:root {
  color-scheme: dark;
  --page: #040704;
  --case: #091009;
  --case-2: #0d160d;
  --screen: #010501;
  --line: rgba(112, 239, 170, 0.24);
  --line-strong: rgba(112, 239, 170, 0.58);
  --green: #70efaa;
  --green-soft: #c7ffdf;
  --amber: #f2bd5a;
  --amber-soft: #ffe0a0;
  --cyan: #69dce6;
  --danger: #ff6b73;
  --text: #f0fbf2;
  --muted: #9eafa1;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--page);
  background-image:
    linear-gradient(rgba(112, 239, 170, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 239, 170, 0.022) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--text);
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  line-height: 1.65;
}

button,
select,
input {
  min-width: 0;
  font: inherit;
}

button {
  border: 0;
  letter-spacing: 0;
  cursor: pointer;
}

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

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

a {
  color: var(--green-soft);
  text-underline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

.noscript {
  margin: 0;
  padding: 14px;
  background: #54191d;
  color: #fff;
  text-align: center;
}

.page-shell {
  width: min(calc(100% - 36px), 1220px);
  margin: 0 auto;
  padding: 18px 0 30px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.device-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 24px;
  align-items: end;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.series-label,
.section-kicker,
.stage-kicker {
  margin-bottom: 5px;
  color: var(--green);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: 0;
}

.device-name {
  margin-bottom: 7px;
  color: var(--amber);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 20px;
  font-weight: 800;
}

.lead {
  margin-bottom: 0;
  color: #d7e7da;
  font-size: 16px;
}

.header-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.header-readout span {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: rgba(112, 239, 170, 0.035);
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.header-readout span.active {
  border-color: var(--line-strong);
  color: var(--green-soft);
}

.header-readout span.warning {
  border-color: rgba(242, 189, 90, 0.6);
  color: var(--amber-soft);
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.view-tabs button {
  min-height: 46px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: #0a120a;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 800;
}

.view-tabs button:last-child {
  border-right: 0;
}

.view-tabs button[aria-pressed="true"] {
  background: var(--green);
  color: #031008;
}

.global-status {
  min-height: 44px;
  margin: 10px 0;
  padding: 9px 12px;
  border-left: 3px solid var(--amber);
  background: rgba(242, 189, 90, 0.07);
  color: #e7e4d7;
  font-size: 14px;
}

.view-panel {
  min-width: 0;
}

.setup-layout,
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.camera-column,
.setup-panel,
.watch-monitor,
.sequence-panel,
.live-log-panel,
.review-layout,
.export-layout {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--case);
  box-shadow: 0 18px 44px var(--shadow);
}

.camera-column,
.setup-panel,
.review-layout,
.export-layout {
  padding: 14px;
}

.camera-column::before,
.setup-panel::before,
.watch-monitor::before,
.sequence-panel::before,
.live-log-panel::before,
.review-layout::before,
.export-layout::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
  content: "";
  pointer-events: none;
}

.setup-panel::before,
.export-layout::before {
  background: var(--amber);
}

.panel-heading,
.monitor-head,
.review-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.panel-heading {
  min-height: 42px;
  margin-bottom: 10px;
}

.panel-heading h2,
.review-toolbar h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-heading > span,
.monitor-head > span,
.review-toolbar > span {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  font-weight: 700;
}

.camera-stage,
.watch-preview,
.comparison-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #010401;
}

.camera-stage,
.watch-preview,
.comparison-stage {
  aspect-ratio: 16 / 9;
}

.camera-stage video,
.camera-stage canvas,
.watch-preview canvas,
.comparison-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.camera-stage video {
  z-index: 1;
  background: #010401;
}

.camera-stage canvas {
  z-index: 0;
}

.camera-reticle {
  position: absolute;
  z-index: 3;
  inset: 8%;
  border: 1px solid rgba(242, 189, 90, 0.52);
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--amber);
  border-style: solid;
}

.corner-a { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.corner-b { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.corner-c { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.corner-d { right: -2px; bottom: -2px; border-width: 0 3px 3px 0; }

.reticle-label {
  position: absolute;
  top: 8px;
  left: 50%;
  padding: 2px 8px;
  transform: translateX(-50%);
  background: rgba(1, 5, 1, 0.8);
  color: var(--amber-soft);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 700;
}

.camera-off-copy,
.dark-display-copy {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 20px;
  background: rgba(1, 5, 1, 0.82);
  text-align: center;
}

.camera-off-copy strong,
.dark-display-copy strong {
  color: var(--green);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 18px;
}

.camera-off-copy span,
.dark-display-copy span {
  color: var(--muted);
  font-size: 13px;
}

.camera-stage.is-dark video,
.camera-stage.is-dark canvas,
.camera-stage.is-dark .camera-reticle {
  opacity: 0.08;
}

.camera-actions,
.export-actions,
.frame-navigation {
  display: grid;
  gap: 8px;
}

.camera-actions {
  grid-template-columns: minmax(160px, 1fr) 140px 150px;
  margin-top: 10px;
}

.camera-actions button,
.primary-button,
.secondary-button,
.start-watch-button,
.emergency-button,
.export-actions button,
.review-controls button,
.storage-choice button,
.direct-save-row button,
.danger-outline {
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #0c160d;
  color: var(--text);
  font-weight: 800;
}

.primary-button,
.start-watch-button {
  border-color: var(--green);
  background: var(--green);
  color: #031008;
}

.secondary-button {
  color: var(--green-soft);
}

.emergency-button,
.danger-outline {
  border-color: rgba(255, 107, 115, 0.65);
  background: rgba(255, 107, 115, 0.08);
  color: #ffb1b6;
}

.privacy-note,
.save-note,
.capacity-estimate,
.validation-message,
.hash-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.privacy-note {
  margin-top: 7px;
}

.setting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.setting-grid label,
.review-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.setting-grid select,
.setting-grid input,
.review-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #050b06;
  color: var(--text);
  padding: 6px 9px;
}

.storage-choice,
.direct-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.storage-choice div,
.direct-save-row div {
  display: grid;
  min-width: 0;
}

.storage-choice span,
.direct-save-row span {
  color: var(--muted);
  font-size: 12px;
}

.storage-choice button,
.direct-save-row button {
  min-height: 40px;
  padding: 6px 8px;
  font-size: 11px;
}

.save-note,
.capacity-estimate,
.validation-message {
  margin-top: 8px;
}

.validation-message:not(:empty) {
  color: var(--amber-soft);
}

.start-watch-button {
  width: 100%;
  margin-top: 13px;
  min-height: 52px;
}

.watch-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.watch-monitor {
  overflow: hidden;
}

.monitor-head {
  min-height: 43px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 800;
}

.watch-state {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.watch-state h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.watch-countdown {
  min-height: 70px;
  margin: 4px 0;
  color: var(--green-soft);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 58px;
  font-weight: 800;
  line-height: 1.1;
}

.watch-state > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.screen-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(112, 239, 170, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 239, 170, 0.08) 1px, transparent 1px);
  background-size: 8% 20%;
  pointer-events: none;
}

.capture-pulse {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  background: rgba(242, 189, 90, 0.18);
  color: var(--amber-soft);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 18px;
  font-weight: 800;
}

.watch-progress,
.export-progress {
  height: 7px;
  background: #030703;
  overflow: hidden;
}

.watch-progress span,
.export-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.watch-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.watch-metrics span {
  min-width: 0;
  min-height: 63px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
}

.watch-metrics span:last-child {
  border-right: 0;
}

.watch-metrics strong {
  color: var(--text);
  font-size: 16px;
}

.watch-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.sequence-panel,
.live-log-panel {
  overflow: hidden;
}

.sequence-panel .panel-heading,
.live-log-panel .panel-heading {
  margin: 0;
  min-height: 43px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.sequence-list,
.device-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sequence-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 48px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
}

.sequence-list li.active {
  background: rgba(112, 239, 170, 0.08);
  color: var(--green-soft);
}

.device-log {
  max-height: 222px;
  overflow-y: auto;
}

.device-log li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(112, 239, 170, 0.12);
  color: var(--muted);
  font-size: 12px;
}

.device-log time {
  color: var(--amber);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
}

.review-layout,
.export-layout {
  padding: 14px;
}

.review-toolbar {
  align-items: end;
  margin-bottom: 10px;
}

.review-toolbar label {
  width: min(310px, 100%);
  margin-left: auto;
}

.review-toolbar .danger-outline {
  min-height: 42px;
}

.review-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.review-filters button {
  min-height: 40px;
  padding: 6px 8px;
  border-right: 1px solid var(--line);
  background: #071007;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-filters button:last-child {
  border-right: 0;
}

.review-filters button[aria-pressed="true"] {
  background: var(--amber);
  color: #1a1001;
}

.filmstrip {
  display: flex;
  gap: 8px;
  min-height: 128px;
  padding: 9px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #030703;
  scrollbar-color: var(--green) #030703;
}

.film-item {
  flex: 0 0 150px;
  min-width: 150px;
  min-height: 108px;
  display: grid;
  grid-template-rows: 76px auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #081108;
  color: var(--text);
  text-align: left;
}

.film-item img {
  width: 100%;
  height: 76px;
  object-fit: cover;
  background: #000;
}

.film-item span {
  display: block;
  min-width: 0;
  padding: 5px 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.film-item[aria-pressed="true"] {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px var(--amber);
}

.film-event {
  flex: 0 0 150px;
  min-height: 108px;
  display: grid;
  place-content: center;
  padding: 10px;
  border: 1px dashed rgba(242, 189, 90, 0.65);
  color: var(--amber-soft);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  text-align: center;
}

.empty-copy {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}

.review-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
  margin-top: 12px;
}

.selected-frame {
  min-width: 0;
}

.selected-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  align-items: center;
  margin-bottom: 7px;
}

.selected-meta div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.selected-meta span {
  color: var(--amber);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  font-weight: 800;
}

.selected-meta strong {
  font-size: 18px;
}

.selected-meta p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.comparison-stage img {
  z-index: 1;
}

.comparison-stage #selectedImage {
  z-index: 2;
}

.comparison-mask {
  position: absolute;
  z-index: 3;
  inset: 0 50% 0 0;
  overflow: hidden;
  border-right: 2px solid var(--amber);
}

.comparison-mask img {
  width: calc(200%);
  max-width: none;
  object-position: left center;
}

.comparison-stage p {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
}

.slider-control {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.slider-control input {
  width: 100%;
}

.review-controls {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 51px;
}

.frame-navigation {
  grid-template-columns: 46px minmax(0, 1fr) 46px;
}

.frame-navigation button {
  min-height: 42px;
  padding: 6px;
}

.hash-note {
  margin-top: 3px;
}

.export-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.export-summary div {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
}

.export-summary div:last-child {
  border-right: 0;
}

.export-summary span {
  color: var(--muted);
  font-size: 11px;
}

.export-summary strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.export-actions {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) 140px 160px;
  margin-top: 12px;
}

.export-progress {
  margin-top: 12px;
  border: 1px solid var(--line);
}

#exportStatus {
  min-height: 26px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.device-notes {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.device-notes h2 {
  margin-bottom: 0;
  font-size: 21px;
}

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

.notes-grid article {
  min-width: 0;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
}

.notes-grid h3 {
  margin-bottom: 5px;
  color: var(--amber-soft);
  font-size: 15px;
}

.notes-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.ad-reservation {
  min-height: 92px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  border: 1px dashed rgba(158, 175, 161, 0.25);
  color: rgba(158, 175, 161, 0.55);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
}

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

.comments-section :where(.app-comments, .app-comment-form-section) {
  border-color: var(--line-strong);
  background: var(--case);
  color: var(--text);
}

.comments-section :where(.app-comments h2, .app-comment-form-section h2) {
  color: var(--green-soft);
}

.comments-section :where(.app-comment-count, .app-comments-empty, .app-comment-page-status) {
  color: var(--muted);
}

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

.comments-section .app-comment-rating {
  color: var(--amber);
}

.comments-section .app-comment-admin-reply {
  border-left-color: var(--cyan);
  background: rgba(105, 220, 230, 0.08);
}

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

.comments-section .app-comment-admin-reply-date {
  color: var(--muted);
}

.comments-section .app-comment-replies {
  border-left-color: var(--line-strong);
}

.comments-section .app-comment-reply {
  background: rgba(112, 239, 170, 0.05);
}

.comments-section .app-comment-form :where(input, select, textarea) {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--screen);
  color: var(--text);
}

.comments-section .app-comment-form :where(input, textarea)::placeholder {
  color: #7f9182;
  opacity: 1;
}

.comments-section .app-comment-form :where(input, select, textarea):focus-visible {
  border-color: var(--amber);
}

.comments-section .app-comment-form button {
  border-color: var(--green);
  background: var(--green);
  color: #031008;
}

.comments-section .app-comment-form button:hover,
.comments-section .app-comment-form button:focus-visible {
  border-color: #9cf6c5;
  background: #9cf6c5;
}

.comments-section .app-comment-pagination a {
  border-color: var(--line-strong);
  color: var(--green-soft);
}

.comments-section .app-comment-pagination span {
  border-color: var(--green);
  background: var(--green);
  color: #031008;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

body.observation-dark .device-header,
body.observation-dark .breadcrumb,
body.observation-dark .view-tabs,
body.observation-dark .global-status,
body.observation-dark .device-notes,
body.observation-dark .ad-reservation,
body.observation-dark .site-footer {
  opacity: 0.12;
}

body.observation-dark .watch-layout {
  filter: brightness(0.36);
}

body.observation-dark .emergency-button {
  filter: brightness(2.8);
}

@media (max-width: 1024px) {
  .setup-layout,
  .watch-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-side {
    grid-template-columns: 1fr 1fr;
  }

  .emergency-button {
    grid-column: 1 / -1;
  }

  .review-stage {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .export-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 16px), 680px);
    padding-top: 10px;
  }

  .device-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.3;
  }

  .device-name {
    font-size: 17px;
  }

  .lead {
    font-size: 14px;
  }

  .header-readout {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .header-readout span {
    min-height: 40px;
    padding: 4px;
    font-size: 9px;
  }

  .view-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .view-tabs button {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
  }

  .view-tabs button:nth-child(2) {
    border-right: 0;
  }

  .view-tabs button:nth-child(3),
  .view-tabs button:nth-child(4) {
    border-bottom: 0;
  }

  .camera-column,
  .setup-panel,
  .review-layout,
  .export-layout {
    padding: 11px;
  }

  .camera-actions {
    grid-template-columns: 1fr 1fr;
  }

  .camera-actions .primary-button {
    grid-column: 1 / -1;
  }

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

  .watch-state {
    min-height: 162px;
    padding: 14px;
  }

  .watch-state h2 {
    font-size: 21px;
  }

  .watch-countdown {
    min-height: 59px;
    font-size: 48px;
  }

  .watch-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .emergency-button {
    grid-column: auto;
  }

  .review-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .review-toolbar label {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }

  .review-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-controls {
    padding-top: 0;
  }

  .selected-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .export-summary {
    grid-template-columns: 1fr 1fr;
  }

  .export-summary div:nth-child(2) {
    border-right: 0;
  }

  .export-summary div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .device-notes {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .notes-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .breadcrumb {
    font-size: 11px;
  }

  h1 {
    font-size: 27px;
  }

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

  .global-status {
    min-height: 54px;
    font-size: 13px;
  }

  .setting-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .storage-choice,
  .direct-save-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .storage-choice button,
  .direct-save-row button {
    width: 100%;
  }

  .watch-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .watch-metrics span:nth-child(2) {
    border-right: 0;
  }

  .watch-metrics span:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .review-filters button {
    padding: 6px 3px;
    font-size: 10px;
  }

  .film-item,
  .film-event {
    flex-basis: 132px;
    min-width: 132px;
  }

  .slider-control {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .export-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .export-summary strong {
    font-size: 13px;
  }

  .site-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
