:root {
  color-scheme: light;
  --ink: #18362e; --muted: #51665d; --green: #195d4c; --pale: #e9f2e9;
  --paper: #fffefa; --bg: #f3f4ed; --line: #cdd8ce; --warm: #ffd1a9;
  --channel-row: 28px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box }
body { margin: 0; line-height: 1.45 }
button, input, select, summary, .link { font: inherit; color: inherit }
button, summary, .link { cursor: pointer; touch-action: manipulation }
button, .link, select, input { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); padding: 8px 13px; min-height: 44px }
button, .link, summary { font-weight: 600 }
button:enabled:hover, .link:hover { background: var(--pale) }
button:disabled { opacity: .5; cursor: default }
:focus-visible { outline: 3px solid #c56428; outline-offset: 1px }
.primary { background: var(--green); color: white; border-color: var(--green) }
.primary:enabled:hover { background: #104937 }
.quiet, .link { background: transparent; border-color: transparent; color: var(--green) }
.link { display: inline-flex; align-items: center; text-decoration: none }
.wrap { width: min(100% - 36px, 960px); margin-inline: auto }
header { border-bottom: 1px solid var(--line); background: var(--paper) }
nav, .actions, .toolbar, .head, .move-tools, .picker-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
nav { min-height: 62px; justify-content: space-between }
.brand { font-weight: 730; letter-spacing: -.045em; font-size: 21px; display: inline-flex; align-items: center; gap: 9px }
.mark { width: 24px; height: 20px; border: 2px solid var(--ink); border-radius: 5px; background: linear-gradient(90deg,#76a591 0 25%,#dec57e 25% 50%,#de9577 50% 75%,#9aabc6 75%) }
main { padding: clamp(22px,5vw,54px) 0 36px }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(30px,5vw,46px); letter-spacing: -.055em; line-height: 1.1 }
h2 { font-size: 23px; letter-spacing: -.035em; line-height: 1.2 }
h3 { font-size: 17px }
p, .muted, small { color: var(--muted) }
.welcome { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden }
.start { padding: clamp(22px,5vw,44px); background: #173b33; color: #fffdf4 }
.start p { color: #dfebe1; margin: 12px 0 22px; max-width: 60ch }
.start .primary { color: #21342a; background: var(--warm); border-color: var(--warm) }
.start .primary:hover { background: #ffe3c8 }
.start .quiet { color: white; text-decoration: underline; text-underline-offset: 4px }
.start .quiet:hover { background: #31574b }
.over { outline: 4px dashed #c56428; outline-offset: -5px }
.steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding: 25px clamp(22px,5vw,44px); margin: 0; list-style: none; counter-reset: steps }
.steps li { counter-increment: steps }
.steps strong { display: block; font-size: 17px; margin: 0 0 4px }
.steps strong::before { content: counter(steps) ". "; color: var(--green) }
.steps p, .guide p, .feedback, .export-info { font-size: 15px }
.head { justify-content: space-between; align-items: flex-end; margin-bottom: 14px }
.head h1 { font-size: clamp(27px,4vw,36px) }
.filename, .station-name, .pick-name, .feedback, .export-info { overflow-wrap: anywhere }
.filename { margin-top: 5px; font-size: 15px }
.export-info { margin: 0 0 14px }
.panel, dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--paper) }
.toolbar { padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 8px 12px }
.toolbar .spacer { flex: 1 }
#sourceLabel { display: inline-flex; align-items: center; gap: 6px }
.search { width: 100%; min-width: 0; background: white }
.searchline { display: flex; align-items: center; gap: 10px; padding: 10px 16px }
#count { flex-shrink: 0; color: var(--muted); font-size: 13px }
.colhead, .station { display: grid; grid-template-columns: 74px minmax(0,1fr) 75px 20px; gap: 12px; align-items: center; padding: 7px 18px; text-align: left }
.colhead { font-size: 13px; color: var(--muted); background: #f1f4ec; border-block: 1px solid var(--line) }
.station { width: 100%; min-height: var(--channel-row); padding-block: 2px; font-size: 15px; line-height: 1.25; border: 0; border-bottom: 1px solid #e2e7de; border-radius: 0; background: transparent }
.station[aria-expanded="true"] { background: var(--pale); box-shadow: inset 3px 0 var(--green) }
.station:focus-visible, .pick:focus-visible { outline-offset: -3px }
.number { font-variant-numeric: tabular-nums; font-weight: 720; color: var(--green) }
.kind { font-size: 14px; color: var(--muted); font-weight: 450 }
.chev { text-align: center; color: var(--muted); font-weight: 450 }
.chev::before { content: "▾" }
.station[aria-expanded="true"] .chev::before { content: "▴" }
.station[data-drop-edge] { position: relative }
.station[data-drop-edge]::after { content: ""; position: absolute; inset-inline: 0; height: 3px; background: #ab511f; pointer-events: none }
.station[data-drop-edge="before"]::after { top: 0 }
.station[data-drop-edge="after"]::after { bottom: 0 }
.import-help { margin: 0 0 14px; overflow-wrap: anywhere }
.import-help summary { padding-block: 6px }
.import-help ol { margin: 4px 0 8px; padding-left: 24px }
.import-help li { margin: 5px 0 }
.list-export { display: flex; justify-content: flex-end; padding: 10px 16px }
.editor { padding: 10px 18px; background: #f1f6ee; border-bottom: 1px solid var(--line) }
.move-tools label { font-size: 14px; font-weight: 600 }
.move-tools input { width: 7ch; box-sizing: content-box; min-height: 26px; padding: 8px; font-variant-numeric: tabular-nums }
.move-tools .step { min-width: 44px }
.inline-error, .error { color: #823918 }
.inline-error { margin-top: 6px }
.feedback { padding: 12px 16px; background: #e4efe4; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px }
.feedback.error { background: #fff0df; border-color: #d7a88b }
.empty { padding: 18px; color: var(--muted) }
.more[open] { flex-basis: 100% }
summary { display: inline list-item; padding: 10px 4px; color: var(--green) }
.more button { margin: 4px 4px 4px 0 }
footer { padding: 18px 0; font-size: 13px; color: var(--muted) }
dialog { color: var(--ink); padding: 20px; width: min(540px,calc(100% - 20px)); max-height: 90dvh; box-shadow: 0 16px 60px #112a2340 }
dialog::backdrop { background: #102b23a8 }
.dialoghead, .dialogfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.dialoghead { margin-bottom: 8px }
.dialoghead button { font-size: 20px; width: 44px; flex-shrink: 0 }
.guide ol { padding-left: 22px }
.guide li { margin: 12px 0 }
.guide p { margin-top: 4px }
#picker { width: min(770px,calc(100% - 20px)); padding: 0 }
#picker[open] { display: flex; flex-direction: column; height: min(600px,90dvh) }
.picker-intro { padding: 14px 18px 10px }
.picker-intro p { font-size: 14px }
.picker-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid var(--line) }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0 }
.order-pane { border-left: 1px solid var(--line); background: #f5f6ee }
.pane-head { padding: 10px 12px }
.pane-head h3 { min-height: 44px; align-content: center }
.pick-list { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0 }
.pick, .choice { display: flex; align-items: center; gap: 9px; width: 100%; padding: 1px 12px; min-height: var(--channel-row); border: 0; border-top: 1px solid #dfe5dc; border-radius: 0; text-align: left; font-size: 15px; line-height: 1.25 }
.pick[aria-pressed="true"] { background: var(--pale) }
.pick-name { flex: 1; min-width: 0 }
.pick .number { min-width: 3ch }
.choice .number { background: var(--warm); min-width: 28px; text-align: center; border-radius: 4px; padding: 2px 3px; color: var(--ink) }
.choice button { width: 44px; min-height: calc(var(--channel-row) - 3px); padding: 0 3px }
.dialogfoot { padding: 10px 16px; flex-wrap: wrap }
.dialogfoot p { font-size: 14px; min-width: 0; overflow-wrap: anywhere }
.switch-view { display: none }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
[hidden] { display: none !important }
@media (pointer: coarse) { :root { --channel-row: 34px } }
@media(max-width:620px) {
  .wrap { width: calc(100% - 20px) }
  nav .link { font-size: 14px }
  nav .actions { gap: 0 }
  .steps { grid-template-columns: 1fr; gap: 16px }
  .head { align-items: flex-start }
  .toolbar { padding: 9px; gap: 6px }
  .toolbar .spacer { display: none }
  .searchline { padding: 8px 10px }
  .colhead, .station { grid-template-columns: 48px minmax(0,1fr) 46px 15px; padding-inline: 10px; gap: 6px }
  .editor { padding: 8px 10px }
  .move-tools { gap: 5px }
  .move-tools label { width: 100% }
  .picker-grid { grid-template-columns: minmax(0,1fr) }
  .order-pane { border: 0 }
  #picker[data-view="channels"] .order-pane, #picker[data-view="order"] .channels-pane { display: none }
  .switch-view { display: flex; padding: 0 12px 8px; gap: 6px }
  .switch-view [aria-pressed="true"] { background: var(--pale); border-color: var(--green) }
  .order-pane .pane-head { display: none }
  .picker-intro { padding: 10px 12px 6px }
  .dialogfoot { padding: 8px 12px }
}
.cloud-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; color: var(--muted); font-size: 14px }
.cloud-bar strong { color: var(--green) }
#placeNumber { width: 6em }
.picker-intro .dialoghead h2 { font-size: 22px }
.dialogfoot label { white-space: nowrap }
.searchline { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line) }
.station { scroll-margin-block-start: 70px }
