:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #64748b;
  --line: #d8dee8;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 calc(48px + 64px + env(safe-area-inset-bottom));
}

/* Only one section shows at a time, switched by the bottom tab bar. */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 6px calc(4px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-left));
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  width: auto;
  border: 0;
  border-radius: 6px;
  padding: 6px 2px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.tab-btn:hover {
  background: var(--bg);
}

.tab-btn.active {
  color: var(--accent);
}

.tab-icon {
  font-size: 20px;
  line-height: 1;
}

header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.section-desc {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  max-width: 60ch;
}

.cmd {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

header p,
.notice,
.status,
label {
  color: var(--muted);
}

.notice {
  max-width: 280px;
  font-size: 14px;
  text-align: right;
}

.notice a {
  display: inline-block;
  margin-top: 4px;
}

section,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

section {
  margin-top: 18px;
  padding: 20px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

/* Author styles always beat the UA stylesheet's `[hidden] { display: none }`
   regardless of specificity, so the rule above silently un-hides any
   <label hidden> used for JS-driven conditional fields (Swap's prompt field,
   Animate's provider/mode toggles) unless restored explicitly here. */
label[hidden] {
  display: none;
}

input,
select,
textarea,
button {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  /* Explicit 16px overrides the 14px inherited from `label` -- anything
     smaller makes iOS Safari zoom the page in on focus. */
  font-size: 16px;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
}

button {
  width: max-content;
  border: 0;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

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

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.checks label {
  display: flex;
  align-items: center;
}

.status {
  min-height: 22px;
  margin-top: 12px;
  font-size: 14px;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card {
  overflow: hidden;
}

video,
.card img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #111827;
  object-fit: contain;
}

.details,
.links,
.revise {
  padding: 14px;
}

.details {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.details p {
  line-height: 1.4;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
}

a {
  color: var(--accent);
}

.shots {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.revise {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid var(--line);
}

.revise .status {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 760px) {
  header,
  .checks {
    display: grid;
  }

  .notice {
    max-width: none;
    text-align: left;
  }

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

/* iPhone 14 Pro Max and similar phone widths (430px logical width). Tighter
   spacing to reclaim edge margin, and larger tap targets -- Apple HIG wants
   at least 44px for anything tappable, well above this page's desktop 40px
   buttons and 16px checkboxes. */
@media (max-width: 480px) {
  main {
    width: calc(100% - 24px);
    padding: 20px 0 40px;
  }

  h1 {
    font-size: 26px;
  }

  section {
    padding: 16px;
  }

  button {
    width: 100%;
    min-height: 44px;
  }

  .checks label {
    padding: 6px 0;
  }

  input[type="checkbox"] {
    width: 20px;
    min-height: 20px;
  }

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