.login-card,
:root,
button,
input,
select,
textarea {
  font-family: "Segoe UI Variable", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-card {
  border: 1px solid #d9dedb;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgb(20 30 24 / 8%);
}

.login-card h1 {
  margin: 0 0 28px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.login-card .code {
  margin: 0;
  border: 1px solid #cfd8d2;
  border-radius: 5px;
  background: #f4f7f5;
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

#mobile-tabs {
  display: none;
}

.task-body {
  min-width: 0;
  cursor: text;
}

.task.inline-edit {
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 13px 14px;
  border-color: #9eb9a7;
  box-shadow: 0 6px 22px rgb(20 30 24 / 8%);
}

.inline-edit-form {
  position: relative;
  min-width: 0;
}

.inline-title,
.inline-description {
  border: 0;
  border-radius: 0;
  padding: 2px 0;
  background: transparent;
  box-shadow: none;
}

.inline-title {
  font-size: 15px;
  font-weight: 600;
}

.inline-description {
  min-height: 42px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.inline-fields label {
  min-width: 0;
  margin: 0;
  font-size: 11px;
}

.inline-fields input,
.inline-fields select {
  min-width: 0;
  padding: 7px;
  font-size: 12px;
}

.inline-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.inline-weekdays label {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  font-size: 11px;
}

.inline-weekdays input {
  width: auto;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.inline-actions span {
  flex: 1;
}

.editor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.editor-chip {
  max-width: 240px;
  overflow: hidden;
  padding: 6px 9px;
  border: 1px solid #d9dedb;
  border-radius: 6px;
  background: #fff;
  color: #536158;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-chip:hover,
.editor-chip:focus-visible {
  border-color: #9eb9a7;
  background: #f5f8f6;
  color: var(--green);
}

.editor-popover {
  position: absolute;
  z-index: 12;
  left: 0;
  width: min(390px, 100%);
  margin-top: 7px;
  padding: 10px;
  border: 1px solid #d7ddd9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgb(20 30 24 / 16%);
}

.editor-menu-list {
  max-height: 270px;
  overflow-y: auto;
}

.editor-menu-item {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border-radius: 5px;
  text-align: left;
}

.editor-menu-item:hover {
  background: #f1f5f2;
}

.editor-section-item {
  padding-left: 25px;
  color: var(--muted);
  font-size: 13px;
}

.editor-menu-empty {
  padding: 12px 9px;
  color: var(--muted);
  font-size: 13px;
}

.editor-quick-row,
.editor-choice-row,
.editor-text-row,
.editor-interval {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.editor-text-row,
.editor-interval,
.editor-choice-row + .editor-choice-row {
  margin-top: 9px;
}

.editor-quick-row button,
.editor-choice-row button,
.editor-interval button {
  padding: 6px 9px;
  border: 1px solid #dce2de;
  border-radius: 5px;
  background: #fff;
  color: #56615a;
  font-size: 12px;
}

.editor-choice-row button.selected,
.editor-quick-row button:hover,
.editor-choice-row button:hover,
.editor-interval button:hover {
  border-color: #9eb9a7;
  background: var(--green2);
  color: var(--green);
}

.editor-text-row input {
  width: 128px;
  padding: 7px 8px;
  border: 1px solid #dce2de;
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
}

.editor-text-row input:last-child {
  width: 86px;
}

.calendar-popover {
  width: min(320px, 100%);
  padding: 12px;
}

.calendar-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  margin-bottom: 9px;
}

.calendar-head strong {
  color: #27332c;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  text-transform: capitalize;
}

.calendar-head button {
  width: 32px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  color: #657069;
  font-size: 16px;
}

.calendar-head button:hover {
  background: #f0f4f1;
  color: var(--green);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.calendar-weekdays {
  margin-bottom: 3px;
}

.calendar-weekdays span {
  padding: 3px 0;
  color: #89938d;
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  text-transform: uppercase;
}

.calendar-days button,
.calendar-empty {
  aspect-ratio: 1;
  min-width: 0;
}

.calendar-days button {
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #344139;
  font-size: 12px;
  font-weight: 550;
}

.calendar-days button:hover {
  background: #f0f4f1;
  color: var(--green);
}

.calendar-days button.today {
  border-color: #b8cbbf;
  color: var(--green);
}

.calendar-days button.selected {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.calendar-popover .editor-quick-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf0ee;
}

.calendar-popover .editor-quick-row button {
  flex: 1 1 auto;
}

.editor-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.editor-time-row input {
  width: 88px;
  padding: 7px 8px;
  border: 1px solid #dce2de;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  text-align: center;
}

.editor-time-row input:focus {
  border-color: #9eb9a7;
  outline: none;
  box-shadow: 0 0 0 2px rgb(54 112 72 / 10%);
}

.editor-time-row input[aria-invalid="true"] {
  border-color: #c96a64;
  color: var(--danger);
}

.editor-interval span {
  color: var(--muted);
  font-size: 12px;
}

.editor-interval strong {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
}

.inline-actions {
  padding-top: 10px;
  border-top: 1px solid #edf0ee;
}

.project-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 7px;
}

.project-suggestions button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--green);
  font-size: 12px;
}

.parsed-result span {
  color: #a2aaa5;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.project-card:hover {
  border-color: #b8c9bd;
  box-shadow: 0 4px 15px rgb(20 30 24 / 5%);
}

.project-open {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  text-align: left;
}

.project-card-name {
  overflow: hidden;
  max-width: 100%;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.project-order {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 10px;
  color: var(--muted);
}

.project-order button {
  width: 34px;
  height: 34px;
  border-radius: 5px;
}

.project-order button:hover:not(:disabled) {
  background: var(--green2);
  color: var(--green);
}

.project-order button:disabled {
  cursor: default;
  opacity: .25;
}

.project-order span {
  padding-left: 5px;
  font-size: 24px;
}

.overview-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  margin-bottom: 22px;
}

.overview-search .searchbox {
  margin: 0;
}

.settings-button {
  min-height: 43px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #536158;
  font-size: 13px;
  font-weight: 600;
}

.settings-button:hover {
  border-color: #9eb9a7;
  background: #f5f8f6;
  color: var(--green);
}

.overview-project-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}

.overview-project-head .overview-heading {
  flex: 1;
  margin: 0;
}

.overview-heading {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 650;
}

.setting-button-link {
  width: 100%;
  text-align: left;
}

.settings-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* Stable task cards and compact inline editor. */
.task {
  min-height: 62px;
  margin: 7px 0;
  padding: 12px 13px;
  border-color: #e1e6e2;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgb(20 30 24 / 2%);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.task:hover,
.task:focus-within {
  border-color: #cbd6ce;
  box-shadow: 0 4px 14px rgb(20 30 24 / 6%);
}

.task .check {
  flex: 0 0 auto;
  margin-top: 0;
}

.task-body {
  min-height: 36px;
  padding-top: 1px;
}

.task-title {
  min-height: 21px;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 560;
  line-height: 21px;
}

.task-description {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  font-size: 13px;
  line-height: 18px;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta {
  min-height: 16px;
  margin-top: 5px;
  line-height: 16px;
}

.task-meta span {
  white-space: nowrap;
}

.task-actions {
  display: flex;
  width: 58px;
  min-height: 26px;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 1px;
}

.task-actions button {
  width: 27px;
  height: 27px;
  padding: 0;
  border-radius: 5px;
  line-height: 27px;
  text-align: center;
}

.task-actions button:hover {
  background: #f0f4f1;
  color: var(--green);
}

.task.inline-edit {
  min-height: 0;
  padding: 13px;
  border-color: #9fb8a7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 26px rgb(20 30 24 / 10%);
}

.inline-title {
  min-height: 25px;
  padding: 1px 0 3px;
  font-size: 16px;
  font-weight: 600;
  line-height: 21px;
}

.inline-description {
  min-height: 27px;
  max-height: 160px;
  margin: 2px 0 0;
  padding: 3px 0;
  font-size: 13px;
  line-height: 19px;
}

.inline-title:focus,
.inline-description:focus {
  outline: none;
}

.editor-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  margin-top: 9px;
}

.editor-chip {
  width: 100%;
  max-width: none;
  min-height: 32px;
  padding: 6px 8px;
  text-align: left;
}

.editor-popover {
  top: 0;
  margin-top: 0;
}

.inline-actions {
  min-height: 43px;
  margin-top: 12px;
  padding-top: 10px;
}

.inline-actions button {
  min-height: 32px;
  border-radius: 6px;
}

@media (max-width: 760px) {
  aside #tabs {
    display: none;
  }

  #mobile-tabs {
    position: fixed;
    z-index: 18;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 62px;
    padding: 5px 4px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid #d9dedb;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -5px 20px rgb(20 30 24 / 7%);
    backdrop-filter: blur(12px);
  }

  #mobile-tabs button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 50px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 1px;
    border-radius: 6px;
    color: #68716b;
    font-size: 10px;
    font-weight: 550;
    line-height: 1.1;
  }

  #mobile-tabs button.active {
    background: #eef5f0;
    color: var(--green);
  }

  #mobile-tabs .nav-icon {
    width: auto;
    font-size: 19px;
    line-height: 1;
  }

  #mobile-tabs .nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mobile-tabs .badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 8px);
    min-width: 16px;
    padding: 1px 4px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    font-size: 9px;
  }

  .task.inline-edit {
    padding: 11px 9px;
  }

  .inline-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-actions button {
    padding: 8px;
  }

  .editor-chip {
    max-width: 180px;
  }

  .editor-popover {
    width: 100%;
  }

  .calendar-popover.time-focused {
    position: fixed;
    z-index: 24;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px !important;
    width: auto;
    padding: 12px;
  }

  .calendar-popover.time-focused .editor-calendar,
  .calendar-popover.time-focused .editor-quick-row {
    display: none;
  }

  .calendar-popover.time-focused .editor-time-row {
    margin-top: 0;
  }

  .project-open {
    padding: 13px 12px;
  }

  .project-order {
    padding-right: 5px;
  }

  .project-order button {
    width: 30px;
  }

  .overview-search {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .settings-button {
    padding: 8px;
    font-size: 18px;
  }

  .settings-button span {
    display: none;
  }

  .task {
    min-height: 60px;
    padding: 11px 9px;
  }

  .task-actions {
    width: 54px;
  }

  .editor-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-chip {
    max-width: none;
  }
}

.weekdays { display:flex; gap:8px; border:1px solid var(--line); border-radius:8px; margin:12px 0; padding:8px 12px; }
.weekdays legend { font-size:12px; color:var(--muted); }
.weekdays label { display:flex; align-items:center; gap:3px; margin:0; }
.weekdays input { width:auto; }
