/* Admin UI Foundation — the admin's one stylesheet for shell, page structure and common components.
 * No framework, no external font: tokens below, element defaults wrapped in :where() (zero specificity, so any class wins),
 * components as plain classes. editor.css (block editor, rich text, picker) builds on the same tokens.
 * Layout: topbar + sidebar (≥ 1024px) / drawer (< 1024px). Contents: page-header → (tabs) → sections/cards/tables. */

:root {
  /* colour */
  --admin-bg: #f4f5f7;
  --admin-surface: #ffffff;
  --admin-surface-muted: #f7f8fa;
  --admin-surface-sunken: #eef0f3;
  --admin-text: #1c2430;
  --admin-text-muted: #5a6474;
  --admin-text-subtle: #6b7482;
  --admin-border: #dde1e7;
  --admin-border-strong: #c5cbd4;
  --admin-accent: #1f56a8;
  --admin-accent-hover: #184785;
  --admin-accent-soft: #e9f0fb;
  --admin-on-accent: #ffffff;
  --admin-success: #1b6e47;
  --admin-success-soft: #e5f4ec;
  --admin-warning: #8a5300;
  --admin-warning-soft: #fdf3dc;
  --admin-danger: #b3261e;
  --admin-danger-soft: #fdeceb;
  --admin-info: #1f56a8;
  --admin-info-soft: #e9f0fb;
  --admin-neutral-soft: #eceef2;
  --admin-focus: #1f56a8;
  /* type */
  --admin-font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  --admin-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --admin-fs-title: 28px;
  --admin-fs-section: 19px;
  --admin-fs-sub: 16px;
  --admin-fs-body: 15px;
  --admin-fs-small: 13px;
  --admin-lh: 1.7;
  /* space, shape */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --admin-radius: 8px;
  --admin-radius-sm: 6px;
  --admin-shadow: 0 1px 2px rgba(20, 30, 50, .06);
  --admin-shadow-pop: 0 8px 24px rgba(20, 30, 50, .14);
  --admin-control-h: 38px;
  --admin-topbar-h: 56px;
  --admin-sidebar-w: 248px;
  --admin-content-w: 1120px;
  --admin-form-w: 720px;
}

/* ----- element defaults (zero specificity) ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--admin-bg); color: var(--admin-text); font-family: var(--admin-font); font-size: var(--admin-fs-body); line-height: var(--admin-lh); }
:where(a) { color: var(--admin-accent); text-underline-offset: 2px; }
:where(a:hover) { color: var(--admin-accent-hover); }
:where(h1, h2, h3, h4) { line-height: 1.4; margin: 0; font-weight: 700; }
:where(.admin-main h1) { font-size: var(--admin-fs-title); letter-spacing: .01em; }
:where(.admin-main h2) { font-size: var(--admin-fs-section); margin: var(--space-6) 0 var(--space-3); }
:where(.admin-main h3) { font-size: var(--admin-fs-sub); margin: var(--space-5) 0 var(--space-2); }
:where(p) { margin: 0 0 var(--space-3); }
:where(ul, ol) { margin: 0 0 var(--space-3); padding-left: 1.4em; }
:where(small) { font-size: var(--admin-fs-small); }
:where(code) { font-family: var(--admin-font-mono); font-size: .88em; background: var(--admin-surface-sunken); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
:where(img) { max-width: 100%; }
:focus-visible { outline: 2px solid var(--admin-focus); outline-offset: 2px; }
:where(hr) { border: 0; border-top: 1px solid var(--admin-border); margin: var(--space-5) 0; }

/* tables: rows divided, no grid; a wide one scrolls inside its own box (.table-wrap) */
:where(.admin-main table) { width: 100%; border-collapse: collapse; background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); margin: 0 0 var(--space-4); font-size: 14px; }
:where(.admin-main th, .admin-main td) { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--admin-border); }
:where(.admin-main th) { font-weight: 600; color: var(--admin-text-muted); font-size: var(--admin-fs-small); background: var(--admin-surface-muted); white-space: nowrap; }
:where(.admin-main tbody th, .admin-main table:not(:has(thead)) tr > th:first-child:not(:only-child)) { white-space: normal; }
:where(.admin-main tr:last-child > td, .admin-main tr:last-child > th) { border-bottom: 0; }
:where(.admin-main td > form.inline + form.inline) { margin-left: var(--space-1); }
.table-wrap { position: relative; overflow-x: auto; margin: 0 0 var(--space-4); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); background: var(--admin-surface); }
.table-wrap > table { border: 0; margin: 0; border-radius: 0; }
.table-wrap td:first-child { min-width: 9em; }
.table-actions { text-align: right; white-space: nowrap; }
.table-actions > * + * { margin-left: var(--space-2); }
.cell-title { font-weight: 600; }
.cell-sub { display: block; color: var(--admin-text-muted); font-size: var(--admin-fs-small); font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* forms */
:where(.admin-main input[type=text], .admin-main input[type=email], .admin-main input[type=url], .admin-main input[type=search], .admin-main input[type=password], .admin-main input[type=number],
       .admin-main input[type=date], .admin-main input[type=datetime-local], .admin-main select, .admin-main textarea, .admin-auth input[type=text], .admin-auth input[type=password]) {
  font: inherit; font-size: 15px; color: var(--admin-text); background: var(--admin-surface); border: 1px solid var(--admin-border-strong); border-radius: var(--admin-radius-sm);
  min-height: var(--admin-control-h); padding: 6px 10px; max-width: 100%;
}
:where(.admin-main input[type=text], .admin-main input[type=url], .admin-main input[type=email], .admin-main textarea, .admin-auth input) { width: 100%; }
:where(.admin-main textarea) { line-height: 1.6; }
:where(.admin-main input:focus-visible, .admin-main select:focus-visible, .admin-main textarea:focus-visible, .admin-auth input:focus-visible) { outline: 2px solid var(--admin-focus); outline-offset: 0; border-color: var(--admin-focus); }
:where(.admin-main input[readonly]) { background: var(--admin-surface-sunken); }
:where(.admin-main input[type=checkbox], .admin-main input[type=radio]) { width: 16px; height: 16px; accent-color: var(--admin-accent); vertical-align: -2px; margin: 0 4px 0 0; }
:where(.admin-main input[type=file]) { font: inherit; font-size: 14px; max-width: 100%; }
/* file input (admin.js): the native control is visually hidden but keeps focus/validation; the label beside it is the button */
.file-input { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 100%; position: relative; vertical-align: middle; }
.file-input__native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-input .file-input__button { display: inline-flex; width: auto; cursor: pointer; margin: 0; font-weight: 600; }
.file-input__native:focus-visible + .file-input__button { outline: 2px solid var(--admin-focus); outline-offset: 2px; }
.file-input__name { font-size: var(--admin-fs-small); color: var(--admin-text-muted); overflow-wrap: anywhere; min-width: 0; }
:where(.admin-main input[type=color]) { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--admin-border-strong); border-radius: 4px; background: var(--admin-surface); vertical-align: middle; }
:where(.admin-main label) { font-weight: 600; font-size: 14px; }
:where(.admin-main label:has(> input[type=checkbox]), .admin-main label:has(> input[type=radio])) { font-weight: 400; display: inline-flex; align-items: center; gap: 2px; margin-right: var(--space-3); }
:where(.admin-main form > p) { margin-bottom: var(--space-4); }
:where(.admin-main fieldset) { border: 1px solid var(--admin-border); border-radius: var(--admin-radius); padding: var(--space-3) var(--space-4) var(--space-2); margin: 0 0 var(--space-4); background: var(--admin-surface); min-width: 0; }
:where(.admin-main legend) { font-weight: 700; padding: 0 var(--space-1); }
:where(.admin-main details > summary) { cursor: pointer; }

/* buttons: <button> is a secondary button; .btn--primary is THE action of the page (one per area) */
:where(.admin-main button, .admin-auth button), .btn {
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 14px; border-radius: var(--admin-radius-sm); border: 1px solid var(--admin-border-strong);
  background: var(--admin-surface); color: var(--admin-text); cursor: pointer; text-decoration: none; white-space: nowrap; vertical-align: middle;
}
:where(.admin-main button:hover, .admin-auth button:hover), .btn:hover { background: var(--admin-surface-sunken); color: var(--admin-text); }
:where(.admin-main button:disabled) { opacity: .45; cursor: default; }
.btn--primary, .admin-main .btn--primary, .ae-btn.ae-btn--primary, .admin-auth button[type=submit] { background: var(--admin-accent); border-color: var(--admin-accent); color: var(--admin-on-accent); }
.btn--primary:hover, .admin-main .btn--primary:hover, .ae-btn.ae-btn--primary:hover, .admin-auth button[type=submit]:hover { background: var(--admin-accent-hover); border-color: var(--admin-accent-hover); color: var(--admin-on-accent); }
.btn--danger, .admin-main .btn--danger { color: var(--admin-danger); border-color: #e7b4b0; background: var(--admin-surface); }
.btn--danger:hover, .admin-main .btn--danger:hover { background: var(--admin-danger-soft); color: var(--admin-danger); }
.btn--ghost, .admin-main .btn--ghost { border-color: transparent; background: transparent; color: var(--admin-accent); }
.btn--ghost:hover, .admin-main .btn--ghost:hover { background: var(--admin-accent-soft); color: var(--admin-accent-hover); }
.btn--small, .admin-main .btn--small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
form.inline { display: inline; }

/* ----- shell ----------------------------------------------------------------------------------------------------------- */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--admin-surface); padding: 8px 12px; border-radius: var(--admin-radius-sm); box-shadow: var(--admin-shadow-pop); }
.skip-link:focus { left: 8px; }
.admin-topbar { position: sticky; top: 0; z-index: 40; height: var(--admin-topbar-h); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4);
  background: var(--admin-surface); border-bottom: 1px solid var(--admin-border); }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--admin-text); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.admin-brand:hover { color: var(--admin-text); }
.admin-brand__mark { width: 26px; height: 26px; border-radius: 7px; background: var(--admin-accent); position: relative; flex: none; }
.admin-brand__mark::after { content: ""; position: absolute; inset: 7px; border: 2px solid #fff; border-radius: 3px; border-right-color: transparent; }
.admin-topbar__sep { width: 1px; height: 24px; background: var(--admin-border); flex: none; }
.admin-topbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; border: 0; background: transparent; border-radius: var(--admin-radius-sm); cursor: pointer; color: var(--admin-text); }
.nav-toggle:hover { background: var(--admin-surface-sunken); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: relative; content: ""; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after { position: absolute; top: 6px; }

/* dropdown menus (native <details>; admin.js closes them on Escape / outside click) */
.menu { position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px; border-radius: var(--admin-radius-sm); cursor: pointer; max-width: 100%; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--admin-surface-sunken); }
.menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--admin-text-subtle); border-bottom: 2px solid var(--admin-text-subtle); transform: rotate(45deg) translateY(-2px); flex: none; }
.menu[open] > summary { background: var(--admin-surface-sunken); }
.menu__panel { position: absolute; top: calc(100% + 6px); min-width: 240px; max-width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto; z-index: 50;
  background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); box-shadow: var(--admin-shadow-pop); padding: 6px; }
.menu--end .menu__panel { right: 0; }
.menu__label { padding: 6px 10px 2px; font-size: 12px; color: var(--admin-text-subtle); font-weight: 600; }
.menu__panel ul { list-style: none; margin: 0; padding: 0; }
.menu__panel a, .menu__panel button { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--admin-radius-sm);
  color: var(--admin-text); text-decoration: none; font: inherit; font-size: 14px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.menu__panel a:hover, .menu__panel button:hover { background: var(--admin-surface-sunken); }
.menu__panel a[aria-current] { background: var(--admin-accent-soft); color: var(--admin-accent); font-weight: 600; }
.menu__meta { font-size: 12px; color: var(--admin-text-subtle); flex: none; }
.menu__panel hr { margin: 6px 0; }
.scope-switch > summary { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.25; padding-right: 26px; position: relative; }
.scope-switch > summary::after { position: absolute; right: 10px; top: 50%; margin-top: -5px; }
.scope-switch__kind { font-size: 11px; color: var(--admin-text-subtle); font-weight: 600; }
.scope-switch__name { font-weight: 600; font-size: 14px; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-static { display: flex; flex-direction: column; line-height: 1.25; padding: 4px 10px; min-width: 0; }
.user-menu__name { font-size: 14px; font-weight: 600; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--admin-accent-soft); color: var(--admin-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }

.admin-body { display: grid; grid-template-columns: var(--admin-sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--admin-topbar-h)); }
.admin-sidebar { background: var(--admin-surface); border-right: 1px solid var(--admin-border); padding: var(--space-4) var(--space-3) var(--space-6);
  position: sticky; top: var(--admin-topbar-h); height: calc(100vh - var(--admin-topbar-h)); overflow-y: auto; }
.sidebar-context { padding: 0 var(--space-2) var(--space-3); margin-bottom: var(--space-2); border-bottom: 1px solid var(--admin-border); position: relative; }
.drawer-close { display: none; position: absolute; right: 0; top: -6px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 22px; line-height: 1; border-radius: var(--admin-radius-sm); cursor: pointer; color: var(--admin-text-muted); }
.drawer-close:hover { background: var(--admin-surface-sunken); }
.sidebar-context__back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; text-decoration: none; color: var(--admin-text-muted); margin-bottom: 6px; }
.sidebar-context__back::before { content: "‹"; font-size: 18px; line-height: 1; }
.sidebar-context__back:hover { color: var(--admin-accent); }
.sidebar-context__kind { display: block; font-size: 11px; font-weight: 700; color: var(--admin-text-subtle); letter-spacing: .04em; }
.sidebar-context__name { display: block; font-weight: 700; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.nav-group { margin-top: var(--space-3); }
.nav-group__title { font-size: 12px; font-weight: 700; color: var(--admin-text-subtle); padding: 0 var(--space-2); margin: 0 0 2px; letter-spacing: .04em; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 7px var(--space-2); border-radius: var(--admin-radius-sm); color: var(--admin-text); text-decoration: none; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; position: relative; }
.nav-group a:hover { background: var(--admin-surface-sunken); color: var(--admin-text); }
.nav-group a[aria-current] { background: var(--admin-accent-soft); color: var(--admin-accent); font-weight: 700; }
.nav-group a[aria-current]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--admin-accent); }

.admin-main { min-width: 0; padding: var(--space-5) var(--space-6) var(--space-7); }
.admin-main__inner { max-width: var(--admin-content-w); }
.admin-main--narrow .admin-main__inner { max-width: 860px; }
.admin-scrim { display: none; }

/* the drawer (< 1024px): the sidebar slides over the page; without JavaScript it stays in the flow above the content */
@media (max-width: 1023px) {
  .admin-body { display: block; }
  .js .nav-toggle { display: inline-flex; }
  .admin-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--admin-border); }
  .js .admin-sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: 100vh; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .18s ease-out; box-shadow: var(--admin-shadow-pop); border-right: 1px solid var(--admin-border); visibility: hidden; }
  .js.nav-open .admin-sidebar { transform: none; visibility: visible; }
  .js .drawer-close { display: inline-flex; align-items: center; justify-content: center; }
  .js .sidebar-context { padding-right: 40px; }
  .js.nav-open body { overflow: hidden; }
  .js.nav-open .admin-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(20, 28, 44, .45); }
  .admin-main { padding: var(--space-5) var(--space-5) var(--space-7); }
  .scope-switch__name { max-width: 24ch; }
}
@media (max-width: 640px) {
  :root { --admin-fs-title: 23px; --admin-fs-section: 18px; }
  .admin-topbar { padding: 0 var(--space-3); gap: var(--space-2); }
  .admin-brand__text, .admin-topbar__sep { display: none; }
  .user-menu__name { display: none; }
  .scope-switch__name { max-width: 15ch; }
  .admin-main { padding: var(--space-4) var(--space-4) var(--space-7); }
  .menu__panel { position: fixed; left: 12px; right: 12px; top: calc(var(--admin-topbar-h) + 4px); min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .js .admin-sidebar { transition: none; } }

/* ----- page structure -------------------------------------------------------------------------------------------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-5); margin: 0 0 var(--space-5); }
.page-header__main { min-width: 0; flex: 1 1 380px; }
.page-header__eyebrow { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--admin-text-muted); margin: 0 0 4px; }
.page-header__eyebrow a { color: var(--admin-text-muted); text-decoration: none; }
.page-header__eyebrow a:hover { color: var(--admin-accent); text-decoration: underline; }
.page-header__eyebrow a.back::before { content: "‹ "; }
.page-header h1 { overflow-wrap: anywhere; }
.page-header__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: var(--space-2); color: var(--admin-text-muted); font-size: 14px; }
.page-header__desc { color: var(--admin-text-muted); margin: var(--space-2) 0 0; max-width: 72ch; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.section { margin: var(--space-6) 0 0; }
.section:first-child { margin-top: 0; }
.section__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
.section__header h2, .section__header h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section__desc { color: var(--admin-text-muted); font-size: 14px; margin: -4px 0 var(--space-3); max-width: 80ch; }
.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

.card { background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); padding: var(--space-4) var(--space-5); box-shadow: var(--admin-shadow); min-width: 0; }
.card + .card { margin-top: var(--space-3); }
.card__header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.card__title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.45; }
.card__desc { color: var(--admin-text-muted); font-size: 14px; margin: 4px 0 0; }
.card__body { margin-top: var(--space-3); }
.card__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.card--muted { background: var(--admin-surface-muted); box-shadow: none; }
.grid { display: grid; gap: var(--space-3); }
.grid > .card + .card { margin-top: 0; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.list-plain { list-style: none; margin: 0; padding: 0; }

/* key–value list (instead of a 2-column table for one item's facts) */
.facts { display: grid; grid-template-columns: minmax(8em, max-content) minmax(0, 1fr); gap: 8px var(--space-5); margin: 0; font-size: 14px; }
.facts dt { color: var(--admin-text-muted); font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }

/* stat tiles (current state at a glance) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: var(--space-3); margin: 0 0 var(--space-4); }
.stat { background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); padding: var(--space-3) var(--space-4); min-width: 0; }
.stat__label { display: block; font-size: 12px; color: var(--admin-text-muted); font-weight: 600; }
.stat__value { display: block; font-size: 20px; font-weight: 700; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.stat__note { display: block; font-size: 12px; color: var(--admin-text-subtle); }

/* tabs (2–3 related pages of one settings area; never the whole settings list) */
.tabs { display: flex; gap: 2px; margin: -8px 0 var(--space-5); border-bottom: 1px solid var(--admin-border); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 14px; color: var(--admin-text-muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--admin-text); }
.tabs a[aria-current] { color: var(--admin-accent); border-bottom-color: var(--admin-accent); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px 2px; margin: 0 0 var(--space-4); padding: 0; border-bottom: 1px solid var(--admin-border); }
.subnav a, .subnav strong { padding: 6px 12px; text-decoration: none; font-size: 14px; color: var(--admin-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav [aria-current], .subnav strong { color: var(--admin-accent); border-bottom-color: var(--admin-accent); font-weight: 600; }
.segmented { display: inline-flex; flex-wrap: wrap; background: var(--admin-surface-sunken); padding: 3px; border-radius: var(--admin-radius); gap: 2px; margin: 0 0 var(--space-4); }
.segmented a { padding: 5px 12px; border-radius: var(--admin-radius-sm); text-decoration: none; color: var(--admin-text-muted); font-size: 14px; font-weight: 600; }
.segmented a[aria-current] { background: var(--admin-surface); color: var(--admin-text); box-shadow: var(--admin-shadow); }

/* toolbar / filters above a list */
.toolbar, .filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-3); background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); }
.toolbar label, .filters label { display: block; font-size: 12px; font-weight: 600; color: var(--admin-text-muted); }
.toolbar > div, .filters > div { min-width: 0; }
.filters input[type=search], .filters input[type=text] { min-width: min(16em, 100%); }
.list-meta { color: var(--admin-text-muted); font-size: 13px; margin: 0 0 var(--space-2); }
.pager, .ae-pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; font-size: 14px; }
.pager [aria-current], .ae-pager [aria-current] { font-weight: 700; text-decoration: none; color: var(--admin-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--admin-border); background: var(--admin-surface); font-size: 13px; color: var(--admin-text); text-decoration: none; }
.chip:hover { border-color: var(--admin-border-strong); color: var(--admin-text); }
.chip[aria-current] { background: var(--admin-accent-soft); border-color: #b9cdee; color: var(--admin-accent); font-weight: 600; }
.chip__count { font-variant-numeric: tabular-nums; color: var(--admin-text-subtle); }

/* status: colour AND text, a dot for the colour-blind-safe shape */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--admin-neutral-soft); color: var(--admin-text-muted); font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; vertical-align: 1px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; flex: none; }
.badge.badge--plain::before { display: none; }
.badge.tone-ok, .badge.live, .badge.used, .badge--ok { background: var(--admin-success-soft); color: var(--admin-success); }
.badge.tone-danger, .badge.unpublished, .badge.trashed, .badge--danger { background: var(--admin-danger-soft); color: var(--admin-danger); }
.badge.tone-action, .badge.draft, .badge--warn { background: var(--admin-warning-soft); color: var(--admin-warning); }
.badge.tone-waiting, .badge.scheduled, .badge--info { background: var(--admin-info-soft); color: var(--admin-info); }
.badge.tone-muted, .badge.expired, .badge.unused, .badge--muted { background: var(--admin-neutral-soft); color: var(--admin-text-muted); }

/* alerts */
.alert, .warn, .notice { display: block; border: 1px solid; border-radius: var(--admin-radius); padding: 10px 14px; margin: 0 0 var(--space-4); font-size: 14px; line-height: 1.65; }
.alert > :last-child, .warn > :last-child, .notice > :last-child { margin-bottom: 0; }
.alert ul, .warn ul { margin: 4px 0 0; }
.warn, .alert--warn { background: var(--admin-warning-soft); border-color: #efd29a; color: #5c3b00; }
.notice, .alert--ok { background: var(--admin-success-soft); border-color: #a9d8bf; color: #11472e; }
.alert--danger { background: var(--admin-danger-soft); border-color: #f0b8b3; color: #7a1a14; }
.alert--info { background: var(--admin-info-soft); border-color: #b9cdee; color: #173f7a; }
small.warn, span.warn { display: inline-block; padding: 2px 8px; margin: 0; font-size: 13px; }
li.warn { list-style: none; margin: 4px 0; }

/* the next thing to do */
.next { border: 1px solid var(--admin-border); border-left: 4px solid var(--admin-warning); background: var(--admin-surface); border-radius: var(--admin-radius); padding: var(--space-3) var(--space-4); margin: 0 0 var(--space-4); }
.next.tone-danger { border-left-color: var(--admin-danger); }
.next.tone-ok { border-left-color: var(--admin-success); }
.next.tone-waiting { border-left-color: var(--admin-info); }
.next.tone-muted { border-left-color: var(--admin-border-strong); }

/* status board: current state + next action (publishing) */
.status-board { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-4); margin: 0 0 var(--space-5); }
.status-board__now { display: flex; flex-direction: column; gap: var(--space-3); }
.status-board__next { border-left: 1px solid var(--admin-border); padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.status-board__label { margin: 0; font-size: 12px; color: var(--admin-text-muted); font-weight: 700; letter-spacing: .03em; }
.status-board__action { font-size: 17px; font-weight: 700; line-height: 1.5; }
.status-board__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: var(--space-3); }
.status-board__facts .stat__value { font-size: 22px; }
@media (max-width: 860px) {
  .status-board { grid-template-columns: 1fr; }
  .status-board__next { order: -1; border-left: 0; padding-left: 0; border-bottom: 1px solid var(--admin-border); padding-bottom: var(--space-3); }
  .status-board__facts { grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); }
  .status-board__facts .stat__value { font-size: 19px; }
}
@media (max-width: 640px) {
  .steps { gap: 6px; }
  .steps li + li::before { display: none; }
  .steps__dot { font-size: 12px; padding: 2px 8px 2px 3px; }
  .steps__dot::before { width: 18px; height: 18px; }
}

/* workflow steps: Build → Check → Staging → Approval → Package → Server → Record */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: flex; align-items: center; font-size: 13px; color: var(--admin-text-subtle); font-weight: 600; }
.steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--admin-border-strong); margin: 0 6px; }
.steps__dot { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--admin-surface-sunken); white-space: nowrap; }
.steps__dot::before { counter-increment: step; content: counter(step); width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: var(--admin-surface); border: 1px solid var(--admin-border-strong); color: var(--admin-text-muted); }
.steps .is-done .steps__dot { color: var(--admin-success); background: var(--admin-success-soft); }
.steps .is-done .steps__dot::before { content: "✓"; background: var(--admin-success); border-color: var(--admin-success); color: #fff; }
.steps .is-current .steps__dot { color: var(--admin-accent); background: var(--admin-accent-soft); box-shadow: inset 0 0 0 1px #b9cdee; }
.steps .is-current .steps__dot::before { background: var(--admin-accent); border-color: var(--admin-accent); color: #fff; }
.steps .is-problem .steps__dot { color: var(--admin-danger); background: var(--admin-danger-soft); }
.steps .is-problem .steps__dot::before { content: "!"; background: var(--admin-danger); border-color: var(--admin-danger); color: #fff; }

/* technical details: kept, folded */
details.tech { margin: var(--space-4) 0 0; border: 1px solid var(--admin-border); border-radius: var(--admin-radius); background: var(--admin-surface-muted); }
details.tech > summary { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--admin-text-muted); list-style: none; display: flex; align-items: center; gap: 8px; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .12s; }
details.tech[open] > summary::before { transform: rotate(45deg); }
details.tech > :not(summary) { margin: 0 14px 12px; }
details.tech .facts { font-size: 13px; }
details.tech table { font-size: 13px; }
td details.tech { margin: 0; }
td details.tech > summary { padding: 2px 8px; }
details.disclosure { margin: var(--space-3) 0 0; }
details.disclosure > summary { font-weight: 600; color: var(--admin-accent); font-size: 14px; }
details.disclosure[open] > summary { margin-bottom: var(--space-3); }

/* empty state */
.empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--admin-text-muted); background: var(--admin-surface); border: 1px dashed var(--admin-border-strong); border-radius: var(--admin-radius); }
.empty__title { font-weight: 700; color: var(--admin-text); margin-bottom: 4px; }

/* form sections */
.form-section { background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); padding: var(--space-4) var(--space-5); margin: 0 0 var(--space-4); }
.form-section > h2, .form-section > h3, .form-section__title { font-size: 16px; margin: 0 0 var(--space-3); }
.form-narrow { max-width: var(--admin-form-w); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.field { margin: 0 0 var(--space-4); }
.field > label, .field__label { display: block; margin-bottom: 4px; }
.field__hint, .hint { display: block; color: var(--admin-text-muted); font-size: 13px; font-weight: 400; margin-top: 4px; }

/* item list (one row = one thing: name, description, state, actions) */
.item-list { list-style: none; margin: 0; padding: 0; background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); }
.item-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-5); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--admin-border); }
.item-list > li:last-child { border-bottom: 0; }
.item__title { font-weight: 700; font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; }
.item__desc { color: var(--admin-text-muted); font-size: 14px; margin: 4px 0 0; }
.item__notes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 13px; color: var(--admin-text-muted); }
.item__actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: var(--space-2); }
.item-list details.tech { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 640px) { .item-list > li { grid-template-columns: 1fr; } .item__actions { justify-content: flex-start; } }

.item-list--compact > li { padding: 10px var(--space-5); grid-template-columns: minmax(10em, 1fr) minmax(0, 2fr); align-items: baseline; font-size: 14px; }
.counts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--admin-text-muted); }
.counts b { color: var(--admin-text); font-size: 15px; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* checklist (setup progress) */
.check { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.check + .check { border-top: 1px solid var(--admin-border); }
.check__mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--admin-border-strong); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 3px; color: #fff; }
.check.is-done .check__mark { background: var(--admin-success); border-color: var(--admin-success); }
/* setup progress: 次にすること (open steps with their button) first, finished steps folded, one line when complete */
.check__text { flex: 1; min-width: 0; }
.check > .btn { flex: none; margin-top: 2px; }
.setup .card__header { margin-bottom: var(--space-2); }
.setup__label { margin: 0 0 var(--space-1); font-size: 12px; font-weight: 700; color: var(--admin-text-muted); }
.setup__complete { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.setup__complete .check__mark { margin-top: 0; background: var(--admin-success); border-color: var(--admin-success); }
.setup__done { font-size: 14px; }

.muted { color: var(--admin-text-muted); font-size: var(--admin-fs-small); }
.text-muted { color: var(--admin-text-muted); }
.nowrap { white-space: nowrap; }
/* 閲覧制限 → ポータルでの表示 (MB4): a sub input under a choice — the label above, the input as wide as the column allows */
.portal-display__sub { display: block; margin-top: var(--space-2); }
.portal-display__sub > input, .portal-display__sub > select { display: block; max-width: 100%; margin-top: var(--space-1); }
.visually-hidden { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* content editor: the form (content, taxonomy, files, window + save) and, beside it on wide screens, publishing + history */
.admin-main--editor .admin-main__inner { max-width: 1280px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.editor-layout:has(> .editor-side) { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
.editor-side { position: sticky; top: calc(var(--admin-topbar-h) + var(--space-4)); display: flex; flex-direction: column; gap: var(--space-3); max-height: calc(100vh - var(--admin-topbar-h) - var(--space-5)); overflow-y: auto; }
.editor-side .card + .card { margin-top: 0; }
.editor-side form + form { border-top: 1px solid var(--admin-border); padding-top: var(--space-3); }
.editor-actions { position: sticky; bottom: 0; background: var(--admin-surface); padding: var(--space-3) 0; margin-bottom: calc(-1 * var(--space-2)); border-top: 1px solid var(--admin-border); z-index: 3; }
/* オプション: the options in use, then the unused ones folded */
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: var(--space-4) 0 var(--space-2); }
.section-title .count, .options-unused > summary .count { font-size: 12px; font-weight: 600; color: var(--admin-text-muted); background: var(--admin-neutral-soft); border-radius: 999px; padding: 0 8px; }
details.options-unused { margin-top: var(--space-4); }
details.options-unused > .field__hint { margin: 0 0 var(--space-2); }
/* home: the few most urgent sites, then one link to the rest */
.home-attention .col-narrow { display: none; }
@media (max-width: 639px) {
  .home-attention .col-wide { display: none; }
  .home-attention .col-narrow { display: block; white-space: normal; margin-top: 4px; }
  .home-attention .badge { white-space: nowrap; }
}
.list-more { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0 0; }
.locale-block { background: var(--admin-surface-muted); }
/* another language (details): one line — name · state · 「編集する」 — until opened; the inputs show only for 「翻訳あり」 */
details.locale-block--extra { border: 1px solid var(--admin-border); border-radius: var(--admin-radius); margin: 0 0 var(--space-4); }
details.locale-block--extra > summary { list-style: none; display: flex; align-items: center; gap: var(--space-2); padding: 10px var(--space-4); }
details.locale-block--extra > summary::-webkit-details-marker { display: none; }
details.locale-block--extra > summary:focus-visible { outline: 2px solid var(--admin-focus); outline-offset: -2px; border-radius: var(--admin-radius); }
.locale-block__name { font-weight: 700; }
.locale-block__toggle { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--admin-accent); }
.locale-block__toggle::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 2px 2px 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
details[open] > summary .locale-block__toggle::after { transform: rotate(-135deg); margin-bottom: -2px; }
.locale-block__close, details[open] > summary .locale-block__open { display: none; }
details[open] > summary .locale-block__close { display: inline; }
details.locale-block--extra[open] > summary { border-bottom: 1px solid var(--admin-border); }
.locale-block__body { padding: var(--space-3) var(--space-4) var(--space-2); }
.locale-block__hint { display: none; }
details.locale-block__more { margin: 0 0 var(--space-2); }
details.locale-block__more > summary { font-size: 13px; }
.locale-block--extra:has(input[value="translated"]:not(:checked)) .locale-block__fields { display: none; }
.locale-block--extra:has(input[value="translated"]:not(:checked)) .locale-block__hint { display: block; margin: 0 0 var(--space-2); }
/* link kind (記事ページ・ファイル・サイト内のページ・外部リンク): the URL / target / new-window / file inputs only for the kind that uses them */
.editor-main:has(input[type="radio"][name="link_mode"][value="external"]:not(:checked)) .link-only--external,
.editor-main:has(input[type="radio"][name="link_mode"][value="internal"]:not(:checked)) .link-only--internal,
.editor-main:has(input[type="radio"][name="link_mode"][value="file"]:not(:checked)) .link-only--file { display: none; }
.field__inline { display: inline-block; margin-left: var(--space-2); }
.attach-add { align-items: center; }
.revisions { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.revisions li { padding: 8px 0; border-top: 1px solid var(--admin-border); }
.revisions li:first-child { border-top: 0; padding-top: 0; }
.revisions__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.input-xs { width: 5em; min-width: 0; }
@media (max-width: 1199px) {
  .editor-layout:has(> .editor-side) { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; max-height: none; overflow: visible; }
}

/* login / error pages (no shell) */
.admin-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-5) var(--space-4); }
.admin-auth__box { width: min(400px, 100%); background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: 12px; padding: var(--space-6); box-shadow: var(--admin-shadow); }
.admin-auth__brand { margin-bottom: var(--space-5); }
.admin-auth h1 { font-size: 22px; margin-bottom: var(--space-4); }
.admin-auth label { display: block; font-weight: 600; font-size: 14px; }
.admin-auth button[type=submit] { width: 100%; min-height: 42px; }

/* phone: legacy 7–9 column tables scroll inside themselves, never the page */
@media (max-width: 760px) {
  .admin-main table:not(.table-wrap > table) { display: block; overflow-x: auto; }
  .page-actions { width: 100%; }
}
.card__note { margin: var(--space-3) 0 0; }
.steps--wizard { margin: 0 0 var(--space-4); }
.page-lead { color: var(--admin-text-muted); font-size: 14px; max-width: 80ch; margin: 0 0 var(--space-4); }
td.indent { padding-left: 32px; }
.logo-preview { max-height: 80px; max-width: 320px; background: #fff; border: 1px solid var(--admin-border); border-radius: var(--admin-radius-sm); padding: 4px; }
.thumb-sm { max-width: 160px; max-height: 90px; border-radius: 4px; }

/* Module Builder (MB2): repeater rows of the entry form, link field */
.repeater__rows { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: grid; gap: var(--space-2); }
.repeater__row { position: relative; padding: var(--space-2) var(--space-3); border: 1px solid var(--admin-border); border-radius: var(--admin-radius-sm); background: var(--admin-surface-muted); }
.repeater__no { position: absolute; top: var(--space-1); right: var(--space-2); }
[data-link-field] { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16em), 1fr)); gap: var(--space-2) var(--space-3); align-items: center; min-width: 0; }
[data-link-field] > legend { grid-column: 1 / -1; }
fieldset.ae-field[data-link-field] > label { display: grid; margin: 0; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; min-width: 0; white-space: nowrap; }
fieldset.ae-field[data-link-field] > label:has(input[type=checkbox]) { grid-template-columns: auto 1fr; }
fieldset.ae-field[data-link-field] > label select, fieldset.ae-field[data-link-field] > label input[type=url], fieldset.ae-field[data-link-field] > label input[type=text] { width: 100%; min-width: 0; }
[data-link-field] > .field__hint { grid-column: 1 / -1; }
.item-list > li > details.disclosure { grid-column: 1 / -1; margin-top: 0; }

/* Listing Builder (MB3): a listing's screen — header, section switcher (segmented), indented sub-options, term checkboxes */
.section__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.section__head .section__desc { flex: 1 1 320px; margin: 0; }
.listing-head { margin-bottom: var(--space-4); }
.listing-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--admin-fs-section); margin: 4px 0; overflow-wrap: anywhere; }
.field--indent { margin-left: 28px; }
.check-row, .segmented-choices { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.filter-tax { padding: var(--space-3) 0; border-top: 1px solid var(--admin-border); }
.companion-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.companion-row select { max-width: 100%; }
.impact { margin: var(--space-3) 0; padding: var(--space-3); border: 1px solid var(--admin-border); border-radius: var(--admin-radius); background: var(--admin-surface-muted); }
.impact h4 { margin: 0 0 6px; }
.tab-rows { display: grid; gap: 8px; }
.tab-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--admin-border); border-radius: var(--admin-radius-sm); }
.tab-row > * { min-width: 0; max-width: 100%; }
.tab-row select { flex: 1 1 220px; width: auto; }
.tab-row input[type="text"] { flex: 1 1 140px; width: auto; }
@media (max-width: 640px) { .tab-row select, .tab-row input[type="text"] { flex-basis: 100%; width: 100%; } }
@media (max-width: 640px) { .field--indent { margin-left: 12px; } }
/* まとめ方: the sub-options of a choice are shown when it is chosen (without :has support they simply stay visible) */
.check:has(> input[type="radio"]:not(:checked)) + .field--indent,
.check:has(> input[type="radio"]:not(:checked)) + .field--indent + .field--indent { display: none; }

/* Final Admin UI Acceptance: module overview cards, the sub-page switcher under the module tabs, plain tags, folded add forms */
.segmented--sub { margin-top: calc(-1 * var(--space-2)); }
.overview { margin: 0 0 var(--space-4); align-items: stretch; }
.overview__card { display: flex; flex-direction: column; gap: var(--space-2); }
.overview__card + .overview__card { margin-top: 0; }
.overview__lead { margin: 0; font-size: 14px; color: var(--admin-text-muted); }
.overview__lead b { color: var(--admin-text); font-size: 20px; margin: 0 2px; font-variant-numeric: tabular-nums; }
.overview__sub { font-size: 13px; }
.overview__note { margin: 0; font-size: 13px; color: var(--admin-text-muted); overflow-wrap: anywhere; }
.overview__link { margin-top: auto; padding-top: var(--space-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.overview__link::after { content: " →"; }
.overview__link:hover { text-decoration: underline; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.tags li { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--admin-surface-sunken); color: var(--admin-text-muted); }
details.adder { margin: var(--space-4) 0 0; }
details.adder > summary { list-style: none; display: inline-flex; }
details.adder > summary::-webkit-details-marker { display: none; }
details.adder[open] > summary { margin-bottom: var(--space-3); }
details.adder[open] > summary.btn--primary { background: var(--admin-surface); color: var(--admin-text); border-color: var(--admin-border-strong); }
details.advanced { margin: 0 0 var(--space-4); }
details.advanced > summary { font-size: 13px; font-weight: 600; color: var(--admin-text-muted); }
details.advanced[open] > summary { margin-bottom: var(--space-2); }
.danger-zone { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--admin-border); }
.danger-zone > h2 { font-size: var(--admin-fs-sub); color: var(--admin-danger); margin: 0 0 var(--space-3); }
.link-danger { color: var(--admin-danger); background: none; border: 0; padding: 0; min-height: 0; font-size: 13px; font-weight: 400; text-decoration: underline; cursor: pointer; }
/* a quiet row action (ゴミ箱へ・削除 in lists): text, not a button-looking box; the danger colour only on hover */
.link-quiet { color: var(--admin-text-muted); font-size: 13px; font-weight: 400; background: none; border: 0; padding: 2px 4px; min-height: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-quiet:hover { color: var(--admin-danger); background: none; }
.menu__panel--wide { min-width: min(400px, calc(100vw - 24px)); }
.menu__panel--wide a { align-items: baseline; }
.menu__panel--wide .menu__meta { flex: 0 1 auto; text-align: right; }
.listing-head__uses { font-size: 13px; color: var(--admin-text-muted); margin: -8px 0 var(--space-4); }
/* オプション: one line per option (name · what it does · 変更); the form opens below the line */
.item-list--options > li { grid-template-columns: minmax(10em, 1fr) minmax(0, 2fr) auto; }
.item-list--options > li > details.disclosure { grid-column: auto; margin: 0; }
.item-list--options > li > details.disclosure > summary { font-size: 13px; }
.item-list--options > li > details.disclosure[open] { grid-column: 1 / -1; padding-top: var(--space-2); border-top: 1px dashed var(--admin-border); }
@media (max-width: 640px) { .item-list--options > li { grid-template-columns: 1fr; } }
/* home (site-level people): the next publishing step in one row, then the content table */
.next--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.next__action { margin: 2px 0 0; font-weight: 600; }
.site-home .section__header .muted { overflow-wrap: anywhere; }
details.invite > summary { color: var(--admin-text); }
.invite__title { font-size: var(--admin-fs-section); font-weight: 700; }
details.invite[open] > summary { margin-bottom: var(--space-2); }
/* publishing: what to do next comes first (left on desktop, top on phones), the facts and the flow beside it */
.status-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.status-board__next { order: -1; border-left: 0; padding-left: 0; border-right: 1px solid var(--admin-border); padding-right: var(--space-5); }
@media (max-width: 860px) { .status-board { grid-template-columns: 1fr; } .status-board__next { border-right: 0; padding-right: 0; } }
.publishing-note { max-width: 90ch; margin: 0 0 var(--space-4); }
.section + .form-section, .section + form.form-section { margin-top: var(--space-4); }
@media (max-width: 640px) { .col-optional { display: none; } }
/* technical details inside a list row: a quiet line, not a second grey box per row */
.item-list details.tech { border: 0; background: none; }
.item-list details.tech > summary { padding: 0; font-weight: 400; }
.item-list details.tech > :not(summary) { margin: 6px 0 0; }
@media (max-width: 640px) { .admin-main button, .admin-main .btn { white-space: normal; text-align: center; max-width: 100%; } }

/* Theme source editing: file navigation and escaped code, never a rendered theme on this origin. */
.theme-editor { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-5); }
.theme-editor__files { min-width: 0; padding: var(--space-4); border: 1px solid var(--admin-border); border-radius: 8px; background: var(--admin-surface, #fff); }
.theme-editor__files h2 { margin-top: 0; }
.theme-editor__files ul { list-style: none; padding: 0; margin: var(--space-3) 0 0; max-height: 65vh; overflow: auto; }
.theme-editor__files li[hidden] { display: none; }
.theme-editor__files a { display: block; padding: 9px 8px; border-radius: 5px; overflow-wrap: anywhere; text-decoration: none; }
.theme-editor__files a[aria-current] { background: #eaf1fa; color: #14365d; font-weight: 600; }
.theme-editor__files a .muted { display: block; font-size: 11px; }
.theme-editor__form { min-width: 0; }
.theme-editor__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-bottom: 10px; }
.theme-editor__form textarea { display: block; width: 100%; max-width: 100%; min-height: 480px; background: #f9fafc; color: #172437; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; resize: vertical; border: 1px solid var(--admin-border); border-radius: 8px; padding: 16px; }
.theme-editor__form input { width: 100%; }
@media (max-width: 860px) { .theme-editor { grid-template-columns: 1fr; } .theme-editor__files ul { max-height: 180px; } .theme-editor__form textarea { min-height: 360px; } }
