/* Mantel studio. Linear-style: quiet chrome, dense lists, keyboard-first, light and dark. */

:root {
  color-scheme: light;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bg: #ffffff;
  --bg-sidebar: #f6f6f7;
  --bg-elev: #ffffff;
  --bg-hover: #f0f0f2;
  --bg-active: #e8e8eb;
  --bg-subtle: #fafafa;
  --bg-input: #ffffff;
  --border: #e7e7ea;
  --border-strong: #d7d7dc;
  --text: #1c1c20;
  --text-2: #5d5f66;
  --text-3: #8d8f96;
  --brand: #5e6ad2;
  --brand-hover: #4e59c0;
  --brand-soft: rgba(94, 106, 210, 0.12);
  --brand-text: #ffffff;
  --green: #2f9e65;
  --yellow: #c99a06;
  --orange: #db7a2c;
  --red: #dc3d43;
  --gray: #9b9ca3;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(94, 106, 210, 0.45);
  --shadow-pop: 0 10px 30px -6px rgba(15, 15, 20, 0.16), 0 0 0 1px rgba(15, 15, 20, 0.07);
  --shadow-card: 0 1px 2px rgba(15, 15, 20, 0.04), 0 0 0 1px var(--border);
  --radius: 6px;
  --radius-lg: 10px;

  /* The editor's stylesheet reads these. */
  --paper: var(--bg);
  --ink: var(--text);
  --muted: var(--text-2);
  --line: var(--border);
  --chip: var(--bg-elev);
  --accent: var(--bg-hover);
  --accent-ink: var(--brand);
  --live: var(--green);
  --editor-soft: #f2f2f4;
  --editor-hover: #eef0fb;
  --editor-faint: #a8aab1;
  --editor-mark: #fde68a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141518;
    --bg-sidebar: #0f1012;
    --bg-elev: #1b1c20;
    --bg-hover: #212227;
    --bg-active: #2a2b31;
    --bg-subtle: #17181b;
    --bg-input: #17181b;
    --border: #26272c;
    --border-strong: #34353c;
    --text: #e7e7ea;
    --text-2: #a2a3ab;
    --text-3: #6f7078;
    --brand: #7380e0;
    --brand-hover: #828ee6;
    --brand-soft: rgba(115, 128, 224, 0.16);
    --green: #4cb782;
    --yellow: #e2b93b;
    --orange: #e8914b;
    --red: #eb5a5f;
    --gray: #7d7e86;
    --shadow-pop: 0 12px 34px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
    --editor-soft: #202126;
    --editor-hover: #24263a;
    --editor-faint: #5f6067;
    --editor-mark: #6b5a17;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141518;
  --bg-sidebar: #0f1012;
  --bg-elev: #1b1c20;
  --bg-hover: #212227;
  --bg-active: #2a2b31;
  --bg-subtle: #17181b;
  --bg-input: #17181b;
  --border: #26272c;
  --border-strong: #34353c;
  --text: #e7e7ea;
  --text-2: #a2a3ab;
  --text-3: #6f7078;
  --brand: #7380e0;
  --brand-hover: #828ee6;
  --brand-soft: rgba(115, 128, 224, 0.16);
  --green: #4cb782;
  --yellow: #e2b93b;
  --orange: #e8914b;
  --red: #eb5a5f;
  --gray: #7d7e86;
  --shadow-pop: 0 12px 34px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --editor-soft: #202126;
  --editor-hover: #24263a;
  --editor-faint: #5f6067;
  --editor-mark: #6b5a17;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-sidebar);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: 0.5; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
a { color: inherit; }
svg { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { color: var(--text-3); padding: 24px; }

/* ---------- Shell ---------- */

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }
.app.bare { display: block; background: var(--bg); overflow: auto; }


.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  padding: 8px 8px 10px; gap: 2px; overflow-y: auto;
}
.side-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.site-switch {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 6px; border-radius: var(--radius); font-weight: 560;
}
.site-switch:hover { background: var(--bg-hover); }
.site-switch .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark {
  width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #6c78e6, #9a5fd1); color: #fff; font-size: 11px; font-weight: 650;
}
.icon-btn {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius); color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

.nav-section {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 2px; padding: 0 8px; height: 24px; color: var(--text-3); font-size: 12px; font-weight: 550;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 28px; padding: 0 8px;
  border-radius: var(--radius); color: var(--text-2); text-align: left; font-weight: 500;
}
.nav-item svg { width: 16px; height: 16px; color: var(--text-3); }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--bg-active); color: var(--text); }
.nav-item[aria-current="page"] svg { color: var(--text); }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav-item .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-text); font-size: 11px; font-weight: 600;
}
.side-foot { margin-top: auto; padding-top: 10px; display: grid; gap: 2px; }
.avatar {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--bg-active); color: var(--text-2); font-size: 10px; font-weight: 650;
}

.main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  margin: 8px 8px 8px 0; background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--border); overflow: hidden;
}
.topbar {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border); flex: none;
}
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-weight: 500; }
.crumbs button { color: var(--text-2); border-radius: 4px; padding: 2px 4px; margin: 0 -4px; white-space: nowrap; }
.crumbs button:hover { color: var(--text); background: var(--bg-hover); }
.crumbs .sep { color: var(--text-3); }
.crumbs .current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.save-state { color: var(--text-3); font-size: 12px; margin-right: 4px; white-space: nowrap; }
.save-state.dirty { color: var(--yellow); }

.toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 40px; padding: 6px 12px 6px 16px;
  border-bottom: 1px solid var(--border); flex: none;
}
.toolbar .grow { flex: 1; }
.view { flex: 1; min-height: 0; overflow-y: auto; }

/* ---------- Controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--radius); font-weight: 500; white-space: nowrap;
  background: var(--bg-elev); box-shadow: 0 0 0 1px var(--border-strong) inset; color: var(--text);
}
a.btn { text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--bg-hover); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); color: var(--brand-text); box-shadow: none; }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn.ghost { background: none; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.small { height: 24px; padding: 0 8px; font-size: 12px; }
.btn kbd, .kbd {
  font-family: var(--font); font-size: 11px; color: inherit; opacity: 0.7;
  border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; line-height: 15px;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px;
  color: var(--text-2); box-shadow: 0 0 0 1px var(--border) inset; font-size: 12px; font-weight: 500; white-space: nowrap;
}
button.chip:hover { background: var(--bg-hover); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 1px transparent inset; }
.chip svg { width: 12px; height: 12px; }
.search {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--border) inset; color: var(--text-3); min-width: 180px;
}
.search svg { width: 14px; height: 14px; }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--text); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 4px;
  font-size: 11.5px; font-weight: 500; color: var(--text-2); background: var(--bg-hover); white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tag.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.tag.yellow { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }

input.input, textarea.input, select.input {
  width: 100%; min-height: 30px; padding: 5px 8px; border-radius: var(--radius); border: 0;
  background: var(--bg-input); box-shadow: 0 0 0 1px var(--border-strong) inset; outline: none;
}
input.input:focus, textarea.input:focus, select.input:focus { box-shadow: 0 0 0 1px var(--brand) inset, 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; line-height: 1.5; }
.field { display: grid; gap: 5px; margin: 0 0 14px; }
.field > span { color: var(--text-2); font-size: 12px; font-weight: 500; }
.help { color: var(--text-3); font-size: 12px; margin: -8px 0 14px; }

/* ---------- Status icons ---------- */

.status { width: 14px; height: 14px; display: inline-grid; place-items: center; flex: none; }
.status svg { width: 14px; height: 14px; }
.status.draft { color: var(--gray); }
.status.edited { color: var(--yellow); }
.status.published { color: var(--brand); }
.status.archived { color: var(--gray); }
.status.live { color: var(--green); }
.status.failed { color: var(--red); }
.status.unknown { color: var(--gray); }
.status.building { color: var(--yellow); }
.status.building svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.star { color: var(--yellow); width: 13px; height: 13px; }

/* ---------- Lists ---------- */

.list { padding-bottom: 40px; }
.group-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border);
  font-weight: 560; color: var(--text);
}
.group-head .count { color: var(--text-3); font-weight: 500; }
.group-head .toggle { color: var(--text-3); display: grid; place-items: center; }
.group-head .toggle svg { width: 14px; height: 14px; transition: transform 0.12s; }
.group.collapsed .toggle svg { transform: rotate(-90deg); }
.group.collapsed .rows { display: none; }
.group-head .actions { margin-left: auto; display: flex; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 16px; text-align: left;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.row:hover, .row.cursor { background: var(--bg-hover); }
.row .title { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row .sub { min-width: 0; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.row .meta { color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.row .hover-actions { display: none; gap: 4px; }
.row:hover .hover-actions, .row.cursor .hover-actions { display: flex; }
.row .lead { width: 14px; height: 14px; display: grid; place-items: center; color: var(--text-3); }
.row .lead svg { width: 14px; height: 14px; }

.empty {
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 72px 24px; color: var(--text-2);
}
.empty svg.big { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 4px; }
.empty h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.empty p { margin: 0; max-width: 360px; }

/* ---------- Inbox and home ---------- */

.hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 16px 8px; padding: 14px 16px;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); background: var(--bg-elev);
}
.hero .status { width: 18px; height: 18px; }
.hero .status svg { width: 18px; height: 18px; }
.hero h2 { margin: 0; font-size: 14px; font-weight: 600; }
.hero p { margin: 2px 0 0; color: var(--text-2); }
.hero .grow { flex: 1; min-width: 200px; }

/* ---------- Piece ---------- */

.piece { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: 100%; min-height: 0; }
.piece-main { overflow-y: auto; min-height: 0; }
.piece-body { max-width: 760px; margin: 0 auto; padding: 36px 40px 120px; }
.piece-title {
  width: 100%; border: 0; outline: none; background: none; padding: 0; margin: 0 0 6px;
  font-size: 26px; font-weight: 640; letter-spacing: -0.02em; line-height: 1.25; color: var(--text);
}
.piece-desc {
  width: 100%; border: 0; outline: none; background: none; padding: 0; margin: 0 0 18px; resize: none;
  font-size: 15px; line-height: 1.5; color: var(--text-2); overflow: hidden;
}
.piece-desc::placeholder, .piece-title::placeholder { color: var(--text-3); }
.piece-title:focus-visible, .piece-desc:focus-visible { box-shadow: none; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 16px; border-radius: var(--radius);
  background: var(--bg-subtle); box-shadow: 0 0 0 1px var(--border) inset; color: var(--text-2);
}
.notice svg { width: 15px; height: 15px; margin-top: 1px; color: var(--yellow); }
.notice.bad svg { color: var(--red); }
.notice ul { margin: 0; padding-left: 16px; }
.section-title {
  display: flex; align-items: center; gap: 8px; margin: 26px 0 10px; color: var(--text-2); font-size: 12px; font-weight: 600;
  text-transform: none;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#editor-slot { margin-top: 8px; }
#editor-slot .mantel-prose { font-size: 15.5px; }
#editor-slot .mantel-prose .ProseMirror { min-height: 240px; padding-bottom: 12vh; }

.panel { border-left: 1px solid var(--border); overflow-y: auto; min-height: 0; background: var(--bg); }
.panel-section { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-section > h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.prop { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 30px; }
.prop > .label { color: var(--text-3); font-size: 12.5px; }
.prop > .value { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prop > .value .muted { color: var(--text-3); }
.prop > .value > svg, .tag > svg { width: 14px; height: 14px; color: var(--text-3); }
.prop .icon-btn { width: 24px; height: 24px; }
.prop .icon-btn svg { width: 14px; height: 14px; }
.prop .input { min-height: 28px; padding: 3px 7px; }
.prop .input:not(:focus):not(:hover) { box-shadow: none; background: none; }
.prop select.input:not(:focus):not(:hover) { padding-left: 7px; }
.prop .link { color: var(--text-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .link:hover { color: var(--brand); }
.panel-actions { display: grid; gap: 6px; }
.panel-actions .btn { width: 100%; }
.share-url { font-family: var(--mono); font-size: 11.5px; }

/* Piece tabs: Content (title and body) and Details (everything else) */
.tabs-bar { min-height: 38px; padding-top: 0; padding-bottom: 0; gap: 0; }
.tabs { display: flex; align-self: stretch; gap: 4px; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; margin-bottom: -1px;
  color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.tabs-bar .meta { color: var(--text-3); font-size: 12px; }

.write { max-width: 720px; margin: 0 auto; padding: 56px 40px 30vh; }
.write .piece-title {
  display: block; resize: none; overflow: hidden; font-size: 32px; line-height: 1.2; margin: 0 0 22px; font-family: inherit;
}
.write #editor-slot { margin: 0; }
.write #editor-slot .mantel-prose { font-size: 17px; line-height: 1.7; }
.write #editor-slot .mantel-prose .ProseMirror { min-height: 50vh; padding-bottom: 0; }
.slim-notice {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: -28px 0 24px; padding: 7px 10px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--yellow) 10%, transparent); color: var(--text-2); text-align: left; font-size: 12.5px;
}
.slim-notice svg { width: 14px; height: 14px; color: var(--yellow); }
.slim-notice span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slim-notice .more { color: var(--text-3); white-space: nowrap; }
.slim-notice:hover .more { color: var(--text); }

/* Details form (long fields, groups, repeated rows) */
.details { display: grid; gap: 0; }
.details fieldset { border: 0; border-left: 2px solid var(--border); padding: 2px 0 2px 14px; margin: 0 0 16px; }
.details legend { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0; margin: 0 0 8px; }
.details fieldset fieldset { border-left-color: var(--border-strong); }
.row-actions { display: flex; gap: 6px; margin: -4px 0 12px; }
.refs { display: grid; gap: 2px; margin: 0 0 14px; }
.refs label { display: flex; align-items: center; gap: 8px; min-height: 26px; padding: 0 6px; border-radius: var(--radius); }
.refs label:hover { background: var(--bg-hover); }
.refs input { accent-color: var(--brand); }
.image-field { display: grid; gap: 6px; margin: 0 0 14px; }
.image-field > span { color: var(--text-2); font-size: 12px; font-weight: 500; }
.image-field img { max-width: 100%; max-height: 140px; width: auto; object-fit: cover; border-radius: var(--radius); background: var(--bg-hover); box-shadow: 0 0 0 1px var(--border); }
.image-field .row-actions { margin: 0; flex-wrap: wrap; }
.image-field select { max-width: 100%; }
.swatch-input { display: flex; gap: 6px; align-items: center; }
.swatch-input i { width: 18px; height: 18px; border-radius: 4px; box-shadow: 0 0 0 1px var(--border-strong); flex: none; }

/* Activity (published versions) */
.activity { display: grid; gap: 0; }
.activity-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 7px 0; }
.activity-item .dot { width: 22px; display: grid; place-items: center; padding-top: 1px; }
.activity-item .what { min-width: 0; }
.activity-item .what strong { font-weight: 560; }
.activity-item .what .muted { color: var(--text-3); }
.activity-item .when { color: var(--text-3); font-size: 12px; white-space: nowrap; }

/* ---------- Releases ---------- */

.release { border-bottom: 1px solid var(--border); }
.release > .row { height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; border-bottom: 0; align-items: flex-start; }
.release .lines { min-width: 0; display: grid; gap: 2px; flex: 1; }
.release .changes { padding: 0 16px 12px 40px; display: grid; gap: 2px; }
.release .change { display: flex; align-items: center; gap: 8px; min-height: 26px; color: var(--text-2); }
.release .change button { color: var(--text); font-weight: 500; text-align: left; }
.release .change button:hover { color: var(--brand); }
.error-text { color: var(--red); font-size: 12px; }

/* ---------- Media ---------- */

.media-layout { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
.media-layout.inspecting { grid-template-columns: minmax(0, 1fr) 320px; }
.media-scroll { overflow-y: auto; min-height: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; padding: 16px; }
.tile { display: grid; gap: 6px; text-align: left; border-radius: var(--radius-lg); padding: 6px; }
.tile:hover { background: var(--bg-hover); }
.tile[aria-pressed="true"] { background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.tile .thumb { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: var(--radius); background: var(--bg-hover); box-shadow: 0 0 0 1px var(--border); }
.tile .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta { color: var(--text-3); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.inspector { border-left: 1px solid var(--border); overflow-y: auto; min-height: 0; }
.inspector img.preview { width: 100%; max-height: 260px; object-fit: contain; background: var(--bg-subtle); border-bottom: 1px solid var(--border); display: block; }
.usage { display: grid; gap: 2px; }
.usage button { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 6px; border-radius: var(--radius); text-align: left; }
.usage button:hover { background: var(--bg-hover); }

/* ---------- Settings ---------- */

.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); height: 100%; min-height: 0; }
.settings-nav { border-right: 1px solid var(--border); padding: 12px 8px; display: grid; align-content: start; gap: 2px; }
.settings-body { overflow-y: auto; padding: 32px 40px 80px; }
.settings-body > * { max-width: 680px; }
.settings-body h1 { margin: 0 0 4px; font-size: 20px; font-weight: 640; letter-spacing: -0.01em; }
.settings-body > p.lede { margin: 0 0 24px; color: var(--text-2); }
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); background: var(--bg-elev); margin: 0 0 20px; }
.card-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 52px; }
.card-row:last-child { border-bottom: 0; }
.card-row { flex-wrap: wrap; }
.card-row .what { flex: 1; min-width: 220px; }
.card-row .what strong { display: block; font-weight: 550; }
.card-row .what span { color: var(--text-2); font-size: 12.5px; }
.card-row .value { color: var(--text-2); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.keys code { font-family: var(--mono); font-size: 11.5px; background: var(--bg-hover); border-radius: 4px; padding: 2px 6px; }
.segmented { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--bg-hover); gap: 2px; }
.segmented button { height: 26px; padding: 0 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.segmented button svg { width: 14px; height: 14px; }
.segmented button[aria-pressed="true"] { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border); }

/* ---------- Auth and onboarding ---------- */

.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth { width: min(360px, 100%); display: grid; gap: 0; text-align: center; }
.auth .mark { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; margin: 0 auto 18px; }
.auth h1 { margin: 0 0 6px; font-size: 20px; font-weight: 620; letter-spacing: -0.01em; }
.auth p.lede { margin: 0 0 22px; color: var(--text-2); }
.auth form { display: grid; gap: 10px; text-align: left; }
.auth .btn { height: 36px; width: 100%; }
.auth .input { min-height: 36px; padding: 7px 10px; }
.auth .switch { margin-top: 16px; color: var(--text-2); }
.auth .switch button { color: var(--brand); font-weight: 500; }
.auth .divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--text-3); font-size: 12px; }
.auth .divider::before, .auth .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.onboard { width: min(520px, 100%); }
.onboard h1 { margin: 0 0 6px; font-size: 22px; font-weight: 640; letter-spacing: -0.015em; }
.onboard > p { margin: 0 0 22px; color: var(--text-2); font-size: 14px; }
.steps { list-style: none; margin: 0 0 22px; padding: 0; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.steps li:last-child { border-bottom: 0; }
.steps .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; }
.steps strong { display: block; font-weight: 560; }
.steps span { color: var(--text-2); }

/* ---------- Overlays: menus, palette, dialogs, toasts ---------- */

.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 14, 0.32); display: grid; align-items: start; justify-items: center; padding-top: 14vh; }
.popover-layer { position: fixed; inset: 0; z-index: 60; }
.menu {
  position: fixed; z-index: 61; min-width: 220px; max-width: 320px; padding: 4px; border-radius: 8px;
  background: var(--bg-elev); box-shadow: var(--shadow-pop);
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0 8px; border-radius: 5px; text-align: left; color: var(--text);
}
.menu-item:hover, .menu-item.active { background: var(--bg-hover); }
.menu-item svg { width: 15px; height: 15px; color: var(--text-2); }
.menu-item .hint { margin-left: auto; color: var(--text-3); font-size: 12px; }
.menu-item.danger { color: var(--red); }
.menu-item.danger svg { color: var(--red); }
.menu-item[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--brand); }
.menu-label { padding: 6px 8px 2px; color: var(--text-3); font-size: 11.5px; font-weight: 550; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px -4px; }

.palette {
  width: min(620px, calc(100vw - 32px)); border-radius: 12px; background: var(--bg-elev); box-shadow: var(--shadow-pop); overflow: hidden;
}
.palette input {
  width: 100%; height: 52px; border: 0; outline: none; background: none; padding: 0 18px; font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.palette .results { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.palette .group-label { padding: 8px 10px 4px; color: var(--text-3); font-size: 11.5px; font-weight: 550; }
.palette .result {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 7px; text-align: left;
}
.palette .result svg { width: 16px; height: 16px; color: var(--text-2); }
.palette .result .hint { margin-left: auto; color: var(--text-3); font-size: 12px; }
.palette .result[aria-selected="true"] { background: var(--bg-hover); }
.palette .none { padding: 24px; text-align: center; color: var(--text-3); }

.dialog { width: min(440px, calc(100vw - 32px)); border-radius: 12px; background: var(--bg-elev); box-shadow: var(--shadow-pop); padding: 18px; }
.dialog h2 { margin: 0 0 6px; font-size: 15px; font-weight: 620; }
.dialog p { margin: 0 0 16px; color: var(--text-2); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.shortcuts { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0 0 4px; }
.shortcuts dt { color: var(--text-2); }
.shortcuts dd { margin: 0; display: flex; gap: 4px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-elev); box-shadow: var(--shadow-pop); animation: toast-in 0.16s ease-out;
}
.toast svg { width: 16px; height: 16px; color: var(--green); }
.toast.error svg { color: var(--red); }
.toast button { color: var(--brand); font-weight: 550; margin-left: 6px; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

/* ---------- Small screens ---------- */

@media (max-width: 1100px) {
  .piece { grid-template-columns: minmax(0, 1fr); }
  .panel { border-left: 0; border-top: 1px solid var(--border); overflow: visible; }
  .piece-main { overflow: visible; }
  .piece { overflow-y: auto; display: block; }
  .media-layout.inspecting { grid-template-columns: minmax(0, 1fr); }
  .inspector { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 100vw); z-index: 40; background: var(--bg); box-shadow: var(--shadow-pop); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 45; background: var(--bg-sidebar);
    transform: translateX(-105%); transition: transform 0.16s ease; box-shadow: var(--shadow-pop);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 44; background: rgba(10, 10, 14, 0.32); }
  .main { margin: 0; border-radius: 0; box-shadow: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 8px; }
  .piece-body { padding: 24px 16px 80px; }
  .write { padding: 28px 16px 30vh; }
  .write .piece-title { font-size: 26px; }
  .slim-notice { margin-top: -8px; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px 8px; }
  .settings-nav .nav-item { width: auto; flex: none; }
  .settings-body { padding: 20px 16px 60px; }
  .row .sub, .row .hide-sm { display: none; }
  .search { min-width: 0; flex: 1; }
  .save-state { display: none; }
}

/* A more welcoming studio, built on Mantel's existing tokens. */
:root { --text-3: #686a73; --radius-lg: 14px; }
[data-theme="dark"] { --text-3: #a0a1ac; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --text-3: #a0a1ac; } }
.demo-banner { display:flex; align-items:center; gap:10px; padding:9px 18px; background:var(--brand-soft); color:var(--text-2); font-size:12px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.demo-banner > svg { width:16px; height:16px; flex-shrink:0; }
.demo-banner span { flex:1; }
.eyebrow { font-size:11px; font-weight:700; letter-spacing:.12em; color:var(--brand); margin-bottom:12px; }
.studio-welcome { padding:32px 24px 24px; border-bottom:1px solid var(--border); margin-bottom:20px; background:linear-gradient(135deg,var(--brand-soft),transparent 75%); border-radius:var(--radius-lg); }
.studio-welcome h1 { font-size:32px; letter-spacing:-.045em; margin:0 0 10px; line-height:1.2; }
.studio-welcome p { color:var(--text-2); line-height:1.6; margin:0 0 22px; }
.create-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.create-card { padding:18px; border:1px solid var(--border); border-radius:12px; background:var(--bg-elev); display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:10px; color:var(--text); transition:transform .15s,border-color .15s,box-shadow .15s; min-height:116px; }
.create-card > svg { color:var(--brand); width:22px; height:22px; }
.create-card strong { font-size:14px; }
.create-card span { font-size:12px; color:var(--text-2); line-height:1.4; }
.create-card:hover { border-color:var(--brand); transform:translateY(-2px); box-shadow:var(--shadow-pop); }
.content-picker { width:min(720px,calc(100vw - 32px)); max-width:720px; }
.content-picker .create-grid { margin:24px 0; }
.preview-dialog { display:flex; flex-direction:column; width:min(960px,calc(100vw - 32px)); height:calc(100vh - 48px); border-radius:16px; background:var(--bg); overflow:hidden; box-shadow:var(--shadow-pop); }
.preview-header { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-bottom:1px solid var(--border); gap:12px; }
.preview-dialog iframe { flex:1; width:100%; border:0; background:#faf8f4; }
.connect-card { max-width:640px; width:100%; }
.connect-card h1 { font-size:36px; line-height:1.15; letter-spacing:-.04em; }
.connect-step { display:flex; justify-content:space-between; align-items:center; padding:18px 0; gap:20px; border-bottom:1px solid var(--border); }
.connect-step p,.connect-project p { margin:6px 0 0; font-size:13px; color:var(--text-2); }
.connect-card .segmented { margin:18px 0; }
.connect-project { display:flex; align-items:center; gap:12px; width:100%; text-align:left; border:1px solid var(--border); border-radius:12px; padding:16px; margin-top:12px; background:var(--bg-elev); color:var(--text); }
/* Connecting a live site: staged progress, a calm success moment, and plain-spoken errors. */
.ob-card h1 { font-size:30px; }
.ob-steps { list-style:none; margin:8px 0 0; padding:0; border-top:1px solid var(--border); }
.ob-step { display:grid; grid-template-columns:22px 1fr; gap:12px; align-items:start; padding:14px 0; border-bottom:1px solid var(--border); color:var(--text-3); transition:color .3s ease; }
.ob-step strong { font-weight:560; }
.ob-step p { margin:4px 0 0; font-size:13px; color:var(--text-2); line-height:1.45; }
.ob-step .status { width:16px; height:16px; margin-top:2px; }
.ob-step .status svg { width:16px; height:16px; }
.ob-step.is-active, .ob-step.is-done { color:var(--text); }
.ob-step.is-done .status { color:var(--green); animation:ob-pop .32s cubic-bezier(.2,.9,.3,1.3); }
.ob-step.is-active .status { color:var(--brand); }
.ob-step.is-failed { color:var(--text); }
.ob-step.is-failed .status { color:var(--red); }
.ob-step.is-done p { animation:ob-fade .4s ease-out; }
.ob-dot { width:8px; height:8px; margin:6px 4px 0; border-radius:50%; background:var(--border-strong); }
.ob-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:22px; }
.ob-actions .btn { height:34px; padding:0 14px; }
.ob-footnote { margin:14px 0 0; font-size:12px; color:var(--text-3); line-height:1.5; }
.ob-success { text-align:left; }
.ob-celebrate { position:relative; width:44px; height:44px; display:grid; place-items:center; margin-bottom:18px; border-radius:50%; background:color-mix(in srgb, var(--green) 14%, transparent); color:var(--green); animation:ob-pop .5s cubic-bezier(.2,.9,.3,1.3); }
.ob-celebrate .status, .ob-celebrate .status svg { width:22px; height:22px; color:var(--green); }
.ob-ring { position:absolute; inset:0; border-radius:50%; box-shadow:0 0 0 0 color-mix(in srgb, var(--green) 35%, transparent); animation:ob-ring 1.6s ease-out .2s 2; }
.ob-arrivals { display:flex; gap:12px; align-items:flex-start; margin:18px 0 0; padding:14px 16px; border-radius:12px; background:var(--bg-subtle); box-shadow:0 0 0 1px var(--border) inset; }
.ob-arrivals > svg { width:18px; height:18px; color:var(--brand); margin-top:1px; flex:none; }
.ob-arrivals.is-done > svg { color:var(--green); }
.ob-arrivals .grow { flex:1; min-width:0; }
.ob-arrivals strong { font-weight:540; font-size:13px; }
.ob-meter { display:flex; align-items:center; gap:10px; margin-top:10px; }
.ob-bar { position:relative; flex:1; height:4px; border-radius:2px; background:var(--border); overflow:hidden; }
.ob-bar::after { content:""; position:absolute; inset:0; background:var(--brand); transform-origin:left; transform:scaleX(var(--progress, 0)); transition:transform .6s ease; }
.ob-count { font-size:12px; color:var(--text-2); font-variant-numeric:tabular-nums; min-width:64px; text-align:right; }
.ob-token { margin-top:16px; padding:14px 16px; border-radius:12px; border:1px dashed var(--border-strong); }
.ob-token strong { font-size:13px; font-weight:560; }
.ob-token p { margin:4px 0 10px; font-size:12px; color:var(--text-2); line-height:1.5; }
.ob-token-row { display:flex; gap:8px; }
.ob-token-row .input { flex:1; min-height:32px; padding:6px 10px; }
.ob-token-row .btn { height:32px; }
.ob-token .ob-token-note { margin:8px 0 0; color:var(--red); }
@keyframes ob-pop { from { transform:scale(.6); opacity:0; } to { transform:scale(1); opacity:1; } }
@keyframes ob-fade { from { opacity:0; transform:translateY(2px); } }
@keyframes ob-ring { to { box-shadow:0 0 0 14px color-mix(in srgb, var(--green) 0%, transparent); } }
@media (max-width:560px) { .ob-card h1 { font-size:24px; } .ob-token-row { flex-direction:column; } }
@media (prefers-reduced-motion:reduce) {
  .ob-step, .ob-step.is-done .status, .ob-step.is-done p, .ob-celebrate, .ob-ring, .ob-bar::after { animation:none; transition:none; }
  .ob-step.is-active .status svg { animation:none; }
}
.demo-option { margin-top:28px; padding:20px; border:1px dashed var(--border-strong); border-radius:12px; }
.editor-mode { font-size:12px; color:var(--text-2); padding:10px; background:var(--brand-soft); border-radius:8px; }
.btn,.icon-btn,.chip,.nav-item { min-height:32px; }
@media (max-width:900px) { .create-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .studio-welcome { padding:22px 16px; } .studio-welcome h1 { font-size:26px; } .create-grid { gap:8px; } .create-card { padding:14px; min-height:108px; } .demo-banner { font-size:11px; padding:8px 12px; } .btn,.icon-btn,.chip { min-height:40px; } .top-actions { gap:4px; } .content-picker { max-height:90vh; overflow:auto; } }
@media (prefers-reduced-motion:reduce) { .create-card { transition:none; } .create-card:hover { transform:none; } }

/* DialKit is the shared configuration surface; writing remains untouched. */
.mantel-config-control { width:100%; min-width:0; padding:4px 0; }
.mantel-config-control .dialkit-text-control { width:100%; }
.mantel-config-control textarea { font-family:inherit; }
.prop:has(.mantel-config-control) { display:block; }
.prop:has(.mantel-config-control) > .label { display:none; }
.refs:has(.mantel-config-control) { display:block; }
.mantel-image-details .mantel-config-control { margin:6px 0; }
.mantel-image-details .mantel-config-control button { background:var(--dial-surface); color:var(--dial-text-primary); }
.mantel-config-control :focus-visible { box-shadow:none; }
.mantel-config-control .dialkit-text-input:focus-visible { outline:1px solid var(--dial-focus-ring); }
.mantel-config-control .dialkit-text-label { min-width:80px; }
.config-menu { width:min(340px,calc(100vw - 16px)); padding:12px; }
.config-menu h3 { font-size:13px; margin:0 0 8px; font-weight:600; }
.config-menu > .btn { margin:8px 8px 0 0; }
.mantel-config-control .dialkit-select-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:55%; }
.mantel-config-control .dialkit-select-value { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mantel-image-details .dialkit-text-control { display:flex; margin:0; }

.editor-preferences { display:flex; align-items:center; gap:8px; }
.editor-preferences > .mantel-config-control { width:210px; padding:0; }
@media (max-width:600px) { .tabs-bar { flex-wrap:wrap; } .editor-preferences { order:3; width:100%; } .editor-preferences > .mantel-config-control { flex:1; } }

/* Image configuration is an inspector, with room for real descriptions. */
.mantel-image-details {
  inset:12px 12px 12px auto; width:360px; height:calc(100dvh - 24px);
  max-height:none; padding:0; display:flex; flex-direction:column;
  box-sizing:border-box; overflow:hidden; z-index:60; color:var(--text);
  background:var(--bg-elev); border:1px solid var(--border-strong);
  border-radius:16px; box-shadow:var(--shadow-pop);
}
.image-settings-header { display:flex; align-items:flex-start; justify-content:space-between; padding:22px 20px 18px; border-bottom:1px solid var(--border); gap:12px; }
.image-settings-header h2 { margin:0; font:600 17px/1.4 var(--font); }
.image-settings-header p { margin:5px 0 0; color:var(--text-3); font-size:12px; }
.mantel-image-details [data-close-image] { padding:0; width:30px; height:30px; border-radius:8px; background:transparent; color:var(--text-2); font:24px/1 var(--font); }
.mantel-image-details [data-close-image]:hover { background:var(--bg-hover); }
.image-settings-body { padding:20px; overflow:auto; flex:1; min-height:0; }
.image-settings-preview { display:grid; place-items:center; padding:16px; height:144px; background:var(--bg); border:1px solid var(--border); border-radius:10px; margin-bottom:24px; }
.image-settings-preview img { max-width:100%; max-height:144px; object-fit:contain; border-radius:6px; }
.image-settings-body h3 { margin:24px 0 10px; font:600 12px/1.4 var(--font); color:var(--text-2); }
.image-settings-body .image-settings-help { margin:2px 0 16px; font-size:12px; color:var(--text-3); line-height:1.5; }
.mantel-image-details .mantel-config-control { margin:0 0 10px; padding:0; }
.mantel-image-details .dialkit-text-control { display:flex; flex-direction:column; gap:10px; height:auto !important; min-height:100px; margin:0; padding:12px; overflow:visible; border:1px solid transparent; }
.mantel-image-details .dialkit-text-label { font-size:12px; color:var(--text-3); }
.mantel-image-details .dialkit-text-input { width:100%; min-height:48px; height:auto !important; text-align:left; padding:0; margin:0; font-size:13px; line-height:1.6; scrollbar-gutter:auto; overflow:auto; outline:none !important; box-shadow:none; }
.mantel-image-details .dialkit-text-control:focus-within { border-color:var(--dial-focus-ring); }
.mantel-config-control .dialkit-segmented-button { background:transparent; border-radius:5px; padding:6px 10px; min-height:30px; color:var(--dial-text-label); }
.mantel-config-control .dialkit-segmented-button[data-active="true"] { color:var(--dial-text-primary); }
.mantel-config-control .dialkit-segmented { padding:3px; border:1px solid var(--dial-border); border-radius:8px; }
.image-settings-footer { padding:16px 20px; border-top:1px solid var(--border); }
.mantel-image-details .image-settings-save { width:100%; padding:11px 14px; min-height:40px; font:500 13px var(--font); }
body:has(.mantel-image-details:not([hidden])) .app.writing-page .main { margin-right:384px; }
.writing-page .write { max-width:760px; padding:36px 36px 120px; min-height:0; }
.writing-page .write .piece-title { font-size:30px; line-height:1.3; margin-bottom:24px; }
.writing-page .mantel-prose h2 { margin-top:1.4em; }
.writing-page .mantel-figure { margin-top:0; margin-bottom:1.5em; }
@media (max-width:1100px) {
  body:has(.mantel-image-details:not([hidden])) .app.writing-page .main { margin-right:0; }
}
@media (max-width:600px) {
  .mantel-image-details { width:calc(100vw - 16px); inset:8px; height:calc(100dvh - 16px); }
  .writing-page .write { padding:28px 20px 100px; }
  .writing-page .write .piece-title { font-size:26px; }
}
.image-settings-preview { height:176px; }
.image-settings-preview img { max-height:132px; }
.mantel-image-details .mantel-config-control .dialkit-segmented-button { background:transparent; border-radius:5px; padding:6px 10px; }
.mantel-config-control .dialkit-segmented-pill { background:var(--brand-soft); }
.mantel-config-control .dialkit-segmented-button[data-active="true"] { color:var(--brand-text, var(--dial-text-primary)); }
.mantel-image-details .dialkit-text-input:focus { background:transparent; }
.writing-settings-panel .image-settings-body h3:first-child { margin-top:0; }
.writing-font-name { font-family:"Paper Mono",monospace; font-size:20px; margin:16px 0 24px; }
.writing-settings-panel .image-settings-help { margin-top:12px; }
#image-settings-button[hidden] { display:none; }

/* Collections have a visual language suited to their contents. */
.collection-list { padding:28px; }
.collection-intro { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 0 28px; }
.collection-intro h1 { font-size:24px; line-height:1.3; letter-spacing:-.035em; margin:0 0 8px; }
.collection-intro p { font-size:13px; line-height:1.6; color:var(--text-3); margin:0; }
.collection-total { flex-shrink:0; font-size:12px; color:var(--text-3); }
.collection-list .group { border:0; margin-bottom:28px; }
.collection-list .group-head { background:transparent; padding:0 0 12px; border:0; }
.collection-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.collection-card { display:flex; flex-direction:column; min-width:0; text-decoration:none; color:var(--text); background:var(--bg-elev); border:1px solid var(--border); border-radius:12px; overflow:hidden; transition:border-color .15s,box-shadow .15s; text-align:left; font:inherit; padding:0; }
.collection-card:hover { border-color:var(--border-strong); box-shadow:0 6px 20px rgba(0,0,0,.08); }
.collection-card:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.collection-art { height:216px; background:var(--bg-hover); display:flex; align-items:center; justify-content:center; position:relative; padding:28px; }
.collection-art img { display:block; width:116px; height:162px; object-fit:contain; filter:drop-shadow(0 4px 5px rgba(0,0,0,.18)); }
.collection-badge { display:inline-flex; align-items:center; gap:5px; font-size:11px; padding:4px 7px; border-radius:5px; background:var(--bg-elev); color:var(--text-2); width:max-content; }
.collection-art > .collection-badge { position:absolute; left:10px; top:10px; z-index:1; }
.collection-badge svg { width:12px; height:12px; }
.collection-card-body { padding:14px; flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.collection-card-body h2,.collection-card-body strong { margin:0; font-size:13px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.collection-card-body p { font-size:12px; line-height:1.5; color:var(--text-3); margin:0; }
.collection-card-footer { margin-top:auto; padding-top:10px; font-size:11px; color:var(--text-3); display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px; }
.collection-card-footer svg { width:12px; height:12px; }
.collection-reading { font-size:11px; color:var(--text-2); margin-top:3px; }
.missing-art { display:flex; flex-direction:column; gap:10px; align-items:center; font-size:12px; color:var(--text-3); }
.missing-art svg { width:28px; height:28px; opacity:.6; }
.collection-create { cursor:pointer; border-style:dashed; }
.collection-create .collection-art { background:transparent; flex-direction:column; gap:14px; color:var(--text-3); font-size:12px; }
.collection-add-icon { width:30px; height:30px; }
.collection-create:hover { border-color:var(--brand); background:var(--brand-soft); }
.collection-films .collection-art { height:248px; }
.collection-films .collection-art img { width:124px; height:190px; }
.collection-blog .collection-grid,.collection-projects .collection-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.collection-blog .collection-art,.collection-projects .collection-art { height:172px; padding:0; }
.collection-blog .collection-art img,.collection-projects .collection-art img,.collection-case-studies .collection-art img,.collection-photos .collection-art img { width:100%; height:100%; object-fit:cover; filter:none; }
.collection-blog .collection-card-body h2,.collection-projects .collection-card-body h2 { font-size:16px; }
.collection-case-studies .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.collection-case-studies .collection-art { height:220px; padding:0; }
.collection-case-studies .collection-card-body { padding:20px; }
.collection-case-studies .collection-card-body h2 { font-size:20px; }
.collection-work .collection-grid { grid-template-columns:1fr; gap:12px; }
.collection-work .collection-card { border-left:3px solid var(--brand); }
.collection-work .collection-card-body { padding:20px 24px; }
.collection-work .collection-card-body h2 { font-size:18px; }
.collection-work .collection-create { flex-direction:row; align-items:center; border-left:1px dashed var(--border); }
.collection-work .collection-create .collection-art { height:112px; width:160px; flex-shrink:0; }
.collection-notes .collection-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.collection-notes .collection-card-body { padding:22px; gap:12px; min-height:210px; }
.collection-notes .collection-card-body h2 { font-size:17px; }
.collection-notes .collection-create .collection-art { height:110px; }
.collection-photos .collection-art { height:240px; padding:0; }
.collection-excerpt { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
@media (max-width:1100px) { .collection-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:1000px) { .collection-grid,.collection-blog .collection-grid,.collection-projects .collection-grid,.collection-notes .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .collection-list { padding:20px 16px; } .collection-intro { align-items:flex-start; } .collection-intro h1 { font-size:21px; } .collection-intro p { max-width:32ch; } .collection-grid { gap:12px; } .collection-art { height:184px; padding:20px; } .collection-art img { width:94px; height:134px; } .collection-case-studies .collection-grid,.collection-notes .collection-grid,.collection-blog .collection-grid,.collection-projects .collection-grid { grid-template-columns:1fr; } .collection-card-body { padding:12px; } .collection-work .collection-create .collection-art { width:100px; } }
@media (prefers-reduced-motion:reduce) { .collection-card { transition:none; } }
.collection-card.cursor { outline:2px solid var(--brand); outline-offset:3px; }

.collection-art img { max-width:100%; }
.collection-books .collection-art { height:auto; aspect-ratio:1.27; padding:20px; }
.collection-books .collection-art img { width:auto; height:100%; max-height:164px; max-width:70%; }

/* Artwork: a quiet two-column gallery, following the supplied Plastic frame. */
.collection-artwork .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.collection-artwork .collection-card { background:#f5f5f5; color:#141414; border:1px solid transparent; border-radius:16px; min-height:480px; padding:32px 24px; text-align:center; position:relative; }
.collection-artwork .collection-card:hover { border-color:var(--brand); box-shadow:0 8px 24px #0002; }
.artwork-status { display:flex; justify-content:center; align-items:center; gap:12px; min-height:20px; font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:#686868; }
.artwork-availability { display:inline-flex; gap:6px; align-items:center; }
.artwork-availability::before { content:""; width:4px; height:4px; border-radius:50%; background:currentColor; }
.artwork-draft { opacity:.75; }
.collection-artwork .collection-art { background:transparent; padding:24px 0; height:260px; flex-shrink:0; }
.collection-artwork .collection-art img { width:70%; height:100%; max-width:76%; max-height:100%; object-fit:contain; filter:drop-shadow(0 5px 8px #0002); }
.collection-artwork .missing-art,.collection-artwork .collection-create .collection-art { color:#747474; }
.collection-artwork .collection-card-body { align-items:center; justify-content:flex-start; gap:6px; padding:8px 0 0; }
.collection-artwork .collection-card-body h2 { font-size:20px; font-weight:500; line-height:1.25; }
.collection-artwork .collection-card-body p { color:#686868; }
.collection-artwork .collection-card-body .artwork-artist { color:#141414; font-size:13px; }
.artwork-price { margin-top:20px; display:flex; flex-direction:column; gap:4px; }
.artwork-price > span { font-size:10px; letter-spacing:.06em; text-transform:uppercase; color:#808080; }
.collection-artwork .artwork-price strong { font-size:16px; font-weight:400; }
.collection-artwork .collection-create { border:1px dashed #929292; }
.collection-artwork .collection-create .collection-card-body strong { color:#141414; font-size:20px; font-weight:500; }
@media(min-width:1500px) { .collection-artwork .collection-card { min-height:600px; padding-block:48px; } .collection-artwork .collection-art { height:320px; } }
@media(max-width:700px) { .collection-artwork .collection-grid { grid-template-columns:1fr; } .collection-artwork .collection-card { min-height:420px; padding:24px; } .collection-artwork .collection-art { height:230px; } }

.catalog-dialog { width:min(640px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); display:flex; flex-direction:column; overflow:hidden; }
.catalog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.catalog-header h2 { margin-bottom:8px; }
.catalog-header p,.catalog-details-prompt p { color:var(--text-3); font-size:13px; line-height:1.5; }
.catalog-search-form { display:flex; gap:8px; margin-top:20px; }
.catalog-search-form .input { flex:1; min-width:0; }
.catalog-search-status { margin:14px 0; font-size:12px; color:var(--text-3); }
.catalog-results { overflow-y:auto; min-height:0; display:flex; flex-direction:column; gap:6px; }
.catalog-result { display:flex; align-items:center; gap:16px; width:100%; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--bg); color:var(--text); text-align:left; flex-shrink:0; }
.catalog-result:hover { border-color:var(--brand); background:var(--brand-soft); }
.catalog-result:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.catalog-result img,.catalog-no-image { width:44px; height:66px; object-fit:contain; flex-shrink:0; border-radius:3px; }
.catalog-no-image { display:grid; place-items:center; background:var(--bg-hover); }
.catalog-result-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.catalog-result-copy strong { font-size:14px; overflow-wrap:anywhere; }
.catalog-result-copy > span,.catalog-result-action { font-size:12px; color:var(--text-3); }
.catalog-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:20px; font-size:12px; color:var(--text-3); }
.catalog-attribution { font-size:10px!important; margin:12px 0 0!important; color:var(--text-3); }
.catalog-details-prompt { display:flex; align-items:center; gap:16px; justify-content:space-between; padding:20px; margin-bottom:24px; border:1px solid var(--border); border-radius:12px; }
.catalog-details-prompt p { margin:6px 0 0; }
@media(max-width:600px) { .catalog-result-action { display:none; } .catalog-footer,.catalog-details-prompt { align-items:flex-start; flex-direction:column; } .catalog-dialog { padding:20px; } }

.catalog-scrim { align-items:center; padding:24px 16px; }
.catalog-dialog { max-height:min(760px,calc(100dvh - 48px)); }
.catalog-header,.catalog-search-form,.catalog-search-status,.catalog-footer,.catalog-attribution { flex-shrink:0; }
.dialog .catalog-search-status { margin:14px 0; }

/* Account emails: forgot/reset password screens and the verify-email banner. */
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.auth-icon { width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.auth-icon svg { width: 20px; height: 20px; }
.auth .auth-note { margin: 0 0 16px; color: var(--text-2); font-size: 12px; }
.verify-banner .verify-dismiss { width: 24px; height: 24px; min-height: 24px; }
.verify-banner .verify-dismiss svg { width: 14px; height: 14px; }
.onboard .verify-banner { margin: -4px 0 16px; border: 1px solid var(--border); border-radius: 8px; }
/* ---------- Analytics ---------- */

.analytics { max-width: 1040px; margin: 0 auto; padding: 24px 24px 80px; }
.analytics .card { margin: 0 0 16px; }
.a-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.a-tiles .card { margin: 0; }
.a-tile { padding: 12px 14px; display: grid; gap: 4px; min-width: 0; }
.a-tile > span { color: var(--text-3); font-size: 12px; font-weight: 500; }
.a-tile > strong { font-size: 22px; font-weight: 640; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.a-tile > strong.a-tile-text { font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-chart { padding: 12px 16px 10px; }
.a-chart-head { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; font-size: 12px; color: var(--text-2); }
.a-chart-head .grow { flex: 1; }
.a-chart-head .meta { color: var(--text-3); }
.a-legend { display: inline-flex; align-items: center; gap: 6px; }
.a-key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.a-key.views, .a-views { fill: color-mix(in srgb, var(--brand) 32%, transparent); background: color-mix(in srgb, var(--brand) 32%, transparent); }
.a-key.visits, .a-visits { fill: var(--brand); background: var(--brand); }
.a-chart-svg { display: block; width: 100%; height: 160px; overflow: visible; }
.a-gridline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; }
.a-hit { fill: transparent; }
.a-day:hover .a-hit { fill: var(--bg-hover); }
.a-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-3); font-size: 11.5px; }
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.a-grid .card { margin: 0; }
.a-list { padding: 4px 0 8px; min-width: 0; }
.a-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 16px 6px; }
.a-list-head h2 { margin: 0; font-size: 13px; font-weight: 600; }
.a-list-head .meta { color: var(--text-3); font-size: 11.5px; }
.a-list ol { list-style: none; margin: 0; padding: 0 8px; }
.a-list li { position: relative; display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 8px; border-radius: 6px; }
.a-fill { position: absolute; inset: 3px auto 3px 0; border-radius: 5px; background: var(--brand-soft); pointer-events: none; }
.a-name { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.a-name > span, .a-name > a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.a-name svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.a-count { position: relative; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.a-none { margin: 4px 16px 10px; color: var(--text-3); font-size: 12.5px; }
.a-page { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--text); text-align: left; }
.a-page > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.a-page.link:hover > span:first-child { text-decoration: underline; text-underline-offset: 2px; }
.a-path { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.a-path.solo { color: var(--text); font-size: inherit; }
.a-ref { color: var(--text); text-decoration: none; }
.a-ref:hover { text-decoration: underline; text-underline-offset: 2px; }
.a-flag { font-size: 14px; line-height: 1; }
.a-empty-head { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 24px 24px; color: var(--text-2); }
.a-empty-head svg.big { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 4px; }
.a-empty-head h1 { margin: 0; font-size: 18px; font-weight: 640; color: var(--text); letter-spacing: -0.01em; }
.a-empty-head p { margin: 0; max-width: 440px; }
.analytics > .a-snippet { max-width: 680px; margin: 0 auto 16px; }
.a-snippet { padding: 14px 16px; }
.a-snippet-head { display: flex; align-items: flex-start; gap: 16px; }
.a-snippet-head > div { flex: 1; min-width: 0; }
.a-snippet-head strong { display: block; font-weight: 600; }
.a-snippet-head span { color: var(--text-2); font-size: 12.5px; }
.a-code { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-subtle); box-shadow: 0 0 0 1px var(--border) inset; overflow-x: auto; }
.a-code code { font-family: var(--mono); font-size: 12px; white-space: pre; color: var(--text); user-select: all; }
.a-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; color: var(--text-2); font-size: 12.5px; }
.a-note svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--green); }
.a-setup { margin: 16px 0 0; }
.a-setup > summary { cursor: pointer; color: var(--text-2); font-weight: 500; padding: 6px 0; }
.a-setup[open] > summary { margin-bottom: 8px; }
.a-foot { margin: 16px 0 0; color: var(--text-3); font-size: 12px; }
.a-views-link { color: var(--text-2); font-size: 12.5px; }
.a-views-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 900px) {
  .a-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-grid { grid-template-columns: minmax(0, 1fr); }
  .analytics { padding: 16px 12px 60px; }
}
