:root {
  --bg: #f6f7f9;
  --card: #fff;
  --ink: #1d2129;
  --ink-2: #4e5969;
  --muted: #86909c;
  --line: #e9ecf0;
  --line-2: #f1f3f5;
  --accent: #2f6bff;
  --accent-ink: #1f55d6;
  --accent-soft: #edf3ff;
  --green: #12a150;
  --green-soft: #e8f7ee;
  --orange: #d97706;
  --orange-soft: #fef5e7;
  --red: #e5484d;
  --red-soft: #fdeeee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit }
a { color: inherit; text-decoration: none }
button { cursor: pointer; border: 0; background: none; padding: 0 }
button:disabled { opacity: .5; cursor: not-allowed }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
[hidden] { display: none !important }
h1, h2, h3 { margin: 0; font-weight: 600 }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden }
.icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0 }
.muted { color: var(--muted) }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn .icon { width: 16px; height: 16px }
.btn:hover:not(:disabled) { background: #f7f8fa; border-color: #dcdfe4; color: var(--ink) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff }
.btn.primary:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff }
.btn.danger { color: var(--red) }
.btn.danger:hover:not(:disabled) { background: var(--red-soft); border-color: #f6c9ca; color: var(--red) }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red) }
.btn.ghost { border-color: transparent; background: none }
.btn.ghost:hover:not(:disabled) { background: var(--line-2) }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px }
.btn.block { width: 100% }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 8px; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink) }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red) }
.link { color: var(--accent); font-size: 13px; display: inline-flex; align-items: center; gap: 4px }
.link:hover { color: var(--accent-ink) }
.link .icon { width: 14px; height: 14px }

input, select, textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 13.5px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 9px 11px }
select { padding-right: 28px }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12) }
input::placeholder { color: #b6bcc5 }
input[readonly] { background: #fafbfc }
label.field { display: block; margin-bottom: 16px; font-size: 13px; color: var(--ink-2); font-weight: 500 }
label.field > input, label.field > select { margin-top: 6px }
label.field small, .help { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 400 }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px }
.full { grid-column: 1 / -1 }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line-2) }
.toggle-row strong { display: block; font-weight: 500; font-size: 13.5px }
.toggle-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px }
.switch {
  appearance: none; flex-shrink: 0; width: 36px; height: 20px; padding: 0; border: 0; border-radius: 20px;
  background: #d9dde3; position: relative; cursor: pointer; transition: background .2s; box-shadow: none !important;
}
.switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s }
.switch:checked { background: var(--accent) }
.switch:checked::before { transform: translateX(16px) }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px }
.form-error { color: var(--red); font-size: 13px; min-height: 20px; margin: 6px 0 }
progress { width: 100%; height: 6px; border: 0; border-radius: 6px; overflow: hidden; appearance: none; background: var(--line-2) }
progress::-webkit-progress-bar { background: var(--line-2) }
progress::-webkit-progress-value { background: var(--accent); border-radius: 6px }
progress::-moz-progress-bar { background: var(--accent) }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #e8efff 0, transparent 60%), var(--bg) }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 36px 32px 28px; box-shadow: var(--shadow-lg); text-align: center }
.login-logo { display: block; margin: 0 auto 14px }
.login-card h1 { font-size: 20px }
.login-card .muted { margin: 4px 0 22px; font-size: 13px }
.login-card input { height: 42px; text-align: left }
.login-card .btn { height: 42px; font-size: 14px }
.login-card .hint { font-size: 12px; color: var(--muted); margin: 16px 0 0 }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 224px; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 600; font-size: 15px }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.sidebar nav { display: flex; flex-direction: column; gap: 2px }
.sidebar nav a, .nav-btn {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; transition: background .15s, color .15s; width: 100%; text-align: left;
}
.sidebar nav a:hover, .nav-btn:hover { background: var(--line-2); color: var(--ink) }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 500 }
.sidebar nav a .icon, .nav-btn .icon { width: 17px; height: 17px }
.count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums }
.active .count { color: var(--accent) }
.pulse { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(217,119,6,.5); animation: pulse 1.6s infinite }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(217,119,6,0) } 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0) } }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px }
.usage { padding: 12px 10px; border-top: 1px solid var(--line-2) }
.usage-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px }
.usage small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px }
.nav-btn { color: var(--muted) }
.sidebar-mask { display: none }
.workspace { flex: 1; margin-left: 224px; min-width: 0; display: flex; flex-direction: column }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(246, 247, 249, .85); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: 17px; margin-right: auto }
.top-actions { display: flex; gap: 8px }
#mobile-menu { display: none }
main { padding: 8px 28px 40px; width: 100%; max-width: 1480px; margin: 0 auto }
.loading { display: flex; justify-content: center; padding: 80px 0 }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Cards / sections ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow) }
.card.pad { padding: 20px }
.section { margin-top: 24px }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px }
.section-head h2 { font-size: 15px }
.section-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-left: 6px }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.stat { padding: 18px 20px }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px }
.stat-label .icon { width: 16px; height: 16px; color: var(--accent) }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.5px }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 3px; letter-spacing: 0 }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 2px }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); min-width: 0 }
.list-row:first-child { border-top: 0; padding-top: 0 }
.list-row:last-child { padding-bottom: 0 }
.list-row .grow { flex: 1; min-width: 0 }
.list-row strong { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.list-row small { display: block; color: var(--muted); font-size: 12px }
.list-row time { color: var(--muted); font-size: 12px; white-space: nowrap }
.kind-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0 }
.kind-icon.b2 { background: #fff1e8; color: #e8590c }
.kind-icon.webdav { background: #f1ecff; color: #7048e8 }
.kind-icon .icon { width: 17px; height: 17px }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--green-soft); color: var(--green) }
.badge.gray { background: var(--line-2); color: var(--muted) }
.badge.orange { background: var(--orange-soft); color: var(--orange) }
.badge.red { background: var(--red-soft); color: var(--red) }
.badge.blue { background: var(--accent-soft); color: var(--accent) }
.note { color: var(--muted); font-size: 13px; margin: 0 }
.empty { text-align: center; padding: 56px 24px; color: var(--muted) }
.empty > .icon { width: 36px; height: 36px; stroke-width: 1.4; color: #c4cad3; margin-bottom: 10px }
.empty h3 { color: var(--ink); font-size: 15px; font-weight: 500; margin-bottom: 4px }
.empty p { margin: 0 0 18px; font-size: 13px }
.error-panel { text-align: center; padding: 48px 20px; color: var(--red) }
.error-panel p { margin: 0 0 16px }

/* ---------- Gallery ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px }
.search { position: relative; flex: 1 1 260px; max-width: 380px }
.search .icon { position: absolute; left: 10px; top: 9px; width: 17px; height: 17px; color: var(--muted) }
.search input { padding-left: 34px }
.toolbar select { width: auto; min-width: 120px }
.toolbar .spacer { flex: 1 }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; transition: box-shadow .2s, transform .2s }
.tile:hover { box-shadow: 0 6px 20px rgba(16, 24, 40, .08); transform: translateY(-1px) }
.tile .thumb { display: block; width: 100%; aspect-ratio: 4 / 3; background: #eef0f3; overflow: hidden; position: relative }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .25s }
.tile img.loaded { opacity: 1 }
.tile img.broken { opacity: 1; object-fit: contain; padding: 30%; filter: grayscale(1); opacity: .25 }
.tile .fmt { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,.92); color: var(--ink-2) }
.tile .quick { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s }
.tile:hover .quick, .tile:focus-within .quick { opacity: 1 }
.tile .quick button { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.95); color: var(--ink-2); box-shadow: 0 1px 3px rgba(0,0,0,.12) }
.tile .quick button:hover { color: var(--accent) }
.tile .quick .icon { width: 15px; height: 15px }
.tile .meta { padding: 9px 11px 10px }
.tile .name { display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tile .sub { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 1px }
.tile .sub span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tile .sub span:last-child { white-space: nowrap; flex-shrink: 0 }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 4px; vertical-align: 1px }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; color: var(--muted); font-size: 13px }
.drop-hint { position: fixed; inset: 12px; z-index: 50; border: 2px dashed var(--accent); border-radius: 16px; background: rgba(237, 243, 255, .85); display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--accent); font-weight: 500; pointer-events: none }

/* ---------- Sources ---------- */
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px }
.source { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.source-top { display: flex; align-items: center; gap: 12px; min-width: 0 }
.source-top .grow { flex: 1; min-width: 0 }
.source-top h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.source-top small { color: var(--muted); font-size: 12px }
.path { background: #f8f9fb; border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2) }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12px; color: var(--muted) }
.facts strong { display: block; color: var(--ink); font-size: 13.5px; font-weight: 500 }
.source-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-2); margin-top: auto }
.source-actions .push { margin-left: auto }

/* ---------- Tasks ---------- */
.table-wrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse; font-size: 13px }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 0 12px 10px; border-bottom: 1px solid var(--line) }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap }
tr:last-child td { border-bottom: 0 }
td .title { font-weight: 500 }
td small { display: block; color: var(--muted); font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis }
.progress-cell { min-width: 160px }
.progress-cell span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px }
.mode { display: flex; gap: 14px; padding: 16px 18px }
.mode h3 { font-size: 14px; display: flex; align-items: center; gap: 8px }
.mode p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted) }

/* ---------- Domains ---------- */
.mode-intro .note { display: flex; gap: 10px; align-items: flex-start; line-height: 1.7 }
.mode-intro .note .icon { color: var(--accent); margin-top: 3px }
td.row-actions { text-align: right; width: 1%; }
td.row-actions > * { vertical-align: middle }
td .link { font-size: 13.5px; font-weight: 500 }
.steps { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.7 }
.steps li { margin-bottom: 12px }
.steps .copy-field { margin: 8px 0 4px }
.steps .copy-field input { font-size: 12px }
td .badge + small { margin-top: 4px }
#domain-preview { white-space: pre-line; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #f8f9fb; border-radius: 7px; padding: 8px 10px; margin: 12px 0 0; overflow-wrap: anywhere }

/* ---------- Settings ---------- */
.settings { max-width: 820px }
.settings .card { padding: 22px 24px; margin-bottom: 16px }
.settings h2 { font-size: 15px }
.settings .desc { color: var(--muted); font-size: 13px; margin: 2px 0 18px }
.kv { list-style: none; padding: 0; margin: 0; font-size: 13px }
.kv li { display: flex; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line-2) }
.kv li:first-child { border-top: 0 }
.kv span:first-child { color: var(--muted); width: 120px; flex-shrink: 0 }
.kv span:last-child { overflow-wrap: anywhere }

/* ---------- Modal ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: 540px; max-width: calc(100vw - 24px); max-height: calc(100vh - 40px); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg) }
dialog[open] { animation: pop .18s ease-out }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99) } }
dialog::backdrop { background: rgba(15, 23, 42, .4) }
dialog.wide { width: 980px }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0 }
.modal-head .grow { flex: 1; min-width: 0 }
.modal-head h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px }
.modal-body { padding: 18px 20px 20px }
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--line-2); border-radius: 9px; margin-bottom: 18px }
.tab { flex: 1; height: 32px; border-radius: 7px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px }
.tab .icon { width: 15px; height: 15px }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500 }
.feedback { font-size: 13px; color: var(--muted); min-height: 20px }
.feedback.ok { color: var(--green) }
.feedback.bad { color: var(--red) }

/* Upload */
.dropzone { border: 1.5px dashed #cfd5de; border-radius: 12px; padding: 30px 16px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; background: #fafbfc }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--accent-soft) }
.dropzone .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px }
.dropzone strong { display: block; font-weight: 500 }
.dropzone p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted) }
.uploads { margin-top: 12px; max-height: 260px; overflow: auto }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px }
.upload-row:first-child { border-top: 0 }
.upload-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.upload-row small { color: var(--muted); font-size: 12px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis }
.upload-row.ok small { color: var(--green) }
.upload-row.bad small { color: var(--red) }
.upload-row img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--line-2); flex-shrink: 0 }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px }
.viewer { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; max-height: 70vh; border-radius: 10px; overflow: hidden;
  background: repeating-conic-gradient(#f2f4f7 0 25%, #fff 0 50%) 0 0 / 16px 16px }
.viewer img { max-width: 100%; max-height: 70vh; display: block; object-fit: contain }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; color: var(--ink-2) }
.viewer .nav.prev { left: 10px }
.viewer .nav.next { right: 10px }
.side h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 8px }
.facts-list { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13px }
.facts-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2) }
.facts-list span:first-child { color: var(--muted); flex-shrink: 0 }
.facts-list span:last-child { text-align: right; overflow-wrap: anywhere }
.links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px }
.copy-field { display: flex; gap: 6px; align-items: center }
.copy-field label { width: 64px; flex-shrink: 0; font-size: 12px; color: var(--muted) }
.copy-field input { height: 32px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace }
.copy-field .icon-btn { border: 1px solid var(--line); flex-shrink: 0 }
.actions-row { display: flex; gap: 6px; flex-wrap: wrap }
.token { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-wrap: anywhere; margin: 0 0 12px }

/* Toasts */
#toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none }
.toast { padding: 9px 16px; border-radius: 9px; background: #1d2129; color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); animation: drop .2s ease-out; max-width: 90vw }
.toast.error { background: var(--red) }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .detail { grid-template-columns: 1fr }
}
@media (max-width: 860px) {
  .two-col, .mode-cards { grid-template-columns: 1fr }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg) }
  .sidebar.open { transform: none }
  .sidebar.open + .sidebar-mask { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(15, 23, 42, .3) }
  .workspace { margin-left: 0 }
  #mobile-menu { display: inline-flex }
  .topbar { padding: 0 14px; gap: 8px }
  main { padding: 6px 14px 32px }
  .top-actions .btn .label { display: none }
  .top-actions .btn { padding: 0 10px }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .tile .quick { opacity: 1 }
  .stats { gap: 10px }
  .stat { padding: 14px }
  .stat-value { font-size: 22px }
  .grid-2 { grid-template-columns: 1fr }
  .search { max-width: none; flex-basis: 100% }
  .toolbar select { flex: 1; min-width: 0 }
  .sources { grid-template-columns: 1fr }
  .settings .card { padding: 18px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }
