/* Admin console, Mayfair Skin layout: system things (sections, account, sign-out) in the left bar;
   page things (title and actions) in the page top bar. Desktop first, works at 390 px. */
.console { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; min-height: 100dvh; }
.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: 0.5rem 0.8rem; z-index: 50; border-radius: var(--r-ctl); }
.skip:focus { left: 0.5rem; top: 0.5rem; }

.sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; min-width: 0; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.brand { font-weight: 700; font-size: var(--fs-xl); letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.55rem; }
.brand::before { content: ""; width: 4px; height: 1.15em; border-radius: 2px; background: var(--accent); }
.brand-sub { font-weight: 500; font-size: var(--fs-sm); color: var(--muted); padding: 1px 7px; border-radius: var(--r-chip); background: var(--bg-soft2); }
.mobile-signout { display: none; }
.section-label { padding: 10px 16px 4px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--r-ctl); color: var(--text); text-decoration: none; font-size: var(--fs-md); }
.nav a:hover { background: var(--bg-soft2); }
.nav a[aria-current=page] { background: var(--accent-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.planned-tag { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }
.who { min-width: 0; flex: 1; line-height: 1.25; }
.who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-plan { font-size: var(--fs-xs); color: var(--muted); }

.content { min-width: 0; outline: none; padding-bottom: 3rem; }
.pagebar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; height: 48px; padding: 0 28px; background: var(--bg); border-bottom: 1px solid var(--border); }
.pagebar h1 { margin: 0; font-size: var(--fs-xl); }
.pagebar .screen-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
.screen { padding: 22px 28px 0; max-width: 1180px; }
.screen h2 { font-size: var(--fs-xl); margin-top: 1.7rem; }
.screen h3 { font-size: var(--fs-lg); margin-top: 1.4rem; }
.prose { max-width: 46rem; font-size: var(--fs-lg); line-height: 1.6; }
.prose li { margin: 0.35rem 0; }
.prose code, .tool-name code { background: var(--bg-soft2); border-radius: var(--r-chip); padding: 0.08em 0.38em; font-size: 0.88em; }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--mono); font-size: var(--fs-sm); }
.stack { display: flex; flex-direction: column; gap: 0.3rem; max-width: 46rem; margin-top: 0.5rem; }
.stack textarea, .stack input[type=text] { width: 100%; }
.stack .field-row input[type=text] { min-width: 12rem; }
.stack button[type=submit] { margin-top: 0.9rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 14px; margin: 14px 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 16px 18px; min-width: 0; }
.stat-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-value { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; overflow-wrap: anywhere; }
.stat-note { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.stat-ok .stat-value { color: var(--ok); }
.stat-bad { border-color: var(--danger-border); background: var(--danger-bg); }
.stat-bad .stat-value { color: var(--danger); }
.stat-warn { border-color: var(--warn-border); background: var(--warn-bg); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.tbl-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-panel); margin: 14px 0; }
.tbl { border-collapse: collapse; width: 100%; font-size: var(--fs-md); }
.tbl th, .tbl td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { background: var(--bg-soft); white-space: nowrap; font-size: var(--fs-sm); font-weight: 600; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--bg-soft); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-empty { padding: 14px 16px; margin: 0; }
.th-btn { font: inherit; font-weight: 600; font-size: var(--fs-sm); background: none; border: 0; padding: 0; cursor: pointer; color: inherit; height: var(--h-s); }
.summary { font-size: var(--fs-lg); }
.people-out { margin-top: 8px; }
.people-out .copy-btn { vertical-align: middle; }

.tool-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; max-width: 52rem; }
.tool-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--r-panel); padding: 14px 16px; background: var(--panel); }
.tool-main { min-width: 0; }
.tool-desc { margin: 4px 0 0; }
.tool-pending { margin: 6px 0 0; font-weight: 600; color: var(--accent-text); }
.switch { flex: none; width: 44px; height: 26px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--bg-soft2); position: relative; cursor: pointer; padding: 0; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 6px; background: var(--muted); transition: transform 0.12s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on .knob { transform: translateX(18px); background: var(--on-accent); }

.example-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 12px; max-width: 56rem; }
.example { border: 1px solid var(--border); border-radius: var(--r-panel); padding: 16px 18px; background: var(--panel); }
.example-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ex-label { margin: 12px 0 4px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ex-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 8px 12px; }
.example-actions { display: flex; gap: 8px; margin-top: 12px; }
.id-box { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 6px 10px; overflow-wrap: anywhere; margin: 4px 0; }
.setup-id { margin: 1rem 0; }

@media (max-width: 800px) {
  .console { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-top { padding: 8px 12px 0; }
  .mobile-signout { display: inline-flex; }
  .sidebar-foot, .nav .section-label, .planned-tag { display: none; }
  .nav { flex: none; overflow-x: auto; overflow-y: hidden; padding: 6px 8px 8px; }
  .nav ul { flex-direction: row; gap: 4px; }
  .nav a { white-space: nowrap; }
  .pagebar { padding: 0 14px; position: static; }
  .screen { padding: 16px 14px 0; }
  .tool-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .switch .knob { transition: none; } }
