/* smoooch.bio dashboard: shell, cards, charts, editor-in-dashboard, plans. Loaded after app.css. */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- shell ---------------------------------------------------------------- */
.dash-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
}
.sidebar-top { padding: 4px 8px 6px; }
.ws-switch select { min-height: 42px; font-weight: 650; }
.ws-meta { display: flex; align-items: center; justify-content: space-between; margin: -4px 4px 0; }
.plan-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.plan-chip.plan-pro { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.plan-chip.plan-agency { background: var(--ink); color: var(--paper); box-shadow: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a.is-active { background: var(--accent-soft); color: var(--accent); }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.sidebar-foot form { margin: 0; }
.dash-main { padding: 28px clamp(16px, 3vw, 44px) 60px; max-width: 1180px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.dash-main.is-wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: clamp(26px, 3vw, 34px); }
.page-head p { margin: 0; overflow-wrap: anywhere; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- building blocks ------------------------------------------------------ */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .card, .grid-3 > .card { min-width: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.rows a:hover strong { color: var(--accent); }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.danger-text { color: var(--danger); }
.locked { border-style: dashed; box-shadow: none; }
.tile-hint { margin-top: 2px; }
.usage { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 10px 0; font-size: 14.5px; }
.usage progress { grid-column: 1 / -1; }
progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 650; box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); }
.toast.is-error { background: var(--danger); color: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 550; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.inline-field select { width: auto; min-height: 38px; }
.status { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-active { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status-pending { background: var(--surface-2); color: var(--ink-2); }
code { font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: .92em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
pre code { padding: 0; background: none; }
.secret { padding: 14px; border-radius: 12px; background: var(--accent-soft); }
.secret p { margin: 0 0 8px; }
.explainer dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.explainer dt { font-weight: 700; }
.explainer dd { margin: 0; color: var(--ink-2); }
.t-meta { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.table tr.is-pending td { color: var(--ink-2); }
.dns td { vertical-align: middle; }
.table-scroll { overflow-x: auto; }

.page-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.page-card { display: flex; flex-direction: column; gap: 10px; }
.page-card h2 { margin: 0; font-size: 19px; }
.page-card p { margin: 0; }
.page-card-top { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.mini-avatar-sm { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--accent-soft); color: var(--accent); font: 800 20px/1 'Bricolage Grotesque', sans-serif; flex: none; }
.mini-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ---- templates & layout pickers ------------------------------------------- */
.templates { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.templates legend { margin-bottom: 8px; }
.template { position: relative; }
.template input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; }
.template-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; height: 100%; }
.template input:checked + .template-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.template input:focus-visible + .template-card { outline: 3px solid var(--accent); outline-offset: 2px; }
.template.is-locked .template-card, .option-card.is-locked > span { opacity: .55; cursor: not-allowed; }
.tpl-preview { display: grid; gap: 5px; padding: 12px 14px; border-radius: 10px; height: 110px; align-content: start; background: #ffe4ec; }
.tpl-preview i { display: block; height: 14px; border-radius: 99px; background: #e8265e; }
.tpl-preview i:first-child { width: 26px; height: 26px; border-radius: 50%; justify-self: center; margin-bottom: 4px; }
.tpl-spotlight i:nth-child(2) { height: 30px; border-radius: 8px; }
.tpl-grid { grid-template-columns: 1fr 1fr; }
.tpl-grid i { height: 26px; border-radius: 6px; }
.tpl-grid i:first-child { grid-column: 1 / -1; }
.tpl-hero i:first-child { width: auto; height: 34px; border-radius: 6px; justify-self: stretch; }
.tpl-pal-cream { background: #f7efe3; }
.tpl-pal-cream i { background: #2b1d14; }
.tpl-pal-midnight { background: #13122b; }
.tpl-pal-midnight i { background: #ff7aa8; }
.tpl-pal-sage { background: #dde6d3; }
.tpl-pal-sage i { background: #25402c; }
.tpl-pal-citrus { background: #fff06b; }
.tpl-pal-citrus i { background: #16130a; }
.tpl-pal-ocean { background: #0c4a6e; }
.tpl-pal-ocean i { background: #e8f6ff; }
.option-card > span { flex-direction: column; align-items: stretch; gap: 6px; min-height: 0; padding: 10px; border-radius: 16px; width: 150px; }
.option-card small { font-weight: 500; font-size: 12.5px; }
.cover-edit { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cover-edit .sub { width: 100%; margin: 0; font-size: 15px; }
.cover-preview { width: 240px; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); font-size: 14px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---- editor inside the dashboard ------------------------------------------ */
.dash .editor { padding: 0; max-width: none; margin: 0; grid-template-columns: minmax(0, 1fr) 380px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); align-self: flex-start; }
.tabs button { border: 0; background: none; padding: 9px 18px; border-radius: 10px; font: 650 15px/1 'Figtree', sans-serif; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.panel { display: flex; flex-direction: column; gap: 20px; }
.add-more { display: flex; gap: 16px; margin-top: 10px; }
.link-item.kind-header, .link-item.kind-text { grid-template-columns: 34px 64px minmax(0, 1fr) auto; }
.kind-tag { font-size: 12px; font-weight: 750; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.in-body { min-height: 60px; border: 1.5px solid transparent; background: transparent; }
.in-body:hover { border-color: var(--line); }
.link-meta { margin: 0; padding: 0 8px; font-size: 12.5px; color: var(--ink-2); }
.link-options { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.link-options[hidden] { display: none; }
.link-options .field { max-width: 320px; }
.link-options p { margin: 0; }

/* ---- pricing & plans ------------------------------------------------------- */
.pricing { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px; }
.pricing-head { text-align: center; margin-bottom: 28px; }
.pricing-head h1 { font-size: clamp(36px, 5vw, 56px); margin: 0 0 10px; }
.pricing-head .lede { margin: 0 auto; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 6px; }
.plan h2 { margin: 0; font-size: 24px; }
.plan-price { margin: 4px 0 0; font: 800 30px/1.1 'Bricolage Grotesque', sans-serif; }
.plan .muted { margin: 0 0 6px; }
.plan .btn { margin-top: auto; }
.plan.is-featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.plan.is-current { background: var(--surface-2); }
.plan-current { margin-top: auto; font-weight: 750; color: var(--ok); }
.ticks { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-direction: column; gap: 7px; }
.ticks li { padding-left: 24px; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.foot a { color: var(--ink-2); }

/* ---- charts ----------------------------------------------------------------- */
.chart-wrap { margin: 0; }
.chart { display: block; width: 100%; height: 190px; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .col:hover .bar { opacity: 1; }
.chart .hit { fill: transparent; }
.chart .col:hover .hit { fill: var(--surface-2); }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-range { margin-left: auto; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-bar { background: var(--accent); }
.key-line { height: 3px; border-radius: 2px; background: var(--ink); }
.spark { width: 90px; height: 24px; display: block; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14.5px; }
.breakdown progress { grid-column: 1 / -1; height: 6px; }
.b-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-count { font-variant-numeric: tabular-nums; font-weight: 650; }
.range { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.range a { padding: 7px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 650; font-size: 14px; }
.range a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---- responsive ------------------------------------------------------------- */
@media (max-width: 1180px) {
  .dash .editor { grid-template-columns: minmax(0, 1fr) 330px; }
  .dash .phone { width: 320px; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .dash-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .side-nav { flex-direction: row; overflow-x: auto; width: 100%; order: 5; }
  .side-nav a { padding: 8px 10px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .ws-switch { flex: 1; min-width: 160px; }
  .ws-meta { margin: 0; gap: 8px; }
  .dash .editor { grid-template-columns: 1fr; }
  .plans, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-main { padding-top: 18px; }
  .explainer dl { grid-template-columns: 1fr; }
  .table { font-size: 14px; }
}
.actions-cell { text-align: right; }
.actions-cell .row-actions { justify-content: flex-end; }
.breakdown-group { display: flex; flex-direction: column; gap: 12px; }
.group-title { margin: 8px 0 0; font-size: 20px; }
.grid-3 h3 { margin: 0 0 12px; font-size: 16px; font-family: 'Bricolage Grotesque', sans-serif; }
