:root {
  color-scheme: light;
  --ink: #213343; --muted: #647586; --line: #dde5ec;
  --blue: #466f90; --tint: #eaf1f7; --surface: #fff; --bg: #f5f7fa;
  --sidebar: 224px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .save { min-height: 44px; border: 1px solid #c8d6e1; background: var(--surface); color: var(--ink); border-radius: 9px; padding: 9px 16px; font-weight: 600; cursor: pointer; }
button:hover:not(:disabled), .save:hover { background: var(--tint); }
button.primary { background: var(--blue); border-color: var(--blue); color: white; }
button.primary:hover:not(:disabled) { background: #355c7b; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.quiet { background: transparent; border-color: transparent; font-size: 13px; }
button.icon-button { padding: 4px; min-width: 44px; background: transparent; border: 0; font-size: 24px; }
:focus-visible { outline: 3px solid #80b3d6; outline-offset: 3px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #c8d6e1; background: white; border-radius: 8px; padding: 11px 12px; color: var(--ink); }
input[type=file] { font-size: 13px; }
input[type=file]::file-selector-button { border: 0; background: var(--tint); padding: 7px 10px; border-radius: 5px; color: var(--ink); margin-right: 10px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 18px 0 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.6px; }
h2 { font-size: 27px; line-height: 1.25; letter-spacing: -.7px; margin-bottom: 10px; }
h3 { font-size: 18px; line-height: 1.35; margin-bottom: 10px; letter-spacing: -.3px; }
.muted, .hint, .footnote { color: var(--muted); }
.hint { font-size: 12px; margin: 10px 0 20px; }
.footnote { font-size: 12px; margin: 22px 0 0; }
.eyebrow, .nav-caption, .section-label { font-size: 10px; letter-spacing: 1.5px; font-weight: 700; color: var(--muted); }
.eyebrow { margin-bottom: 8px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.skip-link { position: fixed; z-index: 20; top: -100px; left: 12px; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.skip-link:not(:focus) { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 32px 18px 24px; background: #edf2f6; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 22px; font-weight: 700; letter-spacing: 1px; padding: 0 8px; }
.brand small { display: block; font-weight: 400; letter-spacing: 0; font-size: 11px; color: var(--muted); }
.brand-mark { background: #29465d; color: white; width: 40px; height: 44px; border-radius: 12px; font-size: 27px; text-align: center; position: relative; flex-shrink: 0; }
.brand-mark span { position: absolute; right: 1px; top: -1px; font-size: 16px; color: #bbd5e8; }
.nav-caption { margin: 52px 12px 12px; }
#navigation { display: flex; flex-direction: column; gap: 7px; }
.nav-link { display: flex; gap: 13px; align-items: center; min-height: 48px; padding: 12px 15px; border-radius: 10px; text-decoration: none; font-size: 14px; color: #536a7c; border: 1px solid transparent; }
.nav-link:hover { background: #e2eaf1; }
.nav-link[aria-current=page] { background: #dce8f2; color: #254f70; font-weight: 600; border-color: #d0dfeb; }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mobile-more { display: none; }
.sidebar-note { margin: auto 12px 0; font-size: 12px; color: var(--muted); }
.sidebar-note small { display: block; font-size: 11px; line-height: 1.8; margin-top: 10px; }
.small-dot, #dot, #activity-dot { display: inline-block; width: 7px; height: 7px; background: #9cabb7; border-radius: 50%; flex-shrink: 0; }
.small-dot { margin-right: 7px; }
#dot.online { background: #388267; }
.app { margin-left: var(--sidebar); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 110px; padding: 24px 38px; border-bottom: 1px solid var(--line); }
.topbar .eyebrow { font-size: 9px; letter-spacing: 1.3px; }
.connection-chip { display: flex; gap: 9px; align-items: center; min-width: 0; max-width: 45%; text-decoration: none; border: 1px solid var(--line); background: white; border-radius: 25px; padding: 10px 14px; font-size: 12px; }
#peer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { padding: 36px 38px; width: 100%; max-width: 1350px; margin: 0 auto; flex: 1; }
main:focus { outline: none; }
.page-intro { margin-bottom: 28px; }
.page-intro>p:last-child { color: var(--muted); margin-bottom: 0; }
.overview-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 26px; min-width: 0; }
.connect-card { background: linear-gradient(140deg, #fff, #f0f5f9); }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.card-heading h3 { margin: 0; }
.section-icon { font-size: 32px; color: var(--blue); line-height: 1; }
.pill, .tag { font-size: 11px; border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; color: var(--muted); white-space: nowrap; }
.pill.connected { color: #27674f; background: #edf7f2; border-color: #d0e6da; }
.connect-card .muted { font-size: 14px; min-height: 44px; }
.advanced { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { color: var(--muted); font-size: 13px; cursor: pointer; padding: 8px 0; }
.details-body { padding-top: 4px; }
.details-body label { margin-top: 6px; }
.details-body .hint { margin-bottom: 0; }
dl { margin: 0; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.hash-value { font-family: Consolas, monospace; font-size: 12px; }
#update-status { font-size: 13px; overflow-wrap: anywhere; }
.session-details>div { margin: 0 0 18px; }
.session-details dd { font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.stats-grid dd { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.section-label { margin: 32px 0 14px; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quick-links>a { display: flex; gap: 16px; align-items: center; padding: 21px; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; background: white; }
.quick-links>a:hover { border-color: #9eb8cb; background: #fbfdff; }
.quick-links strong { font-size: 14px; display: block; }
.quick-links small { font-size: 12px; color: var(--muted); display: block; margin-top: 5px; }
.quick-links>a>span:last-child { margin-left: auto; color: var(--blue); }
.quick-symbol { font: 24px Consolas, monospace; color: var(--blue); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 38px 0; padding: 4px 8px 4px 16px; font-size: 13px; border: 1px solid #cddde9; background: #edf4fa; border-radius: 10px; overflow-wrap: anywhere; }
.notice.error { background: #fff1ef; border-color: #efc6c0; color: #8b3b33; }
.view-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.view-heading h2 { font-size: 23px; margin-bottom: 6px; }
.view-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.terminal { border: 1px solid #cad7e2; border-radius: 14px; overflow: hidden; background: #1d2c38; }
.terminal-heading { display: flex; justify-content: space-between; color: #98b0c3; font-size: 10px; letter-spacing: 1.2px; border-bottom: 1px solid #354652; padding: 14px 20px; }
.terminal-heading>span:last-child { letter-spacing: 0; }
.terminal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #7b9db6; margin-right: 8px; }
pre { color: #dce7ef; background: #1d2c38; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; height: clamp(200px, 40dvh, 550px); margin: 0; padding: 22px; font: 14px/1.65 Consolas, "Cascadia Code", monospace; }
.composer { background: white; padding: 15px 20px; }
.composer label { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
textarea { font: 14px/1.6 Consolas, monospace; min-height: 46px; max-height: 220px; resize: vertical; background: #f9fbfd; tab-size: 4; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.editor-footer .hint { margin: 0; }
.editor-footer .buttons { gap: 5px; flex-wrap: wrap; }
.transfer-summary>p { font-size: 13px; overflow-wrap: anywhere; }
.transfer-summary .hint { margin-bottom: 0; }
.browse-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.browse-toolbar button { padding: 8px 10px; font-size: 12px; }
.path-row { display: flex; gap: 8px; }
.browse-list { margin-top: 16px; max-height: 370px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.browse-empty { padding: 20px; margin: 0; font-size: 13px; color: var(--muted); }
button.file-row { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; padding: 11px 12px; font-weight: 400; }
button.file-row:last-child { border-bottom: 0; }
button.file-row[aria-pressed=true] { background: #dce8f2; box-shadow: inset 3px 0 var(--blue); }
.file-icon { color: var(--blue); flex-shrink: 0; font-size: 19px; }
.file-name { overflow-wrap: anywhere; min-width: 0; font-size: 13px; }
.file-meta { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.browse-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.browse-footer button { padding: 5px 12px; min-width: 44px; font-size: 20px; }
.selected-file { overflow-wrap: anywhere; font-size: 13px; margin: 20px 0 12px; }
progress { width: 100%; height: 7px; accent-color: var(--blue); margin: 6px 0 16px; }
.save { display: block; text-decoration: none; text-align: center; color: #27674f; background: #edf7f2; border-color: #c8dfd2; margin: 8px 0 20px; overflow-wrap: anywhere; }
.activity { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 38px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--bg); position: sticky; bottom: 0; z-index: 3; }
.activity>span { display: flex; align-items: center; gap: 8px; min-width: 0; }
#operation { overflow-wrap: anywhere; }
#activity-dot.busy { background: #527fa2; box-shadow: 0 0 0 3px #dce7f0; }
.activity a { white-space: nowrap; text-decoration: none; font-weight: 600; color: var(--blue); }
@media (max-width: 1100px) {
  :root { --sidebar: 190px; }
  .sidebar { padding-inline: 12px; }
  .topbar, main { padding-inline: 26px; }
  .overview-grid { gap: 16px; }
  .card { padding: 21px; }
  .notice { margin-inline: 26px; }
  .quick-links>a { padding: 17px; gap: 12px; }
}
@media (max-width: 850px) {
  .overview-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; gap: 12px; }
  .stats-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .sidebar { top: auto; width: 100%; height: calc(66px + env(safe-area-inset-bottom)); padding: 5px 12px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); background: #fff; }
  .brand, .nav-caption, .sidebar-note { display: none; }
  #navigation { flex-direction: row; height: 56px; gap: 8px; }
  .nav-link { flex: 1; flex-direction: column; gap: 3px; padding: 5px 4px; min-height: 52px; font-size: 10px; border-radius: 8px; }
  .nav-link svg { width: 20px; height: 20px; }
  .desktop-extra { display: none; }
  .mobile-more { display: block; flex: 1; }
  .mobile-more summary { text-align: center; list-style: none; padding: 16px 4px; }
  .more-list { position: absolute; bottom: 100%; right: 12px; width: 210px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 -8px 32px #21334315; }
  .more-list .nav-link { flex-direction: row; font-size: 14px; gap: 12px; padding: 12px; }
  .app { margin-left: 0; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 82px; padding: 19px 18px; gap: 14px; }
  .topbar .eyebrow { display: none; }
  h1 { font-size: 21px; }
  .connection-chip { max-width: 58%; padding: 9px 11px; font-size: 11px; }
  main { padding: 25px 18px; }
  h2 { font-size: 25px; }
  .page-intro>p:last-child { font-size: 14px; }
  .card { padding: 21px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .notice { margin: 14px 18px 0; }
  .view-heading { gap: 10px; }
  .view-heading h2 { font-size: 22px; }
  .view-heading .tag { font-size: 10px; }
  .view-heading .quiet { padding-inline: 8px; white-space: nowrap; }
  input, select, textarea, .transfer-card input { font-size: 16px; }
  pre { font-size: 13px; padding: 18px; height: clamp(180px, 35dvh, 400px); }
  .composer { padding: 14px; }
  .editor-footer { align-items: flex-start; flex-direction: column-reverse; gap: 9px; }
  .editor-footer .buttons { width: 100%; justify-content: space-between; }
  .editor-footer .hint { font-size: 10px; }
  .activity { padding: 12px 18px; bottom: calc(66px + env(safe-area-inset-bottom)); font-size: 11px; }
  .activity a { font-size: 10px; }
}
/* Two devices, one file workspace. */
.device-panes { display: grid; grid-template-columns: minmax(0,1fr) 128px minmax(0,1fr); gap: 16px; align-items: stretch; }
.device-pane { padding: 20px; }
.device-pane .card-heading { margin-bottom: 18px; }
.device-pane .browse-list { height: clamp(180px, 28dvh, 320px); max-height: 320px; }
.device-pane .selected-file { margin-bottom: 0; min-height: 22px; }
.device-pane input { font-size: 13px; }
.device-pane .browse-toolbar { min-height: 44px; }
.transfer-controls { align-self: center; min-width: 0; text-align: center; }
.transfer-controls button { width: 100%; padding-inline: 8px; font-size: 13px; }
.transfer-controls .hint { overflow-wrap: anywhere; margin: 9px 0 24px; font-size: 11px; }
.transfer-summary { margin-top: 24px; }
.transfer-summary progress { margin-bottom: 0; }
.transfer-summary .save { width: fit-content; }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
input[readonly] { background: #f5f7fa; }
@media (max-width: 1080px) {
  .device-panes { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .transfer-controls { grid-column: 1/-1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  #upload { grid-column: 2; grid-row: 1; }
  #upload-target { grid-column: 2; grid-row: 2; }
  #download { grid-column: 1; grid-row: 1; }
  #download-target { grid-column: 1; grid-row: 2; }
}
@media (max-width: 760px) {
  .device-panes, .manual-grid { grid-template-columns: minmax(0,1fr); }
  #local-pane { grid-row: 1; }
  #remote-pane { grid-row: 2; }
  .transfer-controls { grid-row: 3; gap: 0 14px; }
  .device-pane input { font-size: 16px; }
  .device-pane .browse-list { height: 240px; max-height: 240px; }
  .view-heading button { white-space: nowrap; }
}

.tool-group { margin-block:24px; }
.tool-group textarea { width:100%; resize:vertical; min-height:90px; }
.tool-group .buttons { margin-top:12px; }
.process-scroll { max-height:360px; overflow:auto; }
.process-table { width:100%; border-collapse:collapse; font-size:13px; }
.process-table th, .process-table td { padding:8px; text-align:left; border-bottom:1px solid #e1e7ed; }
.process-table button { text-align:left; width:100%; overflow-wrap:anywhere; }
.process-table button[aria-pressed="true"] { background:#dbeaf2; border-color:#547d95; }
#system-data { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }

.category-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
.category-nav button[aria-pressed=true] { background:var(--blue); color:white; border-color:var(--blue); }
.check-label { display:flex; align-items:center; gap:10px; font-weight:400; }
.check-label input { width:18px; height:18px; flex-shrink:0; }
#capture-preview { display:block; max-width:100%; max-height:480px; object-fit:contain; margin-bottom:16px; }
[data-action-group] > .card > button { margin-top:12px; }

.folder-row { display:flex; gap:6px; align-items:center; }
.folder-row .file-row { flex:1; min-width:0; }
.folder-row > button:last-child[aria-pressed=true] { background:var(--tint); border-color:var(--blue); }

.editor-footer { flex-wrap:wrap; }

.live-card { grid-column:1/-1; }
.live-settings { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.view-surface { background:#1d2d3a; border-radius:10px; overflow:auto; max-height:70vh; text-align:center; color:#c5d5df; min-height:180px; }
#view-empty { padding:55px 20px; }
#view-canvas { display:block; margin:auto; max-width:100%; height:auto; }
@media(max-width:760px){.live-settings { grid-template-columns:repeat(2,minmax(0,1fr)); }}

#view-panel:fullscreen { box-sizing:border-box; width:100%; height:100%; overflow:auto; background:var(--bg,#101820); padding:16px; }
#view-panel:fullscreen .view-surface { max-height:none; }
#view-canvas.controlling { touch-action:none; cursor:crosshair; }
#view-canvas:focus { outline:3px solid #48b7be; outline-offset:-3px; }
