:root {
  --bg: #f6f0f4;
  --bg2: #eef6fb;
  --card: #fffcfe;
  --ink: #3d3a45;
  --muted: #7a7485;
  --pink: #f3c6d4;
  --pink-deep: #e8a0b5;
  --blue: #b8d9ef;
  --blue-deep: #7eb6d9;
  --mint: #cfe8df;
  --cream: #fff8f2;
  --line: #eadfe6;
  --good: #d8f0e4;
  --caution: #fde8d8;
  --shadow: 0 10px 30px rgba(90, 70, 100, 0.08);
  --radius: 20px;
  --tab-h: 64px;
  --font: "Nunito", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fde8f0 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dcebf8 0%, transparent 50%),
    linear-gradient(165deg, var(--bg2), var(--bg));
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.page-header h1 {
  margin: 4px 0;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(120deg, #6a9fc4, #d489a4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: #fff;
  border-color: transparent;
}

.stage {
  display: grid;
  grid-template-columns: minmax(300px, 390px) 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 860px) {
  .stage {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.device {
  width: 100%;
  max-width: 390px;
  height: 780px;
  border-radius: 36px;
  padding: 12px;
  background: linear-gradient(160deg, #f7d6e2, #c9e4f5 55%, #e5f3ec);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  position: relative;
  transition: max-width 0.25s ease, height 0.25s ease;
}

.device.wide {
  max-width: 720px;
  height: 820px;
}

.device-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 22px;
  background: #2a2730;
  border-radius: 999px;
  z-index: 5;
  opacity: 0.85;
}

.device.wide .device-notch {
  display: none;
}

.app {
  position: relative;
  height: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg, #fbf7fa 0%, #f3f8fc 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Login */
.login-hero {
  padding: 72px 28px 12px;
  text-align: center;
}

.logo-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff;
  background: linear-gradient(145deg, var(--blue-deep), var(--pink-deep));
  box-shadow: 0 8px 20px rgba(126, 182, 217, 0.35);
}

.login-hero h2 {
  margin: 0;
  font-size: 1.8rem;
}

.login-hero .login-sub {
  margin: 4px 0 0;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--pink-deep, #c98ba6);
}

.login-hero .login-sub {
  font-size: 0.9rem;
}

.login-hero p {
  color: var(--muted);
  margin: 8px 0 0;
}

.stack {
  margin: 12px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.45;
}

/* Shell */
.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 42px 18px 10px;
  flex-shrink: 0;
  gap: 10px;
}

.topbar-trailing {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-close {
  flex-shrink: 0;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #6a8fad;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.topbar-close:hover {
  background: #fff;
}

.topbar-title {
  font-weight: 800;
  font-size: 1.15rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.8);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 4px 16px calc(var(--tab-h) + 16px);
  scrollbar-width: thin;
}

.screen-pane {
  animation: fade 0.22s ease;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 12px;
}

/* Home — name hero (tap opens collection) */
.name-hero {
  display: block;
  width: 100%;
  border: none;
  text-align: left;
  cursor: pointer;
  margin: 0 0 10px;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(220px 120px at 100% 0%, rgba(243, 198, 212, 0.7), transparent),
    radial-gradient(200px 110px at 0% 100%, rgba(184, 217, 239, 0.65), transparent),
    var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
  font: inherit;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.name-hero:active {
  transform: scale(0.99);
}

.name-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-height: 2rem;
}

/* Home chips — same pill language as sheet, slightly larger */
.name-hero-row .home-name {
  display: inline-flex;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(90, 70, 100, 0.06);
}

.name-placeholder {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--muted);
}

.name-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.progress-title {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.cheer-bar {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: 0 0 12px;
}

.cheer {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 10px;
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(184, 217, 239, 0.55), rgba(243, 198, 212, 0.55));
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.cheer-nav {
  flex-shrink: 0;
  width: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  color: #5a8fb3;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  align-self: stretch;
  box-shadow: 0 2px 8px rgba(90, 70, 100, 0.06);
}

.cheer-nav:active {
  background: rgba(184, 217, 239, 0.55);
}

.stat-btn {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  padding: 4px 8px;
  border-radius: 12px;
  flex: 1;
  min-width: 0;
}

.stat-btn:active {
  background: rgba(184, 217, 239, 0.25);
}

.hero-card {
  background:
    radial-gradient(200px 120px at 100% 0%, rgba(243, 198, 212, 0.35), transparent),
    radial-gradient(180px 100px at 0% 100%, rgba(184, 217, 239, 0.35), transparent),
    var(--card);
}

/* Name sheet */
.add-name-row {
  margin-top: 4px;
}

.inline-add {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-add input {
  flex: 1;
  min-width: 0;
}

.inline-add .btn {
  flex-shrink: 0;
}

.name-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}

.name-section-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

/* Shared chip grid — collection + ideas */
.names-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.names-grid:empty::after {
  content: "No names yet — add one above or try ideas.";
  display: block;
  width: 100%;
  padding: 12px 8px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
}

/* Collection chip = idea chip + checkbox, draggable */
.name-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 10px 8px 8px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(90, 70, 100, 0.06);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.name-chip:active {
  cursor: grabbing;
}

.name-chip.on-home {
  border-color: rgba(126, 182, 217, 0.55);
  background: linear-gradient(145deg, #f7fbfe, #fdf5f8);
  box-shadow: 0 3px 12px rgba(126, 182, 217, 0.18);
}

.name-chip.dragging {
  opacity: 0.45;
}

.name-chip .name-check {
  width: 18px;
  height: 18px;
  accent-color: #7eb6d9;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.name-chip .name-chip-label {
  font-weight: 800;
  font-size: 0.95rem;
}

/* Ideas use same pill shape */
.idea-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 8px 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(90, 70, 100, 0.06);
}

.idea-chip .idea-plus {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-deep), #c98eaa);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

/* Trash drop zone */
.name-trash {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px dashed var(--line);
  background: #faf7f9;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.name-trash .trash-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.name-trash.drag-over {
  border-color: #e07090;
  background: #fff0f4;
  color: #b44568;
  transform: scale(1.02);
}

.ideas-btn {
  width: 100%;
  margin-top: 4px;
}

.ideas-box {
  background: linear-gradient(160deg, #eef7fc, #fdf0f5);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.ideas-box .names-grid {
  margin-top: 8px;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.baby-name {
  margin: 2px 0 0;
  font-size: 1.55rem;
}

.pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: #3f6b5c;
  white-space: nowrap;
}

.stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 16px 0 8px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #5a8fb3;
}

.stat-unit {
  font-weight: 800;
  color: var(--ink);
}

.stat-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--line);
}

.center {
  text-align: center;
}

.fine {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin: 4px 0 0;
}

.appt-card {
  cursor: pointer;
  border-left: 4px solid var(--blue-deep);
}

.appt-card h3 {
  margin: 4px 0;
  font-size: 1.05rem;
}

.appt-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Doctor */
.doctor-card h3 {
  margin: 4px 0 10px;
  font-size: 1.25rem;
}

.doctor-address {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: #5a8fb3;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef7fc, #f7fbfe);
  border: 1px solid rgba(126, 182, 217, 0.35);
}

.doctor-address .maps-hint {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.appt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.appt-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  margin-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font: inherit;
  color: inherit;
  transition: transform 0.1s ease;
}

.appt-item:active {
  transform: scale(0.99);
}

.appt-item-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.appt-item-top strong {
  font-size: 1rem;
}

.appt-item-when {
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a8fb3;
}

.appt-item-notes {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-list {
  padding: 12px 8px;
}

.danger-text {
  color: #b44568 !important;
  border-color: rgba(224, 112, 144, 0.35) !important;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 0;
}

.week-select-label {
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
}

.week-select-label select {
  font: inherit;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
}

input[type="date"] {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.clear-due-btn {
  margin-top: 6px;
  padding: 4px 0;
  color: #b44568;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-grid.two {
  grid-template-columns: 1fr 1fr;
}

.quick {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 12px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  box-shadow: var(--shadow);
}

.quick span {
  font-size: 1.2rem;
}

.quick.primary-ish {
  background: linear-gradient(145deg, #eef7fc, #fdf0f5);
}

.soft-link p {
  margin: 6px 0;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.92rem;
}

.text-link {
  color: #5a8fb3;
  font-weight: 800;
  text-decoration: none;
}

.btn-as-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  display: inline;
}

.registry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-top: 4px;
}

.registry-url-label {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 1.05rem;
}

.registry-share-btn {
  margin-top: 10px;
  width: 100%;
}

.gear-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gear-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 14px;
  padding: 6px 8px 6px 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.gear-row.is-done {
  opacity: 0.62;
}

.gear-row.is-done .gear-name span:first-child {
  text-decoration: line-through;
}

.gear-check {
  flex-direction: row;
  align-items: center;
  margin: 0;
  gap: 0;
}

.gear-check input {
  width: 18px;
  height: 18px;
  accent-color: #7eb6d9;
  cursor: pointer;
}

.gear-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 10px;
}

.gear-name:active {
  background: rgba(184, 217, 239, 0.25);
}

.gear-amz {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5a8fb3;
  letter-spacing: 0.02em;
}

.gear-add {
  margin: 8px 0 4px;
}

.shop-cta {
  width: 100%;
  margin-bottom: 12px;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
}

.home-link-row {
  margin-bottom: 12px;
}

.shop-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 14px;
  padding: 10px 10px 10px 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.shop-row.is-got {
  opacity: 0.55;
}

.shop-row.is-got .shop-name {
  text-decoration: line-through;
  color: var(--muted);
}

.shop-name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 1rem;
}

.shop-actions {
  margin-bottom: 20px;
}

.shop-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shop-pick .idea-plus {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-deep), #c98eaa);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

input[type="url"] {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--blue-deep), #c98eaa);
  color: #fff;
  box-shadow: 0 8px 18px rgba(126, 182, 217, 0.35);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.sm {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-row .btn {
  flex: 1;
}

/* Baby */
.week-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.week-tab {
  flex: 1;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 10px;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
}

.week-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.week-art {
  font-size: 2.4rem;
  margin-bottom: 4px;
}

.week-art.week-num {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #5a8fb3;
  background: linear-gradient(145deg, #eef7fc, #fdf0f5);
  border: 1px solid var(--line);
}

.week-card h2 {
  margin: 4px 0 6px;
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 800;
}

.week-source {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  line-height: 1.4;
}

.week-actions {
  margin-top: 10px;
  flex-wrap: wrap;
}

.week-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Home: this week inside progress card */
.this-week-block {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 12px 10px;
  border: 1px dashed rgba(126, 182, 217, 0.45);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.this-week-block:active {
  background: rgba(184, 217, 239, 0.25);
}

.this-week-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.this-week-head .label {
  margin: 0;
}

.this-week-size {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #5a8fb3;
  line-height: 1.3;
}

.this-week-blurb {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-h {
  margin: 14px 0 6px;
  font-size: 0.95rem;
}

.soft-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-weight: 600;
}

.muted.sm {
  font-size: 0.85rem;
  margin-top: 0;
}

/* Health */
.pane-head {
  margin: 0 2px 12px;
}

.pane-head.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.pane-head h2 {
  margin: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-head h3 {
  margin: 0;
}

.badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}

.badge.soft {
  background: var(--blue);
  color: #355f7a;
}

.insight-row {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.insight-row strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.insight-row span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.insight-row.good {
  background: var(--good);
}

.insight-row.caution {
  background: var(--caution);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: none;
}

.timeline time {
  font-weight: 800;
  font-size: 0.85rem;
  color: #5a8fb3;
}

.timeline p {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.tip-card {
  background: linear-gradient(135deg, rgba(207, 232, 223, 0.65), rgba(255, 252, 254, 0.9));
}

/* Notes */
.seg {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.seg-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: #fff;
  border-color: transparent;
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

.note-card .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.note-card .kind {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c98eaa;
}

.note-card .kind.notable {
  color: #5a8fb3;
}

.note-card .kind.doctor {
  color: #5d8f78;
}

.note-card .when {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.note-card p {
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* More */
.list-card {
  padding: 4px 8px;
}

.row-link {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 14px 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.row-link:last-child {
  border-bottom: none;
}

.export-preview {
  margin: 0;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 42vh;
  overflow: auto;
  flex: 1;
  min-height: 120px;
}

.export-actions {
  flex-wrap: wrap;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.about-body p {
  margin: 0;
}

.about-lead {
  font-weight: 800;
  font-size: 1.05rem;
  color: #6a8fad;
}

.about-signoff {
  margin-top: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fde8f0, #eef6fb);
  border-radius: 14px;
  font-size: 0.9rem;
}

/* Install / Add to Home Screen */
.install-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
}

.install-icon-preview {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(90, 70, 100, 0.16);
  background: #f0e8ef;
}

.install-icon-caption {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-ol {
  margin: 0;
  padding: 12px 14px 12px 32px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.install-ol li {
  margin: 0 0 8px;
}

.install-ol li:last-child {
  margin-bottom: 0;
}

.install-standalone-note {
  margin: 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fde8f0, #eef6fb);
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.45;
}

.install-glyph {
  font-weight: 800;
  color: #6a8fad;
}

/* Tab bar */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 252, 254, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: 4px;
}

.tab {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}

.tab.active {
  color: #6a8fad;
}

.tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Sheets */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 40, 55, 0.28);
  z-index: 20;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  background: #fffcfe;
  border-radius: 24px 24px 0 0;
  padding: 10px 18px 22px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 88%;
  overflow: auto;
  animation: sheet-up 0.22s ease;
}

.sheet-tall {
  min-height: 70%;
}

/* Sticky header sheets: Close stays pinned; body scrolls underneath */
.sheet.has-sticky-head {
  overflow: hidden;
  padding-bottom: 12px;
  gap: 0;
}

.sheet-fixed-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
  background: #fffcfe;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}

.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 8px;
  scrollbar-width: thin;
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  margin: 0 auto 4px;
}

.sheet h3 {
  margin: 0;
}

.sheet-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-pick {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
}

.symptom {
  background: #f8f4f7;
  border-radius: 14px;
  padding: 10px 12px;
}

.symptom-head {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 8px;
  align-items: center;
  gap: 8px;
}

/* Severity: None · Lo · Med · Bad */
.sev-picks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.sev-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 4px;
  font: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
}

.sev-btn.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(90, 70, 100, 0.12);
}

.sev-btn[data-sev="0"].active {
  background: #e8edf2;
  color: var(--muted);
  box-shadow: none;
}

.sev-btn.sev-lo.active {
  background: linear-gradient(145deg, #b8d9ef, #7eb6d9);
}

.sev-btn.sev-med.active {
  background: linear-gradient(145deg, #f5d9a8, #e8b86d);
  color: #5a4018;
}

.sev-btn.sev-bad.active {
  background: linear-gradient(145deg, #f3c6d4, #e07090);
}

/* Analyze CTA */
.quick.analyze-btn {
  background: linear-gradient(145deg, #e8f5ef, #fdf0f5);
  border-color: rgba(126, 182, 217, 0.35);
}

/* Split timeline */
.tl-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.tl-leg {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.tl-leg.food {
  background: #e8f2fa;
  color: #3f6f8f;
}

.tl-leg.med {
  background: #efeaf8;
  color: #6b5a8f;
}

.tl-leg.symptom {
  background: #fcecf2;
  color: #9a4d6a;
}

.entry-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8f4f7;
  border: 1px solid var(--line);
}

.entry-block.med-block {
  background: linear-gradient(145deg, #f4f0fa, #faf7fc);
  border-color: rgba(140, 120, 180, 0.25);
}

.optional-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-left: 4px;
}

.muted.sm.tight {
  margin: 0;
}

.tl-cell.med {
  background: #f6f2fb;
  border: 1px solid rgba(140, 120, 180, 0.3);
  margin-right: 6px;
}

.tl-cell.med time {
  color: #7a6a9a;
}

.split-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.tl-day-label {
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(184, 217, 239, 0.35), rgba(243, 198, 212, 0.3));
  position: sticky;
  top: 0;
  z-index: 1;
}

.tl-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.tl-col-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: 8px;
  text-align: center;
}

.tl-col-head.food {
  background: #e8f2fa;
  color: #3f6f8f;
}

.tl-col-head.symptom {
  background: #fcecf2;
  color: #9a4d6a;
}

.tl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
  position: relative;
}

.tl-row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
  opacity: 0.7;
}

.tl-cell {
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.88rem;
  min-height: 44px;
}

.tl-cell.food {
  background: #f3f8fc;
  border: 1px solid rgba(126, 182, 217, 0.25);
  margin-right: 6px;
}

.tl-cell.symptom {
  background: #fdf5f8;
  border: 1px solid rgba(232, 160, 181, 0.3);
  margin-left: 6px;
}

.tl-cell.empty {
  background: transparent;
  border: none;
  min-height: 0;
}

.tl-cell time {
  display: block;
  font-weight: 800;
  font-size: 0.78rem;
  color: #5a8fb3;
  margin-bottom: 2px;
}

.tl-cell.symptom time {
  color: #c98eaa;
}

.tl-cell p {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  font-size: 0.86rem;
}

.tl-cell .at-work {
  color: var(--muted);
  font-weight: 700;
  font-style: italic;
}

/* Analysis + saved reports */
.analysis-body h4,
.analysis-body .soft-h {
  margin: 14px 0 6px;
  font-size: 0.95rem;
}

.tol-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.tol-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8f4f7;
  border-left: 4px solid var(--line);
}

.tol-row.best {
  background: var(--good);
  border-left-color: #6faf90;
}

.tol-row.ok {
  background: #fff6e5;
  border-left-color: #e0b35a;
}

.tol-row.avoid {
  background: #fdecef;
  border-left-color: #d97a92;
}

.tol-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  margin-top: 2px;
}

.tol-row.best .tol-badge {
  color: #2f6b52;
  background: rgba(255, 255, 255, 0.85);
}

.tol-row.ok .tol-badge {
  color: #8a6420;
}

.tol-row.avoid .tol-badge {
  color: #a04460;
}

.tol-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tol-main strong {
  font-size: 0.95rem;
}

.tol-note {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  font-style: italic;
}

.period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.period-chip {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
}

.period-chip.best {
  background: var(--good);
  color: #2f6b52;
}

.period-chip.ok {
  background: #fff0d4;
  color: #8a6420;
}

.period-chip.avoid {
  background: #fde8d8;
  color: #9a4d3a;
}

.guide-meta {
  margin: 0 0 10px;
}

/* Tab label can be two words — slightly tighter */
.tab span:not(.tab-icon) {
  line-height: 1.1;
  max-width: 100%;
  text-align: center;
}

.text-btn {
  border: none;
  background: none;
  color: #5a8fb3;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.grow {
  flex: 1;
}

.voice-bar {
  background: linear-gradient(135deg, #eef7fc, #fdf0f5);
  border-radius: 16px;
  padding: 12px;
}

.mic-btn {
  width: 100%;
  border: 1px dashed #c9a0b4;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: var(--ink);
}

.mic-btn[aria-pressed="true"] {
  border-style: solid;
  border-color: #e07090;
  background: #fff0f4;
  color: #b44568;
}

.mic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c98eaa;
  flex-shrink: 0;
}

.mic-btn[aria-pressed="true"] .mic-dot {
  background: #e04070;
  box-shadow: 0 0 0 6px rgba(224, 64, 112, 0.15);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 10px rgba(224, 64, 112, 0.08);
  }
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tab-h) + 16px);
  transform: translateX(-50%);
  z-index: 30;
  background: #3d3a45;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* Legend */
.legend {
  background: rgba(255, 252, 254, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.legend h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.legend h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.legend ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.legend li {
  margin-bottom: 6px;
}

.legend p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.path {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 8px !important;
  color: var(--ink) !important;
  word-break: break-all;
}

.device.wide .app {
  border-radius: 20px;
}

.device.wide .topbar {
  padding-top: 18px;
}

/* ��� Live app (full viewport, no mockup chrome) ��� */
html, body.app-live {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #fbf7fa 0%, #f3f8fc 100%);
}

body.app-live {
  margin: 0;
}

body.app-live .app {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

body.app-live .shell {
  height: 100%;
}

body.app-live .topbar {
  padding-top: max(12px, env(safe-area-inset-top));
}

body.app-live .content {
  padding-bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom));
}

body.app-live .tabbar {
  padding-bottom: env(safe-area-inset-bottom);
}

body.app-live .screen {
  min-height: 100%;
  overflow: auto;
}

#login-status {
  min-height: 1.2em;
  color: var(--blue-deep);
  font-weight: 700;
}
