:root {
  --ink: #282828;
  --paper: #fff0e0;
  --surface: #f8f8f0;
  --yellow: #ffd858;
  --pink: #ff90e8;
  --blue: #90a8f0;
  --green: #48c898;
  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(#20202022 1px, transparent 1px);
  background-size: 9px 9px;
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, .tabs a, .job-link {
  border: var(--border);
  background: var(--yellow);
  color: var(--ink);
  padding: 12px 18px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, box-shadow .1s;
}
button:hover:not(:disabled), .job-link:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
button:active:not(:disabled), .job-link:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
button.secondary { background: var(--paper); padding: 9px 13px; font-size: .9rem; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
input:focus-visible, select:focus-visible { outline-style: solid; outline-offset: 2px; }
.masthead {
  max-width: 1360px;
  margin: auto;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { text-decoration: none; font-weight: 1000; font-size: 1.8rem; letter-spacing: -1px; line-height: 1; }
.brand span { background: var(--yellow); padding: 2px 6px; margin-left: 3px; border: 2px solid var(--ink); }
.brand small { display: block; margin-top: 12px; font-size: .7rem; letter-spacing: 2px; }
.sticker { background: var(--pink); border: var(--border); box-shadow: 4px 4px 0 var(--ink); padding: 9px 17px; font-weight: 900; line-height: 1.2; transform: rotate(5deg); }
.tabs { display: flex; flex-wrap: wrap; border-top: var(--border); border-bottom: var(--border); background: var(--blue); padding: 15px max(30px, calc((100vw - 1300px) / 2)); gap: 12px; }
.tabs a { background: var(--paper); padding: 8px 16px; font-size: .95rem; }
.tabs a.active { background: var(--yellow); transform: rotate(-2deg); }
main { max-width: 1360px; margin: auto; padding: 32px 30px 20px; }
.hero { position: relative; margin-bottom: 32px; max-width: 1050px; }
.eyebrow { font-size: .7rem; font-weight: bold; letter-spacing: 2px; }
h1 { font-family: Impact, "Arial Black", sans-serif; font-weight: 900; font-size: clamp(2.5rem, 5vw, 4.8rem); line-height: 1.05; letter-spacing: 1px; margin: 12px 0; }
.hero p { max-width: 800px; font-size: 1.05rem; }
h2 { font-weight: 900; font-size: 1.25rem; margin: 0 0 16px; letter-spacing: .3px; }
h3 { margin: 0 0 12px; }
.panel { padding: 24px; background: var(--surface); border: var(--border); box-shadow: var(--shadow); margin-bottom: 28px; min-width: 0; }
.url-panel { background: var(--yellow); }
.step { display: inline-block; background: var(--ink); color: var(--paper); padding: 3px 8px; margin-right: 8px; font-size: .85rem; vertical-align: middle; }
.url-row { display: flex; align-items: flex-end; gap: 18px; }
.grow { flex: 1; min-width: 0; }
label { display: flex; flex-direction: column; gap: 7px; font-size: .9rem; font-weight: 800; }
input:not([type=checkbox], [type=radio]), select { width: 100%; border: var(--border); background: white; color: var(--ink); padding: 11px; min-height: 48px; border-radius: 0; }
input[type=radio], input[type=checkbox] { accent-color: var(--ink); width: 19px; height: 19px; flex-shrink: 0; }
.hint { font-size: .85rem; margin: 12px 0 0; overflow-wrap: anywhere; }
.info-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 28px; }
.cover-panel { background: var(--pink); }
.cover-panel label, .cover-panel button { margin-top: 16px; }
.thumbnail-frame { background: var(--paper); border: var(--border); min-height: 180px; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: .85rem; font-weight: 900; }
.thumbnail-frame img { width: 100%; height: 100%; object-fit: contain; }
.info-panel { background: var(--blue); }
.source-text { background: var(--surface); border: 2px solid var(--ink); padding: 16px; margin-top: 16px; height: 300px; overflow: auto; user-select: text; cursor: text; }
.source-text pre { font: inherit; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.source-text h3 { font-size: 1.1rem; overflow-wrap: anywhere; }
::selection { background: var(--yellow); color: var(--ink); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.trim-box, .merge-box { border-top: var(--border); margin-top: 24px; padding-top: 20px; }
.trim-box h3 { font-size: 1rem; }
.download-bar { background: var(--green); border: var(--border); box-shadow: var(--shadow); padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 34px; font-weight: 900; }
.download-bar small { display: block; font-weight: normal; font-size: .85rem; }
.stream-toolbar { display: flex; gap: 20px; align-items: end; margin-bottom: 20px; }
.table-scroll { overflow-x: auto; border: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: .8rem; white-space: nowrap; }
th, td { padding: 12px; border-bottom: 2px solid var(--ink); text-align: left; }
th { background: var(--yellow); }
tr:nth-child(even) { background: var(--paper); }
tr.selected { background: var(--green); }
td label { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.check { flex-direction: row; align-items: center; margin-bottom: 15px; }
.merge-box select { max-width: 650px; }
.notice { border: var(--border); box-shadow: 4px 4px 0 var(--ink); padding: 16px; background: var(--green); margin-bottom: 24px; overflow-wrap: anywhere; }
.notice.error { background: #ffc3b6; }
.context-menu { position: fixed; z-index: 100; width: 240px; max-height: calc(100vh - 24px); overflow: auto; background: var(--yellow); border: var(--border); box-shadow: var(--shadow); padding: 7px; }
.context-menu p { font-size: .7rem; font-weight: 900; padding: 4px 8px; margin: 0 0 6px; }
.context-menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; background: var(--paper); box-shadow: none; border: 0; margin: 0; }
.context-menu button:hover, .context-menu button:focus-visible { background: var(--pink); transform: none; box-shadow: none; outline-offset: -3px; }
.field-flash { animation: flash .8s; }
@keyframes flash { 0%, 60% { background-color: var(--yellow); } 100% { background-color: white; } }
dialog { width: min(620px, calc(100vw - 32px)); padding: 28px; background: var(--paper); color: var(--ink); border: var(--border); box-shadow: 9px 9px 0 var(--ink); max-height: 85vh; }
dialog::backdrop { background: #20202088; }
dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.job { border: 2px solid var(--ink); padding: 16px; margin-top: 16px; background: var(--paper); }
.job-title { font-weight: 900; overflow-wrap: anywhere; margin: 0 0 10px; }
.job progress { width: 100%; height: 18px; accent-color: var(--ink); margin-top: 10px; }
.job-error { color: #872419; overflow-wrap: anywhere; font-size: .9rem; }
.job-link { display: inline-block; background: var(--green); padding: 8px 14px; }
.site-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; margin: 20px 0; }
.site-list li { border: 2px solid var(--ink); background: var(--blue); padding: 10px; overflow-wrap: anywhere; font-size: .9rem; }
footer { border-top: 2px solid var(--ink); margin-top: 32px; padding-top: 20px; font-size: .75rem; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .masthead { padding: 20px; }
  .brand { font-size: 1.3rem; }
  .sticker { font-size: .65rem; padding: 7px 10px; }
  main { padding: 24px 16px; }
  .tabs { padding: 14px 16px; gap: 10px; }
  .tabs a { font-size: .8rem; padding: 7px 10px; }
  .info-grid, .fields { grid-template-columns: 1fr; }
  .info-grid { gap: 0; }
  .panel { padding: 18px; }
  .url-row, .download-bar { align-items: stretch; flex-direction: column; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .thumbnail-frame { max-height: 300px; }
  .stream-toolbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
