/* GAUWS CMS admin — light/dark design system */

:root {
  /* Vercel Geist, light. Page gray, white surfaces, hairline borders. */
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --panel: #ffffff;
  --panel-hover: #f2f2f2;
  --fg: #171717;
  --fg-muted: #636363;
  --border: #e6e6e6;
  --border-strong: #c9c9c9;
  --accent: #171717;
  --accent-hover: #383838;
  --accent-fg: #ffffff;
  --accent-soft: #f2f2f2;
  --link: #0060d1;
  --link-hover: #004fac;
  --ring: rgba(0, 112, 243, .28);
  --ok-bg: #effbf3; --ok-fg: #0f6b35; --ok-border: #b5e8c8;
  --warn-bg: #fff0f0; --warn-fg: #b4191f; --warn-border: #f8c7c9;
  --danger: #d32f34;
  --badge: #e5484d;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --radius: 8px;
  color-scheme: light;
}

[data-theme="dark"] {
  /* Vercel Geist, dark. Black page, near-black surfaces lifted by borders. */
  --bg: #0a0a0a;
  --bg-subtle: #000000;
  --panel: #0a0a0a;
  --panel-hover: #1c1c1c;
  --fg: #ededed;
  --fg-muted: #a1a1a1;
  --border: #262626;
  --border-strong: #3e3e3e;
  --accent: #ededed;
  --accent-hover: #cccccc;
  --accent-fg: #0a0a0a;
  --accent-soft: #1c1c1c;
  --link: #52a8ff;
  --link-hover: #7cbcff;
  --ring: rgba(82, 168, 255, .35);
  --ok-bg: #04210f; --ok-fg: #5fd88b; --ok-border: #14532d;
  --warn-bg: #2a0d0e; --warn-fg: #ff8a8f; --warn-border: #6b1a1d;
  --danger: #ff6166;
  --badge: #e5484d;
  --shadow: 0 1px 2px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body.admin {
  margin: 0;
  background: var(--bg-subtle);
  color: var(--fg);
  font: 14px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- admin bar ---------- */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: .75rem; top: .5rem; z-index: 100; background: var(--panel); color: var(--fg); padding: .4rem .7rem; border-radius: 6px; }

.adminbar {
  position: sticky; top: 0; z-index: 40; height: 52px;
  display: flex; align-items: center; gap: .25rem; padding: 0 .75rem 0 .5rem;
  background: var(--bg); color: var(--fg); font-size: .875rem; border-bottom: 1px solid var(--border);
}
.adminbar .icon { width: 17px; height: 17px; flex: none; }
.brand {
  display: inline-flex; align-items: center; gap: .55rem; height: 100%; padding: 0 .5rem;
  color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: .02em; font-size: .9rem;
}
/* A plain mark in the text colour, Vercel style. */
.brand-mark { width: 20px; height: 20px; flex: none; background: var(--fg); clip-path: polygon(50% 8%, 96% 92%, 4% 92%); }
.adminbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 .35rem; flex: none; }

.adminbar-menu, .adminbar-link {
  display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .6rem;
  color: var(--fg-muted); background: none; border: 0; border-radius: 6px; font: inherit; font-size: .875rem;
  text-decoration: none; cursor: pointer; list-style: none; white-space: nowrap;
}
.adminbar-menu:hover, .adminbar-link:hover, details[open] > .adminbar-link { background: var(--panel-hover); color: var(--fg); }
.adminbar-link::-webkit-details-marker { display: none; }
.adminbar-end { margin-left: auto; display: flex; align-items: center; gap: .35rem; }

/* The site switcher: a menu, not a native select, so it looks the same in
   both themes and every browser. */
.site-switch > summary { color: var(--fg); font-weight: 600; }
.site-switch > summary .chev { width: 14px; height: 14px; color: var(--fg-muted); }
.site-switch .current-site { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.site-menu form { margin: 0; }
.site-menu .dropdown-button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-menu .is-current { font-weight: 600; }
.site-menu .check { color: var(--link); }

.adminbar-menu-group { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; z-index: 50;
  background: var(--panel); color: var(--fg); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12); padding: .35rem; display: flex; flex-direction: column;
}
[data-theme="dark"] .dropdown { box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.dropdown-end { left: auto; right: 0; }
.dropdown a, .dropdown-button {
  display: block; padding: .5rem .7rem; border-radius: 6px; color: var(--fg); text-decoration: none;
  font: inherit; font-size: .875rem; text-align: left; background: none; border: 0; width: 100%; cursor: pointer;
}
.dropdown a:hover, .dropdown-button:hover { background: var(--panel-hover); }
.dropdown form { margin: 0; }
.dropdown-note { padding: .35rem .7rem .5rem; font-size: .78rem; color: var(--fg-muted); border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.avatar {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #0070f3); color: #fff; font-size: .75rem; font-weight: 700;
}

/* ---------- sidebar ---------- */
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 52px); }
.sidebar {
  flex: 0 0 216px; width: 216px; background: var(--bg); color: var(--fg-muted); border-right: 1px solid var(--border);
  position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
  display: flex; flex-direction: column; justify-content: space-between; z-index: 30;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav > ul { padding: .75rem .6rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar .icon { width: 18px; height: 18px; flex: none; }
.sidebar-item {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 6px;
  color: var(--fg-muted); text-decoration: none; font-size: .9rem; font-weight: 500; position: relative;
}
.sidebar-item:hover { background: var(--panel-hover); color: var(--fg); }
.is-current > .sidebar-item { background: var(--panel-hover); color: var(--fg); font-weight: 600; }
.sidebar-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--badge); color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center;
}
.sidebar-subs { padding: .15rem 0 .35rem !important; }
.sidebar-subs a {
  display: block; padding: .35rem .65rem .35rem 2.55rem; border-radius: 6px; color: var(--fg-muted);
  text-decoration: none; font-size: .85rem;
}
.sidebar-subs a:hover { color: var(--fg); background: var(--panel-hover); }
.sidebar-subs a.is-on { color: var(--fg); font-weight: 600; }
.sidebar-divider { height: 1px; margin: .5rem .35rem; background: var(--border); }
.sidebar-collapse {
  display: flex; align-items: center; gap: .65rem; padding: .7rem 1.25rem; border-top: 1px solid var(--border);
  background: none; border-left: 0; border-right: 0; border-bottom: 0;
  color: var(--fg-muted); font: inherit; font-size: .85rem; cursor: pointer; text-align: left;
}
.sidebar-collapse:hover { color: var(--fg); }
.sidebar-scrim { display: none; }

.sidebar-collapsed .sidebar { flex-basis: 60px; width: 60px; }
.sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-subs { display: none; }
.sidebar-collapsed .sidebar-item { justify-content: center; padding: .6rem 0; }
.sidebar-collapsed .sidebar-badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; font-size: .62rem; padding: 0 4px; }
.sidebar-collapsed .sidebar-collapse { justify-content: center; padding: .7rem 0; }
.sidebar-collapsed .sidebar-collapse .icon { transform: rotate(180deg); }

@media (max-width: 860px) {
  .adminbar { overflow: hidden; }
  .brand-name, .adminbar-link span, .user-menu .adminbar-link > span:first-child, .adminbar-sep { display: none; }
  .site-switch .current-site { max-width: 9rem; }
  .sidebar {
    position: fixed; left: 0; top: 52px; transform: translateX(-100%); transition: transform .2s ease;
    width: 250px; flex-basis: 250px; box-shadow: 8px 0 24px rgba(0,0,0,.18);
  }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-scrim:not([hidden]) { display: block; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.45); z-index: 25; }
  .sidebar-collapse { display: none; }
  .sidebar-collapsed .sidebar { width: 250px; flex-basis: 250px; }
  .sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-subs { display: revert; }
  .sidebar-collapsed .sidebar-item { justify-content: flex-start; padding: .5rem .65rem; }
}
@media (max-width: 480px) {
  .adminbar-end .theme-toggle { display: none; }
  .site-switch .current-site { max-width: 7rem; }
}

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; flex: none;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg-muted); cursor: pointer; transition: background .12s, color .12s;
}
.theme-toggle:hover { background: var(--panel-hover); color: var(--fg); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- layout ---------- */
main { flex: 1; min-width: 0; padding: 1.5rem 2rem 5rem; }
main > * { max-width: 1320px; }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; margin: 0 0 .3rem; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin: 2rem 0 .75rem; }
h3 { font-size: .95rem; font-weight: 600; margin: 1.5rem 0 .6rem; }
p { margin: .4rem 0; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
.muted { color: var(--fg-muted); font-size: .875rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
/* WordPress's heading: the title with its "Add New" button right beside it. */
.wp-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wp-head h1 { margin: 0; }
.button-outline {
  display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .75rem; border-radius: 6px;
  border: 1px solid var(--border-strong); color: var(--fg); background: var(--panel);
  font-size: .82rem; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit;
}
.button-outline:hover { background: var(--panel-hover); border-color: var(--fg-muted); }

/* ---------- cards & stats ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem; text-decoration: none; color: var(--fg); display: block;
  box-shadow: var(--shadow); transition: border-color .12s, transform .12s;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat strong { display: block; font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.stat span { color: var(--fg-muted); font-size: .8rem; font-weight: 500; }

/* ---------- tables ---------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .9rem;
}
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); font-weight: 600; background: var(--bg-subtle);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-hover); }
td a { color: var(--fg); font-weight: 500; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 1.1rem; max-width: 44rem; }
/* The page and post editors lay out their own columns. */
.stack.editor-form { max-width: none; }
.stack label, fieldset { display: flex; flex-direction: column; gap: .4rem; font-size: .875rem; font-weight: 550; }
.stack label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 450; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local],
input[type=search], input[type=number], input[type=url], textarea, select {
  font: inherit; font-size: .9rem; padding: .55rem .7rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--fg); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--fg-muted); }
textarea.code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: .8rem; line-height: 1.5; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1rem; }
legend { font-size: .78rem; color: var(--fg-muted); padding: 0 .4rem; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 1rem; }

/* ---------- buttons ---------- */
.button, input[type=submit] {
  font: inherit; font-size: .875rem; font-weight: 550;
  background: var(--accent); color: var(--accent-fg); border: 1px solid transparent;
  border-radius: 8px; padding: .5rem 1rem; cursor: pointer; text-decoration: none;
  display: inline-block; transition: opacity .12s;
}
.button:hover, input[type=submit]:hover { background: var(--accent-hover); }
.linkish { background: none; border: 0; color: var(--fg-muted); cursor: pointer; font: inherit; font-size: .875rem; padding: 0; text-decoration: none; }
.linkish:hover { color: var(--fg); }
.linkish.danger { color: var(--danger); }

/* ---------- flashes ---------- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1.25rem; font-size: .875rem; border: 1px solid transparent; }
.flash.notice { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-border); }
.flash.alert { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-border); }
.flash ul { margin: 0; padding-left: 1.2rem; }

/* ---------- formatted text fields ---------- */
.html-field { display: flex; flex-direction: column; gap: .3rem; }
.html-toolbar { display: flex; gap: .25rem; flex-wrap: wrap; }
.html-toolbar button {
  font: inherit; font-size: .8rem; padding: .2rem .55rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--fg);
}
.html-toolbar button:hover { background: var(--panel-hover); }
.html-editable {
  min-height: 7rem; padding: .6rem .75rem; border-radius: 8px; line-height: 1.55;
  border: 1px solid var(--border); background: var(--input-bg, var(--panel)); color: var(--fg);
}
.html-editable:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.html-editable p { margin: 0 0 .6rem; }
.html-editable ul { margin: 0 0 .6rem 1.2rem; }
.html-editable a { color: var(--link); }

/* ---------- misc ---------- */
.filters { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters a {
  text-decoration: none; color: var(--fg-muted); font-size: .85rem; font-weight: 500;
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border);
}
.filters a:hover { color: var(--fg); }
.filters a.on { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
dl { margin: .75rem 0; }
dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); margin-top: 1rem; font-weight: 600; }
dd { margin: .25rem 0 0; }
code {
  background: var(--panel-hover); border: 1px solid var(--border); padding: .12rem .4rem;
  border-radius: 5px; font-size: .85em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all;
}
.row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.row input[type=email] { flex: 1 1 16rem; width: auto; }
form { margin: 0; }
details summary { cursor: pointer; color: var(--fg-muted); font-size: .875rem; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .5rem;
  border-radius: 999px; border: 1px solid var(--border); color: var(--fg-muted);
}
.badge.live { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-border); }

/* ---------- sign-in ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; background: var(--bg-subtle); }
.auth-card { width: 100%; max-width: 22rem; padding: 2rem; }

@media (max-width: 720px) {
  main { padding: 1.25rem 1rem 4rem; }
  table { font-size: .85rem; }
  th:nth-child(n+4), td:nth-child(n+4) { display: none; }
}

/* ---------- block editor ---------- */
.block {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0 0 1rem; box-shadow: var(--shadow); scroll-margin-top: 70px;
}
.block-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--bg-subtle);
  border-radius: var(--radius) var(--radius) 0 0;
}
.block-actions { display: flex; gap: .5rem; align-items: center; flex: none; }
.block-actions form.inline { display: inline; }
.block-fields { padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.block-fields > label { display: flex; flex-direction: column; gap: .35rem; }
.field-label { font-size: .82rem; font-weight: 600; }
.repeater { border: 1px dashed var(--border); border-radius: 8px; padding: .85rem; }
.repeater-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.repeater-row {
  border: 1px solid var(--border); border-radius: 8px; padding: .8rem; margin-bottom: .6rem;
  display: flex; flex-direction: column; gap: .6rem; background: var(--bg-subtle);
}
.repeater-row > label { display: flex; flex-direction: column; gap: .3rem; }
.block-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.block-choice {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
  padding: .7rem .85rem; color: var(--fg); font: inherit; transition: border-color .12s, background .12s;
}
.block-choice:hover { border-color: var(--border-strong); background: var(--panel-hover); }
.block-choice strong { display: block; font-size: .9rem; }
.block-choice .muted { font-size: .78rem; line-height: 1.4; display: block; margin-top: .2rem; }

/* ---------- post block editor ---------- */
.pb-meta { padding: 1.1rem 1.25rem; }
.pb-title-wrap { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; }
.pb-title {
  font-size: 1.6rem !important; font-weight: 650; letter-spacing: -.02em;
  border: 0 !important; padding: .2rem 0 !important; background: transparent !important;
}
.pb-title:focus { box-shadow: none !important; border-bottom: 2px solid var(--accent) !important; border-radius: 0 !important; }
.pb-meta details summary { cursor: pointer; font-size: .85rem; }

.pb-editor { display: flex; flex-direction: column; gap: .2rem; margin: .5rem 0 1rem; }
.pb-block {
  position: relative; display: flex; gap: .5rem; align-items: flex-start;
  border: 1px solid transparent; border-radius: 10px; padding: .55rem .7rem;
  transition: border-color .12s, background .12s;
}
.pb-block:hover, .pb-block:focus-within { border-color: var(--border); background: var(--panel); }
.pb-rail {
  display: flex; flex-direction: column; gap: .15rem; opacity: 0; transition: opacity .12s;
  flex: none; padding-top: .15rem;
}
.pb-block:hover .pb-rail, .pb-block:focus-within .pb-rail { opacity: 1; }
.pb-h {
  width: 22px; height: 22px; line-height: 1; font-size: .75rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 5px; background: var(--panel);
  color: var(--fg-muted);
}
.pb-h:hover { color: var(--fg); background: var(--panel-hover); }
.pb-h.pb-danger:hover { color: var(--danger); border-color: var(--danger); }
.pb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.pb-kind {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted);
  opacity: 0; transition: opacity .12s; font-weight: 600;
}
.pb-block:hover .pb-kind, .pb-block:focus-within .pb-kind { opacity: 1; }
.pb-text, .pb-input, .pb-select {
  width: 100%; font: inherit; color: var(--fg); background: transparent;
  border: 1px solid transparent; border-radius: 7px; padding: .35rem .5rem; resize: none;
}
.pb-text { font-size: 1rem; line-height: 1.7; overflow: hidden; }
.pb-text:focus, .pb-input:focus, .pb-select:focus {
  outline: none; background: var(--panel); border-color: var(--border);
}
.pb-block[data-type="heading"] .pb-input { font-size: 1.3rem; font-weight: 650; letter-spacing: -.01em; }
.pb-block[data-type="quote"] .pb-text { font-style: italic; border-left: 3px solid var(--border-strong); padding-left: .8rem; }
/* align-self, because a flex column stretches children regardless of width */
.pb-select {
  width: auto; align-self: flex-start;
  background: var(--panel); border-color: var(--border);
  font-size: .82rem; padding: .25rem .5rem;
}
.pb-repeater { align-self: stretch; }
.pb-help { font-size: .75rem; color: var(--fg-muted); }
.pb-divider-preview { border: 0; border-top: 2px solid var(--border-strong); width: 100%; margin: .6rem 0; }

.pb-repeater { display: flex; flex-direction: column; gap: .35rem; }
.pb-item { display: flex; gap: .4rem; align-items: center; }
.pb-x {
  flex: none; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--fg-muted); cursor: pointer; line-height: 1;
}
.pb-x:hover { color: var(--danger); }

.pb-add-wrap { display: flex; justify-content: center; margin: .5rem 0 1.5rem; }
.pb-add {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: 999px; background: transparent;
  color: var(--fg-muted); font: inherit; font-size: .875rem; padding: .5rem 1.1rem;
}
.pb-add:hover { color: var(--fg); border-color: var(--fg-muted); background: var(--panel); }
.pb-plus { font-size: 1.05rem; line-height: 1; }

.pb-picker {
  position: absolute; z-index: 60; width: 270px; max-height: 340px; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: .5rem;
}
.pb-search {
  width: 100%; font: inherit; font-size: .85rem; padding: .4rem .55rem; margin-bottom: .35rem;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-subtle); color: var(--fg);
}
.pb-choices { list-style: none; margin: 0; padding: 0; }
.pb-choices button {
  width: 100%; text-align: left; cursor: pointer; background: none; border: 0; font: inherit;
  padding: .45rem .55rem; border-radius: 7px; color: var(--fg);
}
.pb-choices button:hover { background: var(--panel-hover); }
.pb-choices strong { display: block; font-size: .875rem; font-weight: 550; }
.pb-choices span { display: block; font-size: .75rem; color: var(--fg-muted); }

.pb-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 0; background: var(--bg-subtle); border-top: 1px solid var(--border);
}
.pb-hint kbd {
  font: inherit; font-size: .8em; border: 1px solid var(--border); border-radius: 4px;
  padding: 0 .3rem; background: var(--panel-hover);
}

/* ---------- rich text ---------- */
.pb-rich-wrap { border: 1px solid transparent; border-radius: 8px; }
.pb-rich-wrap:focus-within { border-color: var(--border); background: var(--panel); }
.pb-toolbar {
  display: flex; align-items: center; gap: .15rem; flex-wrap: wrap;
  padding: .3rem .4rem; opacity: 0; transition: opacity .12s;
  border-bottom: 1px solid transparent;
}
.pb-rich-wrap:focus-within .pb-toolbar, .pb-rich-wrap:hover .pb-toolbar {
  opacity: 1; border-bottom-color: var(--border);
}
.pb-tb {
  min-width: 26px; height: 26px; padding: 0 .35rem; cursor: pointer; font: inherit; font-size: .8rem;
  background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--fg-muted);
}
.pb-tb:hover { background: var(--panel-hover); color: var(--fg); border-color: var(--border); }
.pb-tb-sep { width: 1px; height: 16px; background: var(--border); margin: 0 .2rem; }
.pb-swatch { width: 20px; min-width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border); }
.pb-colour { font-weight: 700; }

/* Editor previews use the same names the site renders, so what an editor sees
   matches what readers get. */
.hl-yellow { background: #fef08a; }
.hl-green  { background: #bbf7d0; }
.hl-blue   { background: #bfdbfe; }
.hl-pink   { background: #fbcfe8; }
[data-theme="dark"] .hl-yellow { background: #7a6a12; }
[data-theme="dark"] .hl-green  { background: #14532d; }
[data-theme="dark"] .hl-blue   { background: #1e3a8a; }
[data-theme="dark"] .hl-pink   { background: #831843; }
.tc-brand      { color: #7B6DA6; }
.tc-terracotta { color: #b96a47; }
.tc-plum       { color: #3d2f52; }
.tc-muted      { color: var(--fg-muted); }
[data-theme="dark"] .tc-plum { color: #c9b8e0; }

.pb-rich {
  min-height: 1.8em; padding: .4rem .5rem; font-size: 1rem; line-height: 1.7;
  outline: none; color: var(--fg);
}
.pb-rich:empty::before {
  content: attr(data-placeholder); color: var(--fg-muted); pointer-events: none;
}
.pb-rich a { color: var(--link); text-decoration: underline; }
.pb-block[data-type="quote"] .pb-rich { font-style: italic; border-left: 3px solid var(--border-strong); padding-left: .8rem; }

/* ---------- editor with live preview ---------- */
/* ---------- editor layout (pages and posts) ---------- */
/* Content on the left, WordPress-style boxes on the right. */
.edit-layout { display: grid; gap: 1.5rem; align-items: start; grid-template-columns: minmax(0, 1fr); }
.edit-main { min-width: 0; }
.edit-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (min-width: 1000px) {
  /* Posts keep WordPress-style boxes on the right. */
  .edit-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  /* Pages: the section preview takes the right-hand side; status and
     publishing live in the bar above. */
  .edit-layout.page-edit { grid-template-columns: minmax(0, 1fr); }
  .edit-layout.page-edit.has-preview { grid-template-columns: minmax(0, 1fr) minmax(420px, 46%); }
  .edit-side { position: sticky; top: 62px; max-height: calc(100vh - 78px); overflow-y: auto; padding-bottom: .5rem; }
  .pb-bar-narrow { display: none !important; }
}
.metabox { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.metabox-title { margin: 0; padding: .7rem 1rem; font-size: .9rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.metabox-body { padding: .85rem 1rem; display: flex; flex-direction: column; gap: .55rem; }
.metabox-body label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; }
.metabox-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem 1rem; border-top: 1px solid var(--border); background: var(--bg-subtle);
  border-radius: 0 0 var(--radius) var(--radius);
}
.publish-row { margin: 0; font-size: .875rem; }
.publish-date .hint { font-size: .75rem; }
.edit-side .translation-bar .translation { width: 100%; }
.edit-side .translation-new input[type=text] { width: 100%; }

/* The title, set large, with the page's address under it. */
.title-box { display: flex; flex-direction: column; gap: .45rem; }
.title-input {
  font-size: 1.6rem !important; font-weight: 650; letter-spacing: -.01em; padding: .55rem .8rem !important;
  background: var(--panel) !important;
}
.permalink { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; font-size: .85rem; }
.permalink label { font-weight: 600; }
.permalink .permalink-input { width: auto; min-width: 12rem; flex: 0 1 18rem; padding: .25rem .5rem; font-size: .85rem; }
.section-head { display: flex; align-items: baseline; gap: .75rem; margin-top: .5rem; }
.section-head h2 { margin: 0; }

/* The live preview is a box in the editor's sidebar, on screens wide enough for it. */
.preview-col { display: none; overflow: hidden; }
@media (min-width: 1000px) { .preview-col { display: block; } }
.preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .7rem; border-bottom: 1px solid var(--border); background: var(--bg-subtle);
}
.preview-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.preview-tools { display: flex; gap: .2rem; align-items: center; }
.preview-btn {
  font: inherit; font-size: .72rem; padding: .2rem .5rem; cursor: pointer; text-decoration: none;
  background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
}
.preview-btn:hover { background: var(--panel-hover); color: var(--fg); border-color: var(--border); }
.preview-btn.is-on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.preview-frame-wrap {
  /* Height is set from the section's own height, reported by the preview page.
     This is the ceiling while that arrives. */
  height: 420px; max-height: calc(100vh - 175px);
  overflow: hidden; background: #fff; position: relative;
  transition: height .15s;
}
.preview-frame {
  /* flex: none, or the iframe shrinks to the column and lays out as mobile
     instead of rendering the desktop breakpoint scaled down. The scale itself
     is set from JS, based on how much width the column has. */
  flex: none;
  width: 1280px; height: 1810px; border: 0; background: #fff;
  transform-origin: top left;
}
.preview-col.is-mobile .preview-frame-wrap { display: flex; justify-content: center; }
.preview-col.is-mobile .preview-frame { width: 430px; }
.preview-note { padding: .45rem .7rem; margin: 0; border-top: 1px solid var(--border); font-size: .72rem; }

/* ---------- collapsible page blocks ---------- */
details.block > summary.block-head {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: .6rem;
}
details.block > summary.block-head::-webkit-details-marker { display: none; }
.block-caret { color: var(--fg-muted); font-size: .7rem; transition: transform .12s; flex: none; }
details.block[open] > summary .block-caret { transform: rotate(90deg); }
.block-id {
  display: flex; align-items: baseline; gap: .55rem; min-width: 0;
  flex: 1; overflow: hidden;
}
.block-summary { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24rem; }
details.block > summary.block-head:hover { background: var(--panel-hover); }
details.block[open] > summary.block-head { border-radius: var(--radius) var(--radius) 0 0; }
details.block:not([open]) > summary.block-head { border-bottom: 0; border-radius: var(--radius); }
.block-layout > summary { cursor: pointer; font-size: .8rem; }


/* ---------- full-width editing ---------- */
.head-tools { display: flex; align-items: center; gap: .75rem; }
.widen-icon { font-size: .95em; line-height: 1; }

/* Widen: the preview gets the extra room. */
main.is-wide > * { max-width: none; }
@media (min-width: 1200px) {
  main.is-wide .edit-layout.page-edit.has-preview { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); }
}

/* ---------- translations ---------- */
.translation-bar { display: flex; flex-direction: column; gap: .5rem; }
.translation-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.translation {
  display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  padding: .45rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--fg); font-size: .9rem;
}
a.translation:hover { background: var(--panel-hover); }
.translation.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.translation-new input[type=text] { width: 14rem; padding: .35rem .5rem; }
.translation-new .button { padding: .4rem .8rem; font-size: .85rem; }

/* ---------- media library ---------- */
.media-drop {
  display: block; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--panel); margin: 0 0 1.25rem; transition: border-color .15s, background .15s;
}
.media-drop.is-over { border-color: var(--link); background: var(--panel-hover); }
.media-drop-inner { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.6rem 1rem; cursor: pointer; text-align: center; }
.media-drop-inner input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.media-toolbar { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.media-toolbar .filters { margin: 0; }
.media-search input[type=search], .media-toolbar input[type=search] { min-width: 16rem; }
.media-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.media-card {
  display: flex; flex-direction: column; gap: .3rem; width: 100%; height: 100%; padding: .5rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); text-decoration: none; text-align: left; font: inherit; cursor: pointer;
}
.media-card:hover, .media-card:focus-visible { border-color: var(--fg-muted); background: var(--panel-hover); }
.media-thumb {
  display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: calc(var(--radius) - 3px);
  background: repeating-conic-gradient(var(--panel-hover) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-doc { font-weight: 700; font-size: .85rem; color: var(--fg-muted); letter-spacing: .05em; }
.media-name { font-size: .85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { font-size: .75rem; }
.media-empty { padding: 2rem 0; text-align: center; }
.media-pager { display: flex; justify-content: space-between; margin-top: 1rem; }
.media-detail { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
.media-preview { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; display: grid; place-items: center; }
.media-preview img { max-width: 100%; max-height: 70vh; border-radius: calc(var(--radius) - 3px); }
.media-url input { flex: 1 1 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
@media (max-width: 860px) { .media-detail { grid-template-columns: 1fr; } }

/* An image field: thumbnail beside the address and the chooser. */
.image-field { display: flex; flex-direction: column; gap: .3rem; }
.media-field { display: flex; gap: .75rem; align-items: flex-start; }
.media-field-preview { flex: 0 0 72px; height: 54px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: var(--panel-hover); }
.media-field-preview[hidden] { display: none; }
.media-field-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-field-controls { flex: 1; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.media-field-choose { color: var(--link); font-weight: 600; }
.pb-item .media-field { flex: 1 1 100%; }

/* The chooser dialog. */
.media-dialog {
  width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.media-dialog::backdrop { background: rgba(15, 18, 22, .55); }
.media-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.media-dialog-body { padding: 1rem 1.2rem 1.4rem; }
.media-upload-button { cursor: pointer; }
.media-status:empty { display: none; }

/* Chooser tabs and the Unsplash tab. */
.media-tabs { display: flex; gap: .25rem; }
.media-tab {
  background: none; border: 0; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  color: var(--fg-muted); padding: .4rem .8rem; border-radius: 999px;
}
.media-tab:hover { color: var(--fg); }
.media-tab.is-on { color: var(--accent-fg); background: var(--accent); }
.media-source { font-size: .72rem; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unsplash-card { cursor: default; padding: 0; overflow: hidden; }
.unsplash-pick { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.unsplash-pick .media-thumb { border-radius: 0; }
.unsplash-use {
  position: absolute; inset: auto .5rem .5rem .5rem; padding: .35rem .5rem; border-radius: 999px; text-align: center;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: .78rem; font-weight: 600; opacity: 0; transition: opacity .15s;
}
.unsplash-pick:hover .unsplash-use, .unsplash-pick:focus-visible .unsplash-use { opacity: 1; }
.unsplash-card.is-busy, .unsplash-pick.is-busy { opacity: .5; pointer-events: none; }
.unsplash-credit { padding: .35rem .5rem .5rem; }
.unsplash-credit a { color: var(--fg-muted); }
.unsplash-more { display: flex; justify-content: center; margin-top: 1rem; }
.unsplash-note { margin-top: 1rem; font-size: .78rem; }
.media-toolbar select { width: auto; }

/* ---------- WordPress-style lists ---------- */
.list-filters { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 .75rem; }
.subsubsub { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; font-size: .85rem; }
.subsubsub li + li::before { content: "|"; color: var(--border-strong); margin: 0 .5rem; }
.subsubsub a { color: var(--link); text-decoration: none; }
.subsubsub a.current { color: var(--fg); font-weight: 650; }
.subsubsub .count { color: var(--fg-muted); font-weight: 400; }
.list-search { display: flex; gap: .4rem; align-items: center; }
.list-search input[type=search] { width: 14rem; padding: .35rem .6rem; font-size: .85rem; }
.wp-list .row-title { font-weight: 650; font-size: .95rem; color: var(--link); text-decoration: none; }
.wp-list .row-title:hover { text-decoration: underline; }
.post-state { font-weight: 600; color: var(--fg-muted); font-size: .85rem; }
.row-actions { font-size: .8rem; color: var(--fg-muted); margin-top: .2rem; visibility: hidden; display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.row-actions a { color: var(--link); font-weight: 500; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }
.row-actions form.inline, .row-actions form { display: inline; margin: 0; }
.row-actions .linkish { font-size: .8rem; }
tr:hover .row-actions, tr:focus-within .row-actions { visibility: visible; }
@media (hover: none) { .row-actions { visibility: visible; } }
.date-cell { font-size: .85rem; white-space: nowrap; }
.writing-card { padding: .9rem 1rem; }

/* ---------- dashboard ---------- */
.welcome {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem; margin-bottom: 1.25rem;
}
.welcome h2 { margin: 0 0 .2rem; font-size: 1.3rem; }
.welcome-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; margin-top: 1.1rem; }
.welcome-action {
  display: flex; gap: .75rem; align-items: flex-start; padding: .85rem .95rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); text-decoration: none; color: var(--fg);
}
.welcome-action:hover { border-color: var(--fg-muted); background: var(--panel-hover); }
.welcome-action .icon { width: 22px; height: 22px; color: var(--fg); flex: none; margin-top: .1rem; }
.welcome-action strong { display: block; font-size: .9rem; }
.welcome-action .muted { font-size: .8rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.glance { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.glance a { display: flex; align-items: center; gap: .45rem; color: var(--link); text-decoration: none; font-size: .9rem; }
.glance a:hover { text-decoration: underline; }
.glance .icon { width: 18px; height: 18px; color: var(--fg-muted); }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.activity li { display: grid; grid-template-columns: 8.5rem 1fr; column-gap: .75rem; }
.activity li > .muted:last-child { grid-column: 2; font-size: .78rem; }
.activity a { color: var(--link); text-decoration: none; font-weight: 500; }
.activity a:hover { text-decoration: underline; }
.icon { width: 18px; height: 18px; }

/* Drop files anywhere: over the library page, or over the open chooser. */
.drop-overlay {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 82%, transparent); border: 2px dashed var(--link); border-radius: inherit;
}
.drop-overlay.is-page { position: fixed; inset: 12px; border-radius: 12px; }
.drop-overlay-inner {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center;
  padding: 1.4rem 2rem; border-radius: 10px; background: var(--panel); border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.15); color: var(--fg);
}
.drop-overlay-inner span { color: var(--fg-muted); font-size: .85rem; }
.media-dialog { position: fixed; }

/* A scheduled section's state, in its header. */
.schedule-badge {
  flex: none; font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--fg-muted); white-space: nowrap;
}
.schedule-badge.is-showing { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-border); }
.schedule-badge.is-upcoming { color: var(--link); border-color: currentColor; }
.schedule-badge.is-ended { text-decoration: line-through; }

/* ---------- page editor bar ---------- */
.page-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap;
  padding: .6rem .75rem; margin: 0 0 1.25rem; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.page-bar-group { display: flex; align-items: center; gap: .6rem .9rem; flex-wrap: wrap; }
.page-bar .button { padding: .45rem 1.1rem; }
.page-bar-saved { font-size: .78rem; }
.status-chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600;
  padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-muted);
}
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-chip.is-live { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-border); }
.status-chip.is-scheduled { color: var(--link); border-color: currentColor; }
.publish-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; }
.publish-inline input { width: auto; padding: .3rem .5rem; font-size: .85rem; }
.lang-pills { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.lang-pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .65rem; border-radius: 999px;
  border: 1px solid var(--border); font-size: .82rem; color: var(--fg); text-decoration: none; cursor: pointer;
  list-style: none; background: var(--panel);
}
.lang-pill::-webkit-details-marker { display: none; }
a.lang-pill:hover, summary.lang-pill:hover { background: var(--panel-hover); color: var(--fg); }
.lang-pill.is-current { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.lang-pill.is-missing { border-style: dashed; color: var(--fg-muted); }
.lang-new { position: relative; }
.lang-new-form { width: 18rem; padding: .8rem; gap: .55rem; }
.lang-new-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 550; }
.lang-new-form p { margin: 0; font-size: .78rem; }
.lang-new-form .button { width: 100%; }
/* The preview fills its column and stays in view while the sections scroll. */
.page-edit .edit-side .preview-col .preview-frame-wrap { max-height: calc(100vh - 200px); overflow: auto; }

/* ---------- content types ---------- */
.inline-icon { width: 1em; height: 1em; vertical-align: -.12em; }
.type-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .9rem; }
.icon-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.icon-picker legend { margin-bottom: .3rem; }
.icon-picker label { cursor: pointer; }
.icon-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-picker .icon {
  width: 38px; height: 38px; padding: 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--fg-muted);
}
.icon-picker input:checked + .icon { border-color: var(--fg); color: var(--fg); box-shadow: 0 0 0 2px var(--ring); }
.icon-picker input:focus-visible + .icon { outline: 2px solid var(--link); }
.field-rows { display: flex; flex-direction: column; gap: .75rem; max-width: none; }
.field-row {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .7rem; box-shadow: var(--shadow);
}
.field-row label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 550; }
.field-row-main { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr; gap: .75rem; }
.field-row-foot { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.field-row-foot label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 450; }
.field-row-tools { margin-left: auto; display: flex; gap: .7rem; }
@media (max-width: 700px) { .field-row-main { grid-template-columns: 1fr; } }
.entry-fields { display: flex; flex-direction: column; gap: 1.1rem; }
.entry-fields > label, .localized-group > label { display: flex; flex-direction: column; gap: .35rem; }
.localized-group { display: flex; flex-direction: column; gap: .6rem; padding: .75rem .9rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.localized-group > label .field-label { font-weight: 500; color: var(--fg-muted); }
.required { color: var(--danger); }
.list-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.order-cell { white-space: nowrap; }
.order-cell form { display: inline; }
