/* Bardeon band admin UI layer: the visual language of the engagement dashboard
   (cards, clear hierarchy, compact controls, progressive disclosure) for every tab.
   Loaded after bardeon-admin.css. Admin pages only; storefront styles are untouched. */

.section.ui-page { max-width: 1100px; }
.ui-lead { margin: 0 0 14px; color: var(--muted); font-size: var(--t-small); line-height: 1.5; max-width: 70ch; }
.ui-lead a { color: var(--gold); }

/* Cards */
.ui-card, .section .card, .section .onboarding {
  margin: 0 0 14px; padding: 16px; border-radius: 12px;
  background: var(--bg-raise); border: 1px solid var(--line);
}
.ui-card > h2, .section .card > h2, .ui-card-head h2 { margin: 0 0 6px; font-size: 1.1rem; }
.ui-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ui-card-head p { margin: 0; }
.ui-accent { border-top: 2px solid var(--gold); background: radial-gradient(120% 90% at 100% 0%, rgba(228, 168, 68, .12), transparent 60%), var(--bg-raise); }
.ui-accent-red { border-top: 2px solid var(--accent); background: radial-gradient(120% 90% at 100% 0%, var(--accent-wash), transparent 60%), var(--bg-raise); }
.ui-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ui-grid > * { margin: 0; }
.ui-span { grid-column: 1 / -1; }

/* Compact pills / counts */
.ui-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--bg-sunk); white-space: nowrap; }
.ui-pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-wash); }
.ui-pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-wash); }
.ui-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Fields */
.ui-field { display: grid; gap: 4px; margin: 0; }
.ui-field > span, .ui-field > .ui-label { color: var(--muted); font-size: var(--t-small); font-weight: 500; }
.ui-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ui-page input[type="text"], .ui-page input[type="url"], .ui-page input[type="email"], .ui-page input[type="number"],
.ui-page input[type="date"], .ui-page input[type="password"], .ui-page select {
  width: 100%; max-width: none; box-sizing: border-box; min-height: 40px; margin: 0; }

/* Actions */
.ui-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.ui-actions .hint { margin: 0; }
.ui-actions.sticky { position: sticky; bottom: 0; z-index: 2; margin: 12px -16px -16px; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg-raise) 92%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.ui-page .ui-actions button, .ui-page .ui-actions .button, .ui-page .ui-actions input[type="submit"] { width: auto; margin: 0; }
.ui-link { color: var(--gold); text-decoration: none; font-size: var(--t-small); }
.ui-link:hover { text-decoration: underline; }

/* Progressive disclosure: secondary settings collapse into a card header */
details.ui-disclose { margin: 0 0 14px; border-radius: 12px; background: var(--bg-raise); border: 1px solid var(--line); }
details.ui-disclose > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; }
details.ui-disclose > summary::-webkit-details-marker { display: none; }
details.ui-disclose > summary strong { display: block; font-size: 1.02rem; }
details.ui-disclose > summary small { display: block; color: var(--muted); font-size: var(--t-small); margin-top: 2px; }
details.ui-disclose > summary .ui-more { margin-left: auto; flex: none; color: var(--gold); font-size: var(--t-small); white-space: nowrap; }
details.ui-disclose > summary .ui-more::after { content: " ▾"; }
details.ui-disclose[open] > summary .ui-more::after { content: " ▴"; }
details.ui-disclose[open] > summary { border-bottom: 1px solid var(--line); }
details.ui-disclose > .ui-disclose-body { padding: 14px 16px 16px; }
details.ui-disclose .ui-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--bg-sunk); border: 1px solid var(--line-strong); font-size: 1rem; }

/* Empty and locked states */
.ui-empty { text-align: center; padding: 22px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--bg-sunk); color: var(--muted); }
.ui-empty .bard { display: block; width: 92px; height: auto; margin: 0 auto 10px; }
.ui-empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }
.ui-empty p { margin: 0 auto; max-width: 46ch; }
.ui-lock { display: flex; gap: 14px; align-items: flex-start; }
.ui-lock .ui-lock-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-wash); border: 1px solid var(--accent); font-size: 1.1rem; }
.ui-lock p { margin: 0 0 10px; }

/* Checklist */
.ui-steps { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.ui-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bg-sunk); border: 1px solid var(--line); }
.ui-steps .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; border: 1px solid var(--line-strong); color: var(--muted); }
.ui-steps li.done .tick { background: var(--ok-wash); border-color: var(--ok); color: var(--ok); }
.ui-steps li.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ui-steps small { display: block; color: var(--muted); font-size: var(--t-small); margin-top: 2px; }
.ui-progress { height: 6px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden; margin: 6px 0 4px; }
.ui-progress > span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }

/* Stock */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.section .stock-item { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); }
.stock-item h3 { margin: 0 0 8px; font-size: 1rem; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.stock-item h3 small { color: var(--faint); font-weight: normal; font-size: .75rem; font-family: var(--font-mono); }
.stock-sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.stock-sizes .ui-field > span { text-align: center; }
.stock-sizes input { text-align: center; padding-left: 4px; padding-right: 4px; }
.section .stock-item label, .section .shipping-item label { width: auto; display: grid; margin: 0; }
.section .stock-item input[type="number"], .section .shipping-item input[type="number"] { width: 100%; }
.shipping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.section .shipping-item { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); display: grid; gap: 8px; }
.shipping-item h3 { margin: 0; font-size: 1rem; }

/* Responsive tables: stacked rows on phones */
.ui-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raise); }
.ui-table-wrap table { margin: 0; }
.ui-table-wrap th { font-size: .78rem; letter-spacing: .04em; color: var(--muted); background: var(--bg-sunk); }
.ui-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line-strong); text-transform: capitalize; }
.ui-status.pending { color: var(--warn); border-color: var(--warn); background: var(--warn-wash); }
.ui-status.complete, .ui-status.completed, .ui-status.paid { color: var(--ok); border-color: var(--ok); background: var(--ok-wash); }

/* Gigs */
.gig-form-row { display: grid; grid-template-columns: 160px 1fr 1fr auto; gap: 10px; align-items: end; }
.gig-form-row button { margin: 0; }

@media (max-width: 760px) {
  .ui-grid { grid-template-columns: 1fr; }
  .gig-form-row { grid-template-columns: 1fr 1fr; }
  .gig-form-row .ui-field:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .gig-form-row button { grid-column: 1 / -1; }
  table.ui-stack thead { display: none; }
  table.ui-stack, table.ui-stack tbody, table.ui-stack tr, table.ui-stack td { display: block; width: 100%; box-sizing: border-box; }
  table.ui-stack tr { padding: 12px; border-bottom: 1px solid var(--line); }
  table.ui-stack td { border: 0; padding: 3px 0; }
  table.ui-stack td[data-label]::before { content: attr(data-label); display: block; color: var(--faint); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
}
@media (max-width: 520px) {
  .section.ui-page { padding-left: 10px; padding-right: 10px; }
  .ui-card, .section .card, .section .onboarding { padding: 14px 12px; }
  .ui-actions.sticky { margin: 12px -12px -14px; padding: 10px 12px; }
  .ui-actions.sticky button { flex: 1 1 auto; }
  details.ui-disclose > summary { padding: 12px; }
  details.ui-disclose > .ui-disclose-body { padding: 12px; }
  .stock-grid, .shipping-grid { grid-template-columns: 1fr; }
}
.section .onboarding ul.ui-steps { margin: 8px 0 12px; padding: 0; }
.section .onboarding .ui-steps li { margin: 0; }
.ui-page form { margin: 0; }
.stock-grid { margin-bottom: 4px; }

/* ---- Pages (site menu, custom pages, videos, podcast, contact, mailing list) ----
   Compact rows and cards in the engagement dashboard look: one primary action per
   screen, secondary options folded into <details>, inline switches, drag handles. */
.pg-page { --pg-gap: 12px; }
.pg-subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raise); }
.pg-subnav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: var(--t-small); font-weight: 600; white-space: nowrap; }
.pg-subnav a:hover { color: var(--text); background: var(--bg-sunk); }
.pg-subnav a.active { color: var(--text); background: var(--bg-sunk); box-shadow: inset 0 -2px 0 var(--gold); }
.pg-subnav .pg-view { margin-left: auto; color: var(--gold); }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 var(--pg-gap); }
.pg-head .ui-lead { margin: 0; flex: 1 1 320px; }
.pg-head .button, .pg-head button { flex: none; width: auto; margin: 0; }
.pg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--pg-gap); align-items: start; }
.pg-layout > * { min-width: 0; }
.pg-side { display: grid; gap: var(--pg-gap); position: sticky; top: 12px; }
.pg-panel { margin: 0 0 var(--pg-gap); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raise); overflow: hidden; }
.pg-layout .pg-panel, .pg-side .pg-panel { margin: 0; }
.pg-panel-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pg-panel-head h2 { margin: 0; font-size: 1rem; }
.pg-panel-head .muted, .pg-panel-head small { font-size: var(--t-small); }
.pg-panel-head > :last-child:not(h2) { margin-left: auto; }
.pg-panel-body { padding: 12px 14px; display: grid; gap: 10px; }
.pg-panel-body > * { margin: 0; }
.pg-panel-foot { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg-sunk); }
.pg-panel-foot button, .pg-panel-foot .button { width: auto; margin: 0; }
.pg-panel-foot .hint { margin: 0; font-size: var(--t-small); }

/* Rows: [grip] [switch/thumb] [main] [trailing] */
.pg-rows { list-style: none; margin: 0; padding: 0; }
.pg-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 14px 6px 8px; border-bottom: 1px solid var(--line); background: var(--bg-raise); }
.pg-row:last-child { border-bottom: 0; }
.pg-row:hover, .pg-row:focus-within { background: color-mix(in srgb, var(--bg-sunk) 70%, var(--bg-raise)); }
.pg-row.is-off .pg-row-main { opacity: .5; }
.pg-row.is-dragging { position: relative; z-index: 2; background: var(--bg-sunk); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.pg-row.is-drop-hint { box-shadow: inset 0 2px 0 var(--gold); }
.pg-grip { flex: none; display: inline-grid; place-items: center; width: 24px; height: 36px; border-radius: 6px; color: var(--muted); cursor: grab; touch-action: none; user-select: none; font-size: 14px; letter-spacing: -2px; }
.pg-grip:hover { color: var(--text); background: var(--bg-sunk); }
.pg-grip:active { cursor: grabbing; }
.pg-row-main { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.pg-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-row-title a { color: var(--text); text-decoration: none; }
.pg-row-title a:hover { color: var(--gold); }
.pg-inline { width: 100%; margin: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); font-weight: 600; font-size: .95rem; }
.pg-inline:hover { border-color: var(--line); }
.pg-inline:focus { border-color: var(--gold); background: var(--bg-sunk); outline: none; }
.pg-inline::placeholder { color: var(--text); opacity: 1; }
.pg-inline:focus::placeholder { color: var(--muted); }
.pg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding-left: 6px; color: var(--muted); font-size: .76rem; min-width: 0; }
.pg-meta code { font-size: .74rem; color: var(--muted); background: none; padding: 0; }
.pg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-size: .72rem; line-height: 1.5; white-space: nowrap; }
.pg-chip.is-gold { border-color: var(--gold); color: var(--gold); }
.pg-chip.is-warn { border-color: var(--warn, #c9a227); color: var(--warn, #c9a227); }
.pg-chip.is-ok { border-color: #4f9a6a; color: #7fc495; }
.pg-trail { display: flex; align-items: center; gap: 4px; flex: none; }
.pg-icon { display: inline-grid; place-items: center; width: 32px; min-width: 0; height: 32px; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; text-decoration: none; }
.pg-icon:hover, .pg-icon:focus-visible { color: var(--text); background: var(--bg-sunk); border-color: var(--line); }
.pg-icon.is-danger:hover { color: #ff8a7a; border-color: rgba(255, 138, 122, .4); }
.pg-move { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.pg-row:hover .pg-move, .pg-row:focus-within .pg-move { opacity: 1; }
.pg-thumb { flex: none; width: 80px; height: 45px; object-fit: cover; border-radius: 6px; background: #000; }

/* Switch */
.pg-switch { position: relative; flex: none; display: inline-block; width: 38px; height: 22px; }
.pg-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.pg-switch::before { content: ''; position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.pg-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pg-switch:has(input:checked)::before { background: var(--gold); }
.pg-switch:has(input:checked)::after { transform: translateX(16px); }
.pg-switch:has(input:focus-visible)::before { outline: 2px solid var(--gold); outline-offset: 2px; }
.pg-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: var(--t-small); cursor: pointer; }
.pg-toggle-row small { display: block; color: var(--muted); font-size: .76rem; }

/* Fields */
.pg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pg-field { display: grid; gap: 4px; margin: 0; font-size: var(--t-small); }
.pg-field > span { color: var(--muted); font-size: .78rem; font-weight: 600; }
.pg-field input, .pg-field textarea, .pg-field select { margin: 0; width: 100%; }
.pg-inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pg-inline-form input { flex: 1 1 200px; margin: 0; min-width: 0; }
.pg-inline-form button { width: auto; margin: 0; flex: none; }
.pg-inline-form .pg-file { flex: 1 1 100%; min-width: 260px; }
.pg-inline-form .pg-check-line,
.pg-inline-form .pg-help-line,
.pg-row-main .pg-help-line { flex: 1 1 100%; display: block; margin: 0; }
.pg-landing { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-small); color: var(--muted); }
.pg-landing select { width: auto; min-width: 150px; margin: 0; padding: 6px 10px; }
.pg-slug { display: flex; align-items: center; gap: 4px; }
.pg-slug input { flex: 1 1 auto; }
.pg-check { display: flex; gap: 8px; align-items: center; margin: 0; font-size: var(--t-small); }
.pg-check input { width: auto; margin: 0; }

/* Folded secondary options */
details.pg-more { border-top: 1px solid var(--line); }
.pg-panel-body details.pg-more { border: 1px solid var(--line); border-radius: 10px; }
details.pg-more > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; color: var(--muted); font-size: var(--t-small); font-weight: 600; }
details.pg-more > summary::-webkit-details-marker { display: none; }
details.pg-more > summary::before { content: '+'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 12px; }
details.pg-more[open] > summary::before { content: '\2013'; }
details.pg-more > summary:hover { color: var(--text); }
details.pg-more > summary .pg-chip { margin-left: auto; }
details.pg-more > .pg-more-body { display: grid; gap: 10px; padding: 0 14px 14px; }

/* Sticky save bar: visible once something changed */
.pg-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-raise) 94%, transparent); backdrop-filter: blur(6px); }
.pg-savebar button { width: auto; margin: 0; }
.pg-savebar .hint { margin: 0; font-size: .78rem; color: var(--muted); }
.pg-savebar [data-dirty-note] { color: var(--gold); font-size: .78rem; font-weight: 600; }
.pg-savebar [data-dirty-note][hidden] { display: none; }

/* Editor (custom pages) */
.pg-title-input { width: 100%; margin: 0; padding: 8px 10px; font-size: 1.25rem; font-weight: 700; }
.pg-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--bg-sunk); position: sticky; top: 0; z-index: 2; }
.pg-toolbar button { width: auto; min-width: 32px; height: 30px; margin: 0; padding: 0 8px; font-size: .8rem; background: transparent; color: var(--text); border: 1px solid transparent; border-radius: 7px; }
.pg-toolbar button:hover { background: var(--bg-raise); border-color: var(--line); }
.pg-toolbar button.active { border-color: var(--gold); color: var(--gold); }
.pg-toolbar .pg-sep { width: 1px; margin: 4px 2px; background: var(--line); }
.pg-editor, .pg-html { min-height: 340px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; background: var(--bg-raise); color: var(--text); line-height: 1.6; overflow: auto; }
.pg-html { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; font-size: .85rem; }
.pg-editor:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.pg-editor img { max-width: 100%; height: auto; }
.pg-editor blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--gold); }

/* Video picks: a thumbnail grid */
.pg-picks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; }
.pg-picks label { position: relative; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); font-size: .76rem; cursor: pointer; }
.pg-picks label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.pg-picks input { position: absolute; top: 10px; left: 10px; width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.pg-picks img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 6px; }
.pg-picks span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Contact cards */
.pg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pg-card-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); }
.pg-card-edit legend { padding: 0 4px; font-size: .72rem; }
.pg-card-edit input { margin: 0; min-width: 0; padding: 6px 8px; font-size: .85rem; }
.pg-card-edit input:first-of-type, .pg-card-edit input:nth-of-type(2) { grid-column: span 1; }

/* Inbox */
.pg-inbox { list-style: none; margin: 0; padding: 0; }
.pg-inbox li { border-bottom: 1px solid var(--line); }
.pg-inbox li:last-child { border-bottom: 0; }
.pg-inbox summary { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.pg-inbox summary::-webkit-details-marker { display: none; }
.pg-inbox summary:hover { background: var(--bg-sunk); }
.pg-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.is-unread .pg-dot { background: var(--gold); }
.pg-inbox .pg-from { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-inbox .pg-from strong { margin-right: 6px; }
.is-unread .pg-from { color: var(--text); }
.pg-inbox .pg-subject { grid-column: 2 / -1; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-inbox time { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.pg-inbox .pg-message-body { padding: 0 14px 12px 34px; display: grid; gap: 10px; }
.pg-message { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.pg-inbox form, .pg-row-actions form, .pg-trail form { display: inline; margin: 0; }
.pg-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pg-actions .button, .pg-actions button { width: auto; margin: 0; }
.pg-row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* Mailing stats + filters */
.pg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pg-stats a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raise); color: var(--text); text-decoration: none; }
.pg-stats a:hover, .pg-stats a.active { border-color: var(--gold); }
.pg-stats strong { font-size: 1.5rem; line-height: 1.1; }
.pg-stats span { color: var(--muted); font-size: .76rem; }
.pg-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.pg-filters a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .78rem; }
.pg-filters a.active, .pg-filters a:hover { color: var(--text); border-color: var(--gold); }
.pg-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: var(--t-small); }
.pg-empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.pg-page .site-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 960px) {
  .pg-layout { grid-template-columns: 1fr; }
  .pg-side { position: static; }
}
@media (max-width: 720px) {
  .pg-subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pg-subnav .pg-view { margin-left: 0; }
  .pg-row { gap: 8px; padding: 6px 8px 6px 4px; }
  .pg-move { display: none; }
  .pg-thumb { width: 64px; height: 36px; }
  .pg-stats { gap: 6px; }
  .pg-stats a { padding: 10px; }
  .pg-stats strong { font-size: 1.2rem; }
  .pg-card-edit { grid-template-columns: 1fr; }
  .pg-inbox .pg-message-body { padding-left: 14px; }
  .pg-landing { width: 100%; justify-content: space-between; }
  .pg-landing select { flex: 1 1 auto; }
}
/* Win over the global form/button styles inside the Pages section */
.pg-page .pg-row input.pg-inline { width: 100%; max-width: none; min-height: 0; height: auto; margin: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; box-shadow: none; font-weight: 600; font-size: .95rem; }
.pg-page .pg-row input.pg-inline:hover { border-color: var(--line); }
.pg-page .pg-row input.pg-inline:focus { border-color: var(--gold); background: var(--bg-sunk); }
.pg-page button.pg-icon, .pg-page a.pg-icon { width: 32px; min-width: 0; height: 32px; min-height: 0; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; box-shadow: none; color: var(--muted); font-size: 14px; }
.pg-page button.pg-icon:hover, .pg-page a.pg-icon:hover, .pg-page .pg-icon:focus-visible { color: var(--text); background: var(--bg-sunk); border-color: var(--line); }
.pg-page button.pg-icon.is-danger:hover { color: #ff8a7a; border-color: rgba(255, 138, 122, .4); }
.pg-page .pg-row { min-height: 48px; }
.pg-page .pg-actions button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }

/* Published/Hidden switch on the menu page */
.pg-publish { display: inline-flex; align-items: center; gap: 6px; flex: none; min-width: 112px; font-size: .78rem; color: var(--muted); cursor: pointer; }
.pg-publish.is-locked { cursor: default; padding-left: 44px; }
.pg-publish:has(input:not(:checked)) [data-publish-text] { color: var(--danger, #b4232c); font-weight: 600; }
