/* Dashboard and sign-in pages. Built on base.css tokens. */

/* ================================================================ sign-in */

.auth-body { background: var(--canvas); }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 520px) 1fr; gap: 12px; padding: 12px; }
/* Logo at the top, legal links at the bottom, and the form centred between them when there's
   room. On a short screen the auto margins shrink to nothing instead of the parts overlapping. */
.auth-card { display: flex; flex-direction: column; gap: 20px; padding: 24px clamp(24px, 4.5vw, 60px) 18px; }
.auth-card .logo { align-self: flex-start; margin-bottom: auto; padding: 4px 0; }
.auth-head { display: grid; gap: 8px; }
.auth-title { font-size: clamp(34px, 3.2vw, 44px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; }
#auth-form { display: grid; gap: 14px; }
#auth-form .btn { height: 52px; margin-top: 4px; }
.auth-switch a, #auth-form .tiny a { color: var(--ink); font-weight: 600; }
#forgot-link { justify-self: end; color: var(--ink); font-weight: 600; }
.auth-notice { display: grid; gap: 16px; background: var(--mint); border-radius: var(--r-md); padding: 20px 22px; }
.auth-notice p { margin: 0; line-height: 1.5; }
.auth-notice .btn { height: 48px; }
.auth-legal { display: flex; gap: 16px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.auth-legal a, .auth-legal button { color: var(--ink-3); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.auth-legal a:hover, .auth-legal button:hover { color: var(--ink); }
.auth-art { border-radius: var(--r-xl); background: var(--gradient); display: grid; align-items: end; padding: clamp(28px, 5vw, 64px); }
.auth-art-inner { display: grid; gap: 20px; }
.auth-ruler { margin-top: 70px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.auth-points li { background: rgba(255, 255, 255, 0.6); border-radius: var(--r-md); padding: 18px; display: grid; gap: 4px; }
.auth-points b { font-size: 40px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.auth-points span { font-size: 14px; color: var(--ink-2); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
/* Short screens (a 1280×720 laptop, a small phone): tighter spacing so sign-up fits without scrolling. */
@media (max-height: 760px) {
  .auth-card { gap: 14px; padding-top: 16px; padding-bottom: 12px; }
  .auth-title { font-size: clamp(30px, 2.8vw, 38px); }
  #auth-form { gap: 10px; }
  #auth-form .btn { height: 48px; }
  .auth-card .input { height: 46px; }
}

/* ================================================================ app shell */

.app-body {
  background: var(--gradient) top / 100% 460px no-repeat, var(--canvas);
  min-height: 100vh;
}
.topbar {
  max-width: 1320px; margin: 0 auto; height: 76px; padding: 0 20px;
  display: flex; align-items: center; gap: 20px;
}
.topnav { margin: 0 auto; display: flex; gap: 4px; padding: 5px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line); }
.topnav a { padding: 8px 20px; border-radius: var(--pill); text-decoration: none; color: var(--ink-2); font-size: 15px; }
.topnav a:hover { color: var(--ink); }
.topnav a.active { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topnav + .topbar-right { margin-left: 0; }

.credits-pill { display: flex; align-items: center; gap: 4px; height: 46px; padding: 4px 4px 4px 16px; border-radius: var(--pill); background: var(--ink); color: #fff; }
.credits-count { display: flex; align-items: center; gap: 8px; text-decoration: none; padding-right: 8px; }
.credits-count b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.credits-word { font-size: 14px; color: rgba(255, 255, 255, 0.65); }
.credits-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fe0b8; box-shadow: 0 0 0 3px rgba(143, 224, 184, 0.2); }
.credits-pill.low .credits-dot { background: #f5c46b; box-shadow: 0 0 0 3px rgba(245, 196, 107, 0.25); }
.credits-pill.empty .credits-dot { background: #f08a95; box-shadow: 0 0 0 3px rgba(240, 138, 149, 0.25); }
.credits-add {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border: 0; border-radius: var(--pill);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
}
.credits-add:hover { background: var(--mint); }
.credits-pill :focus-visible { outline-color: #fff; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line-2); font-weight: 600; font-size: 17px;
}
.avatar:hover { border-color: var(--ink-3); }

.view { max-width: 1320px; margin: 0 auto; padding: 0 20px 96px; outline: none; }
.view.loading { opacity: 0.6; }

/* ---------------------------------------------------------------- page head and stat strip */

.page-head { padding: 28px 4px 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head-text { display: grid; gap: 8px; min-width: 0; }
.page-title { font-size: clamp(34px, 4.6vw, 54px); font-weight: 300; letter-spacing: -0.035em; line-height: 1.04; overflow-wrap: anywhere; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; margin-bottom: 6px; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 18px; height: 18px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 4px 34px; }
.stat { padding: 0 20px 0 16px; border-left: 1px solid var(--hair); display: grid; gap: 4px; align-content: start; position: relative; }
.stat:first-child { padding-left: 16px; }
.stat.lead { border-left: 1.5px solid var(--ink); }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stat-value { font-size: 30px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--ink-2); }
.stat-label a { color: var(--ink); font-weight: 600; }
.stat-bar {
  height: 20px; margin-top: 8px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 5px) left / calc(var(--p, 0) * 1%) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px 5px) left bottom / 100% 60% no-repeat;
}

/* ---------------------------------------------------------------- surfaces */

.sheet { background: var(--paper); border-radius: 32px; padding: clamp(18px, 2.4vw, 32px); box-shadow: 0 1px 2px rgba(48, 48, 48, 0.04); }
.sheet + .sheet { margin-top: 16px; }
.panel { border-radius: var(--r-lg); padding: clamp(20px, 2.4vw, 28px); }
.panel-mint { background: var(--mint); }
.panel-lilac { background: var(--lilac); }
.panel-line { border: 1px solid var(--line); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-title p { margin-top: 2px; }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; align-items: start; }

/* ---------------------------------------------------------------- composer (new project) */

.composer { display: grid; gap: 22px; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line); gap: 2px; }
.seg button {
  height: 38px; padding: 0 16px; border: 0; border-radius: var(--pill); background: transparent; cursor: pointer;
  color: var(--ink-2); font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
}
.seg button svg { width: 17px; height: 17px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.source-input { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 8px 0 18px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line-2); }
.source-input:focus-within { border-color: var(--ink); }
.source-input svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.source-input input { flex: 1; min-width: 0; border: 0; height: 100%; background: transparent; font-size: 16.5px; }
.source-input input:focus { outline: none; }
.drop {
  display: grid; place-items: center; gap: 6px; min-height: 120px; border-radius: var(--r-md); text-align: center;
  border: 1.5px dashed var(--line-2); background: rgba(255, 255, 255, 0.55); cursor: pointer; position: relative; padding: 18px;
}
.drop:hover, .drop.over { border-color: var(--ink); background: var(--paper); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 24px; height: 24px; }
.group-label { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }

.format-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.format-choice {
  display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: var(--r-md); cursor: pointer;
  background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line); text-align: center; font-size: 13.5px; line-height: 1.25;
}
.format-choice:hover { border-color: var(--ink-3); }
.format-choice[aria-pressed="true"] { background: var(--paper); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.format-choice b { font-weight: 600; font-size: 14.5px; }
.format-choice small { color: var(--ink-3); font-size: 12px; }
.shape { height: 40px; display: grid; place-items: end center; }
.shape i { display: block; border: 1.5px solid var(--ink); border-radius: 5px; background: var(--mint); }
.shape-916 i { width: 22px; height: 39px; }
.shape-45 i { width: 30px; height: 37px; }
.shape-11 i { width: 34px; height: 34px; }
.shape-orig i { width: 46px; height: 26px; }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-choice {
  height: 40px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.6);
  cursor: pointer; font-size: 14.5px; color: var(--ink-2);
}
.pill-choice:hover { border-color: var(--ink-3); }
.pill-choice[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-card {
  text-align: left; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.6);
  cursor: pointer; display: grid; gap: 3px;
}
.mode-card b { font-size: 15.5px; font-weight: 600; }
.mode-card span { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }
.mode-card[aria-pressed="true"] { background: var(--paper); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.mode-card .warn-note { color: var(--warn); }

.stepper { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 3px; border-radius: var(--pill); background: var(--paper); border: 1px solid var(--line-2); }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--canvas); cursor: pointer; font-size: 19px; line-height: 1; }
.stepper button:hover { background: var(--mint); }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.clips-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.more { border-top: 1px solid var(--line-2); padding-top: 14px; }
.more summary { cursor: pointer; color: var(--ink-2); font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 15px; }
.more[open] summary::before { content: "–"; }
.more-body { display: grid; gap: 16px; padding-top: 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background 0.15s ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.composer-foot .btn { height: 54px; padding: 0 26px; }
.cost-note { font-size: 14px; color: var(--ink-2); }
.cost-note b { color: var(--ink); }

/* ---------------------------------------------------------------- project lists */

.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.project-rows { display: grid; gap: 8px; }
.project-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: var(--r-md);
  text-decoration: none; border: 1px solid transparent;
}
.project-row:hover { background: var(--canvas); }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--lilac); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur { position: absolute; right: 5px; bottom: 5px; font-size: 11px; background: rgba(0, 0, 0, 0.72); color: #fff; padding: 1px 6px; border-radius: 5px; }
.row-text { min-width: 0; display: grid; gap: 2px; }
.row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini-progress {
  width: 120px; height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 4px) left / calc(var(--p, 0) * 1%) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px 4px) left / 100% 100% no-repeat;
}

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: grid; gap: 12px; padding: 10px 10px 16px; border-radius: var(--r-lg); background: var(--paper); text-decoration: none; border: 1px solid var(--line); }
.project-card:hover { border-color: var(--ink-3); }
.project-card .thumb { border-radius: 18px; }
.project-card .row-text { padding: 0 6px; gap: 6px; }

.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 56px 20px; }
.empty .ruler { width: min(420px, 100%); margin-bottom: 8px; }
.empty p { max-width: 42ch; }

/* ---------------------------------------------------------------- project page */

.progress-panel { display: grid; gap: 18px; }
.progress-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress-top .pct { margin-left: auto; font-family: var(--mono); color: var(--ink-2); }
.progress-ruler {
  height: 30px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 6px) left / calc(var(--p, 0) * 1%) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px 6px) left bottom / 100% 55% no-repeat;
  transition: background-size 0.4s ease;
}
.stages { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; }
.stages li { font-size: 13px; padding: 4px 12px; border-radius: var(--pill); border: 1px solid var(--line-2); color: var(--ink-3); }
.stages li.done { color: var(--good); border-color: rgba(43, 138, 95, 0.35); background: var(--good-bg); }
.stages li.now { color: var(--ink); border-color: var(--ink); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.notes { display: grid; gap: 8px; margin-bottom: 16px; }
.notes p { padding: 12px 16px; border-radius: var(--r-sm); background: var(--warn-bg); color: #6b4a0e; font-size: 14.5px; }
.error-panel { background: var(--bad-bg); }
.error-panel p { color: #7a2630; margin: 6px 0 14px; }

.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.clip { border-radius: var(--r-lg); background: var(--canvas); overflow: hidden; display: flex; flex-direction: column; }
.clip-media { position: relative; background: #1b1b1b; aspect-ratio: var(--ar, 9 / 16); max-height: 560px; }
.clip-media video, .clip-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.clip-wait { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.clip-wait .spinner { border-color: rgba(255, 255, 255, 0.2); border-top-color: #fff; }
.clip-score {
  position: absolute; top: 12px; left: 12px; display: grid; justify-items: center; line-height: 1.05;
  background: rgba(255, 255, 255, 0.94); border-radius: 14px; padding: 7px 11px; box-shadow: var(--shadow);
}
.clip-score b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.clip-score span { font-size: 10.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.clip-score.good b { color: var(--good); }
.clip-score.ok b { color: var(--warn); }
.clip-score.low b { color: var(--bad); }
.clip-rank { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 12px; color: #fff; background: rgba(0, 0, 0, 0.55); padding: 3px 9px; border-radius: 99px; }
.clip-body { padding: 16px 18px 18px; display: grid; gap: 12px; }
.clip-meta { display: flex; gap: 10px; font-size: 13px; color: var(--ink-2); font-family: var(--mono); }
.clip-body h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.scores { display: grid; gap: 6px; }
.score-row { display: grid; grid-template-columns: 48px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.score-row b { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.score-track { height: 12px; border-radius: 99px; background: rgba(48, 48, 48, 0.07); overflow: hidden; }
.score-track i { display: block; height: 100%; width: var(--v); border-radius: 99px; }
.score-row.hook i { background: linear-gradient(#5b5b5b, #303030); }
.score-row.flow i { background: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 5px), rgba(48, 48, 48, 0.12); }
.score-row.value i { background: radial-gradient(var(--ink) 1.1px, transparent 1.4px) 0 0 / 5px 5px, rgba(48, 48, 48, 0.1); }
.score-row.trend i { background: var(--lilac-2); }
.why summary, .transcript summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.why ul { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 4px; }
.reason { font-size: 14px; color: var(--ink-2); }
.key-moment { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); padding: 10px 12px; border-radius: var(--r-sm); background: rgba(212, 221, 249, 0.45); }
.key-moment b { color: var(--ink); font-weight: 600; }
.post-copy { background: var(--paper); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; display: grid; gap: 6px; }
.post-copy .tags { color: #4d63b8; }
.transcript p { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; max-height: 150px; overflow: auto; }
.clip-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.clip-actions .btn { flex: 1; min-width: 120px; }
.recut { display: grid; gap: 10px; padding: 12px; background: var(--paper); border-radius: var(--r-sm); }
.recut-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recut .input { height: 42px; font-family: var(--mono); font-size: 15px; }

/* ---------------------------------------------------------------- billing */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { border-radius: var(--r-lg); padding: 24px; display: grid; gap: 12px; align-content: start; background: var(--canvas); border: 1px solid transparent; }
.plan.current { border-color: var(--ink); background: var(--paper); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; }
.plan .amount { font-size: 44px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.plan .per { color: var(--ink-3); font-size: 14px; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; font-size: 14.5px; }
.plan li { display: flex; gap: 8px; align-items: center; }
.plan li svg { width: 17px; height: 17px; color: var(--good); flex: none; }
.plan .btn { margin-top: auto; }
.plan-featured { background: var(--ink); color: #fff; }
.plan-featured .per, .plan-featured .faint, .plan-featured .muted { color: rgba(255, 255, 255, 0.6); }
.plan-featured li svg { color: #9fe0bf; }
.plan-featured .btn-dark { background: #fff; color: var(--ink); border-color: #fff; }
.plan-featured.current { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 4px var(--mint-2); }

.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack-card {
  display: grid; gap: 4px; padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--paper);
  text-align: left; cursor: pointer; font: inherit;
}
.pack-card:hover { border-color: var(--ink); }
.pack-card b { font-size: 26px; font-weight: 400; letter-spacing: -0.02em; }
.pack-card .price-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pack-card .price-line span:first-child { font-size: 18px; font-weight: 600; }
.pack-list { display: grid; gap: 10px; }
.pack-list .pack-card { grid-template-columns: 1fr auto; align-items: center; }

.balance-card { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 24px; display: grid; gap: 14px; }
.balance-card .big { font-size: 64px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.balance-card .muted { color: rgba(255, 255, 255, 0.65); }
.balance-card .stat-bar { --ink: #fff; --hair: rgba(255, 255, 255, 0.3); }
.balance-card .btn { background: #fff; color: var(--ink); border-color: #fff; }

.table-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ledger th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 13px; padding: 0 12px 10px; border-bottom: 1px solid var(--line-2); }
.ledger td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th.num { text-align: right; }
.ledger td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); white-space: nowrap; }
.ledger .plus { color: var(--good); }
.ledger tr:last-child td { border-bottom: 0; }

.checkout { max-width: 560px; margin: 0 auto; display: grid; gap: 18px; }
.order-lines { display: grid; gap: 10px; padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.order-lines div { display: flex; justify-content: space-between; gap: 12px; }
.agree-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; color: var(--ink-2); }
.agree-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.agree-row a { color: var(--ink); }
.test-banner { background: var(--warn-bg); color: #6b4a0e; border-radius: var(--r-sm); padding: 12px 16px; font-size: 14px; }

/* ---------------------------------------------------------------- settings */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.form-stack { display: grid; gap: 14px; }
.form-stack .btn { justify-self: start; }

/* ---------------------------------------------------------------- modal, toast, tab bar */

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30, 32, 31, 0.36); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(480px, 100%); background: var(--paper); border-radius: var(--r-lg); padding: 24px; display: grid; gap: 18px; box-shadow: var(--shadow-lg); animation: pop 0.2s ease; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-foot a { color: var(--ink); font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: 28px; translate: -50% 0; z-index: 60; background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: var(--pill); font-size: 15px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
  animation: pop 0.2s ease;
}
.toast.bad { background: var(--bad); }

.tabbar { display: none; }

/* ---------------------------------------------------------------- paywall */

.paywall .modal-backdrop { background: rgba(30, 32, 31, 0.5); }
.paywall-card {
  position: relative; width: min(880px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop 0.25s ease;
}
.paywall-close { position: absolute; top: 18px; right: 18px; z-index: 2; }
.paywall-head { background: var(--gradient); padding: 34px clamp(22px, 4vw, 40px) 30px; display: grid; gap: 12px; justify-items: start; }
.paywall-ruler { width: 100%; margin-bottom: 14px; }
.paywall-title { font-size: clamp(30px, 4vw, 44px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; max-width: 18ch; }
.paywall-head .muted { max-width: 52ch; }
.paywall-body { padding: 24px clamp(22px, 4vw, 40px) 28px; display: grid; gap: 22px; }
.paywall-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.paywall-plans .plan { background: var(--canvas); }
.paywall-plans .plan-featured { background: var(--ink); }
.paywall-packs { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.paywall-pack-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paywall-pack-row .pack-card { padding: 14px 16px; }
.paywall-pack-row .pack-card b { font-size: 20px; }
.paywall-foot { text-align: center; }

/* ---------------------------------------------------------------- dashboard footer */

.app-footer {
  max-width: 1320px; margin: -56px auto 0; padding: 0 24px 40px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3);
}
.app-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.app-footer a, .app-footer button { color: var(--ink-3); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.app-footer a:hover, .app-footer button:hover { color: var(--ink); }
.app-footer a:not([href]) { display: none; }

.credit-split { display: grid; gap: 6px; font-size: 14px; }
.credit-split div { display: flex; justify-content: space-between; gap: 12px; }
.credit-split b { font-variant-numeric: tabular-nums; }
.rename-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.rename-form .input { flex: 1; min-width: 220px; font-size: 20px; height: 54px; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row .icon-btn { width: 38px; height: 38px; }
.title-row .icon-btn svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .split, .settings-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .topnav { display: none; }
  .topbar { height: 64px; gap: 10px; }
  .credits-word, .credits-add span { display: none; }
  .credits-add { width: 38px; padding: 0; justify-content: center; }
  .credits-pill { height: 44px; padding-left: 14px; }
  .avatar { display: none; }
  .view { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .stat:nth-child(3) { border-left: 1px solid var(--hair); }
  .tabbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 68px; padding: 0 6px;
    background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--ink); font-weight: 600; }
  .tabbar .tab-new { width: 52px; height: 52px; border-radius: 18px; background: var(--ink); color: #fff; place-items: center; justify-self: center; }
  .tabbar .tab-new svg { width: 24px; height: 24px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .modal { place-items: end center; padding: 0; }
  .modal-card { width: 100%; border-radius: 28px 28px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .paywall-card { border-radius: 28px 28px 0 0; max-height: 92vh; }
  .paywall-pack-row { grid-template-columns: 1fr; }
  .app-footer { margin-top: -80px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); justify-content: center; text-align: center; }
  .app-footer nav { justify-content: center; }
}

@media (max-width: 600px) {
  .page-head { padding: 18px 2px 26px; }
  .format-choices { grid-template-columns: repeat(2, 1fr); }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 0 10px; font-size: 14px; }
  .mode-cards { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: 80px 1fr; }
  .project-row .mini-progress, .project-row > .badge { grid-column: 2; justify-self: start; }
  .clip-grid { grid-template-columns: 1fr; }
  .composer-foot .btn { width: 100%; }
  .sheet { border-radius: 26px; }
  .stat-value { font-size: 26px; }
  .head-actions { width: 100%; }
}
