html,
body {
    margin: 0;
    min-height: 100%;
    background: #071412;
}

html {
    scroll-padding-top: 0;
}

body {
    padding-top: 0;
}

.camera-app {
    min-height: 100vh;
    min-height: 100dvh;
    background: #071412;
    color: #ffffff;
}

.camera-screen {
    width: min(100%, 520px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(14px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
}

.camera-topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
}

.camera-icon-link,
.camera-topbar-spacer {
    width: 44px;
    height: 44px;
}

.camera-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 34px;
    line-height: 1;
    text-decoration: none;
}

.camera-title-group {
    min-width: 0;
    text-align: center;
}

.camera-title-group h1,
.camera-title-group p {
    margin: 0;
}

.camera-title-group h1 {
    font-size: 18px;
    line-height: 1.25;
}

.camera-title-group p {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    line-height: 1.3;
}

.camera-stage {
    position: relative;
    overflow: hidden;
    align-self: stretch;
    min-height: 0;
    border-radius: 24px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-video,
.camera-preview {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    background: #0f172a;
}

.camera-preview {
    display: none;
}

.camera-preview.is-visible {
    display: block;
}

.camera-video.is-hidden {
    display: none;
}

.camera-controls {
    display: block;
    margin-top: 14px;
}

.camera-bottom-panel {
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
}

.camera-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.camera-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 18px 30px -24px rgba(0, 0, 0, 0.72);
}

.camera-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.camera-button-primary {
    border: none;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
    box-shadow: 0 20px 34px -22px rgba(15, 118, 110, 0.82);
}

.camera-button-secondary {
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
}

.camera-status {
    min-height: 24px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    line-height: 1.7;
}

.camera-result-note {
    display: none;
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-height: min(34%, 180px);
    overflow: auto;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(7, 20, 18, 0.78);
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(14px);
}

.camera-result-note.is-visible {
    display: block;
}

.camera-canvas {
    display: none;
}

@media (max-width: 560px) {
    .camera-stage {
        border-radius: 18px;
    }

    .camera-result-note {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-height: 38%;
        padding: 10px 12px;
        font-size: 13px;
    }

    .camera-button {
        width: 100%;
    }
}
