/* Shared interface system. Skill card visuals are intentionally left to the existing catalog styles. */
:root {
  --ui-ink: #25332a;
  --ui-muted: #66736a;
  --ui-subtle: #879188;
  --ui-line: #dce5de;
  --ui-line-strong: #c9d7cc;
  --ui-page: #f3f6f3;
  --ui-surface: #fff;
  --ui-surface-soft: #f7faf7;
  --ui-green: #2f8051;
  --ui-green-dark: #226c42;
  --ui-green-soft: #eaf4ed;
  --ui-focus: #5277d5;
  color-scheme: light;
}

html { background: var(--ui-page); scroll-padding-top: 76px; }
body { min-width: 320px; color: var(--ui-ink); background: var(--ui-page); font-size: 14px; line-height: 1.5; overflow-x: clip; }
button, select, input { font-family: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #5277d566; outline-offset: 2px; }
button:disabled, select:disabled { cursor: not-allowed; }

.topbar { position: sticky; top: 0; z-index: 80; height: 64px; padding-inline: max(calc((100vw - 1280px)/2), 28px); gap: 38px; border-color: var(--ui-line); background: #fff; box-shadow: 0 1px 5px #20362908; }
.brand { color: var(--ui-ink); }
.logo { background: #5969d5; }
.topbar nav { gap: 24px; }
.topbar nav a.active { color: var(--ui-green-dark); }
.topbar nav a.active::after { background: var(--ui-green); }
.usage-guide { max-width: 1040px; margin: 0 auto; padding: 34px 24px 48px; color: var(--ui-ink); }
.usage-guide[hidden], .planner-main[hidden] { display: none !important; }
body:has(.usage-guide:not([hidden])) .summary { display: none !important; }
.usage-guide-head { margin: 0 0 24px; }
.usage-guide-kicker { color: var(--ui-green); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.usage-guide-head h1 { margin: 5px 0 6px; font-size: 26px; line-height: 1.2; }
.usage-guide-head p { margin: 0; color: var(--ui-muted); font-size: 14px; line-height: 1.6; }
.usage-flow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.usage-step, .usage-legend, .usage-more { border: 1px solid var(--ui-line); border-radius: 14px; background: #fff; }
.usage-step { display: flex; align-items: flex-start; gap: 12px; min-height: 118px; padding: 16px 14px; }
.usage-step>span { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 9px; background: var(--ui-green-soft); color: var(--ui-green-dark); font-size: 11px; font-weight: 850; }
.usage-step h2, .usage-legend h2, .usage-more h2 { margin: 2px 0 6px; font-size: 14px; line-height: 1.35; }
.usage-step p, .usage-more p { margin: 0; color: var(--ui-muted); font-size: 12px; line-height: 1.55; }
.usage-guide-details { display: grid; grid-template-columns: .9fr 1.1fr; gap: 12px; margin-top: 14px; }
.usage-legend, .usage-more { padding: 15px 17px; }
.usage-legend>p { display: flex; align-items: center; gap: 9px; margin: 8px 0 0; color: #526257; font-size: 12px; }
.usage-mark { width: 30px; height: 18px; flex: none; border: 2px solid #d9dfe5; border-radius: 5px; background: #f1f2f4; }
.usage-mark.blue { border-color: #547bd2; background: #eef2ff; }
.usage-mark.plain { border-color: #e1e5e2; background: #fff; }
.usage-mark.gray { border-color: #d4d6d8; background: #e9eaec; }
.usage-legend b { color: #26372c; }
.usage-more p+p { margin-top: 8px; }
.usage-return { display: block; min-height: 44px; margin: 16px auto 0; padding: 0 20px; border: 0; border-radius: 10px; background: var(--ui-green); color: #fff; font-size: 13px; font-weight: 800; }
.usage-return:hover { background: var(--ui-green-dark); }
.topbar nav a { min-width: 64px; color: var(--ui-muted); font-size: 14px; }
.topbar nav a.active { color: var(--ui-green-dark); }
.topbar nav a.active:after { height: 3px; background: var(--ui-green); }
.help { width: 40px; height: 40px; border-radius: 10px; color: var(--ui-muted); }
.help:hover { background: var(--ui-surface-soft); color: var(--ui-green-dark); }

main.planner-main { max-width: 1280px; padding: 26px 20px 38px; }
.setup { padding: 22px 24px 24px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-surface); box-shadow: 0 4px 14px #20362908; }
.section-head { min-height: 40px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e9efea; }
.section-head strong { color: var(--ui-ink); font-size: 17px; letter-spacing: -.02em; }
.section-head>button { min-height: 38px; border-color: var(--ui-line); border-radius: 9px; color: var(--ui-muted); font-size: 12px; }
.section-head>button:hover { border-color: var(--ui-line-strong); background: var(--ui-surface-soft); }
.plan-actions { gap: 7px; }
.plan-actions button { min-height: 38px; padding: 0 11px; border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; color: var(--ui-muted); font-size: 11px; font-weight: 650; }
.plan-actions button:hover { border-color: #a9cbb2; background: var(--ui-green-soft); color: var(--ui-green-dark); }

.preset-bar { min-height: 58px; margin: 0 0 16px; padding: 10px 12px; gap: 9px; border: 1px solid #e3e8f0; border-radius: 12px; background: #f7f8fc; }
.preset-bar>strong { color: #55617a; font-size: 12px; }
.preset-bar button, .preset-bar select { min-height: 38px; border-radius: 9px; font-size: 12px; }
.preset-bar .course-select-trigger { min-height: 40px; border-color: var(--ui-line); background: #fff; }
.preset-bar button:disabled { border-color: #e5e8ec; background: #f4f5f6; color: #9ba39d; }
.preset-bar button:not(:disabled) { border-color: var(--ui-line); background: #fff; color: var(--ui-muted); }
.preset-bar button:not(:disabled):hover { background: var(--ui-green-soft); color: var(--ui-green-dark); }

.config-grid { gap: 18px 22px; }
.config-grid>.character-block>label, .supports-block .picker-heading { color: var(--ui-green-dark); }
.config label { margin-bottom: 8px; color: #526257; font-size: 12px; font-weight: 750; }
.config label svg { width: 15px; height: 15px; }
.character-block .select-card { margin: 8px 0 14px !important; }
.select-input, .scenario-choice select { min-height: 42px; border-color: var(--ui-line); border-radius: 10px; background: #fff; }
.select-input:hover, .scenario-choice select:hover { border-color: #aec8b3; }
.supports-block { padding: 14px 16px; border: 1px solid #e1e8e2; border-radius: 14px; background: #fbfcfb; }
.supports-block .picker-heading { margin-bottom: 10px; }
.supports-block .picker-heading label { font-size: 14px; }
.supports-block .picker-toggle { min-height: 40px; padding: 0 13px; border: 1px solid var(--ui-green); border-radius: 10px; background: var(--ui-green); color: #fff; font-size: 13px; font-weight: 750; }
.supports-block .picker-toggle:hover { background: var(--ui-green-dark); }
.scenario-choice { margin: 8px 0 14px !important; }
.scenario-choice>span { color: var(--ui-muted); font-size: 12px; font-weight: 700; }
.scenario-choice .course-select-trigger { min-height: 44px; border-color: var(--ui-line); border-radius: 10px; background: #fff; }
.scenario-choice .course-select-trigger:hover { border-color: #aec8b3; }

.race-condition-row { margin-top: 12px; padding: 14px; gap: 12px 16px; border-color: var(--ui-line); border-radius: 14px; background: #f8fbf8; }
.race-condition-row .course-select-trigger { min-height: 42px; border-color: var(--ui-line); border-radius: 10px; background: #fff; font-size: 14px; }
.race-condition-row .race-choice>span, .race-condition-row .course-select-field>span { margin-bottom: 7px; color: #526257; font-size: 12px; }
.race-condition-row .turn-readonly { min-height: 32px; border-color: var(--ui-line); border-radius: 9px; color: var(--ui-muted); }
.race-condition-row .choice-pills { gap: 6px; }
.race-condition-row .choice-pills button { min-height: 38px; height: auto; padding: 6px 8px; border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; color: #4c5a50; font-size: 12px; font-weight: 650; }
.race-condition-row .choice-pills button:hover:not(:disabled) { border-color: #9fc5a8; background: #f1f8f2; }
.race-condition-row .choice-pills button.selected { border-color: var(--ui-green); background: var(--ui-green); color: #fff; box-shadow: 0 1px 2px #1b62351f; }
.race-condition-row .choice-pills button:disabled { border-style: dashed; border-color: #d8ded9; background: #f1f3f1; color: #8d9890; opacity: 1; }
.race-condition-row .season-choice-icon { width: 17px; height: 26px; }
.character-aptitude-filters { grid-template-columns: repeat(3, minmax(112px, 132px)); justify-content: start; gap: 10px 12px; }
.character-aptitude-filters label { gap: 6px; color: var(--ui-ink); font-size: 12px; }
.character-aptitude-filters select { width: 100%; height: 36px; padding-inline: 10px; font-size: 13px; font-weight: 600; }
.topbar .brand > span:last-child { color: var(--ui-ink); font-size: 15px; letter-spacing: 0; white-space: nowrap; }
.knowledge-setting { min-height: 62px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; }
.knowledge-setting>label { color: var(--ui-ink); font-size: 13px; font-weight: 750; }
.knowledge-help { color: var(--ui-subtle); font-size: 11px; }
.knowledge-options { gap: 5px; padding: 4px; border-color: #e7ece8; border-radius: 10px; background: #f5f7f5; }
.knowledge-options button { min-height: 38px; height: auto; border-radius: 8px; font-size: 12px; }
.knowledge-options button.selected { border-color: var(--ui-green); background: var(--ui-green); color: #fff; box-shadow: none; }
.knowledge-options button.selected small { color: #e5f2e9; }
.knowledge-options button small { color: var(--ui-subtle); font-size: 10px; }

.skill-area { margin-top: 30px; }
.list-head { margin-bottom: 14px; }
.list-head h2 { color: var(--ui-ink); font-size: 22px; font-weight: 800; }
.list-head h2 small { color: #58645d; background: #e9efea; font-size: 10px; }
.list-head p { color: var(--ui-muted); font-size: 12px; }
.legend-skill-card { border-radius: 10px; }
.legend-skill-card b { color: var(--ui-ink); }
.legend-skill-card small { color: var(--ui-muted); }
.bulk-hint-select { padding: 10px 12px; border-color: #dbe8de; border-radius: 12px; background: #fff; }
.bulk-hint-select>label { color: #34463a; font-size: 12px; font-weight: 750; }
.bulk-hint-options { gap: 5px; }
.bulk-hint-options button { min-width: 43px; min-height: 38px; height: auto; border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; color: #4c5b51; font-size: 12px; font-weight: 700; }
.bulk-hint-options button.active { border-color: var(--ui-green); background: var(--ui-green); color: #fff; box-shadow: none; }
.catalog-controls { gap: 9px; margin: 14px 0 8px; padding: 10px; border-color: var(--ui-line); border-radius: 12px; background: #fff; }
.catalog-search { min-height: 42px; height: 42px; padding-inline: 11px; border-color: var(--ui-line); border-radius: 9px; font-size: 13px; }
.catalog-search input { font-size: 13px; }
.catalog-search input::placeholder { color: #849087; }
.catalog-filters { display: flex; flex: none; gap: 6px; }
.catalog-filters button, .catalog-actions button { min-height: 38px; padding: 0 12px; border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; color: #526157; font-size: 12px; font-weight: 700; white-space: nowrap; }
.catalog-filters button:hover, .catalog-actions button:hover { border-color: #a9c8ae; background: var(--ui-green-soft); color: var(--ui-green-dark); }
.catalog-filters button.active { border-color: var(--ui-green); background: var(--ui-green); color: #fff; }
.catalog-filters button.factor-requirements-filter.active { border-color: #376baf; background: #376baf; }
.category { margin-top: 24px; }
.category-head { min-height: 30px; margin-bottom: 9px; gap: 9px; }
.category-head h3 { color: #304137; font-size: 15px; font-weight: 800; }
.category-head>i { background: #dce5de; }
.category-head>small { color: var(--ui-muted); font-size: 11px; }
.cat-icon { width: 27px; height: 27px; border-radius: 8px; }
.factor-tier-panel { border-color: var(--ui-line); border-radius: 14px; background: #fbfcfb; }
.factor-tier-heading strong { color: var(--ui-ink); font-size: 15px; }
.factor-tier-heading small { color: var(--ui-muted); font-size: 11px; }
.toast { border: 1px solid #c8ddce; border-radius: 12px; background: #fff; color: var(--ui-ink); box-shadow: 0 8px 24px #2036291a; }

.summary { border-color: var(--ui-line); background: #fffffffa; box-shadow: 0 -3px 14px #2036290c; }
.summary-content { max-width: 1280px; min-height: 78px; height: auto; padding-inline: 20px; }
.selection strong { color: var(--ui-ink); font-size: 12px; }
.selection small { color: var(--ui-muted); font-size: 10px; }
.selection>i { background: #e8f3eb; color: var(--ui-green); }
.cost { gap: 15px; }
.cost>span { color: var(--ui-muted); font-size: 10px; }
.cost>span small { color: var(--ui-subtle); font-size: 9px; }
.cost>strong { color: var(--ui-ink); font-size: 22px; }
.cost>strong i { color: var(--ui-muted); font-size: 11px; }
.summary-top-button { background: var(--ui-green) !important; }

.course-select-menu, .distance-select-menu, .character-dropdown, .support-gold-group .course-select-menu { border: 1px solid var(--ui-line); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px #2036291f; }
.course-select-menu button, .distance-select-menu button, .character-option { min-height: 42px; border-radius: 9px; font-size: 13px; }
.course-select-menu button.selected, .distance-select-menu button.selected, .character-option.selected { border-color: var(--ui-green); background: var(--ui-green-soft); color: var(--ui-green-dark); }
.race-choice:first-child .choice-pills button:has(.season-choice-icon) { position: relative; justify-content: center; }
.race-choice:first-child .choice-pills .season-choice-icon { position: absolute; left: 8px; }

@media (min-width: 901px) {
  .topbar { padding-inline: max(calc((100vw - 1280px)/2), 28px); }
  .setup .race-condition-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; align-items: stretch; gap: 10px 16px; }
  .setup .race-condition-row > .course-distance-row { display: grid; grid-column: 1; grid-row: 1 / span 2; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: start; align-items: start; gap: 8px; }
  .setup .race-condition-row > .course-distance-row > .course-select-field { min-width: 0; }
  .setup .race-condition-row > .course-distance-row > .turn-readonly { grid-column: 1; justify-self: start; align-self: start; min-height: 30px; }
  .setup .race-condition-row > .race-strip { display: contents; }
  .setup .race-condition-row > .race-strip > .race-choice { align-self: stretch; min-width: 0; }
  .setup .race-condition-row > .race-strip > .race-choice:nth-child(1) { grid-column: 2; grid-row: 1; }
  .setup .race-condition-row > .race-strip > .race-choice:nth-child(2) { grid-column: 2; grid-row: 2; }
  .setup .race-condition-row > .race-strip > .race-choice:nth-child(3) { grid-column: 3; grid-row: 1; }
  .setup .race-condition-row > .race-strip > .race-choice:nth-child(4) { grid-column: 3; grid-row: 2; }
  .setup .race-condition-row .choice-pills { min-width: 0; }
  .setup .race-condition-row .choice-pills button { font-size: 11px; padding-inline: 6px; }
}

@media (max-width: 900px) {
  body { font-size: 14px; }
  .topbar { height: 56px; padding-inline: 14px; gap: 16px; }
  .brand { gap: 7px; font-size: 16px; }
  .logo { width: 32px; height: 32px; border-radius: 10px; }
  .brand small { font-size: 7px; }
  .topbar nav { gap: 12px; margin-left: 0; }
  .topbar nav a { min-width: 56px; font-size: 12px; }
  .usage-guide { padding: 24px 16px 36px; }
  .usage-flow { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .help { width: 36px; height: 36px; }
  main.planner-main { padding: 14px 12px 30px; }
  .setup { padding: 17px 15px 18px; border-radius: 15px; }
  .setup .section-head { min-height: 36px; margin-bottom: 13px; padding-bottom: 9px; }
  .setup .section-head strong { font-size: 16px; }
  .mobile-plan-actions { gap: 8px; margin: 0 0 10px; padding: 10px; border-color: var(--ui-line); border-radius: 14px; background: #fff; box-shadow: none; }
  .mobile-plan-actions button { min-height: 46px; padding: 7px 5px; border-color: var(--ui-line); border-radius: 10px; color: var(--ui-green-dark); font-size: 12px; font-weight: 750; }
  .mobile-plan-actions button svg { width: 16px; height: 16px; }
  .mobile-plan-actions button:nth-child(5) { background: var(--ui-green-soft); }
  .mobile-panel-switch { top: 56px; z-index: 20; margin: 0 0 14px; padding: 5px; border-color: var(--ui-line); border-radius: 13px; background: #f8faf8fa; box-shadow: 0 3px 10px #20362910; backdrop-filter: blur(10px); }
  .mobile-panel-switch button { min-height: 46px; font-size: 14px; }
  .mobile-panel-switch button.active { background: var(--ui-green); box-shadow: none; }
  .preset-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; padding: 10px; border-radius: 12px; }
  .preset-bar>strong { grid-column: 1 / -1; width: auto; font-size: 12px; }
  .preset-bar>.utility-select-wrap { grid-column: 1 / -1; min-width: 0; }
  .preset-bar .course-select-trigger { min-height: 42px; font-size: 14px; }
  .preset-bar button { min-width: 0; min-height: 40px; height: auto; padding: 4px 4px; font-size: 10px; white-space: nowrap; }
  .preset-bar>button:not(:disabled) { border-color: var(--ui-green); background: var(--ui-green); color: #fff; font-weight: 750; }
  .config label { font-size: 13px; }
  .supports-block { padding: 12px; border-radius: 13px; }
  .supports-block .picker-heading label { font-size: 13px; }
  .supports-block .picker-toggle { min-height: 42px; font-size: 13px; }
  .supports-block:has(.support-picker-grid.expanded) { max-height: min(68dvh, calc(100dvh - 190px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .supports-block:has(.support-picker-grid.expanded) .picker-heading { position: sticky; top: 0; z-index: 30; padding: 6px 0; background: #fbfcfb; }
  .supports-block:has(.support-picker-grid.expanded) .picker-heading label { display: none; }
  .supports-block:has(.support-picker-grid.expanded) .support-picker-tools { position: static; top: auto; z-index: auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #e7ece7; background: transparent; }
  .supports-block:has(.support-picker-grid.expanded) .support-tabs { position: static; padding: 8px; border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; }
  .scenario-choice>span { font-size: 12px; line-height: 1.4; }
  .scenario-choice>span { display: block; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .scenario-choice .course-select-trigger { width: 100%; min-width: 0; }
  .knowledge-setting { gap: 7px; padding: 9px; }
  .knowledge-setting>label { font-size: 12px; }
  .knowledge-help { font-size: 10px; }
  .character-aptitude-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .character-aptitude-filters label { font-size: 11px; }
  .character-aptitude-filters select { height: 40px; font-size: 13px; }
  .topbar .brand > span:last-child { font-size: clamp(10px, 3.1vw, 12px); }
  .topbar nav { gap: 8px; }
  .topbar nav a { font-size: 11px; }
  .knowledge-options button { min-height: 38px; font-size: 12px; }
  .setup .race-condition-row { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .race-condition-row .race-choice .choice-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .race-condition-row .race-choice:nth-child(1) .choice-pills,
  .race-condition-row .race-choice:nth-child(2) .choice-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .race-condition-row .race-choice .choice-pills button { min-width: 0; min-height: 42px; height: auto; padding: 6px 4px; font-size: 12px; white-space: normal; line-height: 1.2; }
  .race-condition-row .race-choice:nth-child(3) .choice-pills button:first-child { grid-column: 1 / -1; }
  .race-condition-row .race-choice:nth-child(4) .choice-pills button:first-child { grid-column: 1 / -1; }
  .skill-area { margin-top: 20px; }
  .list-head { margin-bottom: 12px; }
  .list-head h2 { font-size: 20px; }
  .list-head h2 small { font-size: 9px; }
  .list-head p { font-size: 11px; line-height: 1.45; }
  .legend-skill-card b { font-size: 12px; }
  .legend-skill-card small { font-size: 10px; }
  .bulk-hint-select>label { font-size: 12px; line-height: 1.45; }
  .mobile-panel-skills .bulk-hint-select { margin-right: 62px; }
  .mobile-panel-skills .bulk-hint-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile-panel-skills .bulk-hint-options button { min-width: 0; width: 100%; }
  .bulk-hint-options button { min-height: 40px; font-size: 12px; }
  .catalog-controls { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; margin-top: 12px; padding: 10px; }
  .mobile-panel-skills .catalog-controls { margin-right: 62px; }
  .catalog-search { min-width: 0; min-height: 44px; height: 44px; }
  .catalog-search input { font-size: 14px; }
  .catalog-filters { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; overflow: visible; padding: 0; }
  .catalog-filters button { width: 100%; min-width: 0; min-height: 42px; padding: 6px 7px; font-size: 12px; white-space: normal; line-height: 1.25; }
  .catalog-actions { display: flex; flex-wrap: wrap; margin: 0; }
  .catalog-actions button { min-height: 40px; font-size: 12px; }
  .category { margin-top: 18px; }
  .category-head { min-height: 30px; margin-bottom: 7px; }
  .category-head h3 { font-size: 14px; }
  .category-head>small { font-size: 10px; }
  .summary { z-index: 90; }
  .summary-content { min-height: 72px; padding: 8px 12px; gap: 9px; }
  .selection { gap: 7px; }
  .selection strong { font-size: 11px; }
  .selection small { font-size: 9px; }
  .cost { gap: 8px; }
  .cost>span { font-size: 9px; }
  .cost>span small { font-size: 8px; }
  .cost>strong { font-size: 18px; }
  .cost>strong i { font-size: 9px; }
}

@media (max-width: 420px) {
  .topbar { padding-inline: 10px; gap: 10px; }
  .topbar nav { gap: 8px; }
  .topbar nav a { min-width: 51px; font-size: 11px; }
  .usage-guide { padding: 20px 12px 30px; }
  .usage-guide-head { margin-bottom: 16px; }
  .usage-guide-head h1 { font-size: 22px; }
  .usage-guide-head p { font-size: 13px; }
  .usage-flow { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .usage-step { min-height: 0; padding: 12px; }
  .usage-step h2 { margin-top: 0; }
  .usage-guide-details { grid-template-columns: minmax(0,1fr); gap: 8px; margin-top: 9px; }
  main.planner-main { padding-inline: 10px; }
  .setup { padding-inline: 12px; }
  .mobile-plan-actions { gap: 6px; padding: 8px; }
  .mobile-plan-actions button { gap: 4px; font-size: 11px; }
  .summary-content { padding-inline: 9px; gap: 6px; }
  .selection { gap: 5px; }
  .selection>i { width: 22px; height: 22px; }
  .selection strong { font-size: 10px; }
  .selection small { font-size: 8px; }
  .cost { gap: 5px; }
  .cost>span { font-size: 8px; }
  .cost>span small { font-size: 7px; }
  .cost>strong { font-size: 15px; }
  .cost>strong i { font-size: 8px; }
  .mobile-skill-float-controls.visible { right: 12px; }
}

@media (max-width: 640px) {
  html:has(.supports-block .support-picker-grid.expanded), body:has(.supports-block .support-picker-grid.expanded) { overflow: hidden; }
  .supports-block:has(.support-picker-grid.expanded) {
    position: fixed;
    inset: calc(64px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    width: auto;
    max-height: none;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border: 1px solid #dbe5dd;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 0 0 100vmax #17211b66, 0 18px 48px #17211b35;
  }
  .supports-block:has(.support-picker-grid.expanded) .picker-heading {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    margin: -10px -10px 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #e7ece7;
    background: #fff;
  }
  .supports-block:has(.support-picker-grid.expanded) .picker-heading::before {
    content: "サポートカード選択";
    color: #293b30;
    font-size: 16px;
    font-weight: 800;
  }
  .supports-block:has(.support-picker-grid.expanded) .picker-heading label { display: none; }
  .supports-block:has(.support-picker-grid.expanded) .selected-supports { display: none; }
  .supports-block:has(.support-picker-grid.expanded) .support-picker-tools { position: static; gap: 10px; padding: 6px 0 10px; border: 0; background: transparent; }
  .supports-block:has(.support-picker-grid.expanded) .support-tabs { position: static; padding: 8px; border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; }
  .supports-block:has(.support-picker-grid.expanded) .support-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 7px; }
  .supports-block:has(.support-picker-grid.expanded) .support-option { height: auto !important; min-height: 0 !important; align-items: stretch; padding: 4px; border-radius: 9px; }
  .supports-block:has(.support-picker-grid.expanded) .support-option > img { width: 100% !important; height: auto !important; aspect-ratio: .76; flex: none; object-fit: cover; border-radius: 6px; }
  .supports-block:has(.support-picker-grid.expanded) .support-option > span { display: block; width: 100%; min-width: 0; margin-top: 4px; text-align: center; }
  .supports-block:has(.support-picker-grid.expanded) .support-option > span b { display: -webkit-box; overflow: hidden; font-size: 9px; line-height: 1.2; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .supports-block:has(.support-picker-grid.expanded) .support-option > span small { display: none; }
  .supports-block:has(.support-picker-grid.expanded) .support-option .support-card-type { top: 6px; right: 6px; left: auto; width: 18px; height: 18px; }
  .supports-block:has(.support-picker-grid.expanded) .support-option.selected .support-check { top: 6px; right: auto; left: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Settings explanation and list controls */
.catalog-filters-bottom { justify-content: flex-end; }
.default-settings-note { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--ui-line); border-radius: 10px; background: #f8faf8; color: var(--ui-muted); font-size: 12px; line-height: 1.8; }
@media (max-width: 760px) { .catalog-filters-bottom { justify-content: initial; } .default-settings-note { margin-top: 12px; padding: 11px 12px; font-size: 12px; line-height: 1.75; } }

/* Use the same custom app icon in the header and installed app. */
.topbar .logo { width: 40px; height: 40px; overflow: hidden; padding: 0; background: transparent; }
.topbar .brand-icon { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }

/* Keep default behavior notes together with the skill-state legend. */
@media (min-width: 901px) { .list-head { grid-template-areas: "intro intro" "legend tools" "note note"; } .default-settings-note { grid-area: note; margin: 0; } }
@media (max-width: 900px) { .default-settings-note { margin: 8px 0 0; } }
.character-aptitude-filters { grid-template-columns: repeat(3, minmax(112px, 132px)); justify-content: start; gap: 10px 12px; }
.character-aptitude-filters label { gap: 6px; color: var(--ui-ink); font-size: 12px; }
.character-aptitude-filters select { width: 100%; height: 36px; padding-inline: 10px; font-size: 13px; font-weight: 600; }
.topbar .brand > span:last-child { color: var(--ui-ink); font-size: 15px; letter-spacing: 0; white-space: nowrap; }
.character-option { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease; box-shadow: 0 2px 5px #26352a0c; }
@media (hover: hover) and (pointer: fine) {
  .character-option:hover { transform: translateY(-2px); border-color: #b9c5be; box-shadow: 0 5px 12px #26352a20; }
}
.character-option:active { transform: translateY(1px) scale(.99); box-shadow: inset 0 2px 4px #26352a20, 0 1px 2px #26352a0c; }
@media (max-width: 900px) {
  .character-aptitude-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .character-aptitude-filters label { font-size: 11px; }
  .character-aptitude-filters select { height: 40px; font-size: 13px; }
  .topbar .brand > span:last-child { font-size: clamp(10px, 3.1vw, 12px); }
  .topbar nav { gap: 8px; }
  .topbar nav a { font-size: 11px; }
}
.default-settings-note { white-space: pre-line; line-height: 1.7; }
.config-grid > .supports-block .picker-heading { align-self: start; }
/* Keep the skill-state legend inside narrow phone layouts. The acquisition
   explanation is intentionally longer than the other labels, so let it wrap
   instead of widening the page or being clipped at the right edge. */
@media (max-width: 620px) {
  .planner-main.mobile-panel-skills,
  .planner-main.mobile-panel-skills > .skill-area,
  .planner-main.mobile-panel-skills .list-head,
  .planner-main.mobile-panel-skills .skill-state-legend {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .planner-main.mobile-panel-skills .skill-state-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .planner-main.mobile-panel-skills .legend-skill-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .planner-main.mobile-panel-skills .legend-skill-card > span {
    flex: 1 1 0;
    min-width: 0;
  }
  .planner-main.mobile-panel-skills .legend-skill-card b,
  .planner-main.mobile-panel-skills .legend-skill-card small {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 620px) {
  .list-head > .tools { justify-content: center; }
  .skill-area > .catalog-controls { margin-inline: auto; }
  .supports-block .picker-heading { position: relative; z-index: 3; background: #fff; }
  .supports-block .picker-heading::before { content: ""; position: absolute; z-index: -1; top: -10px; left: -10px; right: -10px; height: 12px; background: #fff; }
}
@media (max-width: 620px) {
  .tools .bulk-hint-select { margin-inline: auto !important; }
  .skill-area > .catalog-controls { width: min(100%, 320px); }
  .supports-block:has(.support-picker-grid.expanded) { top: 56px !important; max-height: calc(100dvh - 56px - env(safe-area-inset-bottom)) !important; }
  .supports-block:has(.support-picker-grid.expanded) .picker-heading { box-shadow: 0 -12px 0 #fff, 0 1px 0 #e7ece7; }
}
@media (max-width: 620px) {
  .supports-block:has(.support-picker-grid.expanded) .picker-heading::before { position: static; inset: auto; z-index: auto; margin-right: auto; width: auto; height: auto; background: transparent; }
}

/* Align the character and support section titles on the same top baseline. */
@media (min-width: 901px) {
  .config-grid > .character-block { padding-top: 0 !important; }
  .config-grid > .supports-block { padding-top: 0 !important; }
  .config-grid > .character-block > label,
  .config-grid > .supports-block > .picker-heading {
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    align-self: start;
  }
}
