/*
DESIGN REFACTOR SUMMARY (2026-02-14)
- Tokens: added spacing (--s-*), radii (--r-*), typography scale, borders/dividers, surfaces, and a single shadow token (--shadow-1).
- Components: normalized cards, buttons, inputs, chips, segmented controls, and list rows to reduce visual noise.
- Bottom sheets: converted Add Project + Quick Add Note modals into iOS-style bottom sheets (slide-up, handle, backdrop, safe-area, scroll lock).
- Layout: tightened vertical density (headers/intro spacing) and standardized focus/active/disabled states.
*/

:root {
  /* Legacy theme palette (themes override these) */
  --bg: #fff3df;
  --surface: #fffdf8;
  --surface-2: #fff6ea;
  --text: #2f261a;
  --muted: #6f6254;
  --accent: #e07a2d;
  --accent-2: #2e7df6;
  --focus: #1d5dd6;
  --danger: #dc2626;

  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);

  /* Design tokens */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;

  --r-1: 10px;
  --r-2: 14px;
  --r-pill: 999px;

  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --text-1: 12px;
  --text-2: 14px;
  --text-3: 16px;
  --text-4: 18px;
  --text-5: 22px;
  --text-6: 28px;
  --lh-tight: 1.15;
  --lh: 1.35;
  --lh-loose: 1.55;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;

  --surface-0: var(--bg);
  --surface-1: var(--surface);
  --surface-2: var(--surface-2);

  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --divider: rgba(0, 0, 0, 0.06);

  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-1: var(--shadow);

  --focus-ring: 0 0 0 3px rgba(0, 122, 255, 0.25);

  /* Back-compat aliases (older CSS uses these) */
  --radius: var(--r-2);
  --space-1: var(--s-1);
  --space-2: var(--s-2);
  --space-3: var(--s-3);
  --space-4: var(--s-4);
  --space-5: var(--s-5);
  --space-6: var(--s-6);
}


* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  line-height: var(--lh);
  background:
    radial-gradient(920px 340px at 50% -16%, rgba(255, 175, 91, 0.26), transparent 72%),
    radial-gradient(860px 280px at 10% 14%, rgba(255, 226, 171, 0.34), transparent 74%),
    linear-gradient(180deg, #ffeecf 0%, #fff3de 48%, #fff8eb 100%);
  color: var(--text);
  min-height: 100%;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html[data-font-size="small"] {
  font-size: 15px;
}

html[data-font-size="medium"] {
  font-size: 16px;
}

html[data-font-size="large"] {
  font-size: 18px;
}

body {
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: pan-y;
}

/* Prevent iOS double-tap-to-zoom on all interactive elements */
button,
.btn,
label,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="file"],
summary,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 220px at 10% 18%, rgba(255, 158, 74, 0.14), transparent 74%),
    radial-gradient(520px 260px at 90% 22%, rgba(255, 200, 124, 0.12), transparent 76%);
  z-index: 0;
}

h1, h2, h3, h4 {
  margin: 0 0 12px 0;
}

p {
  margin: 0;
}

input, textarea, select {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--r-1);
  padding: 10px 12px;
}

input, select {
  min-height: 44px;
}

textarea {
  line-height: var(--lh-loose);
}

input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: rgba(0, 122, 255, 0.35);
}


button {
  cursor: pointer;
  border: none;
}

button,
.btn,
.icon-btn,
.tab-btn,
.fab {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.screen {
  min-height: 100vh;
  padding-bottom: calc(12px + var(--safe-bottom));
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 5vw, 42px) var(--space-4);
  background:
    radial-gradient(900px 300px at 50% -6%, rgba(255, 221, 170, 0.42), transparent 74%),
    linear-gradient(180deg, #fbf3e6 0%, #f8f0e4 56%, #f5ecdf 100%);
}

.auth-card {
  background: rgba(255, 255, 255, 0.78);
  padding: clamp(20px, 5vw, 34px);
  border-radius: 18px;
  width: min(420px, 100%);
  box-shadow: 0 10px 26px rgba(52, 44, 32, 0.08);
  border: 1px solid rgba(96, 82, 63, 0.12);
  display: grid;
  gap: 14px;
}

.auth-title {
  text-align: center;
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand {
  display: grid;
  place-items: center;
  margin-top: 6px;
}

.auth-logo {
  width: min(260px, 64%);
  height: auto;
}

.auth-logo.auth-logo-compact {
  width: clamp(82px, 22vw, 96px);
}

.auth-view {
  display: grid;
  gap: 14px;
}

.auth-subcopy {
  margin: 2px 0 8px 0;
  text-align: center;
  color: #675c50;
  font-size: clamp(1.24rem, 4.6vw, 1.78rem);
  line-height: 1.28;
}

.auth-form {
  gap: 10px;
}

.auth-form label {
  font-size: 1.02rem;
  font-weight: 600;
  color: #3a3028;
}

.auth-form input {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(99, 85, 67, 0.19);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 1.05rem;
}

.auth-form input::placeholder {
  color: #a79b8d;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(99, 85, 67, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: #7b6f61;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.auth-eye-icon {
  position: relative;
  width: 16px;
  height: 10px;
  border: 1.8px solid #8e8377;
  border-radius: 999px;
  display: block;
}

.auth-eye-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8e8377;
  transform: translate(-50%, -50%);
}

.auth-password-toggle.is-visible .auth-eye-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 50%;
  height: 1.6px;
  background: #8e8377;
  transform: rotate(-25deg);
  transform-origin: center;
}

.btn.primary.auth-primary-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 15px;
  background: linear-gradient(135deg, #4e87ea 0%, #3774de 100%);
  border-color: #3f78df;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-message {
  margin: 2px 0 4px 0;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 190, 98, 0.25);
  color: #4b3721;
  font-size: 0.9rem;
}

.auth-message.error {
  background: rgba(247, 126, 126, 0.16);
  color: #8f2d2d;
}

.auth-divider {
  position: relative;
  margin: 8px 0 4px 0;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid rgba(136, 116, 90, 0.22);
}

.auth-divider span {
  position: relative;
  padding: 0 14px;
  color: #7c7063;
  background: transparent;
  font-size: 0.98rem;
}

.btn.auth-google-btn {
  width: 100%;
  min-height: 56px;
  max-width: none;
  justify-self: stretch;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(101, 86, 67, 0.18);
  color: #2c2c2c;
  font-size: 1.02rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.auth-switch-row {
  margin: 2px 0 0 0;
  text-align: center;
  color: #72665a;
  font-size: 1.02rem;
}

.auth-switch-btn {
  border: none;
  background: transparent;
  color: #375e9b;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-weight: 700;
  text-decoration: none;
}

.auth-dev-controls {
  display: grid;
  gap: 10px;
}

.btn.auth-dev-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(94, 80, 62, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #3d342b;
  font-weight: 700;
}

.auth-dev-note {
  margin: 0;
  text-align: center;
  color: #6f6254;
  font-size: 0.88rem;
}

.auth-commit {
  margin: 8px 0 0 0;
  text-align: center;
  color: #8f857b;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.auth-inline {
  margin-top: 4px;
  font-size: 0.88rem;
  color: #716455;
}

.auth-inline.error {
  color: #b23c3c;
}

.auth-checklist {
  margin-top: 6px;
  margin-bottom: 0;
  padding-left: 18px;
  color: #726457;
  line-height: 1.45;
}

.housework-debug {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0 2px 2px 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.debug-details {
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 176, 94, 0.32);
  background: rgba(255, 228, 185, 0.54);
  padding: 8px 10px;
}

.debug-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.debug-summary::-webkit-details-marker {
  display: none;
}

.debug-chevron {
  color: var(--muted);
  font-size: 1rem;
}

.debug-details[open] #calendar-debug {
  margin-top: 8px;
}

.housework-debug-details {
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 176, 94, 0.32);
  background: rgba(255, 228, 185, 0.54);
  padding: 8px 10px;
}

.housework-debug-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.housework-debug-summary::-webkit-details-marker {
  display: none;
}

.housework-debug-chevron {
  color: var(--muted);
  font-size: 1rem;
}

.housework-debug-details[open] .housework-debug {
  margin-top: 8px;
}

.auth-debug {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(228, 170, 97, 0.5);
  background: rgba(253, 234, 197, 0.7);
}

.auth-debug-details {
  width: 100%;
}

.auth-debug-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.auth-debug-summary::-webkit-details-marker {
  display: none;
}

.auth-debug-chevron {
  color: var(--muted);
  font-size: 1.1rem;
}

.auth-debug-body {
  margin-top: 10px;
}

.auth-debug-body .event-actions {
  margin-top: 0;
  gap: 8px;
}

.auth-debug-output {
  margin: 8px 0 0 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 246, 224, 0.96);
  color: #6e6256;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  min-height: 100px;
  overflow: auto;
}

.auth-debug-fab {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 50;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb85f 0%, #ff8f3f 100%);
  color: #201100;
  font-weight: 700;
  box-shadow: var(--shadow);
}

body:not(.debug-visible) .debug-panel {
  display: none !important;
}

/* Keep critical debug accessible where it's needed even when debug is "off". */
body:not(.debug-visible) #auth-screen .debug-panel {
  display: block !important;
}
body:not(.debug-visible) #tab-profile .debug-panel {
  display: block !important;
}

.stack {
  display: grid;
  gap: var(--space-3);
}

.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.divider {
  height: 1px;
  background: rgba(233, 188, 119, 0.44);
  margin: 16px 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(255, 208, 142, 0.96), rgba(255, 194, 118, 0.96));
  padding: calc(var(--space-2) + var(--safe-top)) var(--space-3) var(--space-2) var(--space-3);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(169, 117, 57, 0.28);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-row-compact {
  justify-content: space-between;
  min-height: 44px;
}

.header-row-compact #weather-pill {
  flex: 1 1 auto;
  justify-content: center;
}

.header-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.header-app {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.header-title-wrap {
  min-width: 0;
}

.header-date {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  padding: var(--space-4);
  padding-top: calc(var(--space-3) + var(--safe-top));
  padding-bottom: calc(86px + var(--safe-bottom));
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.card {
  background: var(--surface);
  padding: var(--space-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-4);
  border: 1px solid rgba(15, 23, 42, 0.09);
}

.tab.active .card {
  animation: card-enter 180ms ease-out;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#tab-today .card { border-top: 3px solid #2563eb1c; }
#tab-notes .card { border-top: 3px solid #0f766e1c; }
#tab-projects .card { border-top: 3px solid #64748b1c; }
#tab-strategies .card { border-top: 3px solid #7c3aed1c; }
#tab-health .card { border-top: 3px solid #16a34a1c; }
#tab-goals .card { border-top: 3px solid #b453091c; }

.section-intro {
  margin-top: -6px;
  margin-bottom: 14px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.tab,
.card,
.agenda-columns,
.agenda-list,
.event-card {
  min-width: 0;
  max-width: 100%;
}

#tab-today {
  overflow-x: hidden;
}

img,
svg,
canvas,
iframe,
video {
  max-width: 100%;
}

pre,
code {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.debug-panel,
#calendar-debug,
#housework-debug {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.today-date-line {
  margin-top: -6px;
  margin-bottom: 8px;
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar-trigger {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 245, 255, 0.96));
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.avatar-trigger img {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-chip {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: linear-gradient(135deg, #dbeafe, #f8fafc);
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.avatar-chip-button {
  cursor: pointer;
  padding: 0;
}

.avatar-chip-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.7);
  outline-offset: 2px;
}

.avatar-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 999px;
}

.avatar-photo-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 999px;
}

.avatar-sheet {
  display: grid;
  gap: 10px;
  padding-bottom: env(safe-area-inset-bottom);
}

.avatar-photo-hint {
  font-size: 0.78rem;
}

.avatar-sheet-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.avatar-menu {
  display: grid;
  gap: 6px;
}

.avatar-menu-item {
  justify-content: flex-start;
}

.profile-photo-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 10px 0 14px;
}

.profile-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.85), rgba(248, 250, 252, 0.95));
  color: #1f2937;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo-crop-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.profile-photo-crop-canvas {
  width: min(280px, 100%);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

#profile-photo-status.error {
  color: var(--danger);
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-1) var(--space-2) calc(var(--space-1) + var(--safe-bottom)) var(--space-2);
  background: linear-gradient(180deg, rgba(255, 243, 218, 0.98), rgba(255, 233, 194, 0.99));
  border-top: 1px solid rgba(177, 130, 75, 0.28);
  display: flex;
  overflow-x: hidden;
  gap: 2px;
  z-index: 12;
  backdrop-filter: blur(12px);
}

.tab-btn-utility {
  flex: 0 0 auto;
  width: 56px;
}

.tab-btn-utility .tab-label {
  display: grid;
  gap: var(--s-2);
  font-size: var(--text-2);
  color: var(--text);
  font-weight: var(--w-semibold);
}


.today-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.today-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.today-title-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

/* Smart Scan — header button cluster */
.today-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.scan-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2, #888);
  opacity: 0.6;
  transition: opacity 0.15s ease, background 0.15s ease;
  padding: 0;
  flex: 0 0 auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.scan-trigger:hover,
.scan-trigger:focus-visible {
  opacity: 1;
  background: var(--surface-2, rgba(0, 0, 0, 0.06));
  outline: none;
}

.scan-trigger svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.scan-trigger.scan-trigger-loading {
  opacity: 0.35;
  cursor: wait;
  pointer-events: none;
}

/* Smart Scan — confirmation modal contents */
.smart-scan-preview {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 16px;
  background: var(--surface-2, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.smart-scan-preview img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.smart-scan-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.smart-scan-category-icon {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.smart-scan-category-row h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.smart-scan-data {
  margin: 12px 0 4px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 0.85rem;
}

.smart-scan-data-key {
  color: var(--text-2, #888);
  font-weight: 500;
  white-space: nowrap;
}

.smart-scan-data-val {
  color: var(--text-1, #222);
  word-break: break-word;
}

.smart-scan-summary {
  font-size: 0.85rem;
  margin: 8px 0 14px;
  line-height: 1.5;
}

.smart-scan-category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.smart-scan-category-chip {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--border, #ddd);
  background: transparent;
  cursor: pointer;
  color: var(--text-2, #666);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.smart-scan-category-chip.active {
  border-color: var(--accent, #5b4cdb);
  background: var(--accent, #5b4cdb);
  color: #fff;
}

.smart-scan-actions {
  display: flex;
  gap: 10px;
}

.smart-scan-actions .btn {
  flex: 1;
}


.today-logo {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  margin-top: 6px;
}

.today-title-text {
  min-width: 0;
}

.today-title-text h2 {
  margin-bottom: 6px;
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 14px;
  background: transparent;
  color: rgba(15, 23, 42, 0.45);
  font-size: 0.74rem;
  min-height: 48px;
  min-width: 0;
  flex: 1 1 0;
  border: 1px solid transparent;
  transition: transform 180ms ease, filter 140ms ease, background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  line-height: 0;
}

.tab-label {
  line-height: 1.1;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

#tab-btn-now {
  --tabColor: #0A84FF;
  --tabTint: rgba(10, 132, 255, 0.16);
}

#tab-btn-capture {
  --tabColor: #FF9F0A;
  --tabTint: rgba(255, 159, 10, 0.17);
}

#tab-btn-build {
  --tabColor: #AF52DE;
  --tabTint: rgba(175, 82, 222, 0.16);
}

#tab-btn-align {
  --tabColor: #30B0C7;
  --tabTint: rgba(48, 176, 199, 0.17);
}

#tab-btn-health {
  --tabColor: #FF375F;
  --tabTint: rgba(255, 55, 95, 0.16);
}

.tab-btn.active {
  background: var(--tabTint, rgba(10, 132, 255, 0.16));
  color: var(--tabColor, #0A84FF);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  font-weight: 700;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--tabColor, #0A84FF);
  outline-offset: 2px;
}

.nav-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-icon .svg-outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon .svg-filled {
  display: none;
  fill: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon .svg-filled-detail {
  display: none;
  fill: #ffffff;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-btn.active .nav-icon .svg-outline {
  display: none;
}

.tab-btn.active .nav-icon .svg-filled {
  display: block;
}

.tab-btn.active .nav-icon .svg-filled-detail {
  display: block;
}

.btn {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
  border: 1px solid rgba(15, 23, 42, 0.18);
  font-weight: 600;
}

.btn.primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #ffffff;
  font-weight: 700;
}

.btn.google-btn {
  background: #ffffff;
  color: #1b1b1b;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 320px;
  justify-self: center;
}

.google-btn-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: transform 120ms ease, filter 120ms ease;
  border: 1px solid rgba(15, 23, 42, 0.16);
}

.text-btn {
  background: none;
  color: var(--accent);
  text-decoration: underline;
}

.btn:hover,
.icon-btn:hover,
.tab-btn:hover,
.fab:hover {
  filter: brightness(1.08);
}

.btn:active,
.icon-btn:active,
.tab-btn:active,
.fab:active {
  transform: scale(0.97);
  filter: brightness(1.2);
}

.btn:disabled,
.icon-btn:disabled,
.tab-btn:disabled,
.fab:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:disabled:active,
.icon-btn:disabled:active,
.tab-btn:disabled:active,
.fab:disabled:active {
  transform: none;
  filter: none;
}

input, textarea, select {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(100, 116, 139, 0.4);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

.file-input-hidden {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 0.76rem;
  border: 1px solid rgba(100, 116, 139, 0.26);
}

.atmosphere-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.weather-pill {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  cursor: default;
}

.aqi-pill {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  cursor: default;
}

.weather-icon {
  font-size: 1rem;
  line-height: 1;
}

.weather-forecast-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.weather-day-block {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-width: 0;
  line-height: 1.1;
}

.weather-day-block-today {
  gap: 6px;
}

.weather-day-block-next {
  border-left: 1px solid rgba(100, 116, 139, 0.26);
  padding-left: 10px;
}

.weather-row-icon {
  font-size: 1.45rem;
  line-height: 0.9;
  flex: 0 0 auto;
}

.weather-day-block-today .weather-row-icon {
  font-size: 2.05rem;
}

.weather-temp-high {
  font-size: 0.95rem;
  font-weight: 650;
  color: #273142;
}

.weather-temp-low {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(39, 49, 66, 0.58);
}

.weather-condition {
  font-size: 0.95rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-day-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
}

.aqi-row-content {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.aqi-row-segment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.aqi-row-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.aqi-row-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #273142;
}

.aqi-row-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #273142;
}

.aqi-row-separator {
  color: rgba(51, 65, 85, 0.72);
  line-height: 1;
}

.aqi-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}

.aqi-sensor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aqi-sep {
  color: var(--muted);
  opacity: 0.75;
}

.ai-summary-details {
  border: 1px solid rgba(111, 84, 42, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.ai-summary-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
}

.ai-summary-summary::-webkit-details-marker {
  display: none;
}

.ai-summary-content p {
  margin: 0;
  line-height: 1.45;
  color: var(--text);
}

.brief-heading {
  margin: 10px 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.brief-list {
  margin: 0 0 10px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.brief-paragraph {
  margin: 0 0 10px;
  color: var(--text);
}

.section-details > summary {
  list-style: none;
}

.section-details > summary::-webkit-details-marker {
  display: none;
}

.section-details > summary::marker {
  content: "";
}

.section-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-summary::after {
  content: "▾";
  color: var(--muted);
  font-weight: 700;
  margin-left: auto;
}

.section-details[open] > .section-summary::after {
  content: "▴";
}

/* Swipe-to-reveal wrapper for note cards */
.note-swipe-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 14px; /* match .card border-radius */
  margin-bottom: 10px;
}

.note-swipe-wrap .note-card {
  position: relative;
  z-index: 1;
  will-change: transform;
  margin-bottom: 0; /* wrapper provides spacing */
  background: var(--surface); /* must be opaque to cover the action buttons at rest */
}

/* Flat row variant (Recent Notes list) — no card radius or extra margin */
.note-swipe-wrap.note-swipe-row {
  border-radius: 0;
  margin-bottom: 0;
}

.note-swipe-wrap .recent-note-row {
  position: relative;
  z-index: 1;
  width: 100%;
  will-change: transform;
  background: var(--surface-1); /* must be opaque to cover the action buttons at rest */
}

.note-swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 216px; /* 3 × 72px */
  display: flex;
  pointer-events: none;
  /* Hidden until drag starts or fully open — prevents colored buttons
     from bleeding through semi-transparent theme backgrounds */
  visibility: hidden;
}

.note-swipe-wrap.swipe-open .note-swipe-actions,
.note-swipe-wrap.swiping .note-swipe-actions {
  visibility: visible;
  pointer-events: none; /* pointer-events enabled separately below */
}

.note-swipe-wrap.swipe-open .note-swipe-actions {
  pointer-events: auto;
}

.note-swipe-btn {
  flex: 1;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  letter-spacing: 0.01em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.note-swipe-share  { background: #3b82f6; }
.note-swipe-archive { background: #f59e0b; }
.note-swipe-delete  { background: #ef4444; }

.note-swipe-btn:active {
  filter: brightness(0.88);
}

.note-card {
  padding: 12px;
}

.note-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.note-actions {
  display: inline-flex;
  gap: 8px;
}

.note-text {
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.voice-transcript-label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

.voice-audio-preview {
  width: 100%;
  margin-top: 8px;
}

.voice-transcript-preview {
  min-height: 140px;
  max-height: 36vh;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.4;
  resize: vertical;
}

#voice-transcript-hint {
  margin-top: 6px;
}

.note-title {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 2px 0 8px;
}

.note-origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.12);
}

.note-meta-sep {
  margin: 0 6px 0 2px;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.chip {
  cursor: pointer;
  min-height: 40px;
}


button.chip.active {
  background: var(--surface-2);
  border-color: rgba(0, 122, 255, 0.25);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.14);
}


.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  white-space: nowrap;
}

.badge-muted {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--muted);
}

.badge-work {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
  color: var(--text);
}

.badge-personal {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.22);
  color: var(--text);
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.12);
}

.segmented-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.segmented-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.22);
}

.capture-view {
  display: none;
}

.capture-view.active {
  display: block;
}

.log-segmented-card {
  margin-bottom: var(--s-4);
}

#tab-capture {
  max-width: 780px;
  margin: 0 auto;
}

#tab-capture .section-intro {
  margin-bottom: var(--s-4);
  max-width: 44ch;
}

#tab-capture .now-section {
  margin-bottom: var(--s-4);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.recent-notes-root {
  display: grid;
  gap: var(--s-3);
}

.recent-notes-toolbar {
  position: static;
  background: transparent;
  padding: 0 0 var(--s-3);
  display: grid;
  gap: var(--s-3);
  border-bottom: 1px solid var(--divider);
}

.recent-notes-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.recent-notes-title {
  margin: 0;
  font-size: clamp(1.28rem, 5.2vw, 1.48rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: var(--w-semibold);
}

.recent-notes-add-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  font-size: 1.38rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.22);
}

.recent-notes-search-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

.recent-notes-search-icon {
  color: var(--muted);
  font-size: 0.86rem;
}

.recent-notes-search {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  min-height: 36px;
  color: var(--text);
  font-size: var(--text-2);
}

.recent-notes-search:focus-visible {
  box-shadow: none;
}

.recent-notes-empty {
  padding: var(--s-6) var(--s-3) var(--s-4);
  text-align: center;
}

.recent-notes-empty p {
  margin: 0;
}

.recent-notes-list {
  display: grid;
  gap: var(--s-3);
}

.recent-note-section {
  display: grid;
  gap: 4px;
}

.recent-note-section-label {
  margin: 0;
  padding: 0 2px;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: var(--w-semibold);
}

.recent-note-section-body {
  border: 1px solid var(--divider);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-1);
}

.recent-note-row {
  width: 100%;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  transition: background-color 120ms ease;
}

.recent-note-row:last-child {
  border-bottom: 0;
}

.recent-note-row:hover {
  background: var(--surface-2);
}

.recent-note-row:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(46, 125, 246, 0.28);
}

.recent-note-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.recent-note-title {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-note-pin-dot {
  color: var(--accent-2);
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.recent-note-subline {
  margin-top: 3px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-note-date {
  font-variant-numeric: tabular-nums;
}

.recent-note-preview-empty {
  display: none;
}

.recent-notes-load-more {
  width: 100%;
  margin-top: 0;
}

.recent-note-actions .btn {
  width: 100%;
}

.recent-note-detail-text {
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-segmented-sticky {
  position: static;
  padding: 0;
  margin: 0;
  background: transparent;
}

#tab-capture .log-segmented-sticky .segmented {
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#tab-capture .log-segmented-sticky .segmented-btn {
  min-height: 40px;
  padding: 8px 12px;
}

#tab-capture .log-segmented-sticky .segmented-btn.active {
  background: var(--surface-1);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  #tab-capture .now-section {
    padding: var(--s-3);
  }

  .recent-notes-title {
    font-size: 1.2rem;
  }
}

.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.event-topline,
.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.project-badges {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.inspiration-stack {
  gap: 10px;
}

.inspiration-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inspiration-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inspiration-add-trigger {
  min-height: 44px;
  padding: 0 14px;
  font-weight: 700;
}

.inspiration-sheet {
  gap: 12px;
}

.inspiration-sheet-options {
  display: grid;
  gap: 10px;
}

.inspiration-sheet .sheet-actions {
  margin-top: 2px;
}

.journal-impact {
  display: grid;
  gap: 10px;
}

.journal-impact-row {
  display: grid;
  gap: 8px;
}

.journal-impact-label {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.journal-impact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.impact-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.impact-btn span {
  font-size: 1.4rem;
  line-height: 1;
}

.impact-btn.selected {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35);
}

.journal-badges {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.journal-badge-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.impact {
  font-size: 1.28rem;
  line-height: 1;
}

.journal-datetime-label {
  display: grid;
  gap: 6px;
}

.journal-photo-label input[type="file"] {
  display: block;
  margin-top: 6px;
}

.journal-photos,
.note-photos {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.journal-photos img,
.note-photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.photo-thumb {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 12px;
}

.photo-thumb:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.photo-viewer {
  display: grid;
  gap: 10px;
}

.photo-viewer img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.06);
}

/* HEALTH (new feature; new Firestore namespace users/{uid}/health/...) */
.health-vertical-flow {
  display: grid;
  gap: 32px;
}

.health-vertical-section {
  display: grid;
  gap: 12px;
}

.health-vertical-heading {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.health-overview-card {
  display: grid;
  gap: 12px;
}

.health-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.health-overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.health-overview-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.health-overview-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.health-overview-label {
  font-weight: 750;
}

.health-overview-value {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.health-overview-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.health-overview-actions .btn {
  min-height: 38px;
  padding: 8px 12px;
}

.health-mini-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.26);
  overflow: hidden;
}

.health-mini-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.health-food-summary-card {
  display: grid;
  gap: 12px;
}

.health-food-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

.health-food-preview-list {
  display: grid;
  gap: 8px;
}

.health-food-preview-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 8px;
}

.health-food-preview-row span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.health-reference-list {
  display: grid;
  gap: 8px;
}

.health-reference-card {
  display: grid;
  gap: 8px;
}

.health-reference-item {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 8px;
}

.health-reference-item:first-child {
  border-top: none;
  padding-top: 0;
}

.health-reference-item > .section-summary {
  align-items: center;
}

.health-reference-value {
  color: var(--text);
  font-weight: 700;
}

.health-reference-body {
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

.health-reference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.health-reference-row:first-child {
  border-top: none;
  padding-top: 0;
}

.health-shell {
  display: grid;
  gap: 12px;
}

.health-shell-top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  background: var(--surface-2);
  padding-bottom: 8px;
}

.health-shell-top .segmented {
  width: min(88%, 680px);
  margin: 0 auto;
  min-width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.health-shell-top .segmented-btn {
  border-radius: 999px;
}

.health-shell-top .segmented-btn.active {
  background: linear-gradient(135deg, rgba(56, 106, 144, 0.95), rgba(39, 75, 105, 0.95));
  border-color: rgba(148, 163, 184, 0.45);
  color: #f8fafc;
  box-shadow: 0 2px 8px rgba(9, 22, 40, 0.28);
}

.health-entry-section,
.health-reference-section {
  width: 100%;
}

.health-reference-section {
  margin-top: 6px;
}

.health-reference-grid {
  margin-top: 4px;
}

.health-panel {
  display: none;
}

.health-panel.active {
  display: grid;
  gap: 12px;
}

.health-grid {
  display: grid;
  gap: 12px;
}

.health-tile {
  display: grid;
  gap: 8px;
}

.health-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.health-value {
  font-size: 1rem;
}

.health-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.health-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.health-inline-three {
  grid-template-columns: minmax(120px, 180px) 1fr auto;
  align-items: end;
}

.health-wide {
  grid-column: 1 / -1;
}

.health-cpap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.health-cpap-block {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.health-cpap-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.health-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.health-list.compact {
  gap: 2px;
}

.health-review-list {
  display: grid;
  gap: 8px;
}

.health-review-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.health-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.health-review-meal {
  font-weight: 650;
}

.health-stars {
  letter-spacing: 0.08em;
  font-weight: 700;
}

.health-analysis-box {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.health-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.health-food-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.health-analysis-preview {
  display: grid;
  gap: 4px;
}

.health-food-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.health-food-summary::-webkit-details-marker {
  display: none;
}

.health-food-summary::marker {
  content: "";
}

.health-food-details {
  margin-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}

#tab-health .health-grounding {
  display: grid;
  gap: 12px;
  padding-bottom: 40px;
}

#tab-health .health-grounding-title-block {
  display: grid;
  gap: 4px;
  margin-bottom: 0;
}

#tab-health .health-grounding-kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0.01em;
}

#tab-health .health-grounding-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 620;
}

#tab-health .health-grounding-section {
  display: grid;
  gap: 12px;
}

#tab-health .health-grounding-section-label {
  margin: 0;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

#tab-health .health-grounding-prompt {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

#tab-health .health-grounding-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tab-health .health-grounding-chip {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
}

#tab-health .health-grounding-chip-row-drained .health-grounding-chip {
  background: rgba(71, 85, 105, 0.1);
  border-color: rgba(100, 116, 139, 0.28);
}

#tab-health .health-grounding-chip.is-selected {
  background: rgba(79, 130, 161, 0.95);
  border-color: rgba(79, 130, 161, 0.95);
  color: #f8fafc;
}

#tab-health .health-grounding-meters {
  display: grid;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

#tab-health .health-grounding-meter-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  gap: 8px;
}

#tab-health .health-grounding-meter-label {
  font-size: 14px;
  color: var(--text);
}

#tab-health .health-grounding-dots {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

#tab-health .health-grounding-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  cursor: pointer;
}

#tab-health .health-grounding-dot.is-selected {
  border-color: rgba(126, 143, 160, 0.95);
  background: rgba(126, 143, 160, 0.95);
}

#tab-health .health-grounding-add-reflection {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
  line-height: 1;
  min-height: 36px;
  padding: 8px 0 0;
  text-align: center;
  cursor: pointer;
}

#tab-health .health-grounding-dual {
  display: grid;
  gap: 20px;
}

#tab-health .health-grounding-column {
  display: grid;
  gap: 8px;
}

#tab-health .health-grounding-subheading {
  margin: 0;
  font-size: 15px;
  font-weight: 620;
}

#tab-health .health-grounding-column .health-grounding-chip {
  min-height: 32px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 9px;
}

#tab-health .health-grounding-pattern-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(120, 139, 156, 0.14);
  padding: 16px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

#tab-health .health-grounding-pattern-card p {
  margin: 0;
}

#tab-health .health-grounding-pattern-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

#tab-health .health-grounding-reset-list {
  display: grid;
  gap: 8px;
}

#tab-health .health-grounding-reset-btn {
  min-height: 44px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.2;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(3, 7, 18, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

#tab-health .health-grounding-reset-done-label {
  display: none;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

#tab-health .health-grounding-reset-btn.is-done {
  border-color: rgba(113, 141, 165, 0.4);
  background: rgba(95, 123, 148, 0.16);
}

#tab-health .health-grounding-reset-btn.is-done .health-grounding-reset-done-label {
  display: inline-flex;
}

#tab-health .health-grounding-reflection {
  padding-top: 0;
}

#tab-health .health-grounding-reflection-toggle {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  font-size: 14px;
  font-weight: 620;
  cursor: pointer;
}

#tab-health .health-grounding-reflection-label {
  font-size: 14px;
  line-height: 1;
}

#tab-health .health-grounding-reflection-chevron {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

#tab-health .health-grounding-reflection-body {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

#tab-health .health-grounding-reflection-body textarea {
  min-height: 120px;
  resize: vertical;
  font-size: 14px;
}

#tab-health .health-grounding-history {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

#tab-health .health-grounding-history-block {
  margin-top: 8px;
}

#tab-health .health-grounding-saved-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

#tab-health .health-grounding-history-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 4px;
}

#tab-health .health-grounding-history-date {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#tab-health .health-grounding-history-row {
  font-size: 13px;
  line-height: 1.35;
}

#tab-health .health-grounding-history-row strong {
  font-weight: 620;
}

#tab-health .health-grounding-history-text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#tab-health .health-grounding-reflection-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

#tab-health .health-grounding-reflection-actions .btn {
  min-height: 38px;
  padding: 8px 14px;
}

.health-myair-history {
  display: grid;
  gap: 8px;
}

.health-myair-history-details {
  margin-top: 10px;
}

.health-myair-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.health-myair-grid {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.notes-doc-frame {
  width: 100%;
  min-height: 360px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 420px) {
  .profile-photo-controls {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .health-overview-row {
    grid-template-columns: 1fr;
  }
  .health-food-preview-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .health-inline {
    grid-template-columns: 1fr;
  }
  .health-inline-three {
    grid-template-columns: 1fr;
  }
  .health-cpap-grid {
    grid-template-columns: 1fr;
  }
  .health-today-head {
    align-items: stretch;
    flex-direction: column;
  }
  .health-food-head {
    align-items: stretch;
    flex-direction: column;
  }
  #tab-health .health-grounding-meter-row {
    grid-template-columns: 96px 1fr;
  }
}

@media (min-width: 760px) {
  #tab-health .health-grounding-dual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  #tab-health .health-grounding-reset-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.strategy-details {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.strategy-details > summary {
  list-style: none;
}

.strategy-details > summary::-webkit-details-marker {
  display: none;
}

.strategy-details > summary::marker {
  content: "";
}

.strategy-summary {
  display: grid;
  grid-template-columns: 36px 1fr 16px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
}

.strategy-summary:active {
  transform: translateY(1px);
}

.strategy-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 1.05rem;
}

.strategy-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.strategy-text {
  color: var(--muted);
  line-height: 1.35;
}

.strategy-chevron {
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 160ms ease;
}

.strategy-details[open] .strategy-chevron {
  transform: rotate(180deg);
}

.strategy-expanded {
  padding: 0 12px 12px 60px;
  display: grid;
  gap: 10px;
}

.strategy-expanded-row {
  display: grid;
  gap: 4px;
}

.strategy-expanded-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.whenx-item {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.whenx-item > summary {
  list-style: none;
  font-weight: 750;
  cursor: pointer;
}

.whenx-item > summary::-webkit-details-marker {
  display: none;
}

.whenx-item > summary::marker {
  content: "";
}

.whenx-try {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.vision-error {
  margin: 10px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 63, 94, 0.24);
  background: rgba(244, 63, 94, 0.08);
}

.inspiration-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  min-height: 44px;
}

.inspiration-text {
  overflow-wrap: anywhere;
}

.inspiration-item-book {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
}

.inspo-book-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  padding: 3px;
  min-width: 0;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.inspo-book-card:hover {
  background: rgba(148, 163, 184, 0.14);
}

.inspo-book-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  background: rgba(148, 163, 184, 0.14);
}

.inspo-book-card:not(.is-disabled) {
  cursor: pointer;
}

.inspo-book-card.is-disabled {
  cursor: default;
}

.inspo-book-cover {
  position: relative;
  width: 46px;
  height: 66px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.55), rgba(203, 213, 225, 0.48));
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.inspo-book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.inspo-book-cover-img.is-broken {
  display: none;
}

.inspo-book-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(71, 85, 105, 0.78);
}

.inspo-book-icon {
  position: relative;
  width: 16px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.62);
}

.inspo-book-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  bottom: 2px;
  border-left: 1.5px solid currentColor;
  opacity: 0.78;
}

.inspo-book-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 2px;
  top: 5px;
  border-top: 1.5px solid currentColor;
  opacity: 0.72;
}

.inspo-book-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.inspo-book-title {
  font-size: 0.97rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.inspo-book-author {
  font-size: 0.84rem;
  line-height: 1.15;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.inspo-book-link-indicator {
  font-size: 0.78rem;
  line-height: 1;
  color: rgba(71, 85, 105, 0.62);
  padding-right: 2px;
}

.inspo-book-link-indicator.is-disabled {
  opacity: 0.34;
}

.inspiration-item-book .inspo-remove-btn.action-btn.icon-only {
  width: 44px;
  height: 44px;
  min-height: 44px;
  align-self: center;
  opacity: 0.62;
  font-size: 0.9rem;
}

.inspo-rail {
  margin: 14px 0 18px;
}

.inspo-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 6px 0 10px;
}

.inspo-rail-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
  opacity: 0.92;
}

.inspo-film-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspo-film-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.inspo-film-card {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.inspo-film-card:not(.is-disabled):hover {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.34);
  transform: translateY(-1px);
  cursor: pointer;
}

.inspo-film-card:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.inspo-film-card.is-disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.inspo-film-poster {
  width: 50px;
  min-width: 50px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inspo-film-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.inspo-film-poster-img.is-broken {
  display: none;
}

.inspo-film-poster-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0.65;
}

.inspo-film-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspo-film-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.inspo-film-titleRow {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.inspo-film-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.inspo-film-year {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.6;
  white-space: nowrap;
  margin-top: 1px;
}

.inspo-film-ext {
  font-size: 11px;
  opacity: 0.44;
  margin-top: 1px;
}

.inspo-film-card.is-disabled .inspo-film-ext {
  opacity: 0.25;
}

.inspo-film-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inspo-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.92;
}

.inspo-film-providers {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.inspo-film-why {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.72;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.inspo-empty {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  padding: 10px 2px 0;
}

.inspo-film-row .inspo-remove-btn.action-btn.icon-only {
  width: 44px;
  height: 44px;
  min-height: 44px;
  align-self: center;
  opacity: 0.62;
  font-size: 0.9rem;
}

.anchor-guidance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.anchor-guidance img {
  width: 18px;
  height: 18px;
  opacity: 0.95;
}

.agenda-columns {
  display: grid;
  gap: 16px;
}

.agenda-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

 .agenda-list {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--surface-1);
}

.agenda-list .event-card {
  background: transparent;
  padding: var(--s-4);
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--divider);
}

.agenda-list .event-card:last-child {
  border-bottom: none;
}


.agenda-list .event-card strong,
.agenda-list .event-card .muted {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.event-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 12px;
}

.event-icon-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.action-btn.icon-only {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  justify-content: center;
  font-size: 1rem;
  flex: 0 0 auto;
}

.action-btn span[aria-hidden="true"] {
  font-size: 1rem;
  line-height: 1;
}

.calendar-picker-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.calendar-account-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(229, 171, 100, 0.34);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, #fff8ec, #fff2df);
}

.calendar-account-card.calendar-account-dirty {
  border-color: rgba(217, 119, 6, 0.62);
}

.calendar-account-details {
  width: 100%;
}

.calendar-account-summary {
  list-style: none;
  cursor: pointer;
}

.calendar-account-summary::-webkit-details-marker {
  display: none;
}

.calendar-account-summary::marker {
  content: "";
}

.calendar-account-summary::after {
  content: "▾";
  float: right;
  font-size: 0.86rem;
  color: #7f5630;
  transform: rotate(-90deg);
  transition: transform 120ms ease;
}

.calendar-account-details[open] .calendar-account-summary::after {
  transform: rotate(0deg);
}

.calendar-account-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.calendar-account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f2937;
  background: rgba(79, 130, 161, 0.2);
  border: 1px solid rgba(79, 130, 161, 0.38);
}

.calendar-account-meta {
  min-width: 0;
}

.calendar-account-email {
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.calendar-account-include {
  justify-self: start;
}

.calendar-status-error {
  color: #b42318;
  font-weight: 600;
}

.calendar-account-body {
  padding-top: 10px;
  border-top: 1px solid rgba(229, 171, 100, 0.24);
}

.calendar-account-actions {
  align-items: center;
  flex-wrap: wrap;
}

.calendar-account-actions .muted {
  margin-left: auto;
}

.calendar-account-save-row {
  align-items: center;
  flex-wrap: wrap;
}

.calendar-account-save-row .muted {
  margin-left: auto;
}

.calendar-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px);
  gap: 10px;
  align-items: center;
  background: linear-gradient(180deg, #fff8ec, #fff2df);
  border: 1px solid rgba(229, 171, 100, 0.34);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  min-width: 0;
}

.calendar-settings-label {
  min-width: 0;
  width: 100%;
}

.calendar-settings-name {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.calendar-settings-row select {
  width: 100%;
}

.calendar-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px);
  gap: 10px;
  align-items: center;
  background: linear-gradient(180deg, #fff8ec, #fff2df);
  border: 1px solid rgba(229, 171, 100, 0.34);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  min-width: 0;
}

.calendar-picker-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.calendar-picker-name {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}


.calendar-picker-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
}

.calendar-picker-row select {
  width: 100%;
}


.calendar-feed-row {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #fff8ec, #fff2df);
  border: 1px solid rgba(229, 171, 100, 0.34);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  min-width: 0;
}

.calendar-feed-enable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  min-height: 40px;
}

.calendar-feed-enable input {
  margin: 0;
}

.calendar-feed-name-input {
  width: 100%;
}

.calendar-feed-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.82rem;
}

#calendar-feed-preview {
  min-height: 0;
}

#calendar-feed-preview ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

#calendar-feed-preview li {
  margin: 2px 0;
}

.nested-card {
  background: #f8fafc;
  box-shadow: none;
  margin-bottom: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.context-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.context-strip .pill {
  max-width: 100%;
  overflow-wrap: anywhere;
}

#housework-list label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.family-housework-section {
  margin-top: 8px;
}

.family-housework-section h5 {
  margin: 0 0 8px 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.family-housework-item {
  border-radius: 10px;
  border: 1px solid rgba(232, 176, 106, 0.32);
  background: rgba(255, 236, 206, 0.65);
  padding: 8px 10px;
}

.family-housework-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.family-housework-chores {
  margin: 8px 0 0 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
}

.vision-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  align-items: center;
}

.vision-viewer {
  height: clamp(380px, 62vh, 720px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

.vision-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.vision-viewer img {
  width: 100%;
  height: auto;
  display: block;
}

.fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f78ff 0%, #3d9cff 100%);
  color: #ffffff;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 20;
}

.panel-sheet {
  width: min(420px, 100%);
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: -10px 0 24px rgba(15, 23, 42, 0.18);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 14px 16px;
  border-bottom: 1px solid rgba(231, 174, 102, 0.24);
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
}

.panel-header h2 {
  margin: 0;
  font-size: clamp(1.3rem, 5vw, 1.85rem);
}

.panel-body {
  padding: 0 16px 24px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

@media (max-width: 640px) {
  .panel-sheet {
    width: 100%;
    border-left: none;
    box-shadow: none;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(111, 70, 24, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Must sit above Car Mode (which uses z-index: 50). */
  z-index: 200;
}

.modal-card {
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.99), rgba(255, 243, 220, 0.99));
  padding: 20px;
  border-radius: var(--radius);
  width: min(420px, 90vw);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(231, 174, 102, 0.4);
}

.modal-card.modal-card-wide {
  width: min(860px, 96vw);
}


.timer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.bar-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: var(--accent-2);
  width: 0%;
}

@media (min-width: 720px) {
  .agenda-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .inspo-film-list {
    gap: 10px;
  }

  .inspo-film-card {
    padding: 10px 12px;
  }

  .inspo-film-title {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .tabbar {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .tab-btn {
    min-width: 0;
    padding: 8px 2px;
    font-size: 0.68rem;
  }

  .tab-icon {
    width: 24px;
    height: 24px;
  }

  .tab-label {
    font-size: 11px;
  }

  .tab-btn-utility {
    width: 48px;
  }
}

@media (max-width: 560px) {
  .calendar-account-head {
    grid-template-columns: auto 1fr;
  }

  .calendar-account-actions .muted,
  .calendar-account-save-row .muted {
    margin-left: 0;
    width: 100%;
  }

  .calendar-settings-row,
  .calendar-picker-row {
    grid-template-columns: 1fr;
  }

  .inspiration-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inspiration-chip-row {
    width: 100%;
  }

  .inspiration-item-book {
    padding: 5px;
  }

  .inspo-book-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .inspo-book-cover {
    width: 44px;
    height: 63px;
  }

  .inspo-book-title {
    font-size: 0.94rem;
  }

  .inspiration-item-book .inspo-remove-btn.action-btn.icon-only {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .inspo-film-card {
    padding: 9px;
    gap: 9px;
  }

  .inspo-film-poster {
    width: 46px;
    min-width: 46px;
    height: 66px;
  }

  .inspo-film-title {
    font-size: 13px;
  }

  .inspo-film-providers {
    max-width: 52vw;
  }

  .inspo-film-row .inspo-remove-btn.action-btn.icon-only {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

html[data-theme="midnight"],
html[data-theme="ink"] {
  --text: #f2f4f6;
  --muted: #a9b0b7;
  --accent: #f0b45a;
  --accent-2: #8fd3d2;
  --focus: #9fb8d2;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

html[data-theme="midnight"] body,
html[data-theme="ink"] body {
  background:
    radial-gradient(1000px 460px at 12% -14%, rgba(167, 176, 184, 0.2), transparent 72%),
    radial-gradient(940px 420px at 88% -10%, rgba(134, 143, 151, 0.18), transparent 72%),
    linear-gradient(180deg, #22272c 0%, #1b2024 52%, #171c20 100%);
}

html[data-theme="midnight"] body::before,
html[data-theme="ink"] body::before {
  background:
    radial-gradient(440px 220px at 10% 18%, rgba(160, 168, 176, 0.14), transparent 74%),
    radial-gradient(520px 260px at 90% 22%, rgba(130, 138, 145, 0.12), transparent 76%);
}

html[data-theme="midnight"] .auth-card,
html[data-theme="midnight"] .card,
html[data-theme="ink"] .auth-card,
html[data-theme="ink"] .card {
  background: linear-gradient(180deg, rgba(48, 55, 62, 0.96), rgba(38, 44, 50, 0.96));
  border-color: rgba(128, 136, 143, 0.3);
}

html[data-theme="midnight"] .app-header,
html[data-theme="ink"] .app-header {
  background: linear-gradient(170deg, #3a4148 0%, #343b42 54%, #2f363d 100%);
  border-bottom-color: rgba(124, 132, 140, 0.36);
}

html[data-theme="midnight"] .tabbar,
html[data-theme="ink"] .tabbar {
  background: linear-gradient(180deg, rgba(43, 49, 56, 0.96), rgba(34, 39, 45, 0.98));
  border-top-color: rgba(119, 127, 135, 0.34);
}

html[data-theme="midnight"] .tab-btn,
html[data-theme="ink"] .tab-btn {
  color: #b9c0c7;
}

html[data-theme="midnight"] .tab-btn.active,
html[data-theme="ink"] .tab-btn.active {
  background: linear-gradient(135deg, rgba(96, 105, 113, 0.88), rgba(74, 82, 89, 0.88));
  color: #ffffff;
}

html[data-theme="midnight"] .btn,
html[data-theme="ink"] .btn {
  background: linear-gradient(180deg, rgba(78, 87, 95, 0.9), rgba(67, 75, 82, 0.9));
  color: #f4f6f8;
  border-color: rgba(130, 138, 146, 0.32);
}

html[data-theme="midnight"] .btn.primary,
html[data-theme="ink"] .btn.primary {
  background: linear-gradient(135deg, #f0bd73 0%, #d8a45d 100%);
  color: #1b1300;
}

html[data-theme="midnight"] .icon-btn,
html[data-theme="ink"] .icon-btn {
  background: linear-gradient(180deg, rgba(83, 91, 99, 0.9), rgba(70, 78, 85, 0.9));
  color: #f2f4f6;
  border-color: rgba(129, 137, 145, 0.34);
}

html[data-theme="midnight"] input,
html[data-theme="midnight"] textarea,
html[data-theme="midnight"] select,
html[data-theme="ink"] input,
html[data-theme="ink"] textarea,
html[data-theme="ink"] select {
  background: linear-gradient(180deg, rgba(58, 66, 74, 0.94), rgba(50, 57, 64, 0.94));
  color: #f2f4f6;
  border-color: rgba(127, 135, 142, 0.34);
}

html[data-theme="midnight"] .pill,
html[data-theme="midnight"] .agenda-list .event-card,
html[data-theme="midnight"] .calendar-settings-row,
html[data-theme="midnight"] .calendar-picker-row,
html[data-theme="midnight"] .calendar-account-card,
html[data-theme="midnight"] .calendar-feed-row,
html[data-theme="ink"] .pill,
html[data-theme="ink"] .agenda-list .event-card,
html[data-theme="ink"] .calendar-settings-row,
html[data-theme="ink"] .calendar-picker-row,
html[data-theme="ink"] .calendar-account-card,
html[data-theme="ink"] .calendar-feed-row {
  background: linear-gradient(180deg, rgba(56, 63, 70, 0.95), rgba(47, 54, 60, 0.95));
  border-color: rgba(123, 131, 138, 0.34);
}

html[data-theme="midnight"] .nested-card,
html[data-theme="midnight"] #housework-list label,
html[data-theme="midnight"] .housework-debug,
html[data-theme="midnight"] .housework-debug-details,
html[data-theme="midnight"] .debug-details,
html[data-theme="midnight"] .auth-debug,
html[data-theme="midnight"] .auth-details,
html[data-theme="ink"] .nested-card,
html[data-theme="ink"] #housework-list label,
html[data-theme="ink"] .housework-debug,
html[data-theme="ink"] .housework-debug-details,
html[data-theme="ink"] .debug-details,
html[data-theme="ink"] .auth-debug,
html[data-theme="ink"] .auth-details {
  background: rgba(73, 80, 87, 0.45);
  border-color: rgba(122, 130, 138, 0.35);
}

html[data-theme="midnight"] .auth-debug-output,
html[data-theme="ink"] .auth-debug-output {
  background: rgba(30, 35, 40, 0.78);
}

html[data-theme="midnight"] .panel,
html[data-theme="ink"] .panel {
  background: rgba(21, 24, 28, 0.72);
}

html[data-theme="midnight"] .panel-sheet,
html[data-theme="midnight"] .modal-card,
html[data-theme="ink"] .panel-sheet,
html[data-theme="ink"] .modal-card {
  background: linear-gradient(180deg, rgba(47, 53, 59, 0.98), rgba(38, 44, 49, 0.98));
  border-color: rgba(124, 132, 139, 0.34);
}

html[data-theme="midnight"] .modal,
html[data-theme="ink"] .modal {
  background: rgba(17, 20, 24, 0.82);
}

html[data-theme="paper"],
html[data-theme="clean"] {
  --text: #22252a;
  --muted: #5f6872;
  --accent: #5c768c;
  --accent-2: #4f8c83;
  --focus: #3a6ea0;
  --shadow: 0 8px 18px rgba(50, 58, 68, 0.11);
}

html[data-theme="paper"] body,
html[data-theme="clean"] body {
  background:
    radial-gradient(920px 320px at 50% -18%, rgba(227, 232, 238, 0.42), transparent 74%),
    radial-gradient(860px 260px at 8% 14%, rgba(246, 248, 250, 0.5), transparent 76%),
    radial-gradient(860px 260px at 92% 18%, rgba(241, 245, 248, 0.48), transparent 76%),
    linear-gradient(180deg, #f4f6f8 0%, #f7f8fa 45%, #fbfcfd 100%);
}

html[data-theme="paper"] body::before,
html[data-theme="clean"] body::before {
  background:
    radial-gradient(420px 220px at 10% 18%, rgba(161, 177, 196, 0.12), transparent 74%),
    radial-gradient(520px 260px at 90% 22%, rgba(145, 166, 188, 0.1), transparent 76%);
}

html[data-theme="paper"] .app-header,
html[data-theme="clean"] .app-header {
  background: linear-gradient(170deg, #f2f5f8 0%, #ebeff3 52%, #e3e8ee 100%);
  border-bottom-color: rgba(121, 133, 147, 0.28);
}

html[data-theme="paper"] .card,
html[data-theme="paper"] .auth-card,
html[data-theme="paper"] .panel-sheet,
html[data-theme="paper"] .modal-card,
html[data-theme="clean"] .card,
html[data-theme="clean"] .auth-card,
html[data-theme="clean"] .panel-sheet,
html[data-theme="clean"] .modal-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 248, 251, 0.99));
  border-color: rgba(170, 180, 191, 0.26);
}

html[data-theme="paper"] .btn.primary,
html[data-theme="clean"] .btn.primary {
  background: linear-gradient(135deg, #607f98 0%, #4e6c84 100%);
  color: #f6fbff;
}

html[data-theme="paper"] .btn,
html[data-theme="clean"] .btn {
  background: linear-gradient(180deg, #ffffff, #f2f5f9);
  color: #1f2730;
  border-color: rgba(159, 172, 186, 0.34);
}

html[data-theme="paper"] .icon-btn,
html[data-theme="clean"] .icon-btn {
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  color: #2e3b49;
  border-color: rgba(157, 170, 184, 0.34);
}

html[data-theme="paper"] input,
html[data-theme="paper"] textarea,
html[data-theme="paper"] select,
html[data-theme="paper"] .pill,
html[data-theme="paper"] .agenda-list .event-card,
html[data-theme="paper"] .calendar-settings-row,
html[data-theme="paper"] .calendar-picker-row,
html[data-theme="paper"] .calendar-account-card,
html[data-theme="paper"] .calendar-feed-row,
html[data-theme="clean"] input,
html[data-theme="clean"] textarea,
html[data-theme="clean"] select,
html[data-theme="clean"] .pill,
html[data-theme="clean"] .agenda-list .event-card,
html[data-theme="clean"] .calendar-settings-row,
html[data-theme="clean"] .calendar-picker-row,
html[data-theme="clean"] .calendar-account-card,
html[data-theme="clean"] .calendar-feed-row {
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  border-color: rgba(166, 178, 191, 0.3);
  color: #25313d;
}

html[data-theme="paper"] .panel,
html[data-theme="clean"] .panel {
  background: rgba(42, 52, 64, 0.24);
}

html[data-theme="lagoon"],
html[data-theme="tide"] {
  --text: #0f2c3b;
  --muted: #3a6575;
  --accent: #2c9ad6;
  --accent-2: #20c2a6;
  --focus: #1d7fcc;
  --shadow: 0 10px 24px rgba(36, 113, 139, 0.2);
}

html[data-theme="lagoon"] body,
html[data-theme="tide"] body {
  background:
    radial-gradient(900px 320px at 50% -12%, rgba(70, 190, 255, 0.34), transparent 72%),
    radial-gradient(860px 260px at 8% 14%, rgba(159, 237, 255, 0.38), transparent 74%),
    radial-gradient(860px 260px at 92% 18%, rgba(185, 255, 233, 0.4), transparent 76%),
    linear-gradient(180deg, #ddf5ff 0%, #e7fbff 45%, #eefdfa 100%);
}

html[data-theme="lagoon"] body::before,
html[data-theme="tide"] body::before {
  background:
    radial-gradient(420px 220px at 10% 18%, rgba(85, 187, 255, 0.18), transparent 74%),
    radial-gradient(520px 260px at 90% 22%, rgba(70, 230, 198, 0.16), transparent 76%);
}

html[data-theme="lagoon"] .app-header,
html[data-theme="tide"] .app-header {
  background: linear-gradient(170deg, #58c7ff 0%, #41b7f6 52%, #3fceb0 100%);
  border-bottom-color: rgba(41, 143, 187, 0.44);
}

html[data-theme="lagoon"] .tabbar,
html[data-theme="tide"] .tabbar {
  background: linear-gradient(180deg, rgba(220, 245, 255, 0.98), rgba(203, 246, 239, 0.98));
  border-top-color: rgba(83, 176, 202, 0.45);
}

html[data-theme="lagoon"] .tab-btn,
html[data-theme="tide"] .tab-btn {
  color: #2f6c7f;
}

html[data-theme="lagoon"] .tab-btn.active,
html[data-theme="tide"] .tab-btn.active {
  background: linear-gradient(135deg, rgba(79, 182, 255, 0.78), rgba(62, 198, 174, 0.78));
  color: #083247;
}

html[data-theme="lagoon"] .btn,
html[data-theme="tide"] .btn {
  background: linear-gradient(180deg, #e6f8ff, #ccf2ff);
  color: #103243;
  border-color: rgba(83, 174, 205, 0.36);
}

html[data-theme="lagoon"] .btn.primary,
html[data-theme="tide"] .btn.primary {
  background: linear-gradient(135deg, #4bb9ff 0%, #3ecfae 100%);
  color: #053447;
}

html[data-theme="lagoon"] .icon-btn,
html[data-theme="tide"] .icon-btn {
  background: linear-gradient(180deg, #def5ff, #c9f0ff);
  color: #184153;
  border-color: rgba(83, 174, 205, 0.36);
}

html[data-theme="lagoon"] input,
html[data-theme="lagoon"] textarea,
html[data-theme="lagoon"] select,
html[data-theme="lagoon"] .pill,
html[data-theme="lagoon"] .agenda-list .event-card,
html[data-theme="lagoon"] .calendar-settings-row,
html[data-theme="lagoon"] .calendar-picker-row,
html[data-theme="lagoon"] .calendar-account-card,
html[data-theme="lagoon"] .calendar-feed-row,
html[data-theme="tide"] input,
html[data-theme="tide"] textarea,
html[data-theme="tide"] select,
html[data-theme="tide"] .pill,
html[data-theme="tide"] .agenda-list .event-card,
html[data-theme="tide"] .calendar-settings-row,
html[data-theme="tide"] .calendar-picker-row,
html[data-theme="tide"] .calendar-account-card,
html[data-theme="tide"] .calendar-feed-row {
  background: linear-gradient(180deg, #f3fdff, #e7fbff);
  color: #0f2f3e;
  border-color: rgba(92, 179, 206, 0.32);
}

html[data-theme="lagoon"] .nested-card,
html[data-theme="lagoon"] #housework-list label,
html[data-theme="lagoon"] .housework-debug,
html[data-theme="lagoon"] .housework-debug-details,
html[data-theme="lagoon"] .debug-details,
html[data-theme="lagoon"] .auth-debug,
html[data-theme="lagoon"] .auth-details,
html[data-theme="tide"] .nested-card,
html[data-theme="tide"] #housework-list label,
html[data-theme="tide"] .housework-debug,
html[data-theme="tide"] .housework-debug-details,
html[data-theme="tide"] .debug-details,
html[data-theme="tide"] .auth-debug,
html[data-theme="tide"] .auth-details {
  background: rgba(172, 238, 255, 0.42);
  border-color: rgba(86, 173, 200, 0.3);
}

html[data-theme="lagoon"] .auth-debug-output,
html[data-theme="tide"] .auth-debug-output {
  background: rgba(235, 252, 255, 0.95);
}

html[data-theme="lagoon"] .panel,
html[data-theme="tide"] .panel {
  background: rgba(25, 110, 136, 0.2);
}

html[data-theme="lagoon"] .panel-sheet,
html[data-theme="lagoon"] .modal-card,
html[data-theme="tide"] .panel-sheet,
html[data-theme="tide"] .modal-card {
  background: linear-gradient(180deg, rgba(240, 253, 255, 0.99), rgba(223, 248, 251, 0.99));
  border-color: rgba(87, 174, 202, 0.36);
}

html[data-theme="lagoon"] .modal,
html[data-theme="tide"] .modal {
  background: rgba(26, 104, 128, 0.28);
}

html[data-theme="aurora"] {
  --text: #1c2230;
  --muted: rgba(28, 34, 48, 0.68);
  --accent: #3f66e0;
  --accent-2: #3f66e0;
  --focus: #3f66e0;
  --shadow: 0 10px 26px rgba(25, 55, 130, 0.12);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-1: rgba(255, 255, 255, 0.9);
  --surface-2: rgba(238, 242, 255, 0.9);
  --border: rgba(80, 110, 190, 0.14);
  --border-strong: rgba(80, 110, 190, 0.22);
  --divider: rgba(80, 110, 190, 0.16);
  --focus-ring: 0 0 0 3px rgba(63, 102, 224, 0.35);
}

html[data-theme="aurora"] body {
  background-color: #eef2ff;
  background:
    radial-gradient(980px 360px at 8% -10%, rgba(226, 233, 255, 0.52), transparent 74%),
    radial-gradient(900px 320px at 90% 8%, rgba(221, 228, 255, 0.38), transparent 76%),
    linear-gradient(135deg, #6e8cff 0%, #86a4ff 42%, #aab3ff 72%, #d4d7ff 100%);
}

html[data-theme="aurora"] body::before {
  background:
    radial-gradient(430px 230px at 12% 18%, rgba(255, 255, 255, 0.2), transparent 74%),
    radial-gradient(520px 280px at 86% 20%, rgba(213, 222, 255, 0.2), transparent 76%);
}

html[data-theme="aurora"] .app-header {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.82) 0%, rgba(239, 245, 255, 0.9) 100%);
  border-bottom-color: rgba(80, 110, 190, 0.22);
}

html[data-theme="aurora"] .tabbar {
  background: linear-gradient(180deg, rgba(245, 248, 255, 0.96), rgba(235, 241, 255, 0.98));
  border-top-color: rgba(80, 110, 190, 0.24);
}

html[data-theme="aurora"] .tab-btn {
  color: #3e4f79;
}

html[data-theme="aurora"] .tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(223, 232, 255, 0.84));
  color: #1c2f62;
}

html[data-theme="aurora"] .card,
html[data-theme="aurora"] .auth-card,
html[data-theme="aurora"] .panel-sheet,
html[data-theme="aurora"] .modal-card {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(80, 110, 190, 0.14);
  box-shadow: 0 10px 26px rgba(25, 55, 130, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html[data-theme="aurora"] .btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 245, 255, 0.95));
  color: #1f2d4d;
  border-color: rgba(80, 110, 190, 0.22);
}

html[data-theme="aurora"] .btn.primary {
  background: linear-gradient(135deg, #3f66e0 0%, #365ccb 100%);
  color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="aurora"] .btn.primary:hover {
    background: linear-gradient(135deg, #365ccb 0%, #2f52b8 100%);
  }
}

html[data-theme="aurora"] .icon-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(236, 241, 255, 0.95));
  color: #26407f;
  border-color: rgba(80, 110, 190, 0.22);
}

html[data-theme="aurora"] input,
html[data-theme="aurora"] textarea,
html[data-theme="aurora"] select,
html[data-theme="aurora"] .pill,
html[data-theme="aurora"] .agenda-list .event-card,
html[data-theme="aurora"] .calendar-settings-row,
html[data-theme="aurora"] .calendar-picker-row,
html[data-theme="aurora"] .calendar-account-card,
html[data-theme="aurora"] .calendar-feed-row {
  background: rgba(255, 255, 255, 0.88);
  color: #1c2230;
  border-color: rgba(80, 110, 190, 0.22);
}

html[data-theme="aurora"] .chip,
html[data-theme="aurora"] .inspo-pill {
  border-color: rgba(80, 110, 190, 0.22);
  background: rgba(255, 255, 255, 0.76);
  color: #364a78;
}

html[data-theme="aurora"] button.chip.active {
  background: rgba(255, 255, 255, 0.94);
  border-color: #3f66e0;
  color: #1e2f5f;
  box-shadow: 0 0 0 1px rgba(63, 102, 224, 0.28) inset, 0 1px 2px rgba(20, 44, 108, 0.08);
}

html[data-theme="aurora"] .nested-card,
html[data-theme="aurora"] #housework-list label,
html[data-theme="aurora"] .housework-debug,
html[data-theme="aurora"] .housework-debug-details,
html[data-theme="aurora"] .debug-details,
html[data-theme="aurora"] .auth-debug,
html[data-theme="aurora"] .auth-details {
  background: rgba(63, 102, 224, 0.14);
  border-color: rgba(80, 110, 190, 0.24);
}

html[data-theme="aurora"] .auth-debug-output {
  background: rgba(241, 245, 255, 0.95);
}

html[data-theme="aurora"] .panel {
  background: rgba(33, 52, 108, 0.26);
}

html[data-theme="aurora"] .modal {
  background: rgba(23, 37, 86, 0.34);
}

html[data-theme="aurora"] a {
  color: #2f55cf;
}

html[data-theme="aurora"] .divider {
  background: rgba(80, 110, 190, 0.18);
}

html[data-theme="aurora"] input[type="checkbox"],
html[data-theme="aurora"] input[type="radio"] {
  accent-color: #3f66e0;
}

html[data-theme="highrise"] {
  --text: #20252b;
  --muted: #646d77;
  --accent: #5f6e80;
  --accent-2: #7d8794;
  --focus: #4d6888;
  --shadow: 0 10px 22px rgba(39, 48, 56, 0.16);
}

html[data-theme="highrise"] body {
  background: linear-gradient(180deg, #eef2f6 0%, #e7ebf0 50%, #edf0f4 100%);
}

html[data-theme="highrise"] .app-header {
  background: linear-gradient(170deg, #d9dfe6 0%, #cfd6de 52%, #c7cfd8 100%);
}

html[data-theme="highrise"] .btn.primary {
  background: linear-gradient(135deg, #6d7988 0%, #5b6674 100%);
  color: #f7f9fc;
}

html[data-theme="pastel"] {
  --text: #4a3b49;
  --muted: #806b7d;
  --accent: #b56fa8;
  --accent-2: #77b9c9;
  --focus: #9d5b90;
  --shadow: 0 10px 22px rgba(156, 111, 147, 0.18);
}

html[data-theme="pastel"] body {
  background:
    radial-gradient(900px 320px at 50% -10%, rgba(245, 203, 233, 0.36), transparent 72%),
    linear-gradient(180deg, #fff4fb 0%, #fdf6ff 48%, #f6fcff 100%);
}

html[data-theme="pastel"] .app-header {
  background: linear-gradient(170deg, #f1c8e9 0%, #eabee3 52%, #bfe5f2 100%);
}

html[data-theme="pastel"] .btn.primary {
  background: linear-gradient(135deg, #b66fa8 0%, #78b8ca 100%);
  color: #fff;
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem;
  min-height: 44px;
  width: 100%;
  text-transform: capitalize;
}

.theme-swatch-preview {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.theme-swatch[data-theme-swatch="aurora"] .theme-swatch-preview {
  border-color: rgba(80, 110, 190, 0.24);
}

.theme-swatch[data-theme-swatch="aurora"] .theme-swatch-preview::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 1.12rem;
  height: 0.76rem;
  transform: translate(-50%, -50%);
  border-radius: 0.28rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(80, 110, 190, 0.16);
  box-shadow: 0 4px 9px rgba(25, 55, 130, 0.14);
}

.theme-swatch-name {
  font-size: 0.85rem;
}

.theme-swatch.active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Bottom sheet variant (used for Add Project / Quick Add Note). */
body.modal-open {
  overflow: hidden;
  height: 100vh;
}

.modal {
  background: rgba(0, 0, 0, 0.34);
}

.modal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.modal.modal-confirm {
  background: rgba(0, 0, 0, 0.16);
}

.modal.modal-confirm .modal-card {
  background: rgba(255, 252, 244, 0.88);
  backdrop-filter: blur(8px);
}

.modal.modal-confirm.modal-sheet .modal-card {
  max-height: min(46vh, 360px);
}

.confirm-preview {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.45);
}

/* Car Mode: make sheets fully readable and suppress background clutter. */
body.car-mode-active.modal-open #car-mode-screen {
  opacity: 0.12;
}

body.car-mode-active .modal {
  background: rgba(0, 0, 0, 0.72);
}

body.car-mode-active .modal-card {
  background: rgba(14, 14, 16, 0.98);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

body.car-mode-active .modal-sheet-handle {
  background: rgba(255, 255, 255, 0.22);
}

body.car-mode-active .modal-sheet-x {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.car-mode-active .modal .muted {
  color: rgba(255, 255, 255, 0.72);
}

body.car-mode-active .modal .btn {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

body.car-mode-active .modal .btn.primary {
  background: rgba(0, 122, 255, 0.32);
  border-color: rgba(0, 122, 255, 0.60);
}

/* Car Mode sheets: big type + big controls (no squinting). */
body.car-mode-active .modal.modal-sheet .modal-card {
  font-size: 18px;
}

body.car-mode-active .modal.modal-sheet #modal-content h3 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 10px;
}

body.car-mode-active .modal.modal-sheet #modal-content p,
body.car-mode-active .modal.modal-sheet #modal-content label,
body.car-mode-active .modal.modal-sheet #modal-content .muted {
  font-size: 18px;
}

body.car-mode-active .modal.modal-sheet .btn {
  min-height: 64px;
  padding: 14px 16px;
  font-size: 20px;
  border-radius: 18px;
}

body.car-mode-active .modal.modal-sheet .event-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

body.car-mode-active .modal.modal-sheet .sheet-actions .btn {
  width: 100%;
}

body.car-mode-active .modal.modal-sheet #modal-close {
  min-height: 72px;
  font-size: 22px;
}

body.car-mode-active .modal-sheet-handle {
  width: 64px;
  height: 6px;
}

body.car-mode-active .modal-sheet-x {
  width: 56px;
  height: 56px;
  font-size: 28px;
}

body.car-mode-active .list-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body.car-mode-active .list-row:last-child {
  border-bottom: none;
}

body.car-mode-active .row-title {
  font-size: 22px;
  font-weight: 800;
}

body.car-mode-active .row-sub {
  margin-top: 6px;
  font-size: 18px;
}

.modal.modal-sheet {
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal.modal-sheet.modal-keep-tabbar {
  inset: 0 0 var(--modal-tabbar-offset, 0px) 0;
}

.modal.modal-sheet .modal-card {
  width: min(680px, 100vw);
  max-height: calc(92vh - var(--safe-top));
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px 18px 0 0;
  padding: var(--s-4);
  padding-bottom: calc(var(--s-4) + var(--safe-bottom) + var(--kb-inset, 0px));
  scroll-padding-bottom: calc(var(--s-7) + var(--kb-inset, 0px));
  transform: translateY(18px);
  animation: sheet-in 180ms ease-out forwards;
}

@keyframes sheet-in {
  from { transform: translateY(40px); }
  to { transform: translateY(0); }
}

.modal-sheet-chrome {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% + var(--s-4) + var(--s-4));
  margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-3);
  padding: var(--s-2) var(--s-4) var(--s-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider);
}

.modal-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.18);
}

.modal-sheet-x {
  position: absolute;
  right: 10px;
  top: max(10px, calc(env(safe-area-inset-top, 0px) + 6px));
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.modal.modal-sheet #modal-close {
  width: 100%;
  margin-top: var(--s-4);
}

.modal.modal-sheet #modal-content h3 {
  padding-right: 44px;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(15, 23, 42, 0.95);
  color: #ecfeff;
  font-weight: 600;
  transition: opacity 160ms ease, transform 160ms ease;
  max-width: min(88vw, 420px);
  text-align: center;
}

.app-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-toast.error {
  border-color: rgba(239, 68, 68, 0.45);
}

/* Smart Scan — in-progress banner */
#smart-scan-progress {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  pointer-events: none;
  z-index: 1300;
  padding: 9px 16px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.93);
  border: 1px solid rgba(99, 179, 237, 0.4);
  color: #bfdbfe;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#smart-scan-progress.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* DESIGN SYSTEM OVERRIDES */

h1 { font-size: clamp(1.6rem, 6vw, 1.9rem); line-height: var(--lh-tight); }
h2 { font-size: clamp(1.35rem, 5.4vw, 1.6rem); line-height: var(--lh-tight); }
h3 { font-size: 1.05rem; line-height: var(--lh-tight); }

.muted { color: var(--muted); }

.main {
  padding: var(--s-4);
  padding-top: calc(var(--s-3) + var(--safe-top));
  padding-bottom: calc(80px + var(--safe-bottom));
}

.section-intro {
  margin: 0 0 var(--s-4);
  font-size: var(--text-2);
  color: var(--muted);
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  box-shadow: none;
  padding: var(--s-4);
  margin-bottom: var(--s-5);
}

.card > h3 {
  margin-bottom: var(--s-3);
}

.nested-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: var(--s-4) 0 0;
}

.nested-card + .nested-card {
  border-top: 1px solid var(--divider);
  margin-top: var(--s-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border-radius: var(--r-1);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  font-weight: var(--w-semibold);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.btn.primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
  font-weight: var(--w-bold);
}

.btn:active,
.icon-btn:active,
.tab-btn:active,
.fab:active {
  transform: scale(0.98);
}

.btn:disabled,
.icon-btn:disabled,
.tab-btn:disabled,
.fab:disabled {
  opacity: 0.5;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select {
  min-height: 44px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select {
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  padding: 10px 12px;
}

textarea {
  line-height: var(--lh-loose);
}

label {
  gap: var(--s-2);
  font-size: var(--text-2);
  font-weight: var(--w-semibold);
  color: var(--text);
}

label.check-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s-3);
  flex-wrap: nowrap;
}

label.check-row input[type="checkbox"],
label.check-row input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: 0 0 auto;
}

.notifications-stack {
  margin-top: 12px;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.segmented-btn {
  flex: 1 1 0;
  border-radius: var(--r-pill);
  min-height: 40px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: var(--w-semibold);
}

.segmented-btn.active {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.chip {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

button.chip {
  min-height: 40px;
}

button.chip.active {
  background: var(--surface-1);
  border-color: var(--accent-2);
  color: var(--text);
  font-weight: var(--w-bold);
  box-shadow: 0 0 0 1px var(--accent-2) inset, 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(12px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  z-index: 12;
}

@supports not (backdrop-filter: blur(1px)) {
  .tabbar {
    background: #ffffff;
  }
}

@media (min-width: 900px) {
  .tabbar {
    left: 50%;
    right: auto;
    bottom: 14px;
    width: min(680px, calc(100vw - 32px));
    transform: translateX(-50%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    padding: 10px 12px;
  }
}

@media (max-width: 899px) {
  .tabbar {
    border-radius: 0;
  }
}

.agenda-controls {
  gap: var(--s-2);
}

.agenda-list {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--surface-1);
}

.agenda-list .event-card {
  background: transparent;
  padding: var(--s-4);
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--divider);
}

.agenda-list .event-card:last-child { border-bottom: none; }

.ai-summary-details {
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: var(--r-2);
  padding: var(--s-3);
}

.pill {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
}


/* Compact headers + dark-theme safety for new neutral surfaces. */
.today-hero { gap: var(--s-3); margin-bottom: var(--s-4); }
.today-title-text h2 { margin-bottom: 2px; }
.today-logo { margin-top: 2px; }
.tab-header { gap: var(--s-3); }

html[data-theme="ink"] .tabbar,
html[data-theme="midnight"] .tabbar {
  background: rgba(20, 28, 36, 0.88);
  border-top-color: rgba(148, 163, 184, 0.34);
}

html[data-theme="ink"] .pill,
html[data-theme="midnight"] .pill {
  background: rgba(13, 27, 30, 0.35);
  border-color: rgba(255, 255, 255, 0.14);
}


.sheet-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  margin-top: var(--s-4);
  background: var(--surface-2);
  border-top: 1px solid var(--divider);
}

.modal.modal-sheet .sheet-actions .btn {
  width: 100%;
}

/* iOS WebKit will zoom inputs if font-size < 16px. Keep form controls >= 16px. */
input, textarea, select {
  font-size: max(16px, 1rem);
}

.note-audio {
  width: 100%;
  margin-top: var(--s-2);
}

.brief-tabs {
  display: grid;
  gap: var(--s-3);
}

.brief-tabs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.brief-tab-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.brief-panel {
  display: none;
}

.brief-panel.active {
  display: block;
}

/* =========================
   CAR MODE (Ultra-Minimal)
   ========================= */

body.car-mode-active {
  overflow: hidden;
}

.car-mode {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: manipulation;
}

.car-mode-inner {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + var(--s-5)) var(--s-5) calc(env(safe-area-inset-bottom) + var(--s-5));
  gap: var(--s-6);
}

.car-exit {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--s-3));
  right: var(--s-4);
  min-height: 44px;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: var(--w-semibold);
}

.car-top {
  padding-top: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.car-time {
  font-size: clamp(56px, 11vw, 92px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.car-date {
  font-size: clamp(22px, 4.5vw, 34px);
  font-weight: var(--w-semibold);
  opacity: 0.92;
}

.car-status {
  font-size: clamp(18px, 3.6vw, 28px);
  font-weight: var(--w-medium);
  opacity: 0.86;
}

.car-next {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-3);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  padding: var(--s-6);
}

.car-next-label {
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: var(--w-semibold);
}

.car-next-title {
  font-size: clamp(28px, 5.6vw, 44px);
  line-height: 1.15;
  font-weight: 800;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.car-next-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}

.car-next-time {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 800;
  opacity: 0.9;
}

.car-next-countdown {
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 900;
  text-align: right;
}

.car-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.car-btn {
  min-height: 74px;
  padding: 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 800;
}

.car-btn-primary {
  background: rgba(0, 122, 255, 0.28);
  border-color: rgba(0, 122, 255, 0.55);
}

.car-exit:active,
.car-btn:active {
  transform: scale(0.99);
  filter: brightness(1.08);
}

@media (orientation: landscape) {
  .car-mode-inner {
    padding-top: calc(env(safe-area-inset-top) + var(--s-4));
    gap: var(--s-4);
  }
}

/* =========================
   NOW READABILITY REFACTOR
   ========================= */

#tab-now .now-intro {
  margin-bottom: var(--s-5);
  max-width: 60ch;
  line-height: 1.5;
}

#tab-now .now-section {
  padding: var(--s-5);
  border-radius: 18px;
  margin-bottom: var(--s-5);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74));
}

#tab-now .now-section .section-summary {
  align-items: center;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--divider);
}

#tab-now .now-section .section-summary .muted {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#tab-now .now-subsection {
  padding-top: var(--s-4);
}

#tab-now .now-subsection + .now-subsection {
  border-top: 1px solid var(--divider);
}

#tab-now #todays-focus {
  gap: var(--s-3);
}

#tab-now #todays-focus > .card {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-1);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  font-size: var(--text-2);
  line-height: 1.45;
}

#tab-now .now-next-step-btn {
  width: 100%;
  min-height: 48px;
  font-size: var(--text-3);
  letter-spacing: -0.01em;
}

#tab-now .now-next-step-card {
  margin: 0;
  border-color: rgba(46, 125, 246, 0.28);
  background: linear-gradient(180deg, rgba(46, 125, 246, 0.12), rgba(46, 125, 246, 0.05));
  font-weight: var(--w-semibold);
}

#tab-now #next-step-suggestion {
  gap: var(--s-3);
}

#tab-now .brief-panel.active {
  display: grid;
  gap: var(--s-4);
}

#tab-now .ai-summary-content {
  display: grid;
  gap: var(--s-3);
}

#tab-now .now-news {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
}

#tab-now .now-news .now-news-label {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6B7280;
  text-align: center;
}

#tab-now .now-news #news-feed-cards-clean {
  display: grid;
  gap: 28px;
  width: 100%;
  min-width: 0;
}

#tab-now .now-news .news-feed-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#tab-now .now-news .news-feed-card.is-clickable {
  cursor: pointer;
}

#tab-now .now-news .news-feed-card.is-clickable:focus-visible {
  outline: 2px solid var(--accent-2, #4F46E5);
  outline-offset: 2px;
}

#tab-now .now-news .news-feed-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding-bottom: 10px;
  border-bottom: 1px solid #E5E7EB;
}

#tab-now .now-news .news-feed-slot-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4B5563;
}

#tab-now .now-news .news-feed-time {
  font-size: 11px;
  color: #9CA3AF;
  white-space: nowrap;
}

#tab-now .now-news .news-feed-headline {
  margin: 14px 0 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  color: #111827;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#tab-now .now-news .news-feed-summary,
#tab-now .now-news .news-feed-placeholder {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#tab-now .now-news .news-feed-summary {
  color: #374151;
}

#tab-now .now-news .news-feed-placeholder {
  color: #6B7280;
}

#tab-now .now-news .news-feed-card-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  min-height: 18px;
  flex-wrap: wrap;
}

#tab-now .now-news .news-feed-read-time {
  font-size: 12px;
  color: #6B7280;
}

#tab-now .now-news .news-feed-read-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-2, #4F46E5);
  text-decoration: none;
  overflow-wrap: anywhere;
}

#tab-now .now-news .news-feed-read-link.is-disabled {
  color: #9CA3AF;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  #tab-now .now-news .news-feed-read-link:hover {
    text-decoration: underline;
  }
}

#tab-now .brief-section {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--divider);
  border-radius: var(--r-1);
  background: rgba(255, 255, 255, 0.66);
}

#tab-now .brief-heading {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#tab-now .brief-list {
  margin: 0;
  padding-left: 18px;
}

#tab-now .brief-list li {
  line-height: 1.45;
}

#tab-now .brief-paragraph {
  margin: 0;
  line-height: 1.45;
}

#tab-now .brief-section-next-small-step {
  border-color: rgba(46, 125, 246, 0.34);
  background: linear-gradient(180deg, rgba(46, 125, 246, 0.15), rgba(46, 125, 246, 0.08));
}

#tab-now .brief-section-next-small-step .brief-list li,
#tab-now .brief-section-next-small-step .brief-paragraph {
  font-weight: var(--w-semibold);
}

#tab-now .agenda-controls {
  margin-bottom: var(--s-3);
}

#tab-now .agenda-list .event-card {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
}

#tab-now .agenda-list .event-title strong {
  display: block;
  font-size: var(--text-3);
  line-height: 1.3;
}

#tab-now .agenda-list .event-location {
  font-size: 0.86rem;
}

#tab-now .agenda-list .event-description {
  padding: 8px 10px;
  border-left: 2px solid var(--divider);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
  line-height: 1.5;
  max-height: calc(1.5em * 4 + 16px);
  overflow-y: auto;
}

#tab-now .agenda-list .event-location:empty,
#tab-now .agenda-list .event-description:empty {
  display: none;
}

#tab-now .agenda-list .event-icon-row {
  margin-top: var(--s-1);
}

@media (max-width: 640px) {
  #tab-now .now-section {
    padding: var(--s-4);
  }

  #tab-now .now-news #news-feed-cards-clean {
    gap: 22px;
  }

  #tab-now .now-news .news-feed-card {
    padding: 14px;
  }

  #tab-now .now-news .news-feed-headline {
    font-size: 16px;
  }

  #tab-now .now-news .news-feed-summary,
  #tab-now .now-news .news-feed-placeholder {
    font-size: 14px;
  }
}

html[data-theme="midnight"] #tab-now .now-section,
html[data-theme="ink"] #tab-now .now-section {
  background: linear-gradient(180deg, rgba(54, 61, 68, 0.96), rgba(46, 53, 60, 0.92));
}

html[data-theme="midnight"] #tab-now .now-news .news-feed-card,
html[data-theme="ink"] #tab-now .now-news .news-feed-card {
  background: #111827;
  border-color: #1F2937;
}

html[data-theme="midnight"] #tab-now .now-news .now-news-label,
html[data-theme="ink"] #tab-now .now-news .now-news-label {
  color: #9CA3AF;
}

html[data-theme="midnight"] #tab-now .now-news .news-feed-card-top,
html[data-theme="ink"] #tab-now .now-news .news-feed-card-top,
html[data-theme="midnight"] #tab-now .now-news .news-feed-card-footer,
html[data-theme="ink"] #tab-now .now-news .news-feed-card-footer {
  border-color: #1F2937;
}

html[data-theme="midnight"] #tab-now .now-news .news-feed-slot-label,
html[data-theme="ink"] #tab-now .now-news .news-feed-slot-label,
html[data-theme="midnight"] #tab-now .now-news .news-feed-time,
html[data-theme="ink"] #tab-now .now-news .news-feed-time,
html[data-theme="midnight"] #tab-now .now-news .news-feed-read-time,
html[data-theme="ink"] #tab-now .now-news .news-feed-read-time,
html[data-theme="midnight"] #tab-now .now-news .news-feed-placeholder,
html[data-theme="ink"] #tab-now .now-news .news-feed-placeholder {
  color: #9CA3AF;
}

html[data-theme="midnight"] #tab-now .now-news .news-feed-headline,
html[data-theme="ink"] #tab-now .now-news .news-feed-headline {
  color: #F3F4F6;
}

html[data-theme="midnight"] #tab-now .now-news .news-feed-summary,
html[data-theme="ink"] #tab-now .now-news .news-feed-summary {
  color: #D1D5DB;
}

html[data-theme="midnight"] #tab-now #todays-focus > .card,
html[data-theme="midnight"] #tab-now .brief-section,
html[data-theme="midnight"] #tab-now .agenda-list .event-description,
html[data-theme="ink"] #tab-now #todays-focus > .card,
html[data-theme="ink"] #tab-now .brief-section,
html[data-theme="ink"] #tab-now .agenda-list .event-description {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

/* =========================
   NOW DECLUTTER REFACTOR
   ========================= */

#tab-now {
  max-width: 780px;
  margin: 0 auto;
}

#tab-now .now-intro {
  margin-bottom: var(--s-4);
  max-width: 44ch;
}

#tab-now .now-section {
  margin-bottom: var(--s-4);
  padding: var(--s-4);
  border-radius: 16px;
}

#tab-now .now-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

#tab-now .now-section-head h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

#tab-now .now-mode-card {
  margin-top: 0;
}

#tab-now .now-mode-head {
  margin-bottom: var(--s-2);
}

#tab-now .now-mode-segmented .segmented-btn {
  min-height: 38px;
  font-size: 0.92rem;
}

#tab-now .now-execution {
  display: grid;
  gap: var(--s-3);
}

#tab-now .now-execution-card {
  margin-bottom: 0;
}

#tab-now .now-execution-main-text {
  margin: 0;
  font-size: 1.2rem;
  font-weight: var(--w-semibold);
  line-height: 1.35;
}

#tab-now .now-execution-field-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}

#tab-now .now-execution-next-card {
  border-color: rgba(59, 130, 246, 0.26);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.11), rgba(255, 255, 255, 0.95));
}

#tab-now .now-execution-next-text {
  margin: 0 0 var(--s-3);
  font-size: 1.08rem;
  font-weight: var(--w-semibold);
  line-height: 1.4;
}

#tab-now .now-execution-actions {
  flex-wrap: wrap;
}

#tab-now .now-execution-timer-time {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

#tab-now .now-execution-progress {
  width: 100%;
  height: 8px;
  margin: var(--s-3) 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

#tab-now .now-execution-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.74), rgba(14, 165, 233, 0.74));
  transition: width 300ms ease;
}

#tab-now .now-execution-inline-form {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

#tab-now .now-execution-inline-form .input {
  flex: 1 1 auto;
}

#tab-now .now-execution-parking-card {
  border-color: rgba(245, 158, 11, 0.26);
}

#tab-now .now-execution-momentum-card {
  border-color: rgba(16, 185, 129, 0.28);
}

#tab-now .now-execution-list-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

#tab-now .now-execution-list-mark {
  color: var(--muted);
  font-weight: 700;
}

#tab-now .now-execution-list-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

#tab-now .now-execution-remove-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  #tab-now .now-execution-field-row {
    flex-direction: column;
  }

  #tab-now .now-execution-field-row .btn {
    width: 100%;
  }

  #tab-now .now-execution-inline-form {
    flex-direction: column;
  }
}

#tab-now .now-calendar-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  font-size: 0.8em;
  line-height: 1;
  color: #b45309;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

#tab-now .now-section-head .muted {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#tab-now .now-section-environment .atmosphere-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  width: 100%;
}

#tab-now .now-section-environment .weather-pill {
  flex: 0 1 auto;
  max-width: 100%;
}

#tab-now .now-section-environment .aqi-pill {
  flex: 0 1 auto;
  justify-content: center;
}

#tab-now .now-next-up-list {
  display: grid;
  gap: var(--s-2);
  border: none;
  background: transparent;
}

#tab-now .now-next-up-list .event-card {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--divider);
  border-radius: var(--r-1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

#tab-now .now-next-up-list .event-title strong {
  font-size: 1rem;
  line-height: 1.35;
}

#tab-now .now-next-up-list .event-location {
  margin-top: 2px;
  line-height: 1.4;
}

#tab-now .now-section-look-ahead {
  border-color: rgba(69, 86, 105, 0.16);
}

#tab-now .now-look-ahead-head {
  align-items: flex-start;
  margin-bottom: var(--s-2);
}

#tab-now .now-look-ahead-headings {
  display: grid;
  gap: 2px;
}

#tab-now .now-look-ahead-subtitle {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

#tab-now .icon-btn.ai-brief-refresh.now-look-ahead-refresh {
  margin-left: auto;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 10px;
}

#tab-now .ai-brief-refresh-icon.look-ahead-refresh-icon {
  width: 16px;
  height: 16px;
}

#tab-now .now-look-ahead-controls {
  gap: 6px;
  margin-bottom: var(--s-3);
}

#tab-now .now-look-ahead-chip {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: var(--w-semibold);
}

#tab-now .now-look-ahead-content {
  display: grid;
  gap: var(--s-3);
}

#tab-now .now-look-ahead-day {
  display: grid;
  gap: 8px;
}

#tab-now .now-look-ahead-day + .now-look-ahead-day {
  padding-top: var(--s-2);
  border-top: 1px solid var(--divider);
}

#tab-now .now-look-ahead-day-head h4 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

#tab-now .now-look-ahead-day-events {
  display: grid;
  gap: 6px;
}

#tab-now .now-look-ahead-event {
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
}

#tab-now .now-look-ahead-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

#tab-now .now-look-ahead-event-time {
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

#tab-now .now-look-ahead-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

#tab-now .now-look-ahead-badge {
  font-size: 0.66rem;
  font-weight: var(--w-semibold);
  letter-spacing: 0.01em;
  background: rgba(69, 86, 105, 0.08);
  border-color: rgba(69, 86, 105, 0.18);
  color: var(--muted);
}

#tab-now .now-look-ahead-event-title,
#tab-now .now-look-ahead-event-location {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-now .now-look-ahead-event-title {
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text);
}

#tab-now .now-look-ahead-event-location {
  margin-top: 2px;
  font-size: 0.8rem;
}

#tab-now .now-look-ahead-more,
#tab-now .now-look-ahead-try-three {
  justify-self: flex-start;
  min-height: auto;
  padding: 0;
  font-size: 0.82rem;
}

#tab-now .now-look-ahead-empty p {
  margin: 0 0 6px;
}

#tab-now .now-briefCard {
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
}

#tab-now .now-focusCard {
  border-color: rgba(69, 86, 105, 0.22);
  box-shadow: var(--shadow-1);
}

#tab-now .now-briefTitle,
#tab-now .now-focusTitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

#tab-now .now-briefTitle {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  font-weight: var(--w-medium);
}

#tab-now .icon-btn.ai-brief-refresh {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 0;
  transition: transform 120ms ease, filter 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

#tab-now .ai-brief-refresh-icon {
  width: 18px;
  height: 18px;
  display: block;
}

#tab-now .icon-btn.ai-brief-refresh:hover {
  background: rgba(46, 125, 246, 0.08);
}

#tab-now .icon-btn.ai-brief-refresh:active {
  transform: scale(0.97);
}

#tab-now .icon-btn.ai-brief-refresh[data-loading="true"] {
  opacity: 0.62;
  cursor: wait;
}

#tab-now .icon-btn.ai-brief-refresh[data-loading="true"] .ai-brief-refresh-icon {
  opacity: 0.75;
}

#tab-now .icon-btn.ai-brief-refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#tab-now .now-focusTitle {
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: var(--w-semibold);
}

#tab-now .now-briefTitle::before,
#tab-now .now-focusTitle::before {
  margin-right: 8px;
  font-size: 14px;
  line-height: 1;
}

#tab-now .now-briefTitle::before {
  content: "🧭";
  opacity: 0.75;
}

#tab-now .now-focusTitle::before {
  content: "🎯";
  opacity: 0.85;
}

#tab-now .now-daily-brief {
  display: grid;
  gap: 8px;
  max-width: 66ch;
}

#tab-now .now-briefList,
#tab-now .now-focusList,
#tab-now .now-focus-list {
  margin: 0;
  padding-left: 18px;
}

#tab-now .now-briefList > * {
  position: relative;
  margin: 6px 0;
  padding-left: 12px;
  line-height: 1.45;
  font-size: 0.9rem;
  color: var(--muted);
}

#tab-now .now-briefList > *::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--muted);
}

#tab-now .now-daily-brief p {
  margin: 6px 0;
}

#tab-now .now-briefList li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

#tab-now .now-briefList li:first-child,
#tab-now .now-briefList > *:first-child {
  font-weight: 650;
  color: var(--text);
}

#tab-now .now-focus-content {
  gap: var(--s-3);
}

#tab-now .now-focus-list {
  display: grid;
  gap: 2px;
}

#tab-now .now-focus-list li,
#tab-now .now-focusList li {
  margin: 6px 0;
  line-height: 1.5;
  font-size: 1rem;
  color: var(--text);
}

#tab-now .now-focus-next-step {
  margin: 0;
  padding: var(--s-3);
  border: 1px solid rgba(46, 125, 246, 0.28);
  border-radius: var(--r-1);
  background: linear-gradient(180deg, rgba(46, 125, 246, 0.12), rgba(46, 125, 246, 0.05));
  line-height: 1.45;
}

#tab-now .now-focus-next-step-label {
  font-weight: var(--w-semibold);
}

#tab-now .now-focus-body-check {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

#tab-now .now-focus-body-check-label {
  font-weight: var(--w-semibold);
  color: var(--text);
}

#tab-now .now-self-care-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: var(--s-4);
}

#tab-now .now-self-care-link,
#tab-now .now-selfCareLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  opacity: 0.9;
}

#tab-now .now-self-care-link:hover,
#tab-now .now-selfCareLink:hover {
  opacity: 1;
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.16);
}

#health-mental-section.is-targeted {
  border-radius: 14px;
  outline: 2px solid rgba(46, 125, 246, 0.35);
  outline-offset: 4px;
}

#tab-capture #capture-view-workouts {
  padding-bottom: calc(18px + var(--safe-bottom));
}

#tab-capture .workouts-screen {
  --workouts-bg: #0b1320;
  --workouts-bg-soft: #111d2d;
  --workouts-card-bg: rgba(20, 31, 47, 0.94);
  --workouts-border: rgba(126, 156, 186, 0.28);
  --workouts-text: #e6eef9;
  --workouts-muted: #a8b7cc;
  --workouts-accent: #67a3da;
  --workouts-accent-soft: rgba(103, 163, 218, 0.22);
  display: grid;
  gap: 16px;
  padding: calc(10px + var(--safe-top)) 2px calc(6px + var(--safe-bottom));
  border-radius: 18px;
  color: var(--workouts-text);
  background:
    radial-gradient(120% 90% at 0% -30%, rgba(87, 124, 173, 0.2), transparent 72%),
    radial-gradient(90% 70% at 95% -18%, rgba(74, 118, 160, 0.16), transparent 76%),
    linear-gradient(165deg, var(--workouts-bg) 0%, var(--workouts-bg-soft) 65%, #0a101b 100%);
  border: 1px solid rgba(132, 158, 187, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#tab-capture .workouts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px;
}

#tab-capture .workouts-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#tab-capture .workouts-brand-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: brightness(1.1) contrast(1.05);
}

#tab-capture .workouts-brand-text {
  display: grid;
  gap: 2px;
}

#tab-capture .workouts-brand-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--workouts-muted);
}

#tab-capture .workouts-brand-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--workouts-text);
}

#tab-capture .workouts-avatar {
  min-width: 40px;
  min-height: 40px;
  border-color: rgba(190, 214, 236, 0.32);
  background: rgba(225, 238, 255, 0.06);
  color: var(--workouts-text);
}

#tab-capture .workouts-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px;
}

#tab-capture .workouts-date-label {
  font-size: 0.9rem;
  color: var(--workouts-muted);
  letter-spacing: 0.01em;
}

#tab-capture .workouts-end-btn {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(104, 146, 186, 0.4);
  background: rgba(80, 127, 170, 0.18);
  color: var(--workouts-text);
}

#tab-capture .workouts-logged {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(130, 156, 183, 0.34);
  background: rgba(102, 136, 168, 0.2);
  color: var(--workouts-text);
  font-size: 0.8rem;
  font-weight: 600;
}

#tab-capture .workouts-logged-muted {
  opacity: 0.74;
}

#tab-capture .workouts-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--workouts-border);
  background: linear-gradient(180deg, rgba(28, 42, 61, 0.92), var(--workouts-card-bg));
  box-shadow: 0 8px 22px rgba(3, 8, 15, 0.34);
}

#tab-capture .workouts-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

#tab-capture .workouts-card-head h4 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--workouts-text);
}

#tab-capture .workouts-card-head .muted {
  color: var(--workouts-muted);
}

#tab-capture .workouts-card-head-stack {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

#tab-capture .workouts-list {
  display: grid;
  gap: 8px;
}

#tab-capture .workouts-item-row {
  width: 100%;
  min-height: 50px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(127, 155, 183, 0.28);
  background: rgba(15, 25, 39, 0.52);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

#tab-capture .workouts-item-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#tab-capture .workouts-item-name {
  font-size: 0.95rem;
  font-weight: 620;
  color: var(--workouts-text);
}

#tab-capture .workouts-item-summary {
  font-size: 0.83rem;
  color: var(--workouts-muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

#tab-capture .workouts-item-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#tab-capture .workouts-note-dot {
  display: inline-flex;
  min-width: 18px;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--workouts-muted);
  font-size: 1rem;
  line-height: 1;
}

#tab-capture .workouts-complete-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(110, 149, 189, 0.45);
  color: var(--workouts-text);
  font-size: 0.75rem;
  background: rgba(82, 127, 171, 0.16);
}

#tab-capture .workouts-complete-dot {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid rgba(103, 163, 218, 0.9);
  color: var(--workouts-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  line-height: 1;
}

/* Scan-imported workout items — teal/green to distinguish from default blue */
#tab-capture .workouts-item-scanned {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(52, 211, 153, 0.4);
}

#tab-capture .workouts-item-scanned .workouts-item-name {
  color: #6ee7b7;
}

#tab-capture .workouts-scan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #34d399;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

#tab-capture .workouts-complete-pill-scan {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

#tab-capture .workouts-complete-pill-scan .workouts-complete-dot {
  border-color: rgba(52, 211, 153, 0.9);
  color: #34d399;
}

#tab-capture .workouts-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#tab-capture .workouts-actions .btn {
  min-height: 44px;
}

#tab-capture .workouts-empty {
  border: 1px dashed rgba(126, 156, 186, 0.34);
  border-radius: 12px;
  padding: 12px;
  color: var(--workouts-muted);
}

#tab-capture .workouts-plan-list {
  display: grid;
  gap: 8px;
}

#tab-capture .workouts-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid rgba(126, 156, 186, 0.24);
  border-radius: 12px;
  background: rgba(14, 23, 35, 0.42);
  padding: 8px;
}

#tab-capture .workouts-plan-main {
  min-height: 44px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

#tab-capture .workouts-plan-icon {
  width: 18px;
  color: rgba(206, 221, 238, 0.92);
  font-size: 0.92rem;
  flex-shrink: 0;
  text-align: center;
}

#tab-capture .workouts-plan-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

#tab-capture .workouts-plan-name {
  font-size: 0.94rem;
  font-weight: 610;
  color: var(--workouts-text);
}

#tab-capture .workouts-plan-target {
  font-size: 0.82rem;
  color: var(--workouts-muted);
  overflow-wrap: anywhere;
}

#tab-capture .workouts-plan-alt-chip {
  min-height: 34px;
  align-self: start;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid rgba(105, 148, 189, 0.42);
  background: rgba(80, 126, 168, 0.16);
  color: var(--workouts-text);
  font-size: 0.75rem;
  font-weight: 600;
}

#tab-capture .workouts-plan-alt,
#tab-capture .workouts-plan-note {
  grid-column: 1 / -1;
  padding: 0 4px 4px 30px;
  color: var(--workouts-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

#tab-capture .workouts-plan-note {
  color: #c0d1e6;
}

#tab-capture .workouts-tips {
  border: 1px solid rgba(114, 149, 182, 0.34);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(58, 88, 120, 0.17);
}

#tab-capture .workouts-tips-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--workouts-muted);
  margin-bottom: 6px;
}

#tab-capture .workouts-tips-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--workouts-text);
  font-size: 0.86rem;
}

#tab-capture .workouts-sheet-content h3 {
  margin: 0;
}

@media (max-width: 520px) {
  #tab-capture .workouts-actions {
    flex-direction: column;
  }
  #tab-capture .workouts-actions .btn {
    width: 100%;
  }
  #tab-capture .workouts-plan-row {
    grid-template-columns: 1fr;
  }
  #tab-capture .workouts-plan-alt-chip {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tab-capture .workouts-item-row,
  #tab-capture .workouts-plan-main,
  #tab-capture .workouts-plan-alt-chip,
  #tab-capture .workouts-end-btn {
    transition: none !important;
  }
}

@media (max-width: 640px) {
  #tab-now .now-section {
    padding: var(--s-3);
  }

  #tab-now .now-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #tab-now .now-section-daily-brief .now-section-head {
    flex-direction: row;
    align-items: center;
  }

  #tab-now .now-section-look-ahead .now-section-head {
    flex-direction: row;
    align-items: flex-start;
  }

  #tab-now .now-look-ahead-controls {
    gap: 4px;
  }

  #tab-now .now-look-ahead-chip {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  #tab-now .now-look-ahead-event {
    padding: 8px 9px;
  }

  #tab-now .now-look-ahead-event-title {
    font-size: 0.88rem;
  }

  #tab-now .now-look-ahead-event-location {
    font-size: 0.76rem;
  }

  #tab-now .now-section-head .muted {
    letter-spacing: 0.05em;
  }

  #tab-now .now-section-environment .weather-pill,
  #tab-now .now-section-environment .aqi-pill {
    flex: 0 1 auto;
    max-width: 100%;
  }

  #tab-now .now-daily-brief p {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  #tab-now .now-focus-list li,
  #tab-now .now-focusList li {
    font-size: 0.94rem;
  }
}

@media (prefers-color-scheme: dark) {
  html[data-theme="midnight"] #tab-now .now-briefCard,
  html[data-theme="ink"] #tab-now .now-briefCard {
    background: rgba(120, 170, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  #tab-now .now-self-care-link,
  #tab-now .now-selfCareLink {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
  }

  #tab-now .icon-btn.ai-brief-refresh {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
  }

  #tab-now .icon-btn.ai-brief-refresh:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  #tab-now .now-look-ahead-event {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.13);
  }

  #tab-now .now-look-ahead-day + .now-look-ahead-day {
    border-top-color: rgba(255, 255, 255, 0.12);
  }
}

html[data-theme="midnight"] #tab-now .now-briefCard,
html[data-theme="ink"] #tab-now .now-briefCard {
  background: rgba(120, 170, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="midnight"] #tab-now .now-self-care-link,
html[data-theme="midnight"] #tab-now .now-selfCareLink,
html[data-theme="ink"] #tab-now .now-self-care-link,
html[data-theme="ink"] #tab-now .now-selfCareLink {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="midnight"] #tab-now .icon-btn.ai-brief-refresh,
html[data-theme="ink"] #tab-now .icon-btn.ai-brief-refresh {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="midnight"] #tab-now .now-look-ahead-event,
html[data-theme="ink"] #tab-now .now-look-ahead-event {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="midnight"] #tab-now .now-look-ahead-day + .now-look-ahead-day,
html[data-theme="ink"] #tab-now .now-look-ahead-day + .now-look-ahead-day {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Action List Modal Styles */
.action-list-root {
  display: grid;
  gap: 12px;
}

.action-group-details {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--surface-1);
  overflow: hidden;
}

.action-group-summary {
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.action-group-items {
  padding: 8px 14px 14px;
  gap: 12px;
}

.action-item-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.action-item-row .check-row {
  align-items: flex-start;
}

.action-title {
  line-height: 1.35;
  font-weight: 600;
}

.action-details {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 28px;
}

.action-source {
  margin-left: 28px;
  margin-top: 4px;
}

.action-source summary {
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.8;
}

.action-source .small {
  font-size: 0.8rem;
  white-space: pre-wrap;
  margin-top: 4px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}

/* Dark mode adjustments */
html[data-theme="midnight"] .action-group-details,
html[data-theme="ink"] .action-group-details {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="midnight"] .action-group-summary,
html[data-theme="ink"] .action-group-summary {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="midnight"] .action-item-row,
html[data-theme="ink"] .action-item-row {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}

/* ── Scan Insight Cards (Data tab) ──────────────────────────────────────── */

.scan-insights-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 0 24px;
  overflow-y: auto;
}

.insight-group {
  margin-bottom: 16px;
}

.insight-group-header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #888);
  padding: 0 16px 6px;
}

.insight-card {
  background: var(--surface-1, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  margin: 0 12px 10px;
  padding: 14px 16px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s ease;
}

.insight-card:active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.insight-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.insight-icon-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insight-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #1a202c);
  line-height: 1.3;
}

.insight-subtitle {
  font-size: 0.8rem;
  color: var(--muted, #718096);
}

.insight-date {
  font-size: 0.75rem;
  color: var(--muted, #a0aec0);
  white-space: nowrap;
  padding-top: 2px;
}

.insight-primary-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface, #f7fafc);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  text-align: center;
}

.insight-primary-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent, #3182ce);
  line-height: 1.1;
}

.insight-primary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted, #718096);
  margin-top: 2px;
}

.insight-metrics {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.insight-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.insight-metric-label {
  color: var(--muted, #718096);
}

.insight-metric-value {
  font-weight: 600;
  color: var(--text, #2d3748);
}

button.insight-raw-toggle {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 0.78rem;
  color: var(--accent, #3182ce);
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  opacity: 0.8;
}

button.insight-raw-toggle:active {
  opacity: 1;
}

.insight-raw-text {
  margin-top: 8px;
  border-top: 1px solid var(--border, #e2e8f0);
  padding-top: 8px;
}

.insight-raw-text.hidden {
  display: none;
}

.insight-raw-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted, #a0aec0);
  margin-bottom: 4px;
}

.insight-raw-content {
  font-size: 0.8rem;
  color: var(--text, #4a5568);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.insight-empty {
  text-align: center;
  color: var(--muted, #a0aec0);
  font-size: 0.9rem;
  padding: 40px 20px;
}

/* Dark theme overrides for insight cards */
html[data-theme="midnight"] .insight-card,
html[data-theme="ink"] .insight-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="midnight"] .insight-primary-metric,
html[data-theme="ink"] .insight-primary-metric {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="midnight"] .insight-title,
html[data-theme="ink"] .insight-title {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="midnight"] .insight-metric-value,
html[data-theme="ink"] .insight-metric-value {
  color: rgba(255, 255, 255, 0.85);
}

html[data-theme="midnight"] .insight-raw-text,
html[data-theme="ink"] .insight-raw-text {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="midnight"] .insight-raw-content,
html[data-theme="ink"] .insight-raw-content {
  color: rgba(255, 255, 255, 0.7);
}

.insight-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.insight-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted, #718096);
  margin-bottom: 6px;
}

.insight-empty-body {
  font-size: 0.82rem;
  color: var(--muted, #a0aec0);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Insight card edit/delete action buttons */
.insight-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.insight-action-btns {
  display: flex;
  gap: 4px;
}

.insight-action-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  opacity: 0.65;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, background 0.15s;
}

.insight-action-btn:active,
.insight-action-btn:hover {
  opacity: 1;
  background: var(--surface-2, rgba(0,0,0,0.07));
}

/* ════════════════════════════════════════════════════════════════════
   NOW PAGE REDESIGN
   ════════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────────── */

#tab-now .now-redesign-hero {
  margin-bottom: 14px;
}

/* Suppress old "Now" h2 — date line replaces it */
#tab-now .now-redesign-hero .today-title-text h2 {
  display: none;
}

.now-hero-dayname {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.1;
  margin-bottom: 1px;
}

/* Big live clock */
.now-hero-clock-row {
  padding: 10px 0 2px;
}

.now-hero-clock {
  font-size: clamp(56px, 18vw, 80px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.now-hero-ampm {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
  vertical-align: super;
  margin-left: 5px;
}

.now-hero-time-colon {
  opacity: 0.38;
}

/* Inline weather strip */
.now-hero-weather-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 8px;
  flex-wrap: wrap;
}

.now-hero-weather-main {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.now-hero-weather-icon {
  font-size: 17px;
  line-height: 1;
}

.now-hero-weather-temps {
  display: flex;
  gap: 5px;
  font-size: 13px;
}

.now-hero-weather-high {
  font-weight: 600;
  color: var(--text);
}

.now-hero-weather-low {
  color: var(--muted);
}

.now-hero-weather-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  border-radius: 1px;
  flex-shrink: 0;
}

.now-hero-aqi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.25);
  line-height: 1.5;
}

html[data-theme="midnight"] .now-hero-aqi-badge,
html[data-theme="ink"] .now-hero-aqi-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.2);
}

/* ── Spotlight card ─────────────────────────────────────────────────── */

#tab-now .now-spotlight {
  margin-bottom: 14px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  padding: 16px 18px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(224, 122, 45, 0.22);
}

#tab-now .now-spotlight.hidden {
  display: none;
}

html[data-theme="midnight"] #tab-now .now-spotlight,
html[data-theme="ink"] #tab-now .now-spotlight {
  background: linear-gradient(135deg, #1d3461 0%, #162746 100%);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.5);
}

html[data-theme="lagoon"] #tab-now .now-spotlight,
html[data-theme="tide"] #tab-now .now-spotlight {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  box-shadow: 0 4px 28px rgba(8, 145, 178, 0.3);
}

html[data-theme="aurora"] #tab-now .now-spotlight {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 4px 28px rgba(124, 58, 237, 0.3);
}

.now-spotlight-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.68;
  margin-bottom: 5px;
}

.now-spotlight-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  padding-right: 84px; /* don't overlap countdown */
}

.now-spotlight-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.86;
  flex-wrap: wrap;
}

.now-spotlight-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex-shrink: 0;
}

.now-spotlight-cal-badge {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.now-spotlight-countdown {
  position: absolute;
  top: 16px;
  right: 18px;
  text-align: right;
}

.now-spotlight-countdown-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  opacity: 0.96;
}

.now-spotlight-countdown-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.58;
  margin-top: 2px;
  text-align: right;
}

.now-spotlight-in-progress {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Section label dividers ─────────────────────────────────────────── */

#tab-now .now-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
}

#tab-now .now-label-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

#tab-now .now-label-line {
  flex: 1;
  height: 1px;
  background: var(--divider);
}

/* ── Timeline (Schedule section) ────────────────────────────────────── */

#tab-now .now-timeline-list {
  padding: 2px 0 4px !important;
  gap: 0 !important;
  background: transparent !important;
  border: none !important;
}

#tab-now .timeline-row {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
}

#tab-now .timeline-row + .timeline-row {
  border-top: 1px solid var(--divider);
}

#tab-now .timeline-left {
  width: 50px;
  flex-shrink: 0;
  padding-top: 3px;
  line-height: 1;
}

#tab-now .timeline-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

#tab-now .timeline-time-ampm {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}

#tab-now .timeline-dot-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  flex-shrink: 0;
  padding-top: 4px;
}

#tab-now .timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 0 1.5px var(--accent-2);
}

#tab-now .timeline-dot.dot-next {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  width: 11px;
  height: 11px;
  border-width: 2px;
}

#tab-now .timeline-dot.dot-work {
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

#tab-now .timeline-dot.dot-muted {
  background: var(--border);
  box-shadow: 0 0 0 1.5px var(--border);
}

#tab-now .timeline-connector {
  width: 1.5px;
  flex: 1;
  min-height: 14px;
  background: var(--divider);
  margin-top: 3px;
}

#tab-now .timeline-content {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  padding-right: 4px;
}

#tab-now .timeline-event-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-now .timeline-event-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-now .timeline-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(46, 125, 246, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(46, 125, 246, 0.18);
  align-self: flex-start;
  margin-top: 4px;
}

#tab-now .timeline-badge.badge-orange {
  background: rgba(224, 122, 45, 0.1);
  color: var(--accent);
  border-color: rgba(224, 122, 45, 0.2);
}

/* ── Look Ahead chip layout ──────────────────────────────────────────── */

#tab-now .now-look-ahead-content {
  padding-bottom: 2px;
}

#tab-now .lookahead-day {
  padding: 10px 0 8px;
}

#tab-now .lookahead-day + .lookahead-day {
  border-top: 1px solid var(--divider);
}

#tab-now .lookahead-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

#tab-now .lookahead-day-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

#tab-now .lookahead-day-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

#tab-now .lookahead-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#tab-now .lookahead-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  max-width: 100%;
}

#tab-now .lookahead-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
}

#tab-now .lookahead-chip-dot.work {
  background: var(--accent);
}

#tab-now .lookahead-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* ── Today's Focus – updated title casing ──────────────────────────── */

#tab-now .now-focusTitle {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ── Self-care strip – 3-button flex row ────────────────────────────── */

#tab-now .now-redesign-strip {
  display: flex;
  gap: 8px;
}

#tab-now .now-redesign-strip .now-selfCareLink {
  flex: 1;
  text-align: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-1);
  color: var(--text);
  min-height: 44px;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

#tab-now .now-redesign-strip .now-selfCareLink:active {
  background: var(--surface-2);
}

.now-selfcare-extra-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.now-selfcare-extra-btn:active {
  background: var(--surface-2);
}

/* ── Dark/themed overrides for new elements ─────────────────────────── */

html[data-theme="midnight"] #tab-now .lookahead-chip,
html[data-theme="ink"] #tab-now .lookahead-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="midnight"] #tab-now .timeline-dot,
html[data-theme="ink"] #tab-now .timeline-dot {
  border-color: var(--surface-1);
}

html[data-theme="midnight"] #tab-now .now-label-line,
html[data-theme="ink"] #tab-now .now-label-line {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="midnight"] .now-selfcare-extra-btn,
html[data-theme="ink"] .now-selfcare-extra-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}
