/* VSPL DesignVault. Colours and type follow velloresemicon.com: navy and blue, a touch of the brand orange,
   green for "yours", light surfaces only. */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url(/static/fonts/dm-sans-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Syne"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/static/fonts/syne-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/static/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2-variations"); }
:root {
  --navy: #081b44; --ink: #1c2a4a; --muted: #5b667b; --faint: #8b95a8;
  --blue: #1f4fb8; --blue-hover: #173f96; --blue-soft: #eaf0fb; --blue-faint: #f4f7fd;
  --orange: #d75439; --orange-soft: #fcece6;
  --green: #18794a; --green-soft: #e4f4eb; --red: #c0392b; --red-soft: #fbeae8;
  --amber: #8a5a00; --amber-soft: #fdf1d6; --teal: #0e6b74; --teal-soft: #e1f2f3;
  --bg: #f5f7fb; --surface: #ffffff; --line: #e3e8f1; --line-strong: #cdd5e3;
  --radius: 8px; --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 72, .05); --shadow-lg: 0 10px 30px rgba(16, 32, 72, .14);
  --focus: 0 0 0 3px rgba(31, 79, 184, .2);
  --font: "DM Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Syne", "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
#app { flex: 1; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); margin: 0; }
.mono, .name.mono, .path, code { font-family: var(--font-mono); font-size: .92em; }
.ico { width: 16px; height: 16px; flex: none; } .ico.sm { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.product { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.product img { height: 28px; width: auto; display: block; }
.product b { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
nav.tabs { display: flex; align-items: stretch; gap: 2px; height: 100%; }
nav.tabs button, nav.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-weight: 500; cursor: pointer; text-decoration: none; position: relative; white-space: nowrap; }
nav.tabs button:hover, nav.tabs a:hover { color: var(--navy); }
nav.tabs button[aria-current="page"] { color: var(--blue); font-weight: 600; }
nav.tabs button[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }
nav.tabs .count { font-size: 11px; font-weight: 700; background: var(--blue); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.finder { display: inline-flex; align-items: center; gap: 8px; height: 34px; min-width: 200px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--blue-faint); color: var(--muted); cursor: pointer; }
.finder:hover { border-color: var(--blue); }
.kbd { margin-left: auto; font-size: 11px; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; background: var(--surface); }
.me { display: flex; align-items: center; gap: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.who-text { display: grid; line-height: 1.2; margin-right: 2px; } .who-name { font-weight: 600; color: var(--navy); font-size: 13px; white-space: nowrap; } .who-role { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.iconbtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--blue-soft); color: var(--blue); }

/* ---------------------------------------------------------------- page frame */
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; flex: 1; }
.wrap > *, .panel > *, .field { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 14px; }
.card h2 { font-size: 17px; font-weight: 700; }
.card h3, .sec { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.push { margin-right: auto; } .right { margin-left: auto; } .grow { flex: 1 1 160px; }
.muted, .hint { color: var(--muted); } .hint { font-size: 12.5px; margin: 0; }
.empty { color: var(--faint); margin: 0; padding: 10px 4px; font-size: 13px; }
.loading { padding: 40px; text-align: center; }
.small-text { font-size: 12.5px; } .span-all { grid-column: 1 / -1; } .gap-top { margin-top: 12px; } .tight { padding: 14px 16px; }
.w80 { width: 80px; } .w160 { width: 160px; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--navy); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: var(--blue-faint); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--blue); padding: 0 8px; }
.btn.ghost:hover:not(:disabled) { background: var(--blue-soft); border-color: transparent; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--red); } .btn.danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: none; box-shadow: var(--focus); }
input[type="text"], input[type="email"], input[type="password"], input:not([type]), input[inputmode], select {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 13.5px; }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
input::placeholder { color: var(--faint); }
.field { display: grid; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.field small { font-size: 12px; color: var(--muted); }
.field input, .field select { width: 100%; }
.err { color: var(--red); font-size: 13px; min-height: 1em; margin: 0; }
.err:empty { display: none; }
.checks { display: grid; gap: 8px; } .checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------------------------------------------------------- chips and messages */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--blue-faint); color: var(--muted); }
.chip.wip { color: var(--amber); background: var(--amber-soft); }
.chip.review { color: #b8462c; background: var(--orange-soft); }
.chip.released { color: var(--teal); background: var(--teal-soft); }
.chip.edit, .chip.yours { color: var(--green); background: var(--green-soft); }
.chip.view, .chip.some { color: var(--blue); background: var(--blue-soft); }
.chip.none, .chip.lock { color: var(--red); background: var(--red-soft); }
.chip.latest { color: var(--blue); background: var(--blue-soft); margin-left: 4px; }
.tag { font-size: 11px; color: var(--muted); }
.msg { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-radius: var(--radius); padding: 9px 12px; font-size: 13.5px; border: 1px solid transparent; }
.msg.ok { background: var(--green-soft); color: var(--green); border-color: #c4e6d2; }
.msg.bad { background: var(--red-soft); color: var(--red); border-color: #f2cdc8; }
.msg.info { background: var(--blue-faint); color: var(--ink); border-color: var(--line); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; max-width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--green); box-shadow: var(--shadow-lg); padding: 11px 14px; }
.toast.bad { border-left-color: var(--red); color: var(--red); } .toast.info { border-left-color: var(--blue); }

/* ---------------------------------------------------------------- library */
.vbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vbar .lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.vpill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; }
.vpill b { font-weight: 700; color: var(--navy); }
.vpill:hover { border-color: var(--blue); }
.vpill[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.vpill[aria-pressed="true"] b { color: var(--blue); }
.lm { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 12px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 220px; max-height: 320px; }
.col-head { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); }
.col-head h2 { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.list { overflow-y: auto; padding: 6px; display: grid; gap: 2px; align-content: start; }
.item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius); background: none; text-align: left; cursor: pointer; }
.item:hover { background: var(--blue-faint); }
.item[aria-current="true"] { background: var(--blue-soft); }
.item[aria-current="true"] .name { color: var(--blue); }
.item.locked { box-shadow: inset 3px 0 0 var(--red); } .item.mine { box-shadow: inset 3px 0 0 var(--green); }
.stack { display: grid; flex: 1; min-width: 0; }
.name { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub.red { color: var(--red); } .sub.green { color: var(--green); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.crumbs b { color: var(--navy); } .crumbs .sep { color: var(--faint); }
.title-row h2 { font-size: 20px; }
.libinfo { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; color: var(--muted); }
.libinfo b { color: var(--ink); font-weight: 600; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; display: grid; gap: 12px; background: var(--blue-faint); }
.panel.drop.over { border-color: var(--blue); background: var(--blue-soft); }
.dest { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.dest label.opt { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-content: start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.dest label.opt:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.dest .opt b { font-weight: 600; color: var(--navy); }
.dest .opt .inner, .dest .opt small { grid-column: 1 / -1; min-width: 0; }
.dest .opt small { font-size: 12px; color: var(--muted); font-family: var(--font-mono); overflow-wrap: anywhere; }
.dest select, .dest input[type="text"] { width: 100%; }
.picked { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; } .picked b { color: var(--navy); font-family: var(--font-mono); }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .25s; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.history b { color: var(--navy); font-weight: 600; }

/* ---------------------------------------------------------------- tables */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--blue-faint); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--blue-faint); }
.tbl td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.row { display: table-cell; } .tbl td.row > .btn { margin: 2px 4px 2px 0; }
.tbl tr.vert td { background: var(--blue-faint); font-weight: 600; color: var(--navy); }
.tbl tr.lib td:first-child { padding-left: 28px; font-family: var(--font-mono); font-size: 12.5px; }
.tbl select { height: 30px; font-size: 12.5px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.tree { display: grid; gap: 6px; font-size: 13px; }
.tree .v { display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--navy); }
.tree .l { display: flex; gap: 6px; align-items: center; padding-left: 16px; font-family: var(--font-mono); font-size: 12.5px; }
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--blue-faint); border: 1px solid var(--line); justify-self: start; }
.subtabs button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.subtabs button:hover { color: var(--navy); }
.subtabs button[aria-pressed="true"] { background: var(--surface); color: var(--blue); box-shadow: var(--shadow), 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.tile .ti { grid-row: span 2; width: 38px; height: 38px; border-radius: var(--radius); display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.tile b { font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile span { font-size: 12.5px; color: var(--muted); }
.tile.hot .ti { background: var(--orange-soft); color: var(--orange); }

/* ---------------------------------------------------------------- dialogs */
.modal-back, .palette-back { position: fixed; inset: 0; z-index: 80; background: rgba(8, 27, 68, .28); display: grid; padding: 16px; }
.modal-back { place-items: center; }
.modal { width: min(500px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 20px; display: grid; gap: 14px; }
.modal h2 { font-size: 17px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; }
.keybox { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; background: var(--surface); border: 1px dashed var(--blue); border-radius: var(--radius); padding: 8px 10px; margin-top: 6px; width: 100%; }
.palette-back { align-items: start; justify-items: center; padding-top: 12vh; }
.palette { width: min(620px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette input { flex: 1; height: auto; border: 0 !important; box-shadow: none !important; padding: 4px 0; font-size: 15px; background: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; color: var(--muted); }
.palette li[aria-selected="true"] { background: var(--blue-soft); color: var(--blue); }
.palette .path { flex: 1; color: var(--navy); font-size: 13px; overflow-wrap: anywhere; }
.palette .hint { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; }

/* ---------------------------------------------------------------- sign-in */
.auth { flex: 1; display: grid; place-items: center; padding: 48px 16px; background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); }
.signin { width: min(400px, 100%); padding: 28px; gap: 16px; }
.signin .brandrow { display: flex; justify-content: center; padding-bottom: 6px; }
.signin .brandrow img { height: 30px; width: auto; }
.signin h1 { font-family: var(--font-head); font-size: 22px; font-weight: 700; text-align: center; }
.signin h1 span { color: var(--blue); }
.signin .lede { margin: -10px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.signin input { width: 100%; height: 40px; font-size: 14px; }
.signin .btn.primary { width: 100%; height: 40px; font-size: 14px; }
.notice { margin: 0; font-size: 11.5px; color: var(--muted); text-align: center; }
.qr { width: 172px; height: 172px; image-rendering: pixelated; justify-self: center; border: 1px solid var(--line); border-radius: var(--radius); }
.secret { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-align: center; color: var(--navy); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- footer and legal pages */
footer.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer.foot .legal { margin-right: auto; }
footer.foot a { color: var(--muted); text-decoration: none; } footer.foot a:hover { color: var(--blue); }
.doc { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 24px 56px; line-height: 1.65; flex: 1; }
.doc h1 { font-family: var(--font-head); font-size: 30px; font-weight: 700; margin-bottom: 4px; }
.doc h2 { font-size: 16px; margin: 26px 0 4px; }
.doc .updated { color: var(--muted); font-size: 12.5px; margin: 0 0 8px; }
.doc ul { padding-left: 20px; } .doc li { margin: 3px 0; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1320px) { .finder .label, .finder .kbd { display: none; } .finder { min-width: 0; width: 34px; padding: 0; justify-content: center; } }
@media (max-width: 1240px) { .who-text { display: none; } }
@media (max-width: 960px) { nav.tabs span.tl { display: none; } }
@media (max-width: 900px) { .lm, .split, .grid2 { grid-template-columns: 1fr; } .col { min-height: 0; max-height: 240px; } }
@media (max-width: 640px) {
  .top { gap: 8px; padding: 0 12px; } .product b { display: none; } nav.tabs button { padding: 0 9px; }
  .avatar { display: none; }
  .wrap { padding: 14px 12px 32px; } .card { padding: 14px; } .hide-sm { display: none; }
  footer.foot { padding: 12px; }
}
