:root {
  color-scheme: light;
  --cream: #fff8f3;
  --peach-50: #fff5ed;
  --coral: #e88b6a;
  --coral-soft: rgba(232, 139, 106, 0.22);
  --amber-glow: #f4c975;
  --text: #3a2f2c;
  --text-muted: #7d6e68;
  --stroke-glass: rgba(255, 255, 255, 0.55);
  --shadow-soft: 0 18px 48px rgba(212, 140, 100, 0.18);
  --radius-lg: 20px;
  --radius-md: 14px;
  --blur: 18px;
  --font: ui-sans-serif, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mini-fs-body: 16px;
  --mini-fs-secondary: 15px;
  --mini-fs-meta: 13px;
  --mini-fs-tab: 15px;
  --mini-tap-min: 44px;
  --surface-glass: rgba(255, 255, 255, 0.42);
  --surface-glass-strong: rgba(255, 255, 255, 0.68);
  --surface-input: rgba(255, 253, 248, 0.74);
  --warm-line: rgba(255, 255, 255, 0.78);
  --warm-shadow-low: 0 10px 28px rgba(212, 140, 100, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(255, 210, 180, 0.62), transparent 56%),
    radial-gradient(760px 420px at 88% 12%, rgba(244, 201, 117, 0.26), transparent 52%),
    linear-gradient(165deg, var(--cream) 0%, var(--peach-50) 48%, #fff1f4 100%);
  color: var(--text);
  font-family: var(--font);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(100%, 393px);
  height: 100svh;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
}

.top-bar,
.recommendation-meta,
.capture-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-bar {
  min-height: 44px;
}

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

.top-utility-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.today-label,
.eyebrow,
.next-step-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--mini-fs-meta);
  font-weight: 760;
  line-height: 1.4;
}

.brand {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 780;
  line-height: 1.2;
}

.mobile-top-identity {
  display: flex;
  align-items: center;
  min-width: 0;
}

.mobile-brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.mobile-top-mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 13px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: var(--mini-tap-min);
  height: var(--mini-tap-min);
  border: 1px solid var(--stroke-glass);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-muted);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.icon-button span,
.icon-button span::before,
.icon-button span::after {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.icon-button span {
  position: relative;
}

.icon-button span::before,
.icon-button span::after {
  position: absolute;
  top: 0;
  content: "";
}

.icon-button span::before {
  left: -8px;
}

.icon-button span::after {
  right: -8px;
}

.text-button {
  min-height: 34px;
  border: 1px solid var(--stroke-glass);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.text-button:hover,
.text-button:focus-visible {
  border-color: rgba(232, 139, 106, 0.34);
  color: var(--coral);
  outline: 2px solid rgba(232, 139, 106, 0.16);
  outline-offset: 2px;
}

.language-toggle {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(232, 139, 106, 0.22);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--coral);
  font-size: 13px;
  font-weight: 840;
  line-height: 1.1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.52) inset;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  border-color: rgba(232, 139, 106, 0.42);
  outline: 2px solid rgba(232, 139, 106, 0.16);
  outline-offset: 2px;
}

.logout-button {
  min-height: 34px;
  border: 1px solid rgba(232, 139, 106, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 780;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.52) inset;
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: rgba(232, 139, 106, 0.34);
  color: var(--coral);
  outline: 2px solid rgba(232, 139, 106, 0.16);
  outline-offset: 2px;
}

.view-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.view-section.is-hidden,
.top-actions.is-hidden {
  display: none;
}

#login-view.is-hidden,
#home-view.is-hidden,
#items-view.is-hidden,
#detail-view.is-hidden {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

.hero-section {
  margin-top: 32px;
}

h1 {
  font-size: 31px;
  line-height: 1.16;
}

.supporting-copy {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: var(--mini-fs-secondary);
  line-height: 1.5;
}

.suggestion-section,
.capture-section {
  border: 1px solid var(--stroke-glass);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.suggestion-section {
  margin-top: 34px;
  padding: 20px;
}

.recommendation-chips {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.recommendation-meta span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.recommendation-meta .deadline-chip {
  border: 1px solid rgba(232, 139, 106, 0.16);
  background: rgba(255, 245, 237, 0.72);
  color: #9b6049;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.eyebrow {
  color: var(--coral);
}

.suggestion-section h2 {
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.22;
}

.next-step-panel {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(180, 200, 255, 0.18), rgba(255, 220, 200, 0.34)),
    rgba(255, 255, 255, 0.35);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.42) inset;
}

.next-step-panel p {
  color: var(--coral);
}

.next-step-panel strong,
.step-list li {
  font-size: 16px;
  font-weight: 760;
  line-height: 1.45;
}

.reason {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.primary-action-button,
.secondary-button {
  min-height: var(--mini-tap-min);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button,
.primary-action-button {
  border: 1px solid rgba(232, 139, 106, 0.72);
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 24px rgba(232, 139, 106, 0.22);
}

.secondary-button {
  border: 1px solid var(--stroke-glass);
  background: rgba(255, 255, 255, 0.46);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.52) inset;
}

.safe-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-top: 14px;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: rgba(255, 245, 237, 0.58);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: var(--warm-shadow-low);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.safe-pill span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber-glow);
}

.capture-section {
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 -10px 34px rgba(212, 140, 100, 0.1);
}

.capture-header {
  margin-bottom: 10px;
}

.capture-title {
  color: var(--coral);
  font-size: 14px;
  font-weight: 760;
}

.thought-input {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  padding: 13px;
  background: var(--surface-input);
  color: var(--text);
  font-size: var(--mini-fs-body);
  line-height: 1.55;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.46) inset;
}

.thought-input::placeholder {
  color: rgba(125, 110, 104, 0.68);
}

.thought-input:focus,
.text-input:focus,
.mini-select:focus {
  outline: 2px solid var(--coral-soft);
  border-color: rgba(232, 139, 106, 0.5);
}

.primary-button {
  width: 100%;
  margin-top: 10px;
}

.capture-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.voice-main-tools {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tool-status {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.is-listening {
  border-color: rgba(232, 139, 106, 0.72);
  color: var(--coral);
}

.step-list ol,
#focus-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.focus-section {
  margin-top: 28px;
}

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

.auth-demo-button {
  width: 100%;
}

.text-input,
.mini-select {
  width: 100%;
  min-height: var(--mini-tap-min);
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: var(--surface-input);
  color: var(--text);
  font-size: var(--mini-fs-body);
  line-height: 1.35;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.46) inset;
}

.deadline-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.34fr);
  gap: 10px;
  align-items: center;
}

.deadline-date-input,
.deadline-time-input {
  min-width: 0;
}

.deadline-time-input {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--coral) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--coral) 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    var(--surface-input);
  padding-right: 34px;
}

.field-error,
.field-success {
  min-height: 20px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.field-success {
  color: #557a5e;
}

.inline-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #557a5e;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.inline-status.is-hidden {
  display: none;
}

.inline-status .panel-link {
  margin-top: 0;
}

.toast {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  position: fixed;
  right: clamp(16px, 2vw, 32px);
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  margin: 0;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 44px rgba(112, 77, 58, 0.18);
}

.toast p {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.4;
}

.compact-hero {
  margin-top: 16px;
}

.compact-hero h1 {
  font-size: 27px;
}

.inline-add-form,
.detail-form,
.list-section {
  margin-top: 12px;
}

.item-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.tab-button {
  min-height: 40px;
  border: 1px solid var(--stroke-glass);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-muted);
  font-size: var(--mini-fs-tab);
  font-weight: 800;
}

.tab-button.is-active {
  border-color: rgba(232, 139, 106, 0.48);
  background: var(--coral-soft);
  color: var(--coral);
}

.inline-add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.inline-add-form .field-error {
  grid-column: 1 / -1;
}

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

.item-list,
.detail-form,
#detail-steps {
  display: grid;
  gap: 10px;
}

.list-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.item-list {
  min-height: 0;
  overflow: auto;
  padding-bottom: 2px;
  overscroll-behavior: contain;
}

.item-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--stroke-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface-glass);
  box-shadow: var(--warm-shadow-low);
}

.item-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.3;
}

.item-task-meta {
  margin: -2px 0 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.preview-steps {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
  list-style: none;
}

.preview-steps li,
.step-list li {
  min-width: 0;
}

.step-check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.step-check-row input,
.step-complete-input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--coral);
}

.step-check-row .step-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.step-check-row.is-completed .step-text {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.card-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding-top: 2px;
}

.card-controls .card-action-button {
  min-height: 34px;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1.1;
  box-shadow: none;
}

.card-controls .card-action-primary {
  min-width: 74px;
  margin-left: auto;
  padding-inline: 14px;
  box-shadow: 0 6px 14px rgba(232, 139, 106, 0.16);
}

.card-controls .card-action-muted {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.28);
}

.empty-state {
  border: 1px dashed rgba(232, 139, 106, 0.34);
  border-radius: var(--radius-md);
  padding: 13px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.list-load-more {
  width: 100%;
  justify-content: center;
}

.detail-form {
  border: 1px solid var(--stroke-glass);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--warm-shadow-low);
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.compact-textarea {
  min-height: 86px;
}

.steps-editor {
  display: grid;
  gap: 10px;
}

.small-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.inline-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.step-input-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.is-hidden {
  display: none;
}

.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;
}

@media (max-width: 759px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  html,
  body {
    height: auto;
    min-height: 100svh;
  }

  .deadline-input-group {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: 100%;
    height: auto;
    min-height: 100svh;
    margin: 0;
    overflow: visible;
    padding: env(safe-area-inset-top, 0px) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell.is-home-view {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell.is-home-view .app-main {
    height: 100%;
    overflow: hidden;
  }

  .view-section {
    min-height: 0;
    overflow: hidden;
  }

  .top-bar {
    min-height: 38px;
  }

  .hero-section {
    margin-top: 2px;
  }

  h1 {
    font-size: 25px;
    line-height: 1.08;
  }

  .supporting-copy {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.35;
  }

  .home-primary {
    display: grid;
    gap: 8px;
    min-height: 0;
  }

  .home-primary .capture-section,
  .home-primary .suggestion-section,
  .focus-section {
    margin-top: 0;
  }

  .suggestion-section {
    padding: 10px;
  }

  .suggestion-section h2 {
    margin-top: 6px;
    font-size: 20px;
  }

  .next-step-panel {
    gap: 5px;
    margin-top: 8px;
    padding: 9px 10px;
  }

  .reason,
  .action-row,
  .safe-pill {
    margin-top: 6px;
  }

  .safe-pill {
    padding: 6px 10px;
  }
}

@media (min-width: 760px) {
  body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
  }

  .app-shell {
    min-height: 852px;
    border: 1px solid var(--stroke-glass);
    border-radius: 34px;
    background:
      radial-gradient(560px 320px at 50% -14%, rgba(255, 210, 180, 0.42), transparent 58%),
      linear-gradient(175deg, rgba(255, 248, 243, 0.74) 0%, rgba(255, 245, 237, 0.72) 54%, rgba(255, 245, 240, 0.82) 100%);
    box-shadow: 0 26px 72px rgba(212, 140, 100, 0.2);
  }

  .suggestion-section {
    padding: 18px;
  }

  .primary-button,
  .primary-action-button,
  .secondary-button {
    min-height: 42px;
  }

  .items-view,
  #items-view,
  #detail-view {
    max-width: 760px;
  }

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

  .detail-form {
    padding: 18px;
  }
}

.app-sidebar {
  display: none;
}

.app-main {
  display: flex;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.mobile-brand {
  display: block;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #b05c65, var(--coral));
  color: #fff;
  font-weight: 800;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 14px;
}

.thought-input-shell {
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.46) inset;
}

.thought-input-shell .thought-input {
  height: clamp(96px, 14svh, 116px);
  min-height: 0;
  resize: none;
  overflow-y: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.thought-input-shell .thought-input:focus {
  outline: 0;
}

.capture-tools {
  margin: 0;
  padding: 0 12px 12px;
}

.voice-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(232, 139, 106, 0.2);
  border-radius: 12px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

.voice-button span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
  color: var(--coral);
  font-size: 0;
}

.voice-waveform {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 2px;
}

.voice-waveform.is-active {
  display: inline-flex;
}

.voice-waveform span {
  width: 3px;
  height: 9px;
  border-radius: 999px;
  background: var(--coral);
  opacity: 0.72;
  transform-origin: center;
  animation: voice-wave 920ms ease-in-out infinite;
}

.voice-waveform span:nth-child(2) {
  animation-delay: 110ms;
}

.voice-waveform span:nth-child(3) {
  animation-delay: 220ms;
}

.voice-waveform span:nth-child(4) {
  animation-delay: 330ms;
}

.voice-waveform span:nth-child(5) {
  animation-delay: 440ms;
}

@keyframes voice-wave {
  0%,
  100% {
    transform: scaleY(0.72);
  }

  50% {
    transform: scaleY(1.82);
  }
}

.input-count {
  flex: 0 0 auto;
  margin-left: auto;
  justify-self: end;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.primary-button.is-busy {
  position: relative;
  overflow: hidden;
}

.primary-button.is-busy::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.26) 45%, transparent 70%);
  content: "";
  transform: translateX(-100%);
  animation: busy-sheen 1.4s ease-in-out infinite;
}

@keyframes busy-sheen {
  to {
    transform: translateX(100%);
  }
}

.home-sidebar {
  display: none;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.panel-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--coral);
  font-size: 14px;
  font-weight: 780;
}

.muted-link {
  justify-self: center;
  margin-top: 12px;
  color: var(--text-muted);
}

.resplit-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid rgba(232, 139, 106, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 245, 237, 0.48);
}

.resplit-panel.is-hidden {
  display: none;
}

.resplit-panel p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

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

.resplit-actions .small-button {
  width: 100%;
  padding-inline: 8px;
}

.home-row-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.home-thought-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 74px;
  width: 100%;
  border: 1px solid rgba(232, 139, 106, 0.16);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--text);
  text-align: left;
}

.home-thought-row:hover,
.home-thought-row:focus-visible {
  background: rgba(255, 245, 237, 0.78);
  outline: 2px solid rgba(232, 139, 106, 0.2);
  outline-offset: 2px;
}

.row-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--coral);
}

.row-dot.parking {
  background: var(--amber-glow);
}

.row-dot.done {
  background: #67a66f;
}

.row-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.row-text strong,
.row-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-text strong {
  font-size: 15px;
  line-height: 1.25;
}

.row-text span {
  color: var(--text-muted);
  font-size: 13px;
}

.row-text .row-deadline {
  color: var(--coral);
  font-weight: 780;
}

.row-chevron {
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
}

.panel-footnote {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.panel-count {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

@media (min-width: 980px) {
  body {
    display: block;
    height: 100vh;
    min-height: 100vh;
    padding: 0;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background:
      radial-gradient(740px 420px at 28% -10%, rgba(255, 210, 180, 0.34), transparent 58%),
      linear-gradient(175deg, rgba(255, 248, 243, 0.82) 0%, rgba(255, 245, 237, 0.72) 60%, rgba(255, 245, 240, 0.88) 100%);
    box-shadow: none;
    transition: grid-template-columns 180ms ease;
  }

  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid rgba(232, 139, 106, 0.12);
    padding: 28px 18px;
    background: rgba(255, 253, 248, 0.42);
  }

  .sidebar-brand {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .sidebar-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(232, 139, 106, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
  }

  .sidebar-toggle .tooltip {
    position: absolute;
    top: 47px;
    right: -8px;
    border-radius: 8px;
    padding: 5px 9px;
    background: rgba(58, 47, 44, 0.78);
    color: #fff;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
    white-space: nowrap;
  }

  .sidebar-toggle:hover .tooltip,
  .sidebar-toggle:focus-visible .tooltip {
    opacity: 1;
    transform: translateY(0);
  }

  .sidebar-nav {
    display: grid;
    gap: 10px;
    margin-top: 42px;
  }

  .sidebar-link,
  .sidebar-soft-link,
  .sidebar-user {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 12px 14px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 16px;
    font-weight: 760;
  }

  .sidebar-link span:first-child,
  .sidebar-soft-link span:first-child {
    color: var(--coral);
    font-size: 20px;
  }

  .sidebar-link.is-active {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 245, 237, 0.82);
    color: var(--coral);
  }

  .sidebar-spacer {
    flex: 1;
  }

  .sidebar-soft-link {
    margin-bottom: 12px;
    border-color: rgba(232, 139, 106, 0.11);
    background: rgba(255, 255, 255, 0.34);
    color: var(--text-muted);
    font-size: 14px;
  }

  .sidebar-soft-link strong {
    color: var(--text);
  }

  .sidebar-user {
    border-color: rgba(232, 139, 106, 0.1);
    background: rgba(255, 255, 255, 0.34);
  }

  .sidebar-user p,
  .sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-user div {
    min-width: 0;
  }

  .sidebar-user p {
    font-size: 15px;
    font-weight: 780;
  }

  .sidebar-user span {
    color: var(--text-muted);
    font-size: 12px;
  }

  .app-shell.is-sidebar-collapsed .app-sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .app-shell.is-sidebar-collapsed .sidebar-brand,
  .app-shell.is-sidebar-collapsed .sidebar-link,
  .app-shell.is-sidebar-collapsed .sidebar-soft-link,
  .app-shell.is-sidebar-collapsed .sidebar-user {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-right: 8px;
    padding-left: 8px;
  }

  .app-shell.is-sidebar-collapsed .sidebar-brand .brand,
  .app-shell.is-sidebar-collapsed .sidebar-link span:last-child,
  .app-shell.is-sidebar-collapsed .sidebar-soft-link span:nth-child(2),
  .app-shell.is-sidebar-collapsed .sidebar-soft-link strong,
  .app-shell.is-sidebar-collapsed .sidebar-user div {
    display: none;
  }

  .app-shell.is-sidebar-collapsed .sidebar-toggle {
    width: 38px;
    height: 38px;
  }

  .mobile-brand {
    display: none;
  }

  .app-main {
    height: 100vh;
    min-height: 0;
    padding: 20px 44px 24px;
  }

  .top-bar {
    justify-content: flex-end;
  }

  .top-bar > div:first-child {
    display: none;
  }

  .top-actions {
    display: flex;
  }

  .top-actions .text-button {
    display: none;
  }

  .view-section {
    flex: 1;
  }

  .hero-section {
    margin-top: 6px;
  }

  .hero-section h1,
  h1 {
    font-size: 38px;
    line-height: 1.08;
  }

  .supporting-copy {
    font-size: 16px;
  }

  .home-layout {
    display: grid;
    grid-template-columns: minmax(520px, 700px) minmax(320px, 390px);
    justify-content: center;
    align-items: stretch;
    gap: clamp(24px, 4vw, 58px);
    height: 100%;
    min-height: 0;
  }

  .home-primary {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    min-height: 0;
  }

  .home-primary .capture-section,
  .home-primary .suggestion-section {
    margin-top: 0;
    padding: 16px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.46) inset;
  }

  .home-primary .capture-section {
    background: rgba(255, 253, 248, 0.54);
  }

  .thought-input-shell .thought-input {
    height: clamp(116px, 15svh, 176px);
    min-height: 0;
    font-size: 16px;
  }

  .capture-tools {
    grid-template-columns: auto 1fr auto;
  }

  .primary-button {
    min-height: 46px;
    margin-top: 12px;
    font-size: 16px;
  }

  .suggestion-section h2 {
    font-size: 24px;
  }

  .home-primary .suggestion-section:not(.is-hidden) {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .home-primary .suggestion-section .action-row {
    margin-top: auto;
  }

  .action-row {
    grid-template-columns: 1fr 1.15fr;
    gap: 14px;
    margin-top: 14px;
  }

  .safe-pill {
    margin-top: 10px;
    box-shadow: none;
  }

  .home-sidebar {
    display: grid;
    align-content: start;
    gap: 14px;
    margin-top: 58px;
    min-height: 0;
    overflow: visible;
  }

  .sidebar-panel {
    border: 1px solid rgba(232, 139, 106, 0.14);
    border-radius: 18px;
    padding: 18px;
    background: rgba(255, 253, 248, 0.46);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.44) inset;
  }

  .compact-panel {
    padding-bottom: 20px;
  }

  #items-view,
  #detail-view {
    width: min(100%, 880px);
    height: 100%;
    max-width: none;
    margin: 0 auto;
    min-height: 0;
  }

  #items-view {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  #detail-view {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

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

@media (max-width: 979px) {
  .app-shell {
    display: block;
  }

  .top-actions {
    display: flex;
  }

  .home-primary {
    display: grid;
    flex: 1;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
  }

  .home-primary .capture-section {
    margin-top: 0;
  }

  .home-primary .suggestion-section {
    margin-top: 0;
  }
}

@media (min-width: 980px) and (max-height: 760px) {
  .app-main {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .top-bar {
    min-height: 34px;
  }

  .hero-section {
    margin-top: 0;
  }

  .hero-section h1,
  h1 {
    font-size: 34px;
  }

  .supporting-copy {
    margin-top: 5px;
    font-size: 14px;
  }

  .home-primary {
    gap: 10px;
  }

  .home-primary .capture-section,
  .home-primary .suggestion-section {
    padding: 14px;
  }

  .thought-input-shell .thought-input {
    height: 82px;
  }

  .primary-button {
    min-height: 42px;
    margin-top: 8px;
  }

  .suggestion-section h2 {
    margin-top: 8px;
    font-size: 22px;
  }

  .next-step-panel {
    margin-top: 10px;
    padding: 11px 12px;
  }

  .reason,
  .action-row {
    margin-top: 8px;
  }

  .home-sidebar {
    margin-top: 44px;
  }
}

@media (min-width: 760px) and (max-width: 979px) {
  body {
    display: block;
    padding: 0;
  }

  .app-shell {
    width: min(100%, 760px);
    height: 100vh;
    min-height: 0;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    padding: 28px clamp(22px, 4vw, 40px) 36px;
    background: transparent;
    box-shadow: none;
  }

  .hero-section {
    margin-top: 16px;
  }

  .home-primary .capture-section {
    margin-top: 0;
  }
}

@media (max-width: 979px) {
  #items-view {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  #detail-view {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 759px) {
  .top-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 10px;
    min-height: 0;
  }

  .top-bar > div:first-child {
    min-width: 0;
  }

  .mobile-brand-row .mobile-brand {
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .today-label {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(232, 139, 106, 0.12);
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.34);
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.42) inset;
  }

  .thought-input-shell .thought-input {
    height: 112px;
    overflow: hidden;
  }

  .top-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .top-utility-actions {
    align-self: start;
  }

  .top-utility-actions .logout-button {
    min-width: 0;
    min-height: 34px;
    border-color: transparent;
    padding: 7px 2px 7px 8px;
    background: transparent;
    box-shadow: none;
  }

  .top-actions .text-button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
  }

  .top-actions .text-button.is-active {
    border-color: rgba(232, 139, 106, 0.48);
    background: var(--coral-soft);
    color: var(--coral);
  }

  .recommendation-meta {
    align-items: flex-start;
  }

  .recommendation-chips {
    max-width: 54%;
  }

  #home-view {
    overflow: hidden;
  }

  .app-main,
  .view-section {
    height: auto;
    overflow: visible;
  }

  .app-shell.is-home-view .app-main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell.is-home-view #home-view {
    min-height: 0;
    overflow: hidden;
  }

  #home-view .home-primary {
    align-content: start;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    padding-bottom: 0;
  }

  #home-view .capture-section {
    padding: 10px;
  }

  #home-view .capture-header {
    margin-bottom: 6px;
  }

  #home-view .thought-input-shell .thought-input {
    height: 72px;
    min-height: 0;
    padding: 10px 11px;
    font-size: 15px;
    line-height: 1.45;
  }

  #home-view .capture-tools {
    padding: 0 10px 8px;
  }

  #home-view .primary-button {
    min-height: 40px;
    margin-top: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  #home-view .home-primary .suggestion-section:not(.is-hidden) {
    display: flex;
    align-self: end;
    min-height: 0;
    width: 100%;
    flex-direction: column;
    overflow: hidden;
  }

  #home-view .recommendation-meta {
    gap: 8px;
  }

  #home-view .recommendation-chips {
    display: none;
  }

  #home-view .suggestion-section h2,
  #home-view .next-step-panel strong,
  #home-view .reason {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #home-view .suggestion-section h2 {
    -webkit-line-clamp: 2;
    font-size: 19px;
    line-height: 1.18;
  }

  #home-view .next-step-panel {
    margin-top: 7px;
    padding: 8px 10px;
  }

  #home-view .next-step-panel strong {
    -webkit-line-clamp: 2;
    font-size: 15px;
    line-height: 1.35;
  }

  #home-view .reason {
    -webkit-line-clamp: 1;
    margin-top: 8px;
    color: var(--coral);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
  }

  #home-view .action-row {
    margin-top: 8px;
  }

  #items-view {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: calc(100svh - 81px);
    min-height: 0;
    overflow: hidden;
  }

  #items-view .list-section {
    min-height: 0;
    overflow: hidden;
  }

  #items-view .item-card {
    gap: 8px;
    padding: 12px;
  }

  #items-view .item-card h3 {
    font-size: 17px;
  }

  #items-view .preview-steps {
    display: none;
  }

  #items-view .card-controls {
    gap: 5px;
  }

  #items-view .item-list {
    overflow: auto;
    padding-bottom: 18px;
    overscroll-behavior: contain;
  }
}

@media (max-height: 740px) and (max-width: 759px) {
  .app-shell {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    min-height: 34px;
  }

  .hero-section {
    margin-top: 12px;
  }

  h1 {
    font-size: 25px;
  }

  .home-primary {
    gap: 10px;
  }

  .capture-section,
  .suggestion-section {
    padding: 12px;
  }

  .capture-header {
    margin-bottom: 7px;
  }

  .thought-input-shell .thought-input {
    min-height: 92px;
    padding: 10px 11px;
  }

  .capture-tools {
    padding: 0 10px 9px;
  }

  .primary-button,
  .primary-action-button,
  .secondary-button {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .primary-button {
    margin-top: 8px;
  }

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

  .next-step-panel {
    margin-top: 9px;
  }

  .reason,
  .action-row,
  .safe-pill {
    margin-top: 8px;
  }
}

.app-shell.is-login-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 18px calc(22px + env(safe-area-inset-bottom, 0px));
}

.app-shell.is-auth-checking {
  opacity: 0;
}

.app-shell.is-login-shell .app-sidebar,
.app-shell.is-login-shell .top-bar {
  display: none;
}

.app-shell.is-login-shell .app-main {
  display: grid;
  height: 100%;
  min-height: 0;
  place-items: center;
  padding: 0;
}

.login-page {
  width: min(100%, 430px);
  min-height: auto;
  flex: initial;
  justify-content: center;
  gap: 22px;
}

.login-hero {
  margin-top: 0;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.login-page h1 {
  max-width: 8em;
  font-size: 36px;
  line-height: 1.12;
}

.login-page .auth-form {
  margin-top: 0;
  padding: 18px;
}

@media (min-width: 760px) {
  .app-shell.is-login-shell {
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(680px 420px at 22% 8%, rgba(255, 210, 180, 0.48), transparent 58%),
      radial-gradient(560px 360px at 78% 16%, rgba(244, 201, 117, 0.22), transparent 54%),
      linear-gradient(165deg, var(--cream) 0%, var(--peach-50) 54%, #fff1f4 100%);
    box-shadow: none;
  }
}

@media (min-width: 980px) {
  .app-shell.is-login-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.is-login-shell .app-main {
    padding: 0;
  }

  .app-shell.is-login-shell .hero-section h1 {
    font-size: 46px;
  }

  .app-shell.is-login-shell .primary-button {
    min-height: 52px;
  }
}
