/* Arus 3.0: quiet surfaces.
   Flat tonal layers, no hairlines, one accent: the text colour itself. */

:root {
  --bg: #090a0c;
  --panel: #0c0d10;
  --panel-2: #111316;
  --surface: #111316;
  --surface-2: #17191d;
  --surface-3: #1e2126;
  --raised: #262a30;
  --hover: #17191d;
  --sel: #1e2126;
  --field: #14161a;
  --text: #f4f5f2;
  --muted: #a4a8ae;
  --faint: #7f838a;
  --accent: #f4f5f2;
  --accent-hover: #ffffff;
  --accent-ink: #0a0b0d;
  --danger: #e0837a;
  --danger-solid: #a8443c;
  --danger-on: #fff7f5;
  --focus: #b9bdc4;
  --focus-ring: rgba(255, 255, 255, 0.16);
  --track: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.62);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.4);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;
  --sheen: rgba(255, 255, 255, 0.035);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #ecece8;
  --panel: #f2f2ef;
  --panel-2: #fbfbf9;
  --surface: #fbfbf9;
  --surface-2: #f3f3ef;
  --surface-3: #e7e7e1;
  --raised: #ffffff;
  --hover: #e8e8e3;
  --sel: #e2e2dc;
  --field: #e9e9e4;
  --text: #17181b;
  --muted: #5b5f65;
  --faint: #71757b;
  --accent: #17181b;
  --accent-hover: #2c2d33;
  --accent-ink: #fbfbf9;
  --danger: #a83a33;
  --danger-solid: #a83a33;
  --danger-on: #ffffff;
  --focus: #4c5058;
  --focus-ring: rgba(20, 22, 26, 0.18);
  --track: rgba(20, 22, 26, 0.12);
  --border: rgba(20, 22, 26, 0.08);
  --border-strong: rgba(20, 22, 26, 0.16);
  --shadow: 0 32px 80px rgba(23, 24, 27, 0.18);
  --shadow-soft: 0 18px 44px rgba(23, 24, 27, 0.12);
  --sheen: rgba(255, 255, 255, 0.7);
  color-scheme: light;
}

body {
  background: var(--bg);
  font-size: 13px;
}

::selection {
  background: var(--surface-3);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

kbd {
  border: 0;
  border-radius: 4px;
  padding: 0 5px;
  background: rgba(127, 127, 127, 0.14);
  color: var(--faint);
}

/* Title bar */

.titlebar {
  height: 38px;
  padding: 0 6px 0 14px;
  border-bottom: 0;
  background: var(--panel);
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.brand-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.window-btn {
  border-radius: 7px;
  color: var(--faint);
}

.window-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.window-btn.close:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* Sidebar */

.sidebar {
  padding: 12px 10px 10px;
  border-right: 0;
  background: var(--panel);
}

.new-download {
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.new-download:hover {
  background: var(--accent-hover);
  border: 0;
}

.new-download kbd {
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  opacity: 0.55;
}

.nav-label {
  margin: 20px 9px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--faint);
}

.nav {
  gap: 2px;
}

.nav-item {
  height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
}

.nav-item .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.nav-item .count {
  font-size: 10.5px;
  color: var(--faint);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: none;
}

.nav-item.is-active .icon {
  color: var(--text);
}

.nav-item.is-active .count {
  color: var(--muted);
}

.side-card {
  margin-top: auto;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
}

.side-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.side-card-head .mono {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.side-bar {
  height: 4px;
  margin: 10px 0 9px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}

.side-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--text);
  transition: width 0.3s ease;
}

.side-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  margin-top: 10px;
  padding: 10px 2px 0;
  border-top: 0;
}

.live-speed {
  font-size: 11px;
  color: var(--muted);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--faint);
}

.live-dot.is-live {
  background: var(--text);
}

/* Workspace */

.workspace-head {
  align-items: center;
  padding: 22px 24px 16px;
}

.head-copy h1 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.head-copy p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--faint);
}

.head-tools {
  gap: 8px;
}

.searchbox {
  width: 240px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--faint);
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.searchbox:focus-within {
  border: 0;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.searchbox input {
  font-size: 12px;
}

.searchbox kbd {
  font-size: 9.5px;
}

.icon-btn {
  border: 0;
  border-radius: 9px;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn.framed {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
}

.icon-btn.framed:hover {
  border: 0;
  background: var(--surface-2);
}

.add-btn {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

.add-btn:hover {
  background: var(--accent-hover);
  border: 0;
}

/* Instrument strip */

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 24px 12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  flex: none;
}

.metric {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 13px 9px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.metric:first-child {
  border-left: 0;
}

.metric:hover {
  background: transparent;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 12px;
}

.metric-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.metric-icon {
  display: none;
}

.metric-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.metric-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.metric-live.is-live {
  color: var(--muted);
}

.metric-live.is-live::before {
  background: var(--text);
  animation: live-pulse 1.8s ease-in-out infinite;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 5px;
}

.metric-value strong {
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.metric-speed .metric-value strong {
  font-size: 20px;
}

.metric-unit {
  font-size: 10.5px;
  color: var(--faint);
}

.metric-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.metric-chart {
  position: relative;
  flex: none;
  height: 24px;
  margin-top: 5px;
  border-bottom: 1px solid var(--border);
}

.metric-chart-note {
  display: none;
}

.metric-spark {
  width: 100%;
  height: 24px;
  margin: 0;
  display: block;
  overflow: visible;
}

.metric-slots {
  display: none;
}

.metric-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 7px;
}

.metric-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 15px;
  color: var(--faint);
  font-size: 10px;
}

.metric-rows strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 7px;
  font-size: 9.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.metric-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stage */

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px 8px;
}

.stage-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.stage-sep {
  width: 1px;
  height: 9px;
  background: var(--border-strong);
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.stage-actions .quiet {
  height: 24px;
  padding: 0 8px;
  font-size: 10.5px;
}

.stage-actions .quiet:disabled {
  opacity: 0.4;
}

.quiet {
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  color: var(--faint);
  font-size: 11px;
}

.quiet:hover {
  background: var(--surface-2);
  color: var(--text);
}

.stage {
  margin: 0 24px 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
  scrollbar-gutter: stable;
}

.list {
  gap: 0;
}

.list-head {
  display: none !important;
}

/* Groups */

.group {
  display: flex;
  flex-direction: column;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 5px;
  border: 0;
}

.group + .group .group-head {
  padding-top: 14px;
  border: 0;
}

.group-head .group-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.group-head .group-count {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.group-head .group-meta {
  margin-left: auto;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Rows */

.row {
  grid-template-columns: 32px minmax(0, 1fr) 96px 88px;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  transition: background 0.14s ease;
}

.group-rows .row:last-child {
  border-bottom: 0;
}

.row:hover {
  background: var(--hover);
}

.row.is-selected {
  background: var(--sel);
  box-shadow: inset 2px 0 0 var(--text);
}

.row:focus-visible {
  outline-offset: -2px;
}

.row-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.row:hover .row-icon {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--muted);
}

.row.is-selected .row-icon {
  background: transparent;
  border-color: var(--muted);
  color: var(--text);
}

.row[data-status="downloading"] .row-icon {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.row[data-status="completed"] .row-icon {
  color: var(--faint);
}

.row[data-status="failed"] .row-icon {
  border-color: var(--danger);
  color: var(--danger);
}

.row-icon .icon {
  width: 15px;
  height: 15px;
}

.row-name {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.row[data-priority="high"] .row-name::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--text);
  vertical-align: 1px;
}

.row[data-priority="low"] .row-name {
  color: var(--muted);
}

.row-tag {
  padding: 1px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  font-size: 8.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.row-tag[hidden] {
  display: none;
}

.row-tag::before {
  content: none;
  margin: 0;
}

.row-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--faint);
}

.row-bar {
  height: 2px;
  margin-top: 7px;
  border-radius: 0;
  background: var(--track);
  overflow: hidden;
}

.row-fill {
  border-radius: inherit;
  background: var(--text);
  transition: width 0.25s ease;
}

.row[data-status="paused"] .row-fill {
  background: var(--faint);
}

.row[data-status="completed"] .row-fill {
  background: var(--faint);
}

.row[data-status="failed"] .row-fill {
  background: var(--danger);
}

.row-state strong {
  font-size: 12px;
  font-weight: 500;
}

.row-state small {
  max-width: 94px;
  font-size: 10.5px;
  color: var(--faint);
}

.row-actions {
  gap: 2px;
  opacity: 1;
}

.row-actions .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  color: var(--faint);
}

.row-actions .icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.row-error {
  margin-top: 5px;
  overflow: hidden;
  font-size: 10.5px;
  color: var(--danger);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Row action menu */

.row-menu {
  position: fixed;
  z-index: 80;
  min-width: 186px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  box-shadow: var(--shadow-soft);
}

.row-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 27px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.row-menu button:hover,
.row-menu button:focus-visible {
  background: var(--surface-3);
  outline: none;
}

.row-menu button:disabled {
  opacity: 0.38;
  cursor: default;
}

.row-menu button.is-danger {
  color: var(--danger);
}

.row-menu .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
  flex: none;
}

.row-menu button.is-danger .icon {
  color: inherit;
}

.row-menu .menu-check {
  width: 12px;
  height: 12px;
  margin-left: auto;
}

.row-menu-sep {
  height: 1px;
  margin: 3px 6px;
  background: var(--border);
}

/* Empty state */

.empty {
  padding: 44px 20px;
}

.empty-inner {
  max-width: 380px;
}

.empty-glyph {
  position: relative;
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-glyph::after {
  content: none;
  display: none;
}

.empty-glyph .icon {
  width: 22px;
  height: 22px;
}

.empty h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.empty p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
}

.empty-actions {
  gap: 8px;
  margin-top: 18px;
}

.empty-hint {
  margin-top: 16px !important;
  font-size: 10.5px !important;
}

/* Buttons */

.ghost,
.primary {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.ghost {
  background: var(--surface-2);
  color: var(--text);
}

.ghost:hover {
  background: var(--surface-3);
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.primary:hover {
  background: var(--accent-hover);
}

.primary.is-danger {
  border: 0;
  background: var(--danger-solid);
  color: var(--danger-on);
}

/* Inspector */

.inspector {
  border-left: 0;
  background: var(--panel);
}

.inspector-head {
  padding: 16px 16px 8px;
  border-bottom: 0;
}

.inspector-ident {
  gap: 11px;
}

.detail-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--muted);
}

.detail-icon .icon {
  width: 17px;
  height: 17px;
}

.inspector-head h2 {
  font-size: 13px;
  letter-spacing: -0.01em;
}

#detail-host {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--faint);
}

.inspector-body {
  gap: 12px;
  padding: 8px 16px 20px;
}

.detail-summary {
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.detail-ring {
  position: relative;
  width: 76px;
  height: 76px;
  flex: none;
}

.detail-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.detail-ring .ring-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 4;
}

.detail-ring .ring-fill {
  fill: none;
  stroke: var(--text);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 201.06;
  transition: stroke-dashoffset 0.3s ease;
}

.detail-ring[data-status="queued"] .ring-fill {
  stroke: var(--faint);
}

.detail-ring[data-status="failed"] .ring-fill {
  stroke: var(--danger);
}

.detail-percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.detail-percent[data-empty="true"] {
  font-size: 12px;
  color: var(--faint);
}

.detail-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 0;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.status-chip[data-status="downloading"] {
  color: var(--text);
  background: var(--surface-3);
}

.status-chip[data-status="downloading"]::before {
  background: var(--text);
  animation: live-pulse 1.8s ease-in-out infinite;
}

.status-chip[data-status="completed"]::before {
  background: var(--muted);
}

.status-chip[data-status="failed"] {
  color: var(--danger);
}

.status-chip[data-status="failed"]::before {
  background: var(--danger);
}

.detail-live {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.detail-live strong {
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.detail-live span {
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
}

.detail-note {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--faint);
}

.detail-hero-copy .detail-note {
  margin-top: 1px;
}

.detail-meter {
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}

.detail-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--text);
  transition: width 0.3s ease;
}

.detail-meter[data-status="queued"] .detail-meter-fill {
  background: var(--faint);
}

.detail-meter[data-status="failed"] .detail-meter-fill {
  background: var(--danger);
}

.spark {
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
}

.spark-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.section-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.spark-value {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#detail-spark {
  width: 100%;
  height: 42px;
  display: block;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-actions .primary {
  flex: 1 1 100%;
}

.detail-actions .primary,
.detail-actions .ghost {
  min-width: 84px;
  height: 32px;
  padding: 0 10px;
  font-size: 11.5px;
}

.detail-actions .ghost {
  flex: 1 1 30%;
}

.queue-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
}

.queue-block .section-label {
  display: block;
  margin-bottom: 9px;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.priority-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 6px 0 10px;
  border-radius: var(--radius-xs);
  background: var(--field);
}

.priority-field > span {
  font-size: 10px;
  color: var(--faint);
  white-space: nowrap;
}

.priority-field select {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 18px 0 0;
  border: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f838a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1px center;
  color: var(--text);
  font-size: 11.5px;
  text-align: right;
}

.queue-row .ghost {
  height: 32px;
  padding: 0 11px;
  font-size: 11.5px;
  flex: none;
}

#detail-queue-note {
  margin-top: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-top: 0;
}

.detail-grid > div {
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
}

.detail-grid dt {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.detail-grid dd {
  width: 100%;
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 0;
}

.detail-block > .section-label {
  display: block;
}

.segment-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4px, 1fr));
  gap: 2px;
  height: auto;
  max-height: 48px;
  overflow-y: auto;
}

.segment {
  height: 6px;
  border-radius: 2px;
  background: var(--track);
}

.segment.is-done {
  background: var(--text);
}

.segment.is-partial {
  background: var(--muted);
}

#detail-segment-note {
  margin-top: 2px;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--field);
}

.copy-row .mono {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-row .icon-btn {
  width: 26px;
  height: 26px;
}

.detail-block-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-top: 2px;
}

.detail-block-inner .mono {
  font-size: 10px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

.hash-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--field);
}

.hash-row .hash-value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.hash-row .ghost {
  height: 26px;
  padding: 0 9px;
  font-size: 10.5px;
  flex: none;
}

.detail-error {
  margin: 0;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  background: rgba(224, 131, 122, 0.1);
  font-size: 11px;
  line-height: 1.5;
  color: var(--danger);
}

[data-theme="light"] .detail-error {
  background: rgba(168, 58, 51, 0.08);
}

.danger-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 500;
}

.danger-link:hover {
  background: rgba(224, 131, 122, 0.1);
}

[data-theme="light"] .danger-link:hover {
  background: rgba(168, 58, 51, 0.08);
}

.lifetime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lifetime-grid > div {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface);
}

.lifetime-grid span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.lifetime-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Dialogs */

dialog.modal::backdrop {
  background: rgba(4, 5, 7, 0.55);
  backdrop-filter: blur(8px);
}

[data-theme="light"] dialog.modal::backdrop {
  background: rgba(23, 24, 27, 0.28);
}

.modal-card {
  border: 0;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-head {
  padding: 20px 20px 14px;
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--faint);
}

.tabs {
  gap: 2px;
  margin: 0 20px 16px;
  padding: 3px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
}

.tab {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  transition: background 0.14s ease, color 0.14s ease;
}

.tab:hover {
  background: transparent;
  color: var(--text);
}

.tab.is-active {
  background: var(--raised);
  color: var(--text);
  box-shadow: none;
}

.tab-panel {
  padding: 0 20px 4px;
}

.field {
  gap: 6px;
  margin-bottom: 14px;
}

.field > span {
  font-size: 11px;
  color: var(--faint);
}

.field input,
.field select {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--field);
  font-size: 12px;
}

.field textarea {
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--field);
  font-size: 10.5px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border: 0;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.field-hint {
  font-size: 10.5px;
  color: var(--faint);
}

.form-note {
  font-size: 10.5px;
  color: var(--faint);
}

.modal-foot {
  margin-top: 10px;
  padding: 10px 20px 20px;
  border-top: 0;
}

.hint {
  font-size: 10.5px;
  color: var(--faint);
}

.foot-actions {
  gap: 6px;
}

/* Scanner */

.scan-status {
  margin: 0 0 8px;
  padding: 2px 0 8px;
  border-top: 0;
  font-size: 10.5px;
  color: var(--faint);
}

.scan-results {
  gap: 2px;
  padding-bottom: 4px;
}

.scan-item {
  padding: 8px 10px;
  border-bottom: 0;
  border-radius: var(--radius-xs);
  transition: background 0.12s ease;
}

.scan-item:hover {
  background: var(--hover);
}

.scan-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.scan-item .ghost {
  height: 26px;
  padding: 0 9px;
  font-size: 10.5px;
}

/* Settings */

.settings-scroll {
  padding: 0 20px 12px;
}

.settings-section {
  padding: 18px 0;
  border-top: 0;
}

.settings-section:first-child {
  padding-top: 4px;
  border-top: 0;
}

.settings-section h3 {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-copy {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--faint);
}

.toggle-row {
  padding: 9px 0;
  gap: 16px;
}

.toggle-row strong {
  font-size: 12px;
  font-weight: 500;
}

.toggle-row small {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--faint);
}

.switch {
  width: 36px;
  height: 20px;
  border: 0;
  background: var(--track);
}

.switch::after {
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--faint);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle-row input:checked + .switch {
  border: 0;
  background: var(--accent);
}

.toggle-row input:checked + .switch::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}

.toggle-row.compact {
  padding: 4px 0 2px;
}

.theme-picker {
  gap: 8px;
}

.theme-option {
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--field);
  color: var(--faint);
  font-size: 12px;
}

.theme-option:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-option.is-active {
  background: var(--raised);
  color: var(--text);
  box-shadow: none;
}

[data-theme="light"] .theme-option.is-active {
  box-shadow: 0 1px 2px rgba(23, 24, 27, 0.12);
}

.path-box {
  padding: 4px 4px 4px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--field);
}

.path-box .ghost {
  height: 26px;
  padding: 0 9px;
  font-size: 10.5px;
}

.steps {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--faint);
}

.steps strong {
  color: var(--text);
}

/* Toasts */

.toast {
  width: 320px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--raised);
  box-shadow: var(--shadow-soft);
}

.toast-head > .icon {
  color: var(--muted);
}

.toast-title {
  font-size: 12px;
  font-weight: 600;
}

.toast-body {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.toast-actions {
  margin-top: 10px;
}

.toast-actions .ghost,
.toast-actions .primary {
  height: 26px;
  padding: 0 10px;
  font-size: 10.5px;
}

.toast-close {
  border-radius: 7px;
  color: var(--faint);
}

.toast-close:hover {
  background: rgba(127, 127, 127, 0.14);
  color: var(--text);
}

/* Drop overlay */

.drop {
  background: rgba(4, 5, 7, 0.66);
  backdrop-filter: blur(6px);
}

.drop-card {
  padding: 40px 56px;
  border: 0;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.drop-card .icon {
  width: 26px;
  height: 26px;
  color: var(--muted);
}

.drop-card h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.drop-card p {
  font-size: 12px;
  color: var(--faint);
}

/* Scrollbars */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  background-clip: padding-box;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(20, 22, 26, 0.18);
  background-clip: padding-box;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 22, 26, 0.3);
  background-clip: padding-box;
}

/* Responsive */

@media (max-width: 1280px) {
  body.inspector-open .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.inspector-open .metric:nth-child(3),
  body.inspector-open .metric:nth-child(4) {
    display: none;
  }
}

@media (max-width: 1024px) {
  .overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-schedule {
    display: none;
  }

  .inspector {
    box-shadow: -32px 0 64px rgba(0, 0, 0, 0.4);
  }

  [data-theme="light"] .inspector {
    box-shadow: -32px 0 64px rgba(23, 24, 27, 0.16);
  }
}

@media (max-width: 900px) {
  .workspace-head {
    padding: 18px 18px 14px;
  }

  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 18px 10px;
  }

  .metric-library {
    display: none;
  }

  .stage {
    margin: 0 18px 14px;
  }

  .stage-bar {
    padding: 0 18px 8px;
  }

  .row {
    grid-template-columns: 32px minmax(0, 1fr) 88px 88px;
    gap: 10px;
  }

  .row-state small {
    max-width: 88px;
  }

  .searchbox {
    width: 200px;
  }
}

@media (max-width: 760px) {
  .workspace-head {
    padding: 16px 14px 12px;
  }

  .head-copy h1 {
    font-size: 19px;
  }

  .overview {
    margin: 0 14px 10px;
  }

  .stage {
    margin: 0 14px 12px;
  }

  .stage-bar {
    padding: 0 14px 8px;
  }

  .row {
    grid-template-columns: 30px minmax(0, 1fr) 52px 88px;
    gap: 8px;
    padding: 9px 10px;
  }

  .row-state small {
    display: none;
  }

  .row-state strong {
    font-size: 11px;
  }

  .row-actions {
    opacity: 1;
  }

  .searchbox {
    width: 160px;
  }
}

@media (hover: none) {
  .row-actions {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .overview {
    display: none;
  }

  .head-tools .searchbox {
    display: none;
  }

  .metric-spark {
    display: none;
  }

  .empty-actions {
    flex-direction: column;
    width: 100%;
  }

  .empty-actions .ghost,
  .empty-actions .primary {
    width: 100%;
  }
}

/* 3.1: layered workspace, tabbed settings, about and privacy */

.sidebar-tools {
  display: flex;
  align-items: center;
  gap: 1px;
}

.sidebar-tools .icon-btn {
  width: 28px;
  height: 28px;
}

.sidebar-tools .icon-btn .icon {
  width: 15px;
  height: 15px;
}

/* Empty state */

body.library-empty .overview,
body.library-empty .stage-bar {
  display: none;
}

body.library-empty .stage {
  margin-top: 2px;
}

.empty-inner {
  max-width: 420px;
}

.empty-glyph {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.empty-glyph .icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.5;
}

.empty-eyebrow {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.empty h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.empty p {
  max-width: 440px;
  font-size: 12px;
}

.empty-steps,
.empty-features {
  display: none !important;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}

.empty-actions .primary {
  margin-top: 0;
}

.empty-hint {
  margin-top: 14px !important;
}

/* Segmented control */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--field);
}

.segmented-option {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
}

.segmented-option:hover {
  color: var(--text);
}

.segmented-option.is-active {
  background: var(--raised);
  color: var(--text);
}

[data-theme="light"] .segmented-option.is-active {
  box-shadow: 0 1px 2px rgba(23, 24, 27, 0.1);
}

/* Settings dialog */

dialog.settings-modal {
  width: min(900px, calc(100vw - 40px));
}

.settings-card {
  max-height: min(88vh, 800px);
}

.settings-head {
  padding-bottom: 14px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.settings-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 0 12px 14px 16px;
  overflow-y: auto;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.settings-tab .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.settings-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.settings-tab:hover .icon,
.settings-tab.is-active .icon {
  color: var(--text);
}

.settings-tab.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.settings-tab:focus-visible {
  outline-offset: -2px;
}

.settings-rail-sep {
  height: 1px;
  margin: 8px 10px;
  background: var(--border);
  flex: none;
}

.settings-panels {
  min-width: 0;
  min-height: 0;
  padding: 2px 24px 20px 12px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.settings-panel {
  animation: panel-in 0.16s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.settings-panel-head {
  margin-bottom: 18px;
}

.settings-panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.settings-panel-head p {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.settings-group {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.settings-group h4 {
  margin: 0 0 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-group .lifetime-grid {
  margin-top: 10px;
}

.settings-foot {
  margin-top: 0;
  padding: 12px 24px 16px;
  border-top: 0;
}

.settings-fineprint {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

/* Browser capture status */

.status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.status-pill.is-off i {
  background: var(--faint);
}

.status-note {
  color: var(--faint);
  font-size: 10.5px;
}

.shortcut-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 10px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.shortcut-list kbd {
  background: var(--field);
  color: var(--muted);
  white-space: nowrap;
}

/* About */

.about-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 0 16px;
}

.about-mark {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  box-shadow: var(--shadow-soft);
}

.about-hero h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.about-version {
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.about-hero p {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 11.5px;
}

.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 16px;
}

.about-facts > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.about-facts span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.about-facts strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.about-facts .mono {
  color: var(--muted);
  font-size: 10.5px;
}

.about-facts .wide {
  grid-column: 1 / -1;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.about-actions .ghost {
  height: 30px;
  font-size: 11px;
}

/* Privacy */

.policy-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.policy-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.policy-block {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.policy-block h4 {
  margin: 0 0 7px;
  font-size: 11.5px;
  font-weight: 600;
}

.policy-block ul {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding-left: 16px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}

.policy-block li::marker {
  color: var(--faint);
}

.policy-block .mono {
  color: var(--muted);
  font-size: 10.5px;
}

.settings-panel[data-settings-panel="privacy"] .status-pill i {
  background: var(--text);
}

/* Density and reduced motion */

[data-density="compact"] .row {
  padding: 6px 10px;
}

[data-density="compact"] .row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

[data-density="compact"] .row-icon .icon {
  width: 15px;
  height: 15px;
}

[data-density="compact"] .row-name {
  font-size: 12px;
}

[data-density="compact"] .group-head {
  padding: 10px 10px 4px;
}

[data-density="compact"] .group + .group .group-head {
  padding-top: 13px;
}

[data-motion="reduce"] *,
[data-motion="reduce"] *::before,
[data-motion="reduce"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

[data-motion="reduce"] .metric-live.is-live::before {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .metric-live.is-live::before {
    animation: none;
  }
}

/* Responsive overview and settings */

body.inspector-open .overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.inspector-open .metric-library,
body.inspector-open .metric-schedule {
  display: none;
}

@media (max-width: 760px) {
  .empty-steps {
    grid-template-columns: minmax(0, 1fr);
    max-width: 420px;
  }

  dialog.settings-modal {
    width: calc(100vw - 20px);
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-rail {
    flex-direction: row;
    gap: 2px;
    padding: 0 14px 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .settings-tab {
    height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .settings-tab span {
    display: none;
  }

  .settings-rail-sep {
    width: 1px;
    height: 18px;
    margin: 6px 5px;
  }

  .settings-panels {
    padding: 4px 18px 16px;
  }

  .shortcut-list,
  .about-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-head,
  .settings-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 520px) {
  .overview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "speed"
      "queue";
  }

  .metric-actions {
    flex-wrap: nowrap;
  }

  .metric-actions .quiet {
    white-space: nowrap;
    font-size: 10px;
    padding: 0 6px;
  }

  .metric-foot {
    flex-wrap: wrap;
    row-gap: 2px;
  }
}


/* ===== macOS skin (Arus 4.0) ===== */

/* Arus 4.0: macOS-inspired design language.
   Loaded after styles.css and theme.css; overrides the visual layer only. */

:root {
  --font-ui: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --bg: #1a1b1c;
  --panel: rgba(32, 35, 36, 0.18);
  --panel-2: rgba(37, 40, 41, 0.2);
  --surface: rgba(37, 40, 41, 0.22);
  --surface-2: rgba(46, 49, 50, 0.2);
  --surface-3: rgba(58, 61, 63, 0.24);
  --raised: rgba(58, 61, 63, 0.26);
  --hover: rgba(255, 255, 255, 0.055);
  --sel: rgba(10, 132, 255, 0.9);
  --field: rgba(25, 28, 29, 0.32);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #8e8e93;
  --accent: #0a84ff;
  --accent-hover: #3d9bff;
  --accent-ink: #ffffff;
  --accent-glass: radial-gradient(150% 130% at 18% 0%, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.06) 46%, rgba(255, 255, 255, 0) 64%), linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(10, 132, 255, 0.22) 100%);
  --accent-glass-hover: radial-gradient(150% 130% at 18% 0%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.08) 46%, rgba(255, 255, 255, 0) 64%), linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(10, 132, 255, 0.32) 100%);
  --accent-glass-sel: radial-gradient(150% 130% at 18% 0%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.03) 48%, rgba(255, 255, 255, 0) 66%), linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(10, 132, 255, 0.26) 100%);
  --accent-glass-rim: rgba(140, 200, 255, 0.45);
  --danger: #ff453a;
  --danger-solid: #d70015;
  --danger-on: #ffffff;
  --focus: #0a84ff;
  --focus-ring: rgba(10, 132, 255, 0.32);
  --track: rgba(120, 120, 128, 0.24);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.42);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sheen: rgba(255, 255, 255, 0.06);
  --green: #30d158;
  --red: #ff453a;
  --yellow: #febc2e;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #e8ece9;
  --panel: rgba(255, 255, 255, 0.3);
  --panel-2: rgba(255, 255, 255, 0.34);
  --surface: rgba(255, 255, 255, 0.38);
  --surface-2: rgba(246, 249, 246, 0.34);
  --surface-3: rgba(236, 240, 236, 0.38);
  --raised: rgba(255, 255, 255, 0.46);
  --hover: rgba(0, 0, 0, 0.045);
  --sel: rgba(0, 122, 255, 0.9);
  --field: rgba(255, 255, 255, 0.42);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --accent: #007aff;
  --accent-hover: #2b8fff;
  --accent-ink: #ffffff;
  --accent-glass: radial-gradient(150% 130% at 18% 0%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.06) 46%, rgba(255, 255, 255, 0) 64%), linear-gradient(180deg, rgba(0, 122, 255, 0.92) 0%, rgba(0, 82, 204, 0.9) 100%);
  --accent-glass-hover: radial-gradient(150% 130% at 18% 0%, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.08) 46%, rgba(255, 255, 255, 0) 64%), linear-gradient(180deg, rgba(10, 132, 255, 0.94) 0%, rgba(0, 96, 224, 0.92) 100%);
  --accent-glass-sel: linear-gradient(180deg, rgba(0, 122, 255, 0.9) 0%, rgba(0, 90, 210, 0.86) 100%);
  --accent-glass-rim: rgba(255, 255, 255, 0.5);
  --danger: #ff3b30;
  --danger-solid: #d70015;
  --danger-on: #ffffff;
  --focus: #007aff;
  --focus-ring: rgba(0, 122, 255, 0.26);
  --track: rgba(120, 120, 128, 0.2);
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.14);
  --sheen: rgba(255, 255, 255, 0.8);
  --green: #28a745;
  --red: #ff3b30;
  --yellow: #febc2e;
  color-scheme: light;
}

html,
body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  letter-spacing: -0.006em;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
}

.mono,
.hash-value,
#detail-url,
#detail-path,
#about-data,
#about-extension,
#ext-path {
  font-family: "SF Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;
  letter-spacing: 0;
}

::selection {
  background: rgba(10, 132, 255, 0.32);
  color: var(--text);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

kbd {
  min-width: 18px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(120, 120, 128, 0.16);
  color: var(--faint);
  font-family: var(--font-ui);
  font-size: 10px;
  text-align: center;
}

/* Title bar: traffic lights, centred title, status right */

.titlebar {
  position: relative;
  height: 46px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  gap: 7px;
  pointer-events: none;
}

.brand-mark {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 0;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.window-controls {
  gap: 8px;
  align-items: center;
  margin-right: auto;
}

.window-btn {
  width: 12px;
  height: 12px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  background: transparent;
  transition: filter 0.12s ease;
}

.window-btn .icon {
  width: 7px;
  height: 7px;
  stroke-width: 2.6;
  color: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.window-controls:hover .window-btn .icon {
  opacity: 1;
}

.window-btn.close {
  background: #ff5f57;
}

.window-btn[data-window="minimize"] {
  background: #febc2e;
}

.window-btn[data-window="maximize"] {
  background: #28c840;
}

.window-btn:hover,
.window-btn.close:hover {
  background: inherit;
  filter: brightness(0.9);
}

.window-btn.close:hover {
  background: #ff5f57;
}

/* Layout */

.main {
  height: calc(100% - 46px);
  grid-template-columns: 236px minmax(0, 1fr);
}

body.inspector-open .main {
  grid-template-columns: 236px minmax(0, 1fr) 324px;
}

/* Sidebar */

.sidebar {
  padding: 12px 10px 10px;
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.new-download {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--accent-glass-rim);
  border-radius: 7px;
  background: var(--accent-glass);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.18);
}

.new-download:hover {
  background: var(--accent-glass-hover);
  border-color: var(--accent-glass-rim);
}

.new-download .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.new-download kbd {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  opacity: 0.9;
}

.new-download:active {
  filter: brightness(0.92);
}

.nav-label {
  margin: 18px 8px 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--faint);
}

.nav {
  gap: 1px;
}

.nav-item {
  height: 28px;
  padding: 0 8px;
  gap: 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

.nav-item .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.nav-item .count {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--accent-glass-sel);
  color: var(--accent-ink);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 0 0 1px var(--accent-glass-rim),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-item.is-active .icon,
.nav-item.is-active .count {
  color: rgba(255, 255, 255, 0.92);
}

.side-card {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.side-card-head {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--faint);
}

.side-card-head .mono {
  font-size: 10.5px;
  color: var(--muted);
}

.side-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--track);
}

.side-bar > span {
  border-radius: 99px;
  background: var(--accent);
}

.side-card-foot {
  font-size: 10.5px;
  color: var(--faint);
}

.sidebar-foot {
  padding-top: 8px;
}

.live-speed {
  font-size: 11.5px;
  color: var(--muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--faint);
  opacity: 0.6;
}

.live-dot.is-live {
  background: var(--green);
  opacity: 1;
  box-shadow: 0 0 0 2.5px rgba(48, 209, 88, 0.16);
}

.sidebar-tools .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

/* Workspace head */

.workspace {
  background: var(--bg);
}

.workspace-head {
  padding: 20px 24px 16px;
}

.head-copy h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.head-copy p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.head-tools {
  gap: 8px;
}

.searchbox {
  width: 248px;
  height: 30px;
  padding: 0 9px;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(120, 120, 128, 0.16);
}

.searchbox:focus-within {
  background: var(--field);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.searchbox .icon {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

.searchbox input {
  font-size: 13px;
}

.searchbox input::placeholder {
  color: var(--faint);
}

.searchbox kbd {
  border-color: transparent;
  background: rgba(120, 120, 128, 0.18);
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.icon-btn.framed {
  border: 1px solid var(--border);
  background: var(--surface);
}

.icon-btn.framed:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.add-btn {
  height: 30px;
  padding: 0 13px;
  gap: 6px;
  border: 1px solid var(--accent-glass-rim);
  border-radius: 7px;
  background: var(--accent-glass);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.18);
}

.add-btn:hover {
  background: var(--accent-glass-hover);
  border-color: var(--accent-glass-rim);
}

.add-btn:active {
  filter: brightness(0.92);
}

.add-btn .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

/* Overview: separate rounded cards */

.overview {
  gap: 12px;
  margin: 0 24px 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.metric {
  padding: 12px 14px 11px;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.metric:first-child {
  border-left: 1px solid var(--border);
}

.metric:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.metric-live {
  font-size: 10.5px;
  letter-spacing: 0;
}

.metric-live.is-live {
  color: var(--green);
}

.metric-live.is-live::before {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.16);
}

.metric-value strong {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.metric-speed .metric-value strong {
  font-size: 22px;
}

.metric-unit {
  font-size: 11px;
}

.metric-chip {
  height: 17px;
  padding: 0 6px;
  border: 0;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.18);
  color: var(--muted);
  font-size: 9.5px;
}

.metric-chart {
  height: 24px;
  margin-top: 6px;
  border-bottom: 1px solid var(--border);
}

.metric-rows > div {
  font-size: 11px;
  color: var(--faint);
}

.metric-rows strong {
  font-size: 11.5px;
  font-weight: 600;
}

.metric-foot {
  font-size: 10.5px;
}

/* Stage bar */

.stage-bar {
  padding: 0 24px 10px;
}

.stage-stats {
  gap: 8px;
  font-size: 11.5px;
  color: var(--faint);
}

.stage-sep {
  height: 11px;
  background: var(--border-strong);
}

.stage-actions {
  gap: 4px;
}

.quiet {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.quiet:hover {
  background: var(--hover);
  color: var(--text);
}

.quiet:disabled {
  opacity: 0.4;
}

/* Grouped download list */

.stage {
  margin: 0 24px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.group-head {
  padding: 12px 14px 4px;
}

.group + .group .group-head {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.group-head .group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--faint);
}

.group-head .group-count {
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.18);
  font-size: 10px;
}

.group-head .group-meta {
  font-size: 10.5px;
}

.row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.row:hover {
  background: var(--hover);
}

.row.is-selected {
  background: var(--accent-glass-sel);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 0 0 1px var(--accent-glass-rim);
}

.row.is-selected .row-name {
  color: #fff;
}

.row.is-selected .row-sub,
.row.is-selected .row-state small,
.row.is-selected .row-tag,
.row.is-selected .row-error {
  color: rgba(255, 255, 255, 0.78);
}

.row.is-selected .row-state strong {
  color: #fff;
}

.row.is-selected .row-icon {
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.row.is-selected .row-bar {
  background: rgba(255, 255, 255, 0.32);
}

.row.is-selected .row-fill {
  background: #fff;
}

.row.is-selected .row-actions .icon-btn {
  color: rgba(255, 255, 255, 0.85);
}

.row.is-selected .row-actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.row-icon {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(120, 120, 128, 0.16);
  color: var(--muted);
}

.row:hover .row-icon {
  border: 0;
  background: rgba(120, 120, 128, 0.22);
  color: var(--text);
}

.row[data-status="downloading"] .row-icon {
  border: 0;
  background: rgba(10, 132, 255, 0.18);
  color: #8ec5ff;
}

.row[data-status="completed"] .row-icon {
  border: 0;
  background: rgba(48, 209, 88, 0.14);
  color: var(--green);
}

.row[data-status="failed"] .row-icon {
  border: 0;
  background: rgba(255, 69, 58, 0.14);
  color: var(--red);
}

[data-theme="light"] .row[data-status="downloading"] .row-icon {
  color: #0071e3;
}

.row-icon .icon {
  width: 15px;
  height: 15px;
}

.row-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.row[data-priority="high"] .row-name::before {
  background: var(--accent);
}

.row-tag {
  padding: 1px 5px;
  border: 0;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.18);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.row-sub {
  margin-top: 3px;
  font-size: 11.5px;
}

.row-bar {
  height: 4px;
  margin-top: 7px;
  border-radius: 99px;
  background: var(--track);
}

.row-fill {
  border-radius: 99px;
  background: var(--accent);
}

.row[data-status="paused"] .row-fill {
  background: var(--faint);
}

.row[data-status="completed"] .row-fill {
  background: var(--green);
}

.row[data-status="failed"] .row-fill {
  background: var(--red);
}

.row-state strong {
  font-size: 12px;
  font-weight: 500;
}

.row-state small {
  max-width: 96px;
  font-size: 10.5px;
}

.row-actions .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.row-actions .icon-btn:hover {
  background: var(--surface-3);
}

.row-error {
  font-size: 10.5px;
}

/* Row action menu */

.row-menu {
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.row-menu button {
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 12.5px;
}

.row-menu button:hover,
.row-menu button:focus-visible {
  background: var(--accent);
  color: #fff;
}

.row-menu button:hover .icon,
.row-menu button:focus-visible .icon {
  color: #fff;
}

.row-menu button.is-danger {
  color: var(--danger);
}

.row-menu button.is-danger:hover {
  background: rgba(255, 69, 58, 0.16);
  color: var(--danger);
}

.row-menu button.is-danger:hover .icon {
  color: var(--danger);
}

.row-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--border);
}

/* Empty state */

.empty-glyph {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 0;
  background: none;
}

.empty-glyph img {
  display: block;
  width: 100%;
  height: 100%;
}

.empty-eyebrow {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.empty h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.empty p {
  font-size: 12px;
}

.empty-steps article {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px;
}

.empty-step-num {
  font-size: 10px;
  color: var(--faint);
}

.empty-steps strong {
  font-size: 12px;
}

.empty-steps small {
  font-size: 11px;
  color: var(--faint);
}

.empty-features span {
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--muted);
  background: var(--surface);
}

.empty-hint {
  font-size: 11px;
  color: var(--faint);
}

/* Buttons */

.ghost,
.primary {
  height: 30px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
  transition: background 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.ghost:active {
  background: var(--surface-3);
}

.primary {
  border: 1px solid var(--accent-glass-rim);
  background: var(--accent-glass);
  color: var(--accent-ink);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.18);
}

.primary:hover {
  background: var(--accent-glass-hover);
  border-color: var(--accent-glass-rim);
}

.primary:active {
  filter: brightness(0.92);
}

.primary.is-danger {
  background: var(--danger-solid);
  border: 0;
  color: #fff;
}

.primary.is-danger:hover {
  background: #ff453a;
}

.ghost:disabled,
.primary:disabled {
  opacity: 0.45;
}

/* Inspector */

.inspector {
  border-left: 1px solid var(--border);
  background: var(--panel);
}

.inspector-head {
  padding: 18px 16px 10px;
}

.detail-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(120, 120, 128, 0.18);
  color: var(--muted);
}

.detail-icon .icon {
  width: 16px;
  height: 16px;
}

.inspector-head h2 {
  font-size: 13px;
  font-weight: 600;
}

#detail-host {
  font-size: 10.5px;
}

.inspector-body {
  padding: 8px 16px 20px;
  gap: 12px;
}

.detail-summary {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.detail-ring .ring-fill {
  stroke: var(--accent);
}

.detail-ring[data-status="completed"] .ring-fill {
  stroke: var(--green);
}

.detail-percent {
  font-size: 16px;
  font-weight: 600;
}

.status-chip {
  height: 20px;
  padding: 0 8px;
  border: 0;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.18);
  font-size: 10.5px;
  color: var(--muted);
}

.status-chip::before {
  width: 6px;
  height: 6px;
}

.status-chip[data-status="downloading"] {
  background: rgba(10, 132, 255, 0.16);
  color: #8ec5ff;
}

.status-chip[data-status="downloading"]::before {
  background: var(--accent);
}

.status-chip[data-status="completed"] {
  background: rgba(48, 209, 88, 0.14);
  color: var(--green);
}

.status-chip[data-status="completed"]::before {
  background: var(--green);
}

.status-chip[data-status="failed"] {
  background: rgba(255, 69, 58, 0.14);
  color: var(--red);
}

.status-chip[data-status="failed"]::before {
  background: var(--red);
}

[data-theme="light"] .status-chip[data-status="downloading"] {
  color: #0071e3;
}

.detail-live strong {
  font-size: 15px;
}

.detail-note {
  font-size: 10.5px;
}

.detail-meter {
  height: 4px;
  border-radius: 99px;
  background: var(--track);
}

.detail-meter-fill {
  border-radius: 99px;
  background: var(--accent);
}

.detail-meter[data-status="queued"] .detail-meter-fill,
.detail-meter[data-status="paused"] .detail-meter-fill {
  background: var(--faint);
}

.detail-meter[data-status="failed"] .detail-meter-fill {
  background: var(--red);
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--faint);
}

.spark {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
}

#detail-spark path[stroke] {
  stroke: var(--accent) !important;
}

.detail-block > .section-label,
.detail-block-inner .section-label {
  color: var(--faint);
}

.detail-grid {
  gap: 6px;
}

.detail-grid > div {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.detail-grid dt {
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.detail-grid dd {
  font-size: 11.5px;
  font-weight: 500;
}

.segment {
  height: 6px;
  border-radius: 2px;
  background: var(--track);
}

.segment.is-done {
  background: var(--accent);
}

.segment.is-partial {
  background: var(--accent);
  opacity: 0.55;
}

.copy-row {
  padding: 5px 5px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field);
}

.copy-row .mono {
  font-size: 10.5px;
}

.hash-row .hash-value {
  font-size: 10.5px;
}

.detail-error {
  color: var(--danger);
  font-size: 10.5px;
}

.danger-link {
  color: var(--danger);
  font-size: 12px;
}

.danger-link:hover {
  color: #ff6961;
  background: rgba(255, 69, 58, 0.08);
  border-radius: 6px;
}

/* Dialogs */

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px) saturate(130%);
}

[data-theme="light"] dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.24);
}

.modal-card {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.modal-head {
  padding: 20px 20px 12px;
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.modal-head .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(120, 120, 128, 0.16);
  color: var(--muted);
}

.modal-head .icon-btn:hover {
  background: rgba(120, 120, 128, 0.26);
  color: var(--text);
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.hint {
  font-size: 11px;
}

.tabs {
  margin: 0 20px 16px;
  padding: 2px;
  gap: 2px;
  border-radius: 9px;
  background: rgba(120, 120, 128, 0.18);
}

.tab {
  height: 28px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tab.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

.field > span {
  font-size: 11.5px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea,
.input-row input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field);
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text);
}

.field textarea {
  height: auto;
  padding: 9px 10px;
  font-family: "SF Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input-row input:focus {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-hint,
.form-note {
  font-size: 11px;
  color: var(--faint);
}

.input-row .ghost {
  height: 32px;
}

/* Settings */

.settings-card {
  background: var(--panel);
}

.settings-head {
  padding-bottom: 14px;
}

.settings-layout {
  grid-template-columns: 196px minmax(0, 1fr);
  border-top: 1px solid var(--border);
}

.settings-rail {
  padding: 14px 12px 16px;
  gap: 1px;
  background: var(--panel);
}

.settings-tab {
  height: 30px;
  padding: 0 9px;
  gap: 9px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

.settings-tab .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.settings-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.settings-tab.is-active {
  background: var(--accent-glass-sel);
  color: var(--accent-ink);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 0 0 1px var(--accent-glass-rim);
}

.settings-tab:hover .icon,
.settings-tab.is-active .icon {
  color: currentColor;
}

.settings-rail-sep {
  margin: 8px 8px;
  background: var(--border);
}

.settings-panels {
  padding: 18px 24px 24px 20px;
  background: var(--bg);
  border-left: 1px solid var(--border);
}

.settings-panel-head h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.settings-panel-head p {
  font-size: 12px;
}

.settings-group {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.settings-group h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--faint);
}

.toggle-row {
  padding: 9px 0;
}

.toggle-row strong {
  font-size: 12.5px;
  font-weight: 500;
}

.toggle-row small {
  font-size: 11px;
}

.switch {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.32);
}

.switch::after {
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s cubic-bezier(0.3, 1.2, 0.5, 1), background 0.15s ease;
}

.toggle-row input:checked + .switch {
  border: 0;
  background: var(--accent);
}

.toggle-row input:checked + .switch::after {
  transform: translateX(16px);
  background: #fff;
}

.toggle-row input:focus-visible + .switch {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.segmented {
  padding: 2px;
  gap: 2px;
  border-radius: 9px;
  background: rgba(120, 120, 128, 0.18);
}

.segmented-option {
  height: 27px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.segmented-option:hover {
  color: var(--text);
}

.segmented-option.is-active {
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .segmented-option.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

.theme-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12.5px;
}

.theme-option:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.theme-option.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-option .icon {
  color: var(--muted);
}

.theme-option.is-active .icon {
  color: var(--accent);
}

.path-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field);
}

.status-pill {
  height: 20px;
  padding: 0 8px;
  border: 0;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.18);
  font-size: 10.5px;
  color: var(--muted);
}

.status-pill i {
  width: 6px;
  height: 6px;
  background: var(--green);
}

.status-pill.is-off i {
  background: var(--faint);
}

.status-note {
  font-size: 11px;
}

.steps {
  font-size: 11.5px;
}

.steps strong {
  font-weight: 600;
}

.shortcut-list > div {
  font-size: 12px;
}

.shortcut-list kbd {
  font-size: 10px;
}

.about-hero h3 {
  font-size: 19px;
  font-weight: 700;
}

.about-version {
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.18);
  font-size: 10px;
}

.about-hero p {
  font-size: 12px;
}

.section-copy {
  font-size: 12px;
}

.about-facts > div {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.about-facts span {
  font-size: 10px;
}

.about-facts strong {
  font-size: 11.5px;
}

.policy-block {
  border-top: 1px solid var(--border);
}

.policy-block h4 {
  font-size: 12px;
}

.policy-block ul {
  font-size: 11.5px;
}

.settings-fineprint {
  font-size: 10.5px;
}

/* Toasts */

.toast {
  width: 330px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: var(--shadow-soft);
}

.toast-title {
  font-size: 12.5px;
  font-weight: 600;
}

.toast-body {
  font-size: 11.5px;
}

.toast-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.toast-close:hover {
  background: rgba(120, 120, 128, 0.2);
}

/* Drop overlay */

.drop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.drop-card {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.drop-card .icon {
  color: var(--accent);
}

/* Scrollbars */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.4);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 128, 0.6);
  background-clip: padding-box;
}

/* Responsive */

@media (max-width: 900px) {
  .overview {
    gap: 10px;
    margin: 0 18px 12px;
  }

  .stage,
  .stage-bar {
    margin-left: 18px;
    margin-right: 18px;
  }

  .stage-bar {
    padding-left: 0;
    padding-right: 0;
  }

  .workspace-head {
    padding: 18px 18px 14px;
  }

  .searchbox {
    width: 200px;
  }
}

@media (max-width: 760px) {
  .overview {
    margin: 0 14px 10px;
  }

  .stage {
    margin: 0 14px 12px;
  }

  .stage-bar {
    margin: 0 14px;
    padding: 0 0 8px;
  }

  .workspace-head {
    padding: 16px 14px 12px;
  }

  .head-copy h1 {
    font-size: 21px;
  }

  .searchbox {
    width: 160px;
  }
}

/* Arus 4.1: liquid glass layer.
   Translucent surfaces over a soft ambient field, specular rims, no flat fills. */

html {
  background: transparent;
}

/* The native window is transparent with an acrylic backdrop, so the page
   paints a translucent veil instead of an opaque fill. */
body {
  background:
    radial-gradient(1200px 820px at 102% -18%, rgba(255, 255, 255, 0.07) 0%, transparent 62%),
    radial-gradient(950px 720px at -14% 112%, rgba(255, 255, 255, 0.045) 0%, transparent 62%),
    radial-gradient(1300px 900px at 78% 102%, rgba(10, 132, 255, 0.12) 0%, transparent 62%),
    linear-gradient(140deg, rgba(26, 28, 30, 0.38) 0%, rgba(17, 19, 20, 0.45) 46%, rgba(21, 23, 24, 0.41) 100%);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background:
    radial-gradient(1200px 820px at 102% -18%, rgba(255, 255, 255, 0.85) 0%, transparent 62%),
    radial-gradient(950px 720px at -14% 112%, rgba(198, 206, 202, 0.4) 0%, transparent 64%),
    radial-gradient(1100px 800px at 86% 104%, rgba(0, 122, 255, 0.14) 0%, transparent 60%),
    linear-gradient(150deg, rgba(246, 248, 245, 0.42) 0%, rgba(230, 234, 231, 0.5) 52%, rgba(240, 243, 240, 0.45) 100%);
  background-attachment: fixed;
}

.workspace {
  background: transparent;
}

.titlebar {
  background: rgba(35, 36, 38, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.sidebar {
  background: rgba(34, 35, 37, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.055);
}

[data-theme="light"] .titlebar {
  background: rgba(250, 250, 251, 0.36);
  border-bottom-color: rgba(0, 0, 0, 0.055);
}

[data-theme="light"] .sidebar {
  background: rgba(247, 248, 249, 0.3);
  border-right-color: rgba(0, 0, 0, 0.055);
}

.titlebar,
.sidebar,
.inspector,
.metric,
.side-card,
.stage,
.detail-summary,
.settings-panel,
.settings-card,
.modal-card,
.row-menu,
.toast {
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
}

.overview,
.stage,
.side-card,
.settings-panel,
.settings-card,
.detail-summary,
.inspector {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .overview,
[data-theme="light"] .stage,
[data-theme="light"] .side-card,
[data-theme="light"] .settings-panel,
[data-theme="light"] .settings-card,
[data-theme="light"] .detail-summary,
[data-theme="light"] .inspector {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.searchbox {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

[data-theme="light"] .searchbox {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

.new-download,
.add-btn,
.primary {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, #1f8dff 0%, #0a84ff 52%, #0a79ef 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.new-download:hover,
.add-btn:hover,
.primary:hover {
  background: linear-gradient(180deg, #3396ff 0%, #208eff 52%, #1281f7 100%);
}

[data-theme="light"] .new-download,
[data-theme="light"] .add-btn,
[data-theme="light"] .primary {
  border-color: rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, #1f86ff 0%, #007aff 52%, #0070ec 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .new-download:hover,
[data-theme="light"] .add-btn:hover,
[data-theme="light"] .primary:hover {
  background: linear-gradient(180deg, #3d9bff 0%, #1a8cff 52%, #0a7cf2 100%);
}

.nav-item.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px var(--accent-glass-rim),
    0 3px 10px rgba(0, 0, 0, 0.18);
}

.row.is-selected {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px var(--accent-glass-rim);
}

.metric:hover {
  background: rgba(60, 60, 64, 0.3);
}

[data-theme="light"] .metric:hover {
  background: rgba(255, 255, 255, 0.82);
}
