@font-face {
  font-family: 'Planner Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/ui-sans-0.ttf) format('truetype');
}
@font-face {
  font-family: 'Planner Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/ui-sans-1.ttf) format('truetype');
}
@font-face {
  font-family: 'Planner Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(assets/fonts/ui-sans-2.ttf) format('truetype');
}
@font-face {
  font-family: 'Planner Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/ui-sans-3.ttf) format('truetype');
}

:root {
  color-scheme: dark;
  --bg: #10111e; --panel: #191c2e; --panel-2: #202338;
  --line: #ffffff15; --text: #eceef6; --muted: #a4a9c0;
  --gold: #e7c68a; --teal: #93d9c5; --purple: #b8a6ef; --red: #ee98aa;
  font-family: 'Planner Sans', Arial, 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; color: var(--text); background: radial-gradient(ellipse at 45% 0, #362b4e40, transparent 65%), var(--bg); }
button, input, select { font: inherit; }
button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; line-height: 1.25; }
button:disabled { cursor: wait; opacity: .5; }
button, input, select, a { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); }
button svg { pointer-events: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 15px; font-weight: 600; } h3 { font-size: 13px; font-weight: 600; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type=checkbox] { width: 14px; height: 14px; margin: 0; accent-color: var(--gold); flex: none; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
select { appearance: none; background: #121525 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%239a9db6' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--text); border: 1px solid #ffffff24; border-radius: 6px; padding: 7px 30px 7px 10px; font-size: 13px; min-height: 34px; }
.ui-icon { display: block; width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); } .small { font-size: 12px; }
[hidden] { display: none !important; }

/* Navigation and page structure. */
.app-header { height: 56px; padding: 0 24px; display: flex; align-items: center; gap: 44px; border-bottom: 1px solid var(--line); background: #121321bc; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { font-size: 30px; color: var(--gold); line-height: 1; }
.brand strong { font-size: 17px; font-weight: 600; letter-spacing: .12em; }
.brand-sub { display: none; }
.app-header nav { display: flex; gap: 26px; align-items: center; align-self: stretch; font-size: 13px; }
.nav-active { display: flex; align-items: center; position: relative; height: 100%; color: var(--gold); }
.nav-active:after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--gold); }
.nav-button, .quiet, .text-button { padding: 6px 2px; color: var(--muted); font-size: 13px; }
.nav-button:hover, .quiet:hover, .text-button:hover { color: var(--gold); }
.text-button { color: var(--gold); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.season-tag { font-size: 12px; color: var(--purple); border: 1px solid #b8a6ef36; background: #b8a6ef08; border-radius: 5px; padding: 4px 9px; }
.workspace { max-width: 1920px; padding: 16px; margin: auto; display: grid; grid-template-columns: 212px minmax(0,1fr) 332px; gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, #1d2032, #181b2b); }
.panel-title, .section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-title { margin-bottom: 16px; min-height: 30px; }
.section-title { margin-bottom: 10px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* Shared controls: explicit padding and SVG geometry prevent glyph overflow. */
.icon-button, .close-button, .goal-delete, .must-chip button { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; flex: none; }
.icon-button { width: 30px; height: 30px; border: 1px solid #e7c68a45; color: var(--gold); border-radius: 7px; background: #e7c68a06; }
.icon-button:hover { border-color: #e7c68a90; background: #e7c68a12; }
.close-button { width: 32px; height: 32px; border: 1px solid #ffffff20; border-radius: 7px; color: var(--muted); background: #ffffff04; }
.close-button:hover { color: var(--text); background: #ffffff0a; }
.primary-button, .secondary-button, .cancel-button, .add-goal-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; font-size: 13px; min-height: 34px; }
.primary-button { width: 100%; padding: 10px 12px; min-height: 40px; background: linear-gradient(110deg,#ecd09a,#dcb778); color: #282235; border: 1px solid #efd5a1; font-weight: 600; }
.primary-button:hover { filter: brightness(1.07); }
.primary-button>span { line-height: 1; font-size: 18px; }
.secondary-button { padding: 7px 11px; border: 1px solid #ffffff26; background: #ffffff03; color: #c9cce0; flex: none; }
.secondary-button:hover { border-color: #e7c68a65; color: var(--gold); }
.cancel-button { width: 100%; padding: 7px; border: 1px solid #ee98aa50; color: var(--red); margin-top: 8px; }
.check-line, .required-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; cursor: pointer; line-height: 20px; }
.check-line { margin-top: 12px; }
.help-dot { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; font: 11px/1 Arial,sans-serif; border: 1px solid #a4a9c050; border-radius: 50%; margin-left: auto; cursor: help; }

/* Configuration column. */
.settings { padding: 16px 14px; position: sticky; top: 16px; max-height: calc(100dvh - 88px); overflow: auto; }
.number-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.number-grid>label { font-size: 12px; color: var(--muted); }
.number-field { display: flex; align-items: center; gap: 5px; height: 46px; padding: 0 9px; margin-top: 7px; border: 1px solid #ffffff22; background: #101322a0; border-radius: 7px; }
.number-field:focus-within { border-color: var(--gold); }
.number-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 600 23px/1.2 Arial,sans-serif; }
.number-field span { font-size: 12px; color: var(--muted); }
.section-symbol { color: var(--gold); margin-right: 6px; }
.must-list { display: flex; flex-direction: column; gap: 7px; min-height: 44px; max-height: 170px; overflow: auto; }
.empty-must { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px dashed #ffffff26; border-radius: 7px; color: var(--muted); font-size: 12px; padding: 8px 5px; }
.empty-must:hover { color: var(--gold); border-color: #e7c68a80; }
.must-chip { display: flex; align-items: center; gap: 7px; padding: 5px; background: #e7c68a07; border: 1px solid #e7c68a30; border-radius: 6px; font-size: 12px; }
.must-chip>span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.must-chip img { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; }
.must-chip button { margin-left: auto; width: 24px; height: 24px; color: var(--muted); }
.restriction-title { color: var(--muted); margin-bottom: 10px; }
.restriction-list { display: flex; flex-direction: column; gap: 8px; }
.restriction-button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; font-size: 12px; min-height: 38px; background: #ffffff02; }
.restriction-button>span:first-child { display: flex; align-items: center; gap: 8px; }
.restriction-button:hover { background: #ffffff07; border-color: #ffffff30; }
.ban-symbol { display: inline-flex; align-items: center; color: var(--muted); }
.counter { display: inline-flex; align-items: center; justify-content: center; font: 12px/1.3 Arial,sans-serif; min-width: 22px; padding: 1px 5px; border: 1px solid #ffffff20; border-radius: 4px; color: var(--muted); }
.counter.has-bans { color: var(--red); border-color: #ee98aa45; background: #ee98aa08; }
.ban-summary { margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.ban-summary:empty { display: none; }
.time-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.solve-actions { margin-top: 16px; }
.solve-order { display: none; }
.utility-actions { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; }
.utility-actions button { font-size: 12px; }

/* Result header and metrics. */
.board-section { min-width: 0; position: relative; }
.board-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-bottom: 12px; padding-right: 0; }
.board-heading .eyebrow, .board-heading p { display: none; }
.board-heading h1 { font-size: 19px; line-height: 1.3; letter-spacing: .03em; font-weight: 600; }
.title-spark { color: var(--gold); font-size: 18px; margin-left: 8px; }
.status-line { display: flex; align-items: center; gap: 9px; position: absolute; right: 0; top: 3px; font-size: 12px; min-height: 28px; }
.status-line>span+span { display: none; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--teal); border: 1px solid #93d9c534; background: #93d9c508; border-radius: 20px; padding: 4px 9px; font-size: 12px; line-height: 18px; }
.status-badge.partial { color: var(--gold); border-color: #e7c68a40; background: #e7c68a08; }
.status-badge.loading { color: var(--purple); border-color: #b8a6ef40; background: #b8a6ef08; }
.spinner { display: inline-block; width: 13px; height: 13px; border: 1.5px solid #b8a6ef40; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box, .stale-notice { padding: 10px 12px; font-size: 12px; line-height: 1.7; margin-bottom: 12px; border-radius: 7px; }
.error-box { color: #ffc2cc; background: #ee98aa09; border: 1px solid #ee98aa35; }
.stale-notice { color: var(--gold); background: #e7c68a08; border-left: 2px solid var(--gold); }
.stats-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 10px 11px; border: 1px solid var(--line); background: #1b1f3090; border-radius: 8px; min-width: 0; }
.stat:first-child { border-color: #e7c68a30; background: #e7c68a05; }
.stat-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stat-value { font: 600 24px/1.2 Arial,sans-serif; margin-top: 5px; white-space: nowrap; }
.stat-value em { font-size: 12px; font-weight: 400; font-style: normal; color: var(--muted); margin-left: 4px; }
.stat:first-child .stat-value, .stat:nth-child(3) .stat-value { color: var(--gold); }
.stat-sub { display: none; }

/* Character cards: images, innate traits and equipment occupy distinct layers. */
.battlefield { border: 1px solid #a18cc43b; border-radius: 10px; background: radial-gradient(ellipse at 40% 0,#6a4f9a1a,transparent 70%),#171a2d; padding: 14px; }
.battlefield-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 22px; }
.field-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #d7d5e9; }
.field-label>span { color: var(--purple); display: inline-flex; align-items: center; }
.battlefield-top .small { font-size: 12px; }
.roster-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px 10px; align-items: stretch; }
.role-card { padding: 6px; min-width: 0; background: #0d112037; border: 1px solid #ffffff13; border-radius: 8px; --rarity: #a9b4c6; }
.role-card[data-cost="2"] { --rarity: #82c1a5; } .role-card[data-cost="3"] { --rarity: #82b6ed; } .role-card[data-cost="4"] { --rarity: #b59ae9; } .role-card[data-cost="5"] { --rarity: #debf82; }
.portrait-wrap { position: relative; height: clamp(96px,7.7vw,124px); border: 1px solid color-mix(in srgb,var(--rarity) 45%,transparent); border-bottom: 2px solid var(--rarity); border-radius: 5px; background: #292c43; overflow: hidden; }
.portrait-wrap>img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; display: block; transition: transform .2s; }
.role-card:hover .portrait-wrap>img { transform: scale(1.035); }
.portrait-wrap:after { content: ''; position: absolute; inset: 42% 0 0; background: linear-gradient(transparent,#101323f5); pointer-events: none; }
.cost-badge, .locked-badge { position: absolute; top: 5px; z-index: 1; font-size: 11px; line-height: 17px; padding: 0 5px; border-radius: 4px; white-space: nowrap; }
.cost-badge { left: 5px; color: var(--rarity); border: 1px solid color-mix(in srgb,var(--rarity) 30%,transparent); background: #101323dd; }
.locked-badge { right: 5px; color: #322739; background: var(--gold); }
.portrait-caption { position: absolute; bottom: 5px; left: 6px; right: 5px; z-index: 1; }
.role-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-position { font-size: 11px; color: #c2c6db; margin-top: 1px; }
.native-traits { display: flex; align-items: center; gap: 4px; height: 28px; }
.native-icon { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border: 1px solid #ffffff15; border-radius: 4px; background: #ffffff03; font-size: 11px; color: var(--purple); }
.native-icon img { width: 16px; height: 16px; object-fit: contain; }
.emblem-slots { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
.equipment { min-width: 0; min-height: 48px; padding: 3px 0; border: 1px solid #d9bd7948; border-radius: 4px; background: #e7c68a06; text-align: center; }
.equipment img { width: 26px; height: 26px; object-fit: contain; display: block; margin: 0 auto 2px; }
.equipment span { display: block; font-size: 11px; line-height: 14px; color: #dccba9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equipment.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px dashed #ffffff1c; background: #ffffff02; color: #7d849e; }
.equipment.empty b { display: flex; align-items: center; justify-content: center; height: 24px; font-weight: 400; }
.equipment.empty .ui-icon { width: 14px; height: 14px; }
.equipment.empty span { color: #848aa4; }
.role-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px; margin-top: 6px; padding-top: 5px; border-top: 1px solid #ffffff0b; }
.role-controls button { min-height: 24px; padding: 3px 2px; font-size: 12px; color: #a4abc5; text-align: left; white-space: nowrap; }
.role-controls button:last-child { text-align: right; }
.role-controls button:hover, .role-controls .is-must { color: var(--gold); }
.field-bottom { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; line-height: 1.6; color: #9399b0; margin-top: 12px; text-align: center; }
.field-diamond { color: #a793c6; }
.emblem-overview { padding: 12px 14px; margin-top: 14px; }
.emblem-overview .section-title { margin-bottom: 10px; }
.emblem-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.emblem-pill { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; font-size: 12px; border: 1px solid #ffffff16; border-radius: 5px; background: #11152460; }
.emblem-pill img { width: 25px; height: 25px; object-fit: contain; }
.emblem-pill b { font: 500 12px/1.2 Arial,sans-serif; margin-left: 3px; color: var(--gold); }
.data-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; color: #949bb2; font-size: 11px; line-height: 1.6; margin-top: 10px; }
.data-note a { color: #adb3cb; }

/* Goal controls have a title row and a separate metadata/options row. */
.goals { padding: 14px; display: flex; flex-direction: column; position: sticky; top: 16px; max-height: calc(100dvh - 88px); }
.goals .panel-title { margin-bottom: 8px; }
.goal-legend { font-size: 12px; color: var(--muted); line-height: 1.6; }
.priority-dot { color: var(--gold); font-size: 10px; margin-right: 3px; }
.require-all { padding-bottom: 12px; margin-top: 10px; border-bottom: 1px solid var(--line); }
.goal-list { overflow: auto; min-height: 0; scrollbar-gutter: stable; padding-right: 5px; margin-top: 1px; }
.goal-row { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'head head' 'counts options' 'progress progress'; column-gap: 7px; row-gap: 6px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.goal-row-head { grid-area: head; display: flex; align-items: center; gap: 8px; min-width: 0; }
.goal-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; object-fit: contain; flex: none; }
.goal-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; }
.goal-need { width: 38px; height: 28px; padding: 3px; color: var(--text); background: #101525; border: 1px solid #ffffff26; border-radius: 5px; text-align: center; font: 13px/1.2 Arial,sans-serif; }
.goal-need:focus { border-color: var(--gold); outline-offset: 2px; }
.goal-delete { width: 26px; height: 28px; border-radius: 5px; color: #929ab3; }
.goal-delete:hover { color: var(--red); background: #ee98aa0b; }
.goal-delete .ui-icon { width: 14px; height: 14px; }
.goal-options { grid-area: options; display: flex; align-items: center; gap: 9px; }
.priority-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 25px; padding: 3px 6px; font-size: 12px; line-height: 17px; border: 1px solid #ffffff22; border-radius: 5px; color: #a0a9c2; white-space: nowrap; }
.priority-toggle.active { color: var(--gold); border-color: #e7c68a48; background: #e7c68a09; }
.required-toggle { font-size: 12px; gap: 5px; white-space: nowrap; }
.goal-progress { grid-area: progress; height: 3px; display: flex; overflow: hidden; background: #ffffff0c; border-radius: 3px; }
.progress-native { background: #8d80c2; } .progress-emblems { background: #d8bb7e; }
.goal-row.achieved .progress-native { background: #5aaf9e; } .goal-row.achieved .progress-emblems { background: #a2d6ba; }
.goal-counts { grid-area: counts; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: 11px; line-height: 17px; color: #a0a7bf; min-width: 0; }
.goal-counts span { white-space: nowrap; }.goal-counts b { font: 500 12px/17px Arial,sans-serif; white-space: nowrap; color: #c5cade; }
.goal-row.achieved .goal-counts b { color: var(--teal); }
.goal-native-note { grid-column: 1/-1; font-size: 11px; color: var(--muted); }
.add-goal-button { width: 100%; padding: 8px; border: 1px dashed #b8a6ef45; color: #b9b0d3; margin-top: 12px; flex: none; }
.add-goal-button:hover { color: var(--gold); border-color: var(--gold); }
.goal-note { display: none; }

/* Dialogs use a fixed header/footer and a scrollable, consistently spaced grid. */
dialog { padding: 0; border: 1px solid #ffffff27; border-radius: 12px; background: #191d30; color: var(--text); box-shadow: 0 26px 100px #0009; max-width: calc(100vw - 40px); max-height: calc(100dvh - 48px); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #090d1bd0; backdrop-filter: blur(5px); }
.picker-dialog { width: 1060px; }.emblem-dialog,.target-dialog { width: 840px; }.help-dialog { width: 680px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 20px 16px; flex: none; }
.dialog-head .eyebrow { display: none; }.dialog-head h2 { font-size: 17px; line-height: 28px; }
.dialog-head p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-top: 5px; }
.picker-toolbar { display: flex; gap: 12px; padding: 0 20px; flex: none; }
.search-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; background: #111626; border: 1px solid #ffffff25; border-radius: 7px; padding: 0 10px; }
.search-field:focus-within { border-color: #e7c68a80; }.search-field>span { display: inline-flex; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; flex: 1; border: 0; background: none; outline: none; color: var(--text); padding: 9px 0; font-size: 13px; }
.picker-tabs { display: flex; align-items: center; gap: 8px; padding: 12px 20px; flex: none; }
.picker-tabs button { padding: 6px 9px; min-height: 29px; font-size: 12px; color: var(--muted); border: 1px solid transparent; border-radius: 5px; }
.picker-tabs button.active { color: var(--gold); border-color: #e7c68a38; background: #e7c68a09; }.picker-tabs>span { margin-left: auto; }
.picker-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 12px; padding: 0 20px 20px; overflow-y: auto; min-height: 0; align-content: start; grid-auto-rows: max-content; }
.picker-card { border: 1px solid #ffffff1c; background: #11172770; border-radius: 7px; overflow: hidden; min-width: 0; }
.picker-card.must { border-color: #e7c68a90; background: #e7c68a08; }.picker-card.banned { border-color: #ee98aa70; background: #ee98aa05; }
.picker-picture { position: relative; display: block; width: 100%; height: 96px; padding: 0; overflow: hidden; background: #2b3048; }
.picker-picture img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; display: block; }
.picker-card.banned .picker-picture img { opacity: .5; filter: grayscale(.7); }
.picker-name { font-size: 13px; font-weight: 500; padding: 7px 7px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-native { font-size: 11px; color: #a5adc5; line-height: 18px; height: 39px; padding: 0 7px 3px; overflow: hidden; }
.picker-card-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--line); }
.picker-card-actions button { font-size: 12px; min-height: 31px; padding: 6px 2px; color: var(--muted); }
.picker-card-actions button+button { border-left: 1px solid var(--line); }.picker-card-actions button:hover { background: #ffffff06; }
.picker-card-actions .on-must { color: var(--gold); background: #e7c68a08; }.picker-card-actions .on-ban { color: var(--red); background: #ee98aa08; }
.dialog-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 20px; border-top: 1px solid var(--line); background: #11152650; }
.dialog-footer>span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.compact { width: auto; min-width: 102px; min-height: 34px; padding: 8px 14px; flex: none; }
.emblem-picker,.target-picker { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; padding: 0 20px 20px; overflow: auto; min-height: 0; }
.emblem-option,.target-option { position: relative; display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 9px 8px; border: 1px solid #ffffff22; border-radius: 7px; background: #11162660; text-align: left; font-size: 13px; }
.emblem-option:hover,.target-option:hover { background: #ffffff06; border-color: #ffffff45; }
.emblem-option img,.target-option img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.emblem-option>span,.target-option>span { min-width: 0; }.emblem-option small,.target-option small { display: block; font-size: 11px; line-height: 1.5; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.emblem-option.banned { color: var(--red); border-color: #ee98aa80; background: #ee98aa08; }.emblem-option.banned img { opacity: .6; filter: grayscale(.5); }
.target-option.selected { color: var(--gold); border-color: #e7c68a70; background: #e7c68a08; }.target-option.selected:after { content: '✓'; position: absolute; top: 3px; right: 6px; font: 12px/1 Arial,sans-serif; color: var(--gold); }
.help-content { overflow: auto; padding: 0 20px 20px; font-size: 14px; line-height: 1.9; color: #c5cbdf; }.help-content h3 { font-size: 14px; color: var(--gold); margin: 16px 0 6px; }.help-content p { margin-bottom: 10px; }
.empty-message { grid-column: 1/-1; padding: 32px 12px; color: var(--muted); text-align: center; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); background: #27263cf7; border: 1px solid #e7c68a50; border-radius: 8px; padding: 11px 16px; font-size: 13px; box-shadow: 0 8px 35px #0006; z-index: 100; }
body.busy #settings-fields,body.busy #goal-list { opacity: .7; } body.stale .status-badge { color: var(--muted); border-color: #ffffff25; background: #ffffff04; }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-thumb { border-radius: 7px; background: #55516d; } ::-webkit-scrollbar-track { background: transparent; }

@media(min-width:1600px) { .workspace { grid-template-columns: 226px minmax(0,1fr) 346px; gap: 18px; padding: 18px; }.portrait-wrap { height: 124px; } }
@media(max-width:1280px) and (min-width:761px) {
 .workspace { grid-template-columns: 208px minmax(0,1fr); gap: 14px; }.goals { grid-column: 1/-1; position: static; max-height: none; }
 .goal-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; overflow: visible; }.goal-legend { display: none; }
 .roster-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }.portrait-wrap { height: 112px; }.picker-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
@media(max-width:760px) {
 .app-header { height: 56px; padding: 0 16px; gap: 16px; }.app-header nav { display: none; }.brand-mark { font-size: 27px; }.brand strong { font-size: 16px; }.header-right { gap: 12px; }.season-tag { font-size: 11px; padding: 3px 7px; }.header-right .quiet { font-size: 12px; }
 .workspace { display: flex; flex-direction: column; gap: 16px; padding: 14px; }.settings,.goals { width: 100%; position: static; max-height: none; padding: 16px; }.board-section { width: 100%; }.settings .panel-title { margin-bottom: 12px; }
 .number-field { height: 46px; }.must-list { min-height: 42px; flex-direction: row; flex-wrap: wrap; max-height: 160px; }.empty-must { width: 100%; }.must-chip { width: auto; }.restriction-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }.restriction-button { font-size: 12px; padding: 9px; }
 .divider { margin: 14px 0; }.solve-actions { display: grid; grid-template-columns: 1fr; }.primary-button { min-height: 42px; }.utility-actions { margin-top: 12px; padding-top: 8px; }
 .board-heading { min-height: 34px; margin-bottom: 10px; }.board-heading h1 { font-size: 18px; }.title-spark { display: none; }.status-line { position: static; margin: 0 0 10px; min-height: 28px; }.status-line>span+span { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 .stats-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }.stat { padding: 9px; }.stat-label { font-size: 12px; }.stat-value { font-size: 22px; }.stat-value em { font-size: 11px; }
 .battlefield { padding: 10px; }.battlefield-top { gap: 6px; margin-bottom: 10px; }.field-label { font-size: 12px; gap: 5px; }.battlefield-top .small { font-size: 11px; }.roster-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px 7px; }.role-card { padding: 4px; border-radius: 6px; }.portrait-wrap { height: 96px; }.portrait-caption { left: 4px; right: 3px; }.role-name { font-size: 12px; }.role-position { font-size: 10px; }.cost-badge,.locked-badge { font-size: 10px; padding: 0 3px; top: 3px; }.cost-badge { left: 3px; }.locked-badge { right: 3px; }
 .native-traits { height: 25px; gap: 3px; }.native-icon { width: 17px; height: 17px; }.native-icon img { width: 15px; height: 15px; }.emblem-slots { gap: 3px; }.equipment { min-height: 45px; padding: 3px 0; }.equipment img { width: 22px; height: 22px; }.equipment span { font-size: 10px; line-height: 13px; }.role-controls { gap: 3px; margin-top: 5px; padding-top: 4px; }.role-controls button { font-size: 10px; min-height: 25px; padding: 3px 0; }.field-bottom { font-size: 11px; gap: 5px; margin-top: 10px; }.field-diamond { display: none; }
 .emblem-overview { padding: 12px; margin-top: 12px; }.emblem-summary { gap: 7px; }.emblem-pill { font-size: 12px; padding-right: 7px; }.emblem-pill img { width: 23px; height: 23px; }.data-note { flex-direction: column; font-size: 11px; }
 .goals .goal-list { overflow: visible; padding-right: 0; }.goal-row { padding: 12px 0; }.goal-name { font-size: 14px; }.goal-counts { font-size: 12px; }.goal-counts b { font-size: 12px; }.goal-options { gap: 10px; }.priority-toggle,.required-toggle { font-size: 12px; }
 dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 10px; }.dialog-head { padding: 16px; gap: 12px; }.dialog-head h2 { font-size: 16px; }.dialog-head p { font-size: 12px; }.close-button { width: 32px; height: 32px; }.picker-toolbar { padding: 0 16px; gap: 8px; }.picker-toolbar select { padding-left: 7px; padding-right: 24px; max-width: 100px; font-size: 12px; }.search-field { gap: 6px; padding: 0 8px; }.search-field input { font-size: 12px; }
 .picker-tabs { padding: 10px 16px; gap: 4px; }.picker-tabs button { padding: 6px; font-size: 12px; }.picker-tabs>span { font-size: 11px; }.picker-grid { padding: 0 16px 16px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px 8px; }.picker-picture { height: 82px; }.picker-name { font-size: 12px; padding: 6px 5px 3px; }.picker-native { font-size: 10px; padding-left: 5px; padding-right: 5px; }.picker-card-actions button { font-size: 12px; min-height: 34px; }
 .dialog-footer { padding: 12px 16px; gap: 12px; }.dialog-footer>span { font-size: 11px; }.compact { min-width: 94px; min-height: 36px; padding: 8px 12px; }.emblem-picker,.target-picker { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 0 16px 16px; }.emblem-option,.target-option { font-size: 12px; min-height: 66px; padding: 8px; gap: 7px; }.emblem-option img,.target-option img { width: 28px; height: 28px; }.help-content { padding: 0 16px 16px; }
}
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { animation-duration: .01ms!important; transition: none!important; } }

/* Per-character emblem capacity, kept on its own row for narrow cards. */
.limit-settings-button { width: 100%; margin-top: 10px; }
.role-limit { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 7px 0 1px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 6px; }
.role-limit select { min-height: 28px; width: 52px; flex: none; padding: 3px 15px 3px 5px; background-position: right 5px center; font-size: 11px; }
.role-limit.limited { color: var(--gold); }
.picker-card .role-limit { padding: 7px; margin: 0; font-size: 12px; }
.picker-card .role-limit select { width: 54px; }
@media(max-width:760px) {
 .role-limit { font-size: 10px; gap: 2px; }
 .role-limit select { width: 45px; font-size: 10px; padding-left: 3px; }
 .picker-card .role-limit { font-size: 10px; padding: 7px 5px; }
 .picker-card .role-limit select { width: 45px; }
}

@media(max-width:760px) { .role-limit { flex-wrap: wrap; row-gap: 5px; }.role-limit select { margin-left: auto; } }

/* Target presets and personal target library. */
.target-presets { display: grid; gap: 8px; margin-bottom: 14px; }
.target-presets-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.target-presets-row button { min-height: 34px; padding: 7px 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; }
.target-presets-row button:hover { border-color: #e7c68a70; background: #e7c68a0a; }
.target-presets-row .preset-save-button { color: var(--gold); }
.preset-library-button { color: var(--muted); }
.my-targets-dialog { width: 620px; }
.target-save-form { margin: 0 20px 16px; flex: none; }
.target-save-form>label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.target-save-form>div { display: flex; gap: 10px; }
.target-save-form input { min-width: 0; flex: 1; height: 38px; padding: 8px 10px; border: 1px solid #ffffff24; border-radius: 6px; background: #121525; color: var(--text); font-size: 13px; }
.target-save-form button { width: auto; flex: none; padding: 8px 12px; }
#target-save-error { color: var(--red); font-size: 12px; margin-top: 6px; }
#target-save-error:empty { display: none; }
.saved-target-list { padding: 0 20px 16px; overflow-y: auto; min-height: 0; }
.saved-target-row { display: flex; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.saved-target-row>div { min-width: 0; flex: 1; }
.saved-target-row strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.saved-target-row span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.saved-target-row .secondary-button { padding: 6px 12px; flex: none; }
.saved-target-delete { color: var(--muted); padding: 8px 2px; flex: none; font-size: 12px; }.saved-target-delete:hover { color: var(--red); }
@media(max-width:760px) { .target-save-form { margin: 0 16px 16px; }.saved-target-list { padding: 0 16px 16px; }.target-save-form>div { gap: 8px; }.target-save-form button { padding: 8px; font-size: 12px; }.saved-target-row { gap: 8px; } }
