:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #eef4f0;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-soft: rgba(248, 249, 247, 0.78);
  --control: #fbfcfa;
  --control-strong: #ffffff;
  --ink: #1d2521;
  --muted: #65736d;
  --line: #dce5df;
  --hairline: rgba(29, 37, 33, 0.09);
  --hairline-soft: rgba(29, 37, 33, 0.055);
  --green: #28785d;
  --blue: #376fac;
  --red: #b9483f;
  --coral: #c85f4c;
  --gold: #a77420;
  --shadow: 0 18px 46px rgba(30, 42, 36, 0.08);
  --body-glow: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 247, 244, 0) 320px);
  --sidebar-bg: rgba(255, 255, 255, 0.78);
  --active-nav: rgba(255, 242, 181, 0.64);
  --mix-surface: white;
  --modal-backdrop: rgba(31, 38, 35, 0.3);
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  --radius-card: 8px;
  --radius-control: 8px;
}

/* Clean canvas redesign pass: intentionally visible, flatter, and more modern. */
:root[data-theme="light"],
:root:not([data-theme]),
:root[data-theme="gray"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f7f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f8f8f6;
  --control: #f7f7f5;
  --control-strong: #ffffff;
  --ink: #151917;
  --muted: #737a76;
  --line: #e9ece8;
  --hairline: rgba(21, 25, 23, 0.1);
  --hairline-soft: rgba(21, 25, 23, 0.065);
  --body-glow: none;
  --sidebar-bg: #f6f6f4;
  --active-nav: #ffffff;
  --shadow: none;
  --mix-surface: #ffffff;
}

body {
  background: #ffffff !important;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid #ededeb;
  box-shadow: none !important;
  backdrop-filter: none;
}

.brand {
  padding: 4px 6px 14px;
}

.brand h1 {
  font-size: 17px;
  font-weight: 760;
}

.brand p {
  font-size: 14px;
}

.nav-list {
  gap: 4px;
}

.nav-list a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #636b66;
  font-size: 14px;
  font-weight: 650;
}

.nav-list a.active {
  background: #ffffff !important;
  border-color: #e7e7e4 !important;
  color: #151917;
  box-shadow: 0 1px 2px rgba(21, 25, 23, 0.04) !important;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: #eeeeeb !important;
  box-shadow: none !important;
}

.main {
  max-width: 1480px;
  padding: clamp(28px, 4vw, 54px);
}

.topbar {
  margin-bottom: 28px;
}

.topbar h2 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 760;
  letter-spacing: 0;
}

.page-subtitle {
  max-width: 680px;
  color: #727975;
  font-size: 17px;
}

.eyebrow,
.section-label {
  color: #2d7d5f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel,
.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.task-dialog form,
.auth-card,
.onboarding-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.panel,
.routine-panel,
.side-panel {
  padding: clamp(18px, 1.7vw, 24px);
}

.settings-profile-form label,
.settings-status-card,
.cloud-dashboard-card,
.cloud-dashboard-status,
.sharing-area-card,
.sharing-connection-card,
.sharing-member-card,
.wrap-card,
.wrap-stats div,
.wrap-goals > div,
.idea-card,
.grocery-row,
.agenda-row,
.calendar-day,
.history-day,
.attachment-item,
.phone-url-row,
.phone-step-list div,
.copy-box,
.nudge-item,
.theme-choice-card,
.task-week-day,
.task-week-item,
.task-week-event,
.unscheduled-item,
.week-schedule-entry,
.day-plan-entry {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  box-shadow: none !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  border-color: #e3e7e2 !important;
  border-radius: 8px !important;
}

.primary-button,
.secondary-button,
.icon-button,
.mini-button {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.primary-button {
  background: #151917 !important;
  color: #ffffff !important;
}

.secondary-button,
.icon-button,
.mini-button {
  background: #ffffff !important;
  border-color: #e3e7e2 !important;
}

.project-list {
  gap: 14px;
}

.project-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  border-left: 4px solid var(--project-color, #2d7d5f) !important;
  box-shadow: none !important;
  padding: 18px !important;
}

.project-card header {
  align-items: center;
}

.project-card strong {
  font-weight: 760;
}

.project-card > p,
.project-card span {
  color: #727975;
}

.project-card .task-card,
.project-ticket-list .task-card,
.task-week-item {
  background: #ffffff !important;
  border: 1px solid #e6ebe5 !important;
  box-shadow: none !important;
}

.project-card .task-card:hover,
.task-card:hover {
  border-color: color-mix(in srgb, var(--project-color, #2d7d5f) 36%, #dfe5df) !important;
  box-shadow: 0 8px 24px rgba(21, 25, 23, 0.06) !important;
}

.task-card {
  background: #ffffff !important;
  border: 1px solid #e6ebe5 !important;
  box-shadow: none !important;
}

.task-card.current-focus {
  border-color: color-mix(in srgb, var(--project-color, #2d7d5f) 52%, #dfe5df) !important;
  outline: 0 !important;
}

.kanban {
  gap: 14px;
}

.column {
  background: #fafaf8 !important;
  border: 1px solid #ededeb !important;
  box-shadow: none !important;
}

.column-header {
  color: #727975;
  font-size: 11px;
  font-weight: 800;
}

.pill,
.drag-chip,
.shared-badge {
  background: #f7f7f5 !important;
  border-color: #ededeb !important;
}

@media (max-width: 1080px) {
  .main {
    padding: 22px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="gray"] {
  color-scheme: light;
  --bg: #d8dbd7;
  --panel: #f4f5f2;
  --panel-soft: #cfd5cf;
  --surface: rgba(244, 245, 242, 0.86);
  --surface-strong: #f7f8f5;
  --surface-soft: rgba(235, 237, 232, 0.78);
  --control: #e6e8e4;
  --control-strong: #f7f8f5;
  --ink: #202622;
  --muted: #5f6963;
  --line: #bec7bf;
  --hairline: rgba(32, 38, 34, 0.12);
  --hairline-soft: rgba(32, 38, 34, 0.07);
  --body-glow: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(216, 219, 215, 0) 320px);
  --sidebar-bg: rgba(226, 229, 224, 0.86);
  --active-nav: rgba(196, 204, 196, 0.92);
  --mix-surface: #f4f5f2;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121715;
  --panel: #1d2420;
  --panel-soft: #242d28;
  --surface: rgba(29, 36, 32, 0.9);
  --surface-strong: #232b26;
  --surface-soft: rgba(27, 34, 30, 0.82);
  --control: #171d1a;
  --control-strong: #232b26;
  --ink: #f4f6f1;
  --muted: #acb8b0;
  --line: #334139;
  --hairline: rgba(244, 246, 241, 0.11);
  --hairline-soft: rgba(244, 246, 241, 0.06);
  --green: #7fd6a6;
  --blue: #8dbbff;
  --red: #ff8678;
  --coral: #ff9b83;
  --gold: #ffd166;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  --body-glow: linear-gradient(180deg, rgba(127, 214, 166, 0.08), rgba(21, 26, 24, 0) 320px);
  --sidebar-bg: rgba(23, 29, 26, 0.84);
  --active-nav: rgba(255, 209, 102, 0.13);
  --mix-surface: #202722;
  --modal-backdrop: rgba(0, 0, 0, 0.56);
}

:root[data-theme="color"] {
  color-scheme: light;
  --bg: #fff7dc;
  --panel: #fffdf4;
  --panel-soft: #fff1bf;
  --surface: rgba(255, 253, 244, 0.86);
  --surface-strong: #fffdf4;
  --surface-soft: rgba(255, 249, 227, 0.78);
  --control: #fff9e3;
  --control-strong: #fffdf4;
  --ink: #22231c;
  --muted: #756f58;
  --line: #eadca2;
  --hairline: rgba(54, 43, 12, 0.12);
  --hairline-soft: rgba(54, 43, 12, 0.07);
  --green: #2e8562;
  --blue: #376fac;
  --coral: #d7664f;
  --gold: #b88019;
  --body-glow: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 244, 207, 0) 320px);
  --sidebar-bg: rgba(255, 252, 236, 0.82);
  --active-nav: rgba(255, 225, 101, 0.58);
  --mix-surface: #fffdf4;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.auth-gate {
  min-height: 100vh;
  padding: 24px;
  display: none;
  place-items: center;
}

.onboarding-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 24px;
  display: none;
  place-items: center;
  background: rgba(247, 248, 245, 0.94);
  backdrop-filter: blur(10px);
}

body[data-auth-state="checking"] .auth-gate,
body[data-auth-state="signed-out"] .auth-gate,
body[data-auth-state="setup"] .auth-gate {
  display: grid;
}

body[data-auth-state="checking"] .app-shell,
body[data-auth-state="signed-out"] .app-shell,
body[data-auth-state="setup"] .app-shell,
body[data-auth-state="checking"] .screen-buddy,
body[data-auth-state="signed-out"] .screen-buddy,
body[data-auth-state="setup"] .screen-buddy {
  display: none;
}

body[data-onboarding="open"] .onboarding-gate {
  display: grid;
}

body[data-onboarding-mode="voice"] .onboarding-gate {
  padding: 0;
  background: #fff;
  backdrop-filter: none;
}

body[data-onboarding="open"] .screen-buddy {
  left: clamp(14px, 2vw, 26px);
  right: auto;
  bottom: clamp(14px, 2vw, 24px);
  z-index: 70;
  display: block;
  pointer-events: auto;
  animation:
    onboarding-sunny-arrive 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.2),
    onboarding-sunny-play 6.8s ease-in-out 0.9s infinite;
}

body[data-onboarding-mode="voice"] .screen-buddy {
  display: none;
}

body[data-onboarding="open"] .screen-buddy::before {
  content: "drag me";
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border: 1px solid rgba(255, 194, 14, 0.8);
  border-radius: 999px;
  background: #fff7ce;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  animation: sunny-drag-label 2.1s ease-in-out infinite;
}

body[data-sunny-hint="dismissed"] .screen-buddy::before {
  display: none;
}

body[data-tutorial="open"] .tutorial-layer {
  display: block;
}

.auth-card {
  width: min(100%, 430px);
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.onboarding-card {
  width: min(100%, 620px);
  max-height: calc(100dvh - 48px);
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body[data-onboarding-mode="voice"] .onboarding-card {
  width: 100%;
  height: 100dvh;
  max-height: none;
  padding: clamp(18px, 5vw, 56px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  align-content: stretch;
  overflow: hidden;
}

.onboarding-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.onboarding-buddy {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  filter: drop-shadow(14px 16px 12px rgba(31, 38, 35, 0.13));
  animation: onboarding-buddy-float 3.4s ease-in-out infinite;
}

body[data-onboarding="open"] .onboarding-buddy {
  visibility: hidden;
}

body[data-onboarding-mode="voice"] .onboarding-hero,
body[data-onboarding-mode="voice"] .onboarding-progress,
body[data-onboarding-mode="voice"] .onboarding-actions,
body[data-onboarding-mode="voice"] #onboardingStatus {
  display: none;
}

.auth-brand {
  padding: 0;
}

.auth-card h2,
.auth-card p {
  margin: 0;
}

.auth-card h2 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.05;
}

.auth-copy,
.auth-status {
  color: var(--muted);
  line-height: 1.45;
}

.auth-status {
  min-height: 22px;
  font-weight: 800;
}

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

.auth-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.password-field {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #edf2ef;
  color: var(--ink);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-card input,
.onboarding-card select,
.onboarding-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--control);
  color: var(--ink);
  font: inherit;
}

.onboarding-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.field-hint {
  color: #87918c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.onboarding-card h2,
.onboarding-card p {
  margin: 0;
}

.onboarding-card h2 {
  margin: 4px 0 14px;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.04;
  letter-spacing: 0;
}

.onboarding-copy {
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.onboarding-step {
  display: none;
  gap: 12px;
}

.onboarding-step.is-active {
  display: grid;
}

.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.onboarding-dots {
  display: flex;
  gap: 6px;
}

.onboarding-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.onboarding-dots span.is-active {
  background: var(--green);
}

.onboarding-actions {
  position: sticky;
  bottom: -26px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--panel) 72%, transparent), var(--panel) 35%);
}

.onboarding-card[data-saving="true"] .onboarding-step {
  opacity: 0.72;
}

.onboarding-card[data-saving="true"] input,
.onboarding-card[data-saving="true"] select,
.onboarding-card[data-saving="true"] textarea {
  pointer-events: none;
}

.onboarding-card[data-saving="true"] .auth-status {
  color: var(--ink);
  font-weight: 900;
}

.onboarding-preview {
  min-height: 92px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--line)) 34%, var(--line));
  border-radius: 8px;
  background: var(--entry-soft, #fbfcfb);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.onboarding-color-preview {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.onboarding-color-preview span {
  display: block;
  min-height: 18px;
  border: 1px solid rgba(31, 38, 35, 0.12);
  border-radius: 6px;
}

.onboarding-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.onboarding-preview-row:last-child {
  border-bottom: 0;
}

.onboarding-preview-row strong {
  color: var(--ink);
}

.voice-setup {
  display: grid;
  gap: 22px;
  width: min(100%, 760px);
  min-height: calc(100dvh - clamp(36px, 10vw, 112px));
  margin: 0 auto;
  align-content: center;
  justify-items: center;
  background: #fff;
}

.voice-orb-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-orb {
  --voice-level: 0;
  width: clamp(74px, 12vw, 118px);
  height: clamp(74px, 12vw, 118px);
  border: 0;
  border-radius: 999px;
  background: #ffc83d;
  box-shadow:
    0 0 0 14px rgba(255, 200, 61, 0.12),
    0 24px 52px rgba(255, 194, 14, 0.26);
  cursor: pointer;
  animation: voice-orb-idle 2.8s ease-in-out infinite;
}

.voice-orb.is-listening {
  animation: voice-orb-listen 0.75s ease-in-out infinite;
  transform: scale(calc(1 + (var(--voice-level) * 0.16)));
}

.voice-orb.is-speaking {
  animation: voice-orb-speak 0.62s ease-in-out infinite;
}

.voice-orb.is-thinking {
  animation: voice-orb-think 1.4s ease-in-out infinite;
}

.voice-setup.is-preflight .voice-orb {
  animation: voice-orb-think 1.8s ease-in-out infinite;
}

.voice-caption {
  color: #7b8580;
  max-width: 720px;
  text-align: center;
  font-size: clamp(25px, 4vw, 42px);
  font-weight: 640;
  line-height: 1.16;
}

.voice-transcript {
  display: grid;
  gap: 10px;
  width: min(100%, 640px);
  max-height: 34vh;
  overflow: auto;
  padding: 2px;
}

.voice-line {
  display: grid;
  gap: 3px;
}

.voice-line span {
  color: #a6aea9;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.voice-line p {
  width: fit-content;
  max-width: min(100%, 560px);
  padding: 0;
  border-radius: 8px;
  line-height: 1.45;
}

.sunny-line p {
  color: #9aa39e;
  background: transparent;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 650;
  text-align: center;
}

.sunny-line small {
  display: block;
  max-width: 620px;
  color: #a7afaa;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 550;
  line-height: 1.45;
  text-align: center;
}

.sunny-line .voice-example-text {
  color: #9fa8a3;
}

.sunny-line .voice-status-text {
  margin-top: 8px;
  color: #e6812d;
  font-size: clamp(13px, 1.7vw, 16px);
  font-weight: 700;
}

.user-line {
  justify-items: end;
}

.user-line p {
  color: var(--ink);
  background: #fff7cf;
  padding: 10px 12px;
}

.voice-input-label {
  width: min(100%, 620px);
  color: var(--ink);
}

.voice-input-label textarea {
  min-height: 96px;
  background: #fff;
}

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

.voice-settings-button {
  position: fixed;
  right: clamp(14px, 2.5vw, 24px);
  bottom: clamp(14px, 2.5vw, 24px);
  z-index: 4;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #e4e8e4;
  border-radius: 999px;
  background: #fff;
  color: #8f9994;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.voice-settings-panel {
  position: fixed;
  right: clamp(14px, 2.5vw, 24px);
  bottom: calc(clamp(14px, 2.5vw, 24px) + 46px);
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 160px;
  padding: 10px;
  border: 1px solid #e4e8e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 38, 35, 0.1);
}

.voice-device-field {
  display: grid;
  gap: 5px;
  min-width: min(78vw, 320px);
  color: #6a746f;
  font-size: 0.78rem;
  font-weight: 800;
}

.voice-device-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 9px;
}

.voice-playback {
  width: min(78vw, 460px);
}

.voice-diagnostic {
  width: min(78vw, 460px);
  max-height: 230px;
  overflow: auto;
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid #e4e8e4;
  border-radius: 8px;
  background: #f7f8f6;
  color: #56615c;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.sunny-question-card {
  display: grid;
  gap: 12px;
}

.sunny-question-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.sunny-question-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.sunny-question-field {
  display: grid;
  gap: 6px;
  color: var(--ink);
}

.sunny-question-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

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

.onboarding-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 9px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--line)) 34%, var(--line));
  border-radius: 8px;
  background: var(--entry-soft, #fbfcfb);
  color: var(--ink);
  cursor: pointer;
}

.onboarding-choice-card input {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
}

.onboarding-choice-card span {
  font-weight: 850;
}

.onboarding-choice-card small {
  color: var(--muted);
  font-weight: 720;
  line-height: 1.35;
}

.onboarding-choice-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, white);
}

.tutorial-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}

.tutorial-card {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: min(470px, calc(100vw - 32px));
  padding: 18px;
  border: 2px solid #ffc20e;
  border-radius: 8px;
  background: #fff7ce;
  box-shadow: 0 20px 45px rgba(31, 38, 35, 0.2);
  pointer-events: auto;
  display: grid;
  gap: 10px;
}

.tutorial-card h3,
.tutorial-card p {
  margin: 0;
}

.tutorial-card h3 {
  font-size: 24px;
  line-height: 1.1;
}

.tutorial-card p {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tutorial-highlight {
  position: relative;
  z-index: 40;
  border-color: #ffc20e !important;
  box-shadow:
    0 0 0 4px rgba(255, 194, 14, 0.86),
    0 0 0 9999px rgba(31, 38, 35, 0.2),
    0 18px 40px rgba(31, 38, 35, 0.16) !important;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 2px 6px 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.sunny-brand-mark {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(126, 86, 0, 0.14), 0 8px 18px rgba(31, 38, 35, 0.1);
  color: transparent;
}

.sunny-brand-face {
  display: block;
  width: 100%;
  height: 100%;
  background: url("sunny_icon_cropped.png") center / cover no-repeat;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.section-header h3,
.section-header p,
.metric p,
.assistant-strip p,
.setup-steps p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p,
.metric p,
.weather-copy,
.companion p,
.side-note,
.task-meta,
.idea-card p,
.setup-steps p,
.roadmap-list span,
.page-subtitle,
.project-card span {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-list a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.nav-list a.active,
.nav-list a:hover {
  background: #fff3a8;
  box-shadow: inset 0 0 0 1px rgba(185, 139, 47, 0.36);
  color: var(--ink);
}

body[data-tutorial="open"] .nav-list a.active {
  background: #ffe66d;
  box-shadow:
    inset 0 0 0 1px rgba(185, 139, 47, 0.45),
    0 8px 18px rgba(185, 139, 47, 0.16);
}

.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.panel,
.task-dialog form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.side-panel,
.panel,
.routine-panel {
  padding: 14px;
}

.routine-panel {
  background: var(--entry-soft, var(--panel));
  border-color: color-mix(in srgb, var(--entry-color, var(--line)) 30%, var(--line));
}

.section-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.weather {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.weather-temp {
  font-size: 22px;
  font-weight: 760;
  line-height: 1;
}

.weather-visual {
  position: relative;
  width: 58px;
  height: 58px;
  overflow: hidden;
}

.sun-core {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #f5b642;
  box-shadow: 0 0 0 9px rgba(245, 182, 66, 0.18);
  animation: sun-pulse 4s ease-in-out infinite;
  overflow: hidden;
}

.sun-core::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  background: #f7f8f5;
}

.cloud {
  position: absolute;
  left: 20px;
  width: 42px;
  height: 18px;
  border-radius: 999px;
  background: #dde6e6;
  opacity: 0;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 4px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 8px;
  width: 18px;
  height: 18px;
}

.cloud::after {
  right: 7px;
  width: 22px;
  height: 22px;
}

.cloud-one {
  top: 36px;
  animation: cloud-drift 5s ease-in-out infinite;
}

.cloud-two {
  top: 45px;
  left: 6px;
  transform: scale(0.8);
  animation: cloud-drift 6s ease-in-out infinite reverse;
}

.rain {
  position: absolute;
  top: 54px;
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0;
  animation: none;
}

.rain-one {
  left: 30px;
}

.rain-two {
  left: 46px;
  animation-delay: 0.25s;
}

.weather-visual.is-day.is-cloudy .sun-core,
.weather-visual.is-day.is-rainy .sun-core {
  opacity: 0.55;
}

.weather-visual.is-cloudy .cloud,
.weather-visual.is-rainy .cloud,
.weather-visual.is-stormy .cloud {
  opacity: 1;
}

.weather-visual.is-rainy .rain,
.weather-visual.is-stormy .rain {
  opacity: 1;
  animation: rain-drop 0.9s linear infinite;
}

.weather-visual.is-stormy .sun-core {
  background: #a7b2ba;
  box-shadow: 0 0 0 9px rgba(61, 115, 185, 0.15);
}

.weather-visual.is-night .sun-core {
  background: #f6d66a;
  box-shadow:
    0 0 0 9px rgba(246, 214, 106, 0.18),
    0 0 18px rgba(246, 214, 106, 0.28);
  opacity: 1;
}

.weather-visual.is-night .sun-core::after {
  opacity: 1;
  transform: translateX(8px);
}

.weather-visual.is-night.moon-new .sun-core {
  background: #8f9ba4;
  box-shadow: 0 0 0 9px rgba(143, 155, 164, 0.14);
}

.weather-visual.is-night.moon-new .sun-core::after,
.weather-visual.is-night.moon-full .sun-core::after {
  opacity: 0;
}

.weather-visual.is-night.moon-waxing-crescent .sun-core::after {
  transform: translateX(-7px);
}

.weather-visual.is-night.moon-first-quarter .sun-core::after {
  transform: translateX(-15px);
}

.weather-visual.is-night.moon-waxing-gibbous .sun-core::after {
  transform: translateX(-23px);
}

.weather-visual.is-night.moon-waning-gibbous .sun-core::after {
  transform: translateX(23px);
}

.weather-visual.is-night.moon-last-quarter .sun-core::after {
  transform: translateX(15px);
}

.weather-visual.is-night.moon-waning-crescent .sun-core::after {
  transform: translateX(7px);
}

@keyframes sun-pulse {
  0%,
  100% {
    transform: scale(0.96);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes cloud-drift {
  0%,
  100% {
    transform: translateX(-2px);
  }
  50% {
    transform: translateX(4px);
  }
}

@keyframes rain-drop {
  0% {
    transform: translateY(-5px);
    opacity: 0;
  }
  30%,
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(8px);
    opacity: 0;
  }
}

.primary-button,
.secondary-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 750;
}

.primary-button {
  background: var(--ink);
  color: white;
}

.secondary-button {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

a.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-button.danger {
  color: var(--coral);
}

.danger-button {
  border: 1px solid rgba(217, 93, 75, 0.22);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--coral);
  color: white;
  font-weight: 820;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: white;
  border-color: var(--line);
  color: var(--ink);
  font-size: 18px;
}

.companion {
  margin-top: 0;
  display: grid;
  gap: 10px;
}

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

.nudge-item {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.nudge-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.nudge-item strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.cloud-panel {
  display: grid;
  gap: 10px;
}

.cloud-form {
  display: grid;
  gap: 8px;
}

.cloud-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.cloud-form .password-field input {
  padding-right: 46px;
}

.cloud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cloud-sync-log {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.cloud-dashboard {
  display: grid;
  gap: 14px;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.settings-cloud-form {
  margin-top: 14px;
}

.feedback-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--control);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.feedback-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.feedback-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.feedback-photo-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.feedback-photo-preview img {
  width: 72px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: white;
}

.feedback-photo-preview strong,
.feedback-photo-preview small {
  display: block;
}

.feedback-photo-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-photo-preview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.settings-profile-form > label,
.settings-profile-form .form-grid {
  min-width: 0;
}

.settings-profile-form .form-grid {
  display: contents;
}

.settings-profile-form label {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-profile-form label:has(textarea),
.settings-profile-form label:has(#profileGoals) {
  grid-column: 1 / -1;
  min-height: 0;
}

.settings-profile-form input,
.settings-profile-form select,
.settings-profile-form textarea {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
  outline: none;
}

.settings-profile-form textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.4;
}

.settings-save-note {
  align-self: center;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

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

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.settings-status-card {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.settings-status-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-status-card strong {
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.theme-choice-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  cursor: pointer;
}

.onboarding-theme-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.onboarding-theme-grid .theme-choice-card {
  min-height: 118px;
  background: var(--control-strong);
}

.onboarding-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.onboarding-palette-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-strong);
  color: var(--ink);
  cursor: pointer;
}

.onboarding-palette-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-palette-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--green) 34%, transparent),
    0 8px 18px rgba(31, 38, 35, 0.05);
}

.onboarding-palette-card .onboarding-color-preview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.onboarding-palette-card .onboarding-color-preview span {
  min-height: 20px;
}

.onboarding-palette-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.theme-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-choice-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--green) 34%, transparent),
    0 10px 22px rgba(31, 38, 35, 0.06);
}

.theme-preview {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  height: 54px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f4;
}

.theme-preview span {
  display: block;
  border-radius: 5px;
}

.theme-preview span:first-child {
  grid-row: 1 / -1;
  background: #ffffff;
}

.theme-preview span:nth-child(2) {
  background: #eef4f0;
}

.theme-preview span:nth-child(3) {
  background: #dce5df;
}

.theme-light .theme-preview {
  background: #f6f7f4;
}

.theme-gray .theme-preview {
  background: #d8dbd7;
}

.theme-gray .theme-preview span:first-child {
  background: #f4f5f2;
}

.theme-gray .theme-preview span:nth-child(2) {
  background: #cfd5cf;
}

.theme-gray .theme-preview span:nth-child(3) {
  background: #89958d;
}

.theme-dark .theme-preview {
  background: #121715;
  border-color: #3a453e;
}

.theme-dark .theme-preview span:first-child {
  background: #1d2420;
}

.theme-dark .theme-preview span:nth-child(2) {
  background: #242d28;
}

.theme-dark .theme-preview span:nth-child(3) {
  background: #7fd6a6;
}

.theme-color .theme-preview {
  background: #fff7dc;
}

.theme-color .theme-preview span:first-child {
  background: #fffdf4;
}

.theme-color .theme-preview span:nth-child(2) {
  background: #fff1bf;
}

.theme-color .theme-preview span:nth-child(3) {
  background: #ffc20e;
}

.theme-choice-card strong {
  line-height: 1.2;
}

.theme-choice-card small {
  color: var(--muted);
  font-weight: 800;
}

.sunny-voice-card {
  cursor: default;
}

.sunny-voice-card select {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  outline: none;
}

.settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings-profile-form .settings-action-row {
  grid-column: 1 / -1;
  margin-top: 0;
}

.cloud-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cloud-dashboard-status {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 850;
}

.cloud-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.cloud-summary-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.cloud-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.cloud-summary-card strong {
  color: var(--ink);
  line-height: 1.25;
}

.cloud-activity-log {
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-wrap;
}

.phone-setup {
  display: grid;
  gap: 14px;
}

.phone-url-list,
.phone-step-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.phone-info-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 7%, white);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.phone-url-row,
.phone-step-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.phone-url-row div,
.phone-step-list div {
  min-width: 0;
}

.phone-url-row span,
.phone-step-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.phone-url-row strong,
.phone-step-list strong {
  display: block;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.screen-buddy {
  position: fixed;
  right: clamp(14px, 2vw, 26px);
  bottom: clamp(14px, 2vw, 24px);
  width: 96px;
  height: 96px;
  z-index: 30;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  --look-x: 0px;
  --look-y: 0px;
  filter: drop-shadow(13px 15px 12px rgba(31, 38, 35, 0.14));
  animation: buddy-drift 7s ease-in-out infinite;
}

.screen-buddy:hover {
  filter: drop-shadow(15px 17px 14px rgba(31, 38, 35, 0.17));
}

.screen-buddy.is-dragging {
  cursor: grabbing;
  animation: none;
  transform: none;
}

.screen-buddy.is-routine-pop {
  animation: buddy-routine-pop 0.58s ease-out;
}

.screen-buddy.celebrate-hop {
  animation: buddy-party 0.85s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.screen-buddy.celebrate-spin {
  animation: buddy-spin-party 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}

.screen-buddy.celebrate-wiggle {
  animation: buddy-wiggle-party 0.82s ease-in-out;
}

.screen-buddy.is-celebrating .buddy-avatar {
  animation: buddy-squish-pop 0.85s ease-out;
}

.screen-buddy:hover .buddy-avatar {
  animation: buddy-droop 2.8s ease-in-out infinite;
}

.screen-buddy.is-thinking .buddy-avatar {
  animation: buddy-command-spin 0.95s linear infinite;
}

.screen-buddy.is-sleepy {
  animation: buddy-sleepy 8s ease-in-out infinite;
}

.screen-buddy.is-nudging:not(.is-celebrating) {
  animation: buddy-nudge 1.9s ease-in-out infinite;
}

.buddy-avatar {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  isolation: isolate;
  transform-origin: 50% 72%;
  animation: buddy-droop 5.8s ease-in-out infinite;
}

.screen-buddy.is-dragging .buddy-avatar {
  animation: none;
  transform: none;
}

.buddy-avatar::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  background: #ffc20e;
  clip-path: polygon(
    50% 0%,
    55% 9%,
    62% 2%,
    67% 12%,
    75% 7%,
    78% 18%,
    88% 17%,
    86% 28%,
    97% 33%,
    89% 43%,
    100% 50%,
    89% 57%,
    97% 68%,
    85% 71%,
    89% 83%,
    77% 81%,
    72% 93%,
    62% 86%,
    55% 99%,
    47% 88%,
    36% 98%,
    33% 84%,
    21% 90%,
    22% 77%,
    9% 78%,
    14% 66%,
    1% 61%,
    12% 51%,
    0% 43%,
    13% 36%,
    6% 24%,
    19% 25%,
    20% 12%,
    31% 18%,
    37% 5%,
    44% 14%
  );
}

.buddy-avatar::after {
  content: "";
  position: absolute;
  inset: 14px 13px 13px 14px;
  z-index: -1;
  border-radius: 50%;
  background: #ffc20e;
}

.buddy-face {
  position: absolute;
  left: var(--face-left, 62%);
  top: 44%;
  width: 26px;
  height: 18px;
  z-index: 1;
  transform: translate(calc(-50% + var(--look-x)), calc(-50% + var(--look-y)));
  animation: buddy-face-soft 5.8s ease-in-out infinite;
}

.buddy-face::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6d1c13;
  box-shadow: 15px 0 0 #6d1c13;
  animation: buddy-blink 8s ease-in-out infinite;
}

.buddy-face::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 2px;
  width: 10px;
  height: 5px;
  border: 0;
  background: #6d1c13;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M2 2.5 Q6 5 10 2.5' stroke='black' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M2 2.5 Q6 5 10 2.5' stroke='black' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}

.screen-buddy.is-dragging .buddy-face::after {
  left: 9px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border: 0;
  background: #6d1c13;
  border-radius: 50%;
  -webkit-mask: none;
  mask: none;
}

.screen-buddy.is-looking-away {
  --face-left: 38%;
}

.screen-buddy.is-curious {
  --face-left: 68%;
}

.screen-buddy.is-perky {
  animation: buddy-perky 0.85s ease-in-out;
}

.screen-buddy.is-idle-sleep .buddy-face::before {
  top: 7px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  transform: scaleY(1);
  animation: none;
}

.screen-buddy.is-idle-sleep::after {
  content: "zzz";
  position: absolute;
  left: 56%;
  top: -13px;
  color: #8a948f;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 1px;
  opacity: 0.72;
  animation: buddy-zzz 2.6s ease-in-out infinite;
}

.screen-buddy.is-yawning .buddy-face::before {
  top: 7px;
  left: 4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #6d1c13;
  box-shadow: 15px 0 0 #6d1c13;
  transform: scaleY(1);
  animation: none;
}

.screen-buddy.is-yawning .buddy-face::after {
  left: 9px;
  bottom: 0;
  width: 8px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: #6d1c13;
  -webkit-mask: none;
  mask: none;
  animation: buddy-yawn-mouth 1.9s ease-in-out;
}

@keyframes buddy-drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(-1deg);
  }
  45% {
    transform: translate(-8px, -12px) rotate(2deg);
  }
  70% {
    transform: translate(2px, -5px) rotate(-2deg);
  }
}

@keyframes buddy-droop {
  0%,
  100% {
    transform: scale(1, 1) skew(0deg);
  }
  38% {
    transform: scale(0.98, 1.05) skew(-1.5deg);
  }
  66% {
    transform: scale(1.03, 0.97) skew(1deg);
  }
}

@keyframes onboarding-buddy-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}

@keyframes onboarding-sunny-arrive {
  0% {
    opacity: 0;
    transform: translate(18px, 36px) scale(0.72) rotate(-18deg);
  }
  58% {
    opacity: 1;
    transform: translate(0, -10px) scale(1.08) rotate(7deg);
  }
  78% {
    transform: translate(0, 4px) scale(0.96, 1.04) rotate(-3deg);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(-3deg);
  }
}

@keyframes onboarding-sunny-play {
  0%,
  100% {
    transform: translate(0, 0) rotate(-3deg);
  }
  18% {
    transform: translate(8px, -8px) rotate(4deg);
  }
  34% {
    transform: translate(14px, 4px) rotate(8deg);
  }
  52% {
    transform: translate(2px, 12px) rotate(-5deg);
  }
  70% {
    transform: translate(-10px, 4px) rotate(-8deg);
  }
  86% {
    transform: translate(5px, -5px) rotate(3deg);
  }
}

@keyframes project-loading-sheen {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

@keyframes voice-orb-idle {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 0 14px rgba(255, 200, 61, 0.12),
      0 24px 52px rgba(255, 194, 14, 0.26);
  }
  50% {
    transform: translateY(-8px) scale(1.04);
    box-shadow:
      0 0 0 22px rgba(255, 200, 61, 0.07),
      0 30px 62px rgba(255, 194, 14, 0.22);
  }
}

@keyframes voice-orb-listen {
  0%,
  100% {
    transform: scale(calc(1.02 + (var(--voice-level) * 0.08)));
    box-shadow:
      0 0 0 12px rgba(255, 200, 61, 0.16),
      0 24px 52px rgba(255, 194, 14, 0.24);
  }
  50% {
    transform: scale(calc(1.12 + (var(--voice-level) * 0.18)));
    box-shadow:
      0 0 0 28px rgba(255, 200, 61, 0.06),
      0 28px 60px rgba(255, 194, 14, 0.2);
  }
}

@keyframes voice-orb-speak {
  0%,
  100% {
    transform: translateY(0) scale(1.02);
    border-radius: 48% 52% 50% 50%;
  }
  35% {
    transform: translateY(-3px) scale(1.09, 0.96);
    border-radius: 56% 44% 48% 52%;
  }
  70% {
    transform: translateY(2px) scale(0.98, 1.08);
    border-radius: 44% 56% 54% 46%;
  }
}

@keyframes voice-orb-think {
  0%,
  100% {
    transform: scale(0.98);
    box-shadow:
      0 0 0 10px rgba(255, 200, 61, 0.08),
      0 20px 44px rgba(255, 194, 14, 0.2);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 26px rgba(255, 200, 61, 0.05),
      0 30px 66px rgba(255, 194, 14, 0.22);
  }
}

@keyframes sunny-drag-label {
  0%,
  100% {
    opacity: 0.72;
    transform: translate(-50%, 0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -3px);
  }
}

@keyframes buddy-face-soft {
  0%,
  100% {
    transform: translate(calc(-50% + var(--look-x)), calc(-50% + var(--look-y)));
  }
  50% {
    transform: translate(calc(-50% + var(--look-x)), calc(-46% + var(--look-y)));
  }
}

@keyframes buddy-blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.18);
  }
}

@keyframes buddy-yawn-mouth {
  0% {
    transform: scale(0.35, 0.25) translateY(1px);
  }
  35%,
  70% {
    transform: scale(1, 1) translateY(0);
  }
  100% {
    transform: scale(0.45, 0.28) translateY(1px);
  }
}

@keyframes buddy-perky {
  0%,
  100% {
    transform: translate(0, 0) rotate(-1deg) scale(1);
  }
  38% {
    transform: translate(0, -7px) rotate(2deg) scale(1.03, 0.98);
  }
  68% {
    transform: translate(0, 1px) rotate(-2deg) scale(0.99, 1.02);
  }
}

@keyframes buddy-zzz {
  0%,
  100% {
    transform: translateY(3px);
    opacity: 0.25;
  }
  45% {
    transform: translateY(-4px);
    opacity: 0.78;
  }
}

@keyframes buddy-party {
  0%,
  100% {
    transform: translate(0, 0) rotate(-1deg);
  }
  25% {
    transform: translate(-8px, -18px) rotate(-12deg);
  }
  55% {
    transform: translate(6px, -34px) rotate(14deg) scale(1.08);
  }
  78% {
    transform: translate(-2px, -8px) rotate(-6deg);
  }
}

@keyframes buddy-spin-party {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  45% {
    transform: translate(0, -26px) rotate(390deg) scale(1.12);
  }
  80% {
    transform: translate(0, -4px) rotate(695deg) scale(0.98);
  }
  100% {
    transform: translate(0, 0) rotate(720deg) scale(1);
  }
}

@keyframes buddy-wiggle-party {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  16% {
    transform: translate(-7px, -8px) rotate(-12deg);
  }
  34% {
    transform: translate(7px, -13px) rotate(12deg);
  }
  54% {
    transform: translate(-5px, -8px) rotate(-8deg);
  }
  74% {
    transform: translate(4px, -4px) rotate(6deg);
  }
}

@keyframes buddy-routine-pop {
  0%,
  100% {
    transform: translate(0, 0) rotate(-1deg) scale(1);
  }
  40% {
    transform: translate(0, -10px) rotate(4deg) scale(1.06);
  }
  70% {
    transform: translate(0, -2px) rotate(-3deg) scale(0.99);
  }
}

@keyframes buddy-squish-pop {
  0%,
  100% {
    transform: scale(1, 1);
  }
  30% {
    transform: scale(1.12, 0.88);
  }
  55% {
    transform: scale(0.9, 1.16);
  }
  78% {
    transform: scale(1.04, 0.96);
  }
}

@keyframes buddy-hover-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  38% {
    transform: translateY(-5px) scale(0.99, 1.04);
  }
  68% {
    transform: translateY(1px) scale(1.03, 0.98);
  }
}

@keyframes buddy-thinking {
  0%,
  100% {
    transform: rotate(-2deg) scale(1, 1);
  }
  25% {
    transform: rotate(2deg) scale(1.02, 0.98);
  }
  50% {
    transform: rotate(-1deg) scale(0.98, 1.03);
  }
  75% {
    transform: rotate(1deg) scale(1.01, 0.99);
  }
}

@keyframes buddy-sleepy {
  0%,
  100% {
    transform: translate(0, 0) rotate(-1deg) scale(1, 1);
  }
  50% {
    transform: translate(0, 6px) rotate(1deg) scale(1.02, 0.96);
  }
}

@keyframes buddy-nudge {
  0%,
  100% {
    transform: translate(0, 0) rotate(-1deg);
  }
  45% {
    transform: translate(-5px, -8px) rotate(2deg);
  }
  70% {
    transform: translate(2px, -3px) rotate(-2deg);
  }
}

.status-dot {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 10px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--muted);
  font-weight: 700;
}

.topbar h2 {
  margin-top: 4px;
  font-size: clamp(30px, 4.5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.page-subtitle {
  margin-top: 8px;
  font-size: 17px;
  max-width: 720px;
}

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

.quick-actions[hidden],
.cloud-form[hidden],
#cloudSyncButton[hidden],
#cloudSignOutButton[hidden],
body:not([data-active-view="today"]):not([data-active-view="board"]) .quick-actions {
  display: none !important;
}

.view {
  display: none;
}

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

.ai-panel {
  margin-top: 14px;
}

.metrics-grid,
.split-grid,
.routine-grid {
  display: grid;
  gap: 14px;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 14px;
}

.split-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
}

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

.routine-manager {
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.metric-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.metric-heading span {
  color: var(--muted);
  font-weight: 750;
}

.metric-heading strong {
  max-width: 62%;
  text-align: right;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.progress-track {
  height: 10px;
  background: #e9eee9;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
}

.progress-fill.income {
  width: 50%;
  background: var(--blue);
}

.progress-fill.routines {
  width: 0%;
  background: var(--green);
  transition: width 180ms ease;
}

.compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
}

.compact-list li span {
  min-width: 0;
}

.compact-list li strong {
  flex: 0 0 auto;
}

.assistant-strip {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(45, 125, 95, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 206, 0.58), rgba(255, 255, 255, 0.9));
}

.assistant-strip p {
  font-size: 18px;
  font-weight: 720;
}

.day-history-panel {
  margin-bottom: 14px;
}

.history-layout {
  align-items: start;
}

.history-nav,
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 12px;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.segmented-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.segmented-control button.active {
  background: var(--ink);
  color: white;
}

.history-toolbar input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.day-mood-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-mood-toggle button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfb;
  color: var(--muted);
  font-weight: 850;
}

.day-mood-toggle button.active {
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, white);
  color: var(--ink);
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.history-wrap-section {
  margin-bottom: 16px;
}

.wrap-card {
  display: grid;
  gap: 14px;
  border-color: color-mix(in srgb, var(--sun) 54%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sun) 16%, white), rgba(255, 255, 255, 0.82)),
    color-mix(in srgb, var(--sun) 10%, white);
  box-shadow: 0 18px 45px rgba(31, 38, 35, 0.08);
}

.today-wrap-card {
  margin-bottom: 18px;
}

.history-wrap-card {
  padding: 18px;
}

.wrap-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wrap-hero h3 {
  font-size: 1.65rem;
}

.wrap-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
}

.wrap-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.wrap-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-weight: 760;
}

.wrap-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wrap-stats div,
.wrap-goals > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(31, 38, 35, 0.04);
}

.wrap-stats strong,
.wrap-stats span,
.wrap-goals span,
.wrap-goals strong,
.wrap-goals small {
  display: block;
}

.wrap-stats strong,
.wrap-goals strong {
  font-size: 1.25rem;
}

.wrap-stats span,
.wrap-goals span,
.wrap-goals small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.wrap-goals {
  display: grid;
  gap: 8px;
}

.wrap-goals .progress-track {
  margin: 6px 0;
}

.wrap-goals .progress-track > div {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.history-summary div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.history-summary strong,
.history-summary span {
  display: block;
}

.history-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.history-day {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.history-day:hover,
.history-day.is-selected {
  border-color: color-mix(in srgb, var(--ink) 20%, var(--line));
  background: var(--panel-soft);
}

.history-day.mood-good {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, white);
}

.history-day.mood-good:hover,
.history-day.mood-good.is-selected {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  background: color-mix(in srgb, var(--green) 13%, white);
}

.history-day.mood-neutral {
  border-color: color-mix(in srgb, #d4a017 34%, var(--line));
  background: color-mix(in srgb, #f2c94c 13%, white);
}

.history-day.mood-neutral:hover,
.history-day.mood-neutral.is-selected {
  border-color: color-mix(in srgb, #d4a017 56%, var(--line));
  background: color-mix(in srgb, #f2c94c 20%, white);
}

.history-day.mood-bad {
  border-color: #c94b3f;
  background: #fde9e6;
  box-shadow: inset 4px 0 0 #c94b3f;
}

.history-day.mood-bad:hover,
.history-day.mood-bad.is-selected {
  border-color: #b83f34;
  background: #fbd8d3;
  box-shadow:
    inset 4px 0 0 #b83f34,
    0 0 0 2px rgba(201, 75, 63, 0.14);
}

.history-day.is-selected {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(31, 58, 48, 0.08);
}

.history-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.history-day p {
  margin: 6px 0 0;
  color: var(--muted);
}

.history-note {
  color: var(--ink) !important;
}

.mood-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef1ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mood-pill.good {
  background: color-mix(in srgb, var(--green) 14%, white);
  color: var(--green);
}

.mood-pill.bad {
  background: color-mix(in srgb, var(--red) 12%, white);
  color: var(--red);
}

.history-line {
  margin-top: 8px;
}

.history-line span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.history-line p {
  margin-top: 2px;
}

.history-edit-form {
  display: grid;
  gap: 12px;
}

.history-edit-helper {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.history-edit-helper p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.history-helper-actions {
  justify-content: flex-start;
}

.history-helper-actions .secondary-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.history-routine-checks {
  display: grid;
  gap: 8px;
}

.history-routine-list {
  display: grid;
  gap: 10px;
}

.history-routine-section {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.history-routine-section strong {
  font-size: 13px;
}

.history-routine-row {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink) !important;
  font-size: 14px !important;
  font-weight: 750 !important;
}

.history-routine-row input {
  width: 17px;
  height: 17px;
}

.merge-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.merge-preview-grid article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.merge-preview-grid span,
.merge-preview-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.merge-preview-grid strong {
  color: var(--ink);
  line-height: 1.25;
}

.history-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.history-edit-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

#view-history {
  color: var(--ink-soft);
}

#view-history .section-label {
  color: #a97918;
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: none;
}

#view-history h3 {
  color: var(--ink-soft);
  font-weight: 780;
}

.history-page-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.history-page-grid:has(.history-wrap-card[hidden]) {
  grid-template-columns: 1fr;
}

.history-range-panel,
.history-timeline-panel,
.history-editor,
.history-wrap-card {
  border-color: rgba(31, 38, 35, 0.1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 55px rgba(31, 38, 35, 0.06);
}

.history-range-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.history-layout {
  display: block;
}

.history-editor {
  position: static;
}

.history-toolbar {
  gap: 12px;
  margin: 0;
}

#view-history .segmented-control {
  border-radius: 999px;
  background: rgba(247, 248, 245, 0.72);
}

#view-history .segmented-control button {
  border-radius: 999px;
  color: var(--muted);
}

#view-history .segmented-control button.active {
  background: var(--sun);
  color: #5d4213;
}

.history-summary {
  gap: 10px;
  margin: 0;
}

.history-summary div,
.wrap-stats div,
.wrap-goals > div {
  border-radius: 16px;
  border-color: rgba(31, 38, 35, 0.09);
  background: rgba(249, 250, 247, 0.72);
  box-shadow: none;
}

.history-summary strong,
.wrap-stats strong,
.wrap-goals strong {
  color: var(--ink-soft);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 780;
}

.history-summary span,
.wrap-stats span,
.wrap-goals span,
.wrap-goals small {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: none;
}

.history-wrap-card {
  padding: clamp(18px, 2vw, 26px);
  background:
    linear-gradient(135deg, rgba(255, 246, 219, 0.95), rgba(255, 255, 255, 0.95)),
    rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 195, 70, 0.38);
}

.wrap-hero h3 {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.history-wrap-card .icon-button {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
}

.wrap-card ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
  color: var(--ink-soft);
  font-weight: 650;
}

.history-list {
  gap: 10px;
}

.history-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.history-calendar-grid.is-day {
  grid-template-columns: minmax(280px, 1fr);
}

.history-calendar-grid.is-year {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.history-calendar-weekday {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-align: center;
}

.history-calendar-blank {
  min-height: 88px;
  border-radius: 18px;
  background: rgba(247, 248, 245, 0.42);
}

.history-day {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.history-calendar-day {
  position: relative;
  min-height: 112px;
  cursor: pointer;
  display: grid;
  align-content: start;
  gap: 10px;
}

.history-day:hover,
.history-day.is-selected {
  border-color: rgba(255, 195, 70, 0.55);
  background: rgba(255, 253, 246, 0.94);
  transform: none;
}

.history-day header div {
  display: grid;
  gap: 4px;
}

.history-day header strong {
  color: var(--ink-soft);
  font-size: 1.18rem;
  font-weight: 780;
}

.history-day header small {
  color: var(--muted);
  font-weight: 650;
}

.history-day p {
  font-weight: 620;
}

.history-day-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.history-day-mini span {
  border-radius: 999px;
  background: rgba(247, 248, 245, 0.9);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 720;
  padding: 4px 7px;
}

.history-calendar-day.has-activity::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sun);
  position: absolute;
  right: 14px;
  bottom: 12px;
}

.history-calendar-day.is-selected {
  grid-column: span 2;
  min-height: 260px;
}

.history-calendar-grid.is-day .history-calendar-day.is-selected {
  grid-column: 1 / -1;
}

.history-day-expanded {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.history-note.muted {
  color: var(--muted) !important;
}

.history-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(247, 248, 245, 0.88);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 720;
}

.history-chip.is-task {
  background: rgba(255, 195, 70, 0.2);
  color: #735217;
}

.history-chip.is-habit {
  background: rgba(45, 125, 95, 0.1);
  color: var(--green);
}

.history-chip.is-open {
  background: rgba(120, 124, 118, 0.1);
  color: var(--muted);
}

.history-edit-helper,
.history-routine-section,
.history-edit-form textarea,
.history-routine-row {
  border-radius: 14px;
  background: rgba(249, 250, 247, 0.72);
}

.history-edit-form textarea {
  min-height: 78px;
}

.history-routine-list {
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.history-inline-slot .history-editor {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.history-inline-slot .history-editor > .section-header {
  display: none;
}

.history-inline-slot .history-edit-form {
  display: grid;
  gap: 12px;
}

.history-inline-slot .history-edit-form label {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .history-page-grid,
  .history-layout,
  .history-calendar-grid,
  .history-calendar-grid.is-year {
    grid-template-columns: 1fr;
  }

  .history-editor {
    position: static;
  }

  .history-calendar-weekday,
  .history-calendar-blank {
    display: none;
  }

  .history-calendar-day.is-selected {
    grid-column: 1 / -1;
  }

  .history-summary,
  .wrap-stats {
    grid-template-columns: 1fr;
  }
}

.daily-quote {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: min(470px, 100%);
}

.assistant-actions button {
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.assistant-actions .primary-button {
  border: 1px solid rgba(45, 125, 95, 0.24);
  background: rgba(239, 251, 242, 0.9);
  color: var(--green);
}

.assistant-actions button:disabled {
  opacity: 0.38;
}

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

.section-header h3 {
  font-size: 22px;
  margin-top: 2px;
}

.section-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-header.tight {
  margin-bottom: 12px;
}

.section-header.tight h3 {
  font-size: 18px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.planner-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.planner-side-stack {
  display: grid;
  gap: 14px;
}

.day-schedule-panel {
  min-height: 70vh;
}

.planner-header-row {
  align-items: flex-start;
}

.schedule-range-controls {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.planner-date-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.planner-date-controls input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.planner-view-toggle {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3ef;
}

.planner-view-toggle .mini-button {
  border-color: transparent;
  background: transparent;
}

.planner-view-toggle .mini-button.active {
  background: var(--ink);
  color: white;
}

.schedule-range-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.schedule-range-controls select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fbfcfb;
  color: var(--ink);
}

.planner-quick-add {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 110px 118px auto;
  gap: 8px;
  margin-bottom: 12px;
}

.planner-quick-add input,
.planner-quick-add select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.unscheduled-list {
  display: grid;
  gap: 12px;
}

.planner-drag-tray {
  max-height: min(680px, 68vh);
  overflow: auto;
  padding-right: 2px;
}

.planner-drag-tray.drag-over {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, white);
}

.planner-drag-group {
  display: grid;
  gap: 8px;
}

.planner-drag-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.planner-drag-group-title small {
  color: var(--muted);
  font-size: 12px;
}

.planner-drag-group-items {
  display: grid;
  gap: 8px;
}

.unscheduled-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: grab;
}

.unscheduled-item.routine {
  background: var(--entry-soft, #f2f7ee);
}

.unscheduled-item.calendar {
  background: var(--entry-soft, #fff8df);
  border-color: color-mix(in srgb, var(--entry-color, #eadfae) 34%, var(--line));
}

.unscheduled-item:active,
.day-plan-entry:active,
.week-schedule-entry:active {
  cursor: grabbing;
}

.planner-dragging {
  opacity: 0.55;
}

.unscheduled-item strong,
.unscheduled-item span {
  display: block;
  min-width: 0;
}

.unscheduled-item strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.unscheduled-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.unscheduled-item input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: white;
  color: var(--ink);
}

.drag-chip {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.task-planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.task-week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.task-week-day {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-week-day.is-today {
  border-color: color-mix(in srgb, var(--green) 48%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, white);
}

.task-week-day.drag-over,
.week-schedule-cell.drag-over,
.day-plan-hour.drag-over {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  background: color-mix(in srgb, var(--green) 12%, white);
}

.task-week-day header {
  display: grid;
  gap: 2px;
}

.task-week-day header span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-week-day header strong {
  font-size: 13px;
  line-height: 1.2;
}

.task-week-items {
  display: grid;
  gap: 6px;
}

.task-week-item,
.task-week-event {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--line)) 38%, var(--line));
  border-radius: 8px;
  padding: 8px;
  background: var(--entry-soft, white);
  color: var(--ink);
  text-align: left;
}

.task-week-item {
  border-color: color-mix(in srgb, var(--project-color, var(--green)) 30%, var(--line));
}

.task-week-item.high {
  border-color: color-mix(in srgb, var(--coral) 42%, var(--line));
}

.task-week-item span,
.task-week-event strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.task-week-item small,
.task-week-event span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.task-week-event {
  background: #fff8df;
  border-color: #eadfae;
}

.column {
  min-width: 0;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
}

.column.drag-over {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.column-time-note {
  margin: -2px 2px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.task-list,
.focus-list,
.check-list,
.idea-list,
.project-list,
.roadmap-list,
.setup-steps,
.suggestion-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.empty-state {
  color: var(--muted);
  margin: 0;
}

.project-loading,
.project-empty-state {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.project-loading strong,
.project-empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.project-loading span,
.project-empty-state span {
  display: block;
}

.project-loading-bars {
  display: grid;
  gap: 8px;
}

.project-loading-bars span {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(222, 228, 222, 0.72), rgba(255, 255, 255, 0.95), rgba(222, 228, 222, 0.72));
  background-size: 220% 100%;
  animation: project-loading-sheen 1.2s ease-in-out infinite;
}

.project-loading-bars span:nth-child(2) {
  width: 82%;
  animation-delay: 120ms;
}

.project-loading-bars span:nth-child(3) {
  width: 58%;
  animation-delay: 240ms;
}

.task-card {
  background: var(--project-soft, color-mix(in srgb, var(--project-color, var(--blue)) 26%, white));
  border: 1px solid color-mix(in srgb, var(--project-color, var(--line)) 45%, var(--line));
  border-radius: 8px;
  box-sizing: border-box;
  padding: 12px;
  display: grid;
  gap: 9px;
  min-width: 0;
  width: 100%;
  box-shadow: 0 8px 18px rgba(31, 38, 35, 0.06);
  transform: scale(1);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    gap 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    padding 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card,
.project-card {
  cursor: pointer;
}

.task-card.dragging {
  opacity: 0.94;
  border-color: var(--green);
  box-shadow: 0 18px 34px rgba(45, 125, 95, 0.16);
}

.task-card:hover {
  box-shadow: 0 12px 24px rgba(31, 38, 35, 0.1);
  transform: translateY(-1px);
}

.task-card.high {
  box-shadow: 0 8px 18px rgba(217, 101, 79, 0.1);
}

.task-card.medium {
  box-shadow: 0 8px 18px rgba(185, 139, 47, 0.09);
}

.task-card.current-focus {
  border-color: var(--coral);
  outline: 2px solid rgba(217, 101, 79, 0.22);
  background: color-mix(in srgb, var(--project-color, var(--coral)) 28%, white);
  box-shadow: 0 14px 28px rgba(217, 101, 79, 0.14);
}

.task-card.is-done {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  box-shadow: none;
  opacity: 0.58;
  filter: saturate(0.45);
}

.task-card.is-done:hover {
  opacity: 0.78;
  transform: none;
}

.task-card.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(104, 117, 111, 0.35);
}

.task-title {
  font-weight: 800;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}

.task-time-slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--project-color, var(--line)) 32%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.task-time-slot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.task-time-slot input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  box-sizing: border-box;
  display: inline-block;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 4px 8px;
  background: #fbfcfb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-burst {
  position: fixed;
  z-index: 9999;
  width: 8px;
  height: 8px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.completion-burst::before {
  content: "Done";
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 850;
  transform: translate(-50%, -50%);
  animation: done-pop 760ms ease forwards;
}

.completion-burst span {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  transform: rotate(var(--angle)) translateX(0);
  animation: confetti-pop 720ms ease-out forwards;
}

.completion-burst span:nth-child(3n) {
  background: var(--coral);
}

.completion-burst span:nth-child(3n + 1) {
  background: var(--gold);
}

@keyframes confetti-pop {
  to {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(42px) scale(0.4);
  }
}

@keyframes done-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -74%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -96%) scale(0.94);
  }
}

.mini-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font-weight: 800;
}

.mini-button.danger {
  color: var(--coral);
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.mini-routine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mini-routine-grid strong {
  display: block;
  margin-bottom: 8px;
}

.check-list.compact {
  gap: 7px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.routine-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.routine-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfb;
  color: var(--ink);
}

.routine-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  cursor: grab;
}

.routine-panel {
  background: var(--entry-soft, var(--panel));
  border-color: color-mix(in srgb, var(--entry-color, var(--line)) 30%, var(--line));
}

.routine-row:hover .check-row,
.routine-row.drag-over .check-row,
.routine-panel.drag-over {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
}

.routine-row.dragging,
.routine-panel.dragging {
  opacity: 0.55;
}

.routine-row .check-row {
  min-width: 0;
}

.shared-routine-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-left: 4px;
}

.shared-routine-person {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shared-routine-person input {
  width: 14px;
  height: 14px;
  accent-color: var(--green);
}

.routine-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drag-handle {
  width: 14px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    radial-gradient(circle, var(--muted) 1px, transparent 1.2px) 4px 5px / 6px 6px,
    #fbfcfb;
  cursor: grab;
  opacity: 0.55;
  display: inline-block;
}

.drag-handle:active {
  cursor: grabbing;
}

.section-grip {
  height: 22px;
  flex: 0 0 auto;
}

.routine-actions {
  display: flex;
  gap: 6px;
}

.routine-day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.routine-day-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.routine-day-picker input {
  width: 14px;
  height: 14px;
  accent-color: var(--green);
}

.section-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.idea-card,
.project-card,
.roadmap-list div,
.copy-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.idea-card strong,
.project-card strong,
.roadmap-list strong {
  display: block;
  margin-bottom: 4px;
}

.idea-card p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notes-app {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  min-height: 68vh;
  padding: 0;
  overflow: hidden;
}

.notes-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.apple-note-list {
  display: grid;
  gap: 6px;
}

.apple-note-row {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  background: var(--note-bg, #fffdf7);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.apple-note-row:hover,
.apple-note-row.is-active {
  border-color: #e7d08d;
  background: var(--note-soft, #fff7ce);
}

.apple-note-row strong,
.apple-note-row span,
.apple-note-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apple-note-row strong {
  font-size: 15px;
}

.apple-note-row span,
.apple-note-row small {
  color: var(--muted);
}

.note-editor {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 18px;
  background: var(--note-bg, #fffdf7) !important;
}

.note-editor-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.note-color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-color-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: var(--swatch-color);
  cursor: pointer;
}

.note-color-swatch.is-active {
  box-shadow: 0 0 0 3px rgba(45, 125, 95, 0.18), inset 0 0 0 2px #fff;
}

.note-delete-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(217, 101, 79, 0.35);
  border-radius: 8px;
  background: rgba(255, 241, 241, 0.9);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 38, 35, 0.08);
}

.note-delete-confirm[hidden] {
  display: none;
}

.note-delete-confirm span {
  font-weight: 800;
}

.note-title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 0 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 30px;
  font-weight: 900;
}

.note-title-input:focus,
.lined-note-body:focus {
  outline: none;
}

.lined-note-body {
  width: 100%;
  min-height: 50vh;
  border: 0;
  border-radius: 0;
  padding: 2px 0 24px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      var(--note-line, #dfe7df) 31px,
      var(--note-line, #dfe7df) 32px
    ),
    var(--note-bg, #fffdf7);
  color: var(--ink);
  font: inherit;
  line-height: 32px;
  resize: vertical;
}

.view[data-view="today"] {
  position: relative;
}

.day-plan-panel {
  margin-bottom: 18px;
}

.day-plan-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.day-plan-form select,
.day-plan-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.day-plan-timeline {
  display: grid;
  gap: 8px;
}

.week-timeline-grid {
  display: grid;
  grid-template-columns: 86px repeat(7, minmax(150px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding-bottom: 0;
}

.week-time-rail,
.week-day-header,
.week-schedule-cell {
  background: transparent;
}

.week-time-rail {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  min-height: 86px;
}

.week-time-rail.is-header {
  min-height: auto;
  border-top: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.week-time-rail strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}

.week-time-rail span {
  font-size: 11px;
  font-weight: 850;
}

.week-day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-left: 1px solid var(--line);
  background: white;
}

.week-day-header.is-today {
  border-color: color-mix(in srgb, var(--green) 48%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, white);
}

.week-day-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.week-day-header span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.week-day-header strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
}

.week-schedule-cell {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 86px;
  padding: 8px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.week-cell-empty {
  align-self: center;
  justify-self: center;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  font-size: 12px;
  font-weight: 850;
}

.week-schedule-entry {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: grab;
}

.week-schedule-entry.task {
  background: var(--entry-soft, #eef6ff);
  border-color: color-mix(in srgb, var(--entry-color, #cfe0ee) 38%, var(--line));
}

.week-schedule-entry.routine {
  background: var(--entry-soft, #f2f7ee);
  border-color: color-mix(in srgb, var(--entry-color, #d8e6d2) 38%, var(--line));
}

.week-schedule-entry.calendar {
  background: var(--entry-soft, #fff8df);
  border-color: color-mix(in srgb, var(--entry-color, #eadfae) 38%, var(--line));
}

.week-schedule-entry span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.week-schedule-entry strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.25;
}

.day-plan-hour {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 38px;
}

.day-plan-hour > time {
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.day-plan-hour.is-half-hour > time {
  color: #9ca8a1;
  font-size: 11px;
}

.day-plan-hour.is-half-hour .day-plan-items {
  border-left-style: dashed;
}

.day-plan-items {
  display: grid;
  gap: 7px;
  min-height: 38px;
  padding-left: 12px;
  border-left: 2px solid #e0e8e2;
}

.day-plan-hour.has-items .day-plan-items {
  border-left-color: var(--green);
}

.day-plan-empty {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: #9ca8a1;
  font-size: 12px;
  font-weight: 800;
}

.day-plan-entry {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--line)) 38%, var(--line));
  border-radius: 8px;
  background: var(--entry-soft, #fbfcfb);
  cursor: grab;
}

.day-plan-entry.task {
  background: var(--entry-soft, #eef6ff);
  border-color: color-mix(in srgb, var(--entry-color, #cfe0ee) 38%, var(--line));
}

.day-plan-entry.routine {
  background: var(--entry-soft, #f2f7ee);
  border-color: color-mix(in srgb, var(--entry-color, #d8e6d2) 38%, var(--line));
}

.day-plan-entry.calendar {
  background: var(--entry-soft, #fff8df);
  border-color: color-mix(in srgb, var(--entry-color, #eadfae) 38%, var(--line));
}

.day-plan-entry.is-done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.day-plan-entry-time,
.day-plan-entry small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.day-plan-entry strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.day-plan-entry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sticky-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.sticky-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.sticky-color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 12px;
}

.sticky-color-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: var(--swatch-color);
  cursor: pointer;
}

.sticky-color-swatch.is-active {
  box-shadow: 0 0 0 3px rgba(185, 139, 47, 0.22), inset 0 0 0 2px #fff;
}

.sticky-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  min-height: 132px;
}

.sticky-note {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 116px;
  padding: 26px 12px 12px;
  border: 0;
  border-radius: 2px;
  background: var(--sticky-bg, #fff19a);
  color: var(--ink);
  box-shadow: 0 14px 18px rgba(31, 38, 35, 0.11), 0 2px 3px rgba(31, 38, 35, 0.08);
  transform: rotate(var(--sticky-tilt, -1deg));
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sticky-note.is-placed {
  position: absolute;
  z-index: 4;
  width: min(210px, calc(100vw - 42px));
}

.sticky-note.is-dragging {
  z-index: 12;
  cursor: grabbing;
  box-shadow: 0 22px 28px rgba(31, 38, 35, 0.2), 0 5px 8px rgba(31, 38, 35, 0.12);
}

.sticky-note::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 44px;
  height: 12px;
  border-radius: 2px;
  background: var(--sticky-tape, rgba(255, 255, 255, 0.58));
  box-shadow: 0 1px 2px rgba(31, 38, 35, 0.08);
  transform: translateX(-50%) rotate(1deg);
}

.sticky-note:nth-child(2n) {
  --sticky-tilt: 1.2deg;
}

.sticky-note:nth-child(3n) {
  --sticky-tilt: -0.4deg;
}

.sticky-note span {
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sticky-note .mini-button {
  flex: 0 0 auto;
  min-height: 30px;
  background: rgba(255, 255, 255, 0.54);
}

.project-card {
  display: grid;
  gap: 8px;
  background: var(--project-soft, #fbfcfb);
  border-color: color-mix(in srgb, var(--project-color, var(--line)) 42%, var(--line));
}

.project-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.project-description {
  margin: 0;
  color: var(--muted);
}

.project-meta-row {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.project-ticket-list {
  display: grid;
  gap: 7px;
}

.project-task-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px 112px 132px auto;
  gap: 8px;
  margin: 8px 0 12px;
  align-items: center;
}

.project-task-composer input,
.project-task-composer select {
  min-height: 42px;
}

.project-ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--project-color, var(--line)) 28%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.project-ticket-row span {
  color: var(--ink);
  font-weight: 750;
}

.project-ticket-row small {
  color: var(--muted);
  white-space: nowrap;
}

.sunny-guide-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(45, 125, 95, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 206, 0.72), rgba(239, 251, 242, 0.72));
}

.sunny-guide-panel p {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.4;
}

.sunny-question-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sunny-question-list span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.project-guide-suggestions {
  display: grid;
  gap: 7px;
}

.project-guide-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(45, 125, 95, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.project-guide-suggestion strong {
  margin: 0;
}

.project-guide-suggestion span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.project-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.project-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-color-input {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: white;
}

.copy-box {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.planner-form,
.project-form,
.grocery-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.planner-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.planner-form textarea,
.project-form input,
.grocery-form input,
.calendar-form input,
.calendar-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcfb;
  color: var(--ink);
}

.planner-form textarea {
  resize: vertical;
}

.grocery-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.calendar-form {
  display: grid;
  gap: 10px;
}

.grocery-list,
.agenda-list {
  display: grid;
  gap: 9px;
}

.staples-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.staple-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staple-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.grocery-row,
.agenda-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.grocery-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.grocery-row label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.grocery-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.grocery-row.is-done {
  opacity: 0.55;
}

.grocery-row.is-done label span {
  text-decoration: line-through;
}

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

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.calendar-day {
  min-height: 96px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  display: grid;
  align-content: start;
  gap: 5px;
  color: var(--ink);
  text-align: left;
}

.calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.is-today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.calendar-day.is-selected {
  background: var(--panel-soft);
  border-color: color-mix(in srgb, var(--green) 48%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 52%, transparent);
}

.calendar-day span,
.calendar-day small,
.agenda-row span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-day span {
  padding: 3px 5px;
  border-radius: 6px;
  background: var(--entry-soft, var(--panel-soft));
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--line)) 28%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  cursor: pointer;
}

.agenda-row:hover,
.agenda-row:focus-visible {
  border-color: color-mix(in srgb, var(--entry-color, var(--green)) 48%, var(--line));
  background: color-mix(in srgb, var(--entry-color, var(--green)) 10%, white);
  outline: none;
}

.agenda-row strong,
.agenda-row span {
  display: block;
}

.today-calendar-next {
  display: grid;
  gap: 7px;
}

.today-calendar-next p {
  margin: 0;
}

.calendar-next-strip {
  margin: 0 0 14px;
}

.calendar-next-feature,
.calendar-next-empty {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--green)) 34%, var(--line));
  border-radius: 8px;
  background: var(--entry-soft, color-mix(in srgb, var(--green) 9%, white));
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
}

.calendar-next-feature strong,
.calendar-next-feature small,
.calendar-next-empty strong,
.calendar-next-empty span {
  display: block;
}

.calendar-next-feature small,
.calendar-next-empty > span:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-next-feature:hover {
  border-color: color-mix(in srgb, var(--entry-color, var(--green)) 48%, var(--line));
  transform: translateY(-1px);
}

.calendar-next-cta {
  display: inline-grid;
  min-width: 58px;
  min-height: 34px;
  place-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.calendar-next-row {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--line)) 34%, var(--line));
  border-radius: 8px;
  background: var(--entry-soft, #fbfcfb);
  color: var(--ink);
  text-align: left;
}

.calendar-next-row strong,
.calendar-next-row span {
  display: block;
}

.calendar-next-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.calendar-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 14%, white);
  box-shadow: var(--shadow);
}

.calendar-alert[hidden] {
  display: none;
}

.calendar-alert-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.calendar-alert-list span {
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--entry-color, var(--gold)) 30%, var(--line));
  border-radius: 999px;
  background: var(--entry-soft, rgba(255, 255, 255, 0.72));
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.share-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.grocery-share-preview {
  white-space: pre-wrap;
}

.grocery-partner-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  vertical-align: middle;
}

.grocery-partner-status.is-shared {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.suggestion-list {
  margin-top: 12px;
}

.suggestion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--project-color, var(--line)) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--project-color, var(--coral)) 14%, white);
}

.suggestion-reason {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.plan-rank {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--project-color, var(--ink));
  color: white;
  font-weight: 850;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-meter {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.score-meter span,
.score-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.score-meter strong {
  display: block;
  margin: 2px 0 6px;
}

.score-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eee9;
}

.score-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--project-color, var(--green));
}

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

.nested-task-list {
  display: grid;
  gap: 7px;
}

.plan-task {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.plan-task small {
  color: var(--muted);
  white-space: nowrap;
}

.suggestion-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.chat-sidebar,
.chat-shell {
  display: grid;
  gap: 12px;
}

.chat-sidebar {
  align-content: start;
}

.chat-sidebar .primary-button {
  width: 100%;
}

.chat-thread-list {
  display: grid;
  gap: 8px;
}

.chat-thread-button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  text-align: left;
}

.chat-thread-button.is-active,
.chat-thread-button:hover {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: var(--panel-soft);
}

.chat-thread-button span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-prompts .secondary-button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.chat-log {
  height: min(58vh, 620px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.chat-message {
  width: min(760px, 88%);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.chat-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-message.from-user {
  justify-self: end;
  background: var(--panel-soft);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcfb;
  color: var(--ink);
  resize: vertical;
}

.lower {
  margin-top: 20px;
}

.task-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(520px, calc(100vw - 24px));
}

.task-dialog::backdrop {
  background: rgba(31, 38, 35, 0.3);
}

.task-dialog form {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h3 {
  margin: 2px 0 0;
}

.task-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.task-dialog input,
.task-dialog select,
.task-dialog textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: var(--ink);
}

.task-dialog textarea {
  resize: vertical;
}

/* Premium polish pass: calmer surfaces, slimmer controls, and lighter board density. */
body {
  background:
    var(--body-glow),
    var(--bg);
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 14px;
  gap: 12px;
  background: var(--sidebar-bg);
  box-shadow: inset -1px 0 0 rgba(31, 38, 35, 0.03);
}

.brand {
  gap: 10px;
  padding: 0 4px 4px;
}

.brand-mark {
  width: 38px;
  height: 38px;
}

.brand h1 {
  font-size: 17px;
}

.nav-list {
  gap: 2px;
}

.nav-list a {
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 720;
}

.nav-list a.active,
.nav-list a:hover {
  background: var(--active-nav);
  box-shadow: inset 0 0 0 1px rgba(185, 139, 47, 0.18);
}

.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.panel,
.task-dialog form {
  border-color: rgba(31, 38, 35, 0.09);
  box-shadow: 0 10px 24px rgba(31, 38, 35, 0.045);
}

.side-panel,
.panel,
.routine-panel {
  padding: 12px;
}

.section-label {
  font-size: 11px;
  font-weight: 760;
  color: color-mix(in srgb, var(--green) 80%, var(--ink));
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 720;
}

.icon-button {
  width: 36px;
}

.primary-button {
  box-shadow: 0 8px 18px rgba(31, 38, 35, 0.12);
}

.secondary-button,
.icon-button {
  background: color-mix(in srgb, var(--control-strong) 78%, transparent);
  border-color: rgba(31, 38, 35, 0.11);
}

.main {
  padding: 24px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 680;
}

.topbar h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.page-subtitle {
  margin-top: 6px;
  font-size: 16px;
}

.metrics-grid,
.split-grid,
.routine-grid {
  gap: 12px;
}

.metric {
  min-height: 126px;
  padding: 14px;
  gap: 11px;
}

.metric-heading span,
.metric-heading strong {
  font-weight: 720;
}

.progress-track {
  height: 7px;
}

.assistant-strip {
  padding: 14px;
  gap: 12px;
  margin-bottom: 12px;
}

.assistant-strip p {
  font-size: 16px;
  font-weight: 680;
}

.kanban {
  gap: 10px;
}

.column {
  min-height: 520px;
  padding: 9px;
  background: color-mix(in srgb, var(--control-strong) 43%, transparent);
  border-color: rgba(31, 38, 35, 0.08);
}

.column-header {
  padding: 2px 2px 9px;
  font-size: 12px;
  font-weight: 760;
}

.task-list,
.focus-list,
.check-list,
.idea-list,
.project-list,
.roadmap-list,
.setup-steps,
.suggestion-list {
  gap: 8px;
}

.task-card {
  position: relative;
  padding: 10px;
  gap: 7px;
  background: var(--project-soft, color-mix(in srgb, var(--project-color, var(--blue)) 24%, var(--mix-surface)));
  border-color: color-mix(in srgb, var(--project-color, var(--line)) 42%, var(--line));
  box-shadow: 0 5px 14px rgba(31, 38, 35, 0.045);
}

.task-card::before {
  display: none;
}

.task-card:hover {
  box-shadow: 0 10px 22px rgba(31, 38, 35, 0.075);
}

.task-card.high,
.task-card.medium {
  box-shadow: 0 5px 14px rgba(31, 38, 35, 0.05);
}

.task-card.current-focus {
  background: color-mix(in srgb, var(--project-color, var(--coral)) 28%, var(--mix-surface));
  border-color: color-mix(in srgb, var(--coral) 36%, var(--line));
  outline: 1px solid rgba(217, 101, 79, 0.18);
  box-shadow: 0 12px 26px rgba(217, 101, 79, 0.1);
}

.task-title {
  font-size: 15px;
  font-weight: 760;
  line-height: 1.22;
}

.task-meta {
  gap: 5px;
  font-size: 11px;
}

.pill {
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(31, 38, 35, 0.09);
}

.project-card,
.roadmap-list div,
.copy-box,
.nudge-item,
.phone-url-row,
.phone-step-list div,
.settings-status-card,
.cloud-summary-card {
  border-color: rgba(31, 38, 35, 0.09);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 18px rgba(31, 38, 35, 0.035);
}

.project-card {
  gap: 7px;
  background: color-mix(in srgb, var(--project-color, var(--green)) 8%, white);
}

.sharing-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.sharing-composer {
  grid-template-columns: minmax(0, 1fr) 150px auto;
  margin: 0;
}

.sharing-join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sharing-join-row input {
  min-width: 0;
}

.sharing-connection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(46, 126, 94, 0.18);
  border-radius: 8px;
  background: rgba(46, 126, 94, 0.08);
}

.sharing-connection-card[hidden] {
  display: none;
}

.sharing-connection-card strong,
.sharing-connection-card span {
  display: block;
}

.sharing-connected-name {
  display: grid;
  gap: 5px;
  max-width: 360px;
}

.sharing-connected-name span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.sharing-connection-card strong {
  font-size: 1.08rem;
}

.sharing-connection-card span {
  color: var(--muted);
}

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

.sharing-project-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.sharing-project-panel[hidden] {
  display: none;
}

.sharing-together-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(46, 126, 94, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.sharing-together-panel[hidden] {
  display: none;
}

.sharing-together-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.sharing-together-panel strong,
.sharing-together-panel p {
  margin: 0;
}

.sharing-together-panel p {
  color: var(--muted);
}

.together-chart {
  display: grid;
  gap: 12px;
}

.together-person {
  display: grid;
  grid-template-columns: minmax(110px, 170px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.together-person-header {
  display: grid;
  gap: 2px;
}

.together-person-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.together-bars,
.together-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(14px, 1fr));
  gap: 7px;
  align-items: end;
}

.together-bars {
  height: 56px;
}

.together-bars span {
  display: block;
  height: var(--bar-height, 10%);
  min-height: 7px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #2d7d5f, #f0c63f);
}

.together-days {
  margin-left: min(170px, 30%);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-align: center;
  text-transform: uppercase;
}

.sharing-project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.sharing-area-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(31, 38, 35, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 760;
}

.sharing-area-card input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.inline-share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(31, 38, 35, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 820;
}

.inline-share-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.routine-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-share-toggle {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.dialog-share-toggle {
  margin-top: 4px;
}

.sharing-project-card span,
.sharing-project-card strong,
.sharing-project-card small {
  display: block;
}

.sharing-project-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.project-share-toggle {
  margin: 10px 0 4px;
}

.shared-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(46, 126, 94, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
}

.sharing-member-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sharing-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(31, 38, 35, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.sharing-member-card strong,
.sharing-member-card span {
  display: block;
}

.sharing-member-card span,
.sharing-invite-preview {
  color: var(--muted);
}

.sharing-invite-preview {
  margin-top: 10px;
  white-space: pre-wrap;
  font-weight: 760;
}

.detail-dialog {
  width: min(760px, calc(100vw - 24px));
}

.resource-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.resource-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-panel h4 {
  margin: 2px 0 0;
  font-size: 16px;
}

.resource-preview {
  display: grid;
  gap: 10px;
}

.resource-link-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.resource-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 6px 14px rgba(31, 38, 35, 0.06);
}

.resource-link-chip a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-link-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

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

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

.attachment-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  text-decoration: none;
}

.attachment-item img,
.file-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-soft);
}

.file-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attachment-item small {
  display: block;
  color: var(--muted);
}

.resource-card-grid .attachment-item {
  min-height: 78px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-actions {
  margin: 4px 0 0;
  padding: 0;
}

@keyframes buddy-command-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.03);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Minimal premium pass: quieter chrome, lighter surfaces, and settings-ready design tokens. */
:root[data-theme="light"] {
  --bg: #fbfbf9;
  --panel: #ffffff;
  --panel-soft: #f5f6f3;
  --control: #f7f8f6;
  --control-strong: #ffffff;
  --ink: #171d1a;
  --muted: #6d7771;
  --line: #e7ebe6;
  --body-glow: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 251, 249, 0) 360px);
  --sidebar-bg: rgba(255, 255, 255, 0.78);
  --active-nav: rgba(29, 37, 33, 0.055);
  --shadow: 0 18px 54px rgba(29, 37, 33, 0.055);
  --mix-surface: #ffffff;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--hairline-soft);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.brand {
  padding-bottom: 10px;
}

.brand h1 {
  font-weight: 780;
}

.brand p,
.page-subtitle,
.section-note,
.cloud-helper,
.task-card p,
.project-card span {
  color: var(--muted);
}

.nav-list a {
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  font-weight: 650;
}

.nav-list a.active,
.nav-list a:hover {
  background: var(--active-nav);
  border-color: var(--hairline-soft);
  box-shadow: none;
  color: var(--ink);
}

.main {
  padding: clamp(22px, 3vw, 38px);
}

.topbar {
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 760;
  line-height: 0.96;
}

.eyebrow,
.section-label {
  color: color-mix(in srgb, var(--green) 72%, var(--ink));
  font-weight: 760;
}

.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.panel,
.task-dialog form,
.auth-card,
.onboarding-card {
  background: var(--surface);
  border-color: var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(29, 37, 33, 0.035), var(--shadow);
}

.panel,
.routine-panel,
.side-panel {
  padding: clamp(14px, 1.4vw, 18px);
}

.settings-profile-form label,
.settings-status-card,
.cloud-dashboard-card,
.cloud-dashboard-status,
.sharing-area-card,
.sharing-connection-card,
.sharing-member-card,
.wrap-card,
.wrap-stats div,
.wrap-goals > div,
.idea-card,
.grocery-row,
.agenda-row,
.calendar-day,
.history-day,
.attachment-item,
.phone-url-row,
.phone-step-list div,
.copy-box,
.nudge-item,
.theme-choice-card,
.task-week-day,
.task-week-item,
.task-week-event,
.unscheduled-item,
.week-schedule-entry,
.day-plan-entry {
  background: var(--surface-soft);
  border-color: var(--hairline);
  box-shadow: none;
}

input,
select,
textarea,
.settings-profile-form input,
.settings-profile-form select,
.settings-profile-form textarea,
.task-dialog input,
.task-dialog select,
.task-dialog textarea {
  border-color: var(--hairline);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--green) 18%, transparent);
  border-color: color-mix(in srgb, var(--green) 44%, var(--line));
}

.primary-button,
.secondary-button,
.icon-button,
.mini-button {
  border-radius: var(--radius-control);
  font-weight: 720;
}

.primary-button {
  background: var(--ink);
  box-shadow: 0 10px 26px rgba(29, 37, 33, 0.12);
}

.secondary-button,
.icon-button,
.mini-button {
  background: var(--surface-strong);
  border-color: var(--hairline);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.kanban {
  gap: 12px;
}

.column {
  background: rgba(255, 255, 255, 0.42);
  border-color: var(--hairline-soft);
  box-shadow: none;
}

.column-header {
  color: var(--muted);
  letter-spacing: 0;
}

.task-card {
  background: color-mix(in srgb, var(--project-color, var(--green)) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--project-color, var(--green)) 22%, var(--hairline));
  box-shadow: none;
}

.task-card:hover {
  box-shadow: 0 8px 22px rgba(29, 37, 33, 0.065);
}

.task-card.high,
.task-card.medium {
  box-shadow: none;
}

.task-card.current-focus {
  background: color-mix(in srgb, var(--project-color, var(--coral)) 18%, var(--surface-strong));
  outline: 1px solid color-mix(in srgb, var(--coral) 24%, transparent);
  box-shadow: 0 10px 28px rgba(29, 37, 33, 0.08);
}

.task-title {
  font-weight: 760;
}

.pill,
.shared-badge,
.drag-chip,
.resource-link-chip {
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  border-color: var(--hairline-soft);
  box-shadow: none;
}

.project-card {
  background: var(--surface-strong);
  border-color: var(--hairline);
  border-left: 3px solid color-mix(in srgb, var(--project-color, var(--green)) 72%, var(--line));
  box-shadow: none;
}

.project-card .task-card,
.project-ticket-list .task-card {
  background: color-mix(in srgb, var(--project-color, var(--green)) 5%, var(--surface-strong));
}

.theme-choice-card:has(input:checked) {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 38%, transparent);
}

:root[data-theme="gray"] .settings-profile-form label,
:root[data-theme="gray"] .settings-status-card,
:root[data-theme="gray"] .phone-url-row,
:root[data-theme="gray"] .phone-step-list div,
:root[data-theme="gray"] .cloud-dashboard-card,
:root[data-theme="gray"] .cloud-dashboard-status,
:root[data-theme="gray"] .sharing-area-card,
:root[data-theme="gray"] .sharing-connection-card,
:root[data-theme="gray"] .sharing-member-card,
:root[data-theme="gray"] .wrap-card,
:root[data-theme="gray"] .wrap-stats div,
:root[data-theme="gray"] .wrap-goals > div,
:root[data-theme="gray"] .project-card,
:root[data-theme="gray"] .idea-card,
:root[data-theme="gray"] .grocery-row,
:root[data-theme="gray"] .agenda-row,
:root[data-theme="gray"] .calendar-day,
:root[data-theme="gray"] .history-day,
:root[data-theme="gray"] .attachment-item,
:root[data-theme="gray"] .planner-quick-add input,
:root[data-theme="gray"] .planner-quick-add select,
:root[data-theme="gray"] .schedule-range-controls select,
:root[data-theme="gray"] .sticky-form input,
:root[data-theme="gray"] .planner-form textarea,
:root[data-theme="gray"] .project-form input,
:root[data-theme="gray"] .grocery-form input,
:root[data-theme="gray"] .calendar-form input,
:root[data-theme="gray"] .calendar-form select,
:root[data-theme="color"] .settings-profile-form label,
:root[data-theme="color"] .settings-status-card,
:root[data-theme="color"] .phone-url-row,
:root[data-theme="color"] .phone-step-list div,
:root[data-theme="color"] .cloud-dashboard-card,
:root[data-theme="color"] .cloud-dashboard-status,
:root[data-theme="color"] .sharing-area-card,
:root[data-theme="color"] .sharing-connection-card,
:root[data-theme="color"] .sharing-member-card,
:root[data-theme="color"] .wrap-card,
:root[data-theme="color"] .wrap-stats div,
:root[data-theme="color"] .wrap-goals > div,
:root[data-theme="color"] .project-card,
:root[data-theme="color"] .idea-card,
:root[data-theme="color"] .grocery-row,
:root[data-theme="color"] .agenda-row,
:root[data-theme="color"] .calendar-day,
:root[data-theme="color"] .history-day,
:root[data-theme="color"] .attachment-item,
:root[data-theme="color"] .planner-quick-add input,
:root[data-theme="color"] .planner-quick-add select,
:root[data-theme="color"] .schedule-range-controls select,
:root[data-theme="color"] .sticky-form input,
:root[data-theme="color"] .planner-form textarea,
:root[data-theme="color"] .project-form input,
:root[data-theme="color"] .grocery-form input,
:root[data-theme="color"] .calendar-form input,
:root[data-theme="color"] .calendar-form select {
  background-color: var(--control);
  border-color: var(--line);
}

:root[data-theme="dark"] .side-panel,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .routine-panel,
:root[data-theme="dark"] .assistant-strip,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .task-dialog form,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .onboarding-card {
  border-color: var(--line);
}

:root[data-theme="dark"] .onboarding-gate {
  background: rgba(21, 26, 24, 0.94);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .settings-profile-form label,
:root[data-theme="dark"] .settings-status-card,
:root[data-theme="dark"] .phone-url-row,
:root[data-theme="dark"] .phone-step-list div,
:root[data-theme="dark"] .cloud-dashboard-card,
:root[data-theme="dark"] .cloud-dashboard-status,
:root[data-theme="dark"] .sharing-area-card,
:root[data-theme="dark"] .sharing-connection-card,
:root[data-theme="dark"] .sharing-member-card,
:root[data-theme="dark"] .wrap-card,
:root[data-theme="dark"] .wrap-stats div,
:root[data-theme="dark"] .wrap-goals > div,
:root[data-theme="dark"] .sharing-project-row,
:root[data-theme="dark"] .project-card,
:root[data-theme="dark"] .idea-card,
:root[data-theme="dark"] .grocery-row,
:root[data-theme="dark"] .agenda-row,
:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .history-day,
:root[data-theme="dark"] .attachment-item,
:root[data-theme="dark"] .planner-quick-add input,
:root[data-theme="dark"] .planner-quick-add select,
:root[data-theme="dark"] .schedule-range-controls select,
:root[data-theme="dark"] .sticky-form input,
:root[data-theme="dark"] .planner-form textarea,
:root[data-theme="dark"] .project-form input,
:root[data-theme="dark"] .grocery-form input,
:root[data-theme="dark"] .calendar-form input,
:root[data-theme="dark"] .calendar-form select,
:root[data-theme="dark"] .task-dialog input,
:root[data-theme="dark"] .task-dialog select,
:root[data-theme="dark"] .task-dialog textarea,
:root[data-theme="dark"] .task-week-day,
:root[data-theme="dark"] .task-week-item,
:root[data-theme="dark"] .task-week-event,
:root[data-theme="dark"] .unscheduled-item,
:root[data-theme="dark"] .week-schedule-entry,
:root[data-theme="dark"] .day-plan-entry {
  background-color: var(--control);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .task-card.current-focus,
:root[data-theme="dark"] .task-week-item,
:root[data-theme="dark"] .task-week-event,
:root[data-theme="dark"] .unscheduled-item,
:root[data-theme="dark"] .week-schedule-entry,
:root[data-theme="dark"] .day-plan-entry,
:root[data-theme="dark"] .agenda-row {
  background: color-mix(in srgb, var(--entry-color, var(--project-color, var(--green))) 18%, var(--panel));
}

:root[data-theme="dark"] .routine-panel,
:root[data-theme="dark"] .unscheduled-item.routine,
:root[data-theme="dark"] .week-schedule-entry.routine,
:root[data-theme="dark"] .day-plan-entry.routine {
  background: color-mix(in srgb, var(--entry-color, var(--green)) 18%, var(--panel));
}

:root[data-theme="dark"] .unscheduled-item.calendar,
:root[data-theme="dark"] .week-schedule-entry.calendar,
:root[data-theme="dark"] .day-plan-entry.calendar,
:root[data-theme="dark"] .agenda-row {
  background: color-mix(in srgb, var(--entry-color, var(--gold)) 18%, var(--panel));
}

:root[data-theme="dark"] .pill,
:root[data-theme="dark"] .drag-chip,
:root[data-theme="dark"] .mini-button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .icon-button {
  background: var(--control-strong);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] ::backdrop {
  background: var(--modal-backdrop);
}

:root[data-theme="dark"] .column {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--hairline);
}

:root[data-theme="dark"] .primary-button {
  background: #f4f6f1;
  color: #121715;
}

:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .task-card:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .project-card {
  border-color: color-mix(in srgb, var(--project-color, var(--green)) 24%, var(--hairline));
}

@media (max-width: 1080px) {
  .app-shell,
  .split-grid,
  .routine-grid,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .nav-list a {
    text-align: center;
  }

  .companion {
    margin-top: 0;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .weather-panel {
    display: none;
  }

  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .assistant-strip,
  .section-header,
  .wrap-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 34px;
  }

  .quick-actions,
  .assistant-strip .secondary-button,
  .section-header .secondary-button {
    width: 100%;
  }

  .history-summary,
  .wrap-stats {
    grid-template-columns: 1fr;
  }

  .phone-url-row,
  .phone-step-list div {
    align-items: stretch;
    flex-direction: column;
  }

  .planner-form,
  .project-form,
  .feedback-photo-preview,
  .resource-link-row,
  .planner-page-grid,
  .planner-quick-add,
  .task-planner-grid,
  .chat-form,
  .routine-form,
  .grocery-form,
  .grocery-row,
  .agenda-row,
  .staple-row,
  .suggestion-card {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .calendar-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-next-feature,
  .calendar-next-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-alert-list {
    justify-content: flex-start;
  }

  .notes-app {
    grid-template-columns: 1fr;
  }

  .notes-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .note-title-input {
    font-size: 24px;
  }

  .routine-row {
    grid-template-columns: 18px minmax(0, 1fr);
    width: 100%;
  }

  .routine-day-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .routine-actions {
    justify-content: stretch;
  }

  .routine-actions .mini-button {
    flex: 1;
  }

  .chat-message {
    width: 100%;
  }

  .planner-actions {
    grid-template-columns: 1fr 1fr;
  }

  .assistant-actions,
  .chat-prompts {
    width: 100%;
  }

  .assistant-actions .primary-button,
  .assistant-actions .secondary-button,
  .chat-prompts .secondary-button {
    flex: 1 1 132px;
  }

  .score-grid,
  .onboarding-theme-grid,
  .onboarding-palette-grid,
  .plan-main {
    grid-template-columns: 1fr;
  }

  .plan-task {
    flex-direction: column;
  }

  .quick-actions .primary-button,
  .assistant-strip .secondary-button,
  .section-header .secondary-button {
    flex: 1;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-list a {
    white-space: nowrap;
  }

  .kanban {
    grid-template-columns: repeat(4, 82vw);
  }

  .task-week-grid {
    grid-template-columns: 1fr;
  }

  .unscheduled-item {
    grid-template-columns: 1fr;
  }

  .project-task-composer {
    grid-template-columns: 1fr;
  }

  .day-plan-form,
  .day-plan-entry {
    grid-template-columns: 1fr;
  }

  .day-plan-hour {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .day-plan-entry-actions {
    justify-content: flex-start;
  }

  .mini-routine-grid,
  .settings-profile-form,
  .form-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-day.is-empty,
  .calendar-weekday {
    display: none;
  }

  .screen-buddy {
    width: 88px;
    height: 88px;
  }
}

/* Final clean-canvas overrides. These intentionally sit last so the app visibly changes. */
:root[data-theme="light"],
:root:not([data-theme]),
:root[data-theme="gray"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f7f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f8f8f6;
  --control: #f7f7f5;
  --control-strong: #ffffff;
  --ink: #151917;
  --muted: #737a76;
  --line: #e9ece8;
  --body-glow: none;
  --sidebar-bg: #f6f6f4;
  --active-nav: #ffffff;
  --shadow: none;
  --mix-surface: #ffffff;
}

body {
  background: #ffffff !important;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr) !important;
}

.sidebar {
  background: #f6f6f4 !important;
  border-right: 1px solid #ededeb !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.main {
  max-width: 1480px !important;
  padding: clamp(28px, 4vw, 54px) !important;
}

.topbar {
  margin-bottom: 28px !important;
}

.topbar h2 {
  font-size: clamp(40px, 5vw, 64px) !important;
  font-weight: 760 !important;
  line-height: 0.96 !important;
}

.nav-list a {
  min-height: 36px !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  color: #636b66 !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}

.nav-list a.active {
  background: #ffffff !important;
  border-color: #e7e7e4 !important;
  color: #151917 !important;
  box-shadow: 0 1px 2px rgba(21, 25, 23, 0.04) !important;
}

.panel,
.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.task-dialog form,
.auth-card,
.onboarding-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.project-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  border-left: 4px solid var(--project-color, #2d7d5f) !important;
  box-shadow: none !important;
  padding: 18px !important;
}

.task-card,
.project-card .task-card,
.project-ticket-list .task-card,
.task-week-item,
.week-schedule-entry,
.day-plan-entry,
.unscheduled-item {
  background: #ffffff !important;
  border: 1px solid #e6ebe5 !important;
  box-shadow: none !important;
}

.column {
  background: #fafaf8 !important;
  border: 1px solid #ededeb !important;
  box-shadow: none !important;
}

.settings-profile-form label,
.settings-status-card,
.cloud-dashboard-card,
.cloud-dashboard-status,
.sharing-area-card,
.sharing-connection-card,
.sharing-member-card,
.wrap-card,
.wrap-stats div,
.wrap-goals > div,
.idea-card,
.grocery-row,
.agenda-row,
.calendar-day,
.history-day,
.attachment-item,
.phone-url-row,
.phone-step-list div,
.copy-box,
.nudge-item,
.theme-choice-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  box-shadow: none !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  border-color: #e3e7e2 !important;
  border-radius: 8px !important;
}

.primary-button {
  background: #151917 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.secondary-button,
.icon-button,
.mini-button,
.pill,
.drag-chip,
.shared-badge {
  background: #ffffff !important;
  border-color: #e3e7e2 !important;
  box-shadow: none !important;
}

.section-label,
.eyebrow {
  color: #2d7d5f !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

.page-subtitle,
.project-card > p,
.project-card span,
.task-card p {
  color: #727975 !important;
}
/* Final clean UI override: keep at end so it wins over legacy styling. */
:root[data-theme="light"],
:root:not([data-theme]),
:root[data-theme="gray"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f7f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f8f8f6;
  --control: #f7f7f5;
  --control-strong: #ffffff;
  --ink: #151917;
  --muted: #727975;
  --line: #e9ece8;
  --hairline: rgba(21, 25, 23, 0.1);
  --hairline-soft: rgba(21, 25, 23, 0.065);
  --body-glow: none;
  --sidebar-bg: #f6f6f4;
  --active-nav: #ffffff;
  --shadow: none;
  --mix-surface: #ffffff;
}

body {
  background: #ffffff !important;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr) !important;
}

.sidebar {
  background: #f6f6f4 !important;
  border-right: 1px solid #ededeb !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.main {
  max-width: 1480px;
  padding: clamp(28px, 4vw, 54px) !important;
}

.topbar {
  margin-bottom: 28px !important;
}

.topbar h2 {
  font-size: clamp(40px, 5vw, 64px) !important;
  font-weight: 760 !important;
  line-height: 0.96 !important;
  letter-spacing: 0 !important;
}

.page-subtitle {
  color: #727975 !important;
  font-size: 17px !important;
  max-width: 680px;
}

.nav-list {
  gap: 4px !important;
}

.nav-list a {
  min-height: 36px !important;
  padding: 8px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #636b66 !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.nav-list a.active {
  background: #ffffff !important;
  border-color: #e7e7e4 !important;
  color: #151917 !important;
  box-shadow: 0 1px 2px rgba(21, 25, 23, 0.04) !important;
}

.panel,
.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.task-dialog form,
.auth-card,
.onboarding-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.panel,
.routine-panel,
.side-panel {
  padding: clamp(18px, 1.7vw, 24px) !important;
}

.project-card {
  background: #ffffff !important;
  border: 1px solid #e9ece8 !important;
  border-left: 4px solid var(--project-color, #2d7d5f) !important;
  box-shadow: none !important;
  padding: 18px !important;
}

.task-card,
.project-card .task-card,
.project-ticket-list .task-card,
.task-week-item {
  background: #ffffff !important;
  border: 1px solid #e6ebe5 !important;
  box-shadow: none !important;
}

.task-card:hover,
.project-card .task-card:hover {
  border-color: rgba(45, 125, 95, 0.42) !important;
  box-shadow: 0 8px 20px rgba(21, 25, 23, 0.055) !important;
}

.column {
  background: #fafaf8 !important;
  border: 1px solid #ededeb !important;
  box-shadow: none !important;
}

.primary-button {
  background: #151917 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.secondary-button,
.icon-button,
.mini-button {
  background: #ffffff !important;
  border-color: #e3e7e2 !important;
  box-shadow: none !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  border-color: #e3e7e2 !important;
  border-radius: 8px !important;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .main {
    padding: 22px !important;
  }
}

/* Today redesign: Apple Notes calm, clearer hierarchy, fewer competing boxes. */
body[data-active-view="today"] {
  background: #ffffff !important;
}

body[data-active-view="today"] .topbar {
  margin-bottom: 24px !important;
}

body[data-active-view="today"] .topbar h2 {
  color: #2a302d !important;
  font-size: clamp(46px, 5.2vw, 68px) !important;
  font-weight: 720 !important;
}

body[data-active-view="today"] .eyebrow {
  color: #7c837e !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  text-transform: none !important;
}

body[data-active-view="today"] .page-subtitle {
  color: #7a817d !important;
}

.today-view {
  display: grid;
  gap: 18px;
  max-width: 1180px;
}

.today-plan-panel,
.today-card,
.today-disclosure {
  background: #ffffff !important;
  border: 1px solid #ecefeb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.today-plan-panel {
  padding: clamp(22px, 3vw, 32px);
}

.today-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eef0ed;
}

.today-kicker,
.today-section-heading span,
.today-plan-grid span,
.today-goals-strip span,
.today-disclosure summary span {
  display: block;
  margin: 0 0 6px;
  color: #888f89 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.today-plan-header h3,
.today-section-heading h3,
.today-disclosure summary strong {
  margin: 0;
  color: #303632;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: 0;
}

.today-plan-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(170px, 1fr));
  gap: 0;
  border-bottom: 1px solid #eef0ed;
}

.today-plan-main,
.today-plan-item {
  min-height: 132px;
  padding: 4px 22px 22px 0;
}

.today-plan-item {
  padding-left: 22px;
  border-left: 1px solid #eef0ed;
}

.today-plan-main strong,
.today-plan-item > strong,
.today-next-task strong {
  display: block;
  color: #2c322f;
  font-size: 18px;
  font-weight: 680;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.today-plan-main p,
.today-plan-item p,
.today-next-task span,
.today-goals-strip strong,
.today-goals-strip li strong {
  color: #828984 !important;
  font-size: 13px;
  font-weight: 520;
}

.today-plan-panel .progress-track {
  height: 6px;
  margin: 14px 0 10px;
  background: #eff1ee !important;
}

.today-plan-panel .progress-fill {
  background: #f5c84c !important;
}

.today-calendar-next {
  gap: 8px !important;
}

.today-calendar-next p,
.today-calendar-next article,
.today-calendar-next button,
.today-calendar-next span {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.today-calendar-next p {
  color: #828984;
}

.today-calendar-next button,
.today-calendar-next article {
  padding: 0 !important;
  text-align: left;
}

.today-goals-strip {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  padding-top: 18px;
}

.today-goals-strip .compact-list {
  gap: 8px;
}

.today-goals-strip .compact-list li {
  padding: 0;
  border: 0;
  background: transparent !important;
}

.today-goals-strip .compact-list li span {
  color: #3d433f;
  font-weight: 560;
}

.today-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.today-card {
  padding: clamp(18px, 2vw, 24px);
}

.today-section-heading {
  margin-bottom: 18px;
}

.today-queue-card .focus-list {
  gap: 0;
  border-top: 1px solid #eef0ed;
}

.today-queue-card .task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  margin: 0;
  padding: 15px 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #eef0ed !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.today-queue-card .task-card:last-child {
  border-bottom: 0 !important;
}

.today-queue-card .task-title {
  color: #2e3430;
  font-size: 16px;
  font-weight: 640;
}

.today-queue-card .task-meta {
  justify-content: flex-end;
}

.today-queue-card .pill {
  min-height: 24px;
  padding: 3px 8px;
  background: #f7f7f4 !important;
  border: 0 !important;
  color: #7d847f !important;
  font-size: 11px;
  font-weight: 560;
}

.today-side-stack {
  display: grid;
  gap: 18px;
}

.today-habits-card .mini-routine-grid {
  grid-template-columns: 1fr;
  gap: 18px;
}

.today-habits-card .mini-routine-grid > div {
  padding-top: 14px;
  border-top: 1px solid #eef0ed;
}

.today-habits-card .mini-routine-grid > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.today-habits-card .mini-routine-grid strong {
  color: #3c423f;
  font-size: 14px;
  font-weight: 650;
}

.today-habits-card .check-row {
  min-height: 34px;
  padding: 7px 0;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #f0f1ee !important;
  border-radius: 0 !important;
}

.today-sticky-card .sticky-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.today-sticky-card .sticky-form input {
  min-height: 38px;
  background: #fafaf8 !important;
}

.today-sticky-card .sticky-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.today-sticky-card .sticky-note {
  min-height: 92px;
}

.today-disclosure {
  padding: 0;
  overflow: clip;
}

.today-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

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

.today-disclosure > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: #a0a6a1;
  font-size: 22px;
  font-weight: 300;
}

.today-disclosure[open] > summary::after {
  content: "-";
}

.today-disclosure > summary .mini-button,
.today-disclosure > summary button {
  margin-left: auto;
}

.today-disclosure > summary p {
  margin: 5px 0 0;
  color: #8a918c;
  font-size: 13px;
}

.today-disclosure > :not(summary) {
  margin: 0 22px 22px;
}

.today-ai-panel .planner-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.today-ai-panel textarea {
  min-height: 96px;
  background: #fafaf8 !important;
}

.today-ai-panel .planner-actions {
  align-self: start;
}

#view-today .section-label {
  color: #888f89 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  text-transform: none !important;
}

#view-today .empty-state {
  color: #8b928d;
  font-size: 14px;
}

@media (max-width: 1180px) {
  .today-plan-grid {
    grid-template-columns: 1fr 1fr;
  }

  .today-plan-item:nth-child(3) {
    border-left: 0;
  }

  .today-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .today-plan-header,
  .today-disclosure > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .today-plan-grid,
  .today-goals-strip,
  .today-ai-panel .planner-form {
    grid-template-columns: 1fr;
  }

  .today-plan-main,
  .today-plan-item {
    min-height: auto;
    padding: 18px 0;
    border-left: 0;
    border-top: 1px solid #eef0ed;
  }

  .today-plan-main {
    padding-top: 0;
    border-top: 0;
  }

  .today-queue-card .task-card {
    grid-template-columns: 1fr;
  }

  .today-queue-card .task-meta {
    justify-content: flex-start;
  }
}

/* Today v2: closer to the calm reference layout. */
body[data-active-view="today"] {
  --ink: #272d2a;
  --muted: #747b76;
}

body[data-active-view="today"] .main {
  max-width: 1360px !important;
}

body[data-active-view="today"] .topbar {
  margin-bottom: 34px !important;
}

body[data-active-view="today"] .topbar > div:first-child {
  display: grid;
  gap: 8px;
}

.today-title-chip {
  display: none;
}

body[data-active-view="today"] .today-title-chip {
  display: block;
  order: 2;
  margin: 10px 0 -3px;
  color: #a7a099;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

body[data-active-view="today"] .topbar h2 {
  order: 0;
  color: #262c29 !important;
  font-size: clamp(32px, 3.4vw, 48px) !important;
  font-weight: 650 !important;
  line-height: 1.05 !important;
}

body[data-active-view="today"] .eyebrow {
  order: 1;
  color: #6f7671 !important;
  font-size: 16px !important;
  font-weight: 450 !important;
}

body[data-active-view="today"] .page-subtitle {
  order: 3;
  margin-top: 8px !important;
  color: #878e89 !important;
  font-size: 15px !important;
}

.today-view {
  max-width: 1360px;
  gap: 24px;
}

.today-plan-panel {
  min-height: 330px;
  padding: clamp(36px, 4vw, 56px) clamp(34px, 4vw, 58px);
  border-color: #e4e6e2 !important;
}

.today-focus-hero {
  max-width: 680px;
}

.today-kicker {
  color: #d69c16 !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.today-focus-hero h3 {
  margin: 20px 0 0;
  color: #252b28;
  font-size: clamp(38px, 4.6vw, 66px);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.today-focus-rule {
  width: 72px;
  height: 3px;
  margin: 28px 0 22px;
  border-radius: 99px;
  background: #f7bd38;
}

.today-focus-hero > p {
  margin: 0;
  color: #747b76;
  font-size: 17px;
  line-height: 1.55;
}

.today-focus-hero .today-next-task {
  margin-top: 28px;
  padding: 0;
}

.today-focus-hero .today-next-task strong {
  display: none;
}

.today-focus-hero .today-next-task span {
  color: #8b918d !important;
  font-size: 13px;
}

.today-content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.today-card {
  min-height: 190px;
  padding: 28px 32px;
  border-color: #e7e9e5 !important;
}

.today-section-heading {
  margin-bottom: 20px;
}

.today-section-heading span {
  color: #777e79 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.today-calendar-card .today-calendar-next {
  gap: 16px !important;
}

.today-calendar-card .today-calendar-next > * {
  position: relative;
  padding-left: 26px !important;
}

.today-calendar-card .today-calendar-next > *::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f8bf3b;
}

.today-calendar-card .today-calendar-next > *:nth-child(2)::before {
  background: #9a7bd2;
}

.today-habit-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.today-habit-summary > strong {
  color: #252b28;
  font-size: 34px;
  font-weight: 520;
}

.today-habit-summary b {
  display: block;
  color: #2f3532;
  font-size: 15px;
  font-weight: 600;
}

.today-habit-summary p {
  margin: 4px 0 0;
  color: #838a85;
  font-size: 13px;
}

.today-habits-card .progress-track {
  height: 6px;
  margin-bottom: 18px;
  background: #f0f1ef !important;
}

.today-habits-card .progress-fill {
  background: #f7bd38 !important;
}

.today-habits-card .mini-routine-grid {
  display: none;
}

.today-queue-card .focus-list {
  border-top: 0;
}

.today-queue-card .task-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 8px 0 20px !important;
}

.today-queue-card .task-card::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #a58ad8;
  border-radius: 50%;
}

.today-queue-card .task-title {
  color: #2d3330;
  font-size: 15px;
  font-weight: 570;
}

.today-sticky-card .sticky-form {
  align-items: center;
}

.today-sticky-card .sticky-form input {
  min-height: 48px;
  background: #ffffff !important;
  border-color: #ecefea !important;
}

.today-sticky-card .sticky-form button {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 24px;
  font-weight: 300;
}

.today-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 24px;
  color: #737a75;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.today-card-link::after {
  content: ">";
  color: #8d938f;
  font-size: 20px;
  font-weight: 300;
}

body[data-active-view="today"] h1,
body[data-active-view="today"] h2,
body[data-active-view="today"] h3,
body[data-active-view="today"] h4,
body[data-active-view="today"] strong,
body[data-active-view="today"] .task-title {
  color: #252b28;
}

@media (max-width: 900px) {
  .today-content-grid {
    grid-template-columns: 1fr;
  }

  .today-plan-panel {
    min-height: 280px;
    padding: 30px 24px;
  }
}

/* v290 repair: Today must hide like every other tab, and app text should stay soft gray. */
#view-today:not(.is-active) {
  display: none !important;
}

#view-today.is-active {
  display: grid !important;
}

:root,
:root[data-theme="light"],
:root:not([data-theme]),
:root[data-theme="gray"] {
  --ink: #4a514d;
  --muted: #7d847f;
}

body,
.main,
.topbar h2,
.section-header h3,
.panel h3,
.metric-heading strong,
.task-title,
.project-card strong,
.routine-panel h3,
.calendar-day strong,
.note-title-input,
.notes-title-input,
.settings-profile-form strong,
.today-focus-hero h3,
.today-habit-summary > strong,
.today-habit-summary b,
.today-queue-card .task-title,
body[data-active-view="today"] h1,
body[data-active-view="today"] h2,
body[data-active-view="today"] h3,
body[data-active-view="today"] h4,
body[data-active-view="today"] strong,
body[data-active-view="today"] .task-title {
  color: #4a514d !important;
}

.brand h1,
.nav-list a.active,
.primary-button,
.secondary-button,
.mini-button,
.icon-button {
  color: #4a514d !important;
}

.primary-button {
  background: #3f4642 !important;
  color: #ffffff !important;
}

.page-subtitle,
.section-note,
.metric p,
.task-meta,
.pill,
.empty-state,
.today-focus-hero > p,
.today-card-link,
.today-next-task span {
  color: #7d847f !important;
}

/* v291 responsive comfort: scale Today and the sidebar to the actual window. */
:root,
:root[data-theme="light"],
:root:not([data-theme]),
:root[data-theme="gray"] {
  --ink: #5e6761;
  --muted: #858d87;
}

body,
.main,
.topbar h2,
.section-header h3,
.panel h3,
.metric-heading strong,
.task-title,
.project-card strong,
.routine-panel h3,
.calendar-day strong,
.note-title-input,
.notes-title-input,
.settings-profile-form strong,
.today-focus-hero h3,
.today-habit-summary > strong,
.today-habit-summary b,
.today-queue-card .task-title,
.brand h1,
.nav-list a.active,
body[data-active-view="today"] h1,
body[data-active-view="today"] h2,
body[data-active-view="today"] h3,
body[data-active-view="today"] h4,
body[data-active-view="today"] strong,
body[data-active-view="today"] .task-title {
  color: #5e6761 !important;
}

body[data-active-view="today"] .topbar h2,
body[data-active-view="today"] .today-focus-hero h3 {
  color: #5f6862 !important;
}

.page-subtitle,
.section-note,
.metric p,
.task-meta,
.pill,
.empty-state,
.today-focus-hero > p,
.today-card-link,
.today-next-task span,
.weather-copy,
.brand p,
.nav-list a {
  color: #858d87 !important;
}

.weather-panel {
  overflow: visible !important;
}

.weather {
  grid-template-columns: 44px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
}

.weather-visual {
  width: 44px !important;
  height: 44px !important;
}

.weather-temp {
  color: #5e6761 !important;
  font-size: 24px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.weather-copy {
  margin-top: 4px;
  font-size: 13px !important;
  line-height: 1.3 !important;
  overflow-wrap: normal;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 204px minmax(0, 1fr) !important;
  }

  .sidebar {
    padding: 16px 12px !important;
  }

  .main {
    padding: clamp(24px, 3vw, 38px) !important;
  }

  body[data-active-view="today"] .main {
    max-width: 1180px !important;
  }

  body[data-active-view="today"] .topbar h2 {
    font-size: clamp(28px, 3vw, 40px) !important;
  }

  .today-focus-hero h3 {
    font-size: clamp(34px, 4vw, 54px) !important;
  }
}

@media (max-height: 860px) and (min-width: 1081px) {
  .sidebar {
    gap: 8px !important;
    padding-block: 12px !important;
  }

  .brand {
    padding-bottom: 8px !important;
  }

  .brand-mark {
    width: 38px !important;
    height: 38px !important;
  }

  .brand h1 {
    font-size: 15px !important;
  }

  .brand p {
    font-size: 12px !important;
  }

  .nav-list {
    gap: 2px !important;
  }

  .nav-list a {
    min-height: 30px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
  }

  .weather-panel {
    padding: 10px !important;
  }

  .weather {
    grid-template-columns: 36px minmax(0, 1fr) !important;
  }

  .weather-visual {
    width: 36px !important;
    height: 36px !important;
  }

  .weather-temp {
    font-size: 20px !important;
  }

  .weather-copy {
    font-size: 11px !important;
  }

  body[data-active-view="today"] .main {
    padding-top: 28px !important;
    padding-bottom: 26px !important;
  }

  body[data-active-view="today"] .topbar {
    margin-bottom: 18px !important;
  }

  body[data-active-view="today"] .topbar > div:first-child {
    gap: 4px !important;
  }

  body[data-active-view="today"] .topbar h2 {
    font-size: clamp(28px, 2.7vw, 36px) !important;
  }

  body[data-active-view="today"] .eyebrow {
    font-size: 14px !important;
  }

  body[data-active-view="today"] .today-title-chip {
    margin-top: 6px !important;
    font-size: 15px !important;
  }

  body[data-active-view="today"] .page-subtitle {
    margin-top: 4px !important;
    font-size: 13px !important;
  }

  .today-view {
    gap: 14px !important;
  }

  .today-plan-panel {
    min-height: 220px !important;
    padding: 24px 30px !important;
  }

  .today-kicker {
    font-size: 11px !important;
  }

  .today-focus-hero h3 {
    margin-top: 12px !important;
    font-size: clamp(30px, 3.7vw, 46px) !important;
  }

  .today-focus-rule {
    margin: 16px 0 12px !important;
  }

  .today-focus-hero > p {
    font-size: 14px !important;
  }

  .today-focus-hero .today-next-task {
    margin-top: 14px !important;
  }

  .today-content-grid {
    gap: 14px !important;
  }

  .today-card {
    min-height: 136px !important;
    padding: 18px 22px !important;
  }

  .today-section-heading {
    margin-bottom: 12px !important;
  }

  .today-calendar-card .today-calendar-next {
    gap: 10px !important;
  }

  .today-card-link {
    margin-top: 14px !important;
  }
}

@media (max-height: 720px) and (min-width: 1081px) {
  .weather-panel {
    display: none !important;
  }

  body[data-active-view="today"] .main {
    padding-top: 22px !important;
  }

  .today-plan-panel {
    min-height: 190px !important;
  }

  .today-focus-hero h3 {
    font-size: clamp(28px, 3.2vw, 40px) !important;
  }

  .today-card {
    min-height: 118px !important;
  }
}

/* v292 wide-screen Today: use the monitor width, keep vertical height calm. */
body[data-active-view="today"] .app-shell {
  grid-template-columns: 236px minmax(0, 1fr) !important;
}

body[data-active-view="today"] .sidebar {
  padding: 18px 14px !important;
}

body[data-active-view="today"] .nav-list a {
  min-height: 38px !important;
  padding: 9px 11px !important;
  font-size: 15px !important;
}

body[data-active-view="today"] .main {
  width: 100%;
  max-width: none !important;
  padding: clamp(28px, 3vw, 44px) clamp(34px, 4vw, 72px) 28px !important;
}

body[data-active-view="today"] .topbar {
  margin-bottom: clamp(18px, 2.2vh, 28px) !important;
}

body[data-active-view="today"] .topbar h2 {
  color: #68706a !important;
  font-size: clamp(30px, 2.8vw, 44px) !important;
  font-weight: 600 !important;
}

body[data-active-view="today"] .today-title-chip {
  color: #8f968f !important;
  font-size: clamp(14px, 1.2vw, 17px) !important;
}

body[data-active-view="today"] .eyebrow,
body[data-active-view="today"] .page-subtitle {
  color: #8a918b !important;
}

.today-view {
  width: 100%;
  max-width: none !important;
  gap: clamp(12px, 1.5vh, 18px) !important;
}

.today-plan-panel {
  min-height: 0 !important;
  padding: clamp(22px, 3vh, 34px) clamp(28px, 3.4vw, 48px) !important;
}

.today-focus-hero {
  max-width: min(760px, 52vw);
}

.today-focus-hero h3 {
  max-width: 760px;
  margin-top: 10px !important;
  color: #68706a !important;
  font-size: clamp(28px, 3.2vw, 46px) !important;
  font-weight: 620 !important;
  line-height: 1.08 !important;
}

.today-focus-rule {
  width: 56px !important;
  margin: 16px 0 12px !important;
}

.today-focus-hero > p {
  font-size: clamp(13px, 1vw, 15px) !important;
}

.today-focus-hero .today-next-task {
  margin-top: 12px !important;
}

.today-content-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(12px, 1.2vw, 18px) !important;
}

.today-card {
  min-height: 0 !important;
  padding: clamp(16px, 2vh, 22px) clamp(18px, 1.7vw, 26px) !important;
}

.today-section-heading {
  margin-bottom: 12px !important;
}

.today-habit-summary {
  gap: 16px !important;
  margin-bottom: 12px !important;
}

.today-habit-summary > strong {
  color: #68706a !important;
  font-size: clamp(26px, 2.6vw, 34px) !important;
}

.today-habit-summary p,
.today-habit-summary b {
  color: #68706a !important;
}

.today-calendar-card .today-calendar-next {
  gap: 10px !important;
}

.today-queue-card .task-card {
  padding: 8px 0 12px !important;
}

.today-queue-card .task-title {
  color: #68706a !important;
  font-size: 14px !important;
}

.today-queue-card .pill:nth-child(n + 3) {
  display: none;
}

.today-card-link {
  margin-top: 12px !important;
}

.today-sticky-card .sticky-form input,
.today-sticky-card .sticky-form button {
  min-height: 40px !important;
}

.today-sticky-card .sticky-form button {
  width: 42px !important;
  min-width: 42px !important;
}

.today-ai-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.today-ai-header {
  display: grid;
  gap: 10px;
}

.today-ai-header span {
  color: #8f968f !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-ai-header strong {
  display: block;
  color: #68706a !important;
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 620;
  line-height: 1.15;
}

.today-ai-header p {
  margin: 0;
  color: #8a918b;
  font-size: 13px;
}

.today-ai-panel .planner-form {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

.today-ai-panel textarea {
  min-height: 82px !important;
}

.today-ai-panel .planner-actions {
  display: grid;
  gap: 8px;
}

.today-wrap-card {
  display: none;
}

body[data-active-view="today"] .weather-panel {
  display: block !important;
  padding: 12px !important;
}

body[data-active-view="today"] .weather {
  grid-template-columns: 38px minmax(0, 1fr) !important;
}

body[data-active-view="today"] .weather-visual {
  width: 38px !important;
  height: 38px !important;
}

body[data-active-view="today"] .weather-temp {
  font-size: 22px !important;
}

body[data-active-view="today"] .weather-copy {
  font-size: 12px !important;
}

@media (min-width: 1500px) {
  body[data-active-view="today"] .main {
    padding-inline: clamp(52px, 5vw, 96px) !important;
  }

  .today-focus-hero h3 {
    font-size: clamp(32px, 2.7vw, 48px) !important;
  }
}

@media (max-width: 1220px) {
  .today-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .today-ai-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 820px) and (min-width: 1081px) {
  body[data-active-view="today"] .main {
    padding-top: 20px !important;
    padding-bottom: 18px !important;
  }

  body[data-active-view="today"] .topbar {
    margin-bottom: 12px !important;
  }

  body[data-active-view="today"] .topbar h2 {
    font-size: clamp(28px, 2.5vw, 38px) !important;
  }

  .today-plan-panel {
    padding-block: 18px !important;
  }

  .today-focus-hero h3 {
    font-size: clamp(26px, 2.8vw, 38px) !important;
  }

  .today-card {
    padding-block: 14px !important;
  }

  .today-ai-panel textarea {
    min-height: 64px !important;
  }
}

/* v293: keep sidebar/nav dimensions identical across every tab. */
.app-shell,
body[data-active-view="today"] .app-shell {
  grid-template-columns: 236px minmax(0, 1fr) !important;
}

.sidebar,
body[data-active-view="today"] .sidebar {
  padding: 18px 14px !important;
}

.nav-list {
  gap: 4px !important;
}

.nav-list a,
.nav-list a.active,
body[data-active-view="today"] .nav-list a,
body[data-active-view="today"] .nav-list a.active {
  min-height: 38px !important;
  padding: 9px 11px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

.nav-list a.active,
body[data-active-view="today"] .nav-list a.active {
  border-color: #e7e7e4 !important;
}

@media (max-width: 1080px) {
  .app-shell,
  body[data-active-view="today"] .app-shell {
    grid-template-columns: 1fr !important;
  }
}

@media (max-height: 860px) and (min-width: 1081px) {
  .nav-list a,
  .nav-list a.active,
  body[data-active-view="today"] .nav-list a,
  body[data-active-view="today"] .nav-list a.active {
    min-height: 36px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
  }
}

/* v294: roomier persistent nav and readable weather card. */
.app-shell,
body[data-active-view="today"] .app-shell {
  grid-template-columns: 252px minmax(0, 1fr) !important;
}

.sidebar,
body[data-active-view="today"] .sidebar {
  padding: 20px 16px !important;
}

.nav-list {
  gap: 6px !important;
}

.nav-list a,
.nav-list a.active,
body[data-active-view="today"] .nav-list a,
body[data-active-view="today"] .nav-list a.active {
  min-height: 44px !important;
  padding: 11px 14px !important;
  font-size: 16px !important;
  font-weight: 650 !important;
}

.weather-panel,
body[data-active-view="today"] .weather-panel {
  display: block !important;
  padding: 14px !important;
  overflow: visible !important;
}

.weather,
body[data-active-view="today"] .weather {
  grid-template-columns: 56px minmax(0, 1fr) !important;
  gap: 12px !important;
}

.weather-visual,
body[data-active-view="today"] .weather-visual {
  width: 54px !important;
  height: 54px !important;
}

.weather-temp,
body[data-active-view="today"] .weather-temp {
  font-size: 30px !important;
  font-weight: 650 !important;
}

.weather-copy,
body[data-active-view="today"] .weather-copy {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

@media (max-width: 1080px) {
  .app-shell,
  body[data-active-view="today"] .app-shell {
    grid-template-columns: 1fr !important;
  }
}

@media (max-height: 860px) and (min-width: 1081px) {
  .sidebar,
  body[data-active-view="today"] .sidebar {
    padding-block: 14px !important;
  }

  .nav-list a,
  .nav-list a.active,
  body[data-active-view="today"] .nav-list a,
  body[data-active-view="today"] .nav-list a.active {
    min-height: 40px !important;
    padding: 9px 12px !important;
    font-size: 15px !important;
  }

  .weather-panel,
  body[data-active-view="today"] .weather-panel {
    padding: 12px !important;
  }

  .weather,
  body[data-active-view="today"] .weather {
    grid-template-columns: 48px minmax(0, 1fr) !important;
  }

  .weather-visual,
  body[data-active-view="today"] .weather-visual {
    width: 46px !important;
    height: 46px !important;
  }

  .weather-temp,
  body[data-active-view="today"] .weather-temp {
    font-size: 26px !important;
  }

  .weather-copy,
  body[data-active-view="today"] .weather-copy {
    font-size: 13px !important;
  }
}

/* v295: let every tab use wide browser space, not just Today. */
.main,
body[data-active-view="today"] .main {
  width: 100%;
  max-width: none !important;
  padding-inline: clamp(34px, 4vw, 76px) !important;
}

.view,
.view.is-active,
.panel,
.split-grid,
.routine-grid,
.planner-page-grid,
.project-list,
.idea-list,
.grocery-list,
.staples-list,
.calendar-grid,
.agenda-list,
.chat-layout,
.notes-app,
.settings-grid,
.history-layout,
.history-list,
.cloud-summary-grid,
.settings-status-grid,
.sharing-area-grid,
.sharing-project-list {
  max-width: none !important;
}

.view.is-active {
  width: 100%;
}

.split-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 0.75fr) !important;
}

.planner-page-grid {
  grid-template-columns: minmax(720px, 2fr) minmax(360px, 0.78fr) !important;
}

.routine-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
}

.chat-layout {
  grid-template-columns: minmax(260px, 0.26fr) minmax(680px, 1fr) !important;
}

.notes-app {
  grid-template-columns: minmax(280px, 0.28fr) minmax(680px, 1fr) !important;
}

.calendar-day {
  min-height: clamp(96px, 8vw, 148px);
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr));
  align-items: start;
}

.settings-grid > .panel:first-child,
.settings-grid > .panel:nth-child(3),
.settings-grid > .panel:nth-child(4),
.settings-grid > .panel:nth-child(7),
.settings-grid > .panel:nth-child(8) {
  grid-column: 1 / -1;
}

@media (min-width: 1600px) {
  .main,
  body[data-active-view="today"] .main {
    padding-inline: clamp(64px, 5vw, 108px) !important;
  }

  .split-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.7fr) !important;
  }

  .planner-page-grid {
    grid-template-columns: minmax(900px, 2.25fr) minmax(380px, 0.72fr) !important;
  }
}

@media (max-width: 1180px) {
  .split-grid,
  .planner-page-grid,
  .chat-layout,
  .notes-app,
  .settings-grid,
  .history-layout {
    grid-template-columns: 1fr !important;
  }

  .settings-grid > .panel {
    grid-column: auto;
  }
}

/* v296: working theme modes plus Sunny's project/task palettes. */
:root[data-theme="light"],
:root:not([data-theme]) {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f7f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f8f8f6;
  --control: #ffffff;
  --control-strong: #ffffff;
  --ink: #5e6761;
  --muted: #858d87;
  --line: #e9ece8;
  --hairline: rgba(21, 25, 23, 0.1);
  --sidebar-bg: #f6f6f4;
  --active-nav: #ffffff;
  --mix-surface: #ffffff;
}

:root[data-theme="gray"] {
  color-scheme: light;
  --bg: #d8dbd7;
  --panel: #eef0ec;
  --panel-soft: #dfe3de;
  --surface: #f2f3ef;
  --surface-strong: #f7f8f5;
  --surface-soft: #e6e9e4;
  --control: #f7f8f5;
  --control-strong: #ffffff;
  --ink: #58625b;
  --muted: #737d76;
  --line: #c8d0c8;
  --hairline: rgba(72, 80, 74, 0.18);
  --sidebar-bg: #cfd4ce;
  --active-nav: #edf0eb;
  --mix-surface: #eef0ec;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121715;
  --panel: #1d2420;
  --panel-soft: #242d28;
  --surface: #1a211e;
  --surface-strong: #232b26;
  --surface-soft: #202924;
  --control: #171d1a;
  --control-strong: #232b26;
  --ink: #e7ece6;
  --muted: #a5afa8;
  --line: #334139;
  --hairline: rgba(244, 246, 241, 0.11);
  --sidebar-bg: #111613;
  --active-nav: #202924;
  --mix-surface: #1d2420;
}

:root[data-theme="color"] {
  color-scheme: light;
  --bg: #fbf4e6;
  --panel: #fffdf7;
  --panel-soft: #f4ead7;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --surface-soft: #f8f0e2;
  --control: #fffaf1;
  --control-strong: #ffffff;
  --ink: #615b50;
  --muted: #81786a;
  --line: #e6dac8;
  --hairline: rgba(148, 119, 79, 0.18);
  --sidebar-bg: #f4ead7;
  --active-nav: #fffdf7;
  --mix-surface: #fffdf7;
}

:root[data-theme="custom"] {
  color-scheme: light;
  --line: color-mix(in srgb, var(--ink) 18%, transparent);
  --hairline: color-mix(in srgb, var(--ink) 12%, transparent);
  --active-nav: color-mix(in srgb, var(--bg) 70%, white);
  --mix-surface: #ffffff;
}

body,
body[data-active-view="today"] {
  background: var(--bg) !important;
  color: var(--ink) !important;
}

.sidebar,
body[data-active-view="today"] .sidebar {
  background: var(--sidebar-bg) !important;
  border-right-color: var(--line) !important;
}

.panel,
.side-panel,
.metric,
.routine-panel,
.assistant-strip,
.task-dialog form,
.auth-card,
.onboarding-card,
.today-plan-panel,
.today-card,
.today-ai-panel,
.settings-profile-form label,
.settings-status-card,
.cloud-dashboard-card,
.cloud-dashboard-status,
.sharing-area-card,
.sharing-connection-card,
.sharing-member-card,
.wrap-card,
.wrap-stats div,
.wrap-goals > div,
.idea-card,
.grocery-row,
.agenda-row,
.calendar-day,
.history-day,
.attachment-item,
.phone-url-row,
.phone-step-list div,
.copy-box,
.nudge-item,
.theme-choice-card,
.onboarding-palette-card {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

.column,
.notes-sidebar {
  background: var(--surface-soft) !important;
  border-color: var(--line) !important;
}

input,
select,
textarea,
.planner-quick-add input,
.planner-quick-add select,
.schedule-range-controls select,
.sticky-form input,
.planner-form textarea,
.project-form input,
.grocery-form input,
.calendar-form input,
.calendar-form select {
  background: var(--control) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

.secondary-button,
.icon-button,
.mini-button,
.pill,
.drag-chip,
.shared-badge {
  background: var(--control-strong) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

.primary-button,
.segmented-control button.active,
.planner-view-toggle .mini-button.active {
  background: var(--ink) !important;
  color: var(--bg) !important;
}

:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .segmented-control button.active,
:root[data-theme="dark"] .planner-view-toggle .mini-button.active {
  background: #f4f6f1 !important;
  color: #121715 !important;
}

.nav-list a,
body[data-active-view="today"] .nav-list a {
  color: var(--muted) !important;
}

.nav-list a.active,
body[data-active-view="today"] .nav-list a.active {
  background: var(--active-nav) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

.topbar h2,
body[data-active-view="today"] .topbar h2,
.section-header h3,
.panel h3,
.today-focus-hero h3,
.today-plan-title,
.project-card strong,
.task-title,
.routine-panel h3,
.calendar-day strong,
.note-title-input,
.notes-title-input {
  color: var(--ink) !important;
}

.page-subtitle,
body[data-active-view="today"] .page-subtitle,
.section-note,
.project-card > p,
.project-card span,
.task-card p,
.today-focus-hero p,
.today-card-link {
  color: var(--muted) !important;
}

.task-card,
.project-card .task-card,
.project-ticket-list .task-card,
.task-week-item,
.week-schedule-entry,
.day-plan-entry,
.unscheduled-item {
  background: color-mix(in srgb, var(--project-color, var(--gold)) 13%, var(--surface-strong)) !important;
  border-color: color-mix(in srgb, var(--project-color, var(--gold)) 32%, var(--line)) !important;
  color: var(--ink) !important;
}

.project-card {
  background: color-mix(in srgb, var(--project-color, var(--gold)) 8%, var(--surface)) !important;
  border-color: color-mix(in srgb, var(--project-color, var(--gold)) 26%, var(--line)) !important;
  border-left-color: color-mix(in srgb, var(--project-color, var(--gold)) 76%, var(--line)) !important;
}

:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .project-card .task-card,
:root[data-theme="dark"] .project-ticket-list .task-card,
:root[data-theme="dark"] .task-week-item,
:root[data-theme="dark"] .week-schedule-entry,
:root[data-theme="dark"] .day-plan-entry,
:root[data-theme="dark"] .unscheduled-item {
  background: color-mix(in srgb, var(--project-color, var(--gold)) 22%, var(--surface)) !important;
}

.theme-choice-card.theme-color .theme-preview {
  background: #f4ead7;
}

.theme-choice-card.theme-color .theme-preview span:first-child {
  background: #fffdf7;
}

.theme-choice-card.theme-color .theme-preview span:nth-child(2) {
  background: #e6dac8;
}

.theme-choice-card.theme-color .theme-preview span:nth-child(3) {
  background: #c6a46c;
}

.theme-choice-card.theme-custom .theme-preview {
  background: linear-gradient(135deg, #ffffff, #f2f2f2);
}

.theme-choice-card.theme-custom .theme-preview span:first-child {
  background: #ffffff;
}

.theme-choice-card.theme-custom .theme-preview span:nth-child(2) {
  background: #b8c7a6;
}

.theme-choice-card.theme-custom .theme-preview span:nth-child(3) {
  background: #5e6761;
}

.custom-theme-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.custom-theme-section input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.settings-palette-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.onboarding-palette-grid,
.settings-palette-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
}

.onboarding-color-preview span {
  border-color: color-mix(in srgb, var(--ink) 12%, transparent) !important;
}

body {
  font-size: var(--app-font-size, 16px);
}
/* Sunny command mode */
.sunny-command-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

.sunny-command-dialog::backdrop {
  background: rgba(28, 32, 30, 0.24);
  backdrop-filter: blur(10px);
}

.sunny-command-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(36, 40, 38, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 80px rgba(32, 35, 34, 0.18);
}

.sunny-command-dialog h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.45rem;
  letter-spacing: 0;
}

.sunny-command-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sunny-command-dialog textarea {
  width: 100%;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.sunny-command-dialog textarea:focus {
  outline: 2px solid rgba(255, 190, 57, 0.32);
  border-color: rgba(255, 190, 57, 0.68);
}

.sunny-command-dialog .status-line {
  margin: 0;
}

.sunny-command-toast {
  position: fixed;
  z-index: 90;
  max-width: min(360px, calc(100vw - 40px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.in-app-alert-toast {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 95;
  display: grid;
  gap: 4px;
  width: min(360px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid rgba(230, 174, 54, 0.32);
  border-radius: 20px;
  background: rgba(255, 252, 242, 0.96);
  color: var(--ink-soft);
  box-shadow: 0 22px 70px rgba(28, 32, 30, 0.16);
  backdrop-filter: blur(18px);
  transform: translateY(12px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.in-app-alert-toast.is-showing {
  transform: translateY(0);
  opacity: 1;
}

.in-app-alert-toast span {
  color: #b88618;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.in-app-alert-toast strong {
  color: var(--ink-soft);
  font-size: 1rem;
}

.in-app-alert-toast small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.sunny-confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

.sunny-confirm-dialog::backdrop {
  background: rgba(28, 32, 30, 0.22);
  backdrop-filter: blur(10px);
}

.sunny-confirm-dialog form {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(210, 89, 68, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(32, 35, 34, 0.18);
}

.sunny-confirm-dialog h3 {
  margin: 8px 0;
  color: var(--text);
}

.sunny-confirm-dialog p {
  margin: 0;
  color: var(--muted);
}

.danger-button {
  border: 1px solid rgba(210, 89, 68, 0.24);
  background: #d95a49;
  color: #fff;
  box-shadow: 0 14px 34px rgba(210, 89, 68, 0.18);
}

@media (max-width: 760px) {
  .task-dialog {
    width: min(100vw - 20px, 520px);
    max-width: calc(100vw - 20px);
  }

  .task-dialog form {
    width: 100%;
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
    box-sizing: border-box;
    padding: 16px !important;
  }

  .task-dialog .form-grid {
    grid-template-columns: 1fr !important;
  }

  .task-dialog .dialog-header,
  .task-dialog .dialog-actions {
    gap: 8px;
    align-items: flex-start;
  }

  .task-dialog .dialog-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .task-card {
    min-width: 0;
  }

  .task-title {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px !important;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .task-card .pill,
  .task-dialog .pill {
    max-width: 100%;
    min-height: 22px;
    padding: 2px 7px !important;
    font-size: 10px !important;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* v351: phone calendar stays a real month grid, and weather only appears on Today. */
@media (max-width: 760px) {
  body:not([data-active-view="today"]) .weather-panel {
    display: none !important;
  }

  body[data-active-view="calendar"] .calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  body[data-active-view="calendar"] .calendar-weekday {
    display: block !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    color: var(--muted) !important;
    text-align: center;
  }

  body[data-active-view="calendar"] .calendar-day,
  body[data-active-view="calendar"] .calendar-day.is-empty {
    display: grid !important;
  }

  body[data-active-view="calendar"] .calendar-day {
    min-height: clamp(46px, 12vw, 68px) !important;
    aspect-ratio: 1 / 1;
    padding: 5px !important;
    border-radius: 10px !important;
    gap: 3px !important;
    align-content: start;
    overflow: hidden;
  }

  body[data-active-view="calendar"] .calendar-day strong {
    font-size: 11px !important;
    line-height: 1;
  }

  body[data-active-view="calendar"] .calendar-day span,
  body[data-active-view="calendar"] .calendar-day small {
    max-width: 100%;
    padding: 2px 3px !important;
    font-size: 8px !important;
    line-height: 1.1;
    border-radius: 5px !important;
  }
}

/* v352: calmer phone layout for the Tasks planner with tap-to-place support. */
.drag-label-mobile,
.planner-tap-hint {
  display: none;
}

@media (max-width: 760px) {
  body[data-active-view="board"] .main {
    padding-inline: 14px !important;
  }

  body[data-active-view="board"] .topbar {
    margin-bottom: 12px;
  }

  body[data-active-view="board"] .topbar h2 {
    font-size: clamp(34px, 11vw, 48px) !important;
  }

  body[data-active-view="board"] .section-header {
    margin-bottom: 10px;
  }

  body[data-active-view="board"] .section-header > div > h3 {
    font-size: 18px !important;
  }

  body[data-active-view="board"] .planner-page-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px !important;
  }

  body[data-active-view="board"] .day-schedule-panel,
  body[data-active-view="board"] .planner-side-stack > .panel {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  body[data-active-view="board"] .day-schedule-panel {
    min-height: 0 !important;
  }

  body[data-active-view="board"] .planner-header-row {
    display: grid !important;
    gap: 12px !important;
  }

  body[data-active-view="board"] .planner-date-controls {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px !important;
  }

  body[data-active-view="board"] #plannerTodayButton {
    grid-column: 1 / -1;
  }

  body[data-active-view="board"] .schedule-range-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  body[data-active-view="board"] .planner-view-toggle {
    display: grid !important;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  body[data-active-view="board"] .planner-view-toggle .mini-button,
  body[data-active-view="board"] .schedule-range-controls select,
  body[data-active-view="board"] .planner-date-controls input,
  body[data-active-view="board"] .planner-date-controls .mini-button {
    min-height: 42px !important;
    border-radius: 12px !important;
  }

  body[data-active-view="board"] .planner-side-stack {
    display: flex !important;
    flex-direction: column;
    gap: 12px !important;
  }

  body[data-active-view="board"] .planner-drag-panel {
    order: -1;
  }

  body[data-active-view="board"] .planner-quick-add {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-bottom: 0 !important;
  }

  body[data-active-view="board"] .planner-quick-add input,
  body[data-active-view="board"] .planner-quick-add select,
  body[data-active-view="board"] .planner-quick-add button {
    min-height: 44px !important;
    border-radius: 12px !important;
  }

  body[data-active-view="board"] .planner-tap-hint {
    display: block;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 14px;
    background: color-mix(in srgb, var(--gold) 13%, var(--surface));
    color: var(--ink);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.35;
  }

  body[data-active-view="board"] .planner-drag-tray {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  body[data-active-view="board"] .planner-drag-group-title {
    color: var(--muted) !important;
    font-size: 11px !important;
    letter-spacing: 0 !important;
  }

  body[data-active-view="board"] .planner-drag-group-items {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto;
    padding: 1px 1px 8px;
    scroll-snap-type: x proximity;
  }

  body[data-active-view="board"] .unscheduled-item {
    min-width: min(78vw, 260px);
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 10px 11px !important;
    border-radius: 14px !important;
    scroll-snap-align: start;
    cursor: pointer;
  }

  body[data-active-view="board"] .unscheduled-item.is-selected-for-plan {
    border-color: color-mix(in srgb, var(--gold) 74%, var(--line)) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 28%, transparent);
  }

  body[data-active-view="board"] .drag-label-desktop {
    display: none;
  }

  body[data-active-view="board"] .drag-label-mobile {
    display: inline;
  }

  body[data-active-view="board"] .drag-chip {
    padding: 5px 9px !important;
    font-size: 11px !important;
  }

  body[data-active-view="board"] .day-plan-timeline {
    gap: 6px !important;
  }

  body[data-active-view="board"] .day-plan-hour {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body[data-active-view="board"] .day-plan-hour > time {
    font-size: 11px !important;
  }

  body[data-active-view="board"] .day-plan-items {
    min-height: 42px !important;
    padding-left: 9px !important;
  }

  body[data-active-view="board"] .day-plan-entry {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    padding: 9px 10px !important;
    border-radius: 14px !important;
  }

  body[data-active-view="board"] .day-plan-entry-time {
    font-size: 11px !important;
  }

  body[data-active-view="board"] .day-plan-entry-actions {
    justify-content: flex-start !important;
  }

  body[data-active-view="board"] .week-timeline-grid {
    grid-template-columns: 42px repeat(7, minmax(42px, 1fr)) !important;
    width: 100%;
    overflow-x: hidden !important;
    border-radius: 16px !important;
  }

  body[data-active-view="board"] .week-time-rail {
    min-height: 70px !important;
    padding: 6px 4px !important;
  }

  body[data-active-view="board"] .week-time-rail.is-header {
    min-height: 44px !important;
    font-size: 9px !important;
  }

  body[data-active-view="board"] .week-time-rail strong {
    font-size: 10px !important;
  }

  body[data-active-view="board"] .week-time-rail span {
    display: none;
  }

  body[data-active-view="board"] .week-day-header {
    display: grid !important;
    min-width: 0;
    padding: 6px 3px !important;
    text-align: center;
  }

  body[data-active-view="board"] .week-day-header .mini-button {
    display: none !important;
  }

  body[data-active-view="board"] .week-day-header span {
    font-size: 9px !important;
  }

  body[data-active-view="board"] .week-day-header strong {
    font-size: 9px !important;
    line-height: 1.1 !important;
  }

  body[data-active-view="board"] .week-schedule-cell {
    min-height: 70px !important;
    padding: 4px 3px !important;
    gap: 4px !important;
  }

  body[data-active-view="board"] .week-cell-empty {
    min-height: 40px;
    font-size: 0 !important;
  }

  body[data-active-view="board"] .week-cell-empty::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 40px;
    border: 1px dashed color-mix(in srgb, var(--muted) 28%, transparent);
    border-radius: 10px;
    color: color-mix(in srgb, var(--muted) 70%, transparent);
    font-size: 16px;
    font-weight: 600;
  }

  body[data-active-view="board"] .week-schedule-entry {
    padding: 5px 4px !important;
    border-radius: 10px !important;
    gap: 2px !important;
  }

  body[data-active-view="board"] .week-schedule-entry span {
    font-size: 8px !important;
  }

  body[data-active-view="board"] .week-schedule-entry strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px !important;
    line-height: 1.15 !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* v355: Settings reads as calm full-width rows, with cloud sync hidden from normal users. */
body[data-active-view="settings"] .settings-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px !important;
}

body[data-active-view="settings"] .settings-grid > .panel {
  grid-column: 1 / -1 !important;
  width: 100%;
}

body[data-active-view="settings"] .sunny-voice-grid,
body[data-active-view="settings"] .settings-status-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

body[data-active-view="settings"] .theme-choice-grid,
body[data-active-view="settings"] .settings-palette-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)) !important;
}

/* v362: History becomes a dismissible wrap banner plus an inline calendar journal. */
body[data-active-view="history"] .history-page-grid:has(.history-wrap-card[hidden]) {
  grid-template-columns: 1fr !important;
}

body[data-active-view="history"] .history-page-grid {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

body[data-active-view="history"] .history-wrap-card {
  order: -1;
  min-height: 0;
  padding: 12px 16px !important;
  background:
    linear-gradient(135deg, rgba(255, 246, 219, 0.96), rgba(255, 255, 255, 0.96)),
    #ffffff !important;
  border-color: rgba(255, 195, 70, 0.42) !important;
}

body[data-active-view="history"] .history-wrap-card .wrap-hero {
  align-items: center;
  gap: 12px;
}

body[data-active-view="history"] .history-wrap-card .section-label {
  display: none;
}

body[data-active-view="history"] .history-wrap-card h3 {
  font-size: 0.95rem !important;
  line-height: 1.15;
}

body[data-active-view="history"] .history-wrap-card #historyWrapBody p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 640;
}

body[data-active-view="history"] .history-wrap-card #historyWrapBody strong {
  color: var(--ink-soft);
}

body[data-active-view="history"] .history-range-panel {
  padding: clamp(16px, 2vw, 22px) !important;
}

body[data-active-view="history"] .history-layout {
  display: block !important;
}

body[data-active-view="history"] .history-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(104px, 1fr)) !important;
  gap: 10px !important;
}

body[data-active-view="history"] .history-calendar-grid.is-day {
  grid-template-columns: minmax(280px, 1fr) !important;
}

body[data-active-view="history"] .history-calendar-grid.is-year {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

body[data-active-view="history"] .history-calendar-day {
  min-height: 112px !important;
  cursor: pointer;
  overflow: hidden;
}

body[data-active-view="history"] .history-calendar-day.is-selected {
  grid-column: span 2;
  min-height: 260px !important;
  background: rgba(255, 253, 246, 0.96) !important;
  border-color: rgba(255, 195, 70, 0.55) !important;
}

body[data-active-view="history"] .history-calendar-grid.is-day .history-calendar-day.is-selected {
  grid-column: 1 / -1;
}

body[data-active-view="history"] .history-day-color {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(247, 248, 245, 0.84);
  pointer-events: none;
}

body[data-active-view="history"] .history-calendar-day.mood-good .history-day-color {
  background: rgba(205, 235, 216, 0.9);
}

body[data-active-view="history"] .history-calendar-day.mood-neutral .history-day-color {
  background: rgba(255, 239, 189, 0.82);
}

body[data-active-view="history"] .history-calendar-day.mood-bad .history-day-color {
  background: rgba(255, 216, 207, 0.86);
}

body[data-active-view="history"] .history-calendar-day.has-activity:not(.mood-good):not(.mood-neutral):not(.mood-bad) .history-day-color {
  background: rgba(255, 248, 224, 0.86);
}

body[data-active-view="history"] .history-calendar-day > :not(.history-day-color) {
  position: relative;
  z-index: 1;
}

body[data-active-view="history"] .history-inline-slot .history-editor {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 980px) {
  body[data-active-view="history"] .history-wrap-card .wrap-hero {
    align-items: center !important;
    flex-direction: row !important;
    justify-content: space-between !important;
  }

  body[data-active-view="history"] .history-wrap-card .icon-button {
    flex: 0 0 auto;
    margin-left: auto;
  }

  body[data-active-view="history"] .history-calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  body[data-active-view="history"] .history-calendar-grid.is-day,
  body[data-active-view="history"] .history-calendar-grid.is-year {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }

  body[data-active-view="history"] .history-calendar-weekday {
    display: block !important;
    font-size: 0.62rem;
  }

  body[data-active-view="history"] .history-calendar-blank {
    display: block !important;
    min-height: 42px;
    border-radius: 12px;
  }

  body[data-active-view="history"] .history-calendar-day {
    min-height: 48px !important;
    border-radius: 12px !important;
    padding: 7px 5px !important;
  }

  body[data-active-view="history"] .history-calendar-day header {
    gap: 4px;
  }

  body[data-active-view="history"] .history-calendar-day header strong {
    font-size: 0.88rem !important;
  }

  body[data-active-view="history"] .history-calendar-day header small,
  body[data-active-view="history"] .history-calendar-day .mood-pill,
  body[data-active-view="history"] .history-day-mini {
    display: none !important;
  }

  body[data-active-view="history"] .history-calendar-day.is-selected {
    grid-column: 1 / -1;
    min-height: 250px !important;
    padding: 12px !important;
  }

  body[data-active-view="history"] .history-calendar-day.is-selected header small,
  body[data-active-view="history"] .history-calendar-day.is-selected .mood-pill,
  body[data-active-view="history"] .history-calendar-day.is-selected .history-day-mini {
    display: flex !important;
  }
}

/* v366: phone Today layout stacks sections and gives the brain dump room. */
@media (max-width: 760px) {
  body[data-active-view="today"] .main {
    padding: 18px 14px 24px !important;
  }

  body[data-active-view="today"] .topbar {
    margin-bottom: 14px !important;
  }

  body[data-active-view="today"] .topbar h2 {
    font-size: clamp(25px, 8vw, 34px) !important;
  }

  .today-view {
    gap: 12px !important;
  }

  .today-plan-panel {
    padding: 18px !important;
  }

  .today-focus-hero {
    max-width: none !important;
  }

  .today-focus-hero h3 {
    font-size: clamp(28px, 10vw, 40px) !important;
  }

  .today-content-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .today-card {
    min-height: 0 !important;
    padding: 16px !important;
  }

  .today-habit-summary {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .today-sticky-card .sticky-form {
    grid-template-columns: 1fr auto !important;
  }

  .today-ai-panel {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .today-ai-panel .planner-form {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .today-ai-panel textarea {
    width: 100% !important;
    min-height: 132px !important;
    font-size: 16px !important;
  }

  .today-ai-panel .planner-actions {
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  .today-ai-panel .planner-actions button {
    width: 100%;
    min-height: 44px;
  }
}

/* v373: floating Sunny uses the same simple voice-orb style as onboarding. */
.screen-buddy {
  filter: none !important;
}

.screen-buddy:hover {
  filter: none !important;
}

.screen-buddy .buddy-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px !important;
  clip-path: none !important;
  background: #ffc83d !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow:
    0 0 0 4px rgba(255, 178, 24, 0.48),
    0 0 0 14px rgba(255, 200, 61, 0.12),
    0 24px 52px rgba(255, 194, 14, 0.26) !important;
  transform-origin: 50% 50% !important;
  animation: voice-orb-idle 2.8s ease-in-out infinite !important;
}

.screen-buddy .buddy-avatar::before,
.screen-buddy .buddy-avatar::after,
.screen-buddy .buddy-face,
.screen-buddy::before,
.screen-buddy.is-idle-sleep::after {
  display: none !important;
  content: none !important;
}

.screen-buddy:hover .buddy-avatar,
.screen-buddy.is-nudging:not(.is-celebrating) .buddy-avatar {
  animation: voice-orb-idle 2.8s ease-in-out infinite !important;
}

.screen-buddy.is-thinking .buddy-avatar {
  animation: voice-orb-think 1.4s ease-in-out infinite !important;
}

.screen-buddy.is-celebrating .buddy-avatar,
.screen-buddy.celebrate-hop .buddy-avatar,
.screen-buddy.celebrate-spin .buddy-avatar,
.screen-buddy.celebrate-wiggle .buddy-avatar {
  animation: voice-orb-speak 0.62s ease-in-out infinite !important;
}

.screen-buddy.is-dragging .buddy-avatar {
  animation: none !important;
  transform: scale(0.98) !important;
}

@media (max-width: 760px) {
  .screen-buddy .buddy-avatar {
    width: 100%;
    height: 100%;
  }
}
