:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-2: #eef3f7;
    --text: #172033;
    --muted: #667085;
    --border: #d9e1ea;
    --accent: #1f6feb;
    --accent-dark: #1558c7;
    --danger: #b42318;
    --success: #027a48;
    --shadow: 0 14px 30px rgba(23, 32, 51, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.navlinks { display: flex; align-items: center; gap: 18px; }
.inline-form { display: inline; }
.link-button { background: transparent; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.container { width: min(1180px, calc(100% - 32px)); margin: 32px auto; }
.viewer-page .container { width: 100%; margin: 0; }
.viewer-page .topbar { display: none; }

.hero { display: grid; grid-template-columns: 1.25fr .85fr; gap: 32px; align-items: center; padding: 48px 0; }
.hero h1, .page-heading h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1; margin: 0 0 18px; letter-spacing: -0.04em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--accent); font-size: .78rem; margin: 0 0 12px; }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading.narrow { max-width: 760px; }
.page-heading h1 { font-size: clamp(2rem, 3vw, 3rem); }
.muted { color: var(--muted); }
.small-text { font-size: .86rem; }
.hint { color: var(--muted); font-size: .88rem; margin-top: 6px; }

.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.top-align { align-items: start; }

.card, .metric, .empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.form-card { max-width: 100%; }
.metric span { display: block; font-size: 1.5rem; font-weight: 800; }
.metric label { color: var(--muted); font-size: .88rem; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    background: var(--accent);
    color: white;
    cursor: pointer;
    min-height: 42px;
}
.button:hover { background: var(--accent-dark); color: white; text-decoration: none; }
.button.secondary { background: var(--surface-2); color: var(--text); }
.button.secondary:hover { background: #dfe8f1; }
.button.small { padding: 8px 12px; min-height: 34px; border-radius: 10px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.actions.compact { margin-top: 0; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.validation { color: var(--danger); font-size: .9rem; }
.notice { border: 1px solid #99c2ff; background: #eaf2ff; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; }
.notice.danger, .card.danger { border-color: #f0b3aa; background: #fff0ee; color: var(--danger); }

.badge, .status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .78rem;
    font-weight: 800;
}
.status.ready, .status.finished, .status.succeeded { background: #dcfae6; color: var(--success); }
.status.failed { background: #fee4e2; color: var(--danger); }
.status.processing, .status.queued, .status.uploading, .status.running { background: #fef0c7; color: #93370d; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 12px 8px; vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.table-actions { display: flex; gap: 14px; justify-content: flex-end; }

.check-list, .plain-list, .timeline, .checklist-readonly, .viewer-checklist { list-style: none; padding: 0; margin: 0; }
.check-list li { margin: 11px 0; padding-left: 28px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.plain-list li, .timeline li { border-bottom: 1px solid var(--border); padding: 12px 0; }
.plain-list li:last-child, .timeline li:last-child { border-bottom: 0; }
.checklist-readonly li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.checklist-readonly li.done span { color: var(--success); font-weight: 900; }
.checklist-readonly p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }

.empty-state { text-align: center; padding: 42px; }
.empty-state.slim { padding: 22px; box-shadow: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.progress-wrap { margin-top: 18px; }
.progress-bar { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

.viewer-layout { height: 100vh; display: grid; grid-template-columns: 390px minmax(0, 1fr); overflow: hidden; }
.finish-sidebar { background: #0f172a; color: #e5ecff; overflow-y: auto; padding: 20px; border-right: 1px solid #243149; }
.finish-sidebar a { color: #9ec5ff; }
.finish-sidebar .muted, .finish-sidebar .hint { color: #a8b3cf; }
.finish-sidebar section { border-top: 1px solid #243149; padding: 18px 0; }
.sidebar-header h1 { font-size: 1.25rem; margin: 0 0 8px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.compact-form label { margin-top: 10px; }
.viewer-checklist li { border-bottom: 1px solid #243149; padding: 12px 0; }
.viewer-checklist label { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; }
.viewer-checklist input[type="checkbox"] { width: auto; margin-top: 3px; }
.viewer-checklist textarea { background: #162033; color: #e5ecff; border-color: #33415f; }
.small-list p { color: #a8b3cf; margin: 4px 0 0; }
.potree-host { position: relative; min-width: 0; min-height: 0; background: #111827; }
#potree_render_area { width: 100%; height: 100vh; }
#potree_sidebar_container { position: absolute; left: 0; top: 0; }
.viewer-status { position: absolute; top: 18px; left: 18px; background: rgba(15, 23, 42, .88); color: white; border-radius: 12px; padding: 12px 14px; max-width: 520px; z-index: 10; }
.viewer-status.error { background: rgba(180, 35, 24, .95); }

@media (max-width: 900px) {
    .hero, .grid.two, .grid.three, .grid.four, .form-grid { grid-template-columns: 1fr; }
    .page-heading { flex-direction: column; }
    .viewer-layout { grid-template-columns: 1fr; grid-template-rows: 45vh 55vh; }
    .finish-sidebar { grid-row: 2; }
    .potree-host { grid-row: 1; }
    #potree_render_area { height: 45vh; }
}

.plan-meter { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; align-items: center; gap: 16px; }
.mini-meter { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.mini-meter span { display: block; height: 100%; background: var(--accent); }
.pricing-grid { margin-bottom: 24px; }
.plan-card.current { border-color: var(--accent); }
.price-label { font-size: 1.35rem; font-weight: 900; margin: 6px 0 0; }
.upgrade-card { border-color: #b2ccff; background: #eff6ff; }
.slim-notice { margin-top: 12px; }
.align-end { align-items: end; }
.layer-list { list-style: none; padding: 0; margin: 0; }
.layer-list li { border-bottom: 1px solid #243149; padding: 10px 0; }
.layer-list li.selected { background: rgba(158, 197, 255, .12); border-radius: 10px; padding-inline: 8px; }
.layer-row { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; }
.layer-row input[type="checkbox"] { width: auto; }
.layer-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.realtime-status { position: absolute; top: 70px; left: 18px; background: rgba(2, 122, 72, .95); color: white; border-radius: 12px; padding: 10px 12px; max-width: 520px; z-index: 10; }
.sidebar-upgrade { background: rgba(31, 111, 235, .14); border: 1px solid rgba(158, 197, 255, .28); border-radius: 14px; padding: 14px !important; margin: 14px 0; }
.sidebar-upgrade.soft { background: rgba(255, 255, 255, .06); }
.shared-viewer-card { margin-top: 24px; }
#shared_potree_render_area { width: 100%; height: 70vh; min-height: 520px; background: #111827; border-radius: 14px; overflow: hidden; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 900px) {
    .plan-meter { grid-template-columns: 1fr; }
}
.inline-check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.inline-check input[type="checkbox"] { width: auto; }

/* Collaborative point-cloud alignment workspace */
.editor-workbench-page { background: #070b16; }
.pc-workbench {
    height: 100vh;
    min-height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(31, 111, 235, .22), transparent 34%), #070b16;
    color: #e5ecff;
}
.pc-workbench .eyebrow { color: #9ec5ff; }
.pc-workbench-header {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, .94);
    border-bottom: 1px solid rgba(158, 197, 255, .18);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .24);
    z-index: 20;
}
.pc-workbench-title h1 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.9rem); line-height: 1.08; letter-spacing: -.03em; }
.pc-workbench-title p { margin: 4px 0 0; color: #a8b3cf; }
.pc-workbench-title .eyebrow { margin-bottom: 4px; }
.pc-workbench-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.pc-workbench-notice {
    margin: 10px 18px 0;
    border: 1px solid rgba(158, 197, 255, .28);
    background: rgba(31, 111, 235, .15);
    color: #e5ecff;
    border-radius: 14px;
    padding: 11px 13px;
    z-index: 15;
}
.pc-workbench-notice.danger { border-color: rgba(240, 179, 170, .65); background: rgba(180, 35, 24, .2); color: #ffd7d2; }
.pc-viewer-shell { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #111827; }
.pc-viewer-shell #potree_render_area { width: 100%; height: 100%; min-height: 0; }
.pc-viewer-shell #potree_sidebar_container { position: absolute; left: 0; top: 0; z-index: 2; }
.pc-floating-panel {
    position: absolute;
    z-index: 12;
    border: 1px solid rgba(158, 197, 255, .22);
    border-radius: 18px;
    background: rgba(15, 23, 42, .84);
    color: #e5ecff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
    backdrop-filter: blur(10px);
}
.pc-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(158, 197, 255, .14);
}
.pc-panel-heading.compact { padding-bottom: 12px; }
.pc-panel-heading h2 { margin: 0; font-size: 1rem; }
.pc-panel-heading p { margin: 4px 0 0; color: #a8b3cf; font-size: .82rem; line-height: 1.35; }
.pc-layer-dock { left: 16px; top: 16px; width: min(380px, calc(100vw - 32px)); max-height: calc(100% - 154px); display: flex; flex-direction: column; }
.pc-layer-tree { padding: 10px; overflow: auto; display: grid; gap: 8px; }
.pc-layer-node {
    display: grid;
    grid-template-columns: 26px 34px minmax(0, 1fr) repeat(4, 34px);
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(158, 197, 255, .16);
    border-radius: 14px;
    background: rgba(255, 255, 255, .055);
    padding: 9px;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.pc-layer-node:hover { border-color: rgba(158, 197, 255, .38); background: rgba(255, 255, 255, .08); }
.pc-layer-node.selected,
.pc-layer-group-node.selected { border-color: rgba(158, 197, 255, .72); background: rgba(31, 111, 235, .24); }
.pc-layer-group-node.selected { box-shadow: inset 3px 0 0 #facc15; }
.pc-layer-node.is-hover-highlight,
.pc-layer-group-node.is-hover-highlight {
    border-color: rgba(250, 204, 21, .9) !important;
    box-shadow: inset 3px 0 0 #facc15, 0 0 0 1px rgba(250, 204, 21, .16);
}
.pc-layer-node.is-hidden { opacity: .62; }
.pc-layer-node.is-dirty,
.pc-layer-group-node.is-dirty { box-shadow: inset 3px 0 0 #fdb022; }
.pc-layer-node.is-locked { box-shadow: inset 3px 0 0 #a8b3cf; }
.pc-drag-handle {
    width: 26px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a8b3cf;
    cursor: grab;
    user-select: none;
    touch-action: none;
    border-radius: 10px;
}
.pc-drag-handle:active { cursor: grabbing; background: rgba(255, 255, 255, .08); }
.pc-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(158, 197, 255, .24);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #d9e7ff;
    cursor: pointer;
}
.pc-icon-button.active { background: rgba(31, 111, 235, .45); border-color: rgba(158, 197, 255, .5); color: #fff; }
.pc-layer-select { min-width: 0; background: transparent; border: 0; color: inherit; text-align: left; cursor: pointer; padding: 0; }
.pc-layer-name { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-layer-meta { display: block; color: #a8b3cf; font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.pc-opacity-control { grid-column: 2 / 4; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; align-items: center; margin: 0; color: #a8b3cf; font-size: .76rem; }
.pc-opacity-control input { padding: 0; height: 22px; }
.pc-transform-dock { right: 16px; top: 16px; width: min(390px, calc(100vw - 32px)); max-height: calc(100% - 154px); overflow: auto; }
.pc-selection-cube-dock { right: 16px; bottom: 86px; width: min(330px, calc(100vw - 32px)); overflow: hidden; }
.pc-selection-cube-dock .pc-mode-row { grid-template-columns: repeat(3, 1fr); padding-bottom: 0; }
.pc-selection-cube-dock .pc-panel-actions { padding-top: 10px; }
.pc-warning { margin: 12px 14px 0; border: 1px solid #fedf89; background: rgba(254, 240, 199, .12); color: #ffdf8a; border-radius: 12px; padding: 10px; font-size: .82rem; line-height: 1.35; }
.pc-mode-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 12px 14px 0; }
.pc-mode-row button, .pc-nudge-grid button {
    border: 1px solid rgba(158, 197, 255, .24);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #e5ecff;
    min-height: 34px;
    font-weight: 800;
    cursor: pointer;
}
.pc-mode-row button.active, .pc-nudge-grid button:hover { background: rgba(31, 111, 235, .54); border-color: rgba(158, 197, 255, .55); }
.pc-transform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 0; }
.pc-transform-grid label, .pc-nudge-row label {
    margin: 0;
    color: #a8b3cf;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pc-transform-grid input, .pc-nudge-row input, .pc-export-form input, .pc-inspector-drawer input, .pc-inspector-drawer select, .pc-inspector-drawer textarea {
    margin-top: 5px;
    border-color: rgba(158, 197, 255, .24);
    background: rgba(255, 255, 255, .08);
    color: #f8fbff;
}
.pc-transform-grid input:focus, .pc-nudge-row input:focus, .pc-export-form input:focus { outline: 2px solid rgba(158, 197, 255, .38); }
.pc-nudge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px 0; }
.pc-nudge-grid { display: grid; grid-template-columns: repeat(3, 42px); justify-content: center; gap: 7px; padding: 12px 14px 0; }
.pc-panel-actions { display: flex; gap: 8px; padding: 14px; }
.pc-bottom-toolbar {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 14;
    width: min(1120px, calc(100% - 32px));
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border: 1px solid rgba(158, 197, 255, .22);
    border-radius: 18px;
    background: rgba(15, 23, 42, .88);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
    backdrop-filter: blur(10px);
    padding: 10px;
}
.pc-export-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; margin-left: auto; align-items: center; }
.pc-export-form input { min-height: 34px; padding: 7px 10px; }
.pc-inspector-drawer {
    right: 16px;
    bottom: 86px;
    width: min(760px, calc(100vw - 32px));
    max-height: min(520px, calc(100% - 116px));
    overflow: auto;
}
.pc-inspector-drawer summary { padding: 13px 15px; cursor: pointer; font-weight: 900; }
.pc-inspector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 16px 16px; }
.pc-inspector-grid section { min-width: 0; }
.pc-inspector-grid h2 { margin: 10px 0; font-size: .98rem; }
.compact-checklist { max-height: 260px; overflow: auto; }
.compact-checklist li { padding: 10px 0; }
.compact-checklist textarea { min-height: 64px; }
.pc-inspector-drawer .plain-list li { border-color: rgba(158, 197, 255, .18); }
.pc-inspector-drawer .small-list p { color: #a8b3cf; }
.pc-workbench .viewer-status { top: 86px; left: 50%; transform: translateX(-50%); z-index: 24; pointer-events: none; }
.pc-workbench .realtime-status { top: 138px; left: 50%; transform: translateX(-50%); z-index: 24; pointer-events: none; }

@media (max-width: 1100px) {
    .pc-workbench { min-height: 900px; overflow: auto; }
    .pc-viewer-shell { min-height: 760px; }
    .pc-transform-dock { top: auto; right: 16px; bottom: 160px; max-height: 360px; }
    .pc-selection-cube-dock { right: 16px; bottom: 118px; }
    .pc-layer-dock { max-height: 360px; }
    .pc-bottom-toolbar { bottom: 16px; }
    .pc-export-form { width: 100%; margin-left: 0; }
}
@media (max-width: 760px) {
    .pc-workbench-header { align-items: flex-start; flex-direction: column; }
    .pc-workbench-actions { justify-content: flex-start; }
    .pc-layer-dock, .pc-transform-dock, .pc-selection-cube-dock, .pc-inspector-drawer { position: absolute; left: 10px; right: 10px; width: auto; }
    .pc-layer-dock { top: 10px; }
    .pc-transform-dock { top: 320px; bottom: auto; }
    .pc-selection-cube-dock { bottom: 148px; }
    .pc-inspector-drawer { bottom: 148px; }
    .pc-transform-grid, .pc-inspector-grid { grid-template-columns: 1fr; }
    .pc-bottom-toolbar { align-items: stretch; flex-direction: column; }
    .pc-bottom-toolbar .button, .pc-export-form { width: 100%; }
    .pc-export-form { grid-template-columns: 1fr; }
}

.pc-selection-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(158, 197, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #c8d7f4;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.pc-selection-status.active { color: #e5ecff; background: rgba(31, 111, 235, .32); border-color: rgba(158, 197, 255, .46); }
.pc-selection-status.warning { color: #ffdf8a; background: rgba(254, 240, 199, .12); border-color: rgba(254, 223, 137, .45); }
.pc-operation-remove {
    float: right;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #e5ecff;
    width: 24px;
    height: 24px;
    line-height: 24px;
    cursor: pointer;
}
.pc-operation-remove:hover { background: rgba(180, 35, 24, .45); }
.pc-copy-layer {
    opacity: .92;
}

/* PointCloudEditor UX refinements */
.optional-fields {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 14px 14px;
    background: var(--surface-2);
}
.optional-fields summary {
    cursor: pointer;
    font-weight: 800;
    padding: 14px 0;
}
.optional-fields.compact-optional {
    background: rgba(31, 111, 235, .05);
}
.inline-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 600;
}
.inline-check input {
    width: auto;
    margin-top: 4px;
}
.import-picker { margin-bottom: 18px; }
.import-mode-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    margin-top: 14px;
}
.import-mode-row button {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    min-height: 56px;
    padding: 10px 12px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}
.import-mode-row button.active,
.import-mode-row button:hover {
    border-color: #99c2ff;
    background: #eaf2ff;
}
.import-panel[hidden] { display: none !important; }
.live-progress { margin-bottom: 0; }
.progress-bar {
    width: 100%;
    min-height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
}
.progress-bar > span {
    display: block;
    height: 10px;
    width: 34%;
    border-radius: inherit;
    background: var(--accent);
    transition: width .25s ease;
}

.product-shot-placeholder {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, #111827, #25324a);
    min-height: 340px;
    color: #d9e7ff;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 18px;
}
.placeholder-browser-bar {
    display: flex;
    gap: 7px;
    align-items: center;
    height: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    padding: 0 12px;
}
.placeholder-browser-bar span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
}
.placeholder-ui-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    min-height: 270px;
    margin-top: 14px;
}
.placeholder-sidebar,
.placeholder-viewer,
.mini-ui-placeholder {
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .07);
}
.placeholder-sidebar { padding: 12px; }
.placeholder-sidebar span,
.placeholder-layer-line {
    display: block;
    height: 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    margin-bottom: 10px;
}
.placeholder-viewer { position: relative; overflow: hidden; }
.placeholder-viewer::before,
.placeholder-viewer::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(153, 194, 255, .42), rgba(153, 194, 255, 0) 65%);
}
.placeholder-viewer::before { width: 330px; height: 210px; left: 12%; top: 18%; }
.placeholder-viewer::after { width: 260px; height: 190px; right: -4%; bottom: 4%; }
.feature-card-with-placeholder {
    display: grid;
    gap: 16px;
}
.mini-ui-placeholder {
    min-height: 120px;
    background: linear-gradient(135deg, rgba(31, 111, 235, .16), rgba(23, 32, 51, .06));
    padding: 14px;
}
.mini-ui-placeholder .placeholder-layer-line:nth-child(2) { width: 78%; }
.mini-ui-placeholder .placeholder-layer-line:nth-child(3) { width: 62%; }

.pc-layer-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.pc-layer-node {
    grid-template-columns: 26px 34px minmax(0, 1fr) repeat(4, 34px);
}
.pc-layer-node[hidden] { display: none !important; }
.pc-layer-node .pc-opacity-control {
    grid-column: 3 / 8;
}
.pc-layer-node.is-child {
    margin-left: 24px;
    border-left-color: #fdb022;
}
.pc-layer-group-node {
    display: grid;
    grid-template-columns: 34px 34px minmax(0, 1fr) 34px 34px 34px;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(158, 197, 255, .2);
    border-radius: 14px;
    background: rgba(31, 111, 235, .16);
    padding: 9px;
}
.pc-layer-group-node.is-hidden { opacity: .62; }
.pc-layer-group-node.drag-over,
.pc-layer-tree.drag-over,
.pc-layer-node.drag-over {
    outline: 2px dashed rgba(158, 197, 255, .75);
    outline-offset: 3px;
}
.layer-group-name {
    min-width: 0;
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
    padding: 0;
}
.pc-layer-group-node .pc-layer-name::before { content: "▦ "; opacity: .8; }

.pc-modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 7, 18, .58);
    backdrop-filter: blur(6px);
}
.pc-modal-backdrop[hidden] { display: none !important; }
.pc-modal {
    width: min(540px, 100%);
    border: 1px solid rgba(158, 197, 255, .26);
    border-radius: 20px;
    background: #111827;
    color: #e5ecff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
    padding: 18px;
}
.pc-modal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}
.pc-modal h2 { margin: 0 0 6px; }
.pc-modal p { color: #a8b3cf; }
.pc-modal label { color: #d9e7ff; }
.pc-modal input,
.pc-modal textarea,
.pc-modal select {
    border-color: rgba(158, 197, 255, .24);
    background: rgba(255, 255, 255, .08);
    color: #e5ecff;
}
.pc-modal .pc-export-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0;
}
.pc-share-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}
.pc-share-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(158, 197, 255, .22);
    border-radius: 12px;
    padding: 10px 12px;
    color: #e5ecff;
    background: rgba(255, 255, 255, .06);
}
.pc-share-list a:hover { text-decoration: none; background: rgba(255, 255, 255, .1); }

@media (max-width: 900px) {
    .import-mode-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .placeholder-ui-grid { grid-template-columns: 1fr; }
    .product-shot-placeholder { min-height: 260px; }
}
@media (max-width: 640px) {
    .import-mode-row { grid-template-columns: 1fr; }
    .pc-layer-node { grid-template-columns: 26px 34px minmax(0, 1fr); }
    .pc-layer-node .pc-opacity-control { grid-column: 3 / 4; }
    .pc-layer-node .layer-rename,
    .pc-layer-node .layer-duplicate,
    .pc-layer-node .layer-delete { display: none; }
}
.marketing-hero { align-items: center; }
.hero-note { color: var(--muted); font-size: .9rem; margin-top: 16px; }
.section { margin: 58px 0; }
.section-heading { max-width: 760px; margin-bottom: 22px; }
.section-heading h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.04; margin: 0 0 10px; letter-spacing: -.03em; }
.section.highlight {
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 28px;
    background: linear-gradient(135deg, #ffffff, #eef3f7);
    box-shadow: var(--shadow);
}
.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 58px 0 20px;
    border: 1px solid #99c2ff;
    border-radius: 26px;
    padding: 30px;
    background: #eaf2ff;
    box-shadow: var(--shadow);
}
.cta-card h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.05; }
.placeholder-viewer span {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 1;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .24);
    color: #e5ecff;
    font-size: .82rem;
    font-weight: 800;
}
@media (max-width: 820px) {
    .cta-card { flex-direction: column; align-items: flex-start; }
}

/* Layer-pane drag/drop fixes: only the handle starts a drag; controls remain interactive. */
.pc-layer-node[draggable="false"] { cursor: default; }
.pc-layer-node .pc-drag-handle[draggable="true"] { cursor: grab; }
.pc-layer-node .pc-drag-handle[draggable="false"] { cursor: default; opacity: .55; }
.pc-opacity-control,
.layer-opacity { cursor: pointer; touch-action: pan-x; user-select: auto; }
.pc-layer-tree.is-pointer-dragging,
.pc-layer-tree.is-pointer-dragging * { user-select: none; }
.pc-layer-tree.is-pointer-dragging .pc-drag-handle { cursor: grabbing; }

/* Point quality, annotations, and measurements */
.pc-quality-toolbar { min-width: min(300px, 30vw); }
.pc-quality-control {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    gap: 8px;
    color: #d9e7ff;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}
.pc-quality-control input { padding: 0; height: 22px; }
.pc-quality-control span:last-child { color: #f8fbff; min-width: 64px; text-align: right; }
.pc-annotation-dock {
    right: 16px;
    bottom: 86px;
    width: min(360px, calc(100vw - 32px));
    max-height: min(380px, calc(100% - 130px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pc-annotation-list {
    list-style: none;
    margin: 0;
    padding: 10px;
    display: grid;
    gap: 8px;
    overflow: auto;
}
.pc-annotation-list:empty::before {
    content: "No saved annotations or measurements yet.";
    color: #a8b3cf;
    border: 1px dashed rgba(158, 197, 255, .24);
    border-radius: 12px;
    padding: 10px;
    display: block;
    font-size: .82rem;
}
.pc-annotation-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    border: 1px solid rgba(158, 197, 255, .18);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    padding: 10px;
}
.pc-annotation-list li strong { display: block; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-annotation-list li p { margin: 5px 0 0; color: #a8b3cf; font-size: .78rem; line-height: 1.35; }
.pc-annotation-list .pc-annotation-distance { color: #fde68a; font-weight: 900; }
.pc-annotation-actions {
    display: grid;
    grid-template-columns: 32px 32px;
    gap: 4px;
}
.pc-annotation-actions .pc-icon-button {
    width: 32px;
    height: 32px;
}
.pc-annotation-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    pointer-events: none;
}
.pc-annotation-label {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 86px;
    max-width: 260px;
    border: 2px solid rgba(250, 204, 21, .95);
    border-radius: 13px;
    background: rgba(2, 6, 23, .94);
    color: #f8fbff;
    box-shadow: 0 0 0 2px rgba(2, 6, 23, .95), 0 16px 34px rgba(0, 0, 0, .55), 0 0 24px rgba(250, 204, 21, .22);
    padding: 7px 10px;
    pointer-events: auto;
    text-align: left;
    cursor: pointer;
    transform-origin: 50% 50%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}
.pc-annotation-label.note::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: #facc15;
    box-shadow: 0 0 0 1px rgba(2, 6, 23, .95), 0 0 12px rgba(250, 204, 21, .6);
    transform: translateX(-50%);
}
.pc-annotation-anchor-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    background: #facc15;
    border: 3px solid #020617;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, .45), 0 0 18px rgba(250, 204, 21, .65);
    pointer-events: auto;
    cursor: pointer;
}
.pc-annotation-label strong,
.pc-annotation-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-annotation-label strong { font-size: .92rem; }
.pc-annotation-label span { color: #fde68a; font-size: .76rem; margin-top: 3px; }
.pc-annotation-label.measurement { border-color: rgba(125, 211, 252, .95); box-shadow: 0 0 0 2px rgba(2, 6, 23, .95), 0 16px 34px rgba(0, 0, 0, .55), 0 0 24px rgba(125, 211, 252, .24); }
.pc-annotation-label.measurement span { color: #bae6fd; }
@media (max-width: 1100px) {
    .pc-annotation-dock { right: 16px; bottom: 118px; max-height: 300px; }
    .pc-quality-toolbar { min-width: 220px; }
}
@media (max-width: 760px) {
    .pc-annotation-dock { left: 10px; right: 10px; width: auto; bottom: 148px; }
    .pc-quality-control { grid-template-columns: auto minmax(110px, 1fr); }
    .pc-quality-control span:last-child { grid-column: 2 / 3; text-align: left; }
}
.shared-viewer-card { position: relative; }

#potree_render_area { position: relative; }
.shared-viewer-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: .75rem 0;
}
.shared-annotation-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .6rem;
    margin: .75rem 0 1rem;
    max-height: 240px;
}
.shared-annotation-list:empty { display: none; }
.pc-export-progress {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}
.pc-export-progress h3 {
    margin: 0;
    font-size: 1rem;
}
.pc-export-progress-list {
    display: grid;
    gap: 10px;
}
.pc-export-progress-item {
    border: 1px solid rgba(158, 197, 255, .18);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .05);
}
.pc-export-progress-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.pc-export-progress-item p,
.pc-export-progress-item small {
    display: block;
    margin: 6px 0 0;
}
