:root {
  --bg: #0c1a14;
  --ink: #f3f7f4;
  --mist: rgba(243, 247, 244, 0.7);
  --accent: #e8c15a;
  --clay: #c45c2a;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(16, 38, 28, 0.88);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Author CSS display rules must not override the hidden attribute */
[hidden] { display: none !important; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -18px) scale(1.06); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 16px); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body {
  min-height: 100vh;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #0c1a14;
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: min(70vw, 420px);
  height: min(70vw, 420px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(4px);
}
body::before {
  top: -12%;
  right: -8%;
  background: rgba(196, 92, 42, 0.22);
  animation: drift 16s ease-in-out infinite;
}
body::after {
  bottom: 8%;
  left: -12%;
  background: rgba(232, 193, 90, 0.12);
  animation: drift2 18s ease-in-out infinite;
}

.top, .app-nav, .auth, .dash {
  position: relative;
  z-index: 1;
}

.top {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(12, 26, 20, 0.72);
  animation: rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.65rem; letter-spacing: 0.05em;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--accent); }
.ai-pill {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); padding: 0.35rem 0.65rem; color: var(--mist);
  transition: border-color 0.25s, color 0.25s, transform 0.2s;
}
.ai-pill::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #7a9184;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.ai-pill.on { border-color: var(--accent); color: var(--accent); }
.ai-pill.on::before { background: var(--accent); }
.ai-pill:hover { transform: scale(1.03); }
.linkish {
  background: none; border: none; color: var(--mist); cursor: pointer; font: inherit;
  transition: color 0.2s;
}
.linkish:hover { color: var(--accent); }
.lang-pick select {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
}

.eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem;
}
h1, h2 { font-family: "Bebas Neue", sans-serif; letter-spacing: 0.02em; line-height: 0.98; }
h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); margin-bottom: 0.6rem; max-width: 14ch; }
h2 { font-size: 1.7rem; margin-bottom: 0.75rem; }
.lede { color: var(--mist); line-height: 1.45; margin-bottom: 1rem; max-width: 36rem; }

.auth { display: grid; place-items: center; padding: 2.5rem 1rem; min-height: calc(100vh - 4rem); }
.auth-card {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid rgba(232, 193, 90, 0.22);
  padding: 1.75rem;
  animation: rise-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.tabs { display: flex; gap: 0.4rem; margin: 1rem 0; }
.tab {
  font: inherit; font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.05em; border: 1px solid var(--line); background: transparent;
  color: var(--mist); padding: 0.45rem 0.8rem; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.tab:hover { transform: translateY(-1px); border-color: rgba(232,193,90,0.4); }
.tab.is-active { background: var(--clay); border-color: var(--clay); color: #fff; }

.auth-form, .upload-form { display: grid; gap: 0.75rem; }
label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--mist); }
input, select {
  font: inherit; color: var(--ink); background: rgba(0,0,0,0.25);
  border: 1px solid var(--line); padding: 0.6rem 0.7rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(232, 193, 90, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 193, 90, 0.12);
}
.btn {
  font: inherit; font-weight: 700; border: none; padding: 0.7rem 1rem; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px) scale(1.01); filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--clay); color: #fff; }
.btn-google {
  display: block; text-align: center; text-decoration: none;
  background: #fff; color: #1f1f1f; font-weight: 700;
  padding: 0.85rem 1rem; margin-bottom: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.2s;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.25); }
.divider {
  text-align: center; color: var(--mist); font-size: 0.8rem;
  margin: 0.25rem 0 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.form-error { color: #f0a8a0; font-size: 0.9rem; }
.hint { color: var(--mist); font-size: 0.85rem; }

.dash { padding: 1.25rem; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.15rem;
  animation: rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.18s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:hover {
  border-color: rgba(232, 193, 90, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}
.card.wide { grid-column: 1 / -1; }
.preview {
  width: 100%; max-height: 220px; background: #000; object-fit: contain;
}
.list { display: grid; gap: 0.65rem; max-height: 420px; overflow: auto; }
.item {
  border: 1px solid var(--line);
  padding: 0.75rem;
  display: grid; gap: 0.25rem;
  transition: border-color 0.2s, background 0.2s;
}
.item:hover {
  border-color: rgba(232, 193, 90, 0.35);
  background: rgba(232, 193, 90, 0.04);
}
.item strong { text-transform: capitalize; }
.item .meta { color: var(--mist); font-size: 0.85rem; }
.score { color: var(--accent); font-family: "Bebas Neue", sans-serif; font-size: 1.4rem; }

.row-between { display: flex; justify-content: space-between; gap: 1rem; align-items: start; flex-wrap: wrap; }
.plan-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}
.day {
  border: 1px solid var(--line);
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s, transform 0.2s;
  animation: rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.day:hover { border-color: rgba(232,193,90,0.4); transform: translateY(-2px); }
.day b { display: block; color: var(--accent); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.day h3 { font-family: "Instrument Sans", sans-serif; font-size: 1rem; margin: 0.25rem 0 0.4rem; }
.day ul { margin-left: 1rem; color: var(--mist); font-size: 0.88rem; }
.day .cue { margin-top: 0.4rem; font-size: 0.88rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
textarea {
  font: inherit; color: var(--ink); background: rgba(0,0,0,0.25);
  border: 1px solid var(--line); padding: 0.6rem 0.7rem; resize: vertical;
  min-height: 5rem;
}
.ratings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.ratings label { font-size: 0.8rem; }
.auth-switch { margin-top: 1rem; color: var(--mist); font-size: 0.95rem; }
.auth-switch a { color: var(--accent); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.app-nav {
  display: flex; gap: 0.5rem; padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(12, 26, 20, 0.72);
  animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.app-nav a {
  color: var(--mist); text-decoration: none; font-weight: 700; font-size: 0.9rem;
  padding: 0.45rem 0.8rem; border: 1px solid var(--line);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.app-nav a:hover { transform: translateY(-1px); border-color: rgba(232,193,90,0.45); }
.app-nav a.is-active {
  color: #0c1a14; background: var(--accent); border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 800px) {
  .dash-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

.memory-card {
  border: 1px solid rgba(232,193,90,0.28);
  background: rgba(232,193,90,0.06);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.plan-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.55rem;
  margin: 1rem 0 0.5rem;
}
.cal-cell {
  min-height: 5.6rem;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  justify-items: start;
  gap: 0.35rem;
  padding: 0.65rem 0.7rem;
  text-align: left;
  transition: border-color 0.2s, transform 0.15s;
}
.cal-cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.cal-cell.ready { border-color: rgba(232,193,90,0.55); background: rgba(232,193,90,0.07); }
.cal-cell .cal-day {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.cal-cell .cal-summary {
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cal-cell .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: block;
  margin-top: auto;
}
.cal-cell.ready .dot { background: var(--accent); }
.back-day { margin-bottom: 0.75rem; color: var(--accent); }
.timeline { display: grid; gap: 0.65rem; margin: 1rem 0; }
.timeline-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.timeline-copy { min-width: 0; display: grid; gap: 0.35rem; }
.timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.timeline-copy p { margin: 0; line-height: 1.45; color: var(--ink); }
.listen-btn, #listen-hour {
  border: 1px solid rgba(182, 243, 107, 0.35);
  background: rgba(182, 243, 107, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.timeline-actions { margin-bottom: 0.35rem; }
.timeline-row.is-speaking {
  border-radius: 16px;
  background: rgba(182, 243, 107, 0.08);
  padding: 0.55rem;
}
#listen-hour.is-speaking,
.listen-btn.is-speaking {
  color: #08111f;
  background: var(--accent);
}
.time-badge {
  min-width: 2.6rem;
  text-align: center;
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(232,193,90,0.35);
  background: rgba(232,193,90,0.12);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.75rem;
}
.day-body { display: grid; gap: 0.55rem; margin-bottom: 1.25rem; }
.partner-box {
  background: var(--accent);
  color: #0c1a14;
  font-weight: 700;
  padding: 0.75rem 0.9rem;
}
.chat-panel {
  border: 1px solid rgba(232,193,90,0.3);
  background: rgba(16,38,28,0.9);
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}
.chat-log {
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.55rem;
}
.bubble {
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  max-width: 92%;
}
.bubble.user {
  margin-left: auto;
  width: fit-content;
  align-self: flex-end;
  background: rgba(196,92,42,0.2);
  border-color: rgba(196,92,42,0.45);
}
.bubble.ai {
  background: rgba(232,193,90,0.08);
  border-color: rgba(232,193,90,0.28);
}
.bubble-role {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.bubble-text { line-height: 1.45; font-size: 0.95rem; }
.chat-compose { display: flex; gap: 0.5rem; }
.chat-compose input { flex: 1; }
.video-chips { display: grid; gap: 0.35rem; margin-top: 0.5rem; }
.video-chip {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.video-chip:hover { text-decoration: underline; }

/* 2026 redesign — shared visual language with the mobile app */
:root {
  --bg: #f4f7f5;
  --ink: #14221b;
  --mist: #5d6e64;
  --accent: #1f7a45;
  --accent-soft: rgba(31, 122, 69, 0.1);
  --clay: #1f7a45;
  --line: rgba(20, 34, 27, 0.1);
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --danger: #b42318;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow: 0 16px 40px rgba(20, 34, 27, 0.08);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(117, 167, 255, 0.17), transparent 32rem),
    radial-gradient(circle at 4% 92%, rgba(182, 243, 107, 0.08), transparent 30rem),
    linear-gradient(145deg, #101b31 0%, #08111f 42%, #070d18 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  width: min(55vw, 620px);
  height: min(55vw, 620px);
  filter: blur(70px);
  opacity: 0.55;
}

body::before {
  top: -24rem;
  right: -18rem;
  background: rgba(117, 167, 255, 0.22);
}

body::after {
  bottom: -26rem;
  left: -18rem;
  background: rgba(182, 243, 107, 0.12);
}

.app {
  min-height: 100vh;
}

.top {
  min-height: 74px;
  padding: 0.9rem clamp(1.25rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 31, 0.72);
  backdrop-filter: blur(24px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.brand span {
  color: var(--accent);
}

.ai-pill {
  border-color: rgba(182, 243, 107, 0.17);
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  color: var(--mist);
  background: rgba(182, 243, 107, 0.055);
}

.ai-pill::before {
  background: #6f7f99;
  box-shadow: 0 0 0 4px rgba(111, 127, 153, 0.12);
}

.ai-pill.on {
  color: var(--accent);
  border-color: rgba(182, 243, 107, 0.3);
}

.ai-pill.on::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 243, 107, 0.12);
}

.top-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ai-pill {
  margin-left: 0;
}

.account-signin {
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}

.account {
  position: relative;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 220px;
  padding: 0.22rem 0.7rem 0.22rem 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.account-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  color: var(--bg);
  background: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

.avatar-xl {
  width: 92px;
  height: 92px;
  font-size: 1.8rem;
  border: 3px solid rgba(182, 243, 107, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.account-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 0.15rem;
  width: min(280px, 78vw);
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(14, 18, 26, 0.96);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
}

.account-menu[hidden] {
  display: none;
}

.account-menu-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.25rem;
  padding: 0.55rem 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.account-menu-head strong,
.account-menu-head span {
  display: block;
}

.account-menu-head span {
  margin-top: 0.15rem;
  color: var(--mist);
  font-size: 0.8rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.account-menu a,
.account-menu button {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover,
.account-menu a.is-active {
  background: rgba(255, 255, 255, 0.07);
}

.account-menu .menu-logout {
  color: #f0a8a0;
}

.linkish {
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
}

.linkish:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.auth {
  min-height: calc(100vh - 74px);
  padding: clamp(2rem, 7vw, 6rem) 1.25rem;
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid #e3ebe6;
  border-radius: 20px;
  padding: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 34, 27, 0.06);
  overflow: hidden;
  position: relative;
}

.auth-card::before,
.auth-card::after {
  display: none;
}

.auth-card h1,
.auth-card .lede,
.auth-card .hint {
  color: var(--ink);
}

.auth-card .lede,
.auth-card .hint {
  color: var(--mist);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2 {
  font-family: "Instrument Sans", system-ui, sans-serif;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

h1 {
  max-width: none;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
}

.lede {
  color: var(--mist);
  line-height: 1.65;
}

.btn {
  min-height: 46px;
  border-radius: 14px;
  padding: 0.8rem 1.15rem;
  font-weight: 800;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: none;
}

.btn-primary {
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(182, 243, 107, 0.13);
}

.btn-primary:hover:not(:disabled) {
  background: #c5ff7e;
  box-shadow: 0 14px 32px rgba(182, 243, 107, 0.2);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  color: #14221b;
  background: #fff;
  border: 1px solid #d7e2db;
  box-shadow: none;
}

.btn-google:hover {
  background: #f4f7f5;
  transform: none;
  box-shadow: none;
}

.auth-switch a {
  color: var(--accent);
}

.app-nav {
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 1.25rem auto 0;
  padding: 0.35rem;
  gap: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 28, 46, 0.88);
  backdrop-filter: blur(20px);
}

.app-nav a {
  min-width: 94px;
  padding: 0.62rem 1rem;
  border: 0;
  border-radius: 999px;
  text-align: center;
  color: var(--mist);
}

.app-nav a:hover {
  transform: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.app-nav a.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(182, 243, 107, 0.14);
}

.dash {
  padding: clamp(1.25rem, 4vw, 3rem);
}

.dash-grid {
  max-width: 1180px;
  gap: 1.25rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.022), transparent 44%),
    var(--panel);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(18px);
}

.card:hover {
  border-color: rgba(182, 243, 107, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
  transform: translateY(-3px);
}

.upload-form {
  gap: 1rem;
}

label {
  gap: 0.45rem;
  color: var(--mist);
  font-size: 0.8rem;
  font-weight: 600;
}

input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: rgba(8, 17, 31, 0.62);
  padding: 0.72rem 0.85rem;
}

select option {
  color: var(--ink);
  background: var(--panel-solid);
}

input::placeholder,
textarea::placeholder {
  color: #65758e;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(182, 243, 107, 0.52);
  box-shadow: 0 0 0 4px rgba(182, 243, 107, 0.08);
}

.memory-card {
  border-color: rgba(117, 167, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(117, 167, 255, 0.07);
  padding: 1rem 1.1rem;
}

.preview {
  border-radius: var(--radius-md);
}

.list {
  gap: 0.8rem;
}

.item {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: rgba(8, 17, 31, 0.34);
  padding: 1rem;
}

.item:hover {
  border-color: rgba(182, 243, 107, 0.22);
  background: rgba(182, 243, 107, 0.04);
}

.item a,
.video-chip {
  color: var(--accent);
}

.score {
  color: var(--accent);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-weight: 800;
}

.cal-grid {
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.75rem;
}

.cal-cell {
  min-height: 7rem;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: rgba(8, 17, 31, 0.48);
  padding: 0.85rem;
}

.cal-cell:hover {
  border-color: rgba(117, 167, 255, 0.62);
  background: rgba(117, 167, 255, 0.07);
  transform: translateY(-3px);
}

.cal-cell.ready {
  border-color: rgba(182, 243, 107, 0.32);
  background: var(--accent-soft);
}

.cal-cell .cal-day {
  color: var(--accent);
}

.cal-cell .cal-summary {
  color: var(--ink);
}

.cal-cell.ready .dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 243, 107, 0.1);
}

.time-badge {
  border-color: rgba(182, 243, 107, 0.22);
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

.partner-box {
  border-radius: 14px;
  color: var(--bg);
  background: var(--accent);
}

.chat-panel {
  border-color: rgba(117, 167, 255, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(8, 17, 31, 0.4);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.bubble {
  border-radius: 16px;
}

.bubble.user {
  border-color: rgba(117, 167, 255, 0.28);
  background: rgba(117, 167, 255, 0.12);
}

.bubble.ai {
  border-color: rgba(182, 243, 107, 0.2);
  background: rgba(182, 243, 107, 0.07);
}

.bubble-role {
  color: var(--accent);
}

.form-error {
  color: var(--danger);
}

@media (max-width: 800px) {
  .top {
    min-height: 64px;
    padding-inline: 1rem;
  }

  .brand {
    font-size: 1.25rem;
  }

  .ai-pill {
    font-size: 0;
    gap: 0;
    padding: 0.55rem;
  }

  .account-name,
  .account-caret {
    display: none;
  }

  .account-btn {
    padding: 0.18rem;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-hero .home-hero-actions {
    grid-column: 1 / -1;
  }

  .app-nav {
    position: sticky;
    top: 74px;
    z-index: 8;
  }

  .app-nav a {
    min-width: 78px;
    padding-inline: 0.8rem;
  }

  .dash {
    padding: 1.1rem;
  }

  .card {
    border-radius: 22px;
    padding: 1.2rem;
  }

  .row-between {
    display: grid;
  }

  .plan-actions,
  .plan-actions .btn {
    width: 100%;
  }

  .chat-compose {
    align-items: stretch;
  }

  .chat-compose .btn {
    min-width: 68px;
  }

  .chat-shell { grid-template-columns: 1fr; }
}

.chat-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}
.chat-threads { display: grid; gap: 0.4rem; }
.chat-thread {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  color: inherit;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
}
.chat-thread.active { border-color: var(--accent); }
.chat-thread-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}
.chat-thread-meta { font-size: 0.7rem; color: var(--mist); }
.chat-thread-delete {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--mist);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}
.chat-main { display: grid; gap: 0.55rem; min-width: 0; }
.chat-attach-preview { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chat-attach-preview img,
.chat-attach-preview video {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.attach-chip { position: relative; }
.attach-chip button {
  position: absolute;
  top: 2px;
  right: 2px;
  border: 0;
  background: #0c1a14;
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 0.3rem;
}
.bubble-media { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.45rem; }
.bubble-media img,
.bubble-media video {
  max-width: 220px;
  max-height: 160px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Surface polish: calmer cards, chat, and calendar */
.card:hover {
  transform: none;
}

.profile-form {
  max-width: 760px;
}

.stroke-takes {
  display: grid;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.stroke-take {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.stroke-take-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dev-detail-label {
  display: grid;
  gap: 0.35rem;
}

.dev-detail {
  min-height: 22rem;
  height: min(55vh, 32rem);
  resize: vertical;
  font-size: 0.98rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.dev-preview .btn {
  justify-self: start;
}

.dev-content-type {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.dev-content-type select {
  width: min(100%, 28rem);
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}

.dev-cut-progress {
  display: grid;
  gap: 0.45rem;
}

.dev-cut-progress[hidden] {
  display: none !important;
}

.dev-cut-bar {
  height: 0.55rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.dev-cut-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent, #c8f05f);
  transition: width 0.25s ease;
}

.dev-review {
  display: grid;
  gap: 0.85rem;
}

.dev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.dev-actions .btn:not(.btn-primary) {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mist);
}

.dev-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dev-task-board {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.dev-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dev-task-head .eyebrow {
  margin: 0;
}

.dev-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.dev-task-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dev-task-list .meta {
  color: var(--mist);
  font-size: 0.85rem;
}

.dev-task-list .badge {
  display: inline-block;
  margin-left: 0.45rem;
  margin-right: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--mist);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dev-task-list .badge-active {
  border-color: rgba(232, 193, 90, 0.55);
  color: var(--accent);
}

.dev-task-list .badge-error {
  border-color: rgba(224, 122, 106, 0.55);
  color: #e07a6a;
}

.dev-task-list .badge-done {
  opacity: 0.7;
}

.dev-task-list .meta.err {
  color: #e07a6a;
}

.dev-task-item.is-done {
  opacity: 0.72;
}

.dev-work-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.dev-work-head .linkish {
  justify-self: start;
}

.dev-preview video {
  width: 100%;
  max-height: 22rem;
  background: #000;
  pointer-events: auto;
}

.dev-drop {
  display: none !important;
}

.dev-log {
  max-height: 16rem;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.4;
}

.intake-drop {
  position: relative;
  display: grid;
  gap: 0.35rem;
  place-items: center;
  text-align: center;
  padding: 1.75rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--line, #c9d2c0) 90%, transparent);
  border-radius: 14px;
  cursor: pointer;
  background: color-mix(in srgb, var(--card, #fffdf8) 88%, #e8efe3);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.intake-drop strong {
  font-size: 1.05rem;
}

.intake-drop span {
  color: var(--muted, #5c6754);
  font-size: 0.9rem;
}

.intake-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.intake-drop.is-over {
  border-color: var(--green, #2f6b3a);
  background: color-mix(in srgb, var(--green, #2f6b3a) 10%, transparent);
}

.intake-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.intake-files li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper, #f6f4ee) 70%, #fff);
}

.intake-stats {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--line, #c9d2c0) 70%, transparent);
}

.intake-stats-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}

.intake-stats-head .eyebrow {
  margin: 0;
}

.intake-stats #intake-stats-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green, #2f6b3a);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.intake-stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.intake-stats-list li {
  display: grid;
  gap: 0.2rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper, #f6f4ee) 70%, #fff);
  font-size: 0.9rem;
}

.intake-stats-list li > span:first-child {
  grid-column: 1;
}

.intake-stats-list li {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.intake-stats-list .meta {
  grid-column: 1 / -1;
  color: var(--muted, #5c6754);
  font-size: 0.82rem;
}

.intake-stats-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #5c6754);
  white-space: nowrap;
}

.intake-stats-badge.is-ready {
  color: var(--green, #2f6b3a);
}

.intake-stats-badge.is-error {
  color: #e07a6a;
}

.intake-stats-badge.is-cutting,
.intake-stats-badge.is-analyzing {
  color: #b07a2a;
}

.stroke-take.is-done strong::after {
  content: " · saved";
  font-weight: 500;
}

.plan-actions .btn {
  min-width: 9.5rem;
}

.dash-grid {
  max-width: 1320px;
}

.card.wide,
.wide { grid-column: 1 / -1; }

.plan-stage {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.plan-stage:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: stretch;
  height: calc(100vh - 210px);
  min-height: 520px;
}

.plan-board {
  min-width: 0;
  max-height: 100%;
  overflow: auto;
}

.plan-board .plan-actions {
  margin: 0 0 1rem;
}

.coach-panel {
  position: relative;
  top: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(17, 28, 46, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.coach-panel-head {
  flex: 0 0 auto;
  margin-bottom: 0.65rem;
}

.coach-panel-head .hint {
  margin: 0;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.chat-threads {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  max-height: 132px;
  overflow: auto;
  flex: 0 0 auto;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.45);
}

.chat-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.chat-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.38);
}

.chat-compose {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.72);
}

.chat-compose input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 42px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#chat-attach {
  width: 42px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

#chat-send {
  padding-inline: 0.85rem;
}

.bubble.ai {
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
  background: rgba(182, 243, 107, 0.08);
  border-color: rgba(182, 243, 107, 0.22);
}

.bubble.user {
  background: rgba(117, 167, 255, 0.14);
  border-color: rgba(117, 167, 255, 0.32);
}

.coach-panel-head {
  margin-bottom: 0.7rem;
}

.coach-panel-head .hint {
  margin: 0;
}

.chat-panel {
  display: contents;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  flex: 1;
}

.chat-threads {
  align-content: start;
  gap: 0.45rem;
  max-height: 148px;
  overflow: auto;
  flex: 0 0 auto;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 17, 31, 0.45);
}

.chat-threads .btn {
  width: 100%;
}

.chat-thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 0.25rem;
  align-items: center;
}

.chat-thread {
  width: 100%;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.65rem 0.7rem;
  transition: background 0.15s, border-color 0.15s;
}

.chat-thread:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-thread.active {
  border-color: rgba(182, 243, 107, 0.38);
  background: rgba(182, 243, 107, 0.1);
}

.chat-thread-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-delete {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mist);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.chat-thread-delete:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.chat-main {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.chat-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 17, 31, 0.38);
}

.chat-log .bubble {
  flex: 0 0 auto;
  height: auto;
}

.bubble {
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
}

.chat-compose {
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.62);
}

.chat-compose input {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.chat-compose input:focus {
  border-color: transparent;
  box-shadow: none;
}

.chat-compose .btn {
  flex: 0 0 auto;
}

#chat-attach {
  width: 42px;
  min-width: 42px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.chat-attach-preview img,
.chat-attach-preview video {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

.attach-chip button {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0;
}

.cal-grid {
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
}

.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  border-radius: 18px;
  gap: 0.2rem;
}

.cal-kicker {
  margin-top: 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}

.cal-cell .cal-line {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-grid {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
}

.lesson-card {
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.lesson-card .eyebrow {
  margin: 0 0 0.25rem;
}

.lesson-card p:last-child {
  margin: 0;
  line-height: 1.45;
}

.cal-cell .cal-day {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.cal-cell .cal-summary {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
}

.cal-cell .dot {
  margin-top: 0.15rem;
}

.timeline-row,
.day-body p,
.day-body li {
  line-height: 1.5;
}

@media (max-width: 980px) {
  .plan-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .plan-board {
    max-height: none;
    overflow: visible;
  }

  .coach-panel {
    position: static;
    height: min(70vh, 640px);
    max-height: min(70vh, 640px);
    min-height: 420px;
  }

  .chat-threads {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .chat-threads .btn,
  .chat-thread-row {
    flex: 0 0 auto;
    min-width: 9rem;
  }

  .chat-log {
    min-height: 280px;
  }
}

/* Keep the coach ask box inside the window on the plan page. */
.app:has([data-dash-section="plan"]:not([hidden])) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app:has([data-dash-section="plan"]:not([hidden])) .dash {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 1rem;
}

.app:has([data-dash-section="plan"]:not([hidden])) .dash-grid {
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

.app:has([data-dash-section="plan"]:not([hidden])) .plan-stage {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app:has([data-dash-section="plan"]:not([hidden])) .plan-layout {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: 100%;
}

.app:has([data-dash-section="plan"]:not([hidden])) .coach-panel,
.app:has([data-dash-section="plan"]:not([hidden])) .chat-shell,
.app:has([data-dash-section="plan"]:not([hidden])) .chat-main {
  min-height: 0;
}

#chat-error {
  flex: 0 0 auto;
  margin: 0;
}

.chat-compose {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
}

#chat-mic {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

#chat-mic svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

#chat-mic.is-listening {
  color: #08111f;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 243, 107, 0.18);
}

#chat-send {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .app:has([data-dash-section="plan"]:not([hidden])) {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .app:has([data-dash-section="plan"]:not([hidden])) .dash,
  .app:has([data-dash-section="plan"]:not([hidden])) .dash-grid,
  .app:has([data-dash-section="plan"]:not([hidden])) .plan-stage,
  .app:has([data-dash-section="plan"]:not([hidden])) .plan-layout {
    height: auto;
    overflow: visible;
  }

  .chat-compose {
    position: sticky;
    bottom: 0.5rem;
  }
}

.plan-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.coach-panel,
.chat-shell,
.chat-main,
.chat-compose {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.chat-shell {
  display: flex;
  flex-direction: column;
}

.chat-compose input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

#coach-panel {
  padding: 0;
  background:
    linear-gradient(180deg, rgba(182, 243, 107, 0.08), transparent 7rem),
    #0c1628;
}

#coach-panel .coach-panel-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.9rem 0.95rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

#coach-panel .coach-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #08111f;
  font-weight: 800;
}

#coach-panel .chat-head-copy {
  flex: 1;
  min-width: 0;
}

#coach-panel .chat-head-copy .eyebrow,
#coach-panel .chat-head-copy .hint {
  margin: 0;
}

#coach-panel .chat-head-copy .hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#coach-panel .chat-shell {
  position: relative;
  gap: 0;
}

#coach-panel .chat-threads {
  display: none;
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0.7rem;
  right: 0.7rem;
  max-height: 240px;
  padding: 0.55rem;
  border-radius: 18px;
  background: #121d31;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

#coach-panel .chat-threads.is-open {
  display: grid;
}

#coach-panel .chat-main {
  gap: 0.4rem;
  padding: 0 0.15rem;
}

#coach-panel .chat-log {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.9rem 0.85rem 0.4rem;
  gap: 0.7rem;
}

#coach-panel .chat-empty {
  margin: auto;
  max-width: 14rem;
  text-align: center;
  color: var(--mist);
}

#coach-panel .chat-empty p {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-weight: 700;
}

#coach-panel .bubble {
  width: fit-content;
  max-width: min(88%, 18rem);
  border: 0;
  border-radius: 18px;
  padding: 0.65rem 0.8rem;
  box-shadow: none;
}

#coach-panel .bubble-role {
  display: none;
}

#coach-panel .bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}

#coach-panel .bubble.user {
  align-self: flex-end;
  margin-left: auto;
  background: var(--accent);
  color: #08111f;
  border-bottom-right-radius: 6px;
}

#coach-panel .bubble.user .bubble-text,
#coach-panel .bubble.user .video-chip {
  color: #08111f;
}

#coach-panel .chat-attach-preview {
  padding: 0 0.85rem;
}

#coach-panel .chat-compose {
  width: auto;
  max-width: none;
  align-self: stretch;
  margin: 0.35rem 0.85rem 0.9rem;
  padding: 0.28rem 0.28rem 0.28rem 0.35rem;
  border-radius: 999px;
  background: rgba(8, 17, 31, 0.72);
}

#coach-panel .chat-icon,
#coach-panel .chat-send {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
}

#coach-panel .chat-icon svg,
#coach-panel .chat-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

#coach-panel #chat-chats {
  width: auto;
  min-width: 0;
  height: 32px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

#coach-panel #chat-chats[aria-expanded="true"] {
  color: #08111f;
  background: var(--accent);
  border-color: var(--accent);
}

#coach-panel .chat-send {
  color: #08111f;
  background: var(--accent);
}

#coach-panel #chat-mic.is-listening {
  color: #08111f;
  background: var(--accent);
}

#coach-panel #chat-error {
  margin: 0 0.9rem;
}

.camera-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 8, 16, 0.72);
}

.camera-card {
  width: min(520px, 100%);
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #0c1628;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.camera-head .eyebrow {
  margin: 0;
}

#camera-live {
  width: 100%;
  max-height: 56vh;
  border-radius: 16px;
  background: #05080f;
  object-fit: cover;
}

.camera-actions {
  display: flex;
  gap: 0.5rem;
}

.camera-actions .btn {
  flex: 1;
}

#camera-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
}

/* Muscle Monster–style onboarding quiz */
.onboard {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.onboard-shell {
  width: min(520px, 100%);
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 1.15rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: rgba(16, 20, 28, 0.78);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.onboard-grid {
  display: grid;
  gap: 0.6rem;
}

.onboard-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.onboard-choice strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.onboard-choice span {
  color: var(--mist);
  font-size: 0.86rem;
}

.onboard-choice.is-on {
  border-color: rgba(182, 243, 107, 0.75);
  background: rgba(182, 243, 107, 0.14);
}

.onboard-choice-icon {
  display: none;
}

.onboard-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.onboard-back {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}

.onboard-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.onboard-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9ae84f, var(--accent));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 18px rgba(182, 243, 107, 0.35);
}

.onboard-count {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.onboard-stage {
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
  animation: rise-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.onboard-stage.is-swap {
  animation: onboard-swap 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes onboard-swap {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboard-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.onboard-title {
  font-size: clamp(1.85rem, 5vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 0.55rem;
}

.onboard-sub {
  color: var(--mist);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.onboard-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.5rem 0.5rem 0.5rem;
}

.onboard-hero-icon {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-size: 2.4rem;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(182, 243, 107, 0.28);
  margin-bottom: 0.35rem;
}

.onboard-hero .onboard-title {
  max-width: 14ch;
}

.onboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.onboard-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.onboard-choice:hover {
  border-color: rgba(182, 243, 107, 0.4);
}

.onboard-choice.is-on {
  border-color: rgba(182, 243, 107, 0.8);
  background: rgba(182, 243, 107, 0.14);
}

.onboard-choice-icon {
  display: none;
}

.onboard-choice.is-on .onboard-choice-icon {
  background: var(--accent);
  color: var(--bg);
}

.onboard-choice strong {
  font-size: 0.95rem;
  font-weight: 800;
}

.onboard-choice span {
  color: var(--mist);
  font-size: 0.8rem;
  line-height: 1.35;
}

.onboard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.onboard-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(8, 17, 31, 0.55);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.onboard-chip:hover {
  border-color: rgba(182, 243, 107, 0.4);
}

.onboard-chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.onboard-stroke-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.onboard-stroke-row {
  display: grid;
  gap: 0.4rem;
}

.onboard-stroke-name {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.onboard-stroke-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.onboard-field {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.onboard-field label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.onboard-field input,
.onboard-field textarea {
  width: 100%;
}

.onboard-boost {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  padding: 2rem 0.5rem;
}

.onboard-boost-badge {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(182, 243, 107, 0.12);
  border: 1px solid rgba(182, 243, 107, 0.35);
  color: var(--accent);
  font-size: 2rem;
}

.onboard-build {
  display: grid;
  gap: 1.1rem;
  justify-items: center;
  text-align: center;
  padding: 2.2rem 0.5rem;
}

.onboard-spinner {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 3px solid rgba(182, 243, 107, 0.18);
  border-top-color: var(--accent);
  animation: onboard-spin 0.9s linear infinite;
}

@keyframes onboard-spin {
  to { transform: rotate(360deg); }
}

.onboard-build-list {
  width: min(320px, 100%);
  display: grid;
  gap: 0.55rem;
  text-align: left;
}

.onboard-build-list li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--mist);
  font-size: 0.92rem;
  font-weight: 600;
}

.onboard-build-list li.is-done {
  color: var(--ink);
}

.onboard-build-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.onboard-build-list li.is-done::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 243, 107, 0.12);
}

.onboard-summary {
  display: grid;
  gap: 0.75rem;
}

.onboard-stat {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.5);
}

.onboard-stat b {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.onboard-stat strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.onboard-stat span {
  color: var(--mist);
  font-size: 0.88rem;
  line-height: 1.4;
}

.onboard-footer {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.onboard-footer .btn-primary {
  flex: 1;
}

.onboard-footer .btn-ghost {
  min-width: 96px;
}

.onboard-error {
  text-align: center;
}

.home-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.home-hero h2 {
  margin-bottom: 0.4rem;
}

.home-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.profile-stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: rgba(8, 17, 31, 0.42);
}

.profile-stat b {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.profile-stat strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.profile-stat span {
  color: var(--mist);
  font-size: 0.85rem;
  line-height: 1.4;
}

.profile-edit-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.profile-identity h2 {
  margin-bottom: 0.25rem;
}

.profile-identity .lede {
  margin-bottom: 0.2rem;
}

.profile-language {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.28);
}

.profile-language .hint {
  margin: 0.2rem 0 0;
}

.profile-language .lang-pick select {
  min-width: 160px;
  background: rgba(255, 255, 255, 0.06);
}

.avatar-change {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.avatar-change-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
}

.activity-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.activity-day {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.28);
}

.activity-day.is-today {
  border-color: rgba(182, 243, 107, 0.5);
}

.activity-day b {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}

.activity-bar {
  display: flex;
  align-items: flex-end;
  width: 18px;
  height: 72px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.activity-bar span {
  display: block;
  width: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.activity-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

@media (max-width: 700px) {
  .activity-stats {
    grid-template-columns: 1fr;
  }
}

.community-share {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.community-card {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 17, 31, 0.28);
}

.community-card.is-feature {
  border-color: rgba(182, 243, 107, 0.35);
}

.community-author,
.community-comment {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.community-author span,
.community-comment span {
  display: block;
  color: var(--mist);
  font-size: 0.8rem;
}

.community-video {
  width: 100%;
  max-height: 420px;
  border-radius: 16px;
  background: #000;
}

.community-advice {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(182, 243, 107, 0.08);
}

.community-advice p:last-child {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.community-like {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.community-like.is-on {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.community-comments {
  display: grid;
  gap: 0.7rem;
}

.community-comment {
  align-items: flex-start;
}

.community-comment p {
  margin: 0.15rem 0 0;
}

.community-comment-form {
  display: flex;
  gap: 0.5rem;
}

.community-comment-form input {
  flex: 1;
}

.community-empty {
  padding: 0.4rem 0 0.2rem;
}

.profile-notes {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.28);
}

.profile-notes p:last-child {
  margin: 0;
  color: var(--mist);
  line-height: 1.55;
  white-space: pre-wrap;
}

.stroke-takes,
.analyzer-library {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .onboard-shell {
    min-height: calc(100vh - 110px);
    border-radius: 22px;
  }

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

  .onboard-footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent, rgba(17, 28, 46, 0.96) 30%);
    padding-bottom: 0.2rem;
  }
}

/* Professional white + green */
body,
body.is-auth {
  color: var(--ink);
  background: #f4f7f5;
}

body::before,
body::after {
  display: none;
}

body.is-auth::before,
body.is-auth::after {
  display: none;
}

body.is-auth .top {
  position: absolute;
  inset: 0 0 auto 0;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

body.is-auth .auth {
  min-height: 100vh;
  padding: 6.5rem 1.25rem 3rem;
  align-content: center;
}

body.is-auth .auth-card {
  width: min(440px, 100%);
  padding: 2.2rem 2.1rem 1.9rem;
  border: 1px solid #e3ebe6;
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  backdrop-filter: none;
  box-shadow: 0 10px 30px rgba(20, 34, 27, 0.06);
}

body.is-auth .auth-card .eyebrow {
  color: #c45c2a;
}

body.is-auth .auth-card h1,
body.is-auth .auth-card .lede {
  color: #12161c;
}

body.is-auth .auth-card .lede {
  color: rgba(18, 22, 28, 0.72);
}

body.is-auth .auth-card::before,
body.is-auth .auth-card::after {
  display: none;
}

body.is-auth h1 {
  font-size: clamp(3rem, 8vw, 4.4rem);
  margin-bottom: 0.45rem;
}

body.is-auth .lede {
  color: rgba(247, 249, 252, 0.82);
  margin-bottom: 1.4rem;
}

.google-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

body.is-auth .btn-google {
  gap: 0.7rem;
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(18, 22, 28, 0.12);
  color: #1a1a1a;
  background: #fff;
  box-shadow: 0 10px 24px rgba(40, 16, 4, 0.12);
}

body.is-auth .btn-google:hover {
  background: #fff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

body.is-auth #google-hint {
  margin-top: 0.9rem;
  color: rgba(247, 249, 252, 0.78);
}

/* App chrome over the court photo */
body:not(.is-auth)::before,
body:not(.is-auth)::after {
  display: none;
}

body:not(.is-auth) .top {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  width: min(1180px, calc(100% - 1.5rem));
  min-height: 64px;
  margin: 0.75rem auto 0;
  padding: 0.45rem 0.55rem 0.45rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(12, 16, 22, 0.55);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.top .app-nav,
body:not(.is-auth) .top .app-nav {
  position: static;
  top: auto;
  z-index: auto;
  width: auto;
  max-width: none;
  margin: 0 0 0 0.35rem;
  padding: 0.2rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.top .app-nav a {
  min-width: 0;
  padding: 0.42rem 0.85rem;
}

body:not(.is-auth) .dash {
  padding-top: 1.1rem;
}

body:not(.is-auth) .card,
body:not(.is-auth) .onboard-shell,
body:not(.is-auth) .coach-panel,
body:not(.is-auth) #coach-panel,
body:not(.is-auth) .camera-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 16, 24, 0.72);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

body:not(.is-auth) .card:hover {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

body:not(.is-auth) input,
body:not(.is-auth) select,
body:not(.is-auth) textarea {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

body:not(.is-auth) input[type="file"] {
  padding: 0.85rem;
  border-style: dashed;
  border-color: rgba(182, 243, 107, 0.35);
  background: rgba(182, 243, 107, 0.06);
}

body:not(.is-auth) .btn,
body:not(.is-auth) .chat-thread,
body:not(.is-auth) .item,
body:not(.is-auth) .cal-cell,
body:not(.is-auth) .memory-card,
body:not(.is-auth) .profile-stat,
body:not(.is-auth) .onboard-choice,
body:not(.is-auth) .onboard-chip {
  border-radius: 16px;
}

body:not(.is-auth) .home-hero {
  align-items: end;
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.is-auth) .onboard {
  min-height: calc(100vh - 5.5rem);
}

body:not(.is-auth) .onboard-shell {
  border-radius: 32px;
}

@media (max-width: 800px) {
  body:not(.is-auth) .top {
    top: 0.45rem;
    width: calc(100% - 0.8rem);
    margin-top: 0.45rem;
  }

  .top .app-nav a {
    padding: 0.38rem 0.55rem;
    font-size: 0.82rem;
  }
}

body .top,
body.is-auth .top,
body:not(.is-auth) .top {
  position: sticky;
  top: 0;
  inset: auto;
  z-index: 20;
  width: 100%;
  min-height: 68px;
  margin: 0;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  border: 0;
  border-bottom: 1px solid #e3ebe6;
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  backdrop-filter: none;
  box-shadow: none;
}

body .app-nav,
body .top .app-nav,
body:not(.is-auth) .top .app-nav {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body .app-nav a {
  color: var(--mist);
}

body .app-nav a:hover {
  color: var(--ink);
  background: #eef4f0;
}

body .app-nav a.is-active {
  color: #fff;
  background: var(--accent);
  box-shadow: none;
}

body .ai-pill,
body .ai-pill.on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(31, 122, 69, 0.22);
}

body .account-btn,
body .linkish {
  color: var(--ink);
  background: #fff;
  border-color: #d7e2db;
}

body .account-btn:hover,
body .linkish:hover {
  color: var(--ink);
  background: #eef4f0;
}

body .avatar {
  color: #fff;
  background: var(--accent);
}

body .account-menu {
  color: var(--ink);
  background: #fff;
  border-color: #e3ebe6;
  box-shadow: 0 16px 40px rgba(20, 34, 27, 0.12);
}

body .account-menu a,
body .account-menu button {
  color: var(--ink);
}

body .account-menu a:hover,
body .account-menu button:hover,
body .account-menu a.is-active {
  background: #eef4f0;
}

body .account-menu .menu-logout {
  color: var(--danger);
}

body .card,
body .onboard-shell,
body .coach-panel,
body #coach-panel,
body .camera-card,
body.is-auth .auth-card,
body:not(.is-auth) .card,
body:not(.is-auth) .onboard-shell,
body:not(.is-auth) .coach-panel,
body:not(.is-auth) #coach-panel,
body:not(.is-auth) .camera-card {
  color: var(--ink);
  border: 1px solid #e3ebe6;
  border-radius: 20px;
  background: #fff;
  backdrop-filter: none;
  box-shadow: 0 10px 30px rgba(20, 34, 27, 0.06);
}

body .card:hover,
body:not(.is-auth) .card:hover {
  border-color: #cfe0d6;
  box-shadow: 0 14px 34px rgba(20, 34, 27, 0.08);
  transform: none;
}

body.is-auth .auth {
  min-height: calc(100vh - 68px);
  padding: 3rem 1.25rem;
}

body.is-auth .auth-card {
  width: min(440px, 100%);
}

body.is-auth .auth-card::before,
body.is-auth .auth-card::after {
  display: none;
}

body.is-auth .auth-card .eyebrow,
body .eyebrow {
  color: var(--accent);
}

body.is-auth .auth-card h1,
body.is-auth .auth-card .lede,
body.is-auth h1,
body.is-auth .lede,
body h1,
body h2,
body .lede {
  color: var(--ink);
}

body.is-auth .lede,
body .lede,
body .hint {
  color: var(--mist);
}

body input,
body select,
body textarea,
body:not(.is-auth) input,
body:not(.is-auth) select,
body:not(.is-auth) textarea {
  color: var(--ink);
  border: 1px solid #d7e2db;
  border-radius: 12px;
  background: #fff;
}

body input:focus,
body select:focus,
body textarea:focus {
  border-color: rgba(31, 122, 69, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 122, 69, 0.12);
}

body input[type="file"],
body:not(.is-auth) input[type="file"] {
  border-style: dashed;
  border-color: rgba(31, 122, 69, 0.35);
  background: #f3faf6;
}

body .btn-primary,
body .btn-primary:hover:not(:disabled),
body .app-nav a.is-active,
body #coach-panel .bubble.user,
body #coach-panel .chat-send,
body #coach-panel #chat-mic.is-listening,
body #coach-panel #chat-chats[aria-expanded="true"],
body .partner-box {
  color: #fff;
  background: var(--accent);
  box-shadow: none;
}

body .btn-primary:hover:not(:disabled) {
  background: #18663a;
}

body .btn-ghost {
  color: var(--ink);
  background: #fff;
  border: 1px solid #d7e2db;
}

body .btn-ghost:hover:not(:disabled) {
  background: #eef4f0;
}

body.is-auth .btn-google {
  gap: 0.7rem;
  width: 100%;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #d7e2db;
  box-shadow: none;
}

body .item,
body .cal-cell,
body .memory-card,
body .profile-stat,
body .onboard-stat,
body .onboard-choice,
body .onboard-chip,
body .activity-day,
body .profile-language,
body .profile-notes,
body .chat-thread,
body .chat-threads,
body #coach-panel .chat-threads {
  color: var(--ink);
  border-color: #e3ebe6;
  background: #f7faf8;
}

body .cal-cell.ready,
body .onboard-choice.is-on,
body .onboard-chip.is-on,
body .chat-thread.active {
  color: var(--ink);
  border-color: rgba(31, 122, 69, 0.4);
  background: #e8f6ee;
}

body .cal-cell .cal-day,
body .cal-cell .cal-summary,
body .score,
body .video-chip,
body .item a {
  color: var(--accent);
}

body .cal-cell .cal-summary {
  color: var(--ink);
}

body #coach-panel {
  background: #fff;
}

body #coach-panel .coach-panel-head {
  border-bottom-color: #e3ebe6;
}

body #coach-panel .coach-mark {
  color: #fff;
  background: var(--accent);
}

body #coach-panel .bubble.ai {
  color: var(--ink);
  background: #f3f7f4;
}

body #coach-panel .chat-compose,
body .chat-compose {
  background: #fff;
  border: 1px solid #d7e2db;
}

body #chat-mic {
  color: var(--ink);
  background: #eef4f0;
}

body .home-hero,
body:not(.is-auth) .home-hero {
  border-bottom-color: #e3ebe6;
}

body .onboard-bar {
  background: #e7eee9;
}

body .onboard-footer {
  border-top-color: #e3ebe6;
}

body .camera-sheet {
  background: rgba(20, 34, 27, 0.35);
}

body #camera-live,
body .preview {
  background: #eef3f0;
}

@media (max-width: 800px) {
  body .top,
  body:not(.is-auth) .top {
    top: 0;
    width: 100%;
    margin: 0;
    border-radius: 0;
  }
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app > .auth,
.app > .onboard,
.app > .dash {
  flex: 1 0 auto;
}

body.is-auth .auth {
  min-height: 0;
}

.site-footer {
  margin-top: auto;
  flex: 0 0 auto;
  border-top: 1px solid #e3ebe6;
  background: #fff;
  color: var(--mist);
}

.site-footer-inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.6rem 0 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  align-items: start;
}

.site-footer .brand {
  font-size: 1.15rem;
}

.site-footer p {
  margin: 0.35rem 0 0;
  max-width: 36rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.site-footer-label {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer-nav,
.site-footer-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer-nav a,
.site-footer a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.site-footer-nav a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.site-footer-list li {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

.site-footer-bar {
  border-top: 1px solid #e3ebe6;
}

.site-footer-bar p {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0 1rem;
  max-width: none;
  font-size: 0.82rem;
}

#onboard-next {
  display: none !important;
}

.bg-slides {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #f4f7f5;
}

.bg-slides span {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  animation: bg-fade 30s linear infinite;
}

.bg-slides span:nth-child(2) { animation-delay: 6s; }
.bg-slides span:nth-child(3) { animation-delay: 12s; }
.bg-slides span:nth-child(4) { animation-delay: 18s; }
.bg-slides span:nth-child(5) { animation-delay: 24s; }

.bg-slides::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(244, 247, 245, 0.42);
}

@keyframes bg-fade {
  0% { opacity: 1; }
  14% { opacity: 1; }
  20% { opacity: 0; }
  94% { opacity: 0; }
  100% { opacity: 1; }
}

.app {
  position: relative;
  z-index: 1;
}

.app:has([data-dash-section="plan"]:not([hidden])) .site-footer {
  border-top-color: #e3ebe6;
}

@media (max-width: 800px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}
