/* tasteskill / app.css · "Linear dashboard" (references: linear.app app UI, ui.shadcn.com
   dark dashboard example). Dark ground, compact sidebar, hairline panels, KPI cards with
   large tabular numbers, Inter, 10px radii, one indigo accent (#5e6ad2). */

:root {
  --ground: #0a0a0b;
  --surface: #111113;
  --raised: #101012;
  --active: #1b1b1f;
  --border: #232328;
  --rule: #1c1c20;
  --control: #2a2a30;
  --text: #f2f2f3;
  --muted: #a1a1aa;
  --faint: #85858e;
  --accent: #5e6ad2;
  --primary: #ffffff;
  --primary-ink: #0a0a0b;
  --positive: #4ade80;
  --negative: #f87171;
  --warning: #fbbf24;
  --pill-positive-bg: #12291e; --pill-positive-ink: #55d18b;
  --pill-negative-bg: #2b1414; --pill-negative-ink: #f87171;
  --pill-warning-bg: #2b2410; --pill-warning-ink: #fbbf24;
  --pill-neutral-bg: #1b1b1f; --pill-neutral-ink: #c8c8ce;
  --accent-soft: #171a2b; --accent-ink: #9aa4e8; --accent-line: #2c3355;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Inter", system-ui, sans-serif;
  --fs-title: 18px; --fs-title-sans: 18px; --fs-section: 14px; --fs-kpi: 30px; --fs-body: 14px; --fs-small: 12px;

  --sidebar-width: 232px;
  --pad: 28px;
  --gap: 14px;
  --card-pad: 18px;
  --radius-card: 12px;
  --radius-control: 8px;
  --radius-pill: 999px;
  --control-height: 36px;
  --row-height: 48px;
  --list-row: 62px;
  --nav-row: 32px;
  --nav-pitch: 34px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms; --t-hover: 150ms; --t-ui: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/1.55 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
.stars svg { display: inline-block; vertical-align: -0.08em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .kpi-value, table { font-variant-numeric: tabular-nums; }

/* ---------- shell: sidebar + canvas ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 1px; padding: 14px 10px 12px; overflow: auto; border-right: 1px solid var(--rule); }
.workspace { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; }
.workspace .mark { width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 600 12px var(--font); }
.workspace .name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.workspace .plan { margin-left: auto; }
.sidebar .group-label { margin: 16px 8px 4px; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 9px; height: var(--nav-row); margin: 0 0 1px; padding: 0 9px; border-radius: 7px; color: var(--muted); font-size: 13.5px; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.nav-item svg { width: 15px; height: 15px; flex: none; stroke-width: 1.6; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--text); }
.nav-item .count { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.sidebar .bottom { margin-top: auto; padding-top: 14px; }
.user-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; }
.user-row .who { min-width: 0; }
.user-row .who .nm { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .who .em { display: block; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 11px; font-weight: 600; }

.canvas { min-width: 0; padding: 36px var(--pad) 64px; }

/* ---------- greeting home ---------- */
.home-col { max-width: 1100px; margin: 0 auto; }
.greeting { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.greeting h1 { grid-column: span 12; font: 600 24px/1.15 var(--font); letter-spacing: -0.02em; }
.greeting .date-line { grid-column: span 12; margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.tile { grid-column: span 3; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; min-height: 118px; display: flex; flex-direction: column; }
.tile .lbl { color: var(--muted); font-size: 12.5px; }
.tile .kpi-value { margin-top: auto; font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.02em; }
.tile .cap { margin-top: 3px; color: var(--faint); font-size: var(--fs-small); }

.panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.panel { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; display: flex; flex-direction: column; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel h2 { font-size: 13.5px; font-weight: 600; }
.panel .meta { color: var(--faint); font-size: var(--fs-small); }
.card-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; text-underline-offset: 3px; transition: color var(--t-hover) ease; }
.card-link:hover { color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.demo-tag { background: transparent; border: 1px solid var(--control); color: var(--muted); text-transform: lowercase; letter-spacing: 0.02em; opacity: 0.9; }

/* rows one step up from the panel ground */
.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.row-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: var(--row-height); padding: 9px 13px; display: flex; align-items: center; gap: 11px; transition: border-color var(--t-hover) ease; }
.row-card:hover { border-color: var(--control); }
.row-card .line1 { width: 100%; min-width: 0; }
.row-card .stars { color: var(--accent-ink); font-size: 11px; letter-spacing: 2px; white-space: nowrap; }
.row-card .subject { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .when { margin-left: auto; color: var(--faint); font-size: var(--fs-small); white-space: nowrap; }
.rows .empty { grid-column: 1 / -1; }

/* ---------- inbox triage (form page) ---------- */
.triage { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--gap); }
.list-col { min-width: 0; }
.list-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.list-toolbar .count { margin-left: auto; color: var(--faint); font-size: var(--fs-small); }
.search { height: 32px; flex: 1; min-width: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--raised); font-size: 13px; transition: border-color var(--t-hover) ease; }
.search:focus { outline: none; border-color: var(--accent); }
.search::placeholder { color: var(--faint); }
.tabs { display: inline-flex; width: max-content; max-width: 100%; padding: 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.tabs button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--active); color: var(--text); }

.triage-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.triage-row { text-align: left; width: 100%; border: 1px solid var(--border); background: var(--raised); border-radius: 10px; padding: 10px 13px; min-height: var(--list-row); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 11px; cursor: pointer; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease; }
.triage-row:hover { border-color: var(--control); }
.triage-row[aria-selected="true"] { background: var(--active); border-color: var(--control); }
.triage-row .who { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.triage-row .when { color: var(--faint); font-size: var(--fs-small); white-space: nowrap; }
.triage-row .subject { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.triage-row .subject .stars { margin-right: 6px; }
.triage-row .status { grid-column: 2; justify-self: end; margin-top: 2px; }
.triage-rows .empty { grid-column: 1 / -1; }

.open-item { display: flex; flex-direction: column; gap: 14px; }
.quote-panel { padding: 24px; }
.quote-panel .stars { color: var(--accent-ink); letter-spacing: 3px; font-size: 13px; }
.quote-panel .text { font-size: 18px; line-height: 1.5; letter-spacing: -0.01em; margin: 12px 0 14px; }
.quote-panel .authorline { display: flex; align-items: baseline; gap: 9px; color: var(--muted); font-size: var(--fs-small); }
.quote-panel .authorline .nm { color: var(--text); font-weight: 600; font-size: 13.5px; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; padding: var(--card-pad); }
.details .kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; min-height: 30px; border-bottom: 1px solid var(--rule); }
.details .kv:last-child { border-bottom: 0; }
.details .kv .k { color: var(--muted); font-size: var(--fs-small); }
.details .kv .v { font-size: var(--fs-small); font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--control-height); padding: 0 13px; border-radius: var(--radius-control); border: 1px solid var(--control); background: transparent; color: var(--text); font-weight: 500; cursor: pointer; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn:hover { background: var(--surface); border-color: #3a3a41; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #e4e4e7; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn.danger { color: var(--negative); border-color: #3a2222; }
.btn.danger:hover { background: var(--pill-negative-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 500; font-size: 13.5px; }
.field .hint { color: var(--muted); font-size: var(--fs-small); }
.input, select.input, textarea.input { height: 38px; padding: 0 11px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--raised); transition: border-color var(--t-hover) ease; }
.input:focus { outline: none; border-color: var(--accent); }
textarea.input { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.empty { display: grid; place-items: center; min-height: 96px; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-control); color: var(--muted); text-align: center; font-size: 13px; }
.skeleton { background: var(--active); border-radius: 6px; }
.embed-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; word-break: break-all; }

/* ---------- form inbox page ---------- */
.form-col { max-width: 1152px; margin: 0 auto; }
.form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.form-head h1 { font: 600 20px/1.15 var(--font); letter-spacing: -0.02em; }
.form-prompt { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.form-head-actions { display: flex; gap: 8px; flex: none; }
.back-btn { display: none; margin-top: 14px; }

/* ---------- page scaffolding shared by settings/billing ---------- */
.page-sub { color: var(--muted); font-size: 13.5px; max-width: 56ch; }
.billing-panel .plan-head { margin-bottom: 12px; }

/* ---------- settings (two columns) ---------- */
.settings-col { max-width: 1152px; margin: 0 auto; }
.settings-col .page-title { font: 600 20px/1.15 var(--font); letter-spacing: -0.02em; margin-bottom: 6px; }
.setting-section { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 32px; padding: 26px 0; border-top: 1px solid var(--rule); }
.settings-col > .page-title + .page-sub + .setting-section { border-top: 0; }
.setting-section .label h2 { font-size: 14px; font-weight: 600; }
.setting-section .label p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.setting-panel { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; }
.setting-panel .field + .field { margin-top: 14px; }
.setting-rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.upgrade-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 10px; padding: 8px 8px 8px 14px; margin: 14px 0 26px; }
.upgrade-strip p { font-size: var(--fs-small); color: var(--accent-ink); }
.toggle-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 0; }
.toggle-row .tt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.toggle-row .td { margin-top: 2px; color: var(--muted); font-size: var(--fs-small); }
.switch { appearance: none; width: 30px; height: 18px; border-radius: var(--radius-pill); background: var(--control); position: relative; cursor: pointer; transition: background-color var(--t-ui) ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform var(--t-ui) var(--ease-out); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(12px); }

/* ---------- billing ---------- */
.plan-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.plan-price { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.plan-price small { font-size: 13.5px; color: var(--muted); font-weight: 400; }
.plan-lines { color: var(--muted); font-size: 13.5px; display: grid; gap: 7px; }
.payout-note { color: var(--faint); font-size: var(--fs-small); margin-top: 12px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--primary); color: var(--primary-ink); padding: 9px 15px; border-radius: 8px; font-size: 13px; font-weight: 500; opacity: 0; translate: 0 8px; transition: opacity var(--t-ui) ease, translate var(--t-ui) var(--ease-out); pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; translate: 0 0; }

/* ---------- phone ---------- */
.menu-toggle { display: none; }
.topbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: var(--ground); border-bottom: 1px solid var(--rule); }
  .topbar .name { font-weight: 600; font-size: 14px; }
  .sidebar { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; background: var(--ground); transform: translateX(-100%); transition: transform var(--t-ui) var(--ease-out); border-right: 0; }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .sidebar .scrim-close { display: inline-flex; }
  .canvas { padding: 22px 16px 64px; }
  .home-col, .settings-col { max-width: none; }
  .greeting h1 { font-size: 20px; }
  .tiles { margin-top: 24px; }
  .tile { grid-column: span 6; min-height: 100px; }
  .tile:nth-child(3), .tile:nth-child(4) { grid-column: span 6; }
  .triage { grid-template-columns: minmax(0, 1fr); }
  .triage .list-col.open-list { display: none; }
  .triage.show-open .list-col { display: none; }
  .detail-col { display: none; }
  .triage.show-open .detail-col { display: block; }
  .setting-section { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 0; }
  .form-head { flex-direction: column; align-items: stretch; }
  .form-head-actions { justify-content: flex-start; }
  .back-btn { display: inline-flex; }
}
@media (max-width: 480px) {
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; }
  .tile { grid-column: span 6; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }

/* ---------- app furniture (React shell) ---------- */
.stack { display: grid; gap: 13px; }
.row-top { display: flex; align-items: center; gap: 9px; width: 100%; }
.row-top .when { margin-left: auto; }
.row-top strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline .input { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.as-button { background: none; border: 0; text-align: left; width: 100%; cursor: pointer; }

.user-menu-btn { margin-left: auto; background: none; border: 0; color: var(--faint); font-size: 15px; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.user-menu-btn:hover { background: var(--surface); color: var(--text); }
.user-menu { position: absolute; right: 6px; bottom: calc(100% + 6px); min-width: 190px; background: var(--raised); border: 1px solid var(--border); border-radius: 10px; padding: 5px; display: grid; z-index: 40; }
.user-menu button { text-align: left; background: none; border: 0; color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.user-menu button:hover { background: var(--active); }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); border: 0; z-index: 25; cursor: default; }
@media (max-width: 860px) {
  .sidebar.open { box-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
  .scrim { display: block; }
}
@media (min-width: 861px) { .scrim { display: none; } }

.modal-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-card { width: min(430px, 100%); background: var(--raised); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head strong { font-size: 14.5px; }
.modal-x { background: none; border: 0; color: var(--faint); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-x:hover { background: var(--surface); color: var(--text); }
.field .hint { font-weight: 400; }

a.card-link { cursor: pointer; }
