:root{font-family:"Yu Gothic UI","Meiryo",sans-serif;color:#edf1e9;background:#14201b;font-size:16px;font-synthesis:none;color-scheme:dark;--border:#4b6053;--muted:#becac1;--gold:#e5bd7e}
[data-section="arts"] td:first-child strong,[data-section="art-statuses"] td:first-child strong{white-space:nowrap}
[data-section="arts"] td:last-child{min-width:300px;max-width:520px}
[data-section="arts"] td:nth-child(5){min-width:150px}
[data-section="art-statuses"] td:nth-child(4){min-width:260px;max-width:580px}
*{box-sizing:border-box}body{margin:0}button,input,a{font:inherit}button,a,input{touch-action:manipulation}button,a{min-height:44px}button{cursor:pointer}a{color:var(--gold);text-decoration:none;display:inline-flex;align-items:center}a:hover{text-decoration:underline}button:focus-visible,a:focus-visible,input:focus-visible,.table-scroll:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.admin-header{max-width:1560px;margin:auto;padding:40px 36px 28px;display:flex;justify-content:space-between;gap:24px;align-items:flex-start}.eyebrow{font-size:14px;letter-spacing:.18em;color:var(--gold);margin:0 0 10px}h1{font-size:30px;letter-spacing:.04em;margin:0 0 10px}p{line-height:1.65}.header-note{margin:0;color:var(--muted)}.header-actions{display:flex;align-items:center;gap:20px;white-space:nowrap}.read-only{font-size:14px;color:var(--muted);border:1px solid var(--border);border-radius:999px;padding:7px 12px}
main{max-width:1560px;margin:auto;padding:0 36px 60px}.catalog-tools{padding:22px;background:#19251f;border:1px solid var(--border);border-radius:12px}.search-label{display:block;font-weight:700;margin-bottom:10px}.search-row{display:flex;gap:10px;max-width:720px}input{flex:1;min-width:0;width:100%;padding:13px 15px;border:1px solid #597160;border-radius:6px;background:#101c15;color:#f0f4ee;font-size:16px}button{border:1px solid var(--border);background:#223129;color:#e8eee8;border-radius:6px;padding:10px 15px}button:hover{background:#2b3e31}#catalog-filters{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}#catalog-filters button[aria-pressed=true]{background:var(--gold);border-color:var(--gold);color:#1a2119;font-weight:700}.filter-count{font-variant-numeric:tabular-nums;margin-left:8px;opacity:.8}.result-count{font-size:14px;margin:14px 0 0;color:var(--muted)}.catalog-note{color:var(--muted);margin:20px 0}
.catalog-section{margin-top:30px}.section-title{display:flex;align-items:baseline;gap:12px;margin-bottom:12px}.section-title h2{font-size:22px;margin:0}.section-title span{color:var(--muted);font-size:14px}.section-description{color:var(--muted);margin:0 0 12px;font-size:14px}.table-scroll{overflow:auto;border:1px solid var(--border);border-radius:10px;background:#15211a}table{width:100%;border-collapse:collapse;text-align:left}th,td{padding:14px 16px;border-bottom:1px solid #2b3c31;vertical-align:top;line-height:1.6}th{background:#233229;font-size:14px;color:#c9d4c9;font-weight:700;white-space:nowrap}td{font-size:16px}tr:last-child td{border-bottom:0}tbody tr:hover{background:#1b2c21}td strong{color:#f0eddf}.nowrap{white-space:nowrap}.num{font-variant-numeric:tabular-nums;white-space:nowrap}.subline{display:block;font-size:14px;color:var(--muted);overflow-wrap:anywhere}.description{min-width:260px;max-width:420px}.names{min-width:180px}.tech-list{min-width:210px}.tag{display:inline-block;font-size:14px;color:var(--gold);border:1px solid #655940;padding:2px 8px;border-radius:4px;white-space:nowrap}.identity{display:flex;gap:10px;align-items:center;min-width:145px}.portrait{width:38px;height:48px;image-rendering:auto;object-fit:contain;flex:none}.family-portraits{display:flex;gap:0;margin-top:4px}.family-portraits canvas{width:34px;height:42px;image-rendering:auto}.characters-table{min-width:1200px}.mobile-table-note{display:none;font-size:14px;color:var(--muted)}#empty-result{padding:30px;background:#19251f;border:1px solid var(--border);border-radius:10px}
@media(max-width:700px){.admin-header{padding:24px 16px 20px;display:block}.header-actions{margin-top:12px}h1{font-size:26px}main{padding:0 16px 36px}.catalog-tools{padding:16px}.catalog-note{font-size:14px}.search-row{gap:6px}.search-row button{padding:10px}.section-title h2{font-size:21px}.mobile-table-note{display:block;margin:0 0 8px}.table-scroll{border-radius:7px}th,td{padding:12px}.catalog-section{margin-top:26px}#catalog-filters{gap:6px}#catalog-filters button{padding:9px 10px}}
button:disabled{cursor:default;opacity:.5}.settings-notice{display:flex;align-items:center;gap:12px;margin:18px 0}.settings-notice p{margin:0;color:var(--muted);font-size:14px}.settings-notice .error,#family-editor-error{color:#ffbbab}.edit-family{display:block;margin-top:10px;white-space:nowrap}.save-settings{background:var(--gold);color:#182319;font-weight:700}#family-editor{width:min(820px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:26px;border:1px solid #607057;border-radius:14px;background:#14221a;color:#e8eee8;overflow:auto}#family-editor::backdrop{background:#000a}.editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.editor-heading h2{font-size:24px;margin:0}.editor-heading button{font-size:24px;line-height:1}#family-editor p{font-size:16px;color:#bac8bc}.family-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:24px 0}.family-fields label{font-weight:700;line-height:1.6}.family-fields input{display:block;margin-top:5px;font-weight:400}.family-fields small{font-size:14px;font-weight:400;color:var(--muted)}#family-change-preview th,#family-change-preview td{padding:8px 14px}#family-change-preview tr.changed td:last-child{background:#3a3823;color:#f3cb89;font-weight:700}#family-character-preview p{margin:8px 0}#family-editor-error{min-height:1.5em}.editor-actions{display:flex;justify-content:flex-end;gap:12px;position:sticky;bottom:-26px;background:#14221a;padding:16px 0}.editor-actions button{min-width:120px}@media(max-width:600px){#family-editor{padding:18px}.family-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.editor-heading h2{font-size:21px}.settings-notice{align-items:flex-start;flex-direction:column}.editor-actions{bottom:-18px}.editor-actions button{flex:1;min-width:0}}

.catalog-groups{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 20px}.catalog-groups button[aria-pressed=true]{background:var(--gold);color:#182319;border-color:var(--gold)}.member-cards{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:20px}.member-cards a{padding:12px 18px;background:#192b21;border:1px solid var(--border);border-radius:8px;gap:10px;min-width:150px}.member-cards .portrait{width:52px;height:64px}.member-cards small{display:block;color:var(--muted);font-size:13px}.characters-table tr:target{background:#3a3823}

.family-portraits{flex-wrap:wrap;gap:6px;min-width:220px}.family-member{display:flex;flex-direction:column;align-items:center;padding:6px;min-width:62px;font-size:13px}.family-portraits .family-member canvas{width:38px;height:48px}

.catalog-section th,.catalog-section td{border-right:1px solid #45594d}.catalog-section th:last-child,.catalog-section td:last-child{border-right:0}.characters-table td:nth-child(2){min-width:145px}.characters-table td:nth-child(14){min-width:200px}.characters-table td:nth-child(15){min-width:170px}.family-description{font-size:14px;color:var(--muted);line-height:1.7;min-width:180px;max-width:900px}.family-description b{color:var(--gold)}

.weapon-name{padding:4px 0;border:0;background:transparent;text-align:left;font-weight:700;color:#f0e6ce;text-decoration:underline;text-decoration-color:#897653;text-underline-offset:5px}
.weapon-name:hover{background:transparent;color:var(--gold)}.weapon-art{display:block;width:100%;height:auto;object-fit:contain;image-rendering:auto}
#weapon-art-dialog{width:min(560px,calc(100% - 32px));max-height:calc(100dvh - 28px);padding:24px;border:1px solid #77856b;border-radius:12px;background:#15231b;color:#e8eee8;overflow:auto}
#weapon-art-dialog::backdrop{background:#000b}.weapon-art-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.weapon-art-heading h2{margin:4px 0 0;font-size:24px}.weapon-art-heading form{margin:0}.weapon-art-heading button{font-size:24px;line-height:1}.weapon-art-kind{font-size:13px;color:var(--gold)}
#weapon-art-dialog .weapon-art{width:100%;height:min(420px,48dvh);margin:14px auto;background:radial-gradient(ellipse,#2d3e31,#142119 75%);border-radius:8px}#weapon-art-dialog p{font-size:14px;color:var(--muted)}
.weapon-art-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:16px 0 0}.weapon-art-stats div{border-top:1px solid var(--border);padding-top:10px}.weapon-art-stats dt{font-size:12px;color:var(--muted)}.weapon-art-stats dd{margin:6px 0 0;font-size:20px;font-variant-numeric:tabular-nums}

.technique-conditions{margin:0;padding-left:18px;min-width:240px}.technique-conditions li+li{margin-top:6px}
.hidden-stat-legend{font-size:13px;color:var(--muted)}.hidden-stat-legend span{color:#ebc98c}
[data-section="characters"] .table-scroll{overflow:visible}
.characters-table{min-width:0;table-layout:fixed;width:100%}
.characters-table th,.characters-table td{padding:10px 6px;font-size:13px;min-width:0!important;white-space:normal;overflow-wrap:anywhere}
.characters-table th:nth-child(1){width:11%}.characters-table th:nth-child(2){width:6%}
.characters-table th:nth-child(n+3):nth-child(-n+13){width:5%}
.characters-table th:nth-child(14){width:16%}.characters-table th:nth-child(15){width:12%}
.characters-table th:nth-child(n+11):nth-child(-n+13),.characters-table td:nth-child(n+11):nth-child(-n+13){color:#ebc98c;background:#b88a2510}
.characters-table .identity{min-width:0;gap:5px;flex-wrap:wrap}.characters-table .identity>div{min-width:0;flex:1}.characters-table .edit-family{white-space:normal;padding:6px;font-size:12px;min-height:36px}.characters-table .num{white-space:normal}
@media(max-width:1100px){
  .characters-table,.characters-table tbody{display:block}.characters-table thead{display:none}
  .characters-table tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));border-bottom:2px solid var(--border)}
  .characters-table td{display:block;border-bottom:1px solid var(--border);border-right:1px solid var(--border)!important;min-width:0;line-height:1.5}
  .characters-table td:before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;margin-bottom:4px}
  .characters-table td:first-child{grid-column:span 4}.characters-table td:nth-child(2){grid-column:span 2}
  .characters-table td:nth-child(14),.characters-table td:nth-child(15){grid-column:span 3}
  .characters-table td:nth-child(13){grid-column:span 2}
  .characters-table .identity{flex-wrap:nowrap}.characters-table .edit-family{display:inline-block;margin:0 0 0 10px}
}

[data-section='techniques'] th:first-child,[data-section='techniques'] td:first-child,[data-section='arts'] th:first-child,[data-section='arts'] td:first-child{white-space:nowrap;min-width:10em}
.technique-preview{width:min(1100px,94vw);max-width:94vw;max-height:92vh;overflow:auto;padding:20px;background:#15251e;color:#f2eee0;border:1px solid #9b8b62;border-radius:14px}
.technique-preview::backdrop{background:#000b}
.technique-preview canvas{display:block;width:100%;height:auto;border-radius:8px}
[data-section="combos"] table{min-width:1100px}
[data-section="combos"] td:first-child{min-width:160px}
[data-section="combos"] td:nth-child(2){min-width:230px}
[data-section="combos"] td:nth-child(3){min-width:105px}
[data-section="combos"] td:nth-child(4){min-width:220px}
[data-section="combos"] td:nth-child(5){min-width:280px}
[data-section="combos"] [data-preview-technique]{white-space:nowrap}
.preview-controls{display:flex;gap:18px;align-items:center;margin-top:16px}
.preview-controls:has([data-preview-wind-state]){flex-wrap:wrap}
[data-preview-technique]{margin-top:10px}
@media(max-width:1100px){
  [data-section="arts"] table,[data-section="arts"] tbody,[data-section="art-statuses"] table,[data-section="art-statuses"] tbody{display:block}
  [data-section="arts"] thead,[data-section="art-statuses"] thead{display:none}
  [data-section="arts"] tr,[data-section="art-statuses"] tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:2px solid var(--border)}
  [data-section="arts"] td,[data-section="art-statuses"] td{display:block;min-width:0!important;max-width:none!important;white-space:normal!important;overflow-wrap:anywhere}
  [data-section="arts"] td::before,[data-section="art-statuses"] td::before{content:attr(data-label);display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
  [data-section="arts"] td:last-child,[data-section="art-statuses"] td:nth-child(n+4){grid-column:1/-1}
  [data-section="arts"] td:first-child strong{white-space:normal}
}
[data-section="arts"] .art-production{display:inline-block;margin-top:6px;padding:2px 8px;border:1px solid;border-radius:5px;font-size:12px;font-weight:700;white-space:nowrap}
[data-section="arts"] .art-production-ready{color:#b8ecc9;background:#203c2e;border-color:#537d62}
[data-section="arts"] .art-production-pending{color:#ffce9e;background:#4b2c1d;border-color:#bd7949}
[data-section="arts"] tr:has(.art-production-pending){background:#30251d}
[data-section="arts"] tr:has(.art-production-pending):hover{background:#3b2d21}
[data-section="arts"] tr:has(.art-production-pending) td:first-child{box-shadow:inset 4px 0 #db9459}
[data-section="arts"] .catalog-groups .art-production{display:block;margin-top:5px}
[data-section="arts"] .catalog-groups button:has(.art-production-pending){border-color:#bd7949}

.release-admin{margin:0 0 24px;border:1px solid #65838b;border-radius:12px;background:linear-gradient(115deg,#172c35,#182b25);overflow:hidden}.release-admin>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;cursor:pointer;padding:19px 22px;font-size:20px;font-weight:700;color:#e2f2f4}.release-admin>summary:before{content:'＋';color:#e8c174}.release-admin[open]>summary:before{content:'−'}.release-admin>summary span{flex:1}.release-admin>summary small{font-size:13px;color:#b0c4c3;font-weight:400}.release-admin-body{padding:0 22px 24px}.release-admin-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.release-admin h2{font-size:22px;margin:20px 0 12px}.release-admin .error,[data-release-validation]{color:#ffb6a6}.release-admin-heading p{flex:1}.release-test-tag{font-size:12px;color:#ffdc8e;border:1px solid #816941;border-radius:6px;padding:5px 9px;white-space:nowrap}.release-help{font-size:13px;color:#bdd0c9;line-height:1.8}.release-fixed{font-size:13px;line-height:1.9;background:#11221e;padding:12px 15px;border-left:3px solid #e5bd7e}.release-admin fieldset{border:1px solid #466153;border-radius:8px;margin:22px 0;padding:16px}.release-admin legend{padding:0 8px;color:#e5bd7e;font-weight:700}.release-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.release-fields label,.release-ranks label{display:flex;flex-direction:column;gap:8px;font-size:13px;color:#d6e1d8}.release-fields input,.release-ranks input{font-size:18px;font-variant-numeric:tabular-nums;background:#0c211c}.release-ranks{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px}.release-save-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:10px}.release-save-row span{font-size:12px;color:#abc0b6}.release-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.release-metrics>div{background:#10201e;border:1px solid #456258;border-radius:8px;padding:15px}.release-metrics span{display:block;font-size:12px;color:#bfd1c9}.release-metrics strong{display:block;margin-top:10px;font-size:26px;color:#f1d698;font-variant-numeric:tabular-nums}.release-usage-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.release-usage{list-style:none;padding:0}.release-usage li{display:flex;justify-content:space-between;padding:8px 4px;border-bottom:1px solid #365046}.release-usage b{color:#e5bd7e}.release-stats details{margin:16px 0}.release-stats summary{cursor:pointer;padding:12px 0;color:#ccdfd6}.release-stats td{font-size:13px;overflow-wrap:anywhere}.release-stats table{min-width:540px}.release-stats{padding-bottom:20px;border-bottom:1px solid #52675b}.release-admin input:read-only{color:#a5b9b0;background:#192720}.release-admin button:disabled{cursor:default}
@media(max-width:1000px){.release-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.release-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.release-ranks{grid-template-columns:repeat(4,minmax(0,1fr))}.release-admin>summary small{display:none}}
@media(max-width:600px){.release-admin-body{padding:0 14px 20px}.release-admin>summary{font-size:17px;padding:16px 14px}.release-admin-heading{align-items:flex-start;flex-direction:column;gap:5px}.release-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.release-ranks{grid-template-columns:repeat(2,minmax(0,1fr))}.release-metrics{gap:8px}.release-metrics>div{padding:12px 8px}.release-metrics strong{font-size:21px}.release-usage-grid{grid-template-columns:1fr;gap:4px}.release-admin fieldset{padding:12px}.release-test-tag{white-space:normal}}
.art-production-live{background:#184b45;color:#b5ffde;border-color:#65c99f}
.vision-status-preview[open]{display:flex;flex-direction:column;gap:8px;overflow:hidden;max-height:92dvh}
.vision-status-preview .weapon-art-heading,.vision-status-preview .preview-controls,.vision-status-preview>p{flex:none;margin:0}
.vision-status-preview canvas{min-height:0;max-height:calc(92dvh - 155px);object-fit:contain;flex:1;width:100%}

/* Shared administration workspace: one location for every management area. */
#learning-inspector{border:1px solid var(--border);border-radius:10px;background:#1b2d23;margin:16px 0}#learning-inspector>summary{padding:16px 20px;cursor:pointer;font-weight:700;color:var(--gold)}.learning-body{padding:0 20px 20px}.learning-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:12px;margin:16px 0}.learning-fields label{display:flex;flex-direction:column;gap:5px;font-size:13px}.learning-fields input,.learning-fields select{width:100%;min-height:40px;box-sizing:border-box}.learning-companions,.learning-known{display:flex;flex-wrap:wrap;gap:12px}.learning-companions{margin-bottom:16px}.learning-known{padding:12px}.learning-companions label,.learning-known label{font-size:13px}.learning-results{overflow:auto;margin-top:16px}.learning-results table{min-width:850px;width:100%}.learning-results small{display:block;font-size:12px;color:var(--muted);margin-top:6px}.learning-results ul{padding:0;margin:0;list-style:none;font-size:12px}.learning-pass{color:#b9dec0}.learning-fail{color:#ffbca7}.learning-caution{font-size:12px;color:var(--muted)}
.formation-mini{width:174px;margin:0}.formation-mini-direction{display:flex;justify-content:space-between;margin-bottom:6px;font-size:11px;color:var(--muted);white-space:nowrap}.formation-mini-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;padding:5px;border:1px solid #6a806b;border-radius:7px;background:#10231b}.formation-mini-cell{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:1px solid #425947;border-radius:4px;background:#233a2d;font-size:14px;font-weight:700;line-height:1}.formation-mini-cell.occupied{background:var(--gold);color:#261c0f;border-color:#ffe3a5;box-shadow:inset 0 -2px #b0823d}.formation-mini figcaption{margin-top:5px;color:var(--muted);font-size:10px;text-align:center;white-space:nowrap}
.discovery-previews{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:16px 20px;margin:16px 0 22px;border:1px solid var(--border);border-radius:10px;background:#213229}
.discovery-previews h3{margin:0 0 4px;font-size:17px;color:var(--gold)}.discovery-previews p{margin:0;color:var(--muted);font-size:13px}.discovery-previews>div{margin-right:auto}.discovery-previews button{min-height:44px;padding:10px 18px}
[hidden]{display:none!important}
.character-art-trigger{display:inline-flex;flex-direction:column;align-items:center;gap:3px;padding:5px 7px;flex:none;border-color:#7c7455;cursor:zoom-in}.character-art-trigger span{font-size:11px;color:var(--gold);line-height:1.2}.family-preview-entry{display:flex;flex-direction:column;align-items:center;gap:4px}.family-preview-entry .family-member{min-height:32px;padding:4px 8px}.member-cards button{display:flex;align-items:center;padding:12px 18px;background:#192b21;border:1px solid var(--border);border-radius:8px;gap:10px;min-width:150px;text-align:left;cursor:zoom-in}
.character-art-dialog{box-sizing:border-box;width:min(1060px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:22px;border:1px solid #9b8b62;border-radius:14px;background:#15251e;color:#f2eee0;overflow:auto}.character-art-dialog::backdrop{background:#000c}.character-art-dialog .weapon-art-heading{margin-bottom:18px}.character-art-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:22px;align-items:start}.character-art-stage{align-self:stretch;display:flex;align-items:center;justify-content:center;min-width:0;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:radial-gradient(ellipse,#344f3f,#102119 80%)}.character-art-stage[data-background=light]{background:#f1e4c6}.character-art-stage[data-background=grid]{background-color:#dfdfdf;background-image:conic-gradient(#bdbdbd 25%,transparent 0 50%,#bdbdbd 0 75%,transparent 0);background-size:24px 24px}.character-art-stage canvas{display:block;width:100%;height:auto;image-rendering:auto}.character-art-controls{display:grid;gap:16px}.character-art-controls label{display:grid;gap:6px;color:var(--muted);font-size:13px}.character-art-controls select{width:100%;min-width:0;min-height:42px;padding:8px;background:#10231a;color:#f2eee0;border:1px solid var(--border);border-radius:6px;font:inherit;font-size:14px}.character-art-controls fieldset{min-width:0;margin:0;padding:0;border:0}.character-art-controls legend{margin-bottom:8px;color:var(--muted);font-size:13px}.character-art-members,.character-art-poses,.character-art-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.character-art-controls button{min-height:40px;padding:8px 6px;font-size:13px}.character-art-controls button[aria-pressed=true]{background:var(--gold);border-color:var(--gold);color:#211f16;font-weight:700}.character-art-status{margin:14px 0 0;color:var(--muted);font-size:13px;min-height:1.5em}
.character-art-dialog[open]{display:flex;flex-direction:column;overflow:hidden}.character-art-dialog>.weapon-art-heading,.character-art-status{flex:none}.character-art-layout{min-height:0;overflow:auto;padding-right:4px}.character-art-stage{position:sticky;top:0;align-self:start}.character-art-stage canvas{max-height:calc(100dvh - 198px);object-fit:contain}
@media(max-width:700px){.character-art-dialog{padding:14px}.character-art-layout{grid-template-columns:1fr;gap:16px}.character-art-stage{position:static}.character-art-stage canvas{max-height:52dvh;object-fit:contain}.character-art-controls{gap:12px}.character-art-members,.character-art-poses{grid-template-columns:repeat(3,minmax(0,1fr))}}
.admin-header{padding:22px 28px 16px;align-items:center}.admin-header h1{font-size:26px;margin:0}.admin-header .eyebrow{font-size:11px;margin-bottom:5px}
.admin-navigation{position:sticky;top:0;z-index:10;display:flex;gap:8px;max-width:1504px;margin:0 auto 24px;padding:10px 0;background:#14201bf5;border-bottom:1px solid var(--border);backdrop-filter:blur(12px)}
.admin-navigation button{min-width:140px;min-height:48px;padding:10px 22px;border-radius:8px;font-weight:700;background:#22372c}
.admin-navigation button[aria-pressed=true]{background:var(--gold);color:#211f16;border-color:var(--gold);box-shadow:inset 0 -3px #a97939}
main{padding:0 28px 48px}.admin-view{min-width:0}.catalog-heading{display:flex;align-items:baseline;gap:18px;margin-bottom:16px}.catalog-heading h2{margin:0;font-size:22px}.catalog-heading p{margin:0;font-size:14px;color:var(--muted)}
.catalog-tools{background:#213229;padding:18px 20px;border-radius:10px}.search-row{max-width:900px}.search-label{font-size:14px;margin-bottom:8px}#catalog-filters{gap:7px;margin-top:16px}#catalog-filters button{font-size:14px;padding:9px 13px}.result-count{margin-top:12px}
.catalog-help{margin-top:14px;color:var(--muted);font-size:13px}.catalog-help summary{cursor:pointer;width:fit-content;padding:6px 0}.catalog-help .catalog-note{margin:8px 0}.settings-notice{margin:8px 0 16px}
.catalog-section{margin-top:22px}.section-title{padding-bottom:10px;border-bottom:1px solid var(--border)}.catalog-groups{padding:12px;background:#1d2d24;border-radius:8px;gap:8px}.catalog-groups button{min-height:42px;font-size:14px}
.catalog-section tbody tr:nth-child(even){background:#1e3026}.catalog-section tbody tr:hover{background:#304437}.catalog-section th{background:#2b4134;color:#e3eadd}.catalog-section td{border-bottom-color:#3c5244}
.admin-view>.release-admin,.admin-view>.adjustment-panel{margin:0}.admin-view>.release-admin>summary,.admin-view>.adjustment-panel>summary{display:none}.admin-view .release-admin-body,.admin-view .adjustment-body{padding:22px}
#admin-media-view>.admin-stage-media{width:100%;max-height:none;max-width:none;margin:0;box-shadow:none;padding:22px;overflow:visible;border-color:var(--border);background:#1c2c25}
#admin-media-view .stage-media-layout{grid-template-columns:220px minmax(0,1fr)}#admin-media-view .stage-media-list{max-height:480px;overflow:auto;padding-right:6px}#admin-media-view .stage-media-preview>img{max-height:420px}
@media(max-width:1560px){.admin-navigation{margin-left:28px;margin-right:28px}}
@media(max-width:760px){.admin-header{padding:16px}.admin-navigation{margin:0 16px 16px;gap:5px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.admin-navigation button{min-width:0;padding:9px 5px;font-size:12px;min-height:44px}main{padding:0 16px 32px}.catalog-heading{display:block}.catalog-heading p{margin-top:6px}.catalog-tools{padding:14px}#admin-media-view>.admin-stage-media{padding:14px}#admin-media-view .stage-media-layout{grid-template-columns:130px minmax(0,1fr);gap:12px}.admin-view .release-admin-body,.admin-view .adjustment-body{padding:16px}}
.moderation-layout{display:grid;grid-template-columns:minmax(240px,1fr) minmax(320px,1.5fr);gap:20px}.moderation-layout section{min-width:0}.moderation-layout form{display:grid;gap:10px}.moderation-layout label{display:flex;flex-direction:column;gap:4px}.moderation-layout textarea,#admin-moderation-view details textarea{width:100%;min-height:70px}.moderation-reports{display:grid;gap:8px;max-height:65vh;overflow:auto}.moderation-reports button{display:flex;flex-direction:column;text-align:left;gap:4px}.moderation-reports p,.moderation-history p{white-space:pre-wrap;overflow-wrap:anywhere}.moderation-history article{padding:12px 0;border-bottom:1px solid #b6a482}.moderation-history{max-height:40vh;overflow:auto}#admin-moderation-view header{display:flex;align-items:center;justify-content:space-between}

/* Administration theme. Tokens adapted from stunning-web-design/design-tokens.css.
   Loaded last so game artwork and the existing interaction code stay independent. */
:root {
  color-scheme: light;
  --bg: #eaf0f3;
  --bg-elevated: #ffffff;
  --bg-subtle: #e2eaee;
  --text: #15292f;
  --text-muted: #3d535d;
  --border: #b0c1c9;
  --accent: #00695f;
  --accent-hover: #07665f;
  --accent-soft: #e6f4f0;
  --accent-contrast: #ffffff;
  --warning: #905915;
  --warning-soft: #fff5e5;
  --danger: #ad4035;
  --danger-soft: #fff0ed;
  --font-sans: "Meiryo", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", monospace;
  --step--1: .9375rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.5rem, 1.3rem + .4vw, 1.875rem);
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --gutter: clamp(1rem, 2.4vw, 2.5rem);
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px #24343808;
  --shadow-lg: 0 16px 56px #142b3433;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 150ms;
  --muted: var(--text-muted);
  --gold: var(--accent);
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #152023;
    --bg-elevated: #1e2b30;
    --bg-subtle: #25363b;
    --text: #e9f0f2;
    --text-muted: #c2d4dd;
    --border: #657e89;
    --accent: #86d8c8;
    --accent-hover: #a5eddf;
    --accent-soft: #233e3d;
    --accent-contrast: #152923;
    --warning: #f1c783;
    --warning-soft: #3d3323;
    --danger: #ffb0a5;
    --danger-soft: #432b2b;
    --shadow-sm: 0 1px 3px #0002;
    --shadow-lg: 0 16px 56px #0006;
  }
}
body { background: var(--bg); color: var(--text); font: var(--step-0)/1.65 var(--font-sans); }
button, input, select, textarea { font: inherit; }
button, input:not([type=checkbox]):not([type=range]), select, textarea {
  color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
}
button { min-height: 40px; padding: 8px 13px; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
button:hover { background: var(--bg-subtle); border-color: var(--text-muted); }
button:active { background: var(--accent-soft); }
button:disabled { opacity: 1; color: var(--text-muted); background: var(--bg-subtle); cursor: not-allowed; }
input:not([type=checkbox]):not([type=range]), select, textarea { padding: 10px 12px; min-height: 42px; min-width: 0; max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input[type=checkbox], input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { width: auto; flex: none; }
textarea { resize: vertical; }
a { color: var(--accent); }
:is(button, input, select, textarea, a, summary, .table-scroll):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { color: var(--text); letter-spacing: -.025em; line-height: 1.4; }
summary { cursor: pointer; }
.lab-skip { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 10px 16px; background: var(--bg-elevated); border: 1px solid var(--accent); border-radius: var(--radius); }
.lab-skip:focus { top: 12px; }
.admin-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.lab-sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; display: flex; flex-direction: column; padding: 28px 16px; border-right: 1px solid var(--border); background: var(--bg-elevated); overflow: auto; }
.lab-sidebar .admin-header { max-width: none; margin: 0 0 32px; padding: 0 10px; display: flex; gap: 12px; align-items: center; justify-content: flex-start; }
.admin-header h1 { margin: 0; font-size: 22px; letter-spacing: .01em; white-space: nowrap; }
.admin-header .eyebrow { font-size: 12px; letter-spacing: .16em; color: var(--text-muted); margin: 0 0 3px; }
.lab-mark { display: grid; place-items: center; width: 38px; height: 42px; flex: none; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-lg); }
.lab-mark svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lab-sidebar .admin-navigation { position: static; display: flex; flex-direction: column; width: 100%; margin: 0; padding: 0; max-width: none; gap: 6px; border: 0; background: transparent; backdrop-filter: none; }
.lab-nav-group { margin: 22px 12px 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.lab-nav-group:first-child { margin-top: 0; }
.lab-sidebar .admin-navigation button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text-muted); font-size: 16px; font-weight: 500; box-shadow: none; }
.lab-sidebar .admin-navigation button:hover { color: var(--text); background: var(--bg-subtle); }
.lab-sidebar .admin-navigation button[aria-pressed=true] { color: var(--accent); background: var(--accent-soft); font-weight: 700; border-color: transparent; box-shadow: inset 3px 0 var(--accent); }
.admin-navigation svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lab-sidebar-note { color: var(--text-muted); font-size: 13px; line-height: 1.9; margin: auto 12px 0; padding-top: 32px; }
#admin-main { min-width: 0; width: 100%; max-width: none; padding: 0 var(--gutter) 48px; margin: 0; }
.lab-breadcrumb { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-bottom: 20px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
#lab-current-view { color: var(--text); }
.catalog-heading { display: block; margin-bottom: 18px; }
.catalog-heading h2 { font-size: var(--step-2); font-weight: 700; margin: 0 0 6px; }
.catalog-heading p { color: var(--text-muted); font-size: var(--step-0); margin: 0; }
.catalog-tools { border: 1px solid var(--border); background: var(--bg-elevated); padding: 16px 20px 12px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.search-label { color: var(--text); font-size: var(--step--1); font-weight: 600; margin-bottom: 8px; }
.search-row { max-width: none; gap: 8px; }
.search-row input { min-height: 44px; font-size: 16px; background: var(--bg); }
.search-row button { font-size: var(--step--1); padding-inline: 18px; }
#catalog-filters { gap: 4px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
#catalog-filters button { border: 1px solid transparent; padding: 7px 10px; min-height: 36px; font-size: 15px; color: var(--text-muted); background: transparent; }
#catalog-filters button:hover { background: var(--bg-subtle); color: var(--text); }
#catalog-filters button[aria-pressed=true] { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.filter-count { margin-left: 6px; color: inherit; opacity: 1; font-size: 13px; font-variant-numeric: tabular-nums; }
.result-count { font-size: 14px; margin: 12px 0 0; color: var(--text-muted); }
.settings-notice { margin: 8px 2px 12px; min-height: 20px; }
.settings-notice p { color: var(--text-muted); font-size: 14px; }
.lab-tools { margin: 0 0 18px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }
.lab-tools > summary { padding: 11px 16px; font-size: 15px; color: var(--text); }
.lab-tools > summary::marker { color: var(--accent); }
.lab-tools > summary small { margin-left: 14px; font-size: 14px; color: var(--text-muted); font-weight: 400; }
.lab-tools-body { border-top: 1px solid var(--border); padding: 0 20px 18px; }
.lab-tools .discovery-previews { border: 0; border-radius: 0; background: transparent; padding: 18px 0; margin: 0; gap: 8px; }
.discovery-previews h3 { font-size: 16px; color: var(--text); }
.discovery-previews p { font-size: 14px; }
#learning-inspector { background: var(--bg); border-color: var(--border); border-radius: var(--radius); margin: 0 0 12px; }
#learning-inspector > summary { color: var(--text); padding: 12px 14px; font-size: 15px; }
.learning-body { padding: 0 14px 14px; }
.learning-fields { grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); }
.learning-pass { color: var(--accent); }
.learning-fail { color: var(--danger); }
.catalog-help { margin-top: 12px; font-size: 14px; }
.catalog-section { min-width: 0; margin-top: 18px; }
.catalog-section > h2 { font-size: 20px; margin: 0 0 14px; }
.section-title { border-bottom: 0; padding: 0; margin-bottom: 8px; align-items: center; }
.section-title h2 { font-size: 20px; }
.section-title span { font-size: 14px; }
.section-description { color: var(--text-muted); font-size: 15px; line-height: 1.75; max-width: 90ch; }
.catalog-groups { padding: 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); gap: 6px; margin: 12px 0; max-height: 238px; overflow: auto; }
.catalog-groups button { font-size: 15px; min-height: 38px; padding: 7px 12px; border-color: transparent; background: var(--bg-subtle); }
.catalog-groups button:hover { border-color: var(--text-muted); }
.catalog-groups button[aria-pressed=true] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.family-description { color: var(--text-muted); font-size: 15px; max-width: 100%; }
.family-description b { color: var(--text); }
.learning-rules { margin: 8px 0; font-size: 15px; color: var(--text-muted); }
.learning-rules summary { color: var(--accent); padding: 6px 0; }
.table-scroll { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); max-width: 100%; }
th, td { padding: 13px 14px; border-bottom-color: var(--border); line-height: 1.65; }
th, .catalog-section th { color: var(--text-muted); background: var(--bg-subtle); font-size: 14px; font-weight: 600; }
td { font-size: 16px; }
td strong, .weapon-name { color: var(--text); }
.catalog-section th, .catalog-section td { border-right: 0; border-bottom-color: var(--border); }
tbody tr, .catalog-section tbody tr:nth-child(even) { background: var(--bg-elevated); }
tbody tr:hover, .catalog-section tbody tr:hover { background: var(--bg-subtle); }
.subline { color: var(--text-muted); font-size: 14px; }
.tag { border-color: var(--border); color: var(--text-muted); background: var(--bg-subtle); padding: 2px 7px; font-size: 13px; border-radius: var(--radius); }
.weapon-name { text-decoration-color: var(--border); }
.weapon-name:hover { color: var(--accent); background: transparent; }
.character-art-trigger { background: var(--bg-elevated); border-color: var(--border); }
.character-art-trigger span { color: var(--accent); }
.member-cards button, .member-cards a { color: var(--text); background: var(--bg-elevated); border-color: var(--border); padding: 10px 14px; }
.member-cards button:hover, .member-cards a:hover { background: var(--accent-soft); border-color: var(--accent); }
.hidden-stat-legend span, .characters-table :is(th,td):nth-child(n+11):nth-child(-n+13) { color: var(--warning); }
.characters-table :is(th,td):nth-child(n+11):nth-child(-n+13) { background: var(--warning-soft); }
[data-section="characters"] .table-scroll { overflow: auto; }
.characters-table { min-width: 1100px; }
.characters-table th, .characters-table td { font-size: 15px; }
.characters-table .edit-family { font-size: 14px; }
.characters-table td::before { font-size: 13px; }
.character-art-controls :is(label, select, button), .character-art-controls legend { font-size: 15px; }
.family-fields small, .release-fields label, .release-ranks label, .release-metrics span { font-size: 14px; }
.characters-table tr:target { background: var(--accent-soft); }
[data-section="arts"] .art-production { font-size: 13px; }
[data-section="arts"] .art-production-ready, .art-production-live { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
[data-section="arts"] .art-production-pending { color: var(--warning); background: var(--warning-soft); border-color: var(--warning); }
[data-section="arts"] tr:has(.art-production-pending) { background: var(--bg-elevated); }
[data-section="arts"] tr:has(.art-production-pending):hover { background: var(--warning-soft); }
[data-section="arts"] tr:has(.art-production-pending) td:first-child { box-shadow: inset 3px 0 var(--warning); }
[data-section="arts"] .catalog-groups button:has(.art-production-pending) { border-color: var(--border); }
.formation-mini-grid { background: var(--bg); border-color: var(--border); }
.formation-mini-cell { background: var(--bg-elevated); border-color: var(--border); }
.formation-mini-cell.occupied { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); box-shadow: none; }
#empty-result { background: var(--bg-elevated); border: 1px dashed var(--border); padding: 28px; font-size: 16px; text-align: center; }
/* Dialog chrome follows the lab; artwork canvases keep their original rendering. */
#family-editor, #weapon-art-dialog, .technique-preview, .character-art-dialog {
  background: var(--bg-elevated); color: var(--text); border-color: var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: #12252c99; }
#family-editor p, #weapon-art-dialog p, .character-art-status, .preview-controls { color: var(--text-muted); }
#family-editor .editor-actions { background: var(--bg-elevated); border-top: 1px solid var(--border); }
#family-change-preview tr.changed td:last-child { background: var(--accent-soft); color: var(--accent); }
.character-art-controls select { background: var(--bg); color: var(--text); border-color: var(--border); }
.character-art-controls button[aria-pressed=true] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.save-settings { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.save-settings:hover { background: var(--accent-hover); }
.save-settings:disabled { color: var(--text-muted); background: var(--bg-subtle); border-color: var(--border); }
.settings-notice .error, #family-editor-error, .release-admin .error, [data-release-validation], .adjustment-body .error { color: var(--danger); }
.preview-controls { flex-wrap: wrap; }
/* Operations and media use the same surfaces and form controls. */
.release-admin, .adjustment-panel { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.release-admin > summary { color: var(--text); }
.release-admin > summary small, .release-help, .release-fixed, .release-fields label, .release-ranks label, .release-save-row span, .release-metrics span, .release-stats summary, .adjustment-scope, .adjustment-body small { color: var(--text-muted); }
.release-admin fieldset { border-color: var(--border); background: var(--bg-elevated); border-radius: var(--radius); }
.release-admin legend { color: var(--text); font-size: 16px; }
.release-fields input, .release-ranks input, .adjustment-body input, .adjustment-body textarea { background: var(--bg); color: var(--text); border-color: var(--border); }
.release-fixed { background: var(--bg-subtle); border-left-color: var(--accent); }
.release-test-tag { color: var(--warning); background: var(--warning-soft); border-color: var(--warning); }
.release-metrics > div { background: var(--bg); border-color: var(--border); }
.release-metrics strong, .release-usage b { color: var(--text); }
.release-usage li, .release-stats { border-bottom-color: var(--border); }
.release-admin input:read-only { background: var(--bg-subtle); color: var(--text-muted); }
.adjustment-body button { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.adjustment-body button:hover { background: var(--bg-subtle); }
.adjustment-body .adjustment-commit { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.adjustment-body label { min-width: min(18rem, 100%); }
.adjustment-recent { grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.adjustment-table th, .adjustment-table td { border-color: var(--border); }
#admin-media-view > .admin-stage-media { background: var(--bg-elevated); border-color: var(--border); border-radius: var(--radius-lg); }
.admin-stage-media { --media-bg: var(--bg-elevated); --media-panel: var(--bg); --media-ink: var(--text); --media-muted: var(--text-muted); --media-gold: var(--accent); --media-line: var(--border); }
.admin-stage-media button { border-radius: var(--radius); }
.admin-stage-media button[aria-pressed=true] { box-shadow: none; background: var(--accent-soft); color: var(--accent); }
.stage-media-heading p { color: var(--text-muted); }
#admin-moderation-view > header { margin-bottom: 20px; }
#admin-moderation-view > header h2 { font-size: var(--step-2); margin: 0; }
.moderation-layout > section, #admin-moderation-view > details { padding: 20px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.moderation-layout h3 { font-size: 16px; margin: 0 0 16px; }
.moderation-layout label { font-size: 15px; gap: 6px; }
.moderation-layout select { width: 100%; }
.moderation-layout textarea, #admin-moderation-view details textarea { min-width: 0; padding: 10px; }
.moderation-history article { border-color: var(--border); }
.moderation-history { margin-top: 16px; }
.moderation-layout form { gap: 16px; margin: 16px 0 24px; }
.moderation-layout form > button { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
#admin-moderation-view > details { margin-top: 20px; }
#admin-moderation-view details textarea { margin: 12px 0; font: 12px/1.7 var(--font-mono); }
@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 232px minmax(0, 1fr); }
  .lab-sidebar { padding-inline: 12px; }
  .lab-sidebar .admin-header { padding-inline: 8px; gap: 8px; }
  .admin-header h1 { font-size: 20px; }
  .characters-table { min-width: 0; }
  .release-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .release-fields, .release-ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moderation-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .admin-shell { display: block; }
  .lab-sidebar { position: static; height: auto; padding: 16px var(--gutter) 0; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .lab-sidebar .admin-header { padding: 0; margin-bottom: 14px; }
  .lab-sidebar .admin-navigation { flex-direction: row; gap: 4px; overflow: auto; padding: 0 0 10px; }
  .lab-sidebar .admin-navigation button { flex: none; width: auto; min-height: 44px; padding: 9px 12px; gap: 7px; font-size: 15px; }
  .lab-sidebar .admin-navigation button[aria-pressed=true] { box-shadow: inset 0 -2px var(--accent); }
  .lab-nav-group, .lab-sidebar-note { display: none; }
  .lab-breadcrumb { min-height: 50px; margin-bottom: 20px; }
  .catalog-heading { margin-bottom: 18px; }
  .catalog-tools { padding: 16px; }
  .lab-tools > summary small { display: block; margin: 3px 0 0 16px; }
  .lab-tools-body { padding: 0 14px 14px; }
  #admin-media-view .stage-media-layout { grid-template-columns: 140px minmax(0, 1fr); }
}
@media (max-width: 520px) {
  #catalog-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #catalog-filters button { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 7px; text-align: left; font-size: 14px; min-height: 40px; }
  #catalog-filters .filter-count { font-size: 12px; margin-left: 2px; }
  .catalog-groups { padding: 8px; max-height: 220px; }
  .catalog-groups button { min-height: 40px; padding: 6px 10px; }
  .family-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-fields label { min-width: 0; font-size: 15px; }
  .editor-heading h2, .weapon-art-heading h2 { font-size: 19px; overflow-wrap: anywhere; }
  .editor-actions { gap: 8px; }
  .release-fields, .release-ranks { grid-template-columns: minmax(0, 1fr); }
  .release-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-save-row { flex-wrap: wrap; }
  .release-usage-grid { grid-template-columns: minmax(0, 1fr); }
  .moderation-layout > section, #admin-moderation-view > details { padding: 14px; }
  .adjustment-body label { min-width: 0; flex-basis: 100%; }
  .adjustment-body form > button { width: 100%; }
  #admin-media-view .stage-media-layout { grid-template-columns: minmax(0, 1fr); }
  #admin-media-view .stage-media-list { flex-direction: row; max-height: none; overflow-x: auto; padding: 0 0 8px; gap: 8px; }
  .stage-media-list button { flex: 0 0 126px; }
  .stage-media-player { flex-wrap: wrap; }
  .stage-media-player audio { width: 100%; }
  .weapon-art-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.family-techniques { margin: 20px 0 28px; }
.family-techniques h3 { margin: 0 0 8px; }
.family-technique-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.family-technique-cards article { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }
.family-technique-cards h4 { margin: 0 0 8px; font-size: 17px; }
.family-technique-cards p { margin: 0 0 12px; line-height: 1.7; overflow-wrap: anywhere; }
.family-technique-cards button { margin-top: auto; }

/* Keep category buttons available while browsing long catalogues. */
#catalog-filters { position: sticky; top: 10px; z-index: 12; display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; padding: 12px; border: 1px solid #a7bbc6; border-radius: 14px; background: #f8fbfd; box-shadow: 0 5px 18px #183b5026; }
#catalog-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 15px; border: 1px solid #8ca6b7; border-radius: 9px; background: #fff; color: #193b50; font-size: 16px; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: 0 3px 0 #c5d3dc; transition: transform .12s, box-shadow .12s, background .12s; }
#catalog-filters button:hover { background: #e8f3f7; border-color: #467488; transform: translateY(-2px); box-shadow: 0 5px 0 #c5d3dc; }
#catalog-filters button:active { transform: translateY(2px); box-shadow: none; }
#catalog-filters button[aria-pressed=true] { background: #006b63; border-color: #00534d; color: #fff; box-shadow: 0 3px 0 #004a44; }
#catalog-filters button:focus-visible { outline: 3px solid #163e78; outline-offset: 3px; }
#catalog-filters .filter-count { margin: 0; padding: 2px 7px; border-radius: 5px; background: #e5edf2; color: #28485c; font-size: 13px; }
#catalog-filters button[aria-pressed=true] .filter-count { background: #fff; color: #00534d; }
@media (max-width: 800px), (max-height: 600px) {
  #catalog-filters { top: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 10px; gap: 8px; }
  #catalog-filters button { flex: 0 0 auto; min-height: 46px; padding: 9px 12px; }
}
/* Keep the whole Juso preview and its controls visible on landscape phones. */
dialog.juso-preview[open]{display:flex;flex-direction:column;width:min(1100px,calc(100vw - 32px));height:min(780px,94dvh);box-sizing:border-box;gap:6px;padding:14px;overflow:hidden}
.juso-preview .weapon-art-heading{flex:0 0 auto;margin:0;min-height:32px}
.juso-preview h2{font-size:20px;margin:0}
.juso-preview .weapon-art-heading button{padding:4px 12px;min-height:32px}
.juso-preview p{font-size:13px;line-height:1.4;margin:0}
.juso-preview .technique-preview-power{font-weight:700}
.juso-preview canvas{flex:1 1 0;min-height:80px;width:100%;height:0;max-height:none;aspect-ratio:auto}
.juso-preview .preview-controls{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;font-size:12px;margin:0}
.juso-preview .preview-controls select,.juso-preview .preview-controls button{font-size:12px;min-height:32px;padding:5px 8px}
.juso-preview .preview-controls [role=status]{font-size:12px}
.juso-preview [data-juso-progress]{width:135px;vertical-align:middle}
.mie-preview[open]{display:flex;flex-direction:column;width:min(1100px,calc(100vw - 32px));height:min(780px,94dvh);box-sizing:border-box;gap:6px;padding:14px;overflow:hidden}
.mie-preview .weapon-art-heading{flex:none;margin:0;min-height:32px}
.mie-preview h2{font-size:20px;margin:0}
.mie-preview p{font-size:13px;line-height:1.4;margin:0}
.mie-preview canvas{flex:1 1 0;min-height:80px;width:100%;height:0;max-height:none;aspect-ratio:auto}
.mie-preview .preview-controls{flex:none;gap:6px 12px;font-size:12px;margin:0}
.mie-preview .preview-controls select,.mie-preview button{font-size:12px;min-height:32px;padding:5px 8px}
.mie-preview [data-mie-progress]{width:135px;vertical-align:middle}

.accessory-art-trigger{display:flex;align-items:center;gap:12px;width:100%;min-width:220px;padding:8px;text-align:left;color:var(--text);background:var(--bg-elevated);border:1px solid var(--border);border-radius:10px;cursor:pointer}
.accessory-art-trigger:hover{background:var(--accent-soft);border-color:var(--accent)}
.accessory-art-trigger:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.accessory-art-trigger .accessory-art-thumbnail{display:block;flex:0 0 76px;width:76px;height:76px;object-fit:contain;border-radius:8px;background:#f4eddb;image-rendering:auto}
.accessory-art-trigger strong{display:block;font-size:15px}.accessory-art-trigger small{display:block;margin-top:6px;color:var(--text-muted);font-size:12px}
