/* CR-93: the Fleet area's styles (the shell's few rules first; chunk C1, the organiser, owns the rest of this file). */
.fleet-pointers { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; }
.fleet-planned { max-width: 60rem; }

/* C6, History (fleet-history.js). */
.hist-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.hist-tools select { max-width: 100%; }
.hist-tools input[type="search"] { flex: 1 1 200px; }
.hist-check { white-space: nowrap; }
.hist-rows { list-style: none; margin: 0; padding: 0; }
.hist-row { padding: 10px 0; border-top: 1px solid var(--line); }
.hist-row:first-child { border-top: 0; padding-top: 0; }
.hist-row.is-undo .hist-title b { font-weight: 600; }
.hist-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; justify-content: space-between; }
.hist-main { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.hist-meta { font-size: 13px; }
.hist-error { font-size: 13px; color: var(--bad); }
.hist-actions { display: flex; gap: 8px; }
.hist-more { margin: 6px 0 0; }
.hist-more > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.hist-steps ol { margin: 6px 0; padding-left: 22px; font-size: 14px; }
.hist-steps li { overflow-wrap: anywhere; }
.hist-undo { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
.hist-undo .note { margin-bottom: 8px; }
.hist-group h4 { margin: 8px 0 4px; font-size: 13px; }
.hist-group ul { margin: 0 0 6px; padding-left: 0; list-style: none; }
.hist-group li { padding: 2px 0; overflow-wrap: anywhere; }
.hist-undo .row { margin-top: 10px; }
.hist-foot { margin: 12px 0 0; }
/* CR-93, chunk C1: the Organiser (fleet-organiser.js). Colours come from app.css's tokens, so light and dark follow. */
.fo { display: grid; gap: 12px; min-width: 0; }
.fo .nowrap { white-space: nowrap; }
.fo-status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.fo-switch { border-radius: 99px; padding: 2px 12px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.fo-switch::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .45; }
.fo-switch.on { color: var(--ok); border-color: var(--ok); }
.fo-switch.on::before { opacity: 1; }
.fo-strip { margin: 0; padding: 8px 12px; border: 1px solid var(--warn); border-radius: 6px; }
.fo-invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.fo-invite label { display: grid; gap: 2px; font-size: 13px; }
.fo-invite-name { flex: 1 1 220px; min-width: 0; }
.fo-tools { display: grid; gap: 8px; }
.fo-filter, .fo-modes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fo-extras { display: contents; }
.fo-modes { justify-content: space-between; }
.fo-modes-left { display: inline-flex; }
.fo-seg { display: inline-flex; }
.fo-seg button { border-radius: 0; }
.fo-seg button:first-child { border-radius: 5px 0 0 5px; }
.fo-seg button:last-child { border-radius: 0 5px 5px 0; margin-left: -1px; }
.fo-seg button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.fo-view[open] { flex: 1 1 100%; }
.fo-view > summary { cursor: pointer; display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--sunk); }
.fo-view-box { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.fo-view-box .checks { display: grid; gap: 4px; margin: 0; }
.fo-view-box > p { grid-column: 1 / -1; margin: 0; }
.fo-chips-box { display: grid; gap: 6px; }
.fo-chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fo-chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: 13px; }
.fo-chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
/* CR-112: a chip can be dragged onto a squad, a wing or + Wing; the grip shows it and starts the drag in every browser. */
.fo-chip-wrap { display: inline-flex; align-items: center; gap: 2px; cursor: grab; }
.fo-chip-grip { color: var(--muted); font-size: 13px; line-height: 1; padding: 0 1px; user-select: none; }
/* The moves made a moment ago, each with an Undo (History's undo). */
.fo-undo { display: grid; gap: 6px; }
.fo-undo-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.fo-undo-row.open { border-color: var(--accent); }
.fo-undo-text { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.fo-undo-x { padding: 2px 10px; line-height: 1; }
.fo-chip[class*="fo-flag-"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--flag); }
.fo-flag-flagCruiser { --flag: #d99a00; }
.fo-flag-capsule { --flag: #7c8b95; }
.fo-flag-command { --flag: #b063c9; }
.fo-flag-logi { --flag: #2e9e68; }
.fo-flag-capital { --flag: #d64545; }
.fo-body { display: grid; gap: 12px; min-width: 0; }
.fo-wings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; align-items: start; }
.fo-wings.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.fo-wing { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px; min-width: 0; }
.fo-squad { border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; background: var(--bg); padding: 4px 6px 6px; min-width: 0; }
.fo-wing.dim, .fo-squad.dim { opacity: .45; }
.fo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 34px; min-width: 0; }
.fo-unit-title { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.25; }
.fo-unit-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-head button { white-space: nowrap; }
.fo-count { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
.fo-mass { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fo-fold { border: 0; background: transparent; padding: 2px 6px; min-width: 28px; color: var(--muted); }
.fo-grip { cursor: grab; color: var(--muted); padding: 0 2px; user-select: none; }
.fo-slot { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; padding: 2px 0; min-width: 0; }
.fo-slot-label { font-size: 12px; }
.fo-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; flex: 1 1 100%; min-width: 0; }
.fo-slot > .fo-here { margin-left: auto; }
.fo-here { display: none; }
.has-pick .fo-head .fo-here { display: block; flex: 1 1 100%; order: 10; padding: 8px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: var(--accent); }
.one-pick .fo-slot > .fo-here { display: inline-block; }
.fo-pilot { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 4px 2px 6px; border-left: 3px solid transparent; border-radius: 5px; min-width: 0; }
.can-act .fo-pilot { cursor: pointer; user-select: none; -webkit-user-select: none; }
.fo-pilot:hover { background: var(--sunk); }
.fo-pilot[class*="fo-flag-"] { border-left-color: var(--flag); }
.fo-pilot.picked { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.fo-pilot.hit { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.fo-pilot.dim { opacity: .4; }
.fo-pilot.boss .fo-tick input { visibility: hidden; }
.fo-tick { display: inline-flex; padding: 4px; }
.fo-tick input { width: 18px; height: 18px; margin: 0; }
.fo-text { flex: 1 1 auto; min-width: 0; display: grid; }
.fo-name { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.fo-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fo-role { font-size: 11px; line-height: 1.4; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--muted); flex: 0 0 auto; }
.fo-role.you { color: var(--accent); border-color: var(--accent); }
.fo-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-away { color: var(--warn); }
.fo-more { padding: 2px 10px; min-width: 36px; min-height: 32px; line-height: 1; flex: 0 0 auto; }
.fo-pilot.drag-ghost { opacity: .5; }
.fo .over { outline: 2px dashed var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fo-pick {
  position: sticky; bottom: 8px; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; box-shadow: 0 -2px 14px rgba(0, 0, 0, .2);
}
.fo-pick select { flex: 1 1 180px; min-width: 0; }
.fo-table-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 8px; }
.fo-table td.num { text-align: right; }
.fo-table th { white-space: nowrap; }
.fo-table tr.picked td { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.fo-table tr.hit td { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.fo-table tr.dim td { opacity: .4; }
.fo-table tr[class*="fo-flag-"] > td:first-child { box-shadow: inset 3px 0 0 var(--flag); }
.fo-sort { border: 0; background: transparent; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
.fo-menu {
  position: fixed; z-index: 100; min-width: 260px; grid-template-columns: minmax(0, 1fr); max-width: min(360px, calc(100vw - 16px)); max-height: 80vh; overflow: auto; display: grid; gap: 2px; padding: 6px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
}
.fo-menu-title { font-weight: 600; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-menu-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 2px; }
.fo-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 5px; padding: 8px 10px; color: inherit; text-decoration: none; }
.fo-item:hover:not(:disabled), .fo-item:focus-visible { background: var(--sunk); }
.fo-item.danger { color: var(--bad); }
.fo-item.fo-move { display: flex; gap: 6px; padding: 4px 8px; }
.fo-item.fo-move select { flex: 1 1 0; min-width: 0; }
.fo-dialog { width: min(440px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg); }
.fo-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.fo-ask { display: grid; gap: 12px; }
.fo-ask h3 { margin: 0; font-size: 17px; }
.fo-ask p { margin: 0; }
.fo-ask-buttons { justify-content: flex-end; }
@media (max-width: 600px) {
  .fo-menu { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; max-height: 75vh; border-radius: 12px 12px 0 0; padding: 8px 8px 16px; }
  .fo-item { padding: 12px 10px; }
  .fo-pick { bottom: 0; border-radius: 8px 8px 0 0; }
}
@media (pointer: coarse) {
  .fo-more, .fo-fold { min-height: 40px; min-width: 40px; }
  .fo-tick { padding: 10px; }
  .fo-tick input { width: 22px; height: 22px; }
}
/* CR-93 C3, Invites: invite groups, my characters, where pilots go */
.inv-groups { display: grid; gap: 10px; margin: 0 0 12px; }
.inv-group { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; min-width: 0; }
.inv-group.editing { border-color: var(--accent); }
.inv-group-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; min-width: 0; }
.inv-group-name { overflow-wrap: anywhere; }
.inv-pilots > summary { cursor: pointer; color: var(--muted); }
.inv-places { margin-top: 6px; }
.inv-places li { display: block; overflow-wrap: anywhere; }
.inv-places li b { margin-right: 8px; }
.inv-results { max-height: 22rem; overflow: auto; margin-top: 8px; }
.inv-run .note { margin-bottom: 8px; }
.inv-toons li { justify-content: flex-start; }
.inv-toons li span:first-child { min-width: 12ch; overflow-wrap: anywhere; }
.inv-options { margin: 8px 0; }
.inv-place { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0 0 8px; }
.inv-name input { width: 9rem; }
.inv-editor { display: grid; gap: 10px; }
.inv-editor td input, .inv-editor td select { width: 100%; min-width: 6rem; }
.inv-add { display: grid; gap: 8px; }
.inv-names { display: grid; gap: 4px; margin-top: 10px; }
.inv-form { margin-top: 8px; }
.inv-group > div:empty { display: none; }
/* CR-93, C5: the MOTD sub-tab. The preview is drawn dark on purpose: the game's MOTD window is, and its colours are meant for it. */
.motd-grid { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.motd-side { min-width: 0; }
.motd-side > h3, .motd-grid + .note + h3 { margin-top: 0; }
.motd-preview { margin: 0 0 12px; }
.motd-view { background: #12161c; color: #dfe4ea; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: 14px/1.5 "Segoe UI", system-ui, sans-serif; overflow-wrap: anywhere; }
.motd-line { min-height: 1.5em; }
.motd-link { color: #8ecbff; text-decoration: underline; }
.motd-preview .note { margin: 8px 0 0; }
.motd-field { display: grid; gap: 4px; margin: 0 0 10px; }
.motd-edit { min-height: 180px; font: 13px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; resize: vertical; }
.motd-tools, .motd-chips { margin: 0 0 8px; gap: 6px; }
.motd-tools input[type="color"] { padding: 0; width: 36px; height: 32px; }
button.chip { padding: 2px 8px; font-size: 13px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; border-radius: 12px; }
.motd-help { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 14px; }
.motd-help dt { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.motd-help dd { margin: 0; color: var(--muted); }
.motd-howto { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: var(--sunk); font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; }
@media (max-width: 480px) { .motd-help { grid-template-columns: 1fr; } .motd-help dd { margin-bottom: 4px; } }
.motd-edit { margin: 0 0 8px; }
.motd-editor details.more { margin: 0 0 12px; }
.motd-field { margin-top: 4px; }
.motd-preview + .note, .motd-side > .note { margin: 0 0 12px; }
#motd-pilots > form { margin-top: 10px; }
/* CR-102, chunk C9 (Tools): the rally's quick picks, and the mass check's small tables. */
.tools-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0; }
.tools-picks .chip { padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.tools-bands td:nth-child(2) { white-space: nowrap; }
.card .grid-form + div, .card .grid-form + .grid-form + div { margin-top: 12px; }
/* CR-93 C4: Rules & doctrines */
.rules-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 12px; }
.rules-rule select { width: 100%; max-width: 34rem; }
.rules-rule textarea { width: 100%; max-width: 34rem; }
.route, .doctrine { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; background: var(--surface); margin: 0 0 8px; }
.route > summary, .doctrine > summary { cursor: pointer; overflow-wrap: anywhere; }
.route[open] > summary, .doctrine[open] > summary { margin-bottom: 10px; }
.comp-line { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 10px; margin: 0 0 10px; min-width: 0; }
.comp-line legend { font-weight: 600; padding: 0 4px; }
.prio { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.inline-label { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 10px; }
.doctrine-status { margin: 0 0 12px; }
.doctrine-status p:last-child { margin-bottom: 0; }
/* CR-103, chunk C7 (Automation): the switch and pause, and one row for each thing it does. */
.auto-top { margin: 0 0 12px; }
.auto-controls > p { margin: 8px 0 0; }
.auto-controls > .row { margin: 0; }
.auto-last { margin: 0 0 12px; }
.auto-last p { margin: 0 0 6px; }
.auto-job { padding: 10px 0; border-top: 1px solid var(--line); }
.auto-job:first-child { border-top: 0; padding-top: 0; }
.auto-job > p { margin: 2px 0 0 24px; }
.auto-job label { align-items: baseline; }
.auto-title { display: block; }
.auto-fields { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 6px 0 0 24px; }
.auto-fields input[type="number"] { width: 5rem; }
.auto-fields input:not([type]), .auto-fields input[type="text"] { width: 8rem; }
@media (max-width: 480px) { .auto-job > p, .auto-fields { margin-left: 0; } }
/* CR-97: Requests (fleet-requests.js) */
ul.xup-list { display: grid; gap: 8px; }
ul.xup-list li.xup {
  display: grid; gap: 4px 12px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.6fr) auto; align-items: center; justify-content: stretch;
  padding: 8px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; background: var(--surface);
}
ul.xup-list li.xup.waiting { border-left-color: var(--warn); }
.xup-who, .xup-asks, .xup-state { min-width: 0; overflow-wrap: anywhere; }
.xup-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 760px) {
  ul.xup-list li.xup { grid-template-columns: minmax(0, 1fr); }
  .xup-actions { justify-content: flex-start; }
}

/* CR-106: one heading scale in the Fleet area (a section is an h2, what sits inside it an h3), and no drag handles where nothing drags. */
#panel-fleet .part-panel h3 { font-size: 16px; margin: 16px 0 8px; }
#panel-fleet .part-panel .card h3:first-child, #panel-fleet .part-panel .motd-side > h3 { margin-top: 0; }
@media (pointer: coarse) { .fo-grip { display: none; } }
/* CR-105, C10: Share this setup and Import a setup (Setup sub-tab). */
.setup-parts { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin: 0 0 12px; }
.setup-parts .inline-label { margin: 0; }
.setup-code { width: 100%; font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; resize: vertical; }
.setup-code-row textarea { width: 100%; min-height: 110px; font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.setup-code-row[hidden] { display: none; }
.setup-choose { gap: 8px 16px; align-items: center; }
.setup-choose select { max-width: 100%; }
.setup-preview { margin-top: 12px; }
.setup-sentence { font-weight: 600; margin: 0 0 12px; }
.setup-section { margin: 0 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.setup-section > label { font-weight: 600; }
.setup-section > label .muted { font-weight: 400; }
.setup-items { margin-top: 6px; }
.setup-items > summary { cursor: pointer; color: var(--muted); }
.setup-items .table-box { margin-top: 6px; max-height: 20rem; overflow: auto; }
.setup-notes { margin: 0 0 12px; padding-left: 18px; }
.setup-parts input { flex: none; }
/* CR-104 C8, the planner (fleet-planner.js), a section of Rules & doctrines */
.planner ol.planner-rules { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.planner-rule { display: grid; gap: 8px 10px; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); align-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); min-width: 0; }
.planner-rule label { display: grid; gap: 2px; min-width: 0; }
.planner-rule input, .planner-rule select { width: 100%; min-width: 0; }
.planner-cap { font-size: 12px; color: var(--muted); }
.planner-tools { display: flex; gap: 6px; }
@media (min-width: 900px) {
  .planner-rule { grid-template-columns: minmax(7rem, 9rem) minmax(9rem, 2fr) minmax(5rem, 1fr) minmax(5rem, 1fr) minmax(8rem, 11.5rem) auto; }
}
.planner-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; }
.planner-chips .pill { display: inline-flex; gap: 6px; align-items: center; }
.planner-x { border: 0; background: transparent; padding: 0 4px; color: inherit; cursor: pointer; min-width: 24px; min-height: 24px; }
.planner-rules-box > summary { cursor: pointer; margin: 0 0 10px; }
.planner-rules-box[open] > summary { font-weight: 600; }
.planner-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.planner-controls { margin: 0 0 8px; }
.planner-squads { margin: 0 0 12px; }
.planner-squads p { margin: 0 0 8px; }
.planner-apply { margin: 0 0 12px; }
.planner-more { margin: 0 0 8px; }
.planner-more > summary { cursor: pointer; margin: 0 0 8px; color: var(--muted); }
.planner h4 { margin: 8px 0 6px; font-size: 15px; }
.planner-plan .table-box td { overflow-wrap: anywhere; }
/* CR-117: Who may ask for what (fleet-requests.js). Native selects drawn as chips: the keyboard and screen readers work as everywhere else. */
.pol-summary { margin: 0 0 10px; font-weight: 600; overflow-wrap: anywhere; }
.pol-box { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.pol-table { width: 100%; border-collapse: collapse; }
.pol-table tbody th.pol-what { text-align: left; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--fg); background: transparent; width: 32%; }
.pol-table tbody th.pol-what b { display: block; }
.pol-table td { min-width: 0; }
.pol-how { width: 42%; }
.pol-pair { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.pol-secs { display: inline-flex; gap: 4px; align-items: center; }
.pol-secs input { width: 4.75rem; border-radius: 99px; text-align: center; }
.pol-help, .pol-note { display: block; margin-top: 4px; }
.pol-row.is-off .pol-who { opacity: .55; }
.pol-sub td { padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.pol-row:has(+ .pol-sub) > * { border-bottom: 0; }
.pol-actions { margin-top: 12px; }
select.pol-chip {
  appearance: none; -webkit-appearance: none; border-radius: 99px; padding: 5px 32px 5px 14px; font-weight: 600; cursor: pointer; max-width: 100%;
  background-color: var(--bg); color: var(--fg);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
select.pol-chip option { color: var(--fg); background: var(--surface); }
select.pol-chip[data-tone="ok"] { color: var(--ok); border-color: var(--ok); }
select.pol-chip[data-tone="warn"] { color: var(--warn); border-color: var(--warn); }
select.pol-chip[data-tone="accent"] { color: var(--accent); border-color: var(--accent); }
select.pol-chip[data-tone="off"] { color: var(--muted); }
select.pol-chip:disabled { cursor: default; opacity: .8; }
.xup-rule { white-space: normal; }
@media (max-width: 720px) {
  .pol-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pol-table, .pol-table tbody, .pol-table tr, .pol-table tbody th, .pol-table td { display: block; width: auto; }
  .pol-table tbody tr { border-top: 1px solid var(--line); }
  .pol-table tbody tr:first-child { border-top: 0; }
  .pol-table tr.pol-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; padding: 12px; }
  .pol-table tr.pol-row > * { padding: 0; border: 0; }
  .pol-table tbody th.pol-what { grid-column: 1 / -1; width: auto; }
  .pol-table tr.pol-row td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
  .pol-table tr.pol-sub { border-top: 0; padding: 0 12px 12px; }
  .pol-table tr.pol-sub td { padding: 0; border: 0; }
  .pol-how { width: auto; }
}
@media (max-width: 520px) {
  .pol-table tr.pol-row { grid-template-columns: minmax(0, 1fr); }
  select.pol-chip { width: 100%; }
}

/* CR-156: Select on touch, flag words, the selection bar's buttons */
.fo-select.on { background: var(--accent); color: var(--surface); }
.fo-body.touch-hide .fo-tick, .fo-body.touch-hide .fo-tickcell { display: none; }
.fo-body.selecting .fo-slot > .fo-here, .fo-body.selecting .fo-slot .fo-here { display: inline-block; }
.fo-flagtag { color: var(--flag, var(--muted)); border-color: var(--flag, var(--line)); }
.fo-pick .danger { margin-left: auto; }
.fo-body.selecting .fo-head .fo-here { display: inline-block; flex: 0 0 auto; }
.fo-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 6px 0 0; font-size: 13px; }
.fo-keys[hidden] { display: none; }
.fo-key { display: inline-flex; gap: 4px; align-items: center; }
.fo-keys button.on, .fo-modes button.on { }
