:root {
    color-scheme: dark;
    --bg: #08090b;
    --panel: #11151a;
    --panel-2: #171b20;
    --line: rgba(199, 231, 217, 0.18);
    --text: #eef6f1;
    --muted: #9eaca6;
    --green: #6df0a8;
    --cyan: #73d7ff;
    --red: #ff4c58;
    --amber: #ffce6e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 0%, rgba(115, 215, 255, 0.14), transparent 34rem),
        radial-gradient(circle at 88% 16%, rgba(255, 76, 88, 0.1), transparent 26rem),
        linear-gradient(180deg, #060709 0%, #0b0f0e 52%, #050607 100%);
    color: var(--text);
    font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.noscript {
    padding: 16px;
    background: #4b1118;
    color: #fff;
    text-align: center;
}

.page-shell {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1180px) minmax(120px, 180px);
    gap: 18px;
    width: min(100%, 1580px);
    margin: 0 auto;
    padding: 18px;
}

.app {
    min-width: 0;
}

.app-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0 10px;
    border-bottom: 1px solid var(--line);
}

.series-name {
    margin: 0 0 4px;
    color: var(--green);
    font-size: 0.84rem;
    font-weight: 700;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: clamp(1.55rem, 3vw, 3rem);
    line-height: 1;
    letter-spacing: 0;
}

.lead {
    max-width: 740px;
    margin-bottom: 0;
    color: #d2ded8;
    font-size: 0.9rem;
}

.system-readout {
    display: grid;
    gap: 6px;
    min-width: 240px;
}

.status-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border: 1px solid rgba(109, 240, 168, 0.42);
    background: rgba(109, 240, 168, 0.08);
    color: var(--green);
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-pill.muted {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

.status-pill.alert {
    border-color: rgba(255, 76, 88, 0.75);
    background: rgba(255, 76, 88, 0.14);
    color: #ffd7dc;
}

.detector-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 18px;
    margin-top: 12px;
}

.camera-panel,
.panel,
.info-section article,
.comments-section,
.site-footer {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(17, 21, 26, 0.84);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.camera-panel {
    height: fit-content;
    overflow: hidden;
}

.camera-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 360px;
    overflow: hidden;
    background:
        linear-gradient(rgba(109, 240, 168, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(109, 240, 168, 0.04) 1px, transparent 1px),
        #020403;
    background-size: 24px 24px;
}

.camera-frame.signal-flash {
    animation: signal-flash 0.34s ease-out;
}

.camera-frame video,
.camera-frame canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.rec-live-badge {
    position: absolute;
    z-index: 4;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 76, 88, 0.68);
    border-radius: 6px;
    background: rgba(45, 5, 10, 0.72);
    color: #fff;
    font-family: "Consolas", monospace;
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0.38;
}

.feed-brand,
.feed-clock {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    border: 1px solid rgba(109, 240, 168, 0.22);
    border-radius: 6px;
    background: rgba(2, 4, 3, 0.42);
    color: rgba(238, 246, 241, 0.78);
    font-family: "Consolas", "Noto Sans JP", monospace;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.72);
}

.feed-brand {
    top: 14px;
    left: 14px;
    display: grid;
    gap: 1px;
    padding: 7px 9px;
}

.feed-brand strong {
    color: rgba(109, 240, 168, 0.86);
    font-family: "Noto Sans JP", system-ui, sans-serif;
    font-size: 0.78rem;
    line-height: 1.2;
}

.feed-brand span,
.feed-clock span {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
}

.feed-clock {
    right: 14px;
    bottom: 14px;
    display: flex;
    gap: 10px;
    padding: 6px 8px;
}

.camera-frame.camera-active .rec-live-badge {
    opacity: 1;
}

.rec-live-badge span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 12px rgba(255, 76, 88, 0.85);
    animation: rec-pulse 1.1s ease-in-out infinite;
}

.camera-frame video {
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0.78;
}

.camera-frame.camera-active {
    background: #020403;
}

.camera-frame.night-primary video {
    filter: brightness(1.58) contrast(1.38) grayscale(1) hue-rotate(95deg) saturate(1.55);
    opacity: 0.86;
}

#analysisCanvas {
    display: none;
}

#overlayCanvas {
    mix-blend-mode: screen;
}

.scan-line {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(109, 240, 168, 0.24), transparent);
    height: 32%;
    animation: scan 3.2s linear infinite;
}

.camera-frame.camera-active .scan-line,
.camera-frame.camera-active .empty-mark {
    display: none;
}

.frame-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.86);
}

.camera-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    place-content: center;
    justify-items: center;
    width: min(78%, 420px);
    transform: translate(-50%, -50%);
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    text-align: center;
    background: transparent;
    backdrop-filter: none;
}

.camera-empty.hidden {
    display: none;
}

.empty-mark {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(109, 240, 168, 0.22), transparent 62%);
}

.camera-empty strong {
    display: block;
    width: min(100%, 24ch);
    max-width: 100%;
    margin: 0 auto;
    color: var(--green);
    font-family: "Consolas", monospace;
    font-size: clamp(0.8rem, 3vw, 1rem);
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}

.camera-empty small {
    display: block;
    max-width: 28em;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.55;
    text-align: center;
}

.warning-banner {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 76, 88, 0.72);
    background: rgba(70, 6, 14, 0.72);
    color: #fff;
    font-family: "Consolas", monospace;
    font-weight: 700;
}

.warning-banner[hidden],
.glitch-banner[hidden] {
    display: none !important;
}

.warning-banner strong {
    color: var(--red);
}

.glitch-banner {
    position: absolute;
    inset: auto 18px 18px;
    padding: 8px 12px;
    border: 1px solid rgba(115, 215, 255, 0.62);
    background: rgba(4, 18, 22, 0.84);
    color: #dff8ff;
    font-family: "Consolas", monospace;
    font-weight: 800;
    text-align: center;
    animation: glitch-flash 0.62s steps(2, end) infinite;
}

.camera-actions {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.22);
}

.inline-control-panel {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 14px 12px;
    background: rgba(0, 0, 0, 0.22);
}

.inline-control-panel h2 {
    grid-row: 1 / span 2;
    margin: 0;
    color: var(--cyan);
    font-family: "Consolas", monospace;
    font-size: 0.86rem;
}

.inline-control-panel .control-row {
    margin: 0;
    min-width: 0;
}

.inline-control-panel .control-row span {
    min-width: 0;
}

.inline-control-panel .control-row small,
.inline-control-panel .control-help {
    display: none;
}

.inline-control-panel .segmented .control-help {
    display: none;
}

.inline-control-panel input[type="range"] {
    width: 48%;
}

.inline-control-panel .segmented {
    grid-column: 2 / span 2;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.inline-control-panel .segmented button {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    white-space: nowrap;
}

.inline-control-panel .toggle-row {
    grid-column: 4;
    grid-row: 2;
    margin: 0;
    white-space: nowrap;
}

.inline-control-panel .toggle-row + .toggle-row {
    justify-self: end;
}

.bottom-hud {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 14px 14px;
    background: rgba(0, 0, 0, 0.22);
}

.bottom-hud .panel {
    box-shadow: none;
}

.camera-actions .primary-btn {
    flex: 1 1 180px;
}

.primary-btn,
.ghost-btn {
    min-height: 42px;
    border-radius: 6px;
    padding: 0 16px;
    font-weight: 800;
    letter-spacing: 0;
}

.primary-btn {
    border: 0;
    background: var(--green);
    color: #03100a;
}

.ghost-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.camera-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
}

.camera-frame:fullscreen video,
.camera-frame:fullscreen canvas {
    object-fit: contain;
    background: #000;
}

.control-panel {
    display: grid;
    gap: 10px;
}

.panel {
    padding: 12px;
}

.panel h2,
.info-section h2 {
    margin-bottom: 9px;
    color: var(--cyan);
    font-family: "Consolas", monospace;
    font-size: 0.95rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.panel-head h2 {
    margin-bottom: 0;
}

.panel-head span {
    color: var(--muted);
    font-family: "Consolas", monospace;
    font-size: 0.72rem;
    font-weight: 700;
}

.sub-monitor-panel {
    padding-bottom: 10px;
}

.sub-monitor {
    position: relative;
    aspect-ratio: 16 / 8.2;
    overflow: hidden;
    border: 1px solid rgba(109, 240, 168, 0.24);
    border-radius: 6px;
    background: #020403;
}

.sub-monitor canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sub-scan {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(180deg, rgba(109, 240, 168, 0.09), rgba(109, 240, 168, 0.09) 1px, transparent 1px, transparent 5px);
    mix-blend-mode: screen;
}

.switch-feed-btn {
    width: 100%;
    margin-top: 8px;
}

.meter-head,
.control-row,
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meter-head span,
.readout-grid span,
.control-row span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.meter-head strong {
    color: var(--green);
    font-size: 1.55rem;
    line-height: 1;
}

.meter-head.compact {
    margin-bottom: 6px;
}

.meter-track {
    height: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
}

#signalFill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
    transition: width 0.18s ease;
}

.signal-stack {
    display: grid;
    gap: 12px;
}

.signal-panel .audio-bars {
    height: 46px;
}

.signal-panel .record-row {
    grid-template-columns: 82px 1fr;
    margin-top: 8px;
}

.readout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.readout-grid div {
    min-height: 58px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
}

.readout-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-family: "Consolas", monospace;
    font-size: 1.06rem;
}

.control-row {
    margin-bottom: 10px;
}

.control-row span {
    display: grid;
    gap: 3px;
}

.control-row small,
.control-help {
    color: #aebbb5;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
}

input[type="range"] {
    width: 52%;
    accent-color: var(--green);
}

select {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-weight: 800;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 6px 0 10px;
}

.segmented .control-help {
    grid-column: 1 / -1;
    margin: 0 0 2px;
}

.segmented button {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.segmented button.active {
    border-color: rgba(109, 240, 168, 0.62);
    background: rgba(109, 240, 168, 0.12);
    color: var(--green);
}

.inline-control-panel .segmented button.active {
    border: 1px solid rgba(109, 240, 168, 0.62);
    border-radius: 6px;
    background: rgba(109, 240, 168, 0.12);
    color: var(--green);
}

.toggle-row {
    justify-content: flex-start;
    color: var(--muted);
}

.toggle-row input {
    accent-color: var(--green);
}

.audio-bars {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    align-items: end;
    gap: 4px;
    height: 50px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.28);
}

.audio-bars span {
    display: block;
    height: 12%;
    min-height: 4px;
    border-radius: 999px 999px 2px 2px;
    background: linear-gradient(180deg, var(--amber), var(--green));
    transition: height 0.08s linear;
}

.record-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 9px;
}

.record-row .ghost-btn {
    min-height: 32px;
}

.record-row .recording {
    border-color: rgba(255, 76, 88, 0.8);
    background: rgba(255, 76, 88, 0.16);
    color: #fff;
}

.record-row span {
    color: var(--muted);
    font-family: "Consolas", monospace;
    font-size: 0.78rem;
    font-weight: 700;
}

.camera-select-row {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.camera-select-row span {
    color: var(--muted);
    font-family: "Consolas", monospace;
    font-size: 0.72rem;
    font-weight: 800;
}

.camera-select-row select {
    min-height: 34px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
    background: rgba(2, 4, 3, 0.66);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
}

.log-panel {
    min-height: 132px;
}

.log-list {
    display: grid;
    gap: 6px;
    max-height: 112px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.log-list li {
    border-left: 2px solid rgba(109, 240, 168, 0.55);
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #cdd9d3;
    font-family: "Consolas", monospace;
    font-size: 0.78rem;
}

.info-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.manual-section {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: rgba(17, 21, 26, 0.84);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.manual-section h2 {
    margin-bottom: 14px;
    color: var(--cyan);
    font-family: "Consolas", monospace;
    font-size: 1rem;
}

.manual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.manual-grid article {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.manual-grid h3 {
    margin: 0 0 7px;
    color: var(--green);
    font-family: "Consolas", monospace;
    font-size: 0.86rem;
}

.manual-grid p {
    margin: 0;
    color: #cbd7d1;
    font-size: 0.92rem;
}

.info-section article,
.comments-section {
    padding: 18px;
}

.info-section p,
.info-section li {
    color: #cbd7d1;
}

.info-section ul {
    padding-left: 1.2em;
}

.tool-links {
    display: grid;
    gap: 8px;
}

.tool-links a {
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.035);
}

.comments-section {
    margin-top: 18px;
}

.site-footer {
    margin-top: 18px;
    padding: 18px;
    color: #cbd7d1;
    font-size: 0.9rem;
    line-height: 1.7;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    margin: 12px 0;
}

.footer-links a {
    color: var(--cyan);
    font-weight: 800;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copy {
    color: var(--muted);
    font-family: "Consolas", monospace;
    font-size: 0.78rem;
}

.comments-section :where(.app-comments, .app-comment-form-section) {
    margin: 0;
    border-color: var(--line);
    background: rgba(10, 14, 18, 0.82);
    color: var(--text);
}

.comments-section :where(.app-comments h2, .app-comment-form-section h2) {
    color: var(--cyan);
    font-family: "Consolas", monospace;
}

.comments-section :where(.app-comment-summary, .app-comment-meta, .app-comment-page-status, .app-comment-admin-reply-date) {
    color: var(--muted);
}

.comments-section :where(.app-comment-card) {
    border-top-color: var(--line);
}

.comments-section :where(.app-comment-body, .app-comments-empty, .app-comment-message) {
    color: #d5e2dc;
}

.comments-section :where(.app-comment-admin-reply, .app-comment-reply) {
    border-color: rgba(115, 215, 255, 0.5);
    background: rgba(255, 255, 255, 0.04);
}

.comments-section :where(.app-comment-admin-reply-title, .app-comment-reply-form-wrap summary, .app-comment-pagination a) {
    color: var(--cyan);
}

.comments-section :where(.app-comment-replies, .app-comment-pagination) {
    border-color: var(--line);
}

.comments-section :where(.app-comment-form input, .app-comment-form select, .app-comment-form textarea) {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(2, 4, 3, 0.46);
    color: var(--text);
    padding: 9px 10px;
}

.comments-section :where(.app-comment-form input::placeholder, .app-comment-form textarea::placeholder) {
    color: rgba(210, 222, 216, 0.5);
}

.comments-section :where(.app-comment-form button) {
    justify-self: start;
    min-height: 42px;
    border: 1px solid rgba(109, 240, 168, 0.72);
    border-radius: 6px;
    padding: 0 18px;
    background:
        linear-gradient(180deg, rgba(138, 255, 188, 0.98), rgba(71, 219, 139, 0.95));
    color: #03100a;
    box-shadow:
        0 0 0 1px rgba(109, 240, 168, 0.18),
        0 10px 24px rgba(109, 240, 168, 0.18);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.comments-section :where(.app-comment-form button:hover) {
    filter: brightness(1.06);
}

.comments-section :where(.app-comment-form button:focus-visible) {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.comments-section :where(.app-comment-form button:disabled) {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    box-shadow: none;
}

.comments-section :where(.app-comment-pagination a, .app-comment-pagination span) {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.comments-section :where(.app-comment-pagination span) {
    border-color: rgba(109, 240, 168, 0.62);
    background: rgba(109, 240, 168, 0.13);
    color: var(--green);
}

.side-ad {
    position: sticky;
    top: 12px;
    height: fit-content;
    padding-top: 86px;
}

.ad-box {
    min-height: 280px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.ad-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-family: "Consolas", monospace;
    font-size: 0.68rem;
}

@keyframes scan {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(330%);
    }
}

@keyframes signal-flash {
    0% {
        box-shadow: inset 0 0 0 3px rgba(255, 76, 88, 0), 0 0 0 rgba(255, 76, 88, 0);
        filter: none;
    }
    18% {
        box-shadow: inset 0 0 0 3px rgba(255, 76, 88, 0.92), 0 0 34px rgba(255, 76, 88, 0.45);
        filter: saturate(1.35);
    }
    100% {
        box-shadow: inset 0 0 0 3px rgba(255, 76, 88, 0), 0 0 0 rgba(255, 76, 88, 0);
        filter: none;
    }
}

@keyframes rec-pulse {
    0%,
    100% {
        opacity: 0.45;
    }
    50% {
        opacity: 1;
    }
}

@keyframes glitch-flash {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    50% {
        opacity: 0.52;
        transform: translateX(3px);
    }
    100% {
        opacity: 0.9;
        transform: translateX(-2px);
    }
}

@media (max-width: 1380px) {
    .page-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-ad {
        display: none;
    }
}

@media (min-width: 901px) {
    .camera-frame {
        aspect-ratio: auto;
        height: clamp(360px, calc(100vh - 330px), 520px);
        min-height: 0;
    }

    .bottom-hud {
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    .page-shell {
        padding: 12px;
    }

    .app-header,
    .detector-grid,
    .info-section,
    .manual-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .system-readout {
        min-width: 0;
    }

    .camera-frame {
        min-height: 280px;
    }

    .inline-control-panel {
        grid-template-columns: 1fr;
    }

    .inline-control-panel h2,
    .inline-control-panel .segmented,
    .inline-control-panel .toggle-row {
        grid-column: auto;
        grid-row: auto;
    }

    .inline-control-panel .control-row {
        display: grid;
        gap: 6px;
    }

    .inline-control-panel .control-row small {
        display: block;
    }

    .inline-control-panel input[type="range"] {
        width: 100%;
    }
}

@media (max-width: 560px) {
    h1 {
        font-size: 2rem;
    }

    .camera-actions,
    .warning-banner {
        flex-direction: column;
        align-items: stretch;
    }

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

    .readout-grid {
        grid-template-columns: 1fr;
    }

    .bottom-hud {
        grid-template-columns: 1fr;
    }

    .feed-brand {
        max-width: 56%;
    }

    .feed-clock {
        left: 14px;
        right: 14px;
        justify-content: space-between;
    }
}
