/* The content dashboard's styles (kit v2, option A). Only the dashboard page loads this file (admin/dashboard/index.html); it never reaches a
   visitor's page. One neutral system font, hairline borders, square corners, warm near-black and near-white, gold for the one main action. */
:root {
  --eh-ink: #1d1b18; --eh-paper: #faf9f7; --eh-wash: #f1eee9; --eh-line: #d6d0c6; --eh-mute: #665f55; --eh-err: #a3261b;
  --eh-bar: #17150f; --eh-bar-line: #2c2923; --eh-bar-btn: #4a453c; --eh-bar-text: #f3efe7; --eh-bar-mute: #a39c8e;
  --eh-gold: #b07d2e; --eh-gold-hi: #e0b25c; --eh-gold-ink: #17150f;
  --eh-live: #2b6a3c; --eh-live-bg: #e3efe2; --eh-draft: #7a5415; --eh-draft-bg: #f4e8cf; --eh-err-bg: #f8e6e3;
  --eh-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 14px/1.45 var(--eh-font); color: var(--eh-ink); background: var(--eh-paper); -webkit-font-smoothing: antialiased; }
#eh-dash { min-height: 100vh; font-family: var(--eh-font); }
:where(#eh-dash) button { font: inherit; color: inherit; cursor: pointer; }
:where(#eh-dash) a { color: inherit; }
#eh-dash :focus-visible { outline: 2px solid var(--eh-gold-hi); outline-offset: 2px; }
#eh-dash .ehd-top :focus-visible, #eh-dash .ehd-toast :focus-visible { outline-color: var(--eh-gold-hi); }
#eh-dash [hidden] { display: none !important; }
.ehd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ehd-i { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.ehd-loading, .ehd-fail { padding: 56px 24px; max-width: 640px; }

/* buttons and links */
.ehd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--eh-ink); background: transparent; color: var(--eh-ink);
  font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; line-height: 1; }
.ehd-btn:hover:not(:disabled) { background: var(--eh-ink); color: #fff; }
.ehd-btn:disabled { opacity: .45; cursor: default; }
.ehd-btn.solid { background: var(--eh-ink); color: #fff; }
.ehd-btn.solid:hover:not(:disabled) { background: #000; }
.ehd-btn.gold { background: var(--eh-gold); border-color: var(--eh-gold); color: var(--eh-gold-ink); font-weight: 700; }
.ehd-btn.gold:hover:not(:disabled) { background: var(--eh-gold-hi); border-color: var(--eh-gold-hi); color: var(--eh-gold-ink); }
.ehd-btn.danger { background: var(--eh-err); border-color: var(--eh-err); color: #fff; font-weight: 700; }
.ehd-btn.danger:hover:not(:disabled) { background: #7f1c13; border-color: #7f1c13; color: #fff; }
.ehd-btn.sm { height: 32px; padding: 0 12px; }
.ehd-btn.big { height: 42px; padding: 0 18px; font-size: 14px; }
.ehd-lnk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: none; border: 0; padding: 0; font-weight: 600; font-size: 13px; color: var(--eh-ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--eh-line); min-height: 32px; }
.ehd-lnk:hover { text-decoration-color: currentColor; }
.ehd-lnk.del { color: var(--eh-err); }

/* top bar and account menu */
.ehd-top { height: 56px; background: var(--eh-bar); color: var(--eh-bar-text); display: flex; align-items: center; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--eh-bar-line); position: relative; z-index: 20; }
.ehd-brand { display: flex; align-items: baseline; gap: 12px; font-weight: 800; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; min-width: 0; }
.ehd-sitename { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ehd-brand small { font-weight: 600; font-size: 11px; letter-spacing: .14em; color: var(--eh-gold-hi); }
.ehd-sp { flex: 1; }
.ehd-ext { color: var(--eh-bar-text); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; padding: 8px 4px; }
.ehd-ext:hover { color: var(--eh-gold-hi); }
.ehd-tool { color: var(--eh-bar-text); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; padding: 8px 4px; }
.ehd-tool:hover { color: var(--eh-gold-hi); }
.ehd-acct { position: relative; }
.ehd-acct-btn { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 4px; background: transparent; border: 1px solid transparent; color: var(--eh-bar-text); }
.ehd-acct-btn:hover, .ehd-acct-btn[aria-expanded=true] { border-color: var(--eh-bar-btn); background: #221f19; }
.ehd-mono { width: 28px; height: 28px; background: var(--eh-gold); color: var(--eh-gold-ink); font-weight: 800; font-size: 12px; display: grid; place-items: center; letter-spacing: .02em; }
.ehd-acct-name { font-size: 13px; font-weight: 600; }
.ehd-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 268px; background: #fff; color: var(--eh-ink); border: 1px solid var(--eh-line); box-shadow: 0 18px 40px rgba(23, 21, 15, .28); z-index: 60; }
.ehd-who { padding: 14px 16px; border-bottom: 1px solid var(--eh-line); }
.ehd-who b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.ehd-who span { color: var(--eh-mute); font-size: 12px; }
.ehd-menu button, .ehd-menu a { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 12px 16px; background: none; border: 0; text-align: left; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--eh-ink); }
.ehd-menu button:hover, .ehd-menu a:hover { background: var(--eh-wash); }
.ehd-sep { height: 1px; background: var(--eh-line); }

/* shell */
.ehd-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.ehd-col { min-width: 0; }
.ehd-rail { background: var(--eh-wash); border-right: 1px solid var(--eh-line); padding: 28px 16px 24px; display: flex; flex-direction: column; gap: 4px; }
.ehd-rail h6 { margin: 18px 12px 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--eh-mute); font-weight: 700; }
.ehd-rail h6:first-child { margin-top: 0; }
.ehd-rail button { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 42px; padding: 0 12px; background: transparent; border: 0; text-align: left; font-weight: 600; font-size: 14px; }
.ehd-rail button .n { font-weight: 500; font-size: 12px; color: var(--eh-mute); font-variant-numeric: tabular-nums; }
.ehd-rail button:hover { background: #e7e2da; }
.ehd-rail button[aria-current=page] { background: var(--eh-ink); color: #fff; }
.ehd-rail button[aria-current=page] .n { color: #c9c2b4; }
.ehd-foot { margin-top: auto; padding: 16px 12px 0; color: var(--eh-mute); font-size: 12px; line-height: 1.5; border-top: 1px solid var(--eh-line); }
.ehd-tabs { display: none; }
.ehd-main { padding: 40px 56px 64px; max-width: 1240px; width: 100%; margin: 0 auto; }      /* centred in the space right of the rail, so wide screens do not leave one empty half */
.ehd-done { font-size: 13px; font-weight: 600; color: var(--eh-mute); }
.ehd-crumb { font-size: 12px; font-weight: 600; color: var(--eh-mute); margin-bottom: 14px; letter-spacing: .02em; }
.ehd-crumb button { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--eh-mute); font-weight: 600; font-size: inherit; }
.ehd-crumb button:hover { color: var(--eh-ink); }
.ehd-t { margin: 0; font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -.01em; }
#eh-dash .ehd-t:focus, #eh-dash .ehd-t:focus-visible { outline: none; }      /* the section title is not a control: it takes focus from the script only so a screen reader announces it */
.ehd-lede { margin: 10px 0 0; color: var(--eh-mute); font-size: 15px; max-width: 60ch; }
.ehd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.ehd-note { margin: 14px 0 0; color: var(--eh-mute); font-size: 13px; max-width: 70ch; }
.ehd-live { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 12px 16px; background: var(--eh-draft-bg); color: var(--eh-draft); font-size: 13.5px; font-weight: 600; }
.ehd-live .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ehd-spin .9s linear infinite; flex: none; }
@keyframes ehd-spin { to { transform: rotate(360deg); } }

/* section cards */
.ehd-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ehd-card { background: #fff; border: 1px solid var(--eh-line); padding: 22px 22px 20px; display: flex; flex-direction: column; min-height: 236px; }
.ehd-card .num { font-weight: 800; font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ehd-card h3 { margin: 14px 0 6px; font-size: 16px; font-weight: 700; }
.ehd-card p { margin: 0; color: var(--eh-mute); font-size: 13px; line-height: 1.5; }
.ehd-card .act { margin-top: auto; padding-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ehd-card .fixed { display: inline-flex; align-items: center; min-height: 32px; font-size: 12px; color: var(--eh-mute); }
.ehd-card .meta { margin-top: 10px; font-size: 12px; color: var(--eh-mute); }
.ehd-s { margin: 44px 0 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--eh-mute); }

/* lists */
.ehd-list { background: #fff; border: 1px solid var(--eh-line); margin: 0; }
.ehd-list .row { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.8fr) 84px 124px 300px; align-items: center; gap: 20px; padding: 0 24px; min-height: 68px; border-bottom: 1px solid var(--eh-line); }
.ehd-list .row:last-child { border-bottom: 0; }
.ehd-list .row.hd { min-height: 42px; background: var(--eh-wash); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--eh-mute); }
.ehd-list .ti { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; margin: 0; }
.ehd-list .ad { font: 500 12px/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--eh-mute); overflow-wrap: anywhere; }
.ehd-list .dt { font-size: 13px; color: var(--eh-mute); margin: 0; }
.ehd-list .ac { display: flex; gap: 14px; align-items: center; justify-content: flex-end; }
.ehd-list .ac .ehd-btn { margin-right: 2px; }
.ehd-list .ac .gap { width: 1px; height: 20px; background: var(--eh-line); }
.ehd-busy { font-size: 13px; color: var(--eh-mute); font-weight: 600; }
.ehd-pill { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .02em; width: max-content; }
.ehd-pill::before { content: ""; width: 7px; height: 7px; background: currentColor; }
.ehd-pill.live { color: var(--eh-live); background: var(--eh-live-bg); }
.ehd-pill.draft { color: var(--eh-draft); background: var(--eh-draft-bg); }
.ehd-list.recent .row { grid-template-columns: minmax(0, 2.4fr) 150px 92px 130px 150px; min-height: 60px; }
.ehd-list .type { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--eh-mute); }
.ehd-list.hist .row { grid-template-columns: minmax(0, 3fr) 190px minmax(0, 290px); min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.ehd-list .ev b { font-weight: 700; }
.ehd-list .ev span { display: block; color: var(--eh-mute); font-size: 12.5px; overflow-wrap: anywhere; }
.ehd-dl .row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.ehd-dl dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.ehd-dl dd.none { color: var(--eh-mute); }

/* toast */
.ehd-toast { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); background: var(--eh-bar); color: var(--eh-bar-text); padding: 14px 16px 14px 20px; display: flex; gap: 20px; align-items: center; font-size: 14px; z-index: 90; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); max-width: calc(100vw - 32px); }
.ehd-toast .ehd-lnk { color: var(--eh-gold-hi); text-decoration-color: var(--eh-gold-hi); }

/* dialogs (native <dialog>: focus stays inside, Escape closes, focus returns) */
.ehd-dlg { border: 0; padding: 30px 30px 24px; width: calc(100% - 32px); max-width: 508px; background: #fff; color: var(--eh-ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); font-family: var(--eh-font); }
.ehd-dlg::backdrop { background: rgba(23, 21, 15, .62); }
.ehd-dlg h2 { margin: 0 0 12px; font-size: 21px; line-height: 1.25; font-weight: 800; }
.ehd-dlg p { margin: 0 0 12px; color: #3d3932; font-size: 14.5px; line-height: 1.55; }
.ehd-restore { background: var(--eh-wash); padding: 12px 14px; font-size: 13.5px; color: var(--eh-ink); margin: 16px 0 4px; display: flex; gap: 10px; align-items: flex-start; }
.ehd-restore .ehd-i { margin-top: 3px; }
.ehd-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.ehd-dlg .ehd-btn { height: auto; min-height: 42px; padding: 10px 18px; font-size: 14px; line-height: 1.25; max-width: 100%; white-space: normal; text-align: center; }      /* a label can wrap, so no button ever leaves the dialog */
.ehd-dlg [data-dash-keep]:focus { outline: 2px solid var(--eh-gold-hi); outline-offset: 2px; }
.ehd-pick { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

@media (prefers-reduced-motion: reduce) { .ehd-live .spin { animation: none; } }

/* narrower windows */
@media (max-width: 1100px) {
  .ehd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ehd-list .row { grid-template-columns: minmax(0, 2fr) 92px 124px 260px; }
  .ehd-list .row .ad { display: none; }
  .ehd-list .row .ti::after { content: attr(data-path); display: block; font: 500 12px/1.4 ui-monospace, Consolas, monospace; color: var(--eh-mute); margin-top: 2px; }
  .ehd-list.recent .row { grid-template-columns: minmax(0, 2fr) 120px 92px 124px 150px; }
  .ehd-list.hist .row { grid-template-columns: minmax(0, 2fr) 170px minmax(0, 260px); }
  .ehd-list.hist .row .ti::after, .ehd-dl .row .ti::after { content: none; }
}
/* phone */
@media (max-width: 760px) {
  .ehd-top { padding: 0 12px; gap: 10px; }
  .ehd-ext { padding: 0 8px; min-height: 44px; }
  .ehd-tool { display: none; }                       /* the same links are in the account menu on a phone */
  .ehd-ext-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ehd-ext .ehd-i { width: 18px; height: 18px; }
  .ehd-brand { font-size: 13px; white-space: nowrap; gap: 8px; }
  .ehd-brand small { font-size: 10px; }
  .ehd-acct-name { display: none; }
  .ehd-acct-btn { min-height: 44px; }
  .ehd-shell { display: block; }
  .ehd-rail { display: none; }
  .ehd-tabs { display: flex; overflow-x: auto; background: var(--eh-wash); border-bottom: 1px solid var(--eh-line); padding: 0 8px; gap: 2px; scrollbar-width: none; }
  .ehd-tabs::-webkit-scrollbar { display: none; }
  .ehd-tabs button { flex: none; height: 48px; padding: 0 12px; background: none; border: 0; font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--eh-mute); }
  .ehd-tabs button[aria-current=page] { color: var(--eh-ink); border-bottom-color: var(--eh-ink); }
  .ehd-main { padding: 24px 16px 56px; }
  .ehd-t { font-size: 26px; }
  .ehd-lede { font-size: 14px; }
  .ehd-head { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 22px; }
  .ehd-head .ehd-btn { justify-content: center; }
  .ehd-cards { grid-template-columns: 1fr; gap: 12px; }
  .ehd-card { min-height: 0; padding: 18px; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
  .ehd-card .num { grid-row: 1 / span 2; font-size: 38px; align-self: start; min-width: 44px; }
  .ehd-card h3 { margin: 2px 0 4px; }
  .ehd-card .meta { grid-column: 2; margin-top: 6px; }
  .ehd-card .act { grid-column: 1 / -1; padding-top: 14px; }
  .ehd-card .act .ehd-btn { flex: 1; min-height: 44px; }
  .ehd-list .row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 16px; align-items: start; }
  .ehd-list .row.hd { display: none; }
  .ehd-list .st { grid-column: 2; grid-row: 1; }
  .ehd-list .dt { grid-column: 1 / -1; order: 3; }
  .ehd-list .ac { grid-column: 1 / -1; order: 4; justify-content: flex-start; padding-top: 6px; gap: 14px; }
  .ehd-list .ac .ehd-btn { flex: 1; min-height: 44px; }
  .ehd-list .ac .ehd-lnk { min-height: 44px; }
  .ehd-list .ac .gap { display: none; }
  .ehd-list .ac .ehd-lnk.del { margin-left: auto; }
  .ehd-list.recent .row { grid-template-columns: 1fr auto; }
  .ehd-list.recent .row .type { grid-column: 1; order: 2; }
  .ehd-list.recent .row .dt { grid-column: 2; order: 3; text-align: right; }
  .ehd-list.recent .row .st { grid-column: 2; grid-row: 1; }
  .ehd-list.hist .row { grid-template-columns: 1fr; }
  .ehd-list.hist .row .ac { grid-column: 1; }
  .ehd-dl .row { grid-template-columns: 1fr; }
  .ehd-toast { bottom: 16px; flex-wrap: wrap; gap: 8px 16px; }
  .ehd-dlg { padding: 22px 20px 20px; }
  .ehd-btns { flex-direction: column-reverse; }
  .ehd-btns .ehd-btn { justify-content: center; }
  .ehd-menu { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
}
