/* ============================================================
   Design Dragon — specimen-catalog design system
   Palette:  paper #EFEDE6 · card #FBFAF6 · ink #18181B
   Accent:   indigo #3B4CCA (actions, focus, links)
   Category: ui #3B5BDB · branding #BD5638 · marketing #2F7D4F
   Type:     Space Grotesk (display) · Space Mono (meta) · Inter (body)
   ============================================================ */

:root {
  --paper: #EFEDE6;
  --paper-2: #E7E4DB;
  --card: #FBFAF6;
  --ink: #18181B;
  --ink-2: #56544E;
  --ink-3: #8A877E;
  --line: #D8D4C8;
  --accent: #3B4CCA;
  --accent-soft: #E7E8FA;
  --ui: #3B5BDB;
  --branding: #BD5638;
  --marketing: #2F7D4F;
  --resources: #7A5AA0;
  --radius: 4px;
  --shadow: 0 1px 0 var(--line), 0 8px 24px -18px rgba(24, 24, 27, .5);
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ---------- gating: landing (signed out) vs app (signed in) ---------- */
.landing { display: none; }
body:not(.authed) .landing { display: block; }
body:not(.authed) .masthead,
body:not(.authed) .layout { display: none !important; }

.lp-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; background: #fff; border-bottom: 1.5px solid var(--ink);
}
.lp-nav .lp-logo { height: 46px; width: auto; display: block; }
.lp-hero { max-width: 780px; margin: 0 auto; padding: 84px 28px 52px; text-align: center; }
.lp-hero h1 {
  font-family: var(--display); font-weight: 700; font-size: 48px;
  line-height: 1.04; letter-spacing: -.02em; margin: 0 0 18px;
}
.lp-hero p { font-size: 18px; color: var(--ink-2); line-height: 1.55; margin: 0 auto 28px; max-width: 640px; }
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lp-cta .btn { padding: 12px 22px; font-size: 13px; }
.lp-features {
  max-width: 1000px; margin: 0 auto; padding: 16px 28px 88px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.lp-feat {
  background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.lp-feat .lp-ico { font-size: 22px; }
.lp-feat h3 { font-family: var(--display); font-weight: 500; font-size: 17px; margin: 10px 0 6px; }
.lp-feat p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.lp-foot {
  border-top: 1.5px solid var(--ink); padding: 20px 32px;
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
}
@media (max-width: 680px) {
  .lp-features { grid-template-columns: 1fr; }
  .lp-hero { padding-top: 56px; }
  .lp-hero h1 { font-size: 34px; }
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, rgba(59, 92, 219, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 92, 219, 0.09) 1px, transparent 1px);
  background-size: 26px 26px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 13px 28px;
  background: #fff;
  border-bottom: 1.5px solid var(--ink);
}
.brand { display: flex; flex-direction: column; gap: 6px; }
.brand .logo { height: 52px; width: auto; display: block; }
.brand-meta { display: flex; align-items: center; gap: 11px; }
.brand h1 {
  font-family: var(--display);
  font-weight: 700; font-size: 19px; letter-spacing: -.01em;
  margin: 0; line-height: 1;
}
.brand .sub {
  font-family: var(--mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-3);
}
.masthead .count {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 100px;
  padding: 4px 10px; white-space: nowrap;
}
.search {
  margin-left: auto; position: relative;
}
.search input {
  font-family: var(--body); font-size: 14px;
  width: 240px; max-width: 42vw;
  padding: 9px 12px 9px 32px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; align-items: start; }

.rail {
  position: sticky; top: 106px;
  padding: 24px 18px 40px;
  border-right: 1.5px solid var(--ink);
  height: calc(100vh - 106px); overflow-y: auto;
}
.rail h2 {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .16em; color: var(--ink-3);
  margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.rail h2:first-child { margin-top: 0; }
.drawer {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font-family: var(--body); font-size: 14px; text-align: left;
  padding: 7px 8px; margin: 1px 0;
  background: none; border: none; border-radius: var(--radius);
  color: var(--ink); cursor: pointer;
}
.drawer:hover { background: var(--paper-2); }
.drawer.active { background: var(--ink); color: var(--paper); }
.drawer .tab { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.drawer .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.drawer.active .n { color: var(--paper); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--card); color: var(--ink-2); cursor: pointer;
}
.tag-chip:hover { border-color: var(--ink); color: var(--ink); }
.tag-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.brain-chip {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 9px; border: 1px solid var(--resources); border-radius: 100px;
  background: #fff; color: var(--resources); cursor: pointer;
}
.brain-chip:hover { background: #f3eef9; }
.brain-chip.on { background: var(--resources); color: #fff; }

/* ---------- grid ---------- */
.collection { padding: 24px 28px 64px; }
.toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .08em;
}
.toolbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.toolbar .clear {
  text-transform: none; letter-spacing: 0;
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-family: var(--mono); font-size: 11px;
}
.toolbar .btn { text-transform: none; letter-spacing: .02em; padding: 7px 13px; }
/* grid masonry — wide kinds (website/image/board) span 2 columns, small kinds span 1 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  grid-auto-rows: 10px; column-gap: 16px; row-gap: 0;
  grid-auto-flow: row dense; align-items: start;
}
.grid > .card { width: 100%; }
.grid > .card.wide { grid-column: span 2; }
.grid > .empty { grid-column: 1 / -1; }

/* ---------- specimen card ---------- */
.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card .head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
}
.card .acc {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-2);
}
.card .cat {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2);
}
.card .cat .tab { width: 9px; height: 9px; border-radius: 2px; }

.plate {
  aspect-ratio: 4 / 3; width: 100%;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); color: #fff; font-size: 13px;
  letter-spacing: .04em; position: relative; overflow: hidden;
}
/* per-kind preset shapes */
.plate.k-font, .plate.k-logo, .plate.k-board { aspect-ratio: 1 / 1; }
.plate.k-website, .plate.k-link { aspect-ratio: 16 / 10; }
.plate.k-palette { aspect-ratio: 16 / 6; }
.plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plate.clickable { cursor: pointer; }
.plate.clickable::after {
  content: attr(data-action); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(24, 24, 27, .5); color: #fff;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  opacity: 0; transition: opacity .12s ease;
}
.plate.clickable:hover::after { opacity: 1; }
.card .copy.clickable { cursor: pointer; }
.card .copy.clickable:hover { background: var(--paper-2); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px);
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; padding: 9px 16px; border-radius: 100px;
  z-index: 80; opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.plate .kind {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .12em;
  background: rgba(24,24,27,.78); color: #fff; padding: 3px 7px; border-radius: 2px;
}
.swatches { display: flex; width: 100%; height: 100%; }
.swatches span { flex: 1; }

/* board / gallery: grid of thumbnails */
.board-grid { display: grid; width: 100%; height: 100%; gap: 1px; background: var(--line); }
.board-grid.n2 { grid-template-columns: 1fr 1fr; }
.board-grid.n3, .board-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.board-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* font specimen — Font Book style: dark plate, big light "Aa", weight below */
.plate.font-plate { background: #2b2b2e; color: #ededed; flex-direction: column; gap: 6px; }
.plate.font-plate .kind { display: none; }
.plate .specimen {
  font-size: 48px; line-height: 1; font-weight: 700;
  letter-spacing: -.01em; padding: 0 14px; text-align: center; color: #ededed;
}
.plate .font-style {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: #9a9a9d;
}

.card .body { padding: 12px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card h3 {
  font-family: var(--display); font-weight: 500; font-size: 15.5px;
  line-height: 1.25; margin: 0; letter-spacing: -.005em;
}
.card .copy {
  font-family: var(--body); font-size: 13.5px; color: var(--ink);
  border-left: 2px solid var(--accent); padding: 2px 0 2px 11px; margin: 0;
  font-style: italic;
}
.card .note { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.card .meta {
  margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
.card .meta a { display: inline-flex; align-items: center; gap: 4px; }
.card .meta .date { margin-left: auto; }
.card .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card .tags span {
  font-family: var(--mono); font-size: 10px; color: var(--ink-2);
  background: var(--paper-2); padding: 2px 6px; border-radius: 100px;
}
.card .tags .brain-tag { color: var(--resources); background: #f1ecf8; }
.card .owner-ctl { display: flex; gap: 8px; align-self: flex-start; }

/* ---------- empty ---------- */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 64px 20px;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  font-family: var(--mono); color: var(--ink-3); font-size: 13px;
}

/* ---------- modal (export) ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(24,24,27,.5);
  display: none; align-items: center; justify-content: center; z-index: 40; padding: 20px;
}
.scrim.open { display: flex; }
.modal {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
  width: min(560px, 100%); box-shadow: 0 30px 60px -30px rgba(24,24,27,.7);
}
.modal .m-head {
  display: flex; align-items: center; padding: 16px 18px; border-bottom: 1.5px solid var(--ink);
}
.modal h2 { font-family: var(--display); font-size: 16px; margin: 0; }
.modal .x { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--ink-2); }
.modal .m-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal p { margin: 0 0 4px; font-size: 13.5px; color: var(--ink-2); }
.dl { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.dl .f { font-family: var(--mono); font-size: 12px; }
.dl .d { font-size: 12px; color: var(--ink-3); }
.dl button {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  padding: 6px 12px; background: var(--ink); color: var(--paper);
  border: none; border-radius: var(--radius); cursor: pointer;
}
.dl button:hover { background: var(--accent); }

/* ---------- masthead actions: toggle, add, account ---------- */
/* center group (toggle + search + add); account sits to its right, pinned to the edge */
.actions { margin: 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.actions .search { margin-left: 0; }
.masthead > .account { flex: 0 0 auto; }

.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.btn.wide { width: 100%; justify-content: center; padding: 11px 14px; }

.toggle {
  display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden;
}
.toggle .seg {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  padding: 8px 15px; background: var(--card); color: var(--ink-2);
  border: none; cursor: pointer;
}
.toggle .seg + .seg { border-left: 1.5px solid var(--ink); }
.toggle .seg.active { background: var(--ink); color: var(--paper); }
.toggle .seg:hover:not(.active) { background: var(--paper-2); color: var(--ink); }

.account {
  font-family: var(--mono); font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border: 1.5px solid var(--ink); border-radius: 100px;
  background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.account:hover { background: var(--paper-2); }
.account.in { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.account.in::before { content: "●"; font-size: 9px; color: var(--marketing); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 13px; }
.form label {
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2);
}
.form .hint { text-transform: none; letter-spacing: 0; color: var(--ink-3); font-size: 10px; }
.form input, .form select, .form textarea {
  font-family: var(--body); font-size: 14px; width: 100%;
  padding: 9px 11px; border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* password field with show/hide eye */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--ink-3);
  padding: 6px; border-radius: var(--radius);
}
.pw-eye:hover { color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.auth-msg { font-size: 12.5px; margin: 0; padding: 8px 11px; border-radius: var(--radius); }
.auth-msg.err { color: #7c1f12; background: #f6e4de; }
.auth-msg.ok { color: var(--marketing); background: #e3f0e8; }
.auth-switch { font-size: 12.5px; color: var(--ink-2); margin: 12px 0 0 !important; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* ---------- account menu ---------- */
.acct-who { font-size: 13.5px; }
.acct-name-input {
  width: 100%; margin-top: 6px; padding: 8px 10px;
  font-family: var(--body); font-size: 14px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.acct-name-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.acct-row .ar-t { font-family: var(--display); font-size: 14px; color: var(--ink); }
.acct-row .ar-d { font-size: 12px; color: var(--ink-3); }
.acct-connect h3 { font-family: var(--display); font-size: 13px; margin: 8px 0 4px; }
.acct-connect pre {
  font-family: var(--mono); font-size: 11px; white-space: pre-wrap;
  background: var(--paper-2); color: var(--ink-2); padding: 10px 12px; border-radius: var(--radius); margin: 6px 0 0;
}
.modal.narrow { width: min(420px, 100%); }

/* delete on owned cards */
.card .del {
  align-self: flex-start; font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  color: var(--ink-3); background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 3px 9px; cursor: pointer;
}
.card .del:hover { border-color: var(--branding); color: var(--branding); }

/* ---------- account / profile page ---------- */
body.account-mode .layout { display: none; }
body.account-mode .actions { display: none; }
.account-page { display: none; }
body.account-mode #account-page { display: block; }

.account-page { max-width: 880px; margin: 0 auto; padding: 30px 28px 80px; }
.ap-head { margin-bottom: 22px; }
.ap-head .back { font-family: var(--mono); font-size: 12px; }
.ap-head h1 { font-family: var(--display); font-size: 26px; margin: 12px 0 2px; letter-spacing: -.01em; }
.ap-sub { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.ap-section {
  background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.ap-section > h2 { font-family: var(--display); font-size: 16px; margin: 0 0 14px; }
.ap-section > p { font-size: 13.5px; color: var(--ink-2); margin: 0 0 6px; }
.ap-count { font-family: var(--mono); font-size: 13px; color: var(--ink-3); font-weight: 400; }

.ap-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-fields label {
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2);
}
.ap-fields input {
  font-family: var(--body); font-size: 14px; padding: 9px 11px;
  border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink);
}
.ap-fields input:disabled { background: var(--paper-2); color: var(--ink-3); -webkit-text-fill-color: var(--ink-3); }
.ap-fields input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ap-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row .sr-text { display: flex; flex-direction: column; gap: 2px; }
.switch-row .sr-text b { font-family: var(--display); font-size: 14px; font-weight: 500; }
.switch-row .sr-text small { font-size: 12px; color: var(--ink-3); }
.switch-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }

.ap-default { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ap-default .sr-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }

.ap-exports { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.ap-signout { max-width: 200px; }

/* connection tiles */
.conn-sub { font-family: var(--display); font-size: 13px; margin: 6px 0 10px; color: var(--ink); }
.conn-note { margin: 0 0 4px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 6px; }
.conn-tile {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; font: inherit;
}
.conn-tile:hover { border-color: var(--ink); }
.conn-ico {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
}
.conn-ico img { width: 22px; height: 22px; object-fit: contain; display: block; }
.conn-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.conn-meta b { font-family: var(--display); font-size: 13.5px; font-weight: 500; }
.conn-meta small { font-size: 11px; color: var(--ink-3); }
.conn-status {
  margin-left: auto; font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: .1em; padding: 3px 7px; border-radius: 100px; white-space: nowrap;
}
.conn-status.soon { background: var(--paper-2); color: var(--ink-3); }
.conn-status.ready { background: #e3f0e8; color: var(--marketing); }
.conn-status.do { background: var(--accent-soft); color: var(--accent); }

/* import modal */
.import-head { display: flex; align-items: center; gap: 9px; }
.import-head img { width: 22px; height: 22px; object-fit: contain; }
.import-head h2 { margin: 0; }
.import-blurb { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
.fetch-btn { align-self: flex-start; }

/* universal drag & drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center;
  background: rgba(59, 76, 202, .10); pointer-events: none;
}
.drop-overlay.on { display: flex; }
.drop-card {
  background: #fff; border: 2px dashed var(--accent); border-radius: 12px;
  padding: 30px 44px; text-align: center; color: var(--accent);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 24px 60px -24px rgba(24, 24, 27, .55);
}
.drop-card b { font-family: var(--display); font-size: 18px; color: var(--ink); }
.drop-card small { color: var(--ink-3); font-size: 13px; }
.import-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.import-foot .btn.primary { flex: 1; justify-content: center; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); border-color: var(--ink); }

/* import preview list */
.import-preview { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; margin-bottom: 6px; }
.pv-item { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.pv-cover {
  width: 76px; height: 57px; flex: 0 0 auto; border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #fff; position: relative;
  font-family: var(--mono); font-size: 11px;
}
.pv-cover .pv-spec { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1; }
.pv-cover.pv-font { background: #2b2b2e; color: #ededed; }
.pv-cover.pv-font .pv-spec { color: #ededed; }
.pv-cover .pv-img { width: 100%; height: 100%; object-fit: cover; }
.pv-cover .pv-quote { font-family: var(--body); font-size: 11px; line-height: 1.25; font-style: italic; padding: 6px 8px; }
.pv-cover .board-grid { position: absolute; inset: 0; }
.pv-meta { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pv-title {
  font-family: var(--display); font-size: 14px; width: 100%;
  padding: 6px 9px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink);
}
.pv-row { display: flex; align-items: center; gap: 9px; }
.pv-cat {
  font-family: var(--body); font-size: 13px; padding: 5px 8px;
  border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink);
}
.pv-sugg { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.pv-tags, .pv-note {
  width: 100%; font-family: var(--body); font-size: 13px;
  padding: 6px 9px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.pv-note { resize: vertical; }
.pv-tags:focus, .pv-note:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--ink); }
.pv-rm { margin-left: auto; background: none; border: none; color: var(--ink-3); font-family: var(--mono); font-size: 11px; cursor: pointer; }
.pv-rm:hover { color: var(--branding); }

/* AI export dropdown */
.export-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 14px; padding: 11px 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: var(--radius); cursor: pointer;
}
.export-toggle:hover { background: var(--paper-2); }
.export-toggle .chev { margin-left: auto; transition: transform .15s ease; }
.export-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.export-panel { padding-top: 12px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: none; border-bottom: 1.5px solid var(--ink);
          display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .masthead { flex-wrap: wrap; gap: 14px; }
  .actions { margin: 0; width: 100%; justify-content: flex-start; gap: 10px; }
  .actions .search { order: 5; width: 100%; }
  .search input { width: 100%; max-width: none; }
  .brand .logo { height: 46px; }
  .ap-fields { grid-template-columns: 1fr; }
  .ap-default { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .grid > .card.wide { grid-column: span 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .12s ease, box-shadow .12s ease; }
  .card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--line), 0 16px 30px -18px rgba(24,24,27,.55); }
}
