/* Guild Workshop v35 — visual refinement. Game rules and map geometry stay in their own modules. */
:root {
  color-scheme: dark;
  --bg: #0d1118;
  --panel: #171d27;
  --raised: #1d2531;
  --line: #2b3443;
  --muted: #9da9ba;
  --gold: #e1ba77;
  --text: #eaf0f7;
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
body { background: radial-gradient(ellipse at 55% 0, #1a2231 0, #0d1118 65%); min-height: 100vh; }
button, input, select, textarea { transition: background-color .16s, border-color .16s, box-shadow .16s, color .16s; }
button { border: 1px solid #354051; border-radius: 9px; background: #222b39; padding: 10px 15px; font-weight: 600; }
button:hover:not(:disabled) { background: #2b3748; border-color: #627188; }
button:active:not(:disabled) { filter: brightness(.94); }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
input, select, textarea { font: inherit; color: var(--text); background: #101720; border: 1px solid #394557; border-radius: 9px; padding: 11px 12px; }
input::placeholder, textarea::placeholder { color: #8794a8; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px #e1ba771c; }
input[type=checkbox] { accent-color: var(--gold); }
input[type=search] { padding-left: 37px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239da9ba' stroke-width='1.7'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px; background-position: 12px center; }
button.accent { background: linear-gradient(135deg, #edca8f, #d8aa60); color: #211b12; border-color: #edca8f; box-shadow: 0 3px 12px #0003; }
button.accent:hover:not(:disabled) { background: linear-gradient(135deg, #f4d6a2, #e5bd7c); border-color: #f7d9a5; }
button.delete { color: #ee9b9f; background: #2a2029; border-color: #58313d; }
button.delete:hover:not(:disabled) { color: #ffc7cb; background: #432634; border-color: #a85468; }
button.link { background: none; color: var(--gold); box-shadow: none; }
.good { color: #8cd9b6; } .bad { color: #f4a0a6; }
.small { font-size: 12px; padding: 7px 11px; }
.muted { color: var(--muted); }
:where(.panel, .account-panel, .tw-map-panel, .tw-control-panel, .tw-assignments) { box-shadow: 0 7px 22px #00000016; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 200; color: #151820; background: var(--gold); padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
/* Three distinct levels: audience, section, game account. */
.topbar { height: 82px; min-height: 82px; padding: 0 clamp(20px, 3vw, 48px); gap: 42px; background: #10151e; border-bottom: 1px solid #273140; }
.brand { gap: 11px; flex-shrink: 0; }
.brand > img { width: 42px; height: 42px; }
.brand span { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.brand small { margin-top: 3px; color: #a2adbd; font-size: 9px; letter-spacing: 2px; }
.topbar .area-nav { order: initial; flex-basis: auto; align-self: center; height: 44px; gap: 4px; padding: 4px; background: #090e16; border: 1px solid #2b3443; border-radius: 12px; }
.topbar .area-nav button { height: 34px; padding: 5px 16px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: #aab5c7; }
.topbar .area-nav button.active { color: #f0cd94; background: #2f2a24; border-color: #5e4b33; }
.nav-icon { width: 18px; height: 18px; flex: none; }
.account { gap: 10px; font-size: 12px; }
#sessionLabel { max-width: 205px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); margin-right: 6px; }
#openAccount { background: #1b2431; border-color: #354154; }
#openAccount.active { color: var(--gold); border-color: #95774c; }
#logout { background: transparent; border-color: transparent; color: var(--muted); }
.section-nav, .section-nav:has(#playerSections:not([hidden])) { min-height: 57px; padding: 0 clamp(20px, 3vw, 48px); background: #131a24; border-bottom: 1px solid #293343; }
.section-nav > div, .section-nav #playerSections { gap: 22px; }
.section-nav button { display: inline-flex; align-items: center; gap: 8px; padding: 17px 2px 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #a6b3c4; font-size: 13px; font-weight: 500; background: none; }
.section-nav button.active { color: #f1d09b; border-color: var(--gold); background: none; }
.section-nav button:hover:not(:disabled) { background: none; color: #f4f7fc; border-color: #65738a; }
.section-nav button.active:hover { border-color: var(--gold); }
.workspace-bar { min-height: 69px; padding: 10px clamp(20px, 3vw, 48px); background: #101720; border-color: #273242; gap: 16px; }
.workspace-bar .player-account-tab { background: transparent; border-color: transparent; padding: 4px 14px 4px 6px; border-radius: 9px; font-weight: 500; color: #aebacc; }
.workspace-bar .player-account-tab.active { background: #202937; border-color: #465164; color: #f0f3fa; }
.workspace-bar .player-account-tab .game-portrait { width: 35px; height: 35px; }
.guild-name { color: #c9d3e1; font-size: 13px; font-weight: 600; }
.guild-name:before { font-size: 9px; color: #8998ad; letter-spacing: 1.6px; }
#mainContent { max-width: 1600px; width: 100%; padding: 28px clamp(20px, 3vw, 48px) 64px; }
#mainContent:focus { outline: none; }
.page-head { min-height: 48px; margin-bottom: 22px; gap: 20px; }
.page-head h1 { font-size: 28px; letter-spacing: -.65px; font-weight: 650; }
.back-button, .account-back { font-size: 12px; color: #b4c1d4; margin-bottom: 10px; }
.back-button:hover { color: var(--gold); }
.actions { gap: 9px; align-items: center; }
.panel { padding: 24px; border: 1px solid #303b4c; border-radius: 16px; background: var(--panel); margin-bottom: 18px; }
.panel-heading { margin-bottom: 20px; gap: 12px; }
.panel-heading h2 { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
label { font-size: 12px; font-weight: 500; color: #abb7ca; gap: 8px; }
h2, h3 { font-weight: 650; }
/* Compact lists remain comfortable with dozens of squads. */
.kind-switch { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #303c4d; border-radius: 11px; padding: 4px; background: #0e151f; margin: 0; }
.kind-switch button { min-width: 92px; padding: 8px 18px; border: 1px solid transparent; border-radius: 7px; background: none; color: #a5b1c4; }
.kind-switch button.selected { background: #30302c; border-color: #5a503e; color: #f1ce94; font-weight: 600; }
.list-tools { padding: 14px 16px; background: #171e28; border: 1px solid #2d3748; border-radius: 12px; gap: 12px; margin-bottom: 16px; }
.list-tools input { width: min(360px, 100%); }
.list-tools > .muted { margin-left: auto; font-variant-numeric: tabular-nums; }
.priority-list { gap: 9px; }
.priority-row { padding: 14px 18px; min-height: 88px; gap: 18px; background: linear-gradient(110deg, #1a2230, #161d28 75%); border-color: #303b4c; border-radius: 13px; transition: border-color .16s, background .16s; }
.priority-row:hover { background: #202a39; border-color: #56637a; }
.priority-row .rank { color: #708198; font: 12px/1.5 Consolas, monospace; width: 21px; }
.priority-row .drag { color: #78879c; font-size: 20px; padding: 0; }
.priority-row > .portrait.mini, .priority-row > .team-avatar { width: 50px; height: 50px; flex: none; }
.priority-row .row-copy strong { font-weight: 600; font-size: 15px; letter-spacing: .05px; }
.priority-row .row-copy small { font-size: 11px; color: #91a0b5; margin-top: 4px; }
.priority-row .good { border: 1px solid #365949; background: #18322b; color: #91dcbb; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.row-arrows { gap: 4px; }
.row-arrows button { width: 26px; height: 25px; font-size: 15px; background: #151c27; border-color: #354153; color: #b0bed2; }
.priority-row > button.delete { width: 32px; min-height: 34px; padding: 4px; background: transparent; border-color: transparent; color: #a98089; }
.priority-row > button.delete:hover { background: #432634; }
.library-row .library-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; min-width: 0; }
.library-row .library-actions button { white-space: nowrap; flex: none; }
.library-row .library-actions .builtin-toggle { min-width: 156px; width: auto; padding: 8px 12px; }
.library-row .library-actions .icon-delete { width: 32px; min-width: 32px; padding: 5px; }
.library-row .row-copy { min-width: 120px; }
.guild-name select { max-width: 260px; }
@media (max-width: 850px) {
  .library-row .library-actions { flex-basis: 100%; justify-content: flex-start; margin-left: 0; }
}
#listResults, .results-gradient { background: linear-gradient(135deg, #a94458 0%, #815a66 42%, #34745f 100%); border-color: #b6868c; color: #fff; font-weight: 650; }
/* Editor */
.composition-tabs { gap: 8px; margin-bottom: 18px; border-bottom: 1px solid #303b4b; padding-bottom: 14px; }
.composition-tabs button { font-size: 12px; border-radius: 8px; background: #151d29; }
.composition-tabs .selected { background: #302b23; color: #f2d09a; border-color: #97794b; }
.quality-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; background: linear-gradient(110deg, #25272b, #171e29 65%); padding: 17px 22px; }
.quality-panel .panel-heading { margin: 0 auto 0 0; display: grid; gap: 3px; }
.quality-tabs { gap: 6px; }
.quality-tabs button { min-width: 48px; height: 43px; padding: 5px 12px; border-radius: 9px; background: #141c27; color: #a9b6ca; font-size: 16px; }
.quality-tabs button.selected { color: #221c12; background: var(--gold); border-color: #f3d69f; box-shadow: 0 2px 10px #d9ab5d20; }
.quality-panel > .muted { flex-basis: 100%; margin: 0; }
.quality-panel #removeQuality { margin: 0; }
.composition-panel, .fleet-composition { background: #171e2a; }
.fields.team-fields { gap: 16px; padding-bottom: 22px; border-bottom: 1px solid #2d394b; margin-bottom: 24px; }
.slots { gap: 14px; }
.slot { background: #101822; border: 1px solid #334052; border-radius: 12px; padding: 16px 10px; min-height: 258px; }
.slot.leader { background: radial-gradient(ellipse at 50% 0%, #4d3c25, #1b222d 72%); border: 1px solid #80643e; border-top: 3px solid #e1ba77; }
.slot.required { border-top: 3px solid #b76677; }
.slot.recommended { border-top: 3px solid #d1ae70; }
.slot.free { border-top: 3px solid #6f9ac7; }
.slot-types { height: 28px; margin: 0 0 4px; gap: 7px; }
.type-button { height: 25px; width: 26px; border-width: 1px; border-radius: 6px; }
.slot-role-label { color: #9daec2; font-size: 10px; display: block; height: 20px; margin-bottom: 7px; }
.slot-type.leader-type { color: #e9c387; font-size: 11px; height: 52px; padding-top: 7px; margin-bottom: 7px; }
.slot .portrait, .slot .team-avatar.large { width: 82px; height: 82px; }
.slot .team-avatar.large .portrait { width: 100%; height: 100%; }
.slot .slot-name { font-weight: 600; margin-top: 7px; font-size: 12px; line-height: 1.4; max-width: 100%; }
.slot .choose:hover:not(:disabled) { background: none; }
.slot .choose:hover:not(:disabled) > .portrait { box-shadow: 0 0 0 4px #e1ba771a; }
.unit-controls { gap: 6px; margin-top: 14px; }
.relic-control { background: #1f2835; border-color: #526076; border-radius: 7px; }
.relic-control strong { color: #f1d19d; min-width: 28px; }
.relic-control button { min-width: 23px; padding: 4px 5px; }
.ability-trigger { border-color: #38465b; background: #1b2534; border-radius: 7px; }
.ability-trigger.has-rule { border-color: #947944; background: #373020; }
.thresholds { gap: 14px; align-items: end; }
.thresholds label { min-width: 135px; }
.icon-setting { border-radius: 10px; }
.icon-setting.is-on { background: #302d25; border-color: #8a7045; box-shadow: none; }
.replacement-level { background: #111a26; border-color: #303e52; border-radius: 12px; }
.replacement-card, .add-replacement-card { border-radius: 11px; background: #1a2534; border-color: #38475d; }
.fleet-all-slots { gap: 8px; padding: 2px 0 14px; align-items: stretch; }
.fleet-all-slots .fleet-slot { background: #111a26; border-color: #344153; border-radius: 10px; }
.fleet-all-slots .fleet-slot:not(.fleet-flagship) { flex: 1 0 93px; max-width: 118px; min-height: 193px; padding: 10px 5px; }
.fleet-all-slots .fleet-flagship { flex: 0 0 186px; max-width: 186px; min-height: 220px; padding: 12px 8px; background: linear-gradient(#342c23,#192230)!important; }
.fleet-all-slots .fleet-flagship .ship-icon { width: 122px; height: 87px; }
.fleet-all-slots .fleet-slot small { font-size: 10px; font-weight: 500; }
.fleet-all-slots .fleet-slot>button:first-of-type { background: transparent; border: 0; }
.fleet-all-slots .fleet-slot strong { line-height: 1.4; max-height: none; }
.fleet-ship-stars { margin-top: auto; }
.fleet-plus { width: 20px; height: 24px; background: transparent; color: #b9a27b; }
.fleet-pilot { background: #111a27; border-color: #344256; padding: 12px; border-radius: 10px; }
/* Tables and results */
.visual-summary { gap: 16px; grid-template-columns: repeat(auto-fill,minmax(275px,1fr)); }
.visual-summary .summary-card { background: linear-gradient(130deg,#202b3b,#161e29); padding: 22px; border: 1px solid #364257; border-radius: 14px; }
.visual-summary .summary-card:hover { background: #222e40; border-color: #ad8c59; }
.visual-summary .summary-card strong { font-size: 17px; font-weight: 600; margin: 19px 0 9px; }
.summary-portraits { gap: 7px; }
.summary-portraits .portrait, .summary-portraits .team-avatar { width: 42px; height: 42px; }
.visual-summary .summary-portraits .team-avatar-marker { width: 17px; height: 17px; top: -4px; right: -3px; }
.visual-summary .summary-portraits .team-avatar-marker .portrait { width: 100%; height: 100%; border-width: 1px; }
.bar { border-radius: 3px; overflow: hidden; }
.visual-summary .bar i { background: linear-gradient(90deg,#987b48,#ebc789); }
.tier-chip { background: #131c28; border-color: #344155; color: #93a1b6; }
.tier-chip.has-units { background: #302b22; border-color: #6b5738; color: #eac68e; }
.result-topline .stat { background: #19222f; border-color: #344054; min-width: 148px; padding: 13px 20px; border-radius: 12px; }
.result-topline .stat b { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.result-scroll { background: #161e2a; border-color: #344157; border-radius: 13px; }
.result-head, .fleet-result-head { background: #202b3a; color: #a7b5c8; padding-top: 15px; padding-bottom: 15px; border-color: #3a465a; }
.result-row { border-color: #2b3748; }
.result-row:hover, .result-row[open] { background: #202b3b; }
.roster-unit { background: #121b28; border-color: #303e53; border-radius: 10px; padding: 8px; }
.result-extra { border-color: #3a485e; }
.result-player strong { font-weight: 600; }
.dc-toolbar { gap: 12px; flex-wrap: nowrap; }
.dc-toolbar input { flex: 1; min-width: 0; max-width: 420px; }
.dc-list-head { background: #212d3d; border: 1px solid #344257; border-bottom: 0; padding-top: 16px; padding-bottom: 16px; color: #aebbd0; border-radius: 12px 12px 0 0; }
.dc-list { background: #171f2b; border-color: #344257; }
.dc-player-row { border-color: #2d394c; min-height: 91px; }
.dc-player-row:nth-child(even) { background: #1a2432; }
.dc-player-row:hover { background: #243247; }
.dc-player-row>b { font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-player-name strong { font-weight: 600; }
.dc-card { background: radial-gradient(ellipse at 50% 20%,#26384a,#171f2b 75%); border-color: #36485f; border-radius: 14px; padding-top: 20px; }
.dc-bonus { border-color: #36465c; background: #1c293b; padding: 13px; }
/* Map surface, controls and assignments. Do not override cell placement or badge geometry. */
.tw-page { --color-text: #eaf0f7; --color-text-muted: #9daec2; }
.tw-participants { background: #171f2c; border-color: #324054; padding: 14px 18px; margin: 0 0 12px; }
.tw-participants summary { font-weight: 600; color: #c0cee1; font-size: 13px; }
.tw-participants[open] { border-color: #61718a; }
.tw-participant { border-color: #344258; background: #111b29; }
.tw-presets { background: #171f2c; border-color: #324054; padding: 14px 18px; gap: 8px; margin-bottom: 18px; }
.tw-presets span { color: #9baabe; font-size: 11px; }
.tw-layout { gap: 18px; grid-template-columns: minmax(0,1fr) 370px; }
.tw-map-panel { background: #111c2a; border-color: #344257; padding: 16px; border-radius: 16px; min-width: 0; }
.tw-map { background: #0c1827; box-shadow: none; }
.tw-control-panel { background: #19222f; border-color: #3b4960; padding: 18px; border-radius: 16px; top: 18px; max-height: calc(100vh - 36px); min-height: 490px; }
.tw-selection { margin-bottom: 14px; padding-bottom: 14px; border-color: #344157; }
.tw-selection h2 { color: #f0d0a0; font-size: 19px; font-weight: 650; }
.tw-selection p { color: #a2b3c9; font-size: 12px; }
.tw-mode-switch, .tw-results-tabs { padding: 4px; gap: 4px; background: #101823; border: 1px solid #334257; border-radius: 10px; }
.tw-mode-switch button, .tw-results-tabs button { background: transparent; border: 1px solid transparent; color: #a9b7ca; border-radius: 7px; font-size: 12px; }
.tw-mode-switch button.is-active, .tw-results-tabs button.is-active { background: #334054; border-color: #516078; color: #f3f6fc; }
#tw-squad-editor>h3 { padding-top: 13px; color: #b8c6d9; font-size: 12px; font-weight: 600; }
#tw-search { margin: 10px 0; }
#tw-rule-list { max-height: min(32vh,300px); }
.tw-rule-editor { background: #111c2b; border-color: #3a4d65; border-radius: 9px; padding: 8px 6px; }
.tw-rule-title strong { font-weight: 500; }
.tw-rule-options .tw-tier-range select { background: #1d2b3d; border-color: #42546d; border-radius: 6px; }
.tw-available-row { gap: 5px; }
.tw-available { background: #202c3d; border-color: #34445b; border-radius: 9px; padding: 8px; }
.tw-available:hover { background: #2a3b51; border-color: #617797; }
.tw-available strong { font-weight: 600; }
.tw-available small { color: #94bcae; }
.tw-balance { border-color: #34445b; background: #142030; border-radius: 9px; opacity: .75; }
.tw-balance.is-on { background: #393124; border-color: #a1824d; box-shadow: none; }
.tw-map-actions { padding-top: 17px; gap: 8px; }
.tw-map-actions button { font-size: 12px; padding: 9px 12px; }
.tw-needed-control { margin-right: auto; font-size: 11px; color: #b7c5d8; }
.tw-needed-control input { background: #101824; border-color: #42526a; }
#tw-clear.tw-clear-button { background: #82384a; border-color: #a75969; color: #fff2f4; }
#tw-clear.tw-clear-button:hover { background: #984658; }
#tw-status { color: #97afbd; font-size: 11px; }
.tw-assignments { margin-top: 20px; padding: 22px; border: 1px solid #344257; border-radius: 16px; background: #171f2b; }
.tw-assignments h2 { font-size: 17px; color: #e4ccaa; }
#tw-assignment-results>h3 { font-size: 13px; color: #acbcd0; margin: 16px 0; }
.tw-location-card { background: #111c2b; border-color: #35465e; border-radius: 12px; padding: 15px; }
.tw-location-card-head { border-bottom: 1px solid #2b3c52; margin-bottom: 12px; padding-bottom: 10px; }
.tw-location-card-head strong { font-weight: 600; font-size: 13px; }
.viewer-page .tw-assignments { margin: 0; top: 18px; max-height: calc(100vh - 36px); }
.tw-text-editor select, .tw-text-editor textarea { background: #0f1927; border-color: #41536c; }
.tw-dc-menu { background: #142134; border-color: #62728b; border-radius: 12px; }
/* Account */
.account-page { max-width: 1160px; padding-top: 10px; }
.account-page-head { gap: 22px; border-bottom: 1px solid #344257; padding: 0 0 22px; }
.account-page-head h1 { font-size: 28px; letter-spacing: -.6px; }
.account-back { padding: 8px 0; margin: 0; }
.account-grid { gap: 16px; margin: 26px 0; }
.account-game { position: relative; background: #192331; border-color: #35435a; padding: 24px; border-radius: 15px; gap: 18px; }
.account-game.selected { background: linear-gradient(115deg,#2f2b26,#1b2431 75%); border-color: #9c8053; }
.account-game.selected:before { content: ''; position: absolute; left: -1px; top: 25%; height: 50%; width: 3px; background: #e1ba77; border-radius: 3px; }
.account-game .game-portrait { width: 82px; height: 82px; }
.account-game-info strong { font-size: 18px; font-weight: 600; }
.account-game button:disabled { background: transparent; border-color: transparent; color: #e2c28e; opacity: 1; font-size: 12px; }
.account-panel { padding: 28px; background: #171f2b; border-color: #344258; border-radius: 15px; }
.account-panel h2 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.account-panel form { gap: 14px; margin-top: 22px; }
.account-panel form button[type=submit] { margin-top: 3px; }
#syncNote:empty { display: none; }
.members-list { gap: 8px; margin-top: 22px; }
.members-list>div { background: #111b29; border: 1px solid #303e53; border-radius: 9px; padding: 14px 16px; align-items: center; }
.members-list strong { font-size: 13px; font-weight: 600; }
.members-list span { font-size: 12px; }
/* Dialogs */
dialog, #picker, #fleetPicker, #datacronDialog { background: #171f2c; border: 1px solid #506078; border-radius: 18px; padding: 26px; box-shadow: 0 25px 100px #0009; }
dialog::backdrop, #datacronDialog::backdrop { background: #060b13bf; backdrop-filter: blur(8px); }
.modal-head { gap: 18px; border-bottom: 1px solid #344258; padding-bottom: 16px; margin-bottom: 16px; }
.modal-head h2, #picker .modal-head h2, #datacronDialog .modal-head h2 { font-size: 20px; margin: 0; font-weight: 600; }
.modal-head > button { border: 1px solid #3a4960; background: #222d3d; border-radius: 9px; width: 36px; height: 36px; padding: 0; flex: none; }
.picker-search-row, .fleet-picker-filters { margin: 0 0 18px; }
#unitGrid, #fleetPickerGrid { gap: 10px; padding: 3px 6px 8px 2px; }
.unit-option, #fleetPickerGrid button { background: #202b3b; border-color: #35455c; border-radius: 12px; padding: 17px 8px; gap: 10px; }
.unit-option:hover:not(:disabled), #fleetPickerGrid button:hover:not(:disabled) { background: #2b3a4f; border-color: #b89962; }
.unit-option .unit-name { font-weight: 600; line-height: 1.4; }
.unit-option small { color: #a1aec2; }
.unit-option:disabled { opacity: .4; }
.ability-choice { padding: 14px 10px; border-color: #354259; border-radius: 8px; }
.ability-choice:hover { background: #232f40; }
#toast { max-width: min(540px, calc(100vw - 32px)); background: #193a30; color: #d7f5e5; border-color: #54836c; border-radius: 12px; box-shadow: 0 12px 38px #0006; }
#toast.error { background: #48232e; color: #ffdee2; border-color: #b16a7e; }
.empty, .viewer-empty { color: #9dacbf; padding: 48px 24px; border: 1px dashed #35445c; border-radius: 14px; background: #141e2b; }
/* Sign-in has its own identity, but stays short and practical. */
.login-screen { background: radial-gradient(ellipse at 25% 35%,#1c2b3d,#0b1019 72%); padding: 40px 24px; }
.login-shell { width: min(1080px,100%); display: grid; grid-template-columns: 1.12fr 1fr; border: 1px solid #39485b; border-radius: 24px; overflow: hidden; box-shadow: 0 32px 100px #0006; }
.login-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 640px; padding: 42px; background: linear-gradient(150deg,#23334a,#111b29 75%); }
.login-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #f0f1f5; font-size: 21px; font-weight: 600; position: relative; z-index: 2; }
.login-brand small { display: block; font-size: 9px; letter-spacing: 2px; color: #b0bdd0; }
.login-intro-copy { position: relative; z-index: 2; margin-top: 67px; }
.login-intro-copy .eyebrow { font-size: 9px; letter-spacing: 1.7px; color: #ddbb85; }
.login-intro-copy h2 { font-size: clamp(30px,3.2vw,44px); line-height: 1.15; letter-spacing: -1.4px; font-weight: 600; margin: 17px 0 20px; }
.login-intro-copy p { color: #b3c0d3; font-size: 14px; line-height: 1.8; }
.login-map-art { position: absolute; width: 510px; max-width: 110%; bottom: -83px; right: -40px; transform: rotate(-16deg); opacity: .45; mask-image: linear-gradient(transparent, #000 25%,#000 70%,transparent); pointer-events: none; }
.login-map-art img { width: 100%; }
.login-intro-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; position: relative; z-index: 2; font-size: 11px; color: #c2cfe0; letter-spacing: .3px; }
.login-intro-foot i { width: 3px; height: 3px; border-radius: 50%; background: #d1ad71; }
.login-card { display: flex; flex-direction: column; justify-content: center; align-items: stretch; max-width: none; padding: 52px 42px; border: 0; border-radius: 0; background: #151c27; gap: 20px; }
.login-card > .eyebrow { color: #aab6c8; font-size: 10px; letter-spacing: 2px; }
.login-card h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.8px; font-weight: 600; margin-bottom: 8px; }
.login-card form { gap: 14px; }
.login-card input { font-size: 14px; padding: 14px 16px; min-height: 50px; background-color: #0e1621; border-radius: 10px; }
.login-card form>button { min-height: 48px; margin-top: 6px; border-radius: 10px; }
.login-card #authToggle { border: 1px solid #405068; padding: 12px; border-radius: 10px; color: #d5deea; font-size: 13px; margin-top: 0; }
.login-card #authToggle:hover { background: #243144; }
#loginError:empty { display: none; }
#loginError { font-size: 13px; line-height: 1.6; }
.auth-step h2 { font-size: 21px; }
.auth-target { gap: 15px; }
.auth-target span { font-size: 13px; color: #b5c3d5; }
/* Responsive sizing without changing the eight fleet slots into another composition. */
@media(min-width:1600px) { .tw-layout { grid-template-columns: minmax(0,1fr) 400px; } }
@media(max-width:1200px) {
  .topbar { gap: 22px; }
  #sessionLabel { max-width: 140px; }
  .slots { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
  .unit-controls { gap: 3px; }
  .relic-control button { min-width: 19px; padding: 4px; }
  .tw-layout { grid-template-columns: minmax(0,1fr) 345px; }
}
@media(max-width:1000px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 15px 20px; gap: 14px 22px; }
  .topbar .area-nav { order: 0; }
  .account { margin-left: auto; }
  #sessionLabel { display: none; }
  .section-nav > div, .section-nav #playerSections { gap: 16px; }
  .tw-layout { grid-template-columns: 1fr; }
  .tw-control-panel { position: static; min-height: 440px; max-height: 620px; }
  #tw-unit-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .viewer-page { grid-template-columns: 1fr; }
  .viewer-page .tw-assignments { position: static; max-height: none; }
  .slot .portrait, .slot .team-avatar.large { width: 68px; height: 68px; }
  .slot { padding: 13px 6px; }
  .priority-row { gap: 12px; }
}
@media(max-width:760px) {
  #mainContent { padding: 22px 16px 44px; }
  .topbar { padding: 14px 16px; gap: 12px; }
  .brand span { font-size: 17px; }
  .brand > img { width: 35px; height: 35px; }
  .brand small { font-size: 8px; letter-spacing: 1.4px; }
  .account { gap: 2px; }
  .account button { font-size: 11px; padding: 8px; }
  .topbar .area-nav { order: 3; width: 100%; justify-content: stretch; height: 43px; }
  .topbar .area-nav button { flex: 1; justify-content: center; }
  .section-nav { padding: 0 16px; height: auto; flex-wrap: nowrap; }
  .section-nav > div { flex-wrap: nowrap; }
  .section-nav button { font-size: 12px; padding: 14px 0 12px; }
  .section-nav .nav-icon { width: 16px; height: 16px; }
  .workspace-bar { padding: 10px 16px; }
  .workspace-bar .player-accounts { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 3px; }
  .guild-name { width: auto; margin-left: auto; text-align: right; font-size: 12px; }
  .guild-name:before { display: none; }
  .page-head { gap: 14px; align-items: stretch; }
  .page-head .actions { width: 100%; }
  .page-head h1 { font-size: 23px; }
  .panel { padding: 18px 14px; border-radius: 12px; }
  .fields.team-fields { grid-template-columns: 1fr; gap: 14px; }
  .slots { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
  .slot { min-height: 248px; }
  .list-tools { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .list-tools input, .list-tools select { min-width: 120px; }
  .priority-row { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .priority-row .row-copy { min-width: 130px; }
  .priority-row .row-copy strong { font-size: 14px; }
  .priority-row .rank { display: none; }
  .priority-row > .portrait.mini, .priority-row > .team-avatar { width: 44px; height: 44px; }
  .priority-row .good { margin-left: auto; }
  .row-arrows { flex-direction: row; }
  .result-topline .stat { flex: 1; min-width: 90px; padding: 12px; }
  .result-topline .stat b { font-size: 23px; }
  .result-tools input, .result-tools select { min-width: 0; flex: 1 1 140px; }
  .dc-toolbar { flex-wrap: nowrap; }
  .dc-toolbar #update { padding: 10px; font-size: 11px; }
  .tw-presets { padding: 12px; }
  .tw-presets select { min-width: 0; flex: 1 1 100%; max-width: none; }
  .tw-presets button { font-size: 11px; padding: 8px; }
  .tw-map-panel { padding: 9px; }
  .tw-map-actions { gap: 7px; }
  .tw-needed-control { flex-basis: 100%; margin-bottom: 5px; }
  .tw-map-actions button { flex: 1 1 auto; }
  .tw-control-panel { padding: 15px; }
  .tw-assignments { padding: 16px; }
  #tw-unit-list { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-game { padding: 18px; gap: 12px; }
  .account-game .game-portrait { width: 64px; height: 64px; }
  .account-page-head { flex-wrap: wrap; gap: 12px; }
  .account-page-head #accountSync { margin-left: auto; }
  .account-panel { padding: 22px; }
  .account-panels { grid-template-columns: 1fr; }
  .login-screen { padding: 24px 16px; }
  .login-shell { max-width: 500px; grid-template-columns: 1fr; border-radius: 19px; }
  .login-intro { min-height: 0; padding: 24px 28px; }
  .login-intro-copy { margin-top: 24px; }
  .login-intro-copy h2 { font-size: 28px; margin: 12px 0 0; }
  .login-intro-copy h2 br { display: none; }
  .login-intro-copy p, .login-intro-foot { display: none; }
  .login-map-art { width: 270px; bottom: -60px; right: -90px; opacity: .25; }
  .login-card { padding: 30px 28px; }
  .login-card > .eyebrow { display: none; }
  dialog, #picker, #fleetPicker, #datacronDialog { padding: 18px; border-radius: 14px; }
}
@media(max-width:480px) {
  .slots { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .slot .portrait, .slot .team-avatar.large { width: 76px; height: 76px; }
  .slot { min-height: 258px; }
  .page-head .actions button { font-size: 11px; padding: 10px; }
  .quality-tabs button { min-width: 40px; }
  .quality-panel { gap: 12px; }
  .quality-panel .panel-heading { flex-basis: 100%; }
  .thresholds label { flex: 1; min-width: 100px; }
  .icon-setting { flex: 1; min-width: 132px; padding: 8px; }
  #unitGrid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .unit-option .portrait { width: 56px; height: 56px; }
  .unit-option { min-height: 147px; padding: 11px 4px; }
  .unit-option .unit-name { font-size: 10px; }
  .unit-option small { font-size: 9px; }
  .picker-search-row, .fleet-picker-filters { flex-wrap: wrap; gap: 8px; }
  .picker-search-row .picker-filters, .fleet-picker-filters select { width: 100%; }
  .picker-search-row select { width: 100%; }
  #toast { left: 16px; right: 16px; bottom: 16px; }
}
@media(prefers-reduced-motion:reduce) { *, *:before, *:after { transition: none!important; scroll-behavior: auto!important; } }

.fleet-all-slots .fleet-core { border-top-color: #b76677; }
.fleet-all-slots .fleet-backup { border-top-color: #d1ae70; }
@media(max-width:620px) { .tw-cell__mode { font-size: clamp(6px,1.65vw,9px); line-height: 1.2; padding: .2rem; } }
.relic-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;vertical-align:middle;line-height:1;color:#fff!important;background:transparent!important;padding:0!important;border:0!important;font-size:13px!important;text-shadow:0 1px 2px #000,0 0 3px #000}
.relic-icon img{position:absolute;inset:0;width:100%!important;height:100%!important;object-fit:contain;pointer-events:none}
.relic-icon b{position:relative;z-index:1;font-size:inherit!important;color:#fff!important;font-weight:900;transform:translateY(-1px)}
.relic-icon-gold b{color:#fff8d7!important}
.relic-control .relic-icon{width:27px;height:27px}
.relic-control .relic-icon b{min-width:0}
.roster-values .relic-icon{width:29px;height:29px}
.tw-location-metrics .relic-icon{width:23px;height:23px;font-size:11px!important}
.tw-location-metrics .relic-icon img{width:100%!important;height:100%!important}
.tw-location-metrics .relic-icon b{color:#fff!important;font-size:inherit!important}
.fleet-pilot-relic{display:inline-flex;align-items:center;gap:4px}
.fleet-pilot-relic select{min-width:48px}
.fleet-result-ship .relic-icon{width:16px;height:16px;font-size:9px!important}
.tw-publish-button{background:#238b4b!important;border:1px solid #48c878!important;color:#fff!important;font-weight:800}
.tw-publish-button:hover{background:#2ba85a!important}
.tw-publish-button:disabled{opacity:.55}

.relic-badge:has(.relic-icon){background:none;padding:0}
.tw-location-metrics .relic-value{display:inline-flex;align-items:center;justify-content:center}
.tw-location-unit:not(:has(.tw-location-ship)) .tw-location-metrics{display:grid;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);align-items:center;justify-items:center;gap:2px;width:100%;min-height:34px;font-size:12px}
.tw-location-metrics .zeta-count{grid-column:1;grid-row:1;justify-self:end;gap:2px}
.tw-location-metrics .relic-value{grid-column:2;grid-row:1;justify-self:center}
.tw-location-metrics .omicron-count{grid-column:3;grid-row:1;justify-self:start;gap:2px}
.tw-location-metrics .zeta-count img,.tw-location-metrics .omicron-count img{width:17px;height:17px}
.tw-location-metrics .relic-icon{width:32px;height:32px;font-size:14px!important}
.tw-no-assignments{color:#bd828b}

/* Give the relic frame room around its number in every view. */
.relic-icon{width:36px;height:36px;font-size:12px!important}
.relic-icon img{border:0!important;border-radius:0!important;box-sizing:border-box}
.relic-control .relic-icon{width:38px;height:38px;font-size:12px!important}
.roster-values .relic-icon{width:38px;height:38px;font-size:12px!important}
.fleet-pilot-relic .relic-icon{width:36px;height:36px;font-size:12px!important}
.fleet-result-ship .relic-icon{width:23px;height:23px;font-size:9px!important}
.tw-location-unit:not(:has(.tw-location-ship)) .tw-location-metrics{grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr);min-height:38px}
.tw-location-metrics .relic-icon{width:36px;height:36px;font-size:11px!important}
.tw-location-unit:has(.tw-location-ship) .relic-icon{width:23px;height:23px;font-size:9px!important}

@media(max-width:620px){
  .tw-location-unit:not(:has(.tw-location-ship)) .tw-location-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:36px 22px;
    gap:2px 0;
    min-height:60px;
    overflow:visible;
  }
  .tw-location-metrics .relic-value{grid-column:1/-1;grid-row:1;justify-self:center}
  .tw-location-metrics .zeta-count{grid-column:1;grid-row:2;justify-self:center}
  .tw-location-metrics .omicron-count{grid-column:2;grid-row:2;justify-self:center}
  .tw-location-metrics .zeta-count img,.tw-location-metrics .omicron-count img{width:15px;height:15px}
}
