/* ---------- sidebar ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 14px; flex-wrap: wrap; row-gap: 2px; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent));
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark .ico { stroke-width: 2.4; }
.brand-name { font-weight: 650; font-size: var(--fs-md); letter-spacing: -0.01em; }
.brand .user { flex-basis: 100%; padding-left: 34px; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-section { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; color: var(--muted); padding: 18px 10px 4px; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
:lang(en) .side-section { text-transform: uppercase; }
.side-tools { display: flex; gap: 0; opacity: .7; transition: opacity var(--dur-fast) var(--ease); }
.side-section:hover .side-tools, .side-section:hover .icon-btn { opacity: 1; }
.side-item {
  --indent: 0; display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 0 8px 0 calc(9px + var(--indent) * 14px);
  border-radius: 7px; min-height: 30px; color: var(--text-2); font-size: 13.5px; position: relative;
  transition: transform var(--dur-fast) var(--ease);
}
.side-item:hover { background: color-mix(in srgb, var(--text) 5.5%, transparent); color: var(--text); }
.side-item.on { background: var(--sel); color: var(--text); font-weight: 560; }
.side-item.on > .ico:first-child { color: var(--accent-ink); }
.side-item .ico { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.side-item .ico.sub { width: 18px; margin-left: -4px; }
.side-item .ico.twist { border-radius: 5px; transition: transform var(--dur) var(--ease); }
.side-item .ico.twist.open { transform: rotate(90deg); }
.side-item .ico.twist:hover { background: var(--surface-3); color: var(--text); }
.side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item.dim .label { color: var(--muted); }
.focus-dot { color: var(--accent-ink); display: inline-flex; }
.tag-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tag); box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--tag) 20%, transparent); display: inline-block; }
@media (pointer: coarse) { .side-item { min-height: 44px; } }
.side-spacer { flex: 1; min-height: 16px; }
.side-foot { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 0 6px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; color: var(--muted);
  background: var(--surface-2); box-shadow: var(--e-1); transition: transform var(--dur-fast) var(--ease);
}
.lang-toggle:hover { color: var(--text); }
.lang-toggle span.on { color: var(--text); font-weight: 650; }
.lang-toggle .sep { opacity: .4; }
@media (pointer: coarse) { .lang-toggle { height: 44px; padding: 0 16px; } }

/* count badges: quiet numerals; "hot" (overdue) and "warm" (flagged) get a tinted capsule */
.badge {
  font-size: 11.5px; font-weight: 500; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-pill);
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0;
}
.badge.hot { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font-weight: 650; }
.badge.warm { background: color-mix(in srgb, var(--flag) 14%, transparent); color: var(--flag); font-weight: 650; }
.tabbar .badge.hot { background: var(--danger); color: #fff; height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--bar-bg); }
.native-date { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; pointer-events: none; }

/* ---------- banners & strips ---------- */
.focus-banner {
  display: flex; align-items: center; gap: 10px; margin: 0 20px 8px 24px; padding: 7px 8px 7px 12px; border-radius: var(--r-lg);
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; animation: card-in var(--dur-slow) var(--ease-spring) both;
}
.focus-banner b { font-weight: 600; }
.focus-banner .crumbs { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.focus-banner.soft { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.persp-head .focus-banner { background: var(--surface-2); color: var(--text-2); }
.persp-head .focus-banner.soft { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.color-input { width: 30px; height: 26px; padding: 2px; border-radius: 7px; cursor: pointer; }
.strip { display: flex; gap: 6px; padding: 4px 24px 12px; overflow-x: auto; scrollbar-width: none; }
.strip button {
  flex: none; min-width: 62px; padding: 7px 10px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e-1);
  display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted);
  transition: transform var(--dur-fast) var(--ease);
}
.strip button b { font-size: 17px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.strip button:hover { box-shadow: var(--e-2); }
.strip button.on { background: var(--accent); color: color-mix(in srgb, var(--accent-text) 80%, transparent); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.strip button.on b { color: var(--accent-text); }
.strip button.over b { color: var(--danger); }
.strip button.on.over b { color: var(--accent-text); }
.view-opts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.view-opts select { width: auto; height: 32px; padding: 4px 26px 4px 10px; font-size: 13px; background-color: transparent; border-color: var(--line); color: var(--text-2); }
.view-opts select:hover { background-color: var(--surface); }

/* ---------- outline rows ---------- */
.rows { padding: 0 12px; }
.group-h {
  display: flex; align-items: baseline; gap: 8px; padding: 20px 12px 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); letter-spacing: .01em;
  border-bottom: 1px solid var(--line); margin: 0 4px 4px;
}
.group-h .count { color: var(--muted); font-weight: 400; }
.group-h.overdue { color: var(--danger); }
.row {
  --depth: 0; display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px 7px calc(6px + var(--depth) * var(--row-indent));
  border-radius: 9px; position: relative; user-select: none; touch-action: pan-y; min-height: 38px;
  content-visibility: auto; contain-intrinsic-size: auto 40px;
  transition: opacity var(--dur) var(--ease);
}
.row:hover { background: color-mix(in srgb, var(--text) 3.5%, transparent); }
.row.sel { background: var(--sel); }
.row.cursor:not(.sel) { box-shadow: inset 0 0 0 1px var(--sel-line); }
.outline:focus-visible .row.cursor { box-shadow: inset 0 0 0 1px var(--sel-line); }
.row.unmatched { opacity: .5; }
.row .disc {
  width: 18px; height: 22px; flex: none; color: var(--muted); display: flex; align-items: center; justify-content: center; border-radius: 5px;
  transition: transform var(--dur) var(--ease);
}
.row .disc:hover { color: var(--text); }
.row .disc.open { transform: rotate(90deg); }
.row .disc.none { visibility: hidden; }

/* the check control: circle for actions, rounded square for projects; ticks draw with a stroke animation */
.row .check {
  width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--muted) 75%, transparent); flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--accent-text); position: relative;
  transition: transform var(--dur-fast) var(--ease);
}
.row .check:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row .check:active { transform: scale(.88); }
.row .check .tick { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.row .check .tick path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: none; }
.row.kind-project .check { border-radius: 6px; border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.row.kind-folder .check { border: 0; color: var(--muted); width: 20px; height: 20px; margin-top: 1px; }
.row.kind-folder .check:hover { box-shadow: none; color: var(--text); }
.row.st-next .check { border-color: var(--accent); }
.row.st-blocked .check, .row.st-deferred .check { border-style: dashed; }
.row.due-overdue .check { border-color: var(--danger); }
.row.due-today .check { border-color: var(--warn); }
.row.flagged .check { border-color: var(--flag); background: color-mix(in srgb, var(--flag) 12%, transparent); }
.row.st-completed .check, .row.checking .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.row.st-completed .check .tick path, .row.checking .check .tick path { stroke-dashoffset: 0; }
.row.checking .check { animation: check-pop var(--dur-slow) var(--ease-spring); }
.row.st-dropped .check { border-color: var(--muted); color: var(--muted); }
@keyframes check-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.row .body { flex: 1; min-width: 0; padding-top: 1px; }
.row .title { word-break: break-word; min-height: 21px; line-height: 21px; color: var(--text); transition: none; }
.row.kind-project .title, .row.kind-folder .title { font-weight: 600; letter-spacing: -0.005em; }
.row.kind-folder .title { color: var(--text-2); }
.row.st-completed .title, .row.st-dropped .title, .row.checking .title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.row.st-blocked .title, .row.st-deferred .title { color: var(--muted); }
.row .title-input { padding: 0 6px; margin: -1px -7px; height: 23px; border-radius: 6px; background: var(--surface); }
.row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; font-size: var(--fs-meta); color: var(--muted); margin-top: 2px; line-height: 19px; }
.row .meta:empty { display: none; }
.row .meta .st.next { color: var(--accent-ink); font-weight: 500; }
.m-date, .m-ico { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.m-date .ico, .m-ico .ico { opacity: .85; }
.row .meta .due { color: var(--text-2); }
.row .meta .due.overdue { color: var(--danger); font-weight: 600; }
.row .meta .due.today { color: var(--warn); font-weight: 600; }
.row .meta .due.soon { color: var(--soon); font-weight: 500; }
.stalled-badge { color: var(--warn); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: var(--r-pill); background: var(--chip-bg);
  font-size: 11.5px; line-height: 19px; color: var(--text-2); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.chip.held { opacity: .55; text-decoration: line-through; }
.chip .ico { margin-left: -2px; }
.flag-chip { color: var(--flag); }
.pri { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; line-height: 16px; letter-spacing: .02em; }
.pri.p1 { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.pri.p2 { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pri.p3 { background: var(--accent-soft); color: var(--accent-ink); }
.row .actions { display: flex; gap: 0; margin: -4px -4px -4px 0; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.row .actions .icon-btn { width: 28px; height: 28px; }
.row .actions .icon-btn.on { opacity: 1; color: var(--flag); background: transparent; }
.row:hover .actions, .row.sel .actions, .row .actions:focus-within { opacity: 1; }
.row.flagged .actions { opacity: 1; }
.row.flagged .actions .icon-btn:not(.on) { opacity: 0; }
.row.flagged:hover .actions .icon-btn:not(.on), .row.flagged.sel .actions .icon-btn:not(.on) { opacity: 1; }
@media (pointer: coarse) {
  .row { min-height: 48px; padding-top: 11px; padding-bottom: 11px; }
  .row .check { width: 24px; height: 24px; margin-top: 0; }
  .row .check .tick { width: 16px; height: 16px; }
  .row .actions { opacity: 1; margin-right: -8px; }
  .row .actions .icon-btn { width: 44px; height: 44px; color: color-mix(in srgb, var(--muted) 70%, transparent); }
  .row .actions .icon-btn:not(.act-flag.on) { display: none; }  /* tapping a row opens the sheet */
}
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); box-shadow: var(--e-3); border-radius: var(--r-md); padding: 7px 12px; max-width: 320px; font-size: 13px; transform: rotate(-1.2deg); }
.drop-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); pointer-events: none; z-index: 5; border-radius: 2px; box-shadow: 0 0 0 2px var(--accent-soft); }
.row.drop-inside, .side-item.drop-inside { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* empty states */
.empty { text-align: center; color: var(--muted); padding: 72px 24px 40px; display: flex; flex-direction: column; align-items: center; content-visibility: visible; }
.empty .illus { width: 132px; height: 110px; margin-bottom: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: float-in 420ms var(--ease-out) both; }
.empty .illus .il-fill { fill: var(--accent-soft); stroke: none; }
.empty .illus .il-shadow { fill: var(--line); stroke: none; }
.empty .illus .il-soft { opacity: .5; }
.empty-title { margin: 0; font: 400 var(--fs-lg)/1.5 var(--font-display); color: var(--text-2); max-width: 420px; }
.empty-sub { margin: 6px 0 0; font-size: var(--fs-meta); color: var(--muted); }
@keyframes float-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* review */
.page { padding: 0 12px; }
.review-card { margin: 4px 12px 16px; padding: 20px 22px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--e-2); animation: card-in var(--dur-slow) var(--ease-spring) both; }
.review-progress { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.review-title { margin: 10px 0 4px; font: 400 var(--fs-xl)/1.3 var(--font-display); }
.review-note { white-space: pre-wrap; color: var(--text-2); }
.review-card .bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; }
.inline-field input { width: 72px; }

/* ---------- inspector ---------- */
.insp { padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 14px; }
.insp-head { display: flex; align-items: center; gap: 8px; position: relative; }
.insp-head h2 { flex: 1; font-size: var(--fs-sm); margin: 0; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
:lang(en) .insp-head h2 { text-transform: uppercase; }
.sheet-handle { display: none; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.date-field { display: flex; gap: 6px; align-items: center; }
.date-field .date-pick { position: relative; }
.date-rel { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.seg { display: flex; background: var(--surface-2); border-radius: var(--r-md); padding: 2px; gap: 2px; }
.seg button {
  flex: 1; padding: 5px 4px; font-size: 12.5px; min-height: 28px; border-radius: 6px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
  transition: none;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--e-1); }
.flag-toggle.on { background: color-mix(in srgb, var(--flag) 15%, transparent); color: var(--flag); box-shadow: none; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pick button { padding: 3px 11px; border-radius: var(--r-pill); background: var(--chip-bg); font-size: 12.5px; min-height: 26px; color: var(--text-2); display: inline-flex; align-items: center; transition: none; }
.tag-pick button:hover { color: var(--text); background: var(--surface-3); }
.tag-pick button.on { background: var(--accent); color: var(--accent-text); }
.tag-pick button.add { padding: 3px 8px; }
.insp .path { font-size: var(--fs-sm); color: var(--muted); }
.insp .title-edit { font: 500 var(--fs-lg)/1.4 var(--font-display); background: transparent; padding: 4px 6px; margin: 0 -6px; }
.insp .title-edit:hover { background: var(--surface-2); }
.insp .danger-zone { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 767px) {
  .insp { padding-top: 8px; }
  .insp-head { padding-top: 14px; }
  .sheet-handle { display: block; position: absolute; top: 0; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--line-strong); cursor: grab; touch-action: none; }
  .sheet-handle::after { content: ''; position: absolute; inset: -14px -30px; }
  .insp-head h2 { touch-action: none; }
  .field-row { grid-template-columns: 1fr; }
  .tag-pick button, .seg button { min-height: 40px; }
}

/* ---------- dialogs: scale in over a blurred backdrop ---------- */
.overlay, .overlay-leaving {
  position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
}
.overlay { animation: fade-in var(--dur) var(--ease) both; }
.overlay-leaving { animation: fade-out 140ms var(--ease-in) both; pointer-events: none; }
.dialog, .dialog-leaving {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--e-3); width: 100%; max-width: 560px; max-height: 76vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.dialog { animation: dialog-in var(--dur) var(--ease-out) both; }
.dialog-leaving { animation: dialog-out 140ms var(--ease-in) both; }
.dialog.wide, .dialog-leaving.wide { max-width: 780px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: scale(.975); } }
@keyframes fade-out { to { opacity: 0; } }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; flex: 1; }
.dialog-body { padding: 16px 20px; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.dialog.picker .dialog-head, .dialog.qe-dialog .dialog-head { border-bottom: 0; padding-bottom: 4px; }
.dialog.picker .dialog-head h3, .dialog.qe-dialog .dialog-head h3 { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.qe-input { font-size: var(--fs-lg); padding: 12px 14px; height: 48px; }
.qe-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; min-height: 22px; font-size: 12.5px; }
.qe-help { margin-top: 12px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.75; }
.picker-search { display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.picker-input { border: 0 !important; border-radius: 0; padding: 14px 0; font-size: var(--fs-lg); box-shadow: none !important; background: transparent !important; }
.picker-list { overflow-y: auto; max-height: 52vh; padding: 6px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; min-height: 38px; color: var(--text-2); }
.picker-item .pi-ico { color: var(--muted); display: inline-flex; width: 18px; justify-content: center; }
.picker-item .pi-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .pi-on { color: var(--accent-ink); display: inline-flex; }
.picker-item.on { background: var(--sel); color: var(--text); }
.picker-item.on .pi-ico { color: var(--accent-ink); }
.picker-item .sub { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.picker-empty { padding: 16px 12px; color: var(--muted); }
@media (max-width: 767px) {
  .overlay, .overlay-leaving { padding: 0; align-items: stretch; }
  .dialog, .dialog-leaving { max-height: none; height: 100%; border-radius: 0; max-width: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .dialog.qe-dialog { height: auto; margin-top: auto; border-radius: 18px 18px 0 0; animation-name: sheet-up; }
  .picker-item { min-height: 46px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- shortcuts & settings ---------- */
.sc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-table td, .sc-table th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.sc-table th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.sc-table .keys { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sc-table tr.conflict td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.sc-table .rec { outline: 2px solid var(--accent); }
.sc-groups { columns: 2 280px; column-gap: 28px; }
.sc-groups section { break-inside: avoid; margin-bottom: 16px; }
.sc-groups h4 { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.sc-line { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; }
.settings-tabs { display: flex; gap: 2px; padding: 10px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 8px; }
.settings-tabs button { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; transition: none; margin-bottom: -1px; }
.settings-tabs button:hover { color: var(--text); }
.settings-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 560; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-card { border-radius: var(--r-lg); overflow: hidden; text-align: left; box-shadow: var(--e-1); transition: transform var(--dur-fast) var(--ease); }
.theme-card:hover { box-shadow: var(--e-2); transform: translateY(-1px); }
.theme-card.on { box-shadow: 0 0 0 2px var(--accent), var(--e-2); }
.theme-card .pv { height: 68px; display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.theme-card .pv i { display: block; height: 7px; border-radius: 4px; }
.theme-card .nm { padding: 7px 12px; font-size: 12.5px; background: var(--surface); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.set-row select { width: auto; }

/* ---------- toast: springs in ---------- */
.toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); padding: 9px 10px 9px 16px; border-radius: var(--r-lg); font-size: 13px;
  box-shadow: var(--e-3); pointer-events: auto; display: flex; gap: 12px; align-items: center; min-height: 40px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.toast-text { padding-right: 6px; }
.toast button { color: var(--bg); font-weight: 600; padding: 4px 10px; border-radius: 7px; background: color-mix(in srgb, var(--bg) 16%, transparent); }
.toast button:hover { background: color-mix(in srgb, var(--bg) 26%, transparent); }
.toast.err { background: var(--danger); color: #fff; }
@media (max-width: 767px) { .toast-root { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100% - 32px); } .toast { width: 100%; } }

/* ---------- GTD coach: hint / onboarding card ---------- */
.coach-slot { padding: 0 20px 8px 24px; }
.coach-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--r-xl);
  padding: 14px 44px 14px 14px; box-shadow: var(--e-2); max-width: 760px;
}
.coach-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); }
.coach-card.onboarding .coach-ico { background: color-mix(in srgb, var(--flag) 14%, transparent); color: var(--flag); }
.coach-main { flex: 1; min-width: 0; }
.coach-title { font-weight: 600; margin-bottom: 2px; }
.coach-body { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.coach-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.coach-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; }
.linkish { background: none; border: 0; color: var(--muted); font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 2px 4px; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
  .coach-slot { position: fixed; left: 10px; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 32; padding: 0; }
  .coach-card { max-width: none; padding: 12px 40px 12px 12px; box-shadow: var(--e-3); }
  .coach-body { font-size: 13px; }
  .coach-slot:not(.hidden) ~ .outline { padding-bottom: 280px; }
}

/* ---------- GTD guide page ---------- */
.guide { max-width: 860px; margin: 0 auto; padding: 16px 20px 40px; line-height: 1.6; }
.guide-head h1 { margin: 8px 0 2px; font: 300 var(--fs-title)/1.2 var(--font-display); display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.guide-mark { color: var(--accent-ink); display: inline-flex; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.guide-toc .chip { cursor: pointer; padding: 3px 10px; line-height: 20px; border: 1px solid var(--line); }
.guide-sec { padding-top: 18px; scroll-margin-top: 8px; }
.guide-sec h2 { font: 500 var(--fs-xl)/1.3 var(--font-display); margin: 10px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.guide-quote { margin: 8px 0 12px; padding: 12px 16px; background: var(--accent-soft); border-radius: var(--r-lg); }
.guide-quote p { margin: 0; font-size: 17px; font-weight: 600; color: var(--accent-ink); font-family: var(--font-display); }
.guide-quote cite { font-size: 12.5px; color: var(--muted); font-style: normal; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.guide-card { background: var(--surface); box-shadow: var(--e-1); border-radius: var(--r-lg); padding: 10px 14px; }
.guide-card h3 { font-size: 15px; margin: 2px 0 4px; }
.guide-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.guide-steps { display: flex; flex-direction: column; gap: 12px; }
.guide-step { background: var(--surface); box-shadow: var(--e-1); border-radius: var(--r-lg); padding: 12px 16px; scroll-margin-top: 8px; }
.guide-step header { display: flex; gap: 10px; align-items: center; }
.guide-step h3 { margin: 0; font-size: 16px; }
.guide-step header p { margin: 0; font-size: 13px; }
.step-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.guide-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-two h4 { margin: 4px 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.guide-two ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.guide-two ul.pitfalls li::marker { content: '\00D7  '; color: var(--danger); }
.guide-inapp { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13.5px; }
.guide-terms { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.guide-terms .term { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 12px; background: var(--surface); scroll-margin-top: 8px; }
.guide-terms dt { font-weight: 600; }
.guide-terms dd { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.guide .flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { filter: drop-shadow(0 0 3px var(--accent)); } 100% { filter: none; } }
.check-line { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.check-line input { width: auto; margin-top: 4px; }
.guide .bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { text-align: left; background: var(--surface); box-shadow: var(--e-1); border: 1px solid transparent; border-radius: var(--r-lg); padding: 10px 12px; color: var(--text); font: inherit; }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--accent); }
.stat-v { font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-l { font-size: 12.5px; color: var(--muted); }
.stat-s { font-size: 11.5px; color: var(--muted); }
.stat.warn .stat-v { color: var(--warn); }

/* clarify flowchart (pure HTML/CSS) */
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 0; font-size: 13.5px; }
.fnode { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 7px 12px; text-align: center; min-width: 150px; max-width: 260px; }
.fnode.start { background: var(--surface-2); font-weight: 600; }
.fnode.q { border: 2px solid var(--accent); font-weight: 600; border-radius: 18px; }
.fnode.end { border-style: dashed; }
.fnode.do, .fnode.project { border-color: var(--ok); }
.fnode.wait, .fnode.someday { border-color: var(--warn); }
.fnode.trash { border-color: var(--danger); }
.fsub { font-weight: 400; font-size: 12px; color: var(--muted); }
.farrow { position: relative; height: 26px; width: 2px; background: var(--line); margin: 2px 0 6px; }
.farrow::after { content: ''; position: absolute; bottom: -6px; left: -5px; border: 6px solid transparent; border-top-color: var(--line); border-bottom: 0; }
.farrow span { position: absolute; left: 10px; top: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fbranch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; width: 100%; margin-top: 10px; border-top: 2px solid var(--line); padding-top: 12px; }
.fcol { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fcol.yes { gap: 0; }
.flabel { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.fgrid { display: grid; grid-template-columns: auto 64px auto; align-items: center; justify-items: center; }
.fcell { display: flex; justify-content: center; }
.fside { position: relative; width: 60px; height: 2px; background: var(--line); }
.fside::after { content: ''; position: absolute; right: -6px; top: -5px; border: 6px solid transparent; border-left-color: var(--line); border-right: 0; }
.fside span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); }
@media (max-width: 767px) {
  .guide { padding: 10px 12px 40px; }
  .guide-two { grid-template-columns: 1fr; }
  .fbranch { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: auto 34px minmax(0, 1fr); }
  .fnode { min-width: 0; }
  .fside { width: 28px; }
}

/* ---------- guided inbox processing ---------- */
.proc { outline: none; }
.proc-progress { display: flex; flex-direction: column; gap: 4px; }
.proc-bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.proc-bar i { display: block; height: 100%; background: var(--accent); transition: none; }
.proc-title { font-size: 20px; margin: 12px 0 4px; word-break: break-word; }
.proc-note { white-space: pre-wrap; color: var(--muted); margin: 0 0 6px; font-size: 13.5px; }
.proc-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.proc-ask { font-weight: 600; margin: 12px 0 8px; }
.proc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.proc-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 44px; border: 1px solid transparent; box-shadow: var(--e-1); transition: transform var(--dur-fast); border-radius: var(--r-lg); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.proc-btn:hover, .proc-btn:focus-visible, .proc-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.proc-btn span:nth-child(2) { flex: 1; }
.proc-btn .ico { width: 20px; display: inline-flex; justify-content: center; color: var(--muted); }
.proc-btn.d-delete:hover { border-color: var(--danger); }
.proc-dates { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; padding: 10px; background: var(--surface-2); border-radius: var(--r-lg); }
.proc-date { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.proc-date input { width: 160px; }
.proc-dates p { flex-basis: 100%; margin: 0; }
.proc-keys { margin-top: 12px; }
.proc-done { text-align: center; padding: 20px 0; }
.proc-done .illus { width: 120px; height: 100px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.proc-done .illus .il-fill { fill: var(--accent-soft); stroke: none; }
.proc-done .illus .il-shadow { fill: var(--line); stroke: none; }
.proc-title { font-family: var(--font-display); font-weight: 400; }
.preset-list { display: flex; flex-direction: column; gap: 2px; }
.coach-settings .bar { display: flex; gap: 8px; margin-top: 14px; }

/* ---- Phase A.1: times + reminders ---- */
.date-field .time-input { width: 8.75em; flex: 0 0 auto; }
.reminders { display: flex; flex-direction: column; gap: var(--sp-2); }
.rem-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); }
.rem-row .rem-label { flex: 1; min-width: 0; }
.rem-add { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.rem-add select { width: auto; flex: 1 1 7em; min-width: 0; }
.notif-settings .bar, .set-row .bar { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
label.inline { display: inline-flex; gap: var(--sp-1); align-items: center; }

/* ---- Phase A.2: offline / sync status pill ---- */
.net-pill { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + var(--sp-2)); transform: translateX(-50%); z-index: 60;
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-2); border: 1px solid var(--line); box-shadow: var(--e-2); font-size: var(--fs-sm);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.net-pill.off { color: var(--warn); }
.net-pill.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, -8px); }

/* ---- Phase A.3: custom perspectives ---- */
.side-key { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.pe { display: flex; flex-direction: column; gap: var(--sp-3); }
.pe-head { display: flex; gap: var(--sp-2); align-items: center; }
.pe-head .pe-name { flex: 1; font-size: var(--fs-md); }
.pe-head input[type=color] { width: 40px; height: 34px; padding: 2px; border-radius: var(--r-sm); }
.pe-icons { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.pe-icons .on { background: var(--accent-soft); color: var(--accent-ink); }
.pe-group { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-2); background: var(--surface); }
.pe-group[data-depth="1"], .pe-group[data-depth="3"] { background: var(--surface-2); }
.pe-group-head { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.pe-group-head select { width: auto; }
.pe-row { display: flex; gap: var(--sp-2); align-items: flex-start; }
.pe-leaf { display: flex; gap: var(--sp-2); flex-wrap: wrap; flex: 1; align-items: center; }
.pe-leaf > select, .pe-params > select { width: auto; }
.pe-params { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.pe-not { font-size: var(--fs-sm); color: var(--text-2); padding-top: 6px; white-space: nowrap; }
.pe-count { align-self: flex-end; }
.dialog-foot .spacer { flex: 1; }

/* ---- Phase A.4: account security ---- */
.auth-err { color: var(--danger); min-height: 20px; font-size: var(--fs-sm); }
.auth-info { color: var(--ok); font-size: var(--fs-sm); }
.verify-banner { display: flex; align-items: center; gap: var(--sp-2); margin: 0 var(--sp-4) var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md); background: var(--accent-soft); color: var(--text); font-size: var(--fs-sm); }
.verify-banner.hidden { display: none; }
.verify-banner .spacer { flex: 1; }
.account-settings h4 { display: flex; align-items: center; gap: var(--sp-1); margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-base); }
.acc-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.acc-form input { flex: 1 1 12em; min-width: 0; }
.chip.warn { color: var(--warn); }

/* ---- Settings → Data (A.5): export / import / backup ---- */
.data-settings h4 { display: flex; align-items: center; gap: var(--sp-1); margin: var(--sp-5) 0 var(--sp-1); }
.data-settings h4:first-child { margin-top: var(--sp-2); }
.data-settings .bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }
.import-paste { width: 100%; box-sizing: border-box; font: var(--fs-sm)/1.5 var(--font-mono); padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); resize: vertical; margin-top: var(--sp-1); }
.import-preview .import-stats { font-weight: 500; margin: 0 0 var(--sp-3); font-variant-numeric: tabular-nums; }
.import-tree { list-style: none; margin: 0; padding: var(--sp-2); max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.import-tree li { display: flex; align-items: center; gap: var(--sp-2); padding: 2px 0 2px calc(var(--depth, 0) * 18px); font-size: var(--fs-base); color: var(--text); min-width: 0; }
.import-tree li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-tree li .ico { color: var(--muted); flex: none; }
.import-tree li.k-folder, .import-tree li.k-project { font-weight: 500; }
.import-tree li.done span { color: var(--muted); text-decoration: line-through; }
.import-restore { margin-top: var(--sp-3); }
