:root {
  --bg: #062c29;
  --bg-deep: #031c1a;
  --panel: #f4efe5;
  --panel-soft: #fffaf0;
  --ink: #102320;
  --muted: #64716d;
  --line: rgba(16, 35, 32, 0.12);
  --teal: #32d4c6;
  --teal-dark: #0a5d55;
  --green: #0f3a35;
  --amber: #f6b84b;
  --danger: #b95645;
  --success: #0a8f72;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(50, 212, 198, 0.26), transparent 34rem),
    radial-gradient(circle at 82% 20%, rgba(246, 184, 75, 0.16), transparent 26rem),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: ui-sans-serif, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #f9fff9;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: #145047;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(50, 212, 198, 0.45);
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  padding: 13px 14px;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--teal-dark) 50%),
    linear-gradient(135deg, var(--teal-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 120px;
}

.app-shell[hidden],
.login-screen[hidden],
.mobile-dock[hidden] {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 34px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: var(--shadow);
  padding: clamp(24px, 6vw, 38px);
}

.login-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 12vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.login-copy {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.login-card button {
  width: 100%;
  margin-top: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 18px;
}

.app-header h1,
.section-heading h2,
.modal-card h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.app-header h1 {
  color: #f7fff7;
  font-size: clamp(24px, 4.4vw, 38px);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

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

.ghost-button {
  background: rgba(244, 239, 229, 0.08);
  border: 1px solid rgba(244, 239, 229, 0.2);
  color: #f7fff7;
}

.primary-lite-button {
  background: var(--teal);
  color: #032320;
  font-weight: 800;
}

.today-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 4px 0 18px;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 229, 0.18);
  border-radius: var(--radius-md);
  background: rgba(244, 239, 229, 0.1);
}

.today-strip div {
  padding: 13px 16px;
  background: rgba(3, 28, 26, 0.22);
}

.today-strip span,
.today-strip small {
  display: block;
}

.today-strip span {
  color: #f7fff7;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.today-strip small {
  margin-top: 2px;
  color: rgba(247, 255, 247, 0.62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 229, 0.16);
  border-radius: 999px;
  background: rgba(244, 239, 229, 0.12);
  color: rgba(247, 255, 247, 0.8);
  font-size: 13px;
}

.prompt-strip span {
  padding: 12px 14px;
  text-align: center;
  background: rgba(3, 28, 26, 0.22);
}

.belt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.focus-card,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.focus-card {
  min-height: 300px;
  padding: clamp(20px, 3vw, 28px);
}

.panel {
  padding: 18px;
}

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

.queue-panel,
.blocked-panel,
.parked-panel {
  grid-column: 1 / -1;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 20px;
}

.status-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  min-width: 42px;
  min-height: 32px;
  padding: 0 12px;
  background: transparent;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.count-pill.amber {
  background: transparent;
  color: #835412;
}

.current-task {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: center;
}

.current-task h3 {
  max-width: 840px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4.5vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.current-task p {
  max-width: 540px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.big-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.big-actions button,
.modal-actions button,
.capture-form button,
.inline-add button,
#confirmWinddown,
#confirmAddTask,
#saveSettings,
#enableNotifications,
#showInstallHelp,
#nativeInstallButton {
  min-height: 48px;
}

.success-button {
  background: var(--success);
}

.success-button:hover {
  background: #087b62;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #994636;
}

.text-button {
  width: fit-content;
  min-height: auto;
  margin-top: 18px;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
}

.text-button:hover {
  background: transparent;
  text-decoration: underline;
}

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

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.38);
  padding: 14px;
}

.task-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

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

.task-actions button {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid rgba(15, 58, 53, 0.14);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.task-actions button:hover {
  background: rgba(15, 58, 53, 0.16);
}

.next-card {
  background: rgba(50, 212, 198, 0.12);
}

.blocked-card {
  background: rgba(246, 184, 75, 0.14);
}

.parked-card {
  background: rgba(15, 58, 53, 0.05);
}

.waiting-label {
  margin: 7px 0 0;
  color: #835412;
  font-size: 13px;
  font-weight: 800;
}

.empty-panel {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: rgba(255, 255, 255, 0.34);
}

.empty-panel.small {
  padding: 18px;
}

.empty-panel h3,
.empty-panel p {
  margin: 0;
}

.empty-panel p {
  color: var(--muted);
}

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

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

.rhythm-list span {
  border-left: 3px solid rgba(50, 212, 198, 0.7);
  color: var(--muted);
  padding: 4px 0 4px 10px;
  font-size: 14px;
}

.secondary-button {
  background: rgba(15, 58, 53, 0.08);
  color: var(--green);
  border: 1px solid rgba(15, 58, 53, 0.14);
}

.full-width {
  width: 100%;
}

.mobile-dock {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 20;
  display: none;
  grid-template-columns: 1fr 0.8fr 1fr;
  gap: 8px;
  border: 1px solid rgba(244, 239, 229, 0.16);
  border-radius: 999px;
  background: rgba(3, 28, 26, 0.84);
  padding: 8px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.mobile-dock button {
  min-height: 48px;
  background: rgba(244, 239, 229, 0.12);
  color: #f7fff7;
  font-size: 13px;
  font-weight: 800;
}

.mobile-dock button:nth-child(2) {
  background: var(--teal);
  color: #032320;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 28, 26, 0.68);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  padding: 26px;
  box-shadow: var(--shadow);
}

.modal-card > * + * {
  margin-top: 12px;
}

.modal-card > .eyebrow + h2,
.modal-card > h2 + .modal-copy {
  margin-top: 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: rgba(15, 58, 53, 0.08);
  color: var(--green);
  text-transform: uppercase;
}

.modal-copy {
  margin: 8px 0 18px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions.stacked {
  display: grid;
}

.snooze-row {
  display: grid;
  grid-template-columns: 1fr 0.65fr 0.55fr;
  gap: 8px;
}

.snooze-row button {
  min-height: 40px;
  border: 1px solid rgba(15, 58, 53, 0.14);
  background: rgba(15, 58, 53, 0.06);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

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

.choice-card {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 76px;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
}

.choice-card span {
  font-weight: 800;
}

.choice-card small {
  color: var(--muted);
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 16px;
}

.summary-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.summary-box div {
  border-radius: var(--radius-sm);
  background: rgba(15, 58, 53, 0.08);
  padding: 14px;
}

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

.summary-box strong {
  font-size: 26px;
}

.summary-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stepper-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.stepper-row span {
  color: var(--muted);
}

.fine-print {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.install-copy {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.install-copy p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 58, 53, 0.06);
  padding: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.install-copy strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100% - 36px));
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 13px 18px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 22px, 680px);
    padding-top: 12px;
  }

  .app-header {
    align-items: flex-start;
  }

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

  .today-strip {
    grid-template-columns: 1fr;
  }

  .prompt-strip {
    grid-template-columns: 1fr;
    border-radius: var(--radius-md);
  }

  .prompt-strip span {
    text-align: left;
  }

  .belt-grid {
    grid-template-columns: 1fr;
  }

  .mobile-dock {
    display: grid;
  }

  .focus-card {
    min-height: 280px;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .task-actions {
    justify-content: flex-start;
  }

  .toast {
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 16px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .app-header h1 {
    max-width: 260px;
  }

  .ghost-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .focus-card,
  .panel {
    border-radius: 24px;
    padding: 18px;
  }

  .current-task {
    min-height: 210px;
  }

  .current-task h3 {
    font-size: clamp(28px, 10vw, 42px);
  }

  .big-actions,
  .modal-actions {
    display: grid;
  }

  .snooze-row {
    grid-template-columns: 1fr;
  }

  .inline-add {
    grid-template-columns: 1fr;
  }

  .summary-box {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: min(86vh, 760px);
    border-radius: 28px 28px 0 0;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
