:root {
  color-scheme: light dark;
  --paper: #f7f8fa;
  --surface: #fff;
  --text: #202733;
  --muted: #596679;
  --line: #dbe1e9;
  --accent: #2557b7;
  --accent-wash: #e9f0fd;
  --on-accent: #fff;
  --present: #18745a;
  --danger: #9e3044;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141821;
    --surface: #1c2330;
    --text: #e7edf7;
    --muted: #a8b6cb;
    --line: #394559;
    --accent: #9ebcff;
    --accent-wash: #283b60;
    --on-accent: #13203c;
    --present: #71d6af;
    --danger: #ffadb8;
  }
}

* { box-sizing: border-box; }
[hidden], .symbols { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(680px, 100% - 40px); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.07rem; letter-spacing: -.02em; text-decoration: none; color: inherit; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; background: var(--accent); color: var(--on-accent); }
.brand-mark .icon { width: 18px; height: 18px; }
.icon { display: inline-block; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.top-actions, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.connection { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.connection::before { content: ""; width: 6px; height: 6px; background: var(--muted); border-radius: 50%; }
.connection[data-online="true"]::before { background: var(--present); }

main { padding-block: 30px 36px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { line-height: 1.2; letter-spacing: -.035em; }
h1 { font-size: 1.72rem; font-weight: 665; }
h2 { font-size: 1.22rem; font-weight: 650; }
h3 { margin-bottom: 5px; font-size: .95rem; }
.hint { color: var(--muted); font-size: .86rem; }
.section { margin-bottom: 28px; }
.section-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head { margin-bottom: 14px; }
.section-head .hint { margin-top: 3px; }
.solid, .secondary, .quiet, .icon-button, .command-list button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 12px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-size: .87rem; font-weight: 600;
}
.solid { background: var(--accent); color: var(--on-accent); }
.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.quiet, .icon-button { color: var(--muted); background: transparent; }
.icon-button { min-width: 42px; padding: 6px; }
.solid:hover { filter: brightness(.94); }
.secondary:hover, .quiet:hover, .icon-button:hover, .command-list button:hover { background: var(--accent-wash); color: var(--accent); }
.secondary .icon { width: 16px; height: 16px; }

.device-list, .transfer-list, .paired-list { list-style: none; padding: 0; margin: 0; }
.device-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.device-list:empty { display: none; }
.device-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 9px 8px 12px; min-height: 62px; }
.device-row + .device-row { border-top: 1px solid var(--line); }
.device-row[data-drop="true"] { background: var(--accent-wash); box-shadow: inset 3px 0 var(--accent); }
.device-art { position: relative; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 8px; background: var(--accent-wash); color: var(--accent); }
.device-art::after { content: ""; position: absolute; width: 8px; height: 8px; bottom: 3px; right: 3px; border-radius: 50%; background: var(--present); border: 1px solid var(--surface); }
.device-art .icon { width: 22px; height: 22px; }
.name { font-weight: 630; overflow-wrap: anywhere; }
.row-meta { font-size: .78rem; color: var(--muted); }
.device-send { min-width: 68px; }
.empty { display: grid; justify-items: center; gap: 3px; border: 1px dashed var(--line); border-radius: 9px; padding: 28px 12px; text-align: center; }
.empty > .icon { color: var(--accent); width: 27px; height: 27px; margin-bottom: 4px; }
.empty > p:first-of-type { font-weight: 630; }

.transfers .section-head { margin-bottom: 7px; min-height: 42px; }
.transfer-row, .paired-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-top: 1px solid var(--line); padding-block: 10px; }
.transfer-copy { min-width: 0; flex: 1; }
.transfer-copy .name { font-size: .92rem; }
.transfer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; margin-top: 3px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.route { border: 1px solid var(--line); border-radius: 4px; padding-inline: 5px; font-size: .7rem; line-height: 1.35; }
.transfer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 3px; background: var(--line); accent-color: var(--accent); margin-top: 7px; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

.setup { max-width: 390px; margin-block: 14px; }
.setup h1 { margin-bottom: 7px; }
.setup form { margin-top: 20px; }
label { display: grid; gap: 4px; font-size: .86rem; font-weight: 600; margin-bottom: 11px; }
input, textarea, select { width: 100%; min-width: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: .95rem; }
textarea { resize: vertical; }
.form-error { color: var(--danger); font-size: .85rem; margin-bottom: 9px; }
dialog { width: min(440px, 100% - 28px); max-height: calc(100% - 24px); padding: 15px 17px 17px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--paper); }
dialog::backdrop { background: #10182280; }
.dialog-head { margin-bottom: 9px; }
.command-list { display: grid; }
.command-list button { justify-content: space-between; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; }
.command-list button:last-child { border-bottom: 0; }
.command-list span { font-size: 1.25rem; color: var(--muted); }
#picker-hint { margin-top: 9px; }
.pair-qr { display: block; width: min(100%, 228px); height: auto; margin: 14px auto 16px; image-rendering: pixelated; }
.pair-code { display: block; font: 600 1.28rem/1.3 ui-monospace, Consolas, monospace; letter-spacing: .05em; color: var(--accent); margin-block: 12px; user-select: all; overflow-wrap: anywhere; }
#windows-settings { border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 12px; }
#windows-settings .actions { margin-block: 8px; }
#windows-settings label { margin: 9px 0 0; }
.paired-row .quiet { min-height: 34px; }
.notice { position: fixed; inset: auto 14px 14px auto; z-index: 2; max-width: min(420px, 100% - 28px); padding: 9px 12px; border-radius: 7px; color: var(--text); background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: .87rem; box-shadow: 0 5px 20px #0002; }

@media (max-width: 440px) {
  .shell { width: calc(100% - 28px); }
  .top { min-height: 60px; }
  main { padding-block: 22px 25px; }
  .device-row { gap: 9px; }
  .transfer-row { flex-wrap: wrap; }
  .transfer-actions { justify-content: flex-start; }
}
