:root {
  --bg: #141512;
  --surface: #191a17;
  --lift: #22231f;
  --line: #35362f;
  --lime: #d2f776;
  --text: #f3f4eb;
  --muted: #b1b3a6;
  --subtle: #989b8d;
  --error: #ffaf99;
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, video:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.wrap { width: min(1180px, calc(100% - 96px)); margin-inline: auto; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.skip-link, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { z-index: 3; top: 6px; left: 6px; width: auto; height: auto; clip-path: none; padding: 8px 15px; color: #23261b; background: var(--lime); }
.topbar { border-bottom: 1px solid var(--line); }
.bar-inner { display: flex; align-items: center; height: 75px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 760; font-size: 25px; line-height: 1; letter-spacing: -1.45px; }
.brand > svg { width: 33px; height: 33px; color: var(--lime); }
nav { display: flex; gap: 5px; align-items: center; padding-left: 25px; margin-left: 31px; border-left: 1px solid var(--line); }
.nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px; border-radius: 5px; font-size: 13px; font-weight: 550; color: var(--muted); }
.nav-link > .icon { width: 15px; height: 15px; }
.nav-link:hover { background: #22241f; color: var(--text); }
.nav-link[aria-current] { color: var(--text); background: #2a2c25; }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 11px var(--mono); margin-left: auto; }
.connection-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.connection.online .connection-dot { background: var(--lime); box-shadow: 0 0 0 3px #d2f7760d; }
.connection.offline .connection-dot { background: var(--error); }
.key-button { margin-left: 16px; padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12px; }
.key-button:hover { color: var(--text); border-color: #6e745c; }
.key-button .icon { width: 16px; height: 16px; }
.phone-dialog { width: min(460px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 24px; color: var(--text); background: var(--surface); border: 1px solid #4b4e40; border-radius: 14px; box-shadow: 0 18px 80px #0009; }
.phone-dialog::backdrop { background: #080907bc; }
.phone-header, .phone-link-row, .phone-actions { display: flex; align-items: center; gap: 10px; }
.phone-header { justify-content: space-between; }
.phone-header h2 { font-size: 25px; letter-spacing: -.045em; margin: 0; }
.phone-close { border: 1px solid var(--line); background: var(--lift); border-radius: 5px; color: var(--muted); width: 36px; height: 36px; font-size: 22px; }
.phone-help { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 9px 0; }
.phone-status { color: var(--lime); font: 12px/1.5 var(--mono); margin: 18px 0; }
.phone-dialog label, .phone-pairing h3 { display: block; font-size: 14px; font-weight: 650; margin: 0 0 6px; }
.phone-link-row input { min-width: 0; flex: 1; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font: 12px/1.5 var(--mono); }
.phone-actions { flex-wrap: wrap; margin-top: 18px; }
.phone-dialog .secondary, .phone-dialog .primary { padding: 0 13px; }
.phone-pairing { margin-top: 14px; border-block: 1px solid var(--line); padding-block: 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.phone-pairing > div { flex: 1 1 145px; min-width: 0; }
.phone-pairing img { display: block; background: white; border-radius: 5px; image-rendering: pixelated; }
#phone-code { display: block; overflow-wrap: anywhere; color: var(--lime); font: 600 20px/1.4 var(--mono); user-select: all; }
#remote-key-help { margin: 0; color: var(--muted); line-height: 1.55; }
.social-dialog { width: min(540px, calc(100% - 28px)); }
.social-dialog h3 { margin: 0; font-size: 17px; }
.social-dialog .inline-link { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.social-stack { display: grid; gap: 14px; margin-top: 16px; }
.social-stack > .phone-help { margin: 0; }
.social-stack > button { justify-self: start; }
.social-stack label { margin: 0; }
#social-team-manual summary { cursor: pointer; }
#social-team-manual[open] label { margin-top: 8px; }
.social-stack input:not([type=checkbox]), .social-stack select, .social-stack textarea {
  display: block; width: 100%; min-width: 0; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #42443a; border-radius: 6px; background: var(--bg); color: var(--text); font: 400 14px/1.4 var(--sans);
}
.social-stack textarea { resize: vertical; }
.social-stack :is(input, select, textarea):focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.social-stack .check-line { display: flex; align-items: start; gap: 9px; font: 400 13px/1.5 var(--sans); }
.check-line input { accent-color: var(--lime); width: 17px; height: 17px; flex: none; margin: 2px 0 0; }
.social-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#tiktok-review { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0,1fr); align-items: center; gap: 16px; }
#tiktok-preview { width: 100%; aspect-ratio: 9/16; max-height: 240px; background: #10110e; border-radius: 8px; }
#tiktok-creator { overflow-wrap: anywhere; }
#tiktok-settings { min-width: 0; display: grid; gap: 12px; border: 1px solid #42443a; border-radius: 8px; padding: 12px; margin: 0; }
#tiktok-settings legend { padding: 0 5px; font-size: 14px; font-weight: 650; }
.tiktok-interactions { display: flex; gap: 8px 16px; flex-wrap: wrap; }
#tiktok-settings label:has(input:disabled) { opacity: .65; }
#tiktok-brands { display: grid; gap: 8px; padding-left: 26px; }
#tiktok-brands p { margin: 0; }
.social-account-list { padding: 0; list-style: none; margin: 16px 0 0; }
.social-account { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 12px 0; }
.social-account div { min-width: 0; }
.social-account strong, .social-account span { display: block; overflow-wrap: anywhere; }
.social-account span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.social-account .secondary { min-height: 34px; font-size: 12px; }
.social-channel-actions { display: grid; justify-items: end; gap: 6px; flex-shrink: 0; max-width: 52%; }
.social-channel-actions button { white-space: normal; }
.social-channel-actions .small-button { text-align: right; min-height: 32px; }
#instagram-permissions { border-block: 1px solid var(--line); padding-block: 14px; margin-bottom: 14px; }
.social-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
#social-portal { display: inline-block; margin-top: 12px; }
#social-auto { border-top: 1px solid var(--line); padding-top: 18px; }
.post-delivery { display: grid; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 14px; }
.clip-delivery-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 4px 12px; border-top: 1px solid var(--line); padding: 10px 0; }
.clip-delivery-row strong { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.delivery-detail, .clip-delivery-row .delivery-retry { grid-column: 1 / -1; }
.delivery-detail { font-size: 12px; overflow-wrap: anywhere; }
.delivery-retry { display: grid; justify-items: start; gap: 4px; margin-top: 4px; }
.delivery-retry .secondary { min-height: 36px; padding-inline: 12px; font-size: 12px; }
.delivery-retry small:empty { display: none; }
.publish-clip-summary { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.publish-clip-summary img { width: 38px; height: 54px; flex: none; border-radius: 4px; object-fit: cover; }
.publish-clip-summary strong, .publish-clip-summary small { display: block; overflow-wrap: anywhere; }
.publish-clip-summary small { color: var(--muted); margin-top: 4px; font-size: 12px; }
#publish-view-stats { display: inline-flex; margin-top: 4px; }
@media (min-width: 360px) and (max-width: 430px) {
  #publish-youtube { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  #publish-youtube select { padding-inline: 6px; }
}
@media (max-width: 620px) {
  .delivery-retry .secondary { min-height: 44px; }
  #publish-send { justify-self: stretch; min-height: 44px; }
}
.member-entry { display: grid; min-height: 100svh; place-items: center; padding: 24px; }
.member-auth-card { width: min(100%, 420px); padding: clamp(21px, 5vw, 32px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.member-auth-card .brand { font-size: 24px; }
.member-auth-card h1 { font-size: clamp(32px, 6vw, 43px); margin: 34px 0 8px; line-height: 1.05; letter-spacing: -.055em; }
.member-auth-card .social-stack { margin: 23px 0; }
.member-auth-card label, .members-admin label { display: block; font-size: 14px; font-weight: 600; }
.member-auth-card .social-stack button { justify-self: stretch; }
.member-auth-links { display: flex; gap: 8px 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.member-auth-links a { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.member-pending { border: 1px solid #454b35; background: #26291f; border-radius: 8px; color: var(--muted); padding: 14px 16px; line-height: 1.55; font-size: 14px; margin-bottom: 18px; }
.member-pending strong { display: block; color: var(--text); }
.members-admin { max-width: 960px; }
.members-admin h1 { margin: 0; font-size: clamp(32px,4vw,53px); letter-spacing: -.055em; }
.members-admin .session-list { list-style: none; padding: 0; }
.member-admin-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px; }
.member-admin-row + .member-admin-row { border-top: 1px solid var(--line); }
.member-admin-row strong { white-space: normal; overflow-wrap: anywhere; }
.member-admin-row .secondary { min-height: 36px; font-size: 12px; padding-inline: 12px; }
.members-admin #reset-result { margin: 14px 0; }
.members-admin #reset-result .section-heading { margin: 0; }
.members-admin #reset-result h2 { margin: 0; }
@media (max-width: 620px) {
  .member-admin-row { flex-direction: column; align-items: flex-start; }
  #members-admin-link span { display: none; }
  #member-logout { font-size: 11px; padding: 6px; }
}
.social-dialog .social-error { color: var(--error); }
#batch-clips { margin: 0; padding: 0; border: 0; min-width: 0; }
#batch-clips legend { font-size: 14px; font-weight: 650; }
.batch-item { border-top: 1px solid var(--line); padding: 10px 0; }
.batch-item summary { display: list-item; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 0; }
.batch-item details label { margin: 8px 0; }
.batch-state { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.section-heading .publish-batch { min-height: 36px; font-size: 12px; padding-inline: 10px; }
@media (max-width: 700px) {
  #manage-social span, #manage-key span, #manage-phone span { display: none; }
}
@media (max-width: 430px) {
  .bar-inner:has(#manage-social:not([hidden])) { height: auto; min-height: 84px; padding-block: 8px; flex-wrap: wrap; row-gap: 5px; }
  .bar-inner:has(#manage-social:not([hidden])) nav { order: 1; flex: 0 0 100%; margin: 0; padding: 0; border-left: 0; }
  .social-dialog { padding: 18px; }
  .social-stack input:not([type=checkbox]), .social-stack select, .social-stack textarea { font-size: 16px; }
  .social-pair { grid-template-columns: 1fr; }
}
main { padding-block: 44px 72px; }
main:focus { outline: none; }
.generator { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.hero { display: grid; grid-template-columns: minmax(330px, .9fr) 1.1fr; isolation: isolate; position: relative; min-height: 330px; background: #1d1f19; overflow: hidden; }
.hero-copy { align-self: center; position: relative; z-index: 1; padding: 34px 0 35px 40px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; font: 600 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 1.7px; color: var(--lime); }
.eyebrow-line { display: inline-block; width: 18px; height: 2px; background: var(--lime); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { font-weight: 620; }
.hero h1 { margin: 0; font-size: clamp(54px, 5.35vw, 79px); line-height: .99; letter-spacing: -.068em; }
.hero h1 em { color: var(--lime); font-style: normal; }
.hero-desc { max-width: 360px; margin: 20px 0 0; font-size: 14px; line-height: 1.6; color: #bdc0b2; }
.artwork { position: relative; overflow: hidden; }
.artwork canvas { display: block; width: 100%; height: 100%; position: absolute; }
.source-form { padding: 25px 34px 23px; border-top: 1px solid var(--line); }
.source-form label { display: inline-block; margin-bottom: 11px; color: var(--text); font-size: 14px; font-weight: 600; }
#key-heading { font-size: 22px; letter-spacing: -.03em; margin: 0; }
.key-help { max-width: 80ch; margin: 8px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.key-help a { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.key-saved { margin: 0 0 12px; color: var(--lime); font: 12px/1.5 var(--mono); }
.input-row { display: flex; gap: 10px; }
.input-wrap { flex: 1; display: flex; align-items: center; gap: 11px; background: #12130f; border: 1px solid #42443a; border-radius: 7px; padding-left: 15px; min-width: 0; }
.input-wrap:focus-within { border-color: var(--lime); box-shadow: 0 0 0 2px #d2f77622; }
.input-wrap:has(input[aria-invalid="true"]) { border-color: var(--error); }
.input-wrap > .icon { color: var(--subtle); }
.input-wrap input { flex: 1; width: 100%; min-width: 0; padding: 15px 12px 15px 0; border: none; outline: none; background: transparent; color: var(--text); font-size: 14px; line-height: 20px; border-radius: 7px; }
.input-wrap input::placeholder { color: #939689; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 7px; padding: 0 20px; font-weight: 650; font-size: 14px; min-height: 44px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.primary { color: #252a16; background: var(--lime); }
.primary:hover { background: #e2ffa0; }
.primary .icon { stroke-width: 1.9; }
.secondary { color: var(--text); background: var(--lift); border-color: #424439; }
.secondary:hover { background: #2b2d26; border-color: #6e745c; }
.output-specs { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 15px; color: var(--subtle); font: 11px/1.6 var(--mono); }
.output-specs span { display: inline-flex; align-items: center; gap: 6px; }
.output-specs .icon { width: 15px; height: 15px; }
.generator .hero { min-height: 188px; }
.generator .hero-copy { max-width: none; padding-block: 26px; }
.generator .hero h1 { font-size: clamp(42px, 4.5vw, 67px); }
.generator .hero-desc { margin-top: 12px; }
.source-help, .source-match { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.source-match { padding: 10px 12px; background: var(--lift); border-left: 2px solid var(--lime); }
.source-match a { color: var(--lime); margin-inline-start: 4px; text-decoration: underline; }
.paste-source { flex: none; min-height: 44px; padding: 0 13px; background: transparent; border: 0; color: var(--lime); font: inherit; font-size: 13px; }
.paste-source:hover { text-decoration: underline; }
#edit-options, #edit-options fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#edit-options { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(230px,.8fr); gap: 20px 34px; margin-top: 22px; }
#edit-options legend { color: var(--text); padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.layout-choices, .caption-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.caption-choices { grid-template-columns: repeat(3,minmax(0,1fr)); }
#edit-options :is(.layout-choices,.caption-choices) label { display: block; margin: 0; cursor: pointer; position: relative; }
#edit-options input[type=radio] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.layout-choice, .caption-choice { display: flex; align-items: center; gap: 10px; height: 100%; padding: 8px 10px; border: 1px solid #42443a; border-radius: 7px; background: var(--bg); }
.layout-choice strong, .layout-choice small { display: block; }
.layout-choice strong { font-weight: 600; }
.layout-choice small, #caption-help, #facecam-help { color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.45; }
.layout-choice small { margin-top: 3px; }
#edit-options input:checked + span { border-color: #a5bd67; background: #282e20; }
#edit-options input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 3px; }
.layout-preview { width: 32px; height: 54px; flex: none; position: relative; display: block; border-radius: 3px; overflow: hidden; background: linear-gradient(160deg,#3b6060,#32413a 40%,#202620); }
.preview-scene, .preview-camera { position: absolute; display: block; }
.preview-scene { inset: 32% 0; background: linear-gradient(150deg,transparent 48%,#45604d 49% 65%,#314839 66%),linear-gradient(35deg,#375740 0 31%,#6b8764 32% 48%,#95b2ac 49%); }
.preview-camera { background: #73584b; overflow: hidden; }
.preview-camera::before, .preview-camera::after { content: ""; display: block; position: absolute; left: 50%; transform: translateX(-50%); background: #e5bf8c; border-radius: 50%; }
.preview-camera::before { width: 24%; height: 47%; top: 12%; }
.preview-camera::after { width: 58%; height: 75%; top: 62%; }
.full-preview .preview-camera { left: 3%; top: 34%; width: 23%; height: 11%; }
.split-preview .preview-camera { inset: 0 0 67%; }
.split-preview .preview-scene { inset: 45% 0 0; }
.split-preview::after { content: ""; position: absolute; inset: 33.333% 0 55%; background: linear-gradient(#fff,#fff) center / 52% 1px no-repeat, #191a17; }
#edit-options:has(input[name="captions"][value="none"]:checked) .split-preview .preview-scene { top: 33.333%; }
#edit-options:has(input[name="captions"][value="none"]:checked) .split-preview::after { display: none; }
.caption-choice { min-height: 52px; justify-content: center; font-size: 13px; padding: 8px 4px; }
.classic-sample { font-weight: 800; color: #fff; text-shadow: 1px 1px #181419,-1px -1px #181419,1px -1px #181419,-1px 1px #181419; }
.bubble-sample { border-radius: 10px; padding: 2px 8px; background: #080908; color: white; font-weight: 750; }
#facecam-options { margin-top: 12px; }
#facecam-options label { display: inline-block; margin: 0 8px 5px 0; font-size: 13px; }
#facecam-position { min-height: 40px; max-width: 100%; padding: 5px 8px; border: 1px solid #42443a; border-radius: 5px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
#caption-help, #facecam-help { margin: 7px 0 0; }
.import-submit { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: 20px; }
.import-submit > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 11px/1.5 var(--mono); }
.import-submit > span .icon { width: 16px; height: 16px; }
@media (max-width: 820px) {
  #edit-options { grid-template-columns: 1fr; gap: 14px; }
  .caption-choices { max-width: 400px; }
}
@media (max-width: 540px) {
  #edit-options { margin-top: 17px; }
  .layout-choice { padding: 6px; gap: 7px; font-size: 13px; }
  .layout-choice small { font-size: 11px; }
  .layout-preview { width: 24px; height: 42px; }
  .caption-choice { min-height: 44px; }
  #facecam-position { font-size: 16px; min-height: 44px; }
  .import-submit .primary { width: 100%; }
}
@media (max-width: 700px) {
  .generator .hero { min-height: 0; }
  .generator .hero-copy { max-width: 84%; padding-block: 20px; }
  .generator .hero h1 { font-size: clamp(36px, 7.5vw, 48px); }
  .generator .hero-desc { margin-top: 8px; }
}
.sessions { margin-top: 31px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 22px; font-weight: 610; letter-spacing: -.045em; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 550; color: var(--muted); }
.text-link .icon { width: 15px; height: 15px; }
.text-link:hover { color: var(--lime); }
.session-list { border: 1px solid var(--line); background: var(--surface); border-radius: 11px; overflow: hidden; }
.empty-state { min-height: 108px; display: flex; align-items: center; justify-content: flex-start; gap: 17px; padding: 23px 29px; }
.empty-icon, .row-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 1px solid #3b3e32; border-radius: 9px; background: #26281f; color: #adb891; }
.empty-icon { transform: rotate(-4deg); }
.empty-icon .icon { width: 23px; height: 23px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-state h3 { font-size: 15px; margin: 0 0 4px; }
.page-heading { margin: 9px 0 30px; }
.page-heading h1, .detail-heading h1 { font-size: clamp(33px,4vw,53px); line-height: 1.08; letter-spacing: -.055em; margin: 0; }
.page-heading > p:last-child { color: var(--muted); line-height: 1.55; }
.session-row { display: flex; min-height: 80px; padding: 16px 20px; align-items: center; gap: 15px; }
.session-row + .session-row { border-top: 1px solid var(--line); }
.session-row:hover { background: #21231c; }
.library-item { display: flex; align-items: center; }
.library-item + .library-item { border-top: 1px solid var(--line); }
.library-item .session-row { flex: 1; min-width: 0; }
.library-trash { display: grid; place-items: center; width: 44px; height: 44px; flex: none; margin-right: 8px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.library-trash:hover, .library-trash:focus-visible { background: #382a23; color: var(--error); }
.library-trash .icon { width: 18px; height: 18px; }
.library-feedback { margin: -12px 0 16px; color: var(--lime); font-size: 14px; overflow-wrap: anywhere; }
.library-feedback:empty { display: none; }
#delete-recording-title { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.delete-recording-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.delete-confirm { border: 1px solid #92574b; border-radius: 6px; padding: 0 14px; color: var(--error); background: #382a23; font-weight: 600; }
.delete-recording-actions button { min-height: 44px; }
.row-text { min-width: 0; flex: 1; }
.row-text strong, .row-text small { display: block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.row-text strong { font-size: 15px; font-weight: 600; }
.row-text small { color: var(--subtle); font: 11px/1.5 var(--mono); margin-top: 5px; }
.row-arrow { color: var(--subtle); width: 15px; }
.status { display: inline-flex; align-items: center; flex: none; gap: 6px; padding: 4px 8px; border-radius: 4px; font: 11px/1.45 var(--mono); color: var(--muted); background: #2b2c26; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.running, .status.completed { color: var(--lime); background: #2a311f; }
.status.failed { color: var(--error); background: #382a23; }
.notice, .error-box { color: var(--error); background: #30251f; border: 1px solid #574037; border-radius: 8px; padding: 14px 17px; line-height: 1.55; font-size: 14px; }
.notice { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.small-button { border: 0; background: none; color: inherit; font-size: 13px; text-decoration: underline; padding: 4px; }
.form-error { color: var(--error); margin: 9px 0 0; font-size: 13px; }
.back-link { margin-bottom: 25px; }
.detail-heading { margin-bottom: 22px; }
.detail-heading .caption-update { margin: 10px 0 0; color: var(--text); font-size: 14px; }
.detail-heading .status { margin-bottom: 13px; }
.source-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 17px; margin-top: 15px; color: var(--subtle); font: 12px/1.6 var(--mono); }
.source-meta span { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.source-meta .icon { width: 15px; height: 15px; }
.progress-panel { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.progress-panel h2, .error-box h2 { font-size: 20px; line-height: 1.3; margin: 0 0 7px; letter-spacing: -.03em; }
.progress-panel p, .error-box p { margin: 0; line-height: 1.6; font-size: 14px; }
.progress-panel p { color: var(--muted); }
.row-text .row-eta { color: var(--lime); white-space: normal; }
.job-eta { display: flex; align-items: flex-start; gap: 11px; margin-top: 16px; padding: 13px 15px; border-left: 2px solid var(--lime); background: var(--bg); }
.job-eta .icon { margin-top: 2px; width: 16px; height: 16px; color: var(--lime); }
.job-eta .eta-label, .job-eta .eta-value, .job-eta .eta-detail { display: block; }
.eta-label { color: var(--muted); font-size: 13px; }
.eta-value { margin-top: 3px; font-size: 16px; font-weight: 600; }
.eta-detail { margin-top: 4px; color: var(--subtle); font-size: 12px; line-height: 1.45; }
.progress-steps { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin: 19px 0 0; padding: 0; list-style: none; }
.progress-steps li { padding-top: 10px; border-top: 3px solid var(--line); color: var(--subtle); font: 12px/1.5 var(--mono); }
.progress-steps li.done, .progress-steps li[aria-current] { border-color: var(--lime); }
.progress-steps li[aria-current] { color: var(--lime); }
.error-box .secondary { margin-top: 14px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,270px),1fr)); align-items: start; gap: 18px; }
.more-clips { margin-top: 18px; }
.clip-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.clip-card video { width: 100%; background: #090a08; display: block; aspect-ratio: 9 / 16; max-height: 480px; object-fit: contain; }
.clip-copy { padding: 17px; }
.clip-copy h3 { font-size: 18px; line-height: 1.25; letter-spacing: -.03em; margin: 8px 0 12px; }
.clip-length { color: var(--subtle); font: 11px/1.5 var(--mono); }
.clip-applied-style { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.clip-applied-style strong, .clip-applied-style span { display: block; }
.post-caption { border-top: 1px solid var(--line); margin: 12px 0 16px; padding-top: 12px; }
.post-caption-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 8px; }
.post-caption h4 { margin: 0; font-size: 14px; }
.caption-copy.secondary { min-height: 34px; padding: 0 9px; font-size: 12px; gap: 6px; }
.caption-copy .icon { width: 15px; height: 15px; }
.post-text { color: var(--text); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; margin: 8px 0 0; }
.post-tags { color: var(--lime); }
.copy-hint { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.copy-field { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.clip-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.clip-actions .primary, .clip-actions .secondary { min-height: 37px; padding: 0 11px; font-size: 12px; gap: 6px; }
.clip-actions .icon { width: 15px; height: 15px; }
@media (min-width: 1450px) { main { padding-top: 56px; } .hero { min-height: 355px; } }
@media (max-width: 900px) {
  .wrap { width: calc(100% - 48px); }
  .hero { grid-template-columns: minmax(290px,.95fr) 1fr; min-height: 300px; }
  .hero-copy { padding-left: 28px; }
  .source-form { padding-inline: 25px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 30px); }
  .bar-inner { height: 60px; }
  .brand { gap: 5px; font-size: 21px; }
  .brand > svg { width: 26px; height: 26px; }
  nav { gap: 1px; margin-left: 14px; padding-left: 10px; }
  .nav-link { padding-inline: 8px; gap: 5px; font-size: 12px; }
  .nav-link .icon { width: 14px; height: 14px; }
  .connection { margin-left: auto; padding-left: 7px; }
  .key-button { margin-left: 10px; }
  .key-button span { display: none; }
  #connection-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  main { padding-block: 22px 45px; }
  .hero { display: block; min-height: 260px; }
  .hero-copy { max-width: 77%; padding: 25px 0 25px 20px; }
  .hero h1 { font-size: clamp(46px,10.4vw,61px); }
  .eyebrow { font-size: 9px; letter-spacing: 1.4px; margin-bottom: 14px; }
  .hero-desc { margin-top: 16px; font-size: 13px; max-width: 275px; }
  .artwork { position: absolute; inset: 0 -90px 0 56%; z-index: -1; opacity: .64; mask-image: linear-gradient(to right,transparent,black 47%); }
  .source-form { padding: 19px 17px; }
  .input-row { flex-direction: column; gap: 8px; }
  .input-wrap input { font-size: 16px; padding-block: 12px; }
  .source-form .primary { min-height: 45px; }
  .output-specs { gap: 6px 12px; font-size: 10px; margin-top: 12px; }
  .output-specs .icon { width: 13px; height: 13px; }
  .sessions { margin-top: 22px; }
  .section-heading h2 { font-size: 20px; }
  .empty-state { gap: 12px; padding: 17px; }
  .session-row { gap: 9px; padding: 12px; }
  .row-icon { width: 33px; height: 33px; }
  .row-arrow { display: none; }
  .status { font-size: 10px; }
  .caption-copy.secondary { min-height: 44px; }
  .progress-panel { padding: 18px; }
  .progress-steps { grid-template-columns: 1fr; gap: 5px; }
  .progress-steps li { padding: 3px 0 3px 9px; border-top: 0; border-left: 3px solid var(--line); }
}
.stats-head, .stats-list-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.stats-head .page-heading { margin: 0; }
.stats-head .page-heading p { margin-bottom: 0; }
.stat-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-block: 29px 38px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.stat-totals:empty { display: none; }
.stat-total { display: grid; gap: 7px; align-content: start; padding: 19px 21px; background: var(--surface); }
.stat-total > span, .stats-filters label { color: var(--muted); font-size: 13px; }
.stat-total > strong { font-size: clamp(26px,3.4vw,40px); font-weight: 620; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat-total small, .stats-post small, .stats-detail, .stats-feedback { color: var(--subtle); font-size: 12px; line-height: 1.5; }
.stats-list-head h2 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.stats-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.stats-filters label { display: grid; gap: 5px; margin: 0; }
.stats-filters select { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); padding: 7px 10px; font: inherit; }
.stats-feedback { margin: 8px 0; }
.stats-feedback:empty { margin: 0; }
.stats-feedback.form-error { color: var(--error); }
.stats-posts { margin: 16px 0; }
.stats-post { display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(115px,.65fr) minmax(240px,1.35fr); column-gap: 22px; row-gap: 8px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.stats-post:last-child { border-bottom: 1px solid var(--line); }
.stats-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.stats-thumbnail { flex: 0 0 42px; height: 62px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; color: var(--muted); background: var(--surface); }
.stats-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stats-title { min-width: 0; }
.stats-title h3 { margin: 3px 0; font-size: 16px; line-height: 1.25; }
.stats-title a:hover, .stats-title a:focus-visible { text-decoration: underline; }
.stats-channel { font-weight: 550; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.stats-recording { display: block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.stats-delivery { display: grid; gap: 3px; justify-items: start; }
.stats-state { font-size: 13px; font-weight: 600; }
.stats-state[data-state=published] { color: var(--lime); }
.stats-state[data-state=failed], .stats-state[data-state=unknown] { color: var(--error); }
.stats-numbers { margin: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.stats-numbers dt { color: var(--muted); font-size: 11px; }
.stats-numbers dd { margin: 4px 0 0; font: 500 14px/1.3 var(--mono); overflow-wrap: anywhere; }
.stats-detail { grid-column: 1 / -1; margin: 0; }
.stats-posts .empty-state a { display: inline-flex; color: var(--lime); margin-top: 6px; }
@media (max-width: 760px) {
  .stat-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-total { padding: 14px; }
  .stats-post { grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .stats-numbers { grid-column: 1 / -1; }
  .stats-delivery { max-width: 116px; }
  .stats-filters select { font-size: 16px; }
}
@media (max-width: 540px) {
  .bar-inner:has(#nav-stats:not([hidden])) { height: auto; min-height: 84px; flex-wrap: wrap; row-gap: 5px; padding-block: 8px; }
  .bar-inner:has(#nav-stats:not([hidden])) nav { order: 1; flex: 0 0 100%; margin: 0; padding: 0; border-left: 0; }
  .stats-head, .stats-list-head { gap: 12px; }
  .stats-filters { width: 100%; }
  .stats-filters label { flex: 1; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
