:root{
  --ink:#14231d;
  --paper:#f4f0e6;
  --panel:#fffdf8;
  --acid:#d9ff3f;
  --line:#d8d2c4;
  --muted:#6c756f;
  --blue:#0b4f6c;
  --danger:#b94b39;
  --sidebar:#10231c;
  --soft-green:#eaf7df;
  --soft-yellow:#fff2b8;
  --soft-blue:#e1eef3;
  --soft-red:#f7dfda;
}
*{box-sizing:border-box}
html,body{min-height:100%;background:var(--paper)}
body{margin:0;color:var(--ink);font-family:Inter,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.5}
a{color:var(--blue)}
a:hover{color:#073a4f}
.title,.subtitle,strong{color:var(--ink)}
.button{font-weight:650}
.button.is-primary{background:var(--acid);border-color:var(--acid);color:var(--ink)}
.button.is-primary:hover{background:#c9f22d;border-color:#c9f22d;color:var(--ink)}
.button:focus-visible,.input:focus-visible,.textarea:focus-visible,.select select:focus-visible{outline:2px solid rgba(127,152,80,.45);outline-offset:1px}

/* Legacy helpers kept for review/setup pages that still predate the Bulma pass. */
.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:.55rem .9rem;border-radius:6px;font:inherit;font-weight:700;text-decoration:none;cursor:pointer}
.primary{background:var(--acid);border:1px solid var(--acid);color:var(--ink)}
.secondary{background:#fff;border:1px solid var(--line);color:var(--ink)}
.danger{background:var(--danger);border:1px solid var(--danger);color:#fff}
.primary:disabled,.secondary:disabled{opacity:.45;cursor:not-allowed}

.heading{display:flex;justify-content:space-between;align-items:flex-start;gap:1.5rem;margin-bottom:1.75rem}
.heading h1{margin:.15rem 0 .35rem;font-size:2.35rem;line-height:1.05;font-weight:750;letter-spacing:-.025em;color:var(--ink)}
.heading p{margin:0;color:var(--muted)}
.eyebrow{margin:0 0 .35rem!important;color:var(--muted)!important;text-transform:uppercase;letter-spacing:.14em;font-size:.72rem!important;font-weight:750}
.muted-copy,.muted-action{color:var(--muted)}
.muted-action{display:inline-flex;align-items:center;padding:.5rem 0;font-size:.85rem}

/* Legacy panels. New admin pages prefer Bulma .box/.card. */
.panel,.card-hero,.editor section,.editor-related,.stats article{background:var(--panel);border:1px solid var(--line);box-shadow:0 2px 8px rgba(20,35,29,.035);border-radius:8px}
.panel{display:block;margin-bottom:1rem;padding:1.25rem}
.panel h2,.editor-related h2,.editor h2{margin:0 0 1rem;color:var(--ink);font-size:1.08rem;font-weight:750}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}
.card-hero{padding:1.5rem;margin-bottom:1rem}

.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.table-wrap .table{margin:0;background:transparent}
.table-wrap>table:not(.table){width:100%;border-collapse:collapse}
.table-wrap>table:not(.table) th,.table-wrap>table:not(.table) td{padding:.8rem .9rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.table-wrap>table:not(.table) th{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.table-wrap>table:not(.table) td small{display:block;color:var(--muted);margin-top:.2rem}

/* Form fallback for review/legacy templates. Bulma .field/.input/.select/.textarea remain authoritative elsewhere. */
label:not(.label){display:block;font-size:.82rem;font-weight:700;margin-bottom:.85rem;color:var(--ink)}
label:not(.label) input:not([type=checkbox]):not([type=radio]):not([type=color]),label:not(.label) textarea{display:block;width:100%;margin-top:.35rem}
label small{display:block;margin-top:.3rem;color:var(--muted);font-weight:400}
textarea{resize:vertical}
.checkbox{font-weight:500}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem}
.form-stack{display:grid;gap:.2rem}
.editor{display:grid;gap:1rem}
.editor section{padding:1.35rem}
.editor-related{padding:1.35rem;margin:1rem 0}
.compact-form{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--line)}
.inline-action{display:inline;margin-left:.4rem}
.text-button{border:0;background:transparent;color:var(--blue);text-decoration:underline;cursor:pointer;padding:0;font:inherit}
.clean{padding-left:1.2rem}
.clean li{margin:.45rem 0}
.multiline{white-space:pre-line}
dl{margin:0}
dt{margin-top:.8rem;color:var(--muted);font-size:.68rem;text-transform:uppercase;letter-spacing:.09em;font-weight:750}
dd{margin:.15rem 0 0}

.badge{display:inline-flex;align-items:center;padding:.25rem .5rem;border-radius:999px;font-size:.66rem;line-height:1;font-weight:800;text-transform:uppercase;letter-spacing:.06em;background:#ece8df;color:var(--ink)}
.badge.draft{background:var(--soft-yellow)}
.badge.published,.badge.owned,.badge.active{background:#d9f4ce}
.badge.archived,.badge.disabled{background:var(--soft-red)}
.badge.reference{background:var(--soft-blue)}

.image-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.image-grid figure{margin:0;border:1px solid var(--line);border-radius:6px;padding:.5rem;background:#fff}
.image-grid img{width:100%;height:150px;display:block;object-fit:contain;background:#f7f5ef}
.image-grid figcaption{font-size:.75rem;color:var(--muted);padding:.45rem .1rem 0}
.auth-card{max-width:470px;margin:4rem auto;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:1.75rem}
.flash{padding:.8rem 1rem;margin-bottom:1rem;border:1px solid;border-radius:6px}
.flash.success{background:#eaf9d2;border-color:#87b74b}.flash.error{background:#ffe3dd;border-color:#cf7562}

.entry-dialog,.confirmation-dialog,.flash-dialog{border:0;padding:0;background:var(--panel);color:var(--ink);border-radius:10px;box-shadow:0 22px 70px #0008}
.confirmation-dialog,.flash-dialog{width:min(680px,calc(100vw - 32px))}
.confirmation-dialog>div,.flash-dialog>div{padding:1.6rem}
.entry-dialog{width:min(760px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:hidden}
.entry-dialog>.entry-dialog-shell{padding:0;display:flex;flex-direction:column;max-height:calc(100dvh - 32px);overflow:hidden}
.entry-dialog-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1.25rem;padding:1.35rem 1.5rem 1rem;border-bottom:1px solid var(--line);background:var(--panel);flex:0 0 auto}
.entry-dialog-header p{margin:0}
.entry-dialog-form{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.entry-dialog-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:1.05rem 1.5rem .4rem;background:var(--panel)}
.entry-dialog-body .columns{margin-bottom:0}
.entry-dialog-body .field{margin-bottom:.2rem}
.entry-dialog-body .checkbox{margin-bottom:.35rem}
.entry-dialog-footer{display:flex;justify-content:flex-end;gap:.65rem;padding:.9rem 1.5rem 1rem;border-top:1px solid var(--line);background:#fbfaf6;flex:0 0 auto}
.entry-dialog-body::-webkit-scrollbar{width:10px}
.entry-dialog-body::-webkit-scrollbar-track{background:transparent}
.entry-dialog-body::-webkit-scrollbar-thumb{background:#c8c2b6;border:3px solid var(--panel);border-radius:999px}
.entry-dialog::backdrop,.confirmation-dialog::backdrop,.flash-dialog::backdrop{background:#14231db8}
.dialog-heading{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin-bottom:1rem}
.dialog-heading h2,.flash-dialog h2{margin:0 0 .35rem}
.dialog-heading p{margin:0;color:var(--muted)}
.close-dialog{border:0;background:transparent;font-size:1.8rem;line-height:1;color:var(--ink);cursor:pointer;padding:.1rem .2rem}
.dialog-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}
.flash-dialog.error{border-top:4px solid var(--danger)}.flash-dialog.success{border-top:4px solid #77a641}
.flash-dialog form{text-align:right;margin-top:1rem}

@media(max-width:900px){.heading{display:block}.heading>div+div,.heading>a{margin-top:1rem}.detail-grid,.form-grid{grid-template-columns:1fr}}
@media(max-width:768px){.entry-dialog{width:min(620px,calc(100vw - 20px));max-height:calc(100dvh - 20px)}.entry-dialog>.entry-dialog-shell{max-height:calc(100dvh - 20px)}.entry-dialog-header{padding:1.1rem 1.15rem .85rem}.entry-dialog-body{padding:.9rem 1.15rem .25rem}.entry-dialog-footer{padding:.8rem 1.15rem .9rem}}
@media(max-width:560px){.image-grid{grid-template-columns:1fr}.dialog-actions,.entry-dialog-footer{justify-content:stretch}.dialog-actions>*,.entry-dialog-footer>*{flex:1}}
