/* Persona Studio — design system and shell styles (STU-11).
   Color tokens and layout follow docs/mockups/STU-11-studios-workspace.html:
   dark workspace, amber accent, top bar, Studios rail on the left.
   Our own name and logo mark: no Metricool assets. */

:root {
  --bg: #0d0e11; --panel: #15171c; --panel2: #1b1e24; --line: #262a32; --line2: #323743;
  --text: #e9ebef; --muted: #9097a3; --dim: #646b77;
  --accent: #f5a524; --accent-ink: #1a1204; --accent-soft: rgba(245,165,36,.14);
  --ok: #3ccf8e; --warn: #f0b429; --bad: #f25f5c; --lip: #e8508a; --info: #5aa9ff;
  --field: #0f1115;
  --r: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-size: 12px; background: var(--field); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
.spacer, .sp { flex: 1; }

.app { display: grid; grid-template-rows: 48px 1fr; height: 100vh; }
.app.has-banner { grid-template-rows: 48px auto 1fr; }

/* ---------- Top bar ---------- */
.top { display: flex; align-items: center; gap: 18px; padding: 0 14px; background: #08090b; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.logo { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 10px; border-radius: 7px; color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a.on { background: var(--panel2); color: var(--text); }

.spend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.spend b { color: var(--text); }
.spend .meter { width: 90px; height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; display: inline-block; }
.spend .meter i { display: block; height: 100%; background: var(--accent); }
.spend.warn b, .spend.warn { color: var(--warn); }
.spend.over b, .spend.over { color: var(--bad); }
.spend.over .meter i { background: var(--bad); }
.btn, .pill { border: 1px solid var(--line2); background: var(--panel2); padding: 6px 11px; border-radius: 8px; color: var(--text); display: inline-block; }
.btn:hover, .pill:hover { border-color: var(--dim); }
.btn.primary, .pill.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: none; }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.pill.danger { color: var(--bad); border-color: rgba(242,95,92,.4); background: none; }
.pill.quiet { color: var(--muted); }
.pill.big { width: 100%; padding: 10px 14px; font-size: 14px; }
.btn:disabled, .pill:disabled { opacity: .5; cursor: not-allowed; }
select.pill { background: var(--field); }

/* user menu */
.switcher { position: relative; }
.switcher summary { list-style: none; cursor: pointer; }
.switcher summary::-webkit-details-marker { display: none; }
.me { width: 28px; height: 28px; border-radius: 50%; background: #2b3040; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.switcher .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 6px; z-index: 30; }
.menuitem { width: 100%; display: block; background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.menuitem:hover { background: var(--panel2); }
.menutext { display: flex; flex-direction: column; line-height: 1.3; }
.menutext small { color: var(--muted); font-size: 11px; }
.usermenu form { margin: 0; }

/* Expiry banner under the top bar */
.banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 14px; font-size: 12px; border-bottom: 1px solid var(--line); }
.banner.warn { background: rgba(240,180,41,.12); color: var(--warn); }
.banner.urgent, .banner.expired { background: rgba(242,95,92,.12); color: var(--bad); }
.banner a { margin-left: auto; font-weight: 600; text-decoration: underline; }

/* ---------- Body: Studios rail + main ---------- */
.body { display: grid; grid-template-columns: 240px 1fr; min-height: 0; }

.rail { border-right: 1px solid var(--line); background: #101216; display: flex; flex-direction: column; min-height: 0; }
.rail-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.rail-h b { font-size: 11px; letter-spacing: .08em; color: var(--dim); }
.plus { width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 18px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.chips { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line2); background: none; border-radius: 20px; padding: 2px 8px; font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.chip:hover { color: var(--text); }
.chip.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.studios { overflow: auto; padding: 0 8px 8px; flex: 1; }
.srow { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 9px; }
.srow:hover { background: var(--panel); }
.srow.on { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.srow .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .m { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.rail-empty { padding: 10px 8px; color: var(--dim); font-size: 12px; }
.rail-f { border-top: 1px solid var(--line); padding: 10px 14px; font-size: 11px; color: var(--dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.main { overflow: auto; min-height: 0; position: relative; }
.pad { padding: 22px 26px; }

/* ---------- Studios home ---------- */
.hero { text-align: center; padding: 38px 20px 8px; }
.hero h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); margin: 6px 0 0; }
.prompt { max-width: 820px; margin: 20px auto 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 14px; box-shadow: 0 0 0 1px rgba(245,165,36,.05), 0 20px 60px -30px rgba(245,165,36,.35); }
.prompt textarea { width: 100%; height: 58px; background: none; border: 0; resize: none; font-size: 14px; outline: none; }
.prompt .prow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ppill { border: 1px solid var(--line2); background: var(--panel2); border-radius: 8px; padding: 5px 9px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.ppill.add { border-style: dashed; color: var(--muted); background: none; }
.ppill .k { color: var(--dim); }
.go { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-left: auto; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 12px; }
.sec-h h2 { font-size: 12px; letter-spacing: .08em; color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.newcard { border: 1px dashed var(--line2); border-radius: 12px; display: grid; place-items: center; min-height: 190px; color: var(--muted); }
.newcard:hover { border-color: var(--accent); color: var(--text); }
.newcard b { display: block; font-size: 28px; color: var(--accent); text-align: center; }
.stage { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 1px 7px; border-radius: 20px; background: var(--panel2); color: var(--muted); }
.stage.ok { color: var(--ok); } .stage.run { color: var(--accent); } .stage.wait { color: var(--info); } .stage.todo { color: var(--warn); }

/* ---------- Picture placeholder (graphic-novel feel: gradient + halftone) ---------- */
.art { position: relative; overflow: hidden; background: linear-gradient(170deg, #121316 0%, #2c2f36 60%, #5b616c 100%); display: grid; place-items: center; color: var(--muted); }
.art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.4px); background-size: 5px 5px; opacity: .55; pointer-events: none; }
.badge { position: absolute; top: 8px; font-size: 11px; background: rgba(0,0,0,.65); padding: 1px 6px; border-radius: 5px; z-index: 2; color: var(--text); }
.badge.l { left: 8px; } .badge.r { right: 8px; }

/* ---------- Library ---------- */
.lhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lhead h2 { margin: 0; font-size: 20px; }
.ltabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 12px; flex-wrap: wrap; }
.ltabs a { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.ltabs a:hover { color: var(--text); }
.ltabs a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.ltabs .c { color: var(--dim); margin-left: 4px; font-size: 11px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg a { padding: 5px 9px; color: var(--muted); font-size: 12px; }
.seg a.on { background: var(--panel2); color: var(--text); }
.ltable { width: 100%; border-collapse: collapse; }
.ltable th { font-size: 11px; color: var(--dim); text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600; }
.ltable th a:hover { color: var(--text); }
.ltable th.sorted { color: var(--accent); }
.ltable td { padding: 7px 8px; border-bottom: 1px solid #1a1d23; vertical-align: middle; }
.ltable tr:hover td { background: var(--panel); }
.ltable td.mut { color: var(--muted); white-space: nowrap; }
.lt { width: 64px; height: 38px; border-radius: 5px; object-fit: cover; display: grid; }
.type { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.type.video, .type.short { color: var(--accent); } .type.lip { color: var(--lip); } .type.clip { color: var(--info); } .type.keyframe { color: var(--ok); }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; }
.gcard:hover { border-color: var(--line2); }
.gart { display: block; position: relative; height: 96px; }
.gimg { width: 100%; height: 96px; object-fit: cover; display: grid; }
.gcard .b { display: block; padding: 8px 10px; }
.gcard .t { display: block; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .m { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; margin-top: 3px; }

/* ---------- Cast (reference sheets) ---------- */
.lib { display: grid; grid-template-columns: 230px 1fr; min-height: 100%; }
.libnav { border-right: 1px solid var(--line); padding: 14px 10px; background: #101216; }
.libnav h4 { font-size: 11px; letter-spacing: .08em; color: var(--dim); margin: 14px 6px 6px; }
.li { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; }
.li:hover { background: var(--panel); }
.li.on { background: var(--panel2); }
.liart { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: top; flex-shrink: 0; }   /* top = the head, when only a full-body view exists */
.lisub { display: block; font-size: 11px; color: var(--muted); }
.newsheet { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding: 0 4px; border-top: 1px solid var(--line); }
.newsheet h4 { margin-left: 2px; }
.sheet { padding: 20px 24px; min-width: 0; }
.sheethead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheethead h2 { margin: 0; font-size: 20px; }
.sheethead form { margin: 0; }
.seclbl { font-size: 11px; color: var(--dim); margin: 12px 0 6px; font-weight: 600; letter-spacing: .03em; }
.slots { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); }
.slots.n3 { grid-template-columns: repeat(3, 1fr); }
.slots.n5 { grid-template-columns: repeat(5, 1fr); }
.slots.n1 { grid-template-columns: minmax(0, 520px); }
.slotart { display: grid; grid-template: 100% / 100%; place-items: center; height: 420px; border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px solid var(--line); background-color: var(--panel); }
.slots.n5 .slotart { height: 130px; }
.slots.n1 .slotart { height: 290px; }
.slotart:hover { border-color: var(--accent); }
.slotart img { width: 100%; height: 100%; object-fit: contain; display: block; }   /* the whole picture, never cropped */
.slotart:not(.art) { background-color: #0b0c0f; }
.slotadd { position: relative; z-index: 1; font-size: 12px; color: var(--text); background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: 20px; }
.grouphead { display: flex; align-items: center; gap: 12px; }
.grouphead form { margin: 0; }
.grouphead .btn { font-weight: 400; letter-spacing: 0; color: var(--text); cursor: pointer; }
/* cropping one picture into several views */
.cropkeys { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.cropkey { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; border: 2px solid var(--kc); }
.cropstage { position: relative; display: inline-block; max-width: 100%; line-height: 0; user-select: none; touch-action: none; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.cropstage img { max-width: 100%; max-height: calc(100vh - 230px); display: block; }
.cropbox { position: absolute; border: 2px solid var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); cursor: move; box-sizing: border-box; }
.croplabel { position: absolute; left: 0; top: 0; background: var(--kc); color: #0b0c0f; font-size: 11px; font-weight: 700; line-height: 1.4; padding: 1px 7px; border-radius: 0 0 6px 0; pointer-events: none; }
.crophandle { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; background: var(--kc); border-radius: 6px 0 0 0; cursor: nwse-resize; }
.c0 { --kc: #f5a524; } .c1 { --kc: #5aa9ff; } .c2 { --kc: #3ccf8e; } .c3 { --kc: #e8508a; } .c4 { --kc: #b39ddb; }
.cap2 { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: center; }
.cap2 a, .linkbtn { color: var(--muted); text-decoration: underline; background: none; border: 0; padding: 0; font-size: 11px; }
.inlineform { display: inline; margin: 0; }
.sheetform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 18px; }
.sw { display: flex; gap: 8px; }
.sw i { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line2); }
.notes { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: #cfd3da; }

/* ---------- Projects: the box that starts one, the cards, a project's own page ---------- */
.ppill select { background: none; border: 0; padding: 0; color: var(--text); font-size: 12px; max-width: 170px; }
.ppill select:focus { outline: 0; }
.ppill select option { background: var(--panel2); }
label.ppill { cursor: pointer; }
.ppill.add.has { border-style: solid; border-color: var(--accent); color: var(--text); }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; }
.pcard:hover { border-color: var(--line2); }
.pcart { display: block; height: 118px; }
.pcard .b { display: block; padding: 10px 11px; }
.pcard .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .m { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; margin-top: 3px; }
.shead { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #111318; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.shead h2 { margin: 0; font-size: 16px; }
.persona-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.steps-bar { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.step { padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.step .n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: var(--line); color: var(--muted); }
.step.done .n { background: var(--ok); color: #062014; }
.step.on { background: var(--panel2); color: var(--text); }
a.step:hover { color: var(--text); }
#storyboard, #keyframes, #people { scroll-margin-top: 70px; }
.step.on .n { background: var(--accent); color: var(--accent-ink); }
/* keyframe grid */
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kf { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kf.approved { border-color: rgba(60,207,142,.45); }
.kfart { display: block; position: relative; aspect-ratio: 16 / 9; background-color: #0b0c0f; }
.kfart img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kn { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 10px; font-weight: 700; background: var(--accent); color: var(--accent-ink); padding: 0 5px; border-radius: 4px; }
.st { position: absolute; top: 6px; right: 6px; z-index: 2; font-size: 10px; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,.7); color: var(--muted); }
.st.approved { color: var(--ok); } .st.ready { color: var(--warn); }
.kmic { position: absolute; bottom: 6px; left: 6px; z-index: 2; font-size: 10px; background: var(--lip); padding: 0 5px; border-radius: 4px; }
.kf .b { padding: 8px 10px 10px; font-size: 12px; }
.kf .b b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kf .b .sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.kfact { display: flex; gap: 6px; margin-top: 8px; align-items: flex-start; flex-wrap: wrap; }
.kfact form { margin: 0; }
.kfmore { flex: 1; min-width: 0; }
.kfmore summary { list-style: none; display: inline-block; cursor: pointer; }
.kfmore summary::-webkit-details-marker { display: none; }
.kfredo { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.kfredo textarea { width: 100%; font-size: 12px; }
.kftakes { margin-top: 6px; font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kftakes form, .kfup { margin: 0; display: inline; }
.kfup { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* storyboard table */
.sb { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.sb th { font-size: 11px; color: var(--dim); text-align: left; font-weight: 600; padding: 0 8px; }
.sb td { background: var(--panel2); padding: 8px; vertical-align: top; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sb td:first-child { border-left: 1px solid var(--line); border-radius: 9px 0 0 9px; }
.sb td:last-child { border-right: 1px solid var(--line); border-radius: 0 9px 9px 0; }
.sb tr.actrow td { background: none; border: 0; padding: 14px 8px 2px; color: var(--accent); font-size: 13px; }
.sb tr.actrow .sub, .sb tr.actrow .note { color: var(--muted); }
.sb .num { font-weight: 700; color: var(--accent); width: 28px; }
.sb .what { color: #cfd3da; }
.mini { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; margin: 2px 3px 0 0; background: var(--field); border: 1px solid var(--line2); color: var(--muted); }
.mic { font-size: 11px; color: var(--dim); white-space: nowrap; }
.mic.on { color: var(--lip); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tile { border: 1px solid var(--line2); border-radius: 8px; height: 48px; display: grid; place-items: center; font-size: 11px; font-weight: 400; color: var(--muted); background: var(--field); text-align: center; cursor: pointer; }
.tile.on, .tile:has(input:checked) { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 400; }

/* ---------- Page header ---------- */
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 20px; font-weight: 700; margin: 0; }
.head .sub, .sub { color: var(--muted); font-size: 12px; }

/* ---------- Cards and lists ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.card.dim { opacity: .75; }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.grid2 > * { min-width: 0; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-of-type { border-bottom: 0; }
.chan { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chan:last-child { border-bottom: 0; }
.chan .chantext { flex: 1; min-width: 0; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--ok); }
.tag.warn, .tag.guard { color: var(--warn); background: rgba(240,180,41,.12); }
.tag.urgent, .tag.expired { color: var(--bad); background: rgba(242,95,92,.12); }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.note.tight { margin: 0; }
.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.empty.tall { padding: 40px 12px; text-align: center; line-height: 1.7; }
.samplenote { font-size: 11px; color: var(--dim); margin: 22px 0 0; }
.okline { color: var(--ok); font-weight: 500; }
.dimline { color: var(--muted); font-style: italic; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13px; color: #cfd3da; }
.kv div:nth-child(odd) { color: var(--dim); }

.avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line2); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; border-radius: 10px; }

/* ---------- Personas ---------- */
.phead { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.phead h3 { margin: 0; }
.phead-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.guardtext { color: var(--warn); background: rgba(240,180,41,.1); border-radius: 6px; padding: 4px 8px; }

/* ---------- Settings ---------- */
.keyrow { padding: 14px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-of-type { border-bottom: 0; }
.keyhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.keyhead .fname { width: 110px; }
.keyhead .fpurpose { color: var(--muted); font-size: 12px; }
.keymeta { font-size: 12px; color: var(--muted); margin: 6px 0 0 0; }
.keyform { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.keyform.inline { display: inline-flex; margin-top: 8px; }
.keyform input[type="password"], .keyform input[type="email"], .keyform input[type="file"] { flex: 1; min-width: 260px; }
.keyform .expiry { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.warnbox { background: var(--accent-soft); border: 1px solid rgba(245,165,36,.35); color: var(--text); border-radius: 9px; padding: 10px 12px; font-size: 12px; margin-top: 12px; }
.warnbox a { color: var(--accent); text-decoration: underline; }

.flash { border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; border: 1px solid var(--line2); }
.flash.ok { background: rgba(60,207,142,.1); color: var(--ok); border-color: rgba(60,207,142,.35); }
.flash.warn { background: rgba(240,180,41,.1); color: var(--warn); border-color: rgba(240,180,41,.35); }
.flash.error { background: rgba(242,95,92,.1); color: var(--bad); border-color: rgba(242,95,92,.35); }

/* ---------- Forms ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="file"], textarea, select {
  background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px; color: var(--text); color-scheme: dark;
}
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); outline-offset: 0; }
::placeholder { color: var(--dim); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.lbl input, .lbl select, .lbl textarea { font-weight: 400; }
.lbl textarea { resize: vertical; line-height: 1.5; }
.lbl .note { font-weight: 400; }
.lbl input[type="color"] { width: 60px; height: 34px; border: 1px solid var(--line2); border-radius: 8px; background: var(--field); padding: 2px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.row-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

/* ---------- Splash / sign-in pages ---------- */
body.splash { background: radial-gradient(1200px 600px at 20% -10%, #1f1a10 0%, var(--bg) 55%, #050607 100%); min-height: 100vh; height: auto; }
.splash-wrap { max-width: 440px; margin: 0 auto; padding: 56px 16px 40px; }
.splash-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 22px; }
.splash-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 16px; box-shadow: 0 10px 30px rgba(245,165,36,.3); }
.splash-name { font-size: 20px; font-weight: 700; }
.splash-tag { font-size: 12px; color: var(--muted); margin-top: 2px; }
.splash-card { padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.splash-card h1 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.splash-card .sub { color: var(--muted); margin: 0 0 16px; line-height: 1.5; font-size: 13px; }
.splash-foot { text-align: center; margin-top: 16px; font-size: 13px; }
.splash-foot a, .splash-foot .linkbtn { color: var(--muted); text-decoration: underline; background: none; border: 0; font: inherit; cursor: pointer; }
.steps { padding-left: 20px; margin: 0 0 14px; line-height: 1.6; }
.steps li { margin-bottom: 8px; }
.qr { background: #fff; border-radius: 10px; padding: 8px; width: 200px; margin: 8px 0; }
.qr svg { width: 100%; height: auto; display: block; }
.manualkey { letter-spacing: .08em; font-size: 12px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 8px 0 16px; }
.codes code { font-size: 15px; padding: 8px 10px; border-radius: 8px; text-align: center; letter-spacing: .06em; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #000c; border: 1px solid var(--line2); color: var(--text); padding: 9px 16px; border-radius: 30px; font-size: 12px; z-index: 50; backdrop-filter: blur(6px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .grid2, .grid2.even { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app { height: auto; display: block; }
  .top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .body { display: block; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .pad { padding: 16px; }
  .formgrid { grid-template-columns: 1fr; }
}

/* Spend history (Team page) */
.spendstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.spendstats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.spendstats small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.spendstats b { font-size: 20px; }
.spendbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; }
.spendbars .bar { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.spendbars .amt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.spendbars .col { width: 100%; height: 110px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.spendbars .col i { display: block; width: 100%; min-height: 0; border-radius: 5px 5px 0 0; background: var(--line); }
.spendbars .bar.now .col i { background: var(--accent); }
.spendbars .bar.now .amt { color: var(--text); font-weight: 700; }
.spendbars .mon { font-size: 11px; color: var(--muted); white-space: nowrap; }
.spendbars .mon small { opacity: .7; }

/* Plans (STU-17) */
.banners { display: flex; flex-direction: column; }
.planform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.menutext small + small { display: block; }
.planform input[type=number], .planform input[type=search], .planform input[type=text], .planform input[type=date] {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); color: var(--text); font: inherit; }
.planform .expiry { display: flex; align-items: center; gap: 6px; }

/* Inkreel logo (docs/logo, option B: reel and stroke) */
.brandlogo { height: 30px; width: auto; display: block; }
.splash-logo { height: 64px; width: auto; display: block; margin-left: -6px; }

/* Billing (STU-21) */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.planbox { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.planname { font-weight: 700; }
.planprice { font-size: 28px; font-weight: 800; }
.planprice small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Copy-to-clipboard buttons */
.copybtn { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 6px; padding: 1px 6px; font-size: 13px; line-height: 1.5; cursor: pointer; vertical-align: middle; }
.copybtn.wide { font-size: 11px; padding: 2px 8px; }
.copybtn:hover { color: var(--text); border-color: var(--accent); }

/* Continue with Google */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; border: 1px solid var(--line2, var(--line)); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.gbtn:hover { border-color: var(--accent); }
.ordiv { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.ordiv::before, .ordiv::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack .ordiv { margin: 2px 0; }

.soon { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-right: 6px; }
