/* SillyBus AI accounts — the account page and the owner dashboard.
   Palette and type are sillybusai.com's (Fraunces + Inter, the logo's gold),
   so the pages read as the same product. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #faf7f0; --panel: #fff; --panel-2: #f5f1e7; --ink: #1a1a17; --muted: #6b675c; --faint: #a39d8f;
  --rule: #e6e0d2; --gold: #e8a317; --accent: #b57a10; --accent-ink: #fff; --accent-soft: #fbf1dc;
  --good: #1f7a55; --good-soft: #e3f3ea; --bad: #b3372b; --bad-soft: #fbe7e4;
  --shadow: 0 1px 2px rgba(26,26,23,.06), 0 18px 40px -26px rgba(26,26,23,.3);
  --head: "Fraunces", Georgia, serif; --body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1); --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --panel: #1d1c19; --panel-2: #24221e; --ink: #f1ede4; --muted: #a8a294; --faint: #6f6a5e;
    --rule: #2f2c27; --accent: #e0af4f; --accent-ink: #141311; --accent-soft: #2a2316;
    --good: #6fcf9f; --good-soft: #17281f; --bad: #f08a80; --bad-soft: #2d1a17;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -26px rgba(0,0,0,.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --panel: #1d1c19; --panel-2: #24221e; --ink: #f1ede4; --muted: #a8a294; --faint: #6f6a5e;
  --rule: #2f2c27; --accent: #e0af4f; --accent-ink: #141311; --accent-soft: #2a2316;
  --good: #6fcf9f; --good-soft: #17281f; --bad: #f08a80; --bad-soft: #2d1a17; color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; font-family: var(--body); font-weight: 600; letter-spacing: 0; }
a { color: var(--accent); }
p { margin: 0; }
[hidden] { display: none !important; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 40rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 600; }
.brand img { height: 30px; width: auto; }
.brand .tag { font: 500 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 8px; }
.who { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack > * + * { margin-top: 12px; }

/* the one-line promise, above everything */
.promise { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r); padding: 14px 16px; font-size: .95rem; }
.promise svg { flex: none; margin-top: 2px; color: var(--accent); }

/* forms */
label { display: block; font-size: .82rem; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
input[type=email], input[type=password], input[type=text], input[type=number], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--rule);
  border-radius: 10px; padding: 10px 12px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field + .field { margin-top: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1 1 220px; width: auto; }
button, .btn { font: 600 .9rem/1 var(--body); border-radius: 10px; padding: 11px 16px; border: 1px solid var(--rule);
  background: var(--panel); color: var(--ink); cursor: pointer; transition: transform .12s var(--ease), background .15s, border-color .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover:not(:disabled) { border-color: var(--faint); }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.gold { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.quiet { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 10px; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note { font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.note.ok { color: var(--good); }
.note.bad { color: var(--bad); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; margin: 0; color: var(--ink); font-size: .92rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 999px; background: var(--rule); position: relative; transition: background .2s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 .75rem/1 var(--body); padding: 6px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.plain::before { display: none; }

/* credits meter */
.meter { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--rule); }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .8s var(--ease); }
.meter.low > i { background: var(--bad); }
.big-number { font: 600 clamp(2.4rem, 7vw, 3.4rem)/1 var(--head); letter-spacing: -.03em; }

/* plans */
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.plan { border: 1px solid var(--rule); border-radius: 12px; padding: 16px; background: var(--panel); position: relative; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .2s var(--ease); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.plan .price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan .price b { font: 600 1.5rem/1 var(--head); }
.plan .later { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; font-size: .85rem; }
.plan .current-badge { position: absolute; top: -10px; right: 12px; background: var(--accent); color: var(--accent-ink); font: 600 .7rem/1 var(--body); padding: 5px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.plan button { margin-top: auto; justify-content: center; width: 100%; }
.plan .inactive { margin-top: auto; display: block; }

/* everything to do with money: present, and visibly switched off */
.inactive { position: relative; opacity: .5; filter: grayscale(1); user-select: none; }
.inactive * { pointer-events: none; }
.inactive-flag { display: inline-flex; align-items: center; gap: 6px; font: 600 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border: 1px dashed var(--faint); border-radius: 999px; padding: 6px 10px; }

/* stat tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.tile .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.tile .v { font: 600 1.7rem/1 var(--head); letter-spacing: -.02em; }

/* chart */
.chart { width: 100%; height: 120px; display: block; }
.chart rect { fill: var(--gold); transition: opacity .15s; }
.chart rect.empty { fill: var(--rule); }
.chart rect:hover { opacity: .75; }

/* settings list */
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting .why { grid-column: 1; font-size: .82rem; color: var(--muted); }
.setting .ctl { grid-row: 1 / span 2; grid-column: 2; }
.setting .ctl input { width: 150px; }
.setting .ctl select { width: 190px; }
@media (max-width: 560px) { .setting { grid-template-columns: 1fr; } .setting .ctl { grid-row: auto; grid-column: 1; } }

/* accounts table */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
th { text-align: left; font: 600 .75rem/1 var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 8px 10px; border-bottom: 1px solid var(--rule); }
td { padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td select { width: auto; padding: 6px 8px; }
td input[type=number] { width: 84px; padding: 6px 8px; }
td .meter { width: 120px; height: 7px; }
tr.suspended td { color: var(--faint); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: .9rem; transition: all .25s var(--ease); pointer-events: none; z-index: 10; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

.reveal { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

footer { padding: 40px 0 48px; font-size: .82rem; color: var(--faint); }
code { font-size: .85em; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
