/* ═══════════════════════════════════════════════════════════════
   SiteScan Pro — Apple HIG Dark Theme
   iOS + Android 通用 / 直向 + 橫向支援
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-dark: #000000;
    --surface-1: rgba(28, 28, 30, 0.95);
    --surface-2: rgba(44, 44, 46, 0.9);
    --surface-3: rgba(58, 58, 60, 0.85);
    --glass: rgba(28, 28, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-blue: #0A84FF;
    --accent-orange: #FF9F0A;
    --accent-green: #30D158;
    --accent-purple: #BF5AF2;
    --accent-red: #FF453A;
    --accent-teal: #64D2FF;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.36);
    --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: "SF Mono", ui-monospace, SFMono-Regular, "Fira Code", monospace;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

html,
body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    width: 100%;
    height: 100%;
    height: 100dvh;
    touch-action: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 啟動頁 要可以捲動 */
body:has(#start-screen:not(.hidden)) {
    overflow-y: auto;
    touch-action: auto;
}

.hidden {
    display: none !important;
}

.fullscreen-view {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blur-card {
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}

/* ─── Start Screen ─── */
#start-screen {
    z-index: 50;
    align-items: center;
    justify-content: flex-start;
    background: var(--bg-dark);
    padding: 24px;
    padding-top: calc(var(--safe-top) + 20px);
    padding-bottom: calc(var(--safe-bottom) + 40px);
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
}

.header-safe-area {
    height: var(--safe-top);
    width: 100%;
    min-height: 12px;
}

.site-scan-logo {
    margin-top: 16px;
    margin-bottom: 6px;
}

.site-scan-logo svg {
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(255, 159, 10, 0.35));
}

.site-scan-logo h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
    font-weight: 400;
}

.feature-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    max-width: 340px;
}

.feature-pills span {
    background: var(--surface-2);
    padding: 5px 10px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--accent-orange);
    font-weight: 600;
    border: 1px solid var(--glass-border);
}

.setup-form {
    background: var(--surface-1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
    width: 100%;
    max-width: 340px;
}

.setup-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.stepper-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--surface-3);
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.stepper-btn:active {
    background: var(--accent-orange);
    color: #000;
    transform: scale(0.92);
}

#input-height {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 34px;
    font-weight: 700;
    text-align: center;
    width: 80px;
    font-family: var(--font-ui);
    pointer-events: none;
}

.height-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.5;
    text-align: left;
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
}

.btn-apple {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-apple.primary {
    background: var(--accent-orange);
    color: #000;
}

.btn-apple.primary:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.btn-apple.secondary {
    background: var(--surface-2);
    color: var(--text-primary);
}

.btn-apple.secondary:active {
    background: var(--surface-3);
}

.btn-apple.outline {
    background: transparent;
    color: var(--accent-orange);
    border: 1.5px solid var(--accent-orange);
}

.btn-apple.text {
    background: transparent;
    color: var(--accent-blue);
    font-size: 15px;
}

/* ─── Venue Grid ─── */
.venue-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 340px;
    padding: 0;
}

.venue-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 8px;
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s;
}

.venue-card:active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    transform: scale(0.96);
    color: #000;
}

.venue-card .v-icon {
    font-size: 1.5rem;
}

.venue-card .v-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.venue-heading {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 12px 0 10px;
    text-align: center;
    font-weight: 600;
}

/* ─── Viewports ─── */
#camera-container {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: #000;
}

#ar-container {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: transparent;
    pointer-events: none;
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

#camera-error {
    background: var(--bg-dark);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

/* ─── UI Layer (AR 掃描 HUD) ─── */
#ui-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

button,
.mode-carousel,
select,
input {
    pointer-events: auto;
}

/* ─── Top Nav ─── */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
}

.pill-badge {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--glass-border);
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}

.distance-pill {
    color: var(--accent-green);
    transition: color 0.3s;
}

.dashboard-pill {
    color: var(--text-primary);
    background: rgba(255, 159, 10, 0.15);
    border-color: rgba(255, 159, 10, 0.2);
    cursor: pointer;
    border: none;
    font-family: var(--font-ui);
}

.count-badge {
    background: var(--accent-orange);
    color: #000;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 100px;
    font-weight: 800;
    min-width: 18px;
    text-align: center;
}

/* ─── Reticle ─── */
.ar-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.crosshair-h,
.crosshair-v {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.crosshair-h {
    width: 100vw;
    height: 1px;
}

.crosshair-v {
    width: 1px;
    height: 100vh;
}

.ch-center {
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.ch-center.aiming-up {
    border-color: var(--accent-purple);
    border-style: dashed;
    transform: scale(1.2);
}

.ch-center::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
}

/* ─── Step Hint ─── */
.step-hint {
    position: absolute;
    top: calc(50% + 44px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--accent-orange);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--glass-border);
}

/* ─── Capture Sidebar ─── */
.capture-sidebar {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
}

.side-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s;
}

.side-action-btn svg {
    width: 22px;
    height: 22px;
}

.side-action-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.15);
}

.side-action-btn.record .record-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-red);
    transition: 0.3s;
}

.side-action-btn.recording {
    border-color: var(--accent-red);
}

.side-action-btn.recording .record-dot {
    border-radius: 3px;
    transform: scale(0.8);
    animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

/* ─── Bottom Controls ─── */
.bottom-controls {
    padding: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    width: 100%;
}

/* Mode Carousel */
.mode-selector-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.mode-carousel {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.mode-carousel::-webkit-scrollbar {
    display: none;
}

.m-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 100px;
    white-space: nowrap;
}

.m-item.active {
    color: var(--text-primary);
    background: var(--surface-3);
}

/* Shutter Row */
.shutter-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 0 24px;
    gap: 24px;
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.action-icon svg {
    width: 22px;
    height: 22px;
}

.action-icon:active {
    transform: scale(0.9);
}

.action-icon.disabled {
    opacity: 0;
    pointer-events: none;
}

.shutter-wrapper {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s;
}

.shutter-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: #fff;
    cursor: pointer;
    transition: all 0.1s;
}

.shutter-btn:active {
    transform: scale(0.85);
}

/* Shutter mode colors */
.mode-plan .shutter-btn {
    background: #fff;
}

.mode-measure .shutter-btn {
    background: var(--accent-teal);
}

.mode-height .shutter-wrapper {
    border-color: var(--accent-purple);
}

.mode-height .shutter-btn {
    background: var(--accent-purple);
}

.mode-poi .shutter-wrapper {
    border-color: var(--accent-orange);
}

.mode-poi .shutter-btn {
    background: var(--accent-orange);
}

/* ─── Modals / Sheets ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.black-overlay {
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
}

.modal-sheet {
    background: var(--surface-1);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 12px 20px calc(20px + var(--safe-bottom)) 20px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.drag-indicator {
    width: 36px;
    height: 5px;
    background: var(--text-tertiary);
    border-radius: 2.5px;
    margin: 0 auto 16px auto;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sheet-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.icon-btn-close {
    background: var(--surface-3);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
}

/* Alert Dialog (Gyro Permission) */
.alert-dialog {
    border-radius: var(--radius-lg);
    width: 280px;
    text-align: center;
    overflow: hidden;
    background: var(--surface-1);
}

.alert-dialog h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 20px 16px 8px;
    color: var(--text-primary);
}

.alert-dialog p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 16px 20px;
    line-height: 1.4;
}

.dialog-actions {
    display: flex;
    border-top: 1px solid var(--separator);
}

.dialog-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px;
    font-size: 17px;
    cursor: pointer;
    color: var(--accent-blue);
}

.dialog-btn.confirm {
    font-weight: 600;
    color: var(--accent-orange);
}

/* POI */
.poi-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.poi-grid-scroll {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--separator);
    margin-bottom: 12px;
}

.poi-category {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.poi-btn {
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    font-family: var(--font-ui);
}

.poi-btn:active {
    background: var(--accent-orange);
    color: #000;
    transform: scale(0.96);
}

.poi-custom-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.modern-input {
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 16px;
    font-family: var(--font-ui);
}

.modern-input:focus {
    outline: none;
    border-color: var(--accent-orange);
}

/* Dashboard Items */
.dashboard-scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-tertiary);
    font-size: 14px;
}

.d-item {
    background: var(--surface-2);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.d-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.d-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.d-type.plan {
    color: var(--accent-blue);
}

.d-type.measure {
    color: var(--accent-green);
}

.d-type.height {
    color: var(--accent-purple);
}

.d-type.poi {
    color: var(--accent-orange);
}

.d-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.d-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.d-value small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Sniper Distance Override */
.slider-container {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin: 0 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--surface-3);
    border-radius: 2px;
}

.btn-reset-lock {
    background: rgba(255, 69, 58, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-ui);
}

.btn-reset-lock:active {
    background: var(--accent-red);
    color: #fff;
}

/* ─── LiDAR Effect ─── */
#lidar-sweep,
#lidar-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    display: none;
    transition: opacity 1s;
}

#lidar-sweep {
    background: linear-gradient(180deg, transparent 0%, rgba(48, 209, 88, 0.08) 48%, rgba(48, 209, 88, 0.25) 50%, transparent 52%);
    background-size: 100% 200vh;
    animation: lidarScan 3s linear infinite;
}

@keyframes lidarScan {
    0% {
        background-position: 0 -100vh;
    }

    100% {
        background-position: 0 100vh;
    }
}

#lidar-grid {
    background-image:
        linear-gradient(rgba(48, 209, 88, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(48, 209, 88, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(600px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    transform-origin: top;
    animation: gridMove 2s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 60px;
    }
}

body.lidar-active #lidar-sweep,
body.lidar-active #lidar-grid {
    display: block;
    opacity: 1;
}

/* ═══════════════════════════════════════
   LANDSCAPE LAYOUT
   ═══════════════════════════════════════ */

@media (orientation: landscape) {
    .bottom-controls {
        flex-direction: row;
        padding: 0 16px 8px;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    }

    .mode-selector-wrapper {
        width: auto;
        margin-bottom: 0;
        margin-right: 16px;
    }

    .mode-carousel {
        padding: 6px 8px;
        gap: 2px;
    }

    .m-item {
        font-size: 11px;
        padding: 5px 8px;
    }

    .shutter-row {
        max-width: none;
        gap: 16px;
        padding: 0;
    }

    .shutter-wrapper {
        width: 56px;
        height: 56px;
    }

    .shutter-btn {
        width: 44px;
        height: 44px;
    }

    .action-icon {
        width: 38px;
        height: 38px;
    }

    .action-icon svg {
        width: 18px;
        height: 18px;
    }

    .top-nav {
        padding: 6px 16px;
    }

    .pill-badge {
        font-size: 12px;
        padding: 5px 10px;
    }

    .capture-sidebar {
        right: 8px;
        gap: 10px;
    }

    .side-action-btn {
        width: 36px;
        height: 36px;
    }

    .side-action-btn svg {
        width: 18px;
        height: 18px;
    }

    .slider-container {
        margin: 0 16px 4px;
        padding: 6px 12px;
    }

    .step-hint {
        top: calc(50% + 36px);
        font-size: 12px;
        padding: 6px 12px;
    }

    .ch-center {
        width: 30px;
        height: 30px;
    }

    /* Modal sheets in landscape: side panel instead of bottom */
    .modal-sheet {
        max-height: 100vh;
        border-radius: 0 0 0 0;
        max-width: 420px;
        margin-left: auto;
    }
}

/* Small phone (SE size) */
@media (max-height: 600px) and (orientation: portrait) {
    .shutter-wrapper {
        width: 60px;
        height: 60px;
    }

    .shutter-btn {
        width: 48px;
        height: 48px;
    }

    .bottom-controls {
        padding-bottom: 8px;
    }

    .mode-carousel {
        padding: 6px 12px;
    }

    .m-item {
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* Large tablet */
@media (min-width: 768px) {
    .modal-sheet {
        max-width: 500px;
        margin: 0 auto;
        border-radius: 20px 20px 0 0;
    }
}

/* ─── Orientation Toggle Indicator ─── */
.orientation-indicator {
    position: fixed;
    top: calc(var(--safe-top) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: auto;
    display: flex;
    gap: 2px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 3px;
}

.orientation-indicator button {
    padding: 4px 10px;
    border-radius: 100px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-ui);
    background: transparent;
    color: var(--text-tertiary);
}

.orientation-indicator button.active {
    background: var(--accent-blue);
    color: #fff;
}