:root {
  --bg: #081317;
  --bg-soft: #11232a;
  --card: #f4f9f8;
  --card-muted: #e8f2ef;
  --ink: #102329;
  --ink-soft: #4f6770;
  --line: #cfe2dc;
  --primary: #00b592;
  --primary-dark: #0a7a65;
  --accent: #ff8d3a;
  --danger: #d64949;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, #1b3740 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, #294651 0%, transparent 35%),
    var(--bg);
  color: var(--ink);
}

h1,
h2,
strong {
  font-family: "Space Grotesk", sans-serif;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px 92px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kicker {
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin-bottom: 2px;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.05rem;
}

.screen {
  display: none;
}

.screen.active {
  display: grid;
  gap: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.status {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.pill {
  font-size: 0.75rem;
  background: #dff3ec;
  color: #0c6553;
  border-radius: 999px;
  padding: 5px 9px;
  white-space: nowrap;
}

.pill.accent {
  background: #ffe6d4;
  color: #9a531f;
}

.option-group {
  margin: 12px 0;
}

.label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.83rem;
}

.chip.selected {
  background: #d8fff4;
  border-color: #9ee5d6;
  color: #0f6b59;
  font-weight: 700;
}

.primary-btn,
.ghost-btn,
.quick,
.tab {
  border: 0;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-family: "DM Sans", sans-serif;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #00d8ae 100%);
  color: #fff;
  font-weight: 700;
  width: 100%;
}

.primary-btn.split {
  width: auto;
  min-width: 120px;
}

.ghost-btn {
  background: #e6f2ee;
  color: #0c6251;
  border: 1px solid #c5ddd6;
}

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

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

.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.stats-grid span {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.stats-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

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

.plan-list li,
.list li {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.plan-list li span,
.list li span {
  color: var(--ink-soft);
  text-align: right;
  font-size: 0.82rem;
}

.chat-card {
  min-height: calc(100vh - 215px);
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}

.bubble {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 0.9rem;
}

.bubble.ai {
  align-self: flex-start;
  background: #eaf8f2;
  border: 1px solid #d4e8e2;
}

.bubble.user {
  align-self: flex-end;
  background: #14313a;
  color: #f0f7f5;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.quick {
  background: #effaf6;
  border: 1px solid #c8e6dd;
  color: #105d4d;
  padding: 7px 10px;
  font-size: 0.76rem;
}

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

input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  font-size: 0.88rem;
  font-family: "DM Sans", sans-serif;
  width: 100%;
}

.chat-input button {
  border: 0;
  border-radius: 10px;
  padding: 0 15px;
  background: var(--primary-dark);
  color: #fff;
  font-weight: 700;
}

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

.timer {
  font-size: 2rem;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.03em;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.84rem;
  margin-top: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(8, 19, 23, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 9px 10px;
}

.tab {
  background: transparent;
  color: #c8e0db;
  border: 1px solid transparent;
  padding: 8px 4px;
  font-size: 0.74rem;
}

.tab.active {
  background: rgba(0, 181, 146, 0.2);
  border-color: rgba(0, 181, 146, 0.38);
  color: #fff;
}

dialog {
  width: min(520px, calc(100% - 20px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
}

@media (min-width: 980px) {
  .app-shell {
    max-width: 760px;
    padding-bottom: 20px;
  }

  .screen.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .screen.active .card:first-child {
    grid-column: 1 / -1;
  }

  .chat-card {
    min-height: 650px;
    grid-column: 1 / -1;
  }

  .bottom-nav {
    max-width: 700px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 14px 14px 0 0;
  }
}
