:root { font-family: system-ui, sans-serif; color: #272330; background: #f7f6f9; }
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 1.2rem max(1.2rem, calc((100% - 64rem) / 2)); background: #514178; color: white; }
.brand { font-weight: 700; }
main { max-width: 64rem; margin: 4rem auto; padding: 0 1.2rem; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; }
.eyebrow { color: #514178; font-weight: 600; }
section { margin-top: 2.5rem; padding: 1.5rem; border: 1px solid #dcd7e5;
  border-radius: .6rem; background: white; }
button { background: #514178; color: white; border: 0; border-radius: .3rem;
  padding: .75rem 1rem; font: inherit; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #9c7100; outline-offset: 4px; }
a { color: #514178; }
nav { display:flex; gap:1.2rem; align-items:center; flex-wrap:wrap; }
form { max-width:38rem; }
label { display:block; margin:1rem 0; font-weight:600; }
input, select, textarea { display:block; width:100%; min-width:0; padding:.65rem; font:inherit; border:1px solid #82788e; border-radius:.25rem; background:white; color:#272330; }
.check { display:flex; gap:.7rem; align-items:center; }
input[type=checkbox] { width:1.2rem; height:1.2rem; flex-shrink:0; }
.form-error { color:#8a2138; }
.table-scroll { overflow:auto; }
table { width:100%; border-collapse:collapse; background:white; }
th, td { padding:.8rem; border-bottom:1px solid #dcd7e5; text-align:left; }
caption { text-align:left; padding:.8rem 0; }
dialog { max-width:34rem; padding:2rem; border:2px solid #514178; border-radius:.6rem; }
dialog::backdrop { background:rgb(25 18 37 / 65%); }
dialog button { margin:.5rem .5rem 0 0; }
fieldset { border:1px solid #dcd7e5; }
.history-event + .history-event { border-top:1px solid #dcd7e5; margin-top:1.5rem; }
.subscriber-table { min-width:40rem; }
.import-preview-table { min-width:60rem; }
.import-preview-table th { white-space:nowrap; }
.import-preview-table td:nth-child(2) { min-width:15rem; }
.import-preview-table td:last-child { min-width:12rem; }
.subscriber-table th, .subscriber-table td:nth-child(3) { white-space:nowrap; }
.directory-filters { display:flex; flex-wrap:wrap; gap:.5rem 1rem; max-width:none; align-items:end; margin:1.5rem 0; }
.directory-filters label { flex:1 1 12rem; margin:.25rem 0; }
header { padding:1rem 2rem; align-items:center; }
.brand { display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; }
.brand small { font-weight:400; }
.brand-mark { border:1px solid #ded6ec; border-radius:.5rem; padding:.1rem .6rem; }
.header-context { display:flex; flex-direction:column; text-align:right; overflow-wrap:anywhere; }
body:has(.admin-shell) main { max-width:90rem; margin:1.5rem auto; }
.admin-shell { display:grid; grid-template-columns:15rem minmax(0,1fr); gap:2.5rem; }
.admin-content { min-width:0; padding-bottom:3rem; overflow-wrap:anywhere; }
.admin-content h1 { font-size:clamp(1.8rem,3vw,2.8rem); }
aside { padding:0 1rem 1rem 0; border-right:1px solid #dcd7e5; }
aside nav { display:flex; flex-direction:column; align-items:stretch; gap:.25rem; margin:1rem 0; }
aside nav a, aside nav > span { display:block; padding:.4rem .6rem; border-radius:.3rem; }
aside nav a:hover, aside nav a[aria-current] { background:#e9e3f2; }
aside nav > span { color:#62596e; }
aside nav small { display:block; font-size:.75rem; }
aside h2 { font-size:.9rem; margin:1rem .6rem .25rem; }
textarea { resize:vertical; }
.notice { border-left:4px solid #514178; padding:1rem; background:#eee9f4; }
.button-link { display:inline-block; background:#514178; color:white; padding:.7rem 1rem; border-radius:.3rem; }
#menu-toggle { display:none; }
.skip-link { position:absolute; left:1rem; top:-10rem; padding:1rem; background:white; z-index:10; }
.skip-link:focus { top:1rem; }
@media (max-width: 900px) {
  #menu-toggle { display:block; margin-bottom:1rem; }
  .admin-shell { grid-template-columns:minmax(0,1fr); gap:1rem; }
  #administration-navigation { display:none; border-right:0; border-bottom:1px solid #dcd7e5; }
  #administration-navigation.is-open { display:block; }
  header { padding:1rem 1.2rem; }
  .header-context { text-align:left; }
  section { padding:1rem; }
  dialog { max-width:calc(100% - 2rem); padding:1.25rem; }
}
.asset-logo { max-width: 240px; max-height: 160px; object-fit: contain; }
.historical-campaign-preview { max-width: 100%; }
.metric-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:1rem; }
.metric-grid > div { background:#f0ecf5; border:1px solid #ded6ec; border-radius:.5rem; padding:1rem; }
.metric-grid dt { font-size:.9rem; }
.metric-grid dd { margin:.25rem 0 0; font-size:1.8rem; font-weight:700; color:#514178; }
.table-scroll:focus { outline:2px solid #514178; outline-offset:3px; }
caption { text-align:left; font-weight:700; padding:1rem 0 .5rem; }
[data-assets] table { min-width: 40rem; }
[data-assets] th, [data-assets] td:nth-child(3), [data-assets] td:nth-child(4) { white-space: nowrap; }

.report-table { min-width:44rem; overflow-wrap:normal; }
.report-table th { white-space:nowrap; }
.report-table th, .report-table td { min-width:8rem; }
.report-table td { overflow-wrap:anywhere; }

.documentation { max-width: 76rem; margin: 2rem auto; padding: 1rem; }
.documentation details { margin: 1rem 0; padding: .75rem; border: 1px solid #777; border-radius: .4rem; }
.documentation pre { overflow: auto; max-height: 35rem; padding: 1rem; background: #f3f3f3; color: #222; }
.documentation code { overflow-wrap: anywhere; }
/* Shared interaction hierarchy; action state is distinct from availability. */
[hidden] { display:none !important; }
button, .button-link { min-height:44px; border:1px solid transparent; }
button { margin-block:.2rem; }
button + button { margin-left:.35rem; }
.button-secondary { background:#eee9f4; color:#40305f; border-color:#a89bb9; }
.button-danger { background:#8a2138; color:#fff; }
button:disabled { cursor:not-allowed; opacity:.65; }
button[aria-busy="true"] { cursor:progress; }
button:hover:not(:disabled) { filter:brightness(.94); }
.form-error:empty, [data-feedback]:empty { display:none; }
[data-feedback="success"] { color:#24552e; border-left:4px solid #397543; padding:.6rem 1rem; background:#eff8ef; }
[data-feedback="status"], [data-feedback="busy"] { color:#40305f; }
[data-feedback="warning"] { color:#684800; border-left:4px solid #916700; padding:.6rem 1rem; background:#fff8e6; }
[data-feedback="error"], .field-error { color:#8a2138; }
.field-error { display:block; font-weight:normal; margin:.3rem 0 .6rem; }
[aria-invalid="true"] { border:2px solid #8a2138; }
.field-help, .table-hint { font-size:.9rem; color:#544b60; }
.section-index { padding:1rem; border:1px solid #dcd7e5; border-radius:.4rem; }
dialog { max-height:calc(100dvh - 2rem); overflow:auto; width:min(36rem,calc(100% - 2rem)); }
dialog h2:first-child { margin-top:0; }
summary { cursor:pointer; min-height:44px; padding:.4rem; }
.table-hint { margin-bottom:.3rem; }
@media (max-width:400px) { dialog { padding:1rem; } button + button { margin-left:0; } }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto !important; } }
