:root {
  color-scheme: light;
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --ink: #0f1e42;
  --ink-2: rgba(15, 30, 66, .65);
  --ink-3: rgba(15, 30, 66, .4);
  --border: rgba(15, 30, 66, .08);
  --accent: #ff7a1f;
  --accent-2: #e86b1a;
  --danger: #e63946;
  --shadow: 0 -18px 55px rgba(10, 21, 48, .12);
  --bottom-nav-height: 58px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1626;
  --surface: #172033;
  --surface-2: #202a3e;
  --ink: #eef3ff;
  --ink-2: rgba(238, 243, 255, .7);
  --ink-3: rgba(238, 243, 255, .44);
  --border: rgba(238, 243, 255, .09);
  --shadow: 0 -18px 55px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #0f1626;
    --surface: #172033;
    --surface-2: #202a3e;
    --ink: #eef3ff;
    --ink-2: rgba(238, 243, 255, .7);
    --ink-3: rgba(238, 243, 255, .44);
    --border: rgba(238, 243, 255, .09);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
body { overflow-x: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(255, 122, 31, .35); outline-offset: 2px; }

.timeline-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  border-inline: 1px solid var(--border);
  background: var(--bg);
}

.app-content { min-height: 100dvh; background: var(--bg); padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(520px, 100%);
  min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
  transform: translateX(-50%);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  padding: 3px 12px max(3px, env(safe-area-inset-bottom));
  backdrop-filter: blur(18px);
}
.bottom-nav-item {
  display: grid;
  min-width: 0;
  place-content: center;
  justify-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 10px;
  cursor: pointer;
}
.bottom-nav-item svg { width: 20px; height: 20px; fill: currentColor; }
.bottom-nav-item.active { color: var(--accent); }

.boot-state, .empty-state {
  display: grid;
  min-height: 55dvh;
  place-items: center;
  padding: 32px;
  color: var(--ink-2);
  text-align: center;
}

.top-tools {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 20px 6px;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
}
.top-tools-spacer { flex: 1; }
.record-inline-filters { display: grid; gap: 10px; padding: 8px 20px 4px; }
.record-inline-filters .filter-grid { gap: 8px; }

.search-field {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 13px;
}

.icon-button, .circle-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover { background: var(--surface-2); }
.icon-button svg { width: 20px; height: 20px; fill: currentColor; }
.icon-button.active { color: var(--accent); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #12a676; box-shadow: 0 0 0 3px rgba(18,166,118,.12); }
.sync-dot.offline { background: var(--danger); box-shadow: 0 0 0 3px rgba(230,57,70,.12); }

.timeline { padding: 4px 20px 340px; }
.group-title {
  margin: 16px 0 7px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.timeline-end { padding: 12px 0; color: var(--ink-3); font-size: 12px; text-align: center; }
.timeline-load-more { padding: 16px 0; color: var(--ink-3); font-size: 12px; text-align: center; }

.record-swipe-row { position: relative; min-height: 88px; overflow: hidden; margin: 0 0 10px; border-radius: 14px; }
.record-swipe-actions { position: absolute; top: 0; right: 0; display: grid; width: 260px; height: 52px; grid-template-columns: repeat(4, 1fr); overflow: hidden; border-radius: 14px; }
.record-swipe-actions button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; box-sizing: border-box; border: 0; color: white; padding: 6px 3px; cursor: pointer; }
.record-swipe-actions button.delete { background: #c62828; }
.record-swipe-actions button.copy { background: #6b7280; }
.record-swipe-actions button.relate { background: #4a90d9; }
.record-swipe-actions button.ask { background: #7c4dff; }
.record-swipe-actions b { font-size: 18px; }
.record-swipe-actions span { font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; }
.record-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
  transition: transform .2s ease;
  text-align: left;
  cursor: pointer;
}

.record-swipe-row.open .record-card { transform: translateX(-260px); }
.record-card:hover { border-color: rgba(255,122,31,.28); }
.record-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; color: var(--ink-2); font-size: 11px; }
.record-time { font-family: ui-monospace, "Cascadia Mono", monospace; font-variant-numeric: tabular-nums; }
.record-duration { margin-left: auto; color: var(--ink-3); }
.record-description { display: -webkit-box; margin: 0 0 6px; overflow: hidden; color: var(--ink-2); font-size: 15px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.record-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mini-chip, .tag-chip, .choice-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  white-space: nowrap;
}
.mini-chip { padding: 1px 7px; font-size: 11px; }

.fab {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + max(20px, env(safe-area-inset-bottom)));
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 30px rgba(255,122,31,.3);
  transform: translateX(-50%);
  cursor: pointer;
}
.fab svg { width: 28px; height: 28px; fill: currentColor; }

.composer-layer { position: fixed; z-index: 20; inset: 0 0 calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); pointer-events: none; }
.composer-layer.open { pointer-events: auto; }
.composer-scrim { position: absolute; inset: 0; background: rgba(10, 21, 48, .25); }
.composer-card {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 520px;
  max-height: min(76dvh, 690px);
  margin: auto;
  overflow: auto;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
}

.composer-text {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 3px 4px 8px;
  font-size: 15px;
  line-height: 22px;
}
.composer-text::placeholder { color: var(--ink-3); }
.composer-text:focus { outline: 0; }
.markdown-preview { min-height: 54px; padding: 3px 4px 8px; font-size: 15px; line-height: 1.55; }
.markdown-preview p { margin: 0 0 8px; }
.markdown-preview code { border-radius: 4px; background: var(--surface-2); padding: 1px 4px; }

.image-strip { display: flex; gap: 7px; overflow-x: auto; padding: 4px 2px 8px; }
.image-tile { position: relative; flex: 0 0 78px; width: 78px; height: 78px; overflow: hidden; border-radius: 8px; background: var(--surface-2); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-remove { position: absolute; top: 3px; right: 3px; display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 50%; background: rgba(10,21,48,.72); color: white; cursor: pointer; }

.save-row { display: flex; min-width: 0; min-height: 36px; align-items: center; gap: 7px; }
.time-control-scroll { min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.time-control-scroll::-webkit-scrollbar { display: none; }
.time-control {
  display: flex;
  width: max-content;
  height: 24px;
  align-items: center;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.time-control button {
  display: grid;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.time-control button:hover { background: var(--surface-2); }
.time-adjust { width: 25px; }
.time-quick { width: 32px; }
.time-quick.now { color: var(--accent); }
.time-control .time-value {
  width: auto;
  padding-inline: 2px;
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.char-count { flex: 0 0 auto; color: var(--ink-3); font-size: 12px; }
.save-pill { border: 0; border-radius: 999px; background: var(--accent); color: white; padding: 6px 13px; font-size: 13px; font-weight: 800; cursor: pointer; }
.save-pill:disabled { cursor: not-allowed; opacity: .4; }

.picker-row, .utility-row, .recent-tags { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.picker-row { margin-top: 5px; }
.picker-row::-webkit-scrollbar, .utility-row::-webkit-scrollbar, .recent-tags::-webkit-scrollbar { display: none; }
.composer-horizontal-scroll { overflow-y: hidden; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.choice-chip, .tag-chip { flex: 0 0 auto; padding: 4px 9px; font-size: 12px; cursor: pointer; }
.choice-chip.selected, .tag-chip.selected { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.tag-chip.include { border-color: rgba(18,166,118,.3); background: rgba(18,166,118,.1); color: #0b7855; }
.tag-chip.exclude { border-color: rgba(230,57,70,.3); background: rgba(230,57,70,.08); color: var(--danger); text-decoration: line-through; }
.choice-chip.emotion.selected { border-color: rgba(255,122,31,.25); background: #fff0e5; color: var(--accent-2); }
.utility-row { margin-top: 5px; min-height: 32px; }
.utility-row .icon-button { width: 30px; height: 30px; }
.utility-row .icon-button svg { width: 17px; height: 17px; }
.recent-tags { min-width: 0; flex: 1; }

.login-view { display: grid; min-height: 100dvh; align-content: center; padding: 28px; }
.login-mark { width: 46px; height: 46px; border-radius: 14px 14px 14px 3px; background: var(--ink); color: white; display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.login-view h1 { margin: 20px 0 6px; font-size: 28px; }
.login-view > p { margin: 0 0 24px; color: var(--ink-2); line-height: 1.6; }
.login-form { display: grid; gap: 12px; }
.login-form label { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; }
.login-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.login-terms { display: flex !important; align-items: center; grid-template-columns: auto 1fr; gap: 8px !important; line-height: 1.5; }
.login-form .login-terms input { width: 18px; height: 18px; margin: 0; border-radius: 4px; padding: 0; accent-color: var(--accent); }
.login-terms button, .login-mode-actions button { border: 0; background: transparent; color: var(--accent-2); padding: 0; cursor: pointer; }
.login-mode-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; padding-top: 2px; }
.auth-legal-backdrop { position: fixed; inset: 0; z-index: 60; }
.auth-legal-dialog p { white-space: pre-wrap; line-height: 1.75; color: var(--ink-2); }
.login-back-button { border: 0; background: transparent; color: var(--ink-2); padding: 7px; cursor: pointer; }
.login-form input, .modal input, .modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
}
.primary-button { border: 0; border-radius: 9px; background: var(--accent); color: white; padding: 11px 14px; font-weight: 800; cursor: pointer; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; }
.form-success { margin: 0; color: #0b7855; font-size: 13px; }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; align-items: end; background: rgba(10,21,48,.34); }
.modal { width: min(520px, 100%); max-height: 80dvh; margin: 0 auto; overflow: auto; border-radius: 14px 14px 0 0; background: var(--surface); padding: 18px 20px max(20px, env(safe-area-inset-bottom)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal h2 { margin: 0; font-size: 18px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.secondary-button, .danger-button { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); padding: 9px 12px; cursor: pointer; }
.danger-button { color: var(--danger); }
.time-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.filter-grid { display: grid; gap: 12px; }
.filter-preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-date-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }
.filter-date-field { position: relative; display: flex; min-width: 0; min-height: 34px; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 7px 8px; color: var(--ink-3); font-size: 11px; cursor: pointer; }
.filter-date-field span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-date-field input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; cursor: pointer; }
.filter-date-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.filter-pill { flex: 0 0 auto; min-height: 30px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-2); padding: 5px 10px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.filter-pill.selected { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.filter-selector-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-selector { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink-3); padding: 7px 10px; font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.filter-selector.selected { color: var(--ink); }
.filter-picker-sheet { display: grid; gap: 16px; }
.filter-picker-sheet > header { display: flex; align-items: center; }
.filter-picker-sheet > header h2 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 18px; }
.filter-picker-sheet > header button { border: 0; border-radius: 6px; background: transparent; color: var(--accent); padding: 2px 6px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.filter-picker-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.filter-picker-grid .choice-chip { justify-content: center; min-width: 0; padding: 4px 2px; font-size: 10px; }
.detail-note { min-height: 140px; resize: vertical; }
.detail-editor-modal { display: grid; gap: 12px; }
.detail-date-row label { display: grid; gap: 5px; color: var(--ink-3); font-size: 10px; }
.detail-date-row input { border: 1px solid var(--border); border-radius: 9px; background: var(--bg); padding: 8px; color: var(--ink); font: inherit; }
.detail-time-input { width: 92px; min-width: 92px; border: 0; background: transparent; color: var(--ink); padding: 4px 2px; font: inherit; font-size: 12px; font-weight: 800; text-align: center; }
.detail-utility-row { display: flex; }
.detail-utility-row .secondary-button { cursor: pointer; }
.detail-choice-section { display: grid; gap: 7px; }
.detail-choice-section h3 { margin: 0; color: var(--ink-2); font-size: 12px; }
.record-detail-screen { position: relative; overflow: hidden; background: var(--bg); }
.record-detail-toolbar { display: grid; min-height: 58px; grid-template-columns: 40px 1fr 40px 40px 1fr 40px; align-items: center; gap: 4px; padding: max(8px, env(safe-area-inset-top)) 20px 8px; }
.record-detail-toolbar button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; font-size: 28px; cursor: pointer; }
.record-detail-toolbar button:disabled { color: var(--ink-3); opacity: .35; cursor: default; }
.record-detail-toolbar button.danger { color: var(--danger); font-size: 22px; }
.record-detail-scroll { min-height: 0; flex: 1; overflow-y: auto; padding: 0 0 28px; }
.record-detail-note-card { display: grid; gap: 6px; border: 1px solid var(--border); border-radius: 10px 10px 0 0; background: var(--surface); padding: 4px 4px 10px; }
.record-detail-note-card .detail-note { width: 100%; min-height: 120px; max-height: 180px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 10px 8px; font: inherit; font-size: 15px; line-height: 24px; }
.detail-date-time-input { display: flex; min-width: 164px; align-items: center; border-radius: 9px; background: var(--surface-2); padding: 0 4px; }
.detail-date-time-input > input[type="date"] { width: 88px; min-width: 88px; border: 0; background: transparent; color: var(--ink); padding: 4px 0; font: inherit; font-size: 11px; font-weight: 800; }
.record-detail-preview { min-height: 120px; color: var(--ink); padding: 10px 8px; font-size: 15px; line-height: 24px; }
.record-detail-preview p { margin: 0 0 10px; }
.record-detail-save-row { display: flex; min-width: 0; align-items: center; gap: 8px; }
.record-detail-save-row > .time-control-scroll { min-width: 0; flex: 1; }
.record-detail-save-row > span { color: var(--ink-3); font-size: 12px; }
.record-detail-save-row > button { flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); padding: 7px 13px; font-size: 12px; font-weight: 700; cursor: pointer; }
.record-detail-utility-row { display: flex; min-width: 0; align-items: center; gap: 4px; }
.record-detail-utility-row > button, .record-detail-utility-row > label { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.record-detail-utility-row > button.active { color: var(--accent); }
.record-detail-utility-row svg { width: 16px; height: 16px; fill: currentColor; }
.record-detail-utility-row .recent-tags { min-width: 0; flex: 1; }
.location-picker-backdrop { position: fixed; z-index: 75; inset: 0; display: flex; justify-content: center; background: var(--bg); }
.location-picker-screen { display: flex; width: min(520px, 100%); min-width: 0; height: 100dvh; flex-direction: column; background: var(--surface); }
.location-picker-toolbar { display: grid; min-height: calc(56px + env(safe-area-inset-top)); grid-template-columns: 52px minmax(0, 1fr) 64px; align-items: end; border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.location-picker-toolbar h2 { align-self: center; margin: 0; color: var(--ink); font-size: 18px; text-align: center; }
.location-picker-toolbar button { height: 52px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.location-picker-toolbar button:first-child { color: var(--ink); font-size: 32px; font-weight: 400; }
.location-picker-toolbar button:disabled { color: var(--ink-3); cursor: default; }
.location-map { position: relative; height: min(48dvh, 360px); flex: 0 0 min(48dvh, 360px); overflow: hidden; background: #dbe8d2; cursor: crosshair; touch-action: manipulation; }
.location-map-tiles { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.location-map-pin { position: absolute; z-index: 2; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -100%); color: var(--accent); filter: drop-shadow(0 2px 2px rgba(10,21,48,.35)); pointer-events: none; }
.location-map-pin svg { width: 38px; height: 38px; fill: currentColor; }
.location-map-zoom { position: absolute; z-index: 3; top: 12px; right: 12px; display: grid; overflow: hidden; border: 1px solid rgba(10,21,48,.18); border-radius: 10px; background: rgba(255,255,255,.94); }
.location-map-zoom button { width: 38px; height: 38px; border: 0; border-bottom: 1px solid rgba(10,21,48,.12); background: transparent; color: #182034; font-size: 22px; cursor: pointer; }
.location-map-zoom button:last-child { border-bottom: 0; }
.location-map-attribution { position: absolute; z-index: 3; right: 4px; bottom: 3px; background: rgba(255,255,255,.82); color: #334; padding: 2px 4px; font-size: 9px; text-decoration: none; }
.location-picker-body { display: grid; gap: 9px; overflow: auto; padding: 18px 20px max(22px, env(safe-area-inset-bottom)); }
.location-picker-body label { display: grid; gap: 7px; color: var(--ink-2); font-size: 12px; }
.location-picker-body input { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 11px 12px; font: inherit; }
.location-picker-body p { margin: 0; color: var(--ink-3); font: 12px/1.5 ui-monospace, "Cascadia Mono", monospace; }
.location-picker-body .location-picker-message { color: var(--accent-2); font-family: inherit; }
.location-picker-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.record-detail-timestamps { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); margin-top: 4px; padding: 8px 8px 0; color: var(--ink-3); font-size: 10px; }
.record-detail-related { display: grid; gap: 8px; padding: 18px 20px 0; }
.record-detail-related h2 { margin: 0; color: var(--ink); font-size: 16px; }
.record-detail-related > button { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 10px 12px; text-align: left; cursor: pointer; }
.record-detail-related > button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-detail-related > button small { color: var(--ink-3); }
.record-detail-delete-dialog p { margin: 0; color: var(--ink-2); }
.record-detail-delete-dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.record-detail-delete-dialog footer button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 10px; cursor: pointer; }
.record-detail-delete-dialog footer button.danger { color: var(--danger); }

.feature-screen { min-height: calc(100dvh - var(--bottom-nav-height)); background: var(--bg); padding: max(18px, env(safe-area-inset-top)) 20px 28px; }
.screen-header { display: flex; min-height: 60px; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.screen-header h1 { margin: 0; font-size: 25px; line-height: 1.15; letter-spacing: -.03em; }
.screen-header p { margin: 5px 0 0; color: var(--ink-3); font-size: 12px; }
.header-action { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: white; font-size: 22px; cursor: pointer; }
.segment-row { display: flex; gap: 5px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.segment-row::-webkit-scrollbar { display: none; }
.segment { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-2); padding: 6px 10px; font-size: 12px; cursor: pointer; }
.segment.active { border-color: var(--ink); background: var(--ink); color: white; }
.segment-row.compact { justify-content: center; }
.task-head-actions { display: flex; align-items: center; gap: 6px; }
.task-head-actions > button:not(.header-action) { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.task-search { width: 100%; margin: -3px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px 12px; color: var(--ink); }
.task-tools-panel { display: grid; gap: 10px; margin: -4px 0 14px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.task-tool-section { display: grid; gap: 6px; }
.task-tool-section > small { color: var(--ink-3); font-size: 10px; font-weight: 700; }
.task-tools { display: flex; gap: 6px; margin: 0; overflow-x: auto; scrollbar-width: none; }
.task-tools::-webkit-scrollbar { display: none; }
.task-tools button { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 6px 9px; color: var(--ink-2); font-size: 11px; cursor: pointer; }
.task-tools button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.task-tools button.include { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.task-tools button.exclude { border-color: #ef9a9a; background: #ffebee; color: #c62828; }
.task-filter-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; }
.task-filter-date, .task-filter-dates input { min-width: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); padding: 7px 8px; color: var(--ink); font: inherit; }
.task-filter-dates span { color: var(--ink-3); font-size: 11px; }
.task-tool-footer { display: flex; justify-content: space-between; gap: 8px; }
.task-tool-footer button { border: 0; background: transparent; color: var(--accent); padding: 4px 0; font-size: 11px; cursor: pointer; }
.task-tool-footer button:disabled { color: var(--ink-3); cursor: default; }
.task-reminder-note { margin: -4px 0 0; color: var(--ink-3); font-size: 10px; line-height: 1.5; }
.feature-list { display: grid; gap: 8px; }
.task-group { display: grid; gap: 6px; }
.task-group + .task-group { margin-top: 7px; }
.task-group h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 0; padding: 3px 2px; color: var(--ink-2); font-size: 12px; }
.task-group h2 span { color: var(--ink-3); font-size: 10px; font-weight: 500; }
.related-records { margin-top: 5px; }
.task-editor-nav { display: flex; align-items: center; gap: 8px; }
.task-editor-nav h2 { min-width: 74px; text-align: center; }
.task-editor-nav button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 20px; cursor: pointer; }
.task-editor-nav button:disabled { color: var(--ink-3); cursor: default; opacity: .45; }
.related-record-row { display: grid; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 6px; padding: 9px; color: var(--ink); text-align: left; cursor: pointer; }
.related-record-row time { color: var(--ink-3); font-size: 9px; }
.related-record-row span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.list-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.task-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; }
.task-menu-scrim { position: fixed; z-index: 46; inset: 0; border: 0; background: transparent; padding: 0; }
.task-context-menu { position: absolute; z-index: 47; top: 36px; right: 12px; display: grid; min-width: 112px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 30px rgba(15,30,66,.16); }
.task-context-menu button { border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--ink); padding: 10px 14px; font: inherit; text-align: left; cursor: pointer; }
.task-context-menu button:last-child { border-bottom: 0; }
.task-context-menu button.danger { color: #c62828; }
.task-row.completed { opacity: .58; }
.task-row.completed .row-main strong { text-decoration: line-through; }
.check-button { display: grid; flex: 0 0 auto; width: 24px; height: 24px; place-items: center; border: 1.5px solid var(--ink-3); border-radius: 50%; background: transparent; color: white; cursor: pointer; }
.check-button.checked { border-color: var(--accent); background: var(--accent); }
.row-main { display: grid; min-width: 0; flex: 1; gap: 3px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.row-main strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.row-meta, .row-tags { color: var(--ink-3); font-size: 11px; }
.task-inline-actions { display: flex; flex: 0 0 auto; gap: 3px; }
.task-inline-actions button { min-width: 27px; height: 27px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--ink-2); padding: 0 5px; font-size: 10px; cursor: pointer; }
.task-screen { position: relative; padding-top: max(12px, env(safe-area-inset-top)); }
.task-mobile-toolbar { display: flex; min-height: 42px; align-items: center; justify-content: flex-end; gap: 6px; margin-bottom: 12px; }
.task-mobile-toolbar > span { flex: 1; }
.task-mobile-toolbar > button { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); padding: 0; font-size: 21px; line-height: 1; cursor: pointer; }
.task-mobile-toolbar > button.active { background: var(--accent-soft); color: var(--accent); }
.task-mobile-toolbar .task-search { min-width: 0; flex: 1; margin: 0; border-radius: 999px; padding: 9px 13px; }
.task-inline-filters { display: grid; max-height: 360px; gap: 9px; margin-bottom: 10px; overflow-y: auto; }
.task-inline-filters .task-tools { flex-wrap: wrap; overflow: visible; }
.task-list-summary { margin: 2px 0 15px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.task-list { gap: 8px; }
.task-group { gap: 6px; }
.task-group + .task-group { margin-top: 9px; }
.task-completed-section { display: grid; gap: 6px; margin-top: 12px; }
.task-completed-section > h2 { margin: 0 0 2px; color: var(--ink-3); font-size: 13px; font-weight: 700; }
.task-completed-section > h2 span { font-weight: 500; }
.task-group h2 { justify-content: flex-start; gap: 4px; padding: 4px 0; font-size: 12px; }
.task-group h2 span { font-size: 12px; }
.task-row { align-items: center; gap: 12px; border-radius: 14px; padding: 12px 14px; }
.task-leading { display: grid; flex: 0 0 auto; justify-items: center; gap: 4px; }
.task-due-label { border-radius: 6px; color: white; padding: 2px 5px; font-size: 10px; white-space: nowrap; }
.task-due-label.today { background: #1565c0; }
.task-due-label.future { background: #ff9800; }
.task-row-content { display: grid; min-width: 0; flex: 1; gap: 5px; }
.task-row-content .row-main strong { display: -webkit-box; overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-meta-scroll { display: flex; align-items: center; gap: 4px; overflow-x: auto; color: var(--ink-3); font-size: 10px; scrollbar-width: none; }
.task-meta-scroll::-webkit-scrollbar { display: none; }
.task-meta-scroll > * { flex: 0 0 auto; }
.task-quadrant { color: var(--accent); font-size: 12px; font-weight: 700; }
.task-date-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow: hidden; }
.task-date-chip button { min-height: 27px; border: 0; background: transparent; color: var(--ink-2); padding: 0 6px; font-size: 10px; font-weight: 700; cursor: pointer; }
.task-date-chip button + button { color: var(--ink-3); padding-inline: 4px; }
.task-meta-pill { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink-2); padding: 4px 6px; font-weight: 700; }
.task-meta-pill.accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.task-fab { font-size: 38px; font-weight: 300; line-height: 1; }
.task-composer-backdrop { bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
.task-composer-scrim { position: absolute; inset: 0; border: 0; background: transparent; cursor: default; }
.task-composer-card { position: relative; z-index: 1; width: min(520px, 100%); max-height: 62dvh; margin: auto 0 0; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px 10px 0 0; background: var(--surface); padding: 12px; }
.task-choice-backdrop { bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
.task-choice-sheet { position: relative; z-index: 1; display: grid; width: min(520px, 100%); margin-top: auto; gap: 4px; border-radius: 16px 16px 0 0; background: var(--surface); padding: 18px 20px 20px; }
.task-choice-sheet h2 { margin: 0 0 12px; font-size: 18px; }
.task-choice-sheet > button { display: flex; min-height: 44px; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); padding: 10px 14px; text-align: left; cursor: pointer; }
.task-choice-sheet > button span { flex: 1; font-size: 14px; font-weight: 600; }
.task-choice-sheet > button.selected { border-color: var(--accent); background: var(--surface); color: var(--accent); }
.task-composer-form, .task-edit-card { display: grid; gap: 8px; }
.task-title-row { display: flex; align-items: flex-start; gap: 12px; }
.task-title-row > textarea { width: 100%; min-height: 72px; flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 0; font: inherit; font-size: 15px; line-height: 1.6; }
.task-title-row > textarea::placeholder { color: var(--ink-3); }
.task-title-preview { min-height: 72px; flex: 1; color: var(--ink); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.task-form-primary { display: flex; min-width: 0; align-items: center; gap: 5px; }
.task-quadrant-select { width: 34px; height: 34px; flex: 0 0 auto; appearance: none; border: 0; background: transparent; color: var(--accent); padding: 0; text-align: center; font: inherit; font-size: 15px; font-weight: 700; }
.task-quadrant-button { width: 34px; height: 34px; flex: 0 0 auto; border: 0; background: transparent; color: var(--accent); padding: 0; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.task-form-date { min-width: 0; }
.task-native-picker { position: relative; display: grid; min-width: 56px; min-height: 34px; place-items: center; color: var(--ink); padding: 0 5px; font-size: 12px; font-weight: 700; cursor: pointer; }
.task-native-picker input, .task-reminder-field input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.task-send-button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; margin-left: auto; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: white; padding: 0; font-size: 22px; cursor: pointer; }
.task-form-tools { display: flex; align-items: center; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.task-form-tools::-webkit-scrollbar { display: none; }
.task-form-tools > button { width: 28px; height: 28px; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-2); padding: 0; font-size: 18px; cursor: pointer; }
.task-form-tools > .task-recurrence-button { width: auto; min-height: 32px; border: 1px solid var(--border); border-radius: 9px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.task-form-tools > select, .task-reminder-field { min-height: 32px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink-2); padding: 4px 8px; font: inherit; font-size: 12px; font-weight: 700; }
.task-reminder-field { position: relative; display: flex; min-width: 68px; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.task-tag-icon { flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-2); padding: 2px; font-size: 19px; cursor: pointer; }
.task-tag-icon.active { color: var(--accent); }
.task-tag-backdrop { z-index: 48; }
.task-option-backdrop { z-index: 48; }
.task-option-sheet { display: grid; gap: 4px; }
.task-option-sheet h2 { margin: 0 0 12px; color: var(--ink); font-size: 18px; }
.task-option-sheet h3 { margin: 10px 0 4px; color: var(--ink-2); font-size: 12px; }
.task-option-sheet > button { display: flex; min-height: 44px; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); padding: 10px 14px; font: inherit; text-align: left; cursor: pointer; }
.task-option-sheet > button > b { width: 32px; color: var(--ink-2); font-size: 18px; }
.task-option-sheet > button > span { min-width: 0; flex: 1; }
.task-option-sheet > button > i { color: var(--accent); font-style: normal; }
.task-option-sheet > button.selected { border-color: var(--accent); color: var(--accent); }
.task-recurrence-chips, .task-recurrence-interval, .task-weekday-row { display: flex; align-items: center; gap: 8px; }
.task-recurrence-chips button, .task-recurrence-interval button, .task-weekday-row button { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-2); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.task-recurrence-chips button.selected, .task-recurrence-interval button.selected, .task-weekday-row button.selected { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.task-recurrence-interval { flex-wrap: wrap; }
.task-recurrence-interval input { width: 56px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 8px 10px; font: inherit; }
.task-weekday-row button { min-width: 0; flex: 1; padding: 9px 0; }
.task-recurrence-sheet > footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.task-recurrence-sheet > footer button { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); padding: 12px; font: inherit; font-weight: 600; cursor: pointer; }
.task-recurrence-sheet > footer button:last-child { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.task-form-tags { display: flex; max-height: 64px; flex-wrap: wrap; gap: 4px; overflow-y: auto; }
.task-form-tags button { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-3); padding: 3px 10px; font-size: 12px; cursor: pointer; }
.task-form-tags button.selected { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.task-advanced-fields { border-top: 1px solid var(--border); color: var(--ink-3); padding-top: 6px; font-size: 11px; }
.task-advanced-fields summary { cursor: pointer; }
.task-advanced-fields > div, .task-advanced-fields > fieldset { margin-top: 8px; }
.task-edit-screen { display: grid; align-content: start; gap: 12px; }
.task-edit-toolbar { display: grid; grid-template-columns: 36px 1fr 36px 36px 1fr 36px; align-items: center; gap: 6px; margin-bottom: 2px; }
.task-edit-toolbar button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); padding: 0; font-size: 22px; cursor: pointer; }
.task-edit-toolbar button:disabled { opacity: .4; }
.task-edit-card { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); padding: 12px; }
.task-edit-card .task-title-row > .check-button { margin-top: 4px; }
.task-timestamps { margin: 2px 0 0; color: var(--ink-3); font-size: 10px; }
.task-related-section { display: grid; gap: 7px; }
.task-related-section h2 { margin: 6px 0 0; font-size: 16px; }
.inline-empty { width: 100%; padding: 28px 14px; color: var(--ink-3); text-align: center; font-size: 13px; }
.habit-block { margin-bottom: 18px; }
.habit-map { position: relative; width: 100%; aspect-ratio: 1; margin: -8px auto 10px; }
.habit-map svg { width: 100%; height: 100%; }
.habit-ring { fill: none; stroke: #d5c5bd; stroke-width: 7.5; }
.habit-stage { fill: #936454; stroke: rgba(255,255,255,.85); stroke-width: .16; }
.habit-area { fill: #e8ddd7; stroke: var(--surface); stroke-width: .16; }
.habit-area-center { fill: #d8c5bb; }
html[data-theme="dark"] .habit-ring { stroke: var(--surface-2); }
html[data-theme="dark"] .habit-stage { fill: var(--accent-2); }
html[data-theme="dark"] .habit-area { fill: var(--surface-2); }
html[data-theme="dark"] .habit-area-center { fill: var(--surface); }
.habit-stage-label, .habit-area-label, .habit-map-number, .habit-map-title { text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.habit-stage-label { fill: white; font-size: 3.2px; font-weight: 400; }
.habit-area-label { fill: var(--ink); font-size: 3px; }
.habit-map-number, .habit-map-title { fill: var(--ink); font-size: 2.8px; font-weight: 400; }
.habit-map-hit { outline: none; cursor: pointer; }
.habit-map-hit-shape { fill: transparent; pointer-events: all; }
.habit-map-hit-ring { fill: none; stroke: transparent; stroke-width: 7.5; pointer-events: stroke; }
.habit-map-hit:focus .habit-map-hit-shape { stroke: var(--accent); stroke-width: 1; }
.habit-mobile-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.habit-home-action { min-height: 42px; }
.habit-home-action-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: var(--accent); }
.habit-detail-screen { padding: 0 0 28px; }
.habit-detail-toolbar { display: flex; min-height: 56px; align-items: center; gap: 4px; padding: 4px 8px; }
.habit-detail-toolbar button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; font-size: 28px; cursor: pointer; }
.habit-detail-toolbar h1 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 600; }
.habit-detail-content { display: grid; gap: 16px; padding: 16px 20px 20px; }
.habit-detail-summary { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.65; }
.habit-detail-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 14px; }
.habit-detail-card h2 { margin: 0; color: var(--accent); font-size: 16px; }
.habit-detail-card p { margin: 8px 0 0; color: var(--ink); font-size: 14px; line-height: 1.65; }
.review-editor-screen, .review-history-screen, .review-detail-screen { display: flex; min-height: calc(100dvh - var(--bottom-nav-height)); flex-direction: column; padding: 0; }
.review-page-toolbar { display: flex; min-height: 56px; align-items: center; padding: 4px 8px; }
.review-page-toolbar h1 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 20px; font-weight: 600; }
.review-page-toolbar.detail h1 { font-size: 14px; font-weight: 700; }
.review-icon-button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); padding: 0; cursor: pointer; }
.review-icon-button:first-child { color: var(--ink); }
.review-icon-button:disabled { color: var(--ink-3); opacity: .45; cursor: default; }
.review-icon-button svg { width: 24px; height: 24px; fill: currentColor; }
.review-page-toolbar.detail .review-icon-button { width: 36px; height: 36px; }
.review-recent-row { display: flex; gap: 6px; padding: 2px 16px; }
.review-recent-row button { min-width: 0; flex: 1; overflow: hidden; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); padding: 6px 4px; cursor: pointer; }
.review-recent-row time { display: block; overflow: hidden; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.review-editor-form { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.review-editor-card { min-height: 260px; flex: 1; overflow: hidden; margin: 12px 20px; border: 1px solid var(--surface-2); border-radius: 12px; background: var(--surface); }
.review-editor-card textarea { width: 100%; height: 100%; min-height: 260px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 16px; font: inherit; font-size: 16px; line-height: 1.5; }
.review-editor-card textarea::placeholder { color: var(--ink-3); }
.review-markdown { height: 100%; overflow-y: auto; padding: 16px; color: var(--ink); font-size: 16px; line-height: 1.5; }
.review-markdown p { margin: 0 0 12px; }
.review-preview-empty { margin: 0; padding: 16px; color: var(--ink-3); }
.review-timestamps { display: flex; gap: 12px; padding: 0 20px; color: var(--ink-3); font-size: 11px; }
.review-bottom-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.review-format-scroll { display: flex; min-width: 0; flex: 1; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.review-format-scroll::-webkit-scrollbar { display: none; }
.review-format-scroll button { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); padding: 0; cursor: pointer; }
.review-format-icon { width: 20px; height: 20px; fill: currentColor; }
.review-format-scroll button:disabled { color: var(--ink-3); }
.review-send-button { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: white; padding: 0; cursor: pointer; }
.review-send-button:disabled { background: var(--surface-2); color: var(--ink-3); cursor: default; }
.review-send-button svg { width: 20px; height: 20px; fill: currentColor; }
.review-history-toolbar { justify-content: flex-start; }
.review-history-toolbar h1 { flex: 0 1 auto; font-weight: 700; }
.review-history-list { display: grid; gap: 10px; padding: 12px 20px 28px; }
.review-history-card { display: grid; width: 100%; min-height: 108px; align-content: center; gap: 6px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); padding: 12px 16px; text-align: left; cursor: pointer; }
.review-history-card time { color: var(--ink-3); font-size: 12px; }
.review-history-card span { font-size: 14px; font-weight: 500; }
.review-history-empty { display: grid; flex: 1; place-items: center; color: var(--ink-2); }
.review-delete-modal { align-self: center; }
.review-delete-modal h2 { margin: 0; color: var(--ink); font-size: 20px; }
.review-delete-modal p { color: var(--ink-2); }
.thinking-map-screen, .thinking-detail-screen, .thinking-model-list-screen, .thinking-model-detail-screen { display: flex; min-height: calc(100dvh - var(--bottom-nav-height)); flex-direction: column; padding: 0; }
.thinking-toolbar { display: flex; min-height: 56px; align-items: center; gap: 4px; padding: max(4px, env(safe-area-inset-top)) 8px 4px; }
.thinking-toolbar h1 { min-width: 0; margin: 0; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.25; }
.thinking-back-button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.thinking-back-button svg { width: 24px; height: 24px; fill: currentColor; }
.thinking-map-content { display: flex; flex-direction: column; align-items: center; padding: 16px; }
.thinking-map { width: 100%; aspect-ratio: 1; }
.thinking-map-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.thinking-map-question-ring, .thinking-map-stage-segment, .thinking-map-item-segment, .thinking-map-group-segment { fill: none; stroke-width: 96px; stroke-linecap: butt; }
.thinking-map-question-ring { stroke: var(--thinking-question); }
.thinking-map-stage-segment { stroke: var(--thinking-stage); }
.thinking-map-item-segment { stroke: var(--thinking-item); }
.thinking-map-group-segment { stroke: var(--thinking-group); }
.thinking-map-center { fill: var(--thinking-center); stroke: var(--bg); stroke-width: 4px; }
.thinking-map-item-segment, .thinking-map-group-segment { outline: none; cursor: pointer; }
.thinking-map-item-segment:focus-visible, .thinking-map-group-segment:focus-visible { stroke: var(--accent); }
.thinking-map-center-label, .thinking-map-group-label, .thinking-map-item-label, .thinking-map-stage-label, .thinking-map-question-label { fill: white; font-weight: 700; text-anchor: middle; pointer-events: none; }
.thinking-map-center-label { font-size: 34px; }
.thinking-map-group-label, .thinking-map-item-label, .thinking-map-stage-label, .thinking-map-question-label { font-size: 27px; }
.thinking-map-hint { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; text-align: center; }
html[data-theme="dark"] .thinking-map-svg { --thinking-center: #A95F3D !important; --thinking-group: #35685F !important; --thinking-item: #405E7C !important; --thinking-stage: #5D5872 !important; --thinking-question: #26384C !important; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .thinking-map-svg { --thinking-center: #A95F3D !important; --thinking-group: #35685F !important; --thinking-item: #405E7C !important; --thinking-stage: #5D5872 !important; --thinking-question: #26384C !important; }
}
.thinking-detail-content { display: grid; gap: 16px; padding: 20px; }
.thinking-stage-label { margin: 0; color: var(--accent); font-size: 14px; font-weight: 700; }
.thinking-detail-card { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); padding: 20px; }
.thinking-detail-card h2 { margin: 0; color: var(--accent); font-size: 16px; font-weight: 700; }
.thinking-detail-card p { margin: 8px 0 0; color: var(--ink); font-size: 14px; line-height: 1.65; }
.thinking-model-list-content { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.thinking-model-list-hint { margin: 0; color: var(--ink-2); padding: 8px 20px; font-size: 14px; line-height: 1.5; }
.thinking-model-list { display: grid; gap: 10px; padding: 20px; }
.thinking-model-card { display: flex; width: 100%; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 16px; text-align: left; cursor: pointer; }
.thinking-model-card > span { display: grid; min-width: 0; flex: 1; gap: 6px; }
.thinking-model-card strong { font-size: 16px; font-weight: 600; }
.thinking-model-summary { display: -webkit-box; overflow: hidden; color: var(--ink-2); font-size: 12px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.thinking-model-arrow { width: 24px; height: 24px; flex: 0 0 auto; fill: var(--ink-3); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-title h2 { margin: 0; font-size: 15px; }
.section-title button, .section-title > span { border: 0; background: transparent; color: var(--accent); font-size: 11px; cursor: pointer; }
.action-grid { display: grid; gap: 7px; }
.habit-action, .settings-row { display: flex; width: 100%; align-items: center; gap: 11px; border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; }
.habit-action { border-radius: 10px; padding: 11px; }
.habit-action.compact { justify-content: center; gap: 6px; border: 0; background: var(--surface-2); padding: 11px 4px; text-align: center; }
.habit-action.compact .habit-symbol { width: 20px; height: 20px; background: transparent; font-size: 14px; }
.habit-action.compact strong { font-size: 12px; }
.habit-action > span:nth-child(2), .settings-row > span { display: grid; min-width: 0; flex: 1; gap: 3px; }
.habit-action small, .settings-row small { color: var(--ink-3); font-size: 11px; }
.habit-action b, .settings-row b { color: var(--ink-3); font-weight: 400; }
.habit-symbol { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: #fff0e5; color: var(--accent); }
.modal-head-actions { display: flex; align-items: center; gap: 7px; }
.modal-head-actions > button:not(.modal-close, .header-action) { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.chat-modal { display: flex; max-height: min(780px, calc(100dvh - 32px)); flex-direction: column; }
.chat-modal.active-chat { height: min(780px, calc(100dvh - 32px)); }
.chat-role-strip { display: flex; gap: 7px; margin-bottom: 12px; overflow-x: auto; padding-right: 14px; scroll-padding-inline: 14px; scrollbar-width: none; }
.chat-role-strip::-webkit-scrollbar { display: none; }
.chat-role-strip button { display: grid; flex: 0 0 auto; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 9px 11px; color: var(--ink); text-align: left; cursor: pointer; }
.chat-role-strip small { color: var(--ink-3); font-size: 10px; }
.chat-session-row { display: flex; align-items: center; gap: 7px; padding: 9px; }
.chat-session-row > button:first-child { display: grid; min-width: 0; flex: 1; gap: 3px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.chat-session-row span { overflow: hidden; color: var(--ink-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-session-row time { color: var(--ink-3); font-size: 10px; }
.chat-back { border: 0; background: transparent; color: var(--ink); padding: 0 8px 0 0; font-size: 29px; cursor: pointer; }
.chat-role-button { display: grid; min-width: 0; flex: 1; gap: 2px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.chat-role-button small { color: var(--ink-3); font-size: 10px; }
.chat-messages { display: flex; min-height: 230px; flex: 1; flex-direction: column; gap: 9px; overflow-y: auto; padding: 5px 2px 14px; }
.chat-message { max-width: 84%; border-radius: 13px; background: var(--surface-2); padding: 9px 11px; color: var(--ink); }
.chat-message p { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.chat-message small { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: 9px; }
.chat-message.user { align-self: flex-end; background: var(--accent); color: white; }
.chat-message.system { align-self: center; max-width: 94%; border: 1px solid var(--border); background: transparent; color: var(--ink-2); }
.chat-message.loading { color: var(--ink-3); }
.chat-composer { display: flex; align-items: flex-end; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.chat-composer textarea { min-height: 42px; flex: 1; resize: none; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 9px 11px; color: var(--ink); }
.chat-composer button { border: 0; border-radius: 999px; background: var(--accent); padding: 10px 14px; color: white; cursor: pointer; }
.role-row { display: flex; align-items: center; gap: 8px; padding: 9px; }
.role-row > button:first-child { display: grid; min-width: 0; flex: 1; gap: 3px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.role-row span { display: -webkit-box; overflow: hidden; color: var(--ink-3); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.role-row > button:last-child { border: 0; background: transparent; color: var(--accent); cursor: pointer; }

/* Android-parity AI history, chat and role management pages. */
.ai-chat-history-screen, .ai-chat-screen, .ai-role-manage-screen { position: relative; background: var(--bg); }
.ai-page-toolbar { display: grid; min-height: calc(60px + env(safe-area-inset-top)); grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: end; padding: env(safe-area-inset-top) 8px 4px; }
.ai-page-toolbar > button, .ai-page-toolbar > .ai-chat-menu-anchor > button { display: grid; width: 48px; height: 48px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; font-size: 30px; cursor: pointer; }
.ai-page-toolbar h1 { align-self: center; overflow: hidden; margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.ai-session-list, .ai-role-list { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 4px; overflow-y: auto; padding: 0 16px 24px; }
.ai-session-card { display: grid; width: 100%; gap: 3px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); padding: 12px 16px; text-align: left; cursor: pointer; }
.ai-session-card strong { font-size: 15px; font-weight: 600; }
.ai-session-card span { overflow: hidden; color: var(--ink-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-page-empty { display: grid; min-height: 220px; place-items: center; margin: auto; color: var(--ink-3); font-size: 14px; }
.ai-chat-toolbar { position: relative; z-index: 3; }
.ai-chat-menu-anchor { position: relative; display: grid; width: 48px; height: 48px; place-items: center; }
.ai-chat-menu { position: absolute; top: 46px; right: 4px; display: grid; width: 154px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px rgb(0 0 0 / 16%); padding: 6px 0; z-index: 8; }
.ai-chat-menu button { border: 0; background: transparent; color: var(--ink); padding: 11px 16px; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ai-chat-menu button:hover { background: var(--surface-2); }
.ai-chat-menu button.danger { color: var(--accent); }
.ai-selection-toolbar { display: grid; min-height: calc(60px + env(safe-area-inset-top)); grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: end; gap: 2px; padding: env(safe-area-inset-top) 12px 4px; }
.ai-selection-toolbar h1 { align-self: center; margin: 0; color: var(--ink); font-size: 17px; text-align: center; }
.ai-selection-toolbar button { min-height: 44px; border: 0; background: transparent; color: var(--ink); padding: 0 8px; font: inherit; font-size: 14px; cursor: pointer; }
.ai-selection-toolbar button:last-child { color: var(--accent); font-weight: 600; }
.ai-selection-toolbar button:disabled { opacity: .4; cursor: default; }
.ai-chat-error { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); padding: 9px 16px; font-size: 12px; }
.ai-chat-error span { min-width: 0; flex: 1; }
.ai-chat-error button { border: 0; background: transparent; color: var(--danger); padding: 4px; font-weight: 700; cursor: pointer; }
.ai-chat-messages { display: flex; min-height: 0; flex: 1; flex-direction: column; align-items: stretch; gap: 10px; overflow-y: auto; padding: 8px 16px 12px; }
.ai-chat-message { position: relative; display: block; max-width: 84%; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); padding: 8px 12px; font: inherit; text-align: left; cursor: default; }
.ai-chat-message p { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-chat-message.user { align-self: flex-end; background: var(--accent); color: white; }
.ai-chat-message.assistant { align-self: flex-start; }
.ai-chat-message.system { align-self: center; max-width: 94%; border: 1px solid var(--border); background: transparent; color: var(--ink-2); text-align: center; }
.ai-chat-message.selected { outline: 2px solid var(--accent); outline-offset: 2px; cursor: pointer; }
.ai-message-check { position: absolute; top: -7px; left: -7px; display: none; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-size: 12px; }
.ai-chat-message.selected .ai-message-check { display: grid; }
.ai-chat-thinking { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); padding: 8px; font-size: 13px; font-weight: 600; }
.ai-chat-thinking i { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-chat-share-error { margin: 0 16px 6px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); padding: 8px 10px; font-size: 12px; }
.ai-chat-disclaimer { margin: 0; color: var(--ink-3); font-size: 11px; text-align: center; }
.ai-chat-composer { display: flex; align-items: center; gap: 10px; padding: 8px 16px max(16px, env(safe-area-inset-bottom)); }
.ai-chat-composer textarea { min-height: 42px; max-height: 100px; min-width: 0; flex: 1; resize: none; border: 1px solid var(--border); border-radius: 20px; outline: 0; background: var(--surface); color: var(--ink); padding: 10px 16px; font: inherit; font-size: 15px; line-height: 20px; }
.ai-chat-composer button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: white; padding: 0 0 0 2px; font-size: 17px; cursor: pointer; }
.ai-chat-composer button:disabled { background: var(--surface-2); color: var(--ink-3); cursor: default; }
.ai-sheet-backdrop, .ai-dialog-backdrop { position: absolute; inset: 0; display: flex; background: rgb(0 0 0 / 50%); z-index: 20; }
.ai-sheet-backdrop { align-items: flex-end; }
.ai-role-picker-sheet { width: 100%; max-height: 80%; overflow-y: auto; border-radius: 20px 20px 0 0; background: var(--surface); padding: 16px 20px max(20px, env(safe-area-inset-bottom)); }
.ai-role-picker-sheet header { display: flex; align-items: center; margin-bottom: 12px; }
.ai-role-picker-sheet h2 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 18px; }
.ai-role-picker-sheet header button, .ai-manage-roles { border: 0; background: transparent; color: var(--accent); padding: 4px 6px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ai-role-picker-sheet > div { display: grid; gap: 4px; }
.ai-role-picker-sheet > div > button { display: grid; width: 100%; gap: 2px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); padding: 12px 14px; text-align: left; cursor: pointer; }
.ai-role-picker-sheet > div strong { font-size: 15px; }
.ai-role-picker-sheet > div span { overflow: hidden; color: var(--ink-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-manage-roles { display: block; margin: 12px auto 0; }
.ai-role-card { display: flex; align-items: center; gap: 8px; border-radius: 12px; background: var(--surface); padding: 0 10px 0 0; }
.ai-role-card > button:first-child { display: grid; min-width: 0; flex: 1; gap: 2px; border: 0; background: transparent; color: var(--ink); padding: 12px 16px; text-align: left; cursor: pointer; }
.ai-role-card strong { font-size: 15px; font-weight: 600; }
.ai-role-card span { overflow: hidden; color: var(--ink-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-role-card > button.danger { border: 0; border-radius: 6px; background: transparent; color: var(--accent); padding: 6px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-dialog-backdrop { align-items: center; justify-content: center; padding: 20px; }
.ai-role-edit-dialog, .ai-confirm-dialog { width: min(90%, 440px); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 20px; box-shadow: 0 14px 36px rgb(0 0 0 / 22%); }
.ai-role-edit-dialog h2, .ai-confirm-dialog h2 { margin: 0 0 16px; font-size: 16px; }
.ai-role-edit-dialog form { display: grid; gap: 16px; }
.ai-role-edit-dialog input, .ai-role-edit-dialog textarea { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; outline: 0; background: transparent; color: var(--ink); padding: 6px 0; font: inherit; font-size: 14px; }
.ai-role-edit-dialog textarea { height: 160px; resize: none; }
.ai-role-edit-dialog footer, .ai-confirm-dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.ai-role-edit-dialog footer button, .ai-confirm-dialog footer button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.ai-role-edit-dialog footer button[type="submit"], .ai-confirm-dialog footer button.danger { color: var(--accent); }
.ai-role-edit-dialog footer button:disabled { opacity: .4; cursor: default; }
.ai-confirm-dialog p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.custom-label-row { display: grid; width: 100%; grid-template-columns: 30px minmax(60px, auto) 1fr auto; align-items: center; gap: 8px; padding: 10px; color: var(--ink); text-align: left; cursor: pointer; }
.custom-label-row > span { font-size: 18px; text-align: center; }
.custom-label-row > small { overflow: hidden; color: var(--ink-3); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.custom-label-row > b { color: var(--ink-3); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.summary-grid article { display: grid; gap: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 12px; text-align: center; }
.summary-grid strong { font-size: 22px; }
.summary-grid span { color: var(--ink-3); font-size: 10px; }
.insight-action { font-size: 11px; letter-spacing: .04em; }
.stats-anchor-row { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 8px; margin: 0 0 12px; }
.stats-anchor-row > button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 24px; cursor: pointer; }
.stats-anchor-row label { position: relative; display: grid; height: 34px; place-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; }
.stats-anchor-row input { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.count-map-card { padding-bottom: 10px; }
.map-weekdays, .count-map { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.map-weekdays { margin-bottom: 4px; color: var(--ink-3); font-size: 9px; text-align: center; }
.map-day { display: grid; aspect-ratio: 1; min-width: 0; place-items: center; border: 0; border-radius: 5px; background: var(--surface-2); color: var(--ink-3); font-size: 9px; cursor: pointer; }
.map-day.blank { visibility: hidden; }
.map-day.level-1 { background: rgba(255,122,31,.16); color: var(--ink-2); }
.map-day.level-2 { background: rgba(255,122,31,.32); color: var(--ink); }
.map-day.level-3 { background: rgba(255,122,31,.55); color: white; }
.map-day.level-4 { background: var(--accent); color: white; }
.map-day.selected { box-shadow: inset 0 0 0 2px var(--ink); }
.chart-card { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 13px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 24px; align-items: center; gap: 8px; margin: 10px 0; font-size: 11px; }
.bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row i { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.bar-row i b { display: block; width: var(--pct, 0%); height: 100%; border-radius: inherit; background: var(--accent); }
.bar-row > strong { text-align: right; }
.duration-row { display: grid; width: 100%; grid-template-columns: 62px 1fr 58px; align-items: center; gap: 8px; margin: 4px 0; border: 0; border-radius: 7px; background: transparent; padding: 7px 5px; color: var(--ink); font-size: 11px; text-align: left; cursor: pointer; }
.duration-row.selected { background: var(--surface-2); }
.duration-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duration-row i { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.duration-row i b { display: block; width: var(--pct, 0%); height: 100%; border-radius: inherit; background: var(--accent); }
.duration-row strong { text-align: right; font-size: 10px; }
.trend-bars { display: grid; height: 130px; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: end; gap: 5px; }
.trend-bars > div { display: grid; height: 100%; grid-template-rows: 1fr auto; gap: 5px; text-align: center; }
.trend-bars i { display: flex; min-height: 0; align-items: end; justify-content: center; }
.trend-bars b { width: min(18px, 65%); height: var(--pct, 0%); min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--accent); }
.trend-bars span { overflow: hidden; color: var(--ink-3); font-size: 8px; text-overflow: clip; white-space: nowrap; }
.android-stats-screen { padding: max(4px, env(safe-area-inset-top)) 20px 28px; }
.stats-insight-header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; }
.stats-insight-header > p { margin: 0; color: var(--accent); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; white-space: nowrap; }
.stats-insight-header > div { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.stats-insight-header > div > span { color: var(--ink-2); font-size: 11px; }
.stats-ai-pill { border: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); padding: 7px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.stats-content { display: grid; gap: 16px; }
.stats-card, .stats-empty-card { border: 1px solid var(--border); border-radius: 24px; background: var(--surface); padding: 20px; }
.stats-map-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stats-map-header > strong { color: var(--accent); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; white-space: nowrap; }
.stats-month-control, .stats-anchor-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); overflow: hidden; }
.stats-month-control button, .stats-anchor-control button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.stats-month-control button:first-child, .stats-month-control button:last-child { width: 38px; height: 36px; padding: 0; font-size: 24px; }
.stats-month-control button:nth-child(2) { color: var(--ink); padding: 8px 0; font-size: 14px; font-weight: 700; letter-spacing: -.3px; }
.stats-map-weekdays, .stats-count-map { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.stats-map-weekdays { margin-top: 14px; margin-bottom: 6px; color: var(--ink-3); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10px; text-align: center; }
.stats-map-cell { position: relative; display: grid; min-width: 0; height: 40px; align-content: center; place-items: center; gap: 0; overflow: hidden; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink-3); padding: 0; }
button.stats-map-cell { cursor: pointer; }
.stats-map-cell.blank { visibility: hidden; }
.stats-map-cell.has-records { background: var(--surface); }
.stats-map-cell-fill { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; fill: var(--accent); pointer-events: none; }
.stats-map-cell small, .stats-map-cell strong { position: relative; z-index: 1; }
.stats-map-cell small { color: var(--ink-3); font-size: 9px; font-weight: 400; line-height: 10px; }
.stats-map-cell small.holiday-name { max-width: 100%; overflow: hidden; padding-inline: 1px; font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.stats-map-cell strong { color: white; font-size: 12px; font-weight: 800; line-height: 13px; }
.stats-map-cell.selected strong { color: #21407f; }
.stats-rest-badge { position: absolute; z-index: 1; top: 1px; right: 2px; color: var(--ink-3); font-size: 7px; font-style: normal; font-weight: 700; line-height: 8px; }
.stats-scope-row { display: flex; gap: 4px; }
.stats-scope-pill { min-width: 38px; min-height: 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-2); padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.stats-scope-pill.selected { border-color: transparent; background: var(--ink); color: var(--bg); }
.stats-anchor-control { width: 100%; margin-top: 12px; }
.stats-anchor-control button:first-child, .stats-anchor-control button:last-child { width: 42px; height: 42px; flex: 0 0 auto; padding: 0; font-size: 25px; }
.stats-anchor-control button:nth-child(2) { min-width: 0; flex: 1; align-self: stretch; color: var(--ink); font-size: 13px; font-weight: 600; }
.stats-category-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 10px; margin-top: 20px; }
.stats-donut-wrap { position: relative; width: 140px; max-width: 100%; aspect-ratio: 1; justify-self: center; }
.stats-donut { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.stats-donut-track, .stats-donut-segment { fill: none; stroke-width: 22px; }
.stats-donut-track { stroke: color-mix(in srgb, var(--ink) 5%, transparent); }
.stats-donut-segment { stroke: var(--stats-category); stroke-linecap: butt; }
.stats-donut-wrap > div { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.stats-donut-wrap > div strong { color: var(--ink); font-size: 24px; font-weight: 800; letter-spacing: -1px; }
.stats-donut-wrap > div span { margin-top: 2px; color: var(--ink-3); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; }
.stats-category-rows { display: grid; gap: 1px; }
.stats-category-work { --stats-category: #2F5AA5; }
.stats-category-life { --stats-category: #E86B1A; }
.stats-category-study { --stats-category: #6B5BC7; }
.stats-category-sport { --stats-category: #12A676; }
.stats-category-sleep { --stats-category: #5B6B8A; }
.stats-category-default { --stats-category: #FF7A1F; }
.stats-category-row { display: grid; width: 100%; grid-template-columns: minmax(76px, auto) minmax(24px, 1fr) 32px; align-items: center; gap: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); padding: 5px 4px; text-align: left; cursor: pointer; }
.stats-category-row.selected { background: color-mix(in srgb, var(--stats-category) 8%, transparent); }
.stats-category-row > span { display: flex; min-width: 0; align-items: baseline; gap: 2px; white-space: nowrap; }
.stats-category-row b { font-size: 12px; font-weight: 500; }
.stats-category-row small, .stats-category-row em { color: var(--ink-2); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10px; font-style: normal; font-weight: 500; }
.stats-category-row em.up { color: #12a676; }
.stats-category-row em.down { color: #e63946; }
.stats-category-bar { display: block; width: 100%; height: 4px; overflow: visible; }
.stats-category-bar-track { fill: color-mix(in srgb, var(--stats-category) 14%, transparent); }
.stats-category-bar-fill { fill: var(--stats-category); }
.stats-category-row > strong { font-size: 11px; text-align: right; }
.stats-trend { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.stats-trend > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stats-trend h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.stats-trend header span { color: var(--ink-2); font-size: 11px; font-weight: 500; }
.stats-trend-chart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.stats-trend-area { fill: color-mix(in srgb, var(--stats-category) 14%, transparent); }
.stats-trend-line { fill: none; stroke: var(--stats-category); stroke-width: 5px; stroke-linecap: round; stroke-linejoin: round; }
.stats-trend-average { stroke: color-mix(in srgb, var(--stats-category) 40%, transparent); stroke-width: 2px; stroke-dasharray: 8 6; }
.stats-trend-dot-halo { fill: var(--surface); }
.stats-trend-dot { fill: var(--stats-category); }
.stats-trend-value { fill: var(--ink); font-size: 20px; font-weight: 700; text-anchor: middle; }
.stats-trend-label { fill: var(--ink-3); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 18px; text-anchor: middle; }
.stats-empty-card { padding: 24px; }
.stats-empty-card strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.stats-empty-card p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.stats-bottom-spacer { height: 8px; }
.stats-picker-backdrop { align-items: center; }
.stats-picker-dialog { display: grid; width: min(360px, calc(100% - 40px)); max-height: min(82dvh, 720px); gap: 14px; overflow-y: auto; border-radius: 24px; padding: 24px; }
.stats-picker-dialog h2 { margin: 0; color: var(--ink); font-size: 20px; }
.stats-picker-year { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; }
.stats-picker-year button { display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; font-size: 26px; cursor: pointer; }
.stats-picker-year strong { font-size: 16px; font-weight: 500; }
.stats-picker-grid { display: grid; gap: 4px; }
.stats-picker-grid.month { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-picker-grid.week { grid-template-columns: repeat(6, 1fr); }
.stats-picker-grid.year { grid-template-columns: repeat(5, 1fr); }
.stats-picker-option { min-width: 0; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 0 3px; font-size: 13px; cursor: pointer; }
.stats-picker-grid.month .stats-picker-option { height: 36px; border-radius: 999px; }
.stats-picker-option.selected { border-color: transparent; background: var(--accent); color: white; font-weight: 700; }
.stats-date-picker input { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 11px 12px; font: inherit; }
.stats-picker-dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.stats-picker-dialog footer button { border: 0; border-radius: 9px; background: transparent; color: var(--accent); padding: 8px 10px; font-weight: 600; cursor: pointer; }
.muted-copy { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.65; }
.sync-state { border-radius: 999px; background: var(--surface-2); color: var(--ink-3); padding: 5px 8px; font-size: 10px; }
.sync-state.online { background: rgba(18,166,118,.1); color: #0b7855; }
.profile-screen { padding: max(16px, env(safe-area-inset-top)) 20px 0; }
.profile-settings-card { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.profile-setting-row { position: relative; display: grid; width: 100%; min-height: 56px; grid-template-columns: 20px minmax(0, 1fr) auto 20px; align-items: center; column-gap: 8px; border: 0; background: transparent; padding: 14px 16px; text-align: left; cursor: pointer; }
.profile-setting-row + .profile-setting-row::before { position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--border); content: ""; }
.profile-setting-icon { display: grid; width: 18px; height: 18px; place-items: center; color: var(--ink-3); }
.profile-setting-icon svg { width: 18px; height: 18px; overflow: visible; fill: currentColor; }
.profile-goal-icon { color: inherit; font-size: 14px; line-height: 1; }
.profile-setting-row strong { overflow: hidden; color: var(--ink-3); font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.profile-setting-row > span:not(.profile-setting-icon) { max-width: min(245px, 48vw); overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-setting-row > b { color: var(--ink-3); font-size: 25px; font-weight: 300; line-height: 1; text-align: right; }
.profile-summary-card { display: grid; justify-items: center; gap: 8px; margin-top: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 16px 20px; text-align: center; }
.profile-summary-card p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.profile-summary-card small { color: var(--ink-3); font-size: 12px; }
.profile-bottom-spacer { height: 32px; }
.profile-dialog-backdrop { align-items: center; padding: 20px; }
.profile-dialog { display: grid; width: min(420px, 100%); max-height: min(86dvh, 700px); gap: 18px; overflow: auto; border-radius: 24px; background: var(--surface); padding: 24px; box-shadow: 0 18px 48px rgba(10,21,48,.2); }
.profile-dialog h2 { margin: 0; color: var(--ink); font-size: 20px; }
.profile-dialog > footer, .profile-dialog-form > footer { display: flex; justify-content: flex-end; gap: 6px; }
.profile-dialog > footer button, .profile-dialog-form > footer button { border: 0; background: transparent; color: var(--accent); padding: 8px 10px; font-weight: 600; cursor: pointer; }
.pending-confirm-dialog > footer button.danger { color: var(--danger); }
.profile-radio-list { display: grid; gap: 2px; }
.profile-radio-list button { display: flex; min-height: 48px; align-items: center; gap: 12px; border: 0; background: transparent; color: var(--ink); padding: 8px 0; text-align: left; cursor: pointer; }
.profile-radio { position: relative; width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid var(--ink-3); border-radius: 50%; }
.profile-radio.selected { border-color: var(--accent); }
.profile-radio.selected::after { position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); content: ""; }
.profile-dialog-form { display: grid; gap: 12px; }
.profile-dialog-form > label { display: grid; gap: 5px; color: var(--ink-2); font-size: 12px; }
.profile-dialog-form input { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 11px 12px; }
.profile-minute-fields { display: grid; gap: 12px; }
.profile-minute-field { display: grid; grid-template-columns: 1fr 78px auto; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.profile-minute-field em { color: var(--ink-2); font-size: 12px; font-style: normal; }
.profile-minute-field input { min-width: 0; border: 0; background: transparent; padding: 5px; color: var(--ink); text-align: right; }
.profile-minute-field > span { color: var(--ink-2); font-size: 12px; }
.profile-switch-list { display: grid; }
.profile-switch-list button { display: flex; min-height: 52px; align-items: center; justify-content: space-between; border: 0; background: transparent; color: var(--ink); padding: 8px 0; cursor: pointer; }
.profile-switch-list button:disabled { color: var(--ink-3); cursor: default; }
.profile-switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; border-radius: 999px; background: var(--surface-2); transition: background .16s ease; }
.profile-switch b { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px rgba(10,21,48,.22); transition: transform .16s ease; }
.profile-switch.checked { background: var(--accent); }
.profile-switch.checked b { transform: translateX(20px); }
.profile-dialog-links { display: grid; border-top: 1px solid var(--border); padding-top: 8px; }
.profile-dialog-links button { border: 0; background: transparent; color: var(--accent); padding: 10px; cursor: pointer; }
.profile-dialog-links button:disabled { color: var(--ink-3); cursor: default; }
.profile-dialog-hint { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.profile-account-actions { display: grid; }
.profile-account-actions button { border: 0; background: transparent; color: var(--accent); padding: 12px 8px; cursor: pointer; }
.profile-account-actions button.danger { color: var(--danger); }
.profile-fullscreen-backdrop { display: flex; align-items: stretch; justify-content: center; background: var(--bg); }
.profile-fullscreen { display: flex; width: min(520px, 100%); height: 100dvh; flex-direction: column; overflow: hidden; background: var(--surface); }
.profile-toolbar { display: grid; min-height: calc(56px + env(safe-area-inset-top)); grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: end; border-bottom: 1px solid var(--border); padding: env(safe-area-inset-top) 4px 4px; }
.profile-toolbar > button, .profile-toolbar-action { display: grid; width: 48px; height: 48px; place-items: center; border: 0; background: transparent; color: var(--ink); padding: 0; font-size: 32px; cursor: pointer; }
.profile-toolbar .profile-toolbar-action { color: var(--accent); font-size: 22px; }
.profile-toolbar h1 { align-self: center; margin: 0; color: var(--ink); font-size: 18px; }
.memory-editor-form { flex: 1; padding: 12px 16px; }
.memory-editor-form textarea { width: 100%; height: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.6; }
.help-screen iframe { min-height: 0; flex: 1; border: 0; background: var(--surface); }
.help-external-link { padding: 10px 16px max(10px, env(safe-area-inset-bottom)); color: var(--accent); font-size: 12px; text-align: center; text-decoration: none; }
.goal-manager-screen, .goal-detail-screen { position: relative; background: var(--bg); }
.goal-topbar { display: grid; min-height: calc(56px + env(safe-area-inset-top)); grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: end; padding: env(safe-area-inset-top) 4px 4px; }
.goal-topbar > button { display: grid; width: 48px; height: 48px; place-items: center; border: 0; background: transparent; color: var(--ink); padding: 0; font-size: 32px; cursor: pointer; }
.goal-topbar > button.danger { color: var(--danger); }
.goal-topbar > button svg { width: 22px; height: 22px; fill: currentColor; }
.goal-topbar h1 { align-self: center; margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.goal-toolbar { display: grid; gap: 8px; padding: 4px 16px 0; }
.goal-toolbar-actions { display: flex; min-height: 40px; align-items: center; justify-content: flex-end; gap: 6px; }
.goal-toolbar-actions button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); padding: 0; font-size: 18px; cursor: pointer; }
.goal-toolbar-actions svg, .goal-search-row svg { width: 20px; height: 20px; fill: currentColor; }
.goal-count { margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.goal-search-panel { display: grid; width: 100%; gap: 7px; }
.goal-search-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 30px 30px; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 4px 7px; }
.goal-search-row > span { color: var(--ink-3); }
.goal-search-row input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 7px 2px; }
.goal-search-row button { border: 0; background: transparent; color: var(--ink-2); padding: 4px; cursor: pointer; }
.goal-filter-pills, .goal-active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-filter-pills button, .goal-active-filters button { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.goal-filter-pills button.selected, .goal-filter-pills button.include { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.goal-filter-pills button.exclude { border-color: #c62828; background: #c62828; color: white; }
.goal-active-filters { padding: 6px 16px 0; }
.goal-active-filters button { border-color: var(--accent); color: var(--accent); }
.goal-list { display: grid; min-height: 0; flex: 1; align-content: start; gap: 10px; overflow-y: auto; padding: 12px 16px 100px; }
.goal-group { display: grid; gap: 10px; }
.goal-group + .goal-group { margin-top: 6px; }
.goal-group > h2 { margin: 0 2px; color: var(--ink-2); font-size: 13px; }
.goal-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 14px; }
.goal-card.completed { opacity: .6; }
.goal-complete { display: grid; width: 26px; height: 26px; place-items: center; align-self: start; border: 2px solid var(--border); border-radius: 50%; background: transparent; color: white; padding: 0; font-weight: 700; cursor: pointer; }
.goal-complete.checked, .goal-card.completed > .goal-complete { border-color: var(--accent); background: var(--accent); }
.goal-title { min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 2px 0; text-align: left; cursor: pointer; }
.goal-title strong { font-size: 16px; line-height: 1.4; }
.goal-card.completed .goal-title strong { text-decoration: line-through; }
.goal-meta { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 7px; }
.goal-due, .goal-tag { border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; color: var(--ink-2); font-size: 12px; }
.goal-due { border: 0; background: #ff9800; color: white; }
.goal-due.overdue { background: #c62828; }
.goal-due.today, .goal-due.soon { background: var(--accent); }
.goal-values { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.goal-values label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; }
.goal-values input { min-width: 0; border: 0; border-radius: 8px; outline: 0; background: var(--surface-2); color: var(--ink); padding: 8px 10px; font-weight: 700; }
.goal-values label:nth-child(2) input { color: var(--accent); }
.goal-values > b { padding-bottom: 8px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.goal-add-fab { position: absolute; right: 50%; bottom: max(22px, env(safe-area-inset-bottom)); display: grid; width: 58px; height: 58px; place-items: center; transform: translateX(50%); border: 0; border-radius: 50%; background: var(--accent); color: white; padding: 0 0 4px; box-shadow: 0 8px 22px rgba(255,122,31,.35); font-size: 38px; font-weight: 300; cursor: pointer; }
.goal-empty { display: grid; min-height: 180px; place-items: center; color: var(--ink-3); }
.goal-input-backdrop { position: absolute; z-index: 4; inset: 0; display: flex; align-items: flex-end; background: rgba(10,21,48,.28); }
.goal-input-sheet { display: grid; width: 100%; gap: 14px; border-radius: 18px 18px 0 0; background: var(--surface); padding: 16px 16px max(18px, env(safe-area-inset-bottom)); }
.goal-input-sheet textarea { min-height: 100px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; }
.goal-quick-date { display: flex; align-items: center; gap: 4px; }
.goal-quick-date label { position: relative; border: 1px solid var(--border); border-radius: 10px; color: var(--ink-2); padding: 9px 10px; font-size: 12px; }
.goal-quick-date label input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.goal-quick-date > button { border: 0; background: transparent; color: var(--ink-3); padding: 7px 4px; font-weight: 700; cursor: pointer; }
.goal-quick-date .goal-quick-send { display: grid; width: 42px; height: 42px; margin-left: auto; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); font-size: 22px; }
.goal-quick-tags { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.goal-quick-tags button { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--ink-2); padding: 6px 11px; cursor: pointer; }
.goal-quick-tags button.selected { border-color: var(--accent); background: var(--accent); color: white; }
.goal-detail-form { display: grid; min-height: 0; flex: 1; align-content: start; gap: 16px; overflow-y: auto; padding: 8px 16px 28px; }
.goal-detail-card { display: grid; gap: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 14px; }
.goal-detail-title-row { display: flex; align-items: flex-start; gap: 10px; }
.goal-detail-title-row textarea { min-height: 72px; flex: 1; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.6; }
.goal-title-preview { min-height: 72px; flex: 1; color: var(--ink); font-size: 15px; line-height: 1.6; }
.goal-detail-title-row > button:last-child { width: 28px; height: 28px; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-2); padding: 0; cursor: pointer; }
.goal-detail-status { margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.goal-detail-date { position: relative; justify-self: start; border: 1px solid var(--border); border-radius: 10px; color: var(--ink-2); padding: 8px 10px; font-size: 12px; }
.goal-detail-date input { margin-left: 8px; border: 0; background: transparent; color: var(--ink); }
.goal-detail-values { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.goal-detail-values label { display: grid; gap: 5px; color: var(--ink-2); font-size: 12px; }
.goal-detail-values input { min-width: 0; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink); padding: 10px 12px; font-weight: 700; }
.goal-detail-values label:nth-child(2) input { color: var(--accent); }
.goal-detail-values > b { padding-bottom: 10px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.goal-detail-card h2 { margin: 0; color: var(--ink); font-size: 15px; }
.goal-detail-tag-head { display: flex; align-items: center; }
.goal-detail-tag-head h2 { flex: 1; }
.goal-detail-tag-head button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; background: transparent; color: var(--ink-2); padding: 0; font-size: 20px; cursor: pointer; }
.goal-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-detail-tags button { border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--ink-2); padding: 6px 10px; cursor: pointer; }
.goal-detail-tags span { color: var(--ink-3); font-size: 13px; }
.goal-detail-available-tags, .goal-tag-selected, .goal-tag-history { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-detail-available-tags button, .goal-tag-selected button, .goal-tag-history button, .goal-tag-suggestions button { border: 1px solid color-mix(in srgb, var(--border) 30%, transparent); border-radius: 8px; background: var(--surface); color: var(--ink-2); padding: 5px 10px; font-size: 12px; cursor: pointer; }
.goal-tag-backdrop { position: absolute; z-index: 8; inset: 0; display: flex; align-items: flex-end; background: rgba(10,21,48,.28); }
.goal-tag-sheet { display: grid; width: 100%; max-height: 82%; gap: 16px; overflow-y: auto; border-radius: 18px 18px 0 0; background: var(--surface); padding: 18px 20px max(20px, env(safe-area-inset-bottom)); }
.goal-tag-sheet h2 { margin: 0; color: var(--ink); font-size: 18px; }
.goal-tag-sheet h3 { margin: 0; color: var(--ink-2); font-size: 13px; }
.record-detail-ai-sheet > header { display: flex; align-items: center; }
.record-detail-ai-sheet > header h2 { min-width: 0; flex: 1; }
.record-detail-ai-sheet > header button { border: 0; background: transparent; color: var(--accent); padding: 4px 6px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.record-detail-ai-sheet .feature-list > button { display: grid; width: 100%; gap: 2px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); padding: 12px 14px; text-align: left; cursor: pointer; }
.record-detail-ai-sheet .feature-list strong { font-size: 15px; }
.record-detail-ai-sheet .feature-list small { overflow: hidden; color: var(--ink-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.goal-tag-input-row { display: flex; gap: 10px; align-items: center; }
.goal-tag-input-row input { min-width: 0; flex: 1; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: var(--surface); color: var(--ink); padding: 10px 14px; font: inherit; font-size: 14px; }
.goal-tag-input-row button { display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--bg); padding: 0; font-size: 12px; font-weight: 600; cursor: pointer; }
.goal-tag-suggestions { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.goal-tag-suggestions button { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 10px 14px; text-align: left; }
.goal-tag-suggestions button:last-child { border-bottom: 0; }
.goal-tag-done { width: 100%; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); padding: 12px; font-weight: 600; cursor: pointer; }
.record-tag-sheet, .record-tag-manage-sheet { display: grid; gap: 16px; }
.record-tag-sheet > header { display: flex; align-items: center; }
.record-tag-sheet > header h2 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 18px; }
.record-tag-sheet > header button { border: 0; border-radius: 6px; background: transparent; color: var(--accent); padding: 2px 6px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.record-tag-sheet h3, .record-tag-manage-sheet h2 { margin: 0; color: var(--ink); font-size: 18px; }
.record-tag-sheet h3 { color: var(--ink-2); font-size: 13px; }
.record-tag-manage-list { display: grid; max-height: 320px; gap: 8px; overflow-y: auto; }
.record-tag-manage-list > div, .record-tag-manage-add { display: flex; align-items: center; gap: 8px; }
.record-tag-manage-list input, .record-tag-manage-add input { min-width: 0; flex: 1; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: var(--surface); color: var(--ink); padding: 10px 14px; font: inherit; font-size: 14px; }
.record-tag-manage-list > div.highlighted input { border-color: var(--accent); }
.record-tag-manage-list button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); padding: 0; font-size: 18px; cursor: pointer; }
.record-tag-manage-add button { border: 0; background: transparent; color: var(--accent); padding: 8px; font: inherit; font-size: 14px; cursor: pointer; }
.record-task-picker { display: grid; gap: 12px; }
.record-task-picker > header { display: flex; align-items: center; }
.record-task-picker > header h2 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 18px; }
.record-task-picker > header button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: white; padding: 0; font-size: 22px; cursor: pointer; }
.record-task-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 8px 12px; }
.record-task-search span { color: var(--ink-3); }
.record-task-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 2px; font: inherit; font-size: 14px; }
.record-task-picker .feature-list { max-height: 300px; overflow-y: auto; }
.record-task-picker > footer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.record-task-picker > footer button { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink-2); padding: 12px; font: inherit; cursor: pointer; }
.record-task-picker > footer button:last-child { border-color: var(--accent); background: var(--accent); color: white; }
.goal-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 30px; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.goal-history-item > div { display: grid; gap: 2px; }
.goal-history-item strong { color: var(--ink); font-size: 13px; }
.goal-history-item small, .goal-history-item span { color: var(--ink-3); font-size: 11px; }
.goal-history-item button { border: 0; background: transparent; color: var(--danger); padding: 6px; cursor: pointer; }
.goal-option-sheet { display: grid; gap: 14px; }
.goal-option-sheet > div { display: grid; }
.goal-option-sheet > div button { border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--ink); padding: 12px 4px; text-align: left; cursor: pointer; }
.goal-option-sheet > div button.selected { color: var(--accent); font-weight: 700; }
.goal-option-sheet > button { justify-self: end; border: 0; background: transparent; color: var(--accent); padding: 8px; cursor: pointer; }
.ai-model-screen { background: var(--bg); }
.ai-model-form { display: grid; min-height: 0; flex: 1; gap: 24px; overflow-y: auto; padding: 16px 20px 32px; }
.ai-model-form > section { display: grid; gap: 8px; }
.ai-model-form h2 { margin: 0; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.ai-model-form > section > input, .ai-key-field { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 11px 12px; }
.ai-model-form > section > small { margin-top: -2px; color: var(--ink-3); font-size: 11px; line-height: 1.5; }
.ai-provider-list, .ai-format-list { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.ai-provider-row { position: relative; display: flex; min-height: 54px; align-items: center; padding: 0 8px 0 4px; }
.ai-provider-row + .ai-provider-row::before { position: absolute; top: 0; right: 0; left: 40px; height: 1px; background: var(--border); content: ""; }
.ai-provider-row > button { display: grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-3); padding: 0; cursor: pointer; }
.ai-provider-row > button:first-child { display: flex; width: auto; min-width: 0; height: 54px; flex: 1; align-items: center; justify-content: flex-start; gap: 10px; color: var(--ink); text-align: left; }
.ai-provider-row strong { overflow: hidden; font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.ai-key-field { display: flex; padding: 0; }
.ai-key-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 11px 12px; }
.ai-key-field button { width: 44px; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.ai-format-list label { position: relative; display: flex; min-height: 52px; align-items: center; gap: 10px; padding: 0 16px; cursor: pointer; }
.ai-format-list label + label { border-top: 1px solid var(--border); }
.ai-format-list input { position: absolute; opacity: 0; }
.ai-format-list i { position: relative; width: 20px; height: 20px; border: 2px solid var(--ink-3); border-radius: 50%; }
.ai-format-list input:checked + i { border-color: var(--accent); }
.ai-format-list input:checked + i::after { position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); content: ""; }
.ai-format-list span { color: var(--ink); font-size: 14px; }
.ai-model-bottom-spacer { height: 8px; }
.ai-provider-dialog select { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 11px 12px; }
.membership-screen, .admin-users-screen { background: var(--bg); }
.membership-scroll { display: grid; min-height: 0; flex: 1; align-content: start; gap: 10px; overflow-y: auto; padding: 10px 20px 20px; }
.membership-scroll > h2 { margin: 8px 0 0; color: var(--ink); font-size: 17px; }
.membership-status-card { display: grid; gap: 5px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 16px; }
.membership-status-card strong { color: var(--ink); font-size: 18px; }
.membership-status-card span { color: var(--ink-3); font-size: 13px; }
.membership-table { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.membership-table > header, .membership-table > div { display: grid; min-height: 42px; grid-template-columns: minmax(0, 1fr) 58px 58px; align-items: center; padding: 0 14px; }
.membership-table > div { border-top: 1px solid var(--border); }
.membership-table span { color: var(--ink); font-size: 13px; }
.membership-table header span, .membership-table header b { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.membership-table b { color: var(--ink-3); text-align: center; }
.membership-table b.premium, .membership-table header b:last-child { color: var(--accent); font-weight: 700; }
.membership-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.membership-plan { display: grid; gap: 7px; min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 14px; text-align: left; cursor: pointer; }
.membership-plan.selected { border: 2px solid var(--accent); padding: 13px; }
.membership-plan strong { font-size: 14px; }
.membership-plan b { color: var(--accent); font-size: 20px; }
.membership-plan span { color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.membership-plan.selected span { color: var(--accent); }
.membership-terms { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.55; }
.membership-cancel { justify-self: start; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--ink); padding: 8px 12px; cursor: pointer; }
.membership-bottom-actions { display: grid; gap: 3px; background: var(--surface); padding: 14px 20px max(14px, env(safe-area-inset-bottom)); }
.membership-bottom-actions button:first-child { min-height: 42px; border: 0; border-radius: 999px; background: var(--accent); color: white; font-weight: 700; cursor: pointer; }
.membership-bottom-actions button:last-child { border: 0; background: transparent; color: var(--ink-3); padding: 8px; font-size: 12px; cursor: pointer; }
.admin-count { margin: 8px 20px; color: var(--ink-3); font-size: 13px; }
.admin-user-list { display: grid; gap: 10px; overflow-y: auto; padding: 8px 20px 24px; }
.admin-user-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); padding: 14px; text-align: left; cursor: pointer; }
.admin-user-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--ink-3); color: var(--surface); font-size: 9px; }
.admin-user-card > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.admin-user-card strong { overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-card small { color: var(--ink-3); font-size: 11px; }
.admin-user-card > b { color: var(--accent); font-size: 13px; font-weight: 500; }
.admin-loading, .admin-empty { display: grid; min-height: 60dvh; place-items: center; color: var(--ink-3); }
.admin-empty button { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.admin-membership-dialog form > p { margin: 0; color: var(--ink); }
.admin-membership-dialog form > small { color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.admin-membership-dialog .profile-radio-list label { position: relative; display: flex; min-height: 44px; align-items: center; gap: 10px; cursor: pointer; }
.admin-membership-dialog .profile-radio-list input { position: absolute; opacity: 0; }
.backup-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.backup-dialog > header button { border: 0; background: transparent; color: var(--accent); padding: 7px; cursor: pointer; }
.backup-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.backup-action-grid > form, .backup-action-grid > button { display: grid; min-width: 0; gap: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 12px; text-align: center; }
.backup-action-grid > form label { position: relative; display: grid; gap: 6px; cursor: pointer; }
.backup-action-grid > form input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.backup-action-grid > form button { border: 0; background: transparent; color: var(--accent); padding: 3px; font-size: 11px; cursor: pointer; }
.backup-action-grid > button { cursor: pointer; }
.backup-action-grid span { color: var(--accent); font-size: 25px; }
.backup-action-grid strong { font-size: 13px; }
.backup-action-grid small { color: var(--ink-3); font-size: 11px; }
.backup-browser-note { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.backup-source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-source-grid button { display: grid; justify-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-2); padding: 10px; cursor: pointer; }
.backup-source-grid button.selected { border-color: var(--accent); color: var(--accent); }
.backup-source-grid span { font-size: 12px; }
.backup-history-list { display: grid; max-height: 45dvh; overflow-y: auto; }
.backup-history-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.backup-history-row > button:first-child { display: grid; min-width: 0; flex: 1; gap: 3px; border: 0; background: transparent; color: var(--ink); padding: 10px 0; text-align: left; cursor: pointer; }
.backup-history-row small { color: var(--ink-3); font-size: 11px; }
.backup-history-row > button:last-child { border: 0; background: transparent; color: var(--danger); padding: 10px; cursor: pointer; }
.backup-empty { margin: 0; padding: 24px 8px; color: var(--ink-3); font-size: 13px; line-height: 1.6; text-align: center; }
.settings-row { border-width: 0 0 1px; padding: 11px 2px; }
.settings-row:first-of-type { border-top: 1px solid var(--border); }
.settings-row.goal-completed { opacity: .56; }
.settings-row.goal-completed strong { text-decoration: line-through; }
.goal-history { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.modal-close { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 25px; cursor: pointer; }
.editor-form { display: grid; gap: 12px; }
.editor-form label { display: grid; gap: 5px; color: var(--ink-2); font-size: 11px; }
.editor-form input, .editor-form select, .editor-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 10px 11px; }
.editor-form textarea { min-height: 170px; resize: vertical; line-height: 1.6; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.weekday-field { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 0; border: 0; padding: 0; }
.weekday-field legend { grid-column: 1 / -1; margin-bottom: 5px; color: var(--ink-2); font-size: 11px; }
.weekday-field label { display: block; }
.weekday-field input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-field span { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; }
.weekday-field input:checked + span { border-color: var(--accent); background: var(--accent); color: white; }
.sub-screen-header { display: grid; grid-template-columns: 34px 1fr auto; align-items: start; }
.back-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 30px; line-height: 1; cursor: pointer; }
.exercise-screen, .exercise-history-screen { padding-inline: 0; }
.exercise-toolbar { display: grid; min-height: 56px; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; padding: 4px 8px; }
.exercise-toolbar h1 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 600; }
.exercise-toolbar-button { display: grid; width: 48px; height: 48px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.exercise-history-button { grid-column: 3; }
.exercise-toolbar-button svg { width: 24px; height: 24px; fill: currentColor; }
.exercise-table { margin: 10px 12px; border-top: .5px solid var(--ink-3); border-left: .5px solid var(--ink-3); background: var(--surface); }
.exercise-table-header, .exercise-table-row { display: grid; grid-template-columns: 1.35fr .75fr .55fr .75fr; }
.exercise-table-header { min-height: 42px; background: var(--surface-2); }
.exercise-table-header > span, .exercise-table-cell { display: flex; min-width: 0; align-items: center; justify-content: center; border-right: .5px solid var(--ink-3); border-bottom: .5px solid var(--ink-3); }
.exercise-table-header > span { color: var(--ink); font-size: 12px; text-align: center; }
.exercise-table-row { position: relative; min-height: 64px; background: var(--surface); }
.exercise-table-cell input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 6px; font: inherit; font-size: 13px; text-align: center; }
.exercise-name-cell { justify-content: flex-start; }
.exercise-name-cell input { flex: 1; padding-left: 0; text-align: left; }
.exercise-drag-handle { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 0; background: transparent; color: var(--ink-3); padding: 0; touch-action: none; cursor: ns-resize; }
.exercise-drag-handle svg { width: 20px; height: 20px; fill: currentColor; }
.exercise-drag-handle:active { color: var(--accent); }
.exercise-adjust-cell { padding: 2px 0; }
.exercise-vertical-adjuster { display: grid; align-content: center; }
.exercise-vertical-adjuster button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.exercise-vertical-adjuster svg { width: 24px; height: 24px; fill: currentColor; }
.exercise-add-row { display: grid; width: 100%; min-height: 44px; place-items: center; border: 0; border-right: .5px solid var(--ink-3); border-bottom: .5px solid var(--ink-3); background: var(--surface); color: var(--ink); padding: 0; font-size: 24px; cursor: pointer; }
.exercise-row-menu { position: absolute; z-index: 5; top: 34px; left: 34px; display: grid; min-width: 110px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px rgba(10,21,48,.18); }
.exercise-row-menu button { border: 0; background: transparent; color: var(--ink); padding: 10px 14px; text-align: left; cursor: pointer; }
.exercise-row-menu button:hover { background: var(--surface-2); }
.exercise-row-menu button.danger { color: var(--down); }
.exercise-history-list { padding: 0 20px; }
.exercise-history-row { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.exercise-history-row > div { display: grid; gap: 2px; }
.exercise-history-row > div:last-child { justify-items: end; }
.exercise-history-row strong { color: var(--ink); font-size: 16px; font-weight: 600; }
.exercise-history-row time, .exercise-history-row small { color: var(--ink-3); font-size: 12px; }
.exercise-history-row span { color: var(--ink); font-size: 14px; }
.exercise-history-empty { margin: 0; padding: 20px; color: var(--ink-3); }
.exercise-delete-modal { align-self: center; }
.exercise-delete-modal > header h2 { margin: 0; color: var(--ink); font-size: 20px; }
.exercise-delete-modal > p { color: var(--ink-2); line-height: 1.6; }
.history-block { margin-top: 18px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 9px 2px; }
.history-row > span { display: grid; gap: 3px; }
.history-row small { color: var(--ink-3); font-size: 10px; }
.history-row b { color: var(--ink-2); font-size: 11px; }
.assessment-question-screen, .assessment-detail-screen { display: flex; min-height: calc(100dvh - var(--bottom-nav-height)); flex-direction: column; padding: 52px 0 0; }
.assessment-history-screen { display: flex; min-height: calc(100dvh - var(--bottom-nav-height)); flex-direction: column; padding: 0; }
.assessment-toolbar, .assessment-page-toolbar { display: flex; min-height: 48px; align-items: center; gap: 0; padding: 4px 8px; }
.assessment-page-toolbar { min-height: 56px; }
.assessment-detail-screen .assessment-page-toolbar { gap: 8px; padding: 8px 12px; }
.assessment-toolbar h1, .assessment-page-toolbar h1 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; }
.assessment-page-toolbar h1 { flex: 0 1 auto; font-size: 20px; }
.assessment-icon-button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.assessment-icon-button svg { width: 24px; height: 24px; fill: currentColor; }
.assessment-category-badge { border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); padding: 4px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.assessment-progress-row { display: flex; align-items: center; padding: 2px 16px; }
.assessment-segments { display: flex; height: 20px; min-width: 0; flex: 1; align-items: center; gap: 2px; }
.assessment-segments button { height: 6px; min-width: 0; flex: 1; border: 0; border-radius: 1px; background: color-mix(in srgb, var(--accent) 15%, transparent); padding: 0; cursor: pointer; }
.assessment-segments button.answered { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.assessment-segments button.current { background: var(--accent); }
.assessment-percent { padding-left: 8px; color: var(--accent); font-size: 12px; font-weight: 600; }
.assessment-question-content { padding: 0 16px; }
.assessment-question-content > p { margin: 0; color: var(--ink-2); font-size: 12px; }
.assessment-question-content > h2 { margin: 6px 0; color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.6; }
.assessment-options { display: grid; gap: 6px; }
.assessment-options button { min-height: 48px; border: 0; border-radius: 10px; background: var(--surface); color: var(--ink); padding: 8px 12px; font-size: 13px; cursor: pointer; }
.assessment-options button.selected { background: var(--accent); color: white; font-weight: 700; }
.assessment-history-list { display: grid; gap: 10px; padding: 12px 20px 28px; }
.assessment-history-card { display: flex; min-height: 80px; align-items: center; border-radius: 12px; background: var(--surface); padding: 0 12px 0 16px; }
.assessment-history-card > button:first-child { min-width: 0; flex: 1; align-self: stretch; border: 0; background: transparent; color: var(--ink); padding: 8px 0; text-align: left; cursor: pointer; }
.assessment-history-card > button:first-child span { font-size: 13px; font-weight: 500; }
.assessment-delete-button { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); padding: 0; cursor: pointer; }
.assessment-delete-button svg { width: 20px; height: 20px; fill: currentColor; }
.assessment-empty { display: grid; flex: 1; place-items: center; color: var(--ink-2); font-size: 14px; }
.assessment-detail-content { display: grid; padding: 8px 20px 24px; }
.assessment-detail-content > time { color: var(--ink-2); font-size: 13px; }
.assessment-score-card { display: grid; gap: 14px; margin-top: 16px; border-radius: 12px; background: var(--surface); padding: 12px; }
.assessment-score-item { display: grid; gap: 10px; }
.assessment-score-item > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assessment-score-item strong { color: var(--ink); font-size: 13px; font-weight: 500; }
.assessment-score-item span { color: var(--ink-2); font-size: 12px; }
.assessment-score-item > i { height: 8px; overflow: hidden; border-radius: 4px; background: var(--surface-2); }
.assessment-score-item > i > b { display: block; width: var(--pct, 0%); height: 100%; background: var(--accent); }
.assessment-complete-content { display: grid; overflow-y: auto; padding: 24px 20px; text-align: center; }
.assessment-complete-content > h2 { margin: 0 0 16px; color: var(--ink); font-size: 24px; }
.assessment-primary-button { width: 100%; height: 48px; margin-top: 8px; border: 0; border-radius: 12px; background: var(--accent); color: white; font-size: 15px; font-weight: 600; cursor: pointer; }
.assessment-complete-content .assessment-score-card { text-align: left; }
.assessment-dialog { align-self: center; }
.assessment-dialog h2 { margin: 0; color: var(--ink); font-size: 20px; }
.assessment-dialog > p { color: var(--ink-2); line-height: 1.6; }
.assessment-dialog .modal-actions button:last-child { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.pct-0 { --pct: 0%; }
.pct-5 { --pct: 5%; }
.pct-10 { --pct: 10%; }
.pct-15 { --pct: 15%; }
.pct-20 { --pct: 20%; }
.pct-25 { --pct: 25%; }
.pct-30 { --pct: 30%; }
.pct-35 { --pct: 35%; }
.pct-40 { --pct: 40%; }
.pct-45 { --pct: 45%; }
.pct-50 { --pct: 50%; }
.pct-55 { --pct: 55%; }
.pct-60 { --pct: 60%; }
.pct-65 { --pct: 65%; }
.pct-70 { --pct: 70%; }
.pct-75 { --pct: 75%; }
.pct-80 { --pct: 80%; }
.pct-85 { --pct: 85%; }
.pct-90 { --pct: 90%; }
.pct-95 { --pct: 95%; }
.pct-100 { --pct: 100%; }
.wide { width: 100%; }
.knowledge-list { display: grid; gap: 8px; }
.knowledge-card { padding: 0 12px; }
.knowledge-card summary { display: flex; align-items: center; gap: 10px; padding: 13px 0; cursor: pointer; list-style: none; }
.knowledge-card summary::-webkit-details-marker { display: none; }
.knowledge-card summary span { color: var(--accent); font-family: ui-monospace, monospace; font-size: 11px; }
.knowledge-card p { color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.knowledge-card h3 { margin: 14px 0 0; font-size: 11px; }
.security-note { border-radius: 9px; background: var(--surface-2); color: var(--ink-2); padding: 10px 11px; font-size: 11px; line-height: 1.6; }
.switch-field { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.switch-field input { width: auto; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; }
.backup-upload { display: flex; align-items: end; gap: 8px; margin-bottom: 10px; }
.backup-upload label { display: grid; min-width: 0; flex: 1; gap: 5px; color: var(--ink-2); font-size: 11px; }
.backup-upload input { width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); padding: 8px; color: var(--ink); }
.backup-row > span { display: grid; gap: 4px; }
.backup-row small { color: var(--ink-3); font-size: 10px; }
.backup-row > div { display: flex; gap: 5px; }
.backup-row button { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 6px 8px; font-size: 10px; cursor: pointer; }
.backup-row button.danger { color: var(--danger); }
.help-copy { color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.help-copy p { margin: 0 0 14px; }
.task-choice { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); padding: 10px; text-align: left; cursor: pointer; }
.task-choice > span { display: grid; width: 21px; height: 21px; place-items: center; border: 1px solid var(--ink-3); border-radius: 50%; color: white; font-size: 11px; }
.task-choice.selected > span { border-color: var(--accent); background: var(--accent); }
.task-choice small { color: var(--ink-3); font-size: 10px; }
.header-action.small { font-size: 17px; }
.reading-screen, .reading-article-screen { display: flex; min-height: calc(100dvh - var(--bottom-nav-height)); flex-direction: column; padding: 0; }
.reading-toolbar, .reading-article-toolbar { display: flex; min-height: 64px; align-items: center; padding: max(4px, env(safe-area-inset-top)) 8px 4px; }
.reading-toolbar > div { min-width: 0; flex: 1; }
.reading-toolbar h1 { margin: 0; color: var(--ink); font-size: 22px; font-weight: 600; line-height: 1.2; }
.reading-toolbar p { margin: 3px 0 0; color: var(--ink-3); font-size: 11px; }
.reading-icon-button { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.reading-icon-button:disabled { color: var(--ink-3); opacity: .45; cursor: default; }
.reading-icon-button svg { width: 24px; height: 24px; fill: currentColor; }
.reading-source-tabs { display: flex; margin: 4px 16px; border-radius: 12px; background: var(--surface-2); padding: 3px; }
.reading-source-tabs button { min-height: 34px; flex: 1; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); padding: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.reading-source-tabs button.selected { background: var(--accent); color: white; cursor: default; }
.reading-list { display: grid; gap: 10px; padding: 8px 16px 24px; }
.reading-card { display: flex; width: 100%; align-items: flex-start; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: inherit; padding: 16px 14px 16px 12px; text-align: left; cursor: pointer; }
.reading-card-accent { width: 3px; height: 40px; flex: 0 0 auto; margin-right: 12px; border-radius: 2px; background: var(--accent); }
.reading-card-content { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.reading-card strong { color: var(--ink); font-size: 16px; font-weight: 600; line-height: 23px; }
.reading-card time { margin-top: 5px; color: var(--ink-3); font-size: 11px; }
.reading-card p { display: -webkit-box; overflow: hidden; margin: 9px 0 0; color: var(--ink-2); font-size: 14px; line-height: 21px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.reading-open-link { display: flex; align-items: center; gap: 4px; margin-top: 9px; color: var(--accent); font-size: 12px; }
.reading-open-link svg { width: 13px; height: 13px; fill: currentColor; }
.reading-state { display: flex; min-height: 48dvh; flex: 1; align-items: center; justify-content: center; flex-direction: column; color: var(--ink-2); padding: 32px; text-align: center; }
.reading-state > p { margin: 12px 0 0; font-size: 13px; }
.reading-spinner { width: 36px; height: 36px; border: 2px solid color-mix(in srgb, var(--accent) 20%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: reading-spin .8s linear infinite; }
@keyframes reading-spin { to { transform: rotate(360deg); } }
.reading-error h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; }
.reading-error > p { margin-top: 6px; }
.reading-error > button { margin-top: 16px; border: 0; border-radius: 999px; background: var(--accent); color: white; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.reading-empty { font-size: 16px; }
.reading-article-toolbar { position: relative; z-index: 3; min-height: 56px; padding-top: max(4px, env(safe-area-inset-top)); }
.reading-article-toolbar h1 { min-width: 0; flex: 1; overflow: hidden; margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.reading-article-actions { position: relative; }
.reading-actions-menu { position: absolute; z-index: 5; top: 44px; right: 4px; width: 190px; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); box-shadow: 0 6px 20px rgba(10,21,48,.18); padding: 6px 0; }
.reading-actions-menu button { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 14px; border: 0; background: transparent; color: var(--ink-2); padding: 0 16px; font-size: 20px; text-align: left; cursor: pointer; }
.reading-actions-menu button:hover { background: var(--surface-2); }
.reading-actions-menu span { color: var(--ink); font-size: 14px; }
.reading-document { max-width: 720px; margin: 0 auto; background: var(--bg); color: var(--ink); padding: 20px 18px 40px; font-family: sans-serif; font-size: 16px; line-height: 1.78; overflow-wrap: anywhere; }
.reading-document a { color: var(--accent); text-decoration: none; }
.reading-disabled-link { color: var(--accent); }
.reading-document img, .reading-document video { display: block; max-width: 100%; height: auto; margin: 16px auto; border-radius: 12px; }
.reading-document h1, .reading-document h2, .reading-document h3 { margin: 24px 0 12px; color: var(--ink); line-height: 1.42; }
.reading-document h2 { font-size: 22px; }
.reading-document h3 { font-size: 18px; }
.reading-document p { margin: 0 0 16px; white-space: pre-wrap; }
.reading-document .dt-source { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.reading-document .dt-source-left { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.reading-document .dt-avatar { width: 32px; height: 32px; margin: 0; border-radius: 50%; }
.reading-document .dt-source-name { font-weight: 700; }
.reading-document .dt-handle, .reading-document .dt-meta { color: var(--ink-3); font-size: 13px; }
.reading-document .dt-source-right, .reading-document .dt-export-button, .reading-document .timeline-star, .reading-document .dt-selected-badge, .reading-document .timeline-score { display: none !important; }
.reading-document .dt-readtop { display: inline-flex; align-items: center; gap: 6px; margin: 18px 0; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 10px 13px; font-weight: 650; }
.reading-document .dt-reason, .reading-document .dt-summary { margin: 14px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 15px; }
.reading-document .dt-reason-label, .reading-document .dt-summary-label { display: block; margin-bottom: 6px; color: var(--accent); font-size: 13px; font-weight: 700; }
.reading-document .dt-reason-text, .reading-document .dt-summary-text { margin: 0; }
.reading-document .dt-article { margin-top: 22px; }
.reading-document blockquote { margin: 18px 0; border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; }
.reading-document pre { overflow-x: auto; border-radius: 10px; background: var(--surface-2); padding: 14px; }
.writing-screen, .topics-screen, .topic-config-screen { display: flex; min-height: calc(100dvh - var(--bottom-nav-height)); flex-direction: column; padding: 0; }
.writing-toolbar { display: flex; min-height: 64px; align-items: center; padding: max(4px, env(safe-area-inset-top)) 8px 4px; }
.writing-toolbar h1 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 22px; font-weight: 600; line-height: 1.2; }
.writing-icon-button { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; cursor: pointer; }
.writing-icon-button.save { color: var(--accent); }
.writing-icon-button:disabled { color: var(--ink-3); opacity: .5; cursor: default; }
.writing-icon-button svg { width: 24px; height: 24px; fill: currentColor; }
.writing-toolbar-spacer { width: 48px; }
.writing-entry-list { display: grid; gap: 16px; padding: 16px 20px; }
.writing-entry { display: flex; width: 100%; min-height: 81px; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 16px; text-align: left; cursor: pointer; }
.writing-entry > svg:first-child { width: 24px; height: 24px; flex: 0 0 auto; fill: var(--accent); }
.writing-entry > svg:last-child { width: 24px; height: 24px; flex: 0 0 auto; fill: var(--ink-3); }
.writing-entry > span { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.writing-entry strong { color: var(--ink); font-size: 16px; font-weight: 600; }
.writing-entry small { color: var(--ink-2); font-size: 13px; line-height: 19px; }
.topic-toolbar > div { min-width: 0; flex: 1; }
.topic-toolbar > div h1 { font-size: 22px; }
.topic-toolbar > div p { overflow: hidden; margin: 3px 0 0; color: var(--ink-3); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topic-list-content { display: grid; gap: 10px; padding: 8px 16px 24px; }
.topic-list-content > h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; }
.topic-list-content > h2.topic-alternative-title { margin-top: 10px; }
.writing-topic-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 16px; }
.topic-title-row { display: flex; align-items: flex-start; gap: 12px; }
.topic-title { min-width: 0; flex: 1; margin: 0; border: 0; background: transparent; color: var(--accent); padding: 0; font-size: 16px; font-weight: 700; line-height: 23px; text-align: left; cursor: pointer; }
.topic-title.disabled { color: var(--ink); cursor: default; }
.topic-score { flex: 0 0 auto; border-radius: 999px; background: var(--surface-2); color: var(--accent); padding: 4px 9px; font-size: 13px; font-weight: 700; }
.writing-topic-card p { margin: 0; }
.topic-summary { margin-top: 9px !important; color: var(--ink-2); font-size: 14px; line-height: 21px; }
.topic-reason { margin-top: 10px !important; color: var(--ink); font-size: 13px; line-height: 19px; }
.topic-angle { margin-top: 6px !important; color: var(--ink-2); font-size: 13px; line-height: 19px; }
.topic-dimensions { margin-top: 10px !important; color: var(--ink-3); font-size: 11px; line-height: 17px; }
.topic-sources { margin-top: 6px !important; color: var(--ink-3); font-size: 11px; line-height: 17px; }
.topic-state { display: flex; min-height: 52dvh; flex: 1; align-items: center; justify-content: center; flex-direction: column; color: var(--ink-2); padding: 32px; text-align: center; }
.topic-spinner { display: block; width: 40px; height: 40px; border: 3px solid color-mix(in srgb, var(--accent) 18%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: reading-spin .8s linear infinite; }
.topic-spinner.small { width: 24px; height: 24px; border-width: 2px; }
.topic-error p { margin: 0; }
.topic-error button { margin-top: 12px; border: 0; border-radius: 999px; background: var(--accent); color: white; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.topic-config-content { display: grid; gap: 18px; padding: 16px 16px 28px; }
.topic-config-intro { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 20px; }
.topic-config-card { display: grid; gap: 8px; border-radius: 16px; background: var(--surface); padding: 16px; }
.topic-config-card h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; }
.topic-config-card p { margin: 0; color: var(--ink); font-size: 14px; }
.topic-config-card > small { color: var(--ink-3); font-size: 12px; line-height: 18px; }
.topic-config-card input[type="range"] { width: 100%; accent-color: var(--accent); }
.topic-source-list { display: grid; gap: 4px; }
.topic-source-row { display: flex; min-height: 74px; align-items: center; gap: 4px; }
.topic-source-row > div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.topic-source-row strong { color: var(--ink); font-size: 14px; font-weight: 500; }
.topic-source-row small { overflow: hidden; color: var(--ink-2); font-size: 12px; line-height: 18px; text-overflow: ellipsis; }
.topic-source-row em { color: var(--ink-3); font-size: 11px; font-style: normal; }
.topic-source-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.topic-source-icon.danger { color: var(--danger); }
.topic-source-switch { position: relative; width: 52px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--surface-2); padding: 0; cursor: pointer; }
.topic-source-switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(10,21,48,.25); transition: transform .16s ease; }
.topic-source-switch.on { background: var(--accent); }
.topic-source-switch.on span { transform: translateX(20px); }
.topic-source-add { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; }
.topic-weight-list { display: grid; gap: 6px; }
.topic-weight-list label { display: grid; grid-template-columns: 1fr auto; align-items: center; color: var(--ink); font-size: 14px; }
.topic-weight-list output { color: var(--accent); }
.topic-weight-list input { grid-column: 1 / -1; }
.topic-config-message { margin: 0; color: var(--ink-3); font-size: 14px; }
.topic-config-message.saved { color: var(--accent); }
.topic-source-backdrop { align-items: center; padding: 24px 36px; }
.topic-source-editor { width: min(360px, 100%); max-height: calc(100dvh - 48px); border-radius: 28px; padding: 24px; }
.topic-source-editor form { display: grid; gap: 12px; }
.topic-source-editor h2 { margin: 0 0 4px; font-size: 20px; }
.topic-source-editor form > label { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; }
.topic-source-editor input[type="text"], .topic-source-editor input:not([type]), .topic-source-editor textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 11px 12px; font-size: 14px; }
.topic-source-types { display: flex; gap: 8px; }
.topic-source-types label { border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; color: var(--ink-2); font-size: 13px; }
.topic-source-types input { accent-color: var(--accent); }
.topic-source-editor small { color: var(--ink-3); font-size: 11px; }
.topic-source-error { margin: 0; color: var(--accent); font-size: 13px; }
.topic-source-actions { display: flex; justify-content: flex-end; gap: 8px; }
.topic-source-actions button { border: 0; background: transparent; color: var(--accent); padding: 10px 12px; font-weight: 600; cursor: pointer; }
.insight-picker { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.lens-list { display: grid; gap: 7px; }
.lens-row { display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.lens-row.selected { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.lens-row > button { border: 0; background: transparent; padding: 10px; color: var(--ink); text-align: left; cursor: pointer; }
.lens-row > button:first-child { display: grid; gap: 4px; }
.lens-row small { display: -webkit-box; overflow: hidden; color: var(--ink-3); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lens-row > button:last-child { color: var(--accent); font-size: 10px; }
.insight-history { margin-top: 20px; }
.insight-history-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; padding: 11px; color: var(--ink); text-align: left; cursor: pointer; }
.insight-history-row > span { display: grid; gap: 4px; }
.insight-history-row small, .insight-history-row time, .insight-detail .modal-head small { color: var(--ink-3); font-size: 9px; }
.insight-detail textarea { min-height: 360px; }
.insight-fullscreen-backdrop { display: flex; align-items: stretch; justify-content: center; background: var(--bg); }
.insight-fullscreen { position: relative; display: flex; width: min(520px, 100%); height: 100dvh; flex-direction: column; overflow: hidden; background: var(--surface); }
.insight-toolbar { display: flex; min-height: 64px; align-items: center; padding: max(16px, env(safe-area-inset-top)) 4px 8px 12px; }
.insight-toolbar > button, .insight-toolbar-actions > button { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); padding: 0; cursor: pointer; }
.insight-toolbar button.accent { color: var(--accent); }
.insight-toolbar button:disabled { color: var(--ink-3); cursor: default; }
.insight-toolbar svg { width: 20px; height: 20px; fill: currentColor; }
.insight-toolbar > button:first-child svg { width: 24px; height: 24px; }
.insight-toolbar h2 { min-width: 0; flex: 1; margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.insight-toolbar > input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 0; font: inherit; font-size: 18px; font-weight: 700; }
.insight-toolbar-actions { display: flex; flex: 0 0 auto; align-items: center; }
.insight-toolbar-actions .insight-select-all { width: auto; border-radius: 8px; color: var(--accent); padding: 0 8px; font-size: 14px; }
.insight-divider { height: 1px; flex: 0 0 auto; background: var(--border); }
.insight-range-row { display: flex; flex: 0 0 auto; gap: 6px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; }
.insight-range-row::-webkit-scrollbar { display: none; }
.insight-range-pill { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--ink-2); padding: 5px 10px; font-size: 12px; cursor: pointer; }
.insight-range-pill.selected { border-color: transparent; background: var(--accent); color: var(--bg); font-weight: 600; }
.insight-custom-range { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.insight-custom-range label { position: relative; display: grid; min-width: 0; height: 34px; flex: 1; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.insight-custom-range input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.insight-range-summary { margin: 4px 16px 8px; color: var(--ink-3); font-size: 12px; }
.insight-lens-list { min-height: 0; flex: 1; overflow-y: auto; }
.insight-lens-row { display: flex; min-height: 52px; align-items: center; padding: 10px 8px 10px 16px; }
.insight-lens-row > button { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 0; background: transparent; color: var(--ink-2); padding: 0; cursor: pointer; }
.insight-lens-row > button svg { width: 18px; height: 18px; fill: currentColor; }
.insight-lens-main { display: flex !important; width: auto !important; min-width: 0; height: auto !important; flex: 1 1 auto !important; justify-content: flex-start; gap: 8px; color: var(--ink) !important; text-align: left; }
.insight-lens-main strong { overflow: hidden; font-size: 15px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.insight-radio { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 2px solid var(--ink-3); border-radius: 50%; color: var(--accent); font-size: 12px; font-style: normal; }
.insight-radio.selected { border-color: var(--accent); }
.insight-history-list { min-height: 0; flex: 1; overflow-y: auto; }
.insight-history-empty { display: grid; min-height: 0; flex: 1; place-items: center; color: var(--ink-3); font-size: 14px; }
.insight-history-row { display: flex; width: 100%; align-items: center; gap: 12px; border: 0; background: transparent; color: var(--ink); padding: 12px 16px; text-align: left; cursor: pointer; }
.insight-history-row.selected { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.insight-history-row > span { display: grid; min-width: 0; flex: 1; gap: 6px; }
.insight-history-row > span > span { display: flex; align-items: center; gap: 12px; }
.insight-history-row time { flex: 0 0 auto; color: var(--ink-3); font-size: 13px; }
.insight-history-row strong { min-width: 0; flex: 1; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.insight-history-row small { overflow: hidden; color: var(--ink-2); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.insight-selection-icon { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; color: var(--accent); font-style: normal; }
.insight-selection-icon svg { width: 22px; height: 22px; fill: currentColor; }
.insight-selection-icon > span { width: 20px; height: 20px; border: 2px solid var(--ink-3); border-radius: 50%; }
.insight-confirm-backdrop { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; background: rgba(10, 21, 48, .34); padding: 20px; }
.insight-confirm-dialog { width: min(320px, 100%); border-radius: 24px; background: var(--surface); padding: 24px; box-shadow: 0 18px 55px rgba(10,21,48,.2); }
.insight-confirm-dialog h3 { margin: 0; font-size: 20px; }
.insight-confirm-dialog p { margin: 14px 0; color: var(--ink-2); font-size: 14px; }
.insight-confirm-dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.insight-confirm-dialog button { border: 0; background: transparent; color: var(--accent); padding: 8px 10px; font-weight: 600; cursor: pointer; }
.insight-detail-content { min-height: 0; flex: 1; overflow-y: auto; padding: 16px 20px; }
.insight-detail-content > time { display: block; margin-bottom: 16px; color: var(--ink-3); font-size: 13px; }
.insight-input-collapsed { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink-3); padding: 10px 12px; font-size: 12px; cursor: pointer; }
.insight-input-collapsed b { color: var(--ink-2); font-size: 20px; }
.insight-labelled-box { position: relative; min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.insight-labelled-box legend { color: var(--ink-3); padding: 0 4px; font-size: 12px; }
.insight-labelled-box textarea { width: 100%; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 0; font: inherit; font-size: 14px; line-height: 1.57; }
.insight-collapse { position: absolute; top: 2px; right: 6px; display: grid; width: 32px; height: 32px; place-items: center; border: 0; background: transparent; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.insight-output-box { margin-top: 20px; }
.insight-markdown { color: var(--ink); font-size: 14px; line-height: 1.57; }
.insight-markdown p { margin: 0 0 12px; }
.insight-disclaimer { margin: 24px 0 16px; color: var(--ink-3); font-size: 12px; text-align: center; }
.insight-lens-editor-screen > form { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.insight-lens-editor-content { display: grid; gap: 16px; overflow-y: auto; padding: 16px 20px; }
.insight-lens-editor-content > label { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; }
.insight-lens-editor-content input, .insight-lens-editor-content textarea { width: 100%; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--ink); padding: 14px 12px; font: inherit; font-size: 14px; }
.insight-lens-editor-content textarea { min-height: 400px; resize: vertical; line-height: 1.55; }
.insight-lens-editor-content > p { margin: -4px 0 -12px; color: var(--ink-3); font-size: 12px; }
.insight-variable-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.insight-variable-row::-webkit-scrollbar { display: none; }
.insight-variable-row button { flex: 0 0 auto; border: 0; background: transparent; color: var(--accent); padding: 8px 6px; font-size: 11px; cursor: pointer; }
.membership-modal h3 { margin: 18px 0 8px; font-size: 14px; }
.membership-status { display: grid; gap: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 15px; }
.membership-status strong { font-size: 18px; }
.membership-status span { color: var(--ink-3); font-size: 11px; }
.feature-comparison { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.feature-comparison > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 8px 11px; font-size: 11px; }
.feature-comparison > div:last-child { border-bottom: 0; }
.feature-comparison b { color: var(--accent); }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-card { display: grid; gap: 5px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); padding: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.plan-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-card b { color: var(--accent); font-size: 17px; }
.plan-card span { color: var(--ink-3); font-size: 9px; }
.membership-modal > .wide { margin-top: 8px; }
.admin-user-row { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px; color: var(--ink); text-align: left; cursor: pointer; }
.admin-user-row > span { display: grid; gap: 4px; }
.admin-user-row small { color: var(--ink-3); font-size: 10px; }
.data-action-list { display: grid; margin: 12px 0 20px; }
.import-form { border-top: 1px solid var(--border); padding-top: 16px; }

.toast { position: fixed; z-index: 60; right: 18px; bottom: calc(var(--bottom-nav-height) + 12px + env(safe-area-inset-bottom)); max-width: min(360px, calc(100vw - 36px)); border-radius: 999px; background: var(--ink); color: white; padding: 10px 14px; font-size: 13px; box-shadow: 0 12px 35px rgba(10,21,48,.22); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 700px) {
  body { background: #f3f5f8; }
  .timeline-shell { box-shadow: 0 0 0 1px rgba(15,30,66,.03), 0 28px 90px rgba(10,21,48,.08); }
  .composer-card { bottom: 16px; border-bottom: 1px solid var(--border); border-radius: 10px; }
}

@media (max-width: 390px) {
  .top-tools, .timeline, .feature-screen { padding-inline: 12px; }
  .feature-screen.task-screen { padding-inline: 20px; }
  .composer-card { padding-inline: 5px; }
  .choice-chip, .tag-chip { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
