/* RH CDN: a modern dark panel (blue-grey), colourful folder icons, the red of RedHorizon on the main actions. */

:root {
  --bg: #0f121a;
  --panel: #131722;
  --surface: #191e2a;
  --surface-2: #1f2533;
  --surface-3: #262d3e;
  --border: #242b3a;
  --border-2: #2f3748;
  --text: #e6e9f0;
  --dim: #8c95a8;
  --faint: #5f687c;
  --accent: #d6453d;
  --accent-hi: #e3564e;
  --accent-soft: rgba(214, 69, 61, 0.16);
  --green: #4ade80;
  --blue: #4fa3f7;
  --yellow: #facc15;
  --orange: #fb923c;
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  --tile: 168px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { display: none; }
.muted { color: var(--dim); }
code { font-family: var(--mono); color: var(--accent-hi); font-size: 0.95em; }
kbd { font: 11px var(--mono); color: var(--faint); border: 1px solid var(--border-2); border-radius: 4px; padding: 0 5px; }

.c-green { color: var(--green); }
.c-blue { color: var(--blue); }
.c-yellow { color: var(--yellow); }
.c-orange { color: var(--orange); }

/* the transparent background behind images */
.checker {
  background-color: #1a1f2b;
  background-image: linear-gradient(45deg, #222838 25%, transparent 25%), linear-gradient(-45deg, #222838 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222838 75%), linear-gradient(-45deg, transparent 75%, #222838 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* ─── Controls ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-3); border-color: #3a4357; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn--danger { color: #ff8f88; }
.btn--danger:hover { background: rgba(214, 69, 61, 0.18); border-color: var(--accent); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--block { width: 100%; height: 38px; }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible, .select:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--dim); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--sm { width: 26px; height: 26px; }
.icon-btn--sm svg { width: 14px; height: 14px; }
.icon-btn.is-on { color: var(--accent-hi); }

.input, .select {
  height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: #0c0f16; color: var(--text);
  outline: none; min-width: 0;
}
.input:focus, .select:focus { border-color: #4a5470; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input--mono { font-family: var(--mono); font-size: 12px; }
.input--sm { height: 28px; }
.select { padding-right: 6px; cursor: pointer; }
.field { display: block; margin-bottom: 12px; }
.field > .input { width: 100%; }
.field__label { display: block; color: var(--dim); font-size: 12px; margin-bottom: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.form-error { color: #ff8f88; margin: 6px 0 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input { flex: 1; }

/* ─── Login ─── */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(214, 69, 61, 0.10), transparent 60%), var(--bg); }
.login__card { width: min(360px, 100%); padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.login__logo { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login__logo .logo-mark { width: 34px; height: 34px; }
.login__logo .logo-text { font-size: 24px; }
.login__lead { text-align: center; color: var(--dim); margin: 6px 0 22px; }
.logo-mark { color: var(--accent); }
.logo-text { font-weight: 800; letter-spacing: 0.02em; }
.logo-text b { color: var(--accent-hi); font-weight: 800; }

/* ─── Layout ─── */
.app { display: grid; grid-template-columns: 260px 1fr; grid-template-rows: 52px 1fr; height: 100%; }
.top {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.top__logo { display: flex; align-items: center; gap: 8px; text-decoration: none; padding-right: 6px; }
.top__logo .logo-mark { width: 26px; height: 26px; }
.top__logo .logo-text { font-size: 16px; }
.top__spacer { flex: 1; }
.top__user { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); padding: 0 6px; }
.top__user svg { color: var(--accent-hi); }
.search {
  display: flex; align-items: center; gap: 8px; width: min(520px, 46vw); height: 34px; padding: 0 10px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: #0c0f16; color: var(--faint);
}
.search:focus-within { border-color: #4a5470; color: var(--dim); }
.search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); min-width: 0; }
.search input::-webkit-search-cancel-button { filter: invert(0.6); }

/* ─── Sidebar ─── */
.side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--border); }
.side__head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 6px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.tree { flex: 1; overflow: auto; padding: 2px 6px 10px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 14px; }
.node {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; cursor: pointer; user-select: none;
}
.node:hover { background: var(--surface); }
.node.is-current { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.node.is-target { background: var(--accent-soft); outline: 1px dashed var(--accent); }
.node__toggle { display: grid; place-items: center; width: 16px; height: 16px; color: var(--faint); border-radius: 3px; flex: none; }
.node__toggle svg { width: 12px; height: 12px; transition: transform 0.12s; }
.node__toggle.is-closed svg { transform: rotate(-90deg); }
.node__toggle:hover { color: var(--text); background: var(--surface-3); }
.node__toggle--none { visibility: hidden; }
.node__icon { width: 17px; height: 17px; color: var(--c, var(--blue)); }
.node__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node__count { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.side__foot {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--border);
  color: var(--faint); font: 11px var(--mono); min-width: 0;
}
.side__foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.side__foot svg { width: 14px; height: 14px; }

/* ─── Main ─── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.head { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; font-size: 15px; }
.crumbs a { color: var(--dim); text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.crumbs a:hover { color: var(--text); background: var(--surface); }
.crumbs a.is-target { background: var(--accent-soft); color: var(--text); }
.crumbs .here { font-weight: 700; padding: 2px 4px; }
.crumbs svg { width: 13px; height: 13px; color: var(--faint); }
.summary { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.head__actions { display: flex; align-items: center; gap: 6px; }
.sep { width: 1px; height: 22px; background: var(--border-2); margin: 0 4px; }

.selbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--accent-soft); border-bottom: 1px solid rgba(214, 69, 61, 0.35);
}
.selbar #sel-count { font-weight: 700; margin-right: 6px; }

.content { position: relative; flex: 1; overflow: auto; padding: 14px 16px 24px; outline: none; }
.dropmask { display: none; position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 12px; background: rgba(15, 18, 26, 0.88); z-index: 3; }
.dropmask div { position: sticky; top: 40%; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; padding-top: 120px; }
.dropmask svg { width: 42px; height: 42px; color: var(--accent-hi); }
.content.is-drop .dropmask { display: block; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 80px; color: var(--dim); }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 8px; }
.empty p { margin: 0; }

/* grid */
.items.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 10px; }
.tile {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; cursor: pointer; user-select: none; transition: border-color 0.1s, transform 0.1s;
}
.tile:hover { border-color: #3a4357; }
.tile.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile.is-target { border-color: var(--accent); background: var(--accent-soft); }
.tile.is-cut { opacity: 0.5; }
.tile__thumb { position: relative; aspect-ratio: 4 / 3.1; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.tile__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 8px; object-fit: contain; }
.tile--folder .tile__thumb, .tile--json .tile__thumb { background: var(--surface-2); }
.tile__big { width: 46%; height: 46%; color: var(--c, var(--blue)); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35)); }
.tile--json .tile__big { color: var(--yellow); width: 40%; height: 40%; }
.tile__text { padding: 8px 10px 9px; min-width: 0; }
.tile__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__meta { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; font-variant-numeric: tabular-nums; }
.tile__check {
  position: absolute; top: 7px; left: 7px; z-index: 2; display: grid; place-items: center; width: 20px; height: 20px;
  border: 1.5px solid rgba(230, 233, 240, 0.55); border-radius: 5px; background: rgba(15, 18, 26, 0.6); opacity: 0; transition: opacity 0.1s;
}
.tile__check svg { width: 13px; height: 13px; stroke-width: 3; color: #fff; opacity: 0; }
.tile:hover .tile__check, .items.has-selection .tile__check { opacity: 1; }
.tile.is-selected .tile__check { background: var(--accent); border-color: var(--accent); opacity: 1; }
.tile.is-selected .tile__check svg { opacity: 1; }
.items.size-s { --tile: 128px; }
.items.size-l { --tile: 224px; }
.pixel img { image-rendering: pixelated; }

/* list */
.items.is-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lrow {
  display: grid; grid-template-columns: 28px 40px minmax(160px, 1fr) 110px 90px 140px 70px; align-items: center; gap: 10px;
  height: 46px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; user-select: none;
}
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow.is-selected { background: var(--accent-soft); }
.lrow.is-target { outline: 1px dashed var(--accent); outline-offset: -1px; }
.lrow--head { height: 34px; background: var(--panel); color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; cursor: default; }
.lrow--head:hover { background: var(--panel); }
.lrow__thumb { position: relative; width: 36px; height: 32px; border-radius: 4px; display: grid; place-items: center; overflow: hidden; }
.lrow__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 2px; object-fit: contain; }
.lrow__thumb svg { width: 22px; height: 22px; color: var(--c, var(--blue)); }
.lrow__thumb svg.c-yellow { color: var(--yellow); }
.lrow__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__cell { color: var(--dim); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lrow .tile__check { position: static; opacity: 1; }
.lrow.is-selected .tile__check { background: var(--accent); border-color: var(--accent); }
.lrow.is-selected .tile__check svg { opacity: 1; }

/* search results */
.results__title { margin: 2px 0 12px; font-size: 14px; color: var(--dim); }
.results__title b { color: var(--text); }
.result { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.result:hover { background: var(--surface); }
.result__path { font: 11px var(--mono); color: var(--faint); }
.result mark { background: var(--accent-soft); color: var(--accent-hi); border-radius: 2px; }

/* ─── Overlays ─── */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(6, 8, 12, 0.72); backdrop-filter: blur(3px); }
.modal {
  display: flex; flex-direction: column; width: min(480px, 100%); max-height: calc(100vh - 48px); border: 1px solid var(--border-2);
  border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden;
}
.modal--upload { width: min(760px, 100%); height: min(720px, calc(100vh - 48px)); }
.modal--wide { width: min(980px, 100%); height: calc(100vh - 48px); }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal__head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.modal__head svg { width: 20px; height: 20px; }
.modal__body { flex: 1; overflow: auto; padding: 16px; min-height: 0; }
.modal__body > p { margin: 0 0 10px; color: var(--dim); }
.modal__foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.15); }
.modal > .form-error { margin: 0 16px 10px; }

.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--dim); font-weight: 600; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); border-bottom-color: var(--accent); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 170px; padding: 20px;
  border: 1.5px dashed var(--border-2); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: center;
}
.dropzone svg { width: 34px; height: 34px; color: var(--green); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.options { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.progress-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.progress-list li { display: grid; grid-template-columns: 1fr 160px; gap: 10px; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface); font-size: 12px; }
.progress-list .pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-list .pl-state { color: var(--dim); text-align: right; }
.progress-list li.ok .pl-state { color: var(--green); }
.progress-list li.bad .pl-state { color: #ff8f88; }
.bar { position: relative; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; grid-column: 1 / -1; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width 0.15s; }
.ok .bar i { background: var(--green); }
.jobbox { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.jobbox .bar { margin: 8px 0; }
.jobbox ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 180px; overflow: auto; font-size: 12px; }
.jobbox li { padding: 2px 0; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobbox li.bad { color: #ff8f88; }
.jobbox li.ok { color: var(--green); }
.page-tools { margin: 4px 0 10px; flex-wrap: wrap; }
.page-tools .input { flex: 0 1 220px; }
.page-tools #page-count { margin-right: auto; }
.page-tools b { color: var(--accent-hi); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pick { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--surface); }
.pick__img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.pick__img img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6px; object-fit: contain; }
.pick__name { padding: 4px 6px; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.is-on { border-color: var(--accent); }
.pick.is-on .pick__name { color: var(--text); }
.pick .tile__check { opacity: 1; }
.pick.is-on .tile__check { background: var(--accent); border-color: var(--accent); }
.pick.is-on .tile__check svg { opacity: 1; }
.note { color: var(--faint); font-size: 12px; margin: 10px 0 0; }

/* detail */
.detail {
  display: flex; flex-direction: column; width: min(1500px, 100%); height: min(860px, calc(100vh - 48px));
  border: 1px solid var(--border-2); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden;
}
.detail__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); }
.detail__head svg { width: 18px; height: 18px; }
.detail__head strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail__body { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.detail__view { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 16px; }
.detail__view img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.detail__view pre { align-self: stretch; justify-self: stretch; margin: 0; overflow: auto; padding: 12px; font: 12px/1.5 var(--mono); color: var(--text); background: #0c0f16; border-radius: var(--radius); }
.detail__view .tile__big { width: 120px; height: 120px; }
.detail__info { padding: 16px; border-left: 1px solid var(--border); overflow: auto; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0 0 16px; }
.props dt { color: var(--dim); }
.props dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; word-break: break-all; }
.copyfield { display: flex; gap: 6px; }
.copyfield .input { flex: 1; }
.copyfield .icon-btn { border: 1px solid var(--border-2); background: var(--surface-2); }
.detail__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* JSON editor */
.json { display: flex; flex-direction: column; height: 100%; gap: 8px; }
.json textarea { flex: 1; min-height: 300px; resize: none; font: 13px/1.55 var(--mono); tab-size: 2; white-space: pre; }
.json__status { font-size: 12px; color: var(--green); }
.json__status.is-bad { color: #ff8f88; }

/* colours */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid transparent; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.swatch svg { width: 26px; height: 26px; color: var(--c); }
.swatch.is-on { border-color: var(--text); }
.color-custom { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--dim); }
.color-custom input[type="color"] { width: 44px; height: 32px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-2); padding: 2px; cursor: pointer; }

/* settings */
.settings h3 { margin: 4px 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.settings section + section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: var(--surface); color: var(--dim); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-2); }
.seg button.is-on { background: var(--accent); color: #fff; }
.settings .line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.settings dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.settings dt { color: var(--dim); }
.settings dd { margin: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* context menu */
.menu {
  position: fixed; z-index: 40; min-width: 210px; padding: 5px; border: 1px solid var(--border-2); border-radius: 9px;
  background: #1a1f2b; box-shadow: var(--shadow);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 10px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); outline: none; }
.menu button svg { color: var(--dim); }
.menu button.is-danger { color: #ff8f88; }
.menu button.is-danger svg { color: #ff8f88; }
.menu hr { border: 0; border-top: 1px solid var(--border-2); margin: 5px 4px; }
.menu__colors { display: flex; gap: 5px; padding: 6px 8px 4px; }
.menu__colors button { width: 22px; height: 22px; padding: 0; border-radius: 5px; background: var(--c); border: 2px solid transparent; }
.menu__colors button:hover { border-color: var(--text); background: var(--c); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 420px; padding: 10px 14px; border: 1px solid var(--border-2);
  border-left: 3px solid var(--green); border-radius: var(--radius-sm); background: #1a1f2b; box-shadow: var(--shadow); animation: toast-in 0.15s ease-out;
}
.toast--error { border-left-color: var(--accent); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .detail__body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .detail__info { border-left: 0; border-top: 1px solid var(--border); }
  .lrow { grid-template-columns: 28px 40px 1fr 80px; }
  .lrow > :nth-child(n+5) { display: none; }
}
