:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #111821;
  --panel-2: #151e29;
  --line: #263241;
  --muted: #8e9cac;
  --text: #eef4f8;
  --accent: #19d3a2;
  --accent-2: #0eaa82;
  --danger: #ff6b75;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 72% -10%, #15352e 0, transparent 33%), var(--bg); }
body[data-authenticated="true"] { padding-left: 220px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); background: radial-gradient(circle at 18% 18%, #17443a 0, transparent 32%), linear-gradient(135deg, #09100f 0 54%, #0b1118 54% 100%); }
.auth-intro { min-height: 100vh; padding: clamp(38px, 6vw, 86px); display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid #20312f; }
.auth-brand { width: fit-content; display: flex; align-items: center; gap: 13px; color: var(--text); text-decoration: none; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand small { margin-top: 3px; color: #779288; font: 700 10px/1 monospace; letter-spacing: .18em; }
.auth-intro h1 { max-width: 760px; font-size: clamp(38px, 4.3vw, 56px); line-height: 1.1; }
.auth-intro > div > p:last-child { max-width: 650px; margin: 22px 0 0; color: #91a59e; font-size: 15px; line-height: 1.85; }
.auth-intro > div > p strong { color: #b8f5e3; }
.auth-intro ul { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 24px; list-style: none; color: #82968f; font-size: 12px; }
.auth-intro li { display: flex; align-items: center; gap: 8px; }
.auth-intro li span { color: var(--accent); font: 700 9px/1 monospace; }
.auth-panel { min-height: 100vh; padding: 32px; display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); padding: clamp(28px, 4vw, 46px); border: 1px solid #2a3945; border-radius: 18px; background: linear-gradient(145deg, #131c25f2, #0d141bf2); box-shadow: 0 28px 90px #0008; }
.auth-tabs { margin: 0 0 38px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #26333f; border-radius: 10px; background: #0a1016; }
.auth-tabs button { min-height: 39px; border: 0; border-radius: 7px; color: #778897; background: transparent; font-size: 13px; }
.auth-tabs button[aria-selected="true"] { color: #07130f; background: var(--accent); font-weight: 700; }
.auth-card h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.auth-description { margin: 10px 0 28px; color: var(--muted); font-size: 13px; }
.auth-card > label { display: block; margin-top: 17px; color: #c1ccd4; font-size: 12px; }
.auth-card > label input { width: 100%; height: 46px; margin-top: 8px; padding: 0 13px; border: 1px solid #2a3845; border-radius: 9px; outline: none; color: var(--text); background: #080e14; }
.auth-card > label input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px #19d3a212; }
.auth-hint { margin: 17px 0 0; color: #6e817a; font-size: 11px; line-height: 1.6; }
.auth-error { margin: 14px 0 0; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 26px; border: 0; }
.topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1e2834; background: rgba(9, 13, 18, .9); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #07110e; font-weight: 900; font-size: 20px; background: linear-gradient(135deg, #56f0c6, #0cb083); box-shadow: 0 0 28px #19d3a244; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.account-chip { display: flex; align-items: center; gap: 8px; color: #c9d5dc; font-size: 12px; }
.account-chip i { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #2f6155; border-radius: 50%; color: #8defd3; background: #123128; font: 700 11px/1 monospace; font-style: normal; }
.logout-button { padding: 7px 9px; border: 0; color: #788a98; background: transparent; font-size: 11px; }
.logout-button:hover { color: #ff9ca4; }
.health { color: var(--muted); font-size: 13px; }
.health i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.primary, .secondary, .danger-button { border-radius: 9px; padding: 10px 16px; border: 1px solid transparent; color: var(--text); background: transparent; transition: .16s ease; }
.primary { color: #04100d; font-weight: 700; background: var(--accent); }
.primary:hover { background: #4ce8c0; transform: translateY(-1px); }
.secondary { border-color: var(--line); background: #121a23; }
.secondary:hover { border-color: #536477; }
.danger-button { color: #ff929a; border-color: #6f3038; }
.sidebar { position: fixed; inset: 72px auto 0 0; z-index: 9; width: 220px; padding: 25px 15px; border-right: 1px solid #1e2834; background: #0c1219ee; backdrop-filter: blur(14px); }
.sidebar-label { margin: 0 12px 12px; color: #607180; font: 700 10px/1 monospace; letter-spacing: .16em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 9px; color: #8494a3; text-decoration: none; font-size: 13px; }
.sidebar nav a span { width: 20px; color: #667887; text-align: center; font-size: 17px; }
.sidebar nav a:hover { color: var(--text); background: #131d27; }
.sidebar nav a.active { color: #9af2d9; border-color: #225247; background: #102a25; }
.sidebar nav a.active span { color: var(--accent); }
.sidebar-hint { margin: 24px 12px 0; padding-top: 18px; border-top: 1px solid #202b35; color: #687987; font-size: 11px; line-height: 1.65; }
main { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 80px; }
.admin-view[hidden] { display: none !important; }
.page-heading { min-height: 112px; margin-bottom: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.page-heading h1 { font-size: clamp(32px, 4vw, 44px); }
.page-heading p:last-child { max-width: 720px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
#mapping-workspace .page-heading p:last-child { font-size: 16px; }
.page-heading > .secondary { flex: 0 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 42px; }
.eyebrow { margin: 0 0 11px; color: var(--accent); font: 700 11px/1 monospace; letter-spacing: .2em; }
#mapping-workspace .eyebrow { font-size: 13px; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); letter-spacing: -.04em; }
.hero > div > p:last-child { margin: 13px 0 0; color: var(--muted); }
.summary { display: flex; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #111821bb; }
.summary div { min-width: 116px; padding: 17px 22px; border-left: 1px solid var(--line); }
.summary div:first-child { border-left: 0; }
.summary strong, .summary span { display: block; }
.summary strong { font-size: 24px; }
.summary span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.workspace-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.workspace-links a { min-height: 224px; padding: 24px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: linear-gradient(145deg, #141d27, #0e151d); text-decoration: none; transition: border-color .18s, transform .18s, background .18s; }
.workspace-links a:hover { border-color: #356b5e; background: linear-gradient(145deg, #16261f, #0e1818); transform: translateY(-2px); }
.workspace-icon { width: 42px; height: 42px; margin-bottom: 22px; display: grid; place-items: center; border: 1px solid #2c695b; border-radius: 11px; color: var(--accent); background: #12342d; font-size: 20px; }
.workspace-links strong { font-size: 18px; }
.workspace-links p { margin: 10px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.workspace-links em { margin-top: auto; color: #70e6c5; font-size: 12px; font-style: normal; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #101720; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.archive-toggle { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.archive-toggle input { accent-color: var(--accent); }
.mapping-panel { margin-bottom: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #111a23, #0d141b); }
.mapping-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.mapping-heading .eyebrow { margin-bottom: 6px; }
.mapping-heading h2 { margin: 0; font-size: 20px; }
#mapping-workspace .mapping-live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.mapping-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); animation: live-pulse 1.6s ease-in-out infinite; }
.mapping-jobs { display: grid; gap: 10px; }
.mapping-job { padding: 15px; border: 1px solid #263542; border-radius: 11px; background: #0b1218; }
.mapping-job.succeeded { border-color: #235b4b; }
.mapping-job.failed { border-color: #67323a; }
.job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.job-head > div strong, .job-head > div span { display: block; }
#mapping-workspace .job-head > div strong { font-size: 15px; }
#mapping-workspace .today-badge { display: inline-block; margin-left: 8px; padding: 3px 7px; border-radius: 99px; color: #07130f; background: var(--accent); font-size: 11px; font-style: normal; vertical-align: 1px; }
#mapping-workspace .job-head > div span { margin-top: 4px; color: #6f8191; font-size: 12px; }
#mapping-workspace .job-status { padding: 5px 9px; border-radius: 99px; color: #ffd976; background: #3b3319; font-size: 12px; white-space: nowrap; }
.job-status.succeeded { color: #66e8c4; background: #123a30; }
.job-status.failed, .job-status.rejected, .job-status.cancelled { color: #ff9ca4; background: #49232a; }
.mapping-stage-panel { margin-top: 13px; padding: 11px; border: 1px solid #20313d; border-radius: 9px; background: #0a1117; }
.mapping-stage-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
#mapping-workspace .mapping-stage-panel header strong { color: #a9bbc5; font-size: 12px; }
#mapping-workspace .mapping-stage-panel header span { color: #55d7b5; font: 700 11px/1.2 monospace; text-align: right; }
.mapping-stage-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; list-style: none; }
.mapping-stage { min-width: 0; min-height: 42px; padding: 6px 7px; display: flex; align-items: center; gap: 6px; border: 1px solid #1e2d37; border-radius: 7px; color: #647580; background: #0e161c; }
#mapping-workspace .mapping-stage i { width: 19px; height: 19px; flex: 0 0 19px; display: grid; place-items: center; border: 1px solid #354650; border-radius: 50%; color: #6e808a; font: normal 700 9px/1 monospace; }
#mapping-workspace .mapping-stage span { min-width: 0; overflow: hidden; display: flex; flex: 1; flex-direction: column; gap: 2px; font-size: 10px; line-height: 1.2; text-overflow: ellipsis; }
#mapping-workspace .mapping-stage span small { overflow: hidden; color: #79e8ca; font: 700 9px/1.2 monospace; text-overflow: ellipsis; white-space: nowrap; }
#mapping-workspace .mapping-stage em { margin-left: auto; color: inherit; font-size: 9px; font-style: normal; }
.mapping-stage.completed { color: #65a897; border-color: #21463d; background: #0d1c19; }
.mapping-stage.completed i { color: #07130f; border-color: #2b9d80; background: #35c8a2; }
.mapping-stage.completed.final { color: #cffff1; border-color: #36b995; background: #123028; box-shadow: 0 0 0 1px #35c8a233, 0 0 13px #35c8a21f; }
.mapping-stage.completed.final em { margin-left: auto; color: #63dfbd; }
.mapping-stage.current { position: relative; color: #d4fff3; border-color: #37cba5; background: #12352d; box-shadow: 0 0 0 1px #30b89344, 0 0 15px #1ec79d22; }
.mapping-stage.current::after { content: ''; position: absolute; inset: -2px; pointer-events: none; border: 1px solid #4fe0ba66; border-radius: 8px; animation: stage-current-pulse 1.8s ease-in-out infinite; }
.mapping-stage.current i { color: #07130f; border-color: #64f0ca; background: #55e0ba; }
.mapping-stage.current em { color: #75f4d1; }
.mapping-stage.failed { color: #ffd1d4; border-color: #a94752; background: #381b21; }
.mapping-stage.failed i { color: #2b090c; border-color: #ff9098; background: #ff858e; }
.mapping-stage.pending { color: #8b9ca7; border-color: #263842; background: #0d151b; opacity: 1; }
#mapping-workspace .mapping-stage.pending i { color: #91a3ad; border-color: #43545e; }
.progress-row { display: flex; align-items: center; gap: 13px; margin-top: 14px; }
.progress-track { height: 9px; flex: 1; overflow: hidden; border-radius: 99px; background: #202b35; }
.progress-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #0eaa82, #40e0b7); transition: width .45s ease; }
.progress-fill.indeterminate { position: relative; overflow: hidden; }
.progress-fill.indeterminate::after { content: ''; position: absolute; inset: 0; width: 70px; background: linear-gradient(90deg, transparent, #c7fff0aa, transparent); animation: progress-scan 1.25s linear infinite; }
#mapping-workspace .progress-percent { width: 52px; text-align: right; color: #9df1da; font: 700 14px/1 monospace; }
.job-live-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.job-live-metrics > div { min-width: 0; padding: 10px 11px; border: 1px solid #213643; border-radius: 8px; background: #0e1820; }
.job-live-metrics span, .job-live-metrics strong, .job-live-metrics small { display: block; }
#mapping-workspace .job-live-metrics span { color: #718693; font-size: 11px; }
#mapping-workspace .job-live-metrics strong { margin-top: 5px; overflow: hidden; color: #cbe3df; font: 700 14px/1.2 monospace; text-overflow: ellipsis; white-space: nowrap; }
.job-live-metrics .eta-metric { border-color: #276151; background: #10241f; }
.job-live-metrics .eta-metric strong { color: #6cebc8; }
#mapping-workspace .job-live-metrics small { margin-top: 4px; color: #58756c; font-size: 10px; }
#mapping-workspace .job-output-health { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #728793; font-size: 11px; }
.job-output-health i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #687985; }
.job-output-health.active { color: #71cdb6; }
.job-output-health.active i { background: #37d7ad; box-shadow: 0 0 7px #37d7ad; animation: live-pulse 1.6s ease-in-out infinite; }
.job-output-health.waiting { color: #b0a26d; }
.job-output-health.waiting i { background: #c5ac58; }
#mapping-workspace .job-detail { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; color: #788a99; font-size: 12px; }
#mapping-workspace .progress-note { margin: 8px 0 0; color: #687b8a; font-size: 12px; }
#mapping-workspace .job-error { margin: 9px 0 0; color: #ff929a; font-size: 13px; word-break: break-word; }
#mapping-workspace .mapping-empty { padding: 22px; border: 1px dashed #2c3a46; border-radius: 9px; color: var(--muted); text-align: center; font-size: 14px; }
.mapping-empty.error { color: #ff9199; }
@keyframes progress-scan { from { transform: translateX(-70px); } to { transform: translateX(900px); } }
@keyframes live-pulse { 50% { opacity: .35; transform: scale(.78); } }
@keyframes stage-current-pulse { 50% { opacity: .25; transform: scale(1.015); } }
.capture-projects-panel { margin-bottom: 24px; padding: 20px; border: 1px solid #285247; border-radius: 14px; background: linear-gradient(145deg, #12221f, #0d1518); }
.capture-project-summary { color: var(--muted); font-size: 11px; }
.mapping-profile-control { min-width: 250px; display: grid; grid-template-columns: auto minmax(145px, 1fr); align-items: center; gap: 4px 9px; color: #8fa69f; font-size: 10px; }
.mapping-profile-control select { min-width: 0; padding: 8px 10px; border: 1px solid #2c6d5d; border-radius: 8px; color: #b8f4e3; background: #10221e; font-size: 11px; font-weight: 700; }
.mapping-profile-control small { grid-column: 1 / -1; color: #627b73; font-size: 9px; }
.capture-project-grid { display: grid; gap: 14px; }
.capture-project-card { min-width: 0; overflow: hidden; border: 1px solid #263f3a; border-radius: 12px; background: #0b1415; }
.capture-project-header { padding: 17px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid #213a34; background: #0e1919; }
.capture-project-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid #286b5a; border-radius: 10px; color: var(--accent); background: #11362e; font-size: 20px; }
.capture-project-content { min-width: 0; flex: 1; }
.capture-project-title { display: flex; align-items: center; gap: 9px; }
.capture-project-title h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.capture-project-content p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.capture-project-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; color: #6f887f; font: 10px/1.4 monospace; }
.capture-project-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.capture-project-open, .capture-build-all { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--accent-2); border-radius: 8px; color: #07130f; background: var(--accent); text-decoration: none; font-size: 12px; font-weight: 700; }
.capture-project-open:hover { background: #4ce8c0; }
.capture-build-all { color: #8ff0d3; border-color: #2c6d5d; background: #102c26; }
.capture-build-all:hover:not(:disabled) { color: #07130f; background: var(--accent); }
.capture-build-all:disabled, .capture-build-button:disabled { opacity: .46; cursor: not-allowed; }
.capture-hierarchy { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.capture-outdoor, .capture-connectors { grid-column: 1 / -1; }
.capture-building { min-width: 0; overflow: hidden; border: 1px solid #233d37; border-radius: 10px; background: #0b1213; }
.capture-building-head { min-height: 54px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #20342f; background: #101b1b; }
.capture-building-head div span, .capture-building-head div strong { display: block; }
.capture-building-head div span { margin-bottom: 4px; color: #5d8479; font: 700 9px/1 monospace; letter-spacing: .14em; text-transform: uppercase; }
.capture-building-head div strong { font-size: 13px; }
.capture-building-head small { color: #71877f; white-space: nowrap; font-size: 10px; }
.capture-floor-list { display: grid; }
.capture-floor-empty { padding: 20px; color: #687b75; text-align: center; font-size: 11px; }
.capture-node { min-width: 0; min-height: 62px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #1c302b; }
.capture-node:first-child { border-top: 0; }
.capture-node-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.capture-node-icon { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 8px; color: #76bda9; background: #142924; }
.capture-node-main div { min-width: 0; }
.capture-node-main strong, .capture-node-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capture-node-main strong { font-size: 12px; }
.capture-node-main span { margin-top: 5px; color: #667b75; font-size: 9px; }
.capture-node-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.capture-state { padding: 5px 8px; border-radius: 99px; color: #95a49f; background: #202b28; font-size: 9px; white-space: nowrap; }
.capture-state.capturing { color: #7bc8ff; background: #172f43; }
.capture-state.ready { color: #07130f; background: var(--accent); }
.capture-state.queued, .capture-state.processing { color: #ffda79; background: #3b3218; }
.capture-state.succeeded, .capture-state.published, .capture-state.review { color: #66e8c4; background: #123a30; }
.capture-state.failed, .capture-state.ambiguous, .capture-state.unavailable { color: #ff9ca4; background: #49232a; }
.capture-build-button { padding: 6px 10px; border: 1px solid #2c826b; border-radius: 7px; color: #07130f; background: var(--accent); font-size: 10px; font-weight: 700; }
.capture-build-button:hover:not(:disabled) { background: #55e8c1; }
.capture-connectors { overflow: hidden; border: 1px solid #233d37; border-radius: 10px; background: #0b1213; }
.capture-connectors summary { padding: 12px 14px; color: #9eaea8; cursor: pointer; font-size: 11px; }
.capture-connectors summary span { margin-left: 6px; color: #668078; }
.section-heading { margin: 34px 0 18px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.map-card { min-height: 270px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(150deg, #151e28, #0f151d); transition: border-color .18s, transform .18s; }
.map-card:hover { border-color: #405366; transform: translateY(-2px); }
.map-card.archived { opacity: .64; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.map-icon { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid #245c50; border-radius: 10px; color: var(--accent); background: #13352e; font-size: 20px; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge { padding: 4px 8px; border-radius: 20px; color: #aab7c5; background: #202b37; font-size: 10px; }
.badge.active { color: #55e8c1; background: #123b31; }
.map-card h2 { margin: 20px 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; }
.description { height: 40px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; overflow: hidden; }
.meta { margin: 18px 0 0; display: flex; gap: 18px; color: #768697; font-size: 11px; }
.tags { min-height: 23px; margin-top: 13px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { color: #9babb9; font-size: 11px; }
.tag::before { content: '#'; color: #54677a; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid #222e3a; }
.card-actions a, .card-actions button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: #bec9d3; background: #121a23; text-decoration: none; font-size: 12px; }
.card-actions .open-editor { flex: 1; text-align: center; color: #07130f; border-color: var(--accent-2); background: var(--accent); font-weight: 700; }
.card-actions .open-preview { display: grid; place-items: center; white-space: nowrap; color: #71eac7; border-color: #286b5a; background: #102b25; }
.card-actions .open-preview:hover { border-color: #48b797; background: #15382f; }
.card-actions .open-preview.unavailable { color: #687a76; border-color: #273733; background: #101816; cursor: not-allowed; opacity: .72; }
.card-actions .archive { color: #ff8d95; }
.state, .empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.state.error { color: #ff9199; }
.empty div { color: var(--accent); font-size: 42px; }
.empty h2 { margin-bottom: 5px; color: var(--text); }
.empty p { margin-top: 0; }
dialog { width: min(520px, calc(100% - 32px)); border: 1px solid #334253; border-radius: 16px; color: var(--text); background: #111923; box-shadow: 0 24px 80px #000b; }
dialog::backdrop { background: #030609bb; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 25px; }
.dialog-heading h2 { margin: 0; font-size: 26px; }
.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 27px; }
#map-form { padding: 10px; }
#map-form label { display: block; margin: 16px 0; color: #c2ccd5; font-size: 13px; }
#map-form input, #map-form textarea { width: 100%; margin-top: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: #0b1118; resize: vertical; }
#map-form input:focus, #map-form textarea:focus { border-color: var(--accent-2); }
.new-project-hint { margin: 14px 0 2px; padding: 12px 13px; border: 1px solid #24504b; border-radius: 9px; color: #a9ddd2; background: #102622; font-size: 12px; line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.form-error { color: #ff8f97; font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 12px 16px; border: 1px solid #285e51; border-radius: 9px; color: #a8f3df; background: #102d27; box-shadow: 0 12px 40px #0008; }

@media (max-width: 1050px) {
  body[data-authenticated="true"] { padding-left: 0; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: 44vh; padding: 40px; }
  .auth-intro h1 { font-size: clamp(34px, 7vw, 54px); }
  .auth-panel { min-height: 56vh; }
  .sidebar { position: sticky; inset: auto; top: 72px; width: auto; height: 54px; padding: 6px 14px; border-right: 0; border-bottom: 1px solid #1e2834; }
  .sidebar-label, .sidebar-hint { display: none; }
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .sidebar nav a { min-height: 40px; justify-content: center; }
  .workspace-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .mapping-stage-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .job-live-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture-hierarchy { grid-template-columns: 1fr; }
  .capture-project-header { align-items: flex-start; flex-wrap: wrap; }
  .capture-project-actions { width: 100%; }
  .capture-project-actions > * { flex: 1; text-align: center; }
}
@media (max-width: 620px) {
  .mapping-stage-panel header { align-items: flex-start; flex-direction: column; }
  .mapping-stage-panel header span { text-align: left; }
  .mapping-stage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-intro { min-height: auto; padding: 28px 22px 38px; gap: 54px; }
  .auth-intro h1 { font-size: 34px; }
  .auth-intro ul { display: none; }
  .auth-panel { min-height: auto; padding: 24px 14px 42px; }
  .auth-card { padding: 27px 22px; }
  .health { display: none; }
  .account-chip strong { display: none; }
  .top-actions { gap: 7px; }
  .sidebar nav a { padding: 0 5px; gap: 5px; font-size: 10px; }
  .sidebar nav a span { width: 15px; font-size: 13px; }
  main { width: min(100% - 28px, 1280px); padding-top: 34px; }
  .summary { width: 100%; flex-wrap: wrap; }
  .summary div { flex: 1 0 50%; min-width: 0; padding: 13px; }
  .workspace-links { grid-template-columns: 1fr; }
  .workspace-links a { min-height: 190px; }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .page-heading, .mapping-heading, .job-head, .section-heading { align-items: flex-start; flex-direction: column; }
  .mapping-live { align-self: flex-start; }
  .capture-node { align-items: flex-start; flex-direction: column; }
  .capture-node-actions { width: 100%; justify-content: space-between; }
  .map-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .top-actions .primary { padding: 9px 11px; }
}
