/* Mockup Studio — shared design system
   Cool graphite neutrals with a teal bias; one accent, used only on live things.
   Every number and label is monospace: a design tool is read numerically. */

:root {
  --bg: #EEF1F2;
  --workbench: #E4E8EA;
  --panel: #F8FAFA;
  --panel-2: #FFFFFF;
  --line: #D3DADD;
  --line-soft: #E2E7E9;
  --ink: #131A1D;
  --ink-2: #4A565B;
  --muted: #7C8A90;
  --accent: #0E9E90;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(14,158,144,.12);
  --danger: #C8452F;
  --danger-soft: rgba(200,69,47,.10);
  --warn: #B47514;
  --link: #2C6ECB;
  --shadow-lg: 0 24px 60px -20px rgba(10,25,30,.28), 0 4px 12px -4px rgba(10,25,30,.12);
  --shadow-md: 0 8px 24px -10px rgba(10,25,30,.24);
  --shadow-sm: 0 1px 2px rgba(10,25,30,.06);
  --dot: rgba(19,26,29,.13);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r: 7px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1013; --workbench: #0F1417; --panel: #151C20; --panel-2: #1B2429;
    --line: #2A353B; --line-soft: #222C31; --ink: #E6ECEE; --ink-2: #AEBBC1; --muted: #7A888F;
    --accent: #12C2B0; --accent-ink: #04211E; --accent-soft: rgba(18,194,176,.15);
    --danger: #E4674E; --danger-soft: rgba(228,103,78,.12); --warn: #D9A038; --link: #6FA8F5;
    --shadow-lg: 0 30px 70px -24px rgba(0,0,0,.7), 0 4px 14px -6px rgba(0,0,0,.5);
    --shadow-md: 0 10px 30px -14px rgba(0,0,0,.6);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --dot: rgba(230,236,238,.10);
  }
}
:root[data-theme="light"] {
  --bg: #EEF1F2; --workbench: #E4E8EA; --panel: #F8FAFA; --panel-2: #FFFFFF;
  --line: #D3DADD; --line-soft: #E2E7E9; --ink: #131A1D; --ink-2: #4A565B; --muted: #7C8A90;
  --accent: #0E9E90; --accent-ink: #FFFFFF; --accent-soft: rgba(14,158,144,.12);
  --danger: #C8452F; --danger-soft: rgba(200,69,47,.10); --warn: #B47514; --link: #2C6ECB;
  --shadow-lg: 0 24px 60px -20px rgba(10,25,30,.28), 0 4px 12px -4px rgba(10,25,30,.12);
  --shadow-md: 0 8px 24px -10px rgba(10,25,30,.24);
  --shadow-sm: 0 1px 2px rgba(10,25,30,.06); --dot: rgba(19,26,29,.13);
}
:root[data-theme="dark"] {
  --bg: #0B1013; --workbench: #0F1417; --panel: #151C20; --panel-2: #1B2429;
  --line: #2A353B; --line-soft: #222C31; --ink: #E6ECEE; --ink-2: #AEBBC1; --muted: #7A888F;
  --accent: #12C2B0; --accent-ink: #04211E; --accent-soft: rgba(18,194,176,.15);
  --danger: #E4674E; --danger-soft: rgba(228,103,78,.12); --warn: #D9A038; --link: #6FA8F5;
  --shadow-lg: 0 30px 70px -24px rgba(0,0,0,.7), 0 4px 14px -6px rgba(0,0,0,.5);
  --shadow-md: 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --dot: rgba(230,236,238,.10);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 13px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.app { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0;
}
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: var(--r);
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); text-decoration: none;
}
.btn:hover { color: var(--ink); border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.btn.icon { width: 30px; padding: 0; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.lg { height: 38px; padding: 0 16px; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.mini-btn {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 5px; padding: 0;
}
.mini-btn:hover { color: var(--ink); background: var(--line-soft); }
.mini-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
svg { flex: none; }

/* ---------- inputs ---------- */
.in {
  width: 100%; min-width: 0; height: 30px; padding: 0 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums;
}
.in:hover { border-color: var(--muted); }
.in.text { font-family: var(--font-ui); font-size: 13px; }
select.in { padding: 0 4px; font-family: var(--font-ui); font-size: 12.5px; }
textarea.in { height: auto; min-height: 62px; padding: 7px 8px; font-family: var(--font-ui); font-size: 13px; resize: vertical; line-height: 1.45; }
label.lbl { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 5px; }
.field-block { margin-bottom: 12px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 50px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  display: grid; place-items: center; color: var(--accent-ink); flex: none;
}
.brand b { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.crumb .sep { opacity: .5; }
.tabs { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.tabs a {
  padding: 0 11px; height: 26px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 6px; color: var(--muted); font-size: 12.5px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* invitation bell */
.btn.bell { position: relative; overflow: visible; }
.btn.bell .bell-badge { display: none; }
.btn.bell.has { color: var(--accent); }
.btn.bell.has .bell-badge {
  display: grid; place-items: center; position: absolute; top: -3px; right: -3px;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
  background: var(--danger); color: #fff;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; line-height: 1;
  border: 1.5px solid var(--panel);
}
.invite {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
  padding: 11px 12px; margin-bottom: 8px;
}
.invite:last-child { margin-bottom: 0; }
.invite-msg {
  margin: 9px 0 0; padding: 7px 9px; border-radius: 7px;
  background: var(--bg); border-left: 2px solid var(--accent);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
}
.invite-pending {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-top: 1px solid var(--line-soft); opacity: .85;
}

.avatars { display: flex; }
.av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border: 1.5px solid var(--panel);
  margin-left: -6px; text-transform: uppercase;
}
.av:first-child { margin-left: 0; }
.av.me { background: var(--ink); color: var(--bg); }

/* ---------- centred auth pages ---------- */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: 12px 0 4px; font-size: 21px; letter-spacing: -.01em; }
.auth-card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 12.5px; }
.auth-card .in { height: 36px; }
.err {
  background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger);
  border-radius: 7px; padding: 7px 10px; font-size: 12px; margin-bottom: 12px;
}
.ok-note {
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--ink);
  border-radius: 7px; padding: 8px 10px; font-size: 12px; margin-bottom: 12px;
}

/* ---------- generic page shell ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 22px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 22px; }
.page-head h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.015em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.card:hover { border-color: var(--muted); }
.card .body { padding: 11px 12px; display: flex; align-items: center; gap: 8px; }
.card .body .t { flex: 1; min-width: 0; }
.card .body .t b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .body .t span { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.card .preview {
  aspect-ratio: 4/3; background: var(--workbench); position: relative; overflow: hidden;
  display: grid; place-items: center; border-bottom: 1px solid var(--line); cursor: pointer;
}
.card.new { border-style: dashed; align-items: center; justify-content: center; min-height: 190px; cursor: pointer; background: transparent; }
.card.new:hover { border-color: var(--accent); color: var(--accent); }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  padding: 0 12px 8px; border-bottom: 1px solid var(--line);
}
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tr:hover td { background: var(--panel); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 20px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 600;
  background: var(--line-soft); color: var(--ink-2);
}
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.off { background: var(--danger-soft); color: var(--danger); }

/* ---------- dialogs ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  color: var(--ink); padding: 0; box-shadow: var(--shadow-lg); max-width: 94vw; max-height: 90vh;
}
dialog::backdrop { background: rgba(6,12,14,.6); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.dlg-body { padding: 16px; overflow: auto; }
.dlg-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 13px 13px; }

/* ---------- command palette ---------- */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 6000; background: rgba(6,12,14,.5);
  backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start;
  padding-top: 14vh;
}
.cmdk {
  width: 100%; max-width: 540px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 13px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column;
}
.cmdk-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cmdk-icon { color: var(--muted); display: flex; }
.cmdk-input { flex: 1; border: 0; background: transparent; font-size: 15px; outline: none; }
.cmdk-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.cmdk-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.cmdk-row.on { background: var(--accent-soft); }
.cmdk-label { flex: 1; font-size: 13.5px; }
.cmdk-group { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cmdk-hint { font-size: 11px; color: var(--muted); }
.cmdk-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--bg); padding: 9px 15px; border-radius: 9px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 5000; box-shadow: var(--shadow-lg); max-width: 70vw;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- scrollbars ---------- */
.scroll { overflow: auto; min-height: 0; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--panel); }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
