:root {
  color-scheme: light;
  --ivory: #ede9e3;
  --nude: #e7d7c9;
  --rose: #d4b2a7;
  --stone: #cdc6c3;
  --latte: #a38f85;
  --latte-deep: #816f67;
  --text: #463c38;
  --text-soft: rgba(70, 60, 56, 0.72);
  --line: rgba(163, 143, 133, 0.18);
  --surface: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 60px rgba(126, 105, 96, 0.14);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --font-ui: "Aptos", "Trebuchet MS", "Gill Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top left, rgba(231, 215, 201, 0.72), transparent 38%),
    radial-gradient(circle at bottom right, rgba(212, 178, 167, 0.34), transparent 32%),
    linear-gradient(180deg, #f7f4f1 0%, #f0ebe6 100%);
  color: var(--text);
  padding:
    max(18px, env(safe-area-inset-top))
    16px
    calc(108px + env(safe-area-inset-bottom))
    16px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.page-glow {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.page-glow-a {
  top: -42px;
  right: -34px;
  background: rgba(212, 178, 167, 0.44);
}

.page-glow-b {
  bottom: 12%;
  left: -70px;
  background: rgba(205, 198, 195, 0.52);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.hero-card,
.surface-card,
.composer-section,
.summary-panel,
.empty-state,
.toast,
.mini-list-item,
.stat-card,
.system-banner {
  backdrop-filter: blur(12px);
}

.hero-card,
.surface-card,
.composer-section,
.summary-panel,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 22px 20px;
  border-radius: var(--radius-xl);
}

.hero-copy {
  display: grid;
  gap: 10px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(231, 215, 201, 0.64);
  color: var(--latte-deep);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.04;
}

.hero-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-soft);
  max-width: 64ch;
}

.app-main {
  display: grid;
  gap: 16px;
}

.layout-grid,
.stats-grid,
.grid-two,
.summary-grid,
.list-stack,
.detail-list,
.form-grid {
  display: grid;
  gap: 12px;
}

.surface-card,
.composer-section,
.summary-panel,
.empty-state {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.surface-card h2,
.composer-section h2,
.summary-panel h2,
.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.surface-card p,
.composer-section p,
.summary-panel p,
.empty-state p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.58;
}

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

.section-head p {
  max-width: 58ch;
}

.loading-card,
.empty-state {
  text-align: center;
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.loader-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--latte);
  box-shadow:
    -18px 0 0 rgba(231, 215, 201, 0.92),
    18px 0 0 rgba(205, 198, 195, 0.92);
  animation: pulse 1.1s infinite ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.85;
  }
  50% {
    transform: translateY(-4px) scale(1.06);
    opacity: 1;
  }
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button {
  border-radius: 999px;
  border: none;
  min-height: 46px;
  padding: 0 18px;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.ghost-button,
.secondary-button {
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-button {
  background: linear-gradient(135deg, var(--rose), var(--latte));
  color: #fffaf6;
  box-shadow: 0 12px 28px rgba(163, 143, 133, 0.28);
}

.danger-button {
  background: rgba(212, 178, 167, 0.22);
  color: #8a534a;
  border: 1px solid rgba(212, 178, 167, 0.42);
}

.text-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--latte-deep);
}

.button-row,
.pill-row,
.options-grid,
.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.system-banner {
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(231, 215, 201, 0.7);
  border: 1px solid rgba(163, 143, 133, 0.24);
  color: var(--latte-deep);
  font-size: 14px;
  line-height: 1.5;
}

.preview-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(237, 233, 227, 0.88));
}

.is-hidden {
  display: none !important;
}

.stat-card,
.mini-list-item {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(163, 143, 133, 0.18);
  border-radius: 20px;
  padding: 16px;
}

.stat-card {
  gap: 6px;
}

.stat-label,
.caption,
.helper-text,
.detail-label {
  color: var(--text-soft);
  font-size: 13px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.choice-chip,
.status-pill,
.role-pill,
.info-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.choice-chip {
  background: rgba(237, 233, 227, 0.78);
  border-color: rgba(163, 143, 133, 0.18);
  color: var(--text);
}

.choice-chip.is-active {
  background: linear-gradient(135deg, rgba(212, 178, 167, 0.9), rgba(163, 143, 133, 0.88));
  color: #fffaf7;
  border-color: rgba(163, 143, 133, 0.44);
  box-shadow: 0 12px 26px rgba(163, 143, 133, 0.18);
}

.choice-chip__meta {
  display: block;
  font-size: 12px;
  opacity: 0.78;
}

.status-pill,
.role-pill,
.info-pill {
  min-height: 34px;
  background: rgba(237, 233, 227, 0.9);
  color: var(--latte-deep);
  font-size: 13px;
}

.status-pill[data-tone="pending"] {
  background: rgba(212, 178, 167, 0.24);
}

.status-pill[data-tone="success"] {
  background: rgba(205, 198, 195, 0.82);
}

.status-pill[data-tone="danger"] {
  background: rgba(212, 178, 167, 0.38);
}

.mini-list-item,
.detail-list,
.form-grid {
  gap: 10px;
}

.mini-list-item__top,
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mini-list-item__top h3,
.surface-card h3,
.summary-panel h3 {
  margin: 0;
  font-size: 17px;
}

.mini-list-item__body {
  color: var(--text-soft);
  line-height: 1.56;
}

.mini-list-item__body p {
  margin: 0;
}

.detail-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(163, 143, 133, 0.14);
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-value {
  text-align: right;
  font-weight: 600;
}

.detail-note {
  margin-top: 10px;
  color: var(--latte-deep);
  font-size: 14px;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  color: var(--latte-deep);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(163, 143, 133, 0.28);
  background: rgba(255, 255, 255, 0.88);
  min-height: 50px;
  padding: 14px 16px;
  color: var(--text);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.empty-state__icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(212, 178, 167, 0.55), rgba(237, 233, 227, 0.96));
  display: grid;
  place-items: center;
  color: var(--latte-deep);
  font-size: 28px;
}

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: calc(94px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  z-index: 5;
}

.toast {
  min-width: min(320px, calc(100vw - 28px));
  max-width: 420px;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(70, 60, 56, 0.92);
  color: #fffaf6;
}

.toast[data-tone="error"] {
  background: rgba(138, 83, 74, 0.96);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 920px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(163, 143, 133, 0.18);
  border-radius: 26px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(126, 105, 96, 0.18);
  z-index: 4;
}

.bottom-nav__item {
  min-height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 6px;
  color: var(--text-soft);
}

.bottom-nav__icon {
  font-size: 16px;
}

.bottom-nav__label {
  font-size: 12px;
}

.bottom-nav__item.is-active {
  background: linear-gradient(180deg, rgba(231, 215, 201, 0.86), rgba(237, 233, 227, 0.98));
  color: var(--latte-deep);
}

@media (min-width: 720px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  }

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

@media (max-width: 560px) {
  .hero-card,
  .mini-list-item__top,
  .detail-row {
    flex-direction: column;
  }

  .detail-value {
    text-align: left;
  }

  .button-row > * {
    width: 100%;
  }

  .bottom-nav {
    gap: 6px;
    padding: 8px;
  }

  .bottom-nav__label {
    font-size: 11px;
  }
}
