:root {
    color-scheme: dark;
    --ink: #f6f3eb;
    --muted: #bbc7d8;
    --gold: #d6ab52;
    --navy: #07132b;
    --panel: #101f3a;
    --edge: #314465;
    --green: #8ed5b4;
    font-family: "Trebuchet MS", system-ui, sans-serif;
    color: var(--ink);
    background: var(--navy);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: radial-gradient(ellipse at 78% 0, #1a2d52 0, var(--navy) 61%); }
a { color: #efcd82; text-underline-offset: .18em; }
a:hover { color: #ffe2a2; }
a:focus-visible, button:focus-visible { outline: 3px solid #f0c970; outline-offset: 4px; }
header { border-bottom: 1px solid var(--edge); }
.shell { width: min(1080px, calc(100% - 46px)); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 13px; padding: 16px 0; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { width: 43px; height: 43px; border-radius: 10px; }
.brand span { display: grid; gap: 2px; }
.brand small { font-weight: 400; color: var(--muted); }
main { padding: 48px 0 58px; }
h1, h2, h3, p { margin: 0; }
h1 { font: 700 clamp(2rem, 5vw, 3.25rem)/1.06 Georgia, serif; letter-spacing: -.035em; }
h2 { font: 700 clamp(1.4rem, 3vw, 2rem)/1.15 Georgia, serif; }
p { color: var(--muted); line-height: 1.58; }
.intro { max-width: 680px; margin: 12px 0 22px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: .86rem; font-weight: 700; margin-bottom: 11px; }
.status::before { content: ""; background: currentColor; border-radius: 50%; width: 8px; height: 8px; }
.note { display: block; max-width: 680px; background: #112542; border-left: 3px solid var(--gold); padding: 12px 15px; margin: 16px 0; color: var(--muted); }
.workspace { display: grid; grid-template-columns: 195px minmax(0, 1fr); border-top: 1px solid var(--edge); padding-top: 27px; }
.editions { padding-right: 20px; }
.editions a { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-decoration: none; color: var(--muted); padding: 10px 12px; margin-bottom: 4px; border-radius: 8px; font-size: .88rem; }
.editions a:hover { background: #203758; }
.editions a[aria-current] { background: #203758; box-shadow: inset 3px 0 var(--gold); color: var(--ink); font-weight: 700; }
.editions a span:last-child { font-size: .76rem; color: var(--muted); }
.list { overflow: hidden; padding-left: 22px; border-left: 1px solid var(--edge); }
.list-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .3rem .8rem; margin-bottom: 14px; }
.list-title small { color: var(--muted); }
.characters { list-style: none; padding: 0; margin: 0; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; background: var(--panel); }
.character { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 17px; align-items: center; padding: 13px 16px; }
.character + .character { border-top: 1px solid var(--edge); }
.identity { display: flex; gap: 13px; align-items: center; min-width: 0; }
.portrait { flex: 0 0 44px; width: 44px; height: 44px; display: grid; overflow: hidden; place-items: center; background: #233a5e; border-radius: 9px; color: var(--gold); font-weight: 700; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.identity h3 { font-size: 1rem; overflow-wrap: anywhere; }
.identity small { color: var(--muted); display: block; margin-top: 4px; font-size: .78rem; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: .71rem; padding: 2px 6px; border-radius: 4px; background: #213656; color: var(--muted); }
.tag-main { background: #503e23; color: #ffe0a0; }
.controls { display: flex; gap: 5px; flex-wrap: wrap; }
button, .button { display: inline-block; font: inherit; font-size: .83rem; font-weight: 700; line-height: 1.2; padding: 8px 10px; border: 1px solid #435979; border-radius: 7px; color: var(--ink); background: #1a3051; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #28446b; color: var(--ink); }
button[aria-pressed="true"] { border-color: #a1844e; color: #ffdf99; }
.button-primary { background: var(--gold); border-color: var(--gold); color: #201705; padding: 11px 16px; font-weight: 800; }
.button-primary:hover { background: #edc574; color: #201705; }
.foot, .pagination { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; margin-top: 17px; }
.pagination { justify-content: space-between; }
.foot small, footer { color: var(--muted); }
footer { padding-bottom: 26px; font-size: .78rem; }
.dashboard-footer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 1.5rem; border-top: 1px solid var(--edge); padding-top: 16px; }
.dashboard-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.dashboard-footer a[aria-current="page"] { color: var(--ink); }
.policy { max-width: 760px; margin-inline: auto; }
.policy-date { margin-top: 10px; font-size: .87rem; }
.policy section { margin-top: 13px; padding: clamp(16px, 3vw, 24px); border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); }
.policy h2 { font-size: clamp(1.22rem, 3vw, 1.56rem); }
.policy section p, .policy section ul { margin: .75rem 0 0; }
.policy ul { padding-inline-start: 1.24rem; color: var(--muted); line-height: 1.58; }
.policy li + li { margin-top: .5rem; }
.policy p, .policy li { overflow-wrap: anywhere; }
.policy code { color: var(--ink); font-size: .92em; }
progress { width: min(620px, 100%); height: 8px; display: block; margin: 26px 0 13px; accent-color: var(--gold); }
@media (max-width: 800px) {
    .shell { width: calc(100% - 32px); }
    main { padding-top: 34px; }
    .workspace { display: block; }
    .editions { display: flex; gap: 4px; padding: 0 0 9px; margin-bottom: 13px; flex-wrap: wrap; }
    .editions a { padding: 8px 10px; }
    .list { padding: 0; border: 0; }
}
@media (max-width: 610px) {
    .character { grid-template-columns: 1fr; }
    .controls { padding-left: 0; margin-top: 2px; }
    .controls button { flex-grow: 1; }
}
