/* Video House Production Toolkit: app shell (dark, Video House brand) + documents (white paper, print-ready) */
body.tk-body { padding: 0 !important; background: var(--bg); }
.tk-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ---------- sidebar ---------- */
.tk-side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 24px 16px 20px; background: #13161A; border-right: 1px solid var(--line); }
.tk-brand { padding: 0 8px; display: grid; gap: 10px; }
.tk-brand .logo { font-size: 13px; }
.tk-lockup { display: flex; align-items: center; gap: 4px; }
.tk-lockup .by-x { padding-left: 10px; }
.tk-lockup .by-x img { height: 24px; }
.tk-word { margin: 0; font-family: var(--headline); font-weight: 400; text-transform: uppercase; font-size: 46px; line-height: 0.9; letter-spacing: 0.005em; color: var(--fg); }
.tk-word span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tk-tag { margin: 0; font-size: 13px; color: var(--muted); }

.tk-tabs { display: grid; gap: 2px; }
.tk-tab { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; min-height: 48px; padding: 6px 10px 6px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; font-family: var(--display) !important; font-weight: 600; font-size: 15px; cursor: pointer; transition: background-color .15s, color .15s; }
.tk-tab .n { font-family: var(--headline); font-weight: 400; font-size: 28px; line-height: 1; color: #3D434A; transition: color .15s; }
.tk-tab .c { min-width: 26px; padding: 2px 7px; border-radius: 99px; background: var(--line); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.tk-tab:hover { color: var(--fg); background: rgba(255,255,255,0.03); }
.tk-tab:hover .n { color: var(--muted); }
.tk-tab[aria-selected="true"] { color: var(--fg); background: rgba(255,255,255,0.06); }
.tk-tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad); }
.tk-tab[aria-selected="true"] .n { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tk-tab[aria-selected="true"] .c { background: var(--accent); color: var(--on-accent); }
.tk-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.tk-side-foot { margin-top: auto; display: grid; gap: 12px; }
.tk-side-foot .tk-banner { order: -1; }
.tk-main > section, .tk-viewer { padding-block: 0; }
.tk-main > section.tk-welcome { padding: 4px 0 4px 20px; }
.tk-install, .tk-banner { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.tk-install[hidden] { display: none; }
.tk-pro-name { margin: 0; font-family: var(--headline); font-size: 24px; line-height: 1; text-transform: uppercase; color: var(--fg); }
.tk-pro-name span { font-family: var(--body); font-size: 13px; text-transform: none; color: var(--accent); margin-left: 6px; white-space: nowrap; }
.tk-banner .btn, .tk-install .btn { justify-content: center; text-align: center; width: 100%; }
.tk-made { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 0; font-size: 13px; }
.tk-made > a:first-child { color: var(--muted); text-decoration: none; }
.tk-made > a:first-child:hover { color: var(--fg); }
.tk-made .by-x img { height: 22px; width: auto; }

/* ---------- workspace ---------- */
.tk-main { display: grid; align-content: start; gap: 26px; padding: 28px clamp(18px, 3vw, 40px) 90px; max-width: 1180px; width: 100%; }
.tk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-bar .spacer { flex: 1; }
.tk-small { font-size: 13px; color: var(--muted); }
.tk button { font: inherit; cursor: pointer; }
.tk .btn { font-weight: 600; font-size: 15px; border: 0; }
.tk .btn-ghost { background: transparent; border: 1px dashed var(--line); color: var(--fg); }
.tk .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.tk-mini { min-height: 38px; padding: 0 14px; border-radius: 8px; background: transparent; color: var(--fg); border: 1px solid var(--line); font-size: 14px !important; font-weight: 500; }
.tk-mini:hover { border-color: var(--muted); background: rgba(255,255,255,0.03); }
.tk-mini:focus-visible, .tk .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the slate: the project, live */
.tk-slate { border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.tk-clap { height: 26px; background: repeating-linear-gradient(-55deg, #0F1113 0 22px, transparent 22px 44px), var(--grad); }
.tk-slate-body { padding: 22px 26px 20px; display: grid; gap: 6px; }
.tk-slate-title { margin: 0; font-family: var(--headline); text-transform: uppercase; font-size: clamp(40px, 6.4vw, 92px); line-height: 0.9; letter-spacing: 0.005em; color: var(--fg); overflow-wrap: anywhere; }
.tk-slate-title.is-blank { color: #3D434A; }
.tk-slate-meta { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.tk-slate-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.9fr); margin: 16px 0 0; border-top: 1px solid var(--line); }
.tk-slate-stats > div { padding: 12px 14px 0 0; }
.tk-slate-stats > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.tk-slate-stats dt { font-size: 12px; color: var(--muted); }
.tk-slate-stats dd { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-actions { padding: 12px 26px; border-top: 1px solid var(--line); background: rgba(0,0,0,0.18); }

.tk-welcome { display: none; gap: 12px; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); }
.tk-is-empty .tk-welcome { display: grid; }
.tk-welcome-lede { margin: 0; font-size: 17px; max-width: 72ch; color: var(--fg); }

/* panels */
.tk-panel { display: grid; gap: 20px; }
.tk-panel-head { display: flex; gap: 20px; align-items: flex-start; }
.tk-panel-n { font-family: var(--headline); font-size: 92px; line-height: 0.78; color: transparent; -webkit-text-stroke: 1.5px var(--accent); flex: none; min-width: 0.6em; }
.tk-panel-head h2 { margin: 0 0 6px; font-family: var(--headline); font-weight: 400; text-transform: uppercase; font-size: clamp(30px, 3.6vw, 44px); line-height: 0.95; }
.tk-panel h2 { font-size: clamp(22px, 3vw, 30px); }
.tk-help { color: var(--muted); margin: 0; max-width: 72ch; }
.tk-next { padding-top: 18px; border-top: 1px solid var(--line); }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.tk-field { display: grid; gap: 6px; min-width: 0; }
.tk-field.wide { grid-column: 1 / -1; }
.tk-field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.tk input, .tk select, .tk textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; transition: border-color .15s; }
.tk input:hover, .tk select:hover, .tk textarea:hover { border-color: #3D434A; }
.tk textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.tk input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
.tk input:focus, .tk select:focus, .tk textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.tk-check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.tk-rows { display: grid; gap: 14px; }
.tk-row { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px 18px; display: grid; gap: 12px; }
.tk-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tk-row-head b { font-family: var(--headline); font-weight: 400; font-size: 22px; text-transform: uppercase; color: var(--fg); }
.tk-row-head .tk-mini { min-height: 34px; padding: 0 12px; font-size: 13px !important; color: var(--muted); }
.tk-row .tk-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tk-empty { border: 1px dashed var(--line); border-radius: 14px; padding: 28px; color: var(--muted); text-align: center; }
.tk-warn { background: rgba(232,176,75,0.08); border: 1px solid rgba(232,176,75,0.4); color: var(--fg); border-radius: 10px; padding: 12px 14px; margin: 0; font-size: 14px; }

/* documents: each one is a sheet of paper on the desk */
.tk-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; padding: 6px 0; }
.tk-doc-btn { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 230px; padding: 18px 16px 16px; text-align: left; border: 0; border-radius: 3px; background: #F7F5F1; color: #15171A; box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 10px 24px rgba(0,0,0,0.45); transition: transform .18s ease, box-shadow .18s ease; }
.tk-doc-btn::before { content: ""; height: 5px; width: 46px; background: var(--grad); border-radius: 2px; margin-bottom: 6px; }
.tk-doc-btn::after { content: ""; margin-top: auto; height: 58px; background: repeating-linear-gradient(to bottom, #DAD6CF 0 2px, transparent 2px 11px); -webkit-mask: linear-gradient(90deg, #000 70%, transparent); mask: linear-gradient(90deg, #000 70%, transparent); }
.tk-doc-btn strong { font-family: var(--display); font-size: 18px; line-height: 1.15; color: #15171A; }
.tk-doc-btn span { font-size: 13px; line-height: 1.4; color: #5A5650; }
.tk-doc-btn:hover { transform: translateY(-5px) rotate(-0.8deg); box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 18px 34px rgba(0,0,0,0.55); }
.tk-doc-btn[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 4px; }
.tk-doc-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* document viewer: full screen */
body.tk-viewing { overflow: hidden; }
.tk-viewer { position: fixed; inset: 0; z-index: 950; display: flex; flex-direction: column; background: #1F2226; }
.tk-viewer[hidden] { display: none; }
.tk-viewer-bar { padding: 12px 20px; gap: 12px; background: #13161A; border-bottom: 1px solid var(--line); }
.tk-viewer-bar h2 { margin: 0; font-family: var(--headline); font-weight: 400; text-transform: uppercase; font-size: 26px; line-height: 1; }
.tk-paper-wrap { flex: 1; overflow: auto; padding: 32px 20px 60px; }
@media (max-width: 1100px) { .tk-viewer-hint { display: none; } }

/* modal */
.tk-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.72); display: grid; place-items: center; padding: 16px; z-index: 1000; }
.tk-modal[hidden] { display: none; }
.tk-modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: min(460px, 100%); display: grid; gap: 14px; }
.tk-modal-box h3 { margin: 0; font-family: var(--headline); font-weight: 400; text-transform: uppercase; font-size: 30px; line-height: 1; }

/* ---------- small screens: steps become a strip across the top ---------- */
@media (max-width: 900px) {
  .tk-shell { display: flex; flex-direction: column; }
  .tk-side { display: contents; }
  .tk-brand { order: 1; padding: 18px 18px 6px; grid-template-columns: 1fr auto; align-items: end; }
  .tk-brand .logo, .tk-lockup { grid-column: 1 / -1; }
  .tk-word { font-size: 34px; }
  .tk-tag { text-align: right; }
  .tk-steps { order: 2; position: sticky; top: 0; z-index: 30; background: #13161A; border-block: 1px solid var(--line); }
  .tk-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; scrollbar-width: none; }
  .tk-tabs::-webkit-scrollbar { display: none; }
  .tk-tab { width: auto; flex: none; grid-template-columns: auto auto auto; gap: 6px; min-height: 44px; padding: 4px 12px; font-size: 14px; }
  .tk-tab .n { font-size: 20px; }
  .tk-tab[aria-selected="true"]::before { left: 12px; right: 12px; top: auto; bottom: 2px; width: auto; height: 3px; }
  .tk-main { order: 3; padding-top: 18px; }
  .tk-side-foot { order: 4; padding: 0 18px 40px; margin: 0; }
  .tk-slate-body { padding: 18px 18px 16px; }
  .tk-slate-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tk-slate-stats > div:nth-child(n+4) { padding-top: 10px; }
  .tk-slate-stats > div:last-child { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  .tk-slate-stats > div:nth-child(3n+1) { padding-left: 0; border-left: 0; }
  .tk-slate-stats dd { font-size: 20px; }
  .tk-actions { padding: 12px 18px; }
  .tk-panel-n { font-size: 64px; }
  .tk-paper-wrap { padding: 10px 8px 40px; }
  .tk-docs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tk-doc-btn { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) { .tk-tab, .tk-doc-btn, .tk input, .tk-tab .n { transition: none; } .tk-doc-btn:hover { transform: none; } }

/* ---------- premium layer ---------- */
.tk-body { scrollbar-color: #3D434A transparent; }
.tk-body ::-webkit-scrollbar { width: 10px; height: 10px; }
.tk-body ::-webkit-scrollbar-thumb { background: #2E3338; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.tk-body ::-webkit-scrollbar-thumb:hover { background-color: #454B52; }
.tk-body ::-webkit-scrollbar-track { background: transparent; }

/* icons */
.tk-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tk-mini, .tk .btn, .tk-viewer .btn { display: inline-flex; align-items: center; gap: 8px; }
.tk-mini .tk-ico { opacity: 0.8; }

/* the clapper: a striped arm that snaps shut on a striped base */
.tk-slate { overflow: visible; background: radial-gradient(120% 160% at 0% 0%, rgba(255,181,71,0.07), transparent 46%), var(--surface); box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6); }
.tk-clap { position: relative; height: 50px; background: none; }
.tk-clap::before, .tk-clap::after { content: ""; position: absolute; left: -1px; right: -1px; height: 24px; background: repeating-linear-gradient(-55deg, #0F1113 0 22px, transparent 22px 44px), var(--grad); }
.tk-clap::before { top: -1px; border-radius: 16px 16px 3px 3px; transform-origin: 10px 100%; box-shadow: 0 2px 0 #0F1113; }
.tk-clap::after { bottom: 0; background: repeating-linear-gradient(55deg, #0F1113 0 22px, transparent 22px 44px), var(--grad); }
.tk-clap.is-clapping::before { animation: tkClap 0.75s cubic-bezier(.3,.7,.2,1) both; }
@keyframes tkClap { 0% { transform: rotate(var(--clap-a, -17deg)); } 46% { transform: rotate(var(--clap-a, -17deg)); } 62% { transform: rotate(0); } 72% { transform: rotate(-2.5deg); } 82%, 100% { transform: rotate(0); } }
.tk-clap.is-clapping + .tk-slate-body .tk-slate-title { animation: tkThud 0.75s ease both; }
@keyframes tkThud { 0%, 60% { transform: none; } 66% { transform: translateY(2px); } 80%, 100% { transform: none; } }
.tk-slate-stats dd.tick { animation: tkTick 0.7s ease; }
@keyframes tkTick { 0% { color: var(--accent); transform: translateY(-4px); } 100% { color: var(--fg); transform: none; } }

/* sidebar extras */
.tk-jump { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 9px 10px 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, color .15s; }
.tk-jump span { flex: 1; text-align: left; }
.tk-jump:hover { color: var(--fg); border-color: #3D434A; }
.tk-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-body kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #0F1113; color: var(--muted); font: 600 11px/1.5 var(--body); text-align: center; }
.tk-tab .c.ok { background: rgba(232,176,75,0.16); color: var(--accent); }
.tk-tab[aria-selected="true"] .c.ok { background: var(--accent); color: var(--on-accent); }
.tk-tab.is-done:not([aria-selected="true"]) .n { color: #5B6269; }

/* dock: slim bar once the slate scrolls away */
.tk-dock { position: fixed; top: 0; left: 272px; right: 0; z-index: 60; transform: translateY(-110%); transition: transform .28s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.tk-dock.on { transform: none; pointer-events: auto; }
.tk-dock-in { display: flex; align-items: center; gap: 14px; padding: 10px clamp(18px, 3vw, 40px); background: rgba(19,22,26,0.86); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.tk-dock-clap { width: 30px; height: 16px; border-radius: 4px; flex: none; background: repeating-linear-gradient(-55deg, #0F1113 0 5px, transparent 5px 10px), var(--grad); }
.tk-dock b { font-family: var(--headline); font-weight: 400; font-size: 24px; line-height: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tk-dock-budget { font-family: var(--display); font-weight: 700; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-dock .spacer { flex: 1; }

/* step change */
.tk-enter { animation: tkIn .32s cubic-bezier(.2,.8,.2,1); }
@keyframes tkIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* form polish */
.tk select { -webkit-appearance: none; appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B3AEA6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.tk input:focus, .tk select:focus, .tk textarea:focus { box-shadow: 0 0 0 5px rgba(232,176,75,0.14); }
.tk input[type="number"] { font-variant-numeric: tabular-nums; }
.tk input[type="date"], .tk input[type="time"] { color-scheme: dark; }

/* documents: readiness */
.tk-meter { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tk-meter-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.tk-meter-top b { font-family: var(--display); font-size: 18px; }
.tk-meter-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tk-meter-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.tk-doc-btn::after { order: 2; }
.tk-doc-state { order: 3; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 9px 3px 8px; border-radius: 99px; background: #E3F1E7; color: #1E6A3A; font: 600 12px/1.4 var(--body); font-style: normal; }
.tk-doc-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tk-doc-state.is-need { background: #F5E7CC; color: #7A5312; }

/* viewer chrome */
.tk-icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; }
.tk-icon-btn:hover { background: rgba(255,255,255,0.05); border-color: #3D434A; }
.tk-icon-btn:focus-visible, .tk-zoom-v:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-docnav { display: inline-flex; gap: 4px; }
.tk-pages { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tk-zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tk-zoom .tk-icon-btn { border: 0; border-radius: 0; height: 36px; }
.tk-zoom-v { min-width: 58px; height: 36px; border: 0; border-inline: 1px solid var(--line); background: transparent; color: var(--fg); font: 600 13px var(--body); cursor: pointer; font-variant-numeric: tabular-nums; }
.tk-paper-wrap { background: radial-gradient(90% 60% at 50% 0%, #2A2E33, #1A1D20 70%); }
.tk-viewer-hint { display: none; }
@media (min-width: 1700px) { .tk-viewer-hint { display: inline; } }
.tk-viewer-bar h2 { white-space: nowrap; }

/* toasts */
.tk-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 1200; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.tk-toast { position: relative; padding: 12px 16px 12px 20px; border-radius: 12px; background: #F7F5F1; color: #15171A; font: 600 14px/1.3 var(--body); box-shadow: 0 16px 40px rgba(0,0,0,0.5); overflow: hidden; animation: tkToast .3s cubic-bezier(.2,.8,.2,1); }
.tk-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--grad); }
.tk-toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes tkToast { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* command bar */
.tk-pal { position: fixed; inset: 0; z-index: 1100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(6,7,8,0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tk-pal[hidden] { display: none; }
.tk-pal-box { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; border-radius: 18px; border: 1px solid #353A40; background: #171A1D; box-shadow: 0 40px 100px rgba(0,0,0,0.65); overflow: hidden; animation: tkPal .22s cubic-bezier(.2,.8,.2,1); }
@keyframes tkPal { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
.tk-pal-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.tk-pal-in .tk-ico { width: 20px; height: 20px; }
.tk-pal-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 500 18px var(--body); }
.tk-pal-in input::placeholder { color: #6B7178; }
.tk-pal ul { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.tk-pal li[role="option"] { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--fg); cursor: pointer; }
.tk-pal li[role="option"] span { flex: 1; min-width: 0; }
.tk-pal li[role="option"] small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tk-pal li[role="option"] .tk-ico { color: var(--muted); }
.tk-pal li[aria-selected="true"] { background: rgba(232,176,75,0.13); }
.tk-pal li[aria-selected="true"] .tk-ico { color: var(--accent); }
.tk-pal-g { padding: 12px 12px 4px; font-size: 12px; font-weight: 600; color: #6B7178; }
.tk-pal-none { padding: 22px 12px; color: var(--muted); text-align: center; }
.tk-pal-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .tk-dock, .tk-jump { display: none; }
  .tk-clap { --clap-a: -7deg; }
  .tk-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tk-actions .tk-mini { justify-content: center; padding: 0 8px; }
  .tk-actions .spacer { display: none; }
  .tk-actions #tk-status, .tk-actions .tk-proj { grid-column: 1 / -1; }
  .tk-toasts { left: 16px; right: 16px; bottom: 16px; justify-items: stretch; }
  .tk-viewer-bar { gap: 8px; padding: 10px 12px; }
  .tk-viewer-bar h2 { font-size: 20px; }
  .tk-pages { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-enter, .tk-toast, .tk-pal-box, .tk-slate-stats dd.tick, .tk-clap.is-clapping::before, .tk-clap.is-clapping + .tk-slate-body .tk-slate-title { animation: none; }
  .tk-dock, .tk-meter-bar i { transition: none; }
}

/* ---------- documents (paper) ---------- */
.paper { --ink: #111; --rule: #c9c9c9; --soft: #f2f2f2; color: var(--ink); font-family: "Inter", "Segoe UI", Arial, sans-serif; font-size: 12px; line-height: 1.45; }
.paper .page { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto 18px; padding: 14mm 14mm 18mm; position: relative; box-shadow: 0 4px 24px rgba(0,0,0,0.35); }
.paper .page.land { width: 297mm; min-height: 210mm; }
.paper [contenteditable]:focus { outline: 2px dashed #E8B04B; outline-offset: 2px; }
.paper h1, .paper h2, .paper h3 { color: var(--ink); font-family: "Space Grotesk", "Segoe UI", Arial, sans-serif; margin: 0; }
.paper h1 { font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; }
.paper h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; margin: 16px 0 6px; border-bottom: 2px solid var(--ink); padding-bottom: 3px; }
.paper h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin: 10px 0 4px; }
.paper p { margin: 0 0 8px; }
.paper .d-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 3px solid var(--ink); padding-bottom: 8px; margin-bottom: 10px; }
.paper .d-head .meta { text-align: right; font-size: 11px; }
.paper .d-kind { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: #555; font-weight: 600; }
.paper table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; }
.paper th, .paper td { border: 1px solid var(--rule); padding: 4px 6px; text-align: left; vertical-align: top; }
.paper th { background: var(--soft); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.paper td.num, .paper th.num { text-align: right; white-space: nowrap; }
.paper tr.sub td { background: var(--soft); font-weight: 600; }
.paper tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.paper tr.grp td { background: #e7e7e7; font-weight: 700; font-size: 11px; }
.paper tr.brk td { background: #fff7e6; font-style: italic; }
.paper .boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.paper .box { border: 1px solid var(--rule); padding: 6px 8px; }
.paper .box b { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #555; }
.paper .big { font-size: 20px; font-weight: 700; font-family: "Space Grotesk", Arial, sans-serif; }
.paper .note { font-size: 10px; color: #555; }
.paper .legal { border: 1px solid #b00; color: #900; padding: 5px 8px; font-size: 10px; margin-bottom: 10px; }
.paper .sig { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 28px; margin-top: 22px; }
.paper .sig div { border-top: 1px solid var(--ink); padding-top: 4px; font-size: 10px; min-height: 34px; }
.paper .blank { display: inline-block; min-width: 140px; border-bottom: 1px solid var(--ink); }
.paper .chk { width: 26px; text-align: center; }
.paper .d-foot { position: absolute; left: 14mm; right: 14mm; bottom: 7mm; display: flex; justify-content: space-between; font-size: 9px; color: #777; border-top: 1px solid var(--rule); padding-top: 4px; }
.paper ol, .paper ul { margin: 0 0 8px; padding-left: 18px; }

#tk-print { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; padding: 0 !important; }
  body > *:not(#tk-print) { display: none !important; }
  #tk-print { display: block !important; }
  .paper .page { box-shadow: none; margin: 0; width: auto; min-height: 297mm; break-after: page; }
  .paper .page:last-child { break-after: auto; }
  .paper .page.land { min-height: 0; }
  .paper [contenteditable] { outline: none !important; }
}

/* install-as-app box */
.tk-install { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--surface); }
.tk-install[hidden] { display: none; }
.tk-install [hidden] { display: none !important; }

/* ===================== edit suite layer =====================
   One metaphor for the whole app: an editing suite. The sidebar is the scene list, the slate is the
   program monitor, the timeline along the bottom is the edit. One accent (amber) for selection,
   tally red only for "live" (playhead, REC). Two corner sizes: 6px controls, 12px containers. */
.tk-body { --r1: 6px; --r2: 12px; --tally: #E5484D; --tl-h: 92px; }

/* unify corners and borders */
.tk-tab, .tk-mini, .tk input, .tk select, .tk textarea, .tk-jump, .tk-icon-btn, .tk-zoom, .tk-pal li[role="option"], .tk-warn, .tk .btn, .tk-viewer .btn { border-radius: var(--r1); }
.tk-slate, .tk-row, .tk-empty, .tk-install, .tk-banner, .tk-modal-box, .tk-toast, .tk-pal-box, .tk-meter { border-radius: var(--r2); }
.tk .btn-ghost { border-style: solid; }
/* one accent: primary buttons are solid amber inside the app (the sunset gradient stays on the brand marks) */
.tk-body .btn-primary { background: var(--accent); color: var(--on-accent); }
.tk-body .btn-primary:hover { background: #F3C97A; }
.tk-side .tk-install { display: grid; margin-top: 0; padding: 14px; border-left-width: 1px; border-left-color: var(--line); background: var(--bg); }

/* scene list: solid amber for "you are here", no gradients */
.tk-tab[aria-selected="true"]::before { background: var(--accent); }
.tk-tab[aria-selected="true"] .n { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent); }

/* documents are paper, so they lift like paper on a desk, they don't spin */
.tk-doc-btn:hover { transform: translateY(-4px); }

/* program monitor: viewfinder corners on the slate */
.tk-slate { position: relative; }
.tk-slate-body { position: relative; }
.tk-slate-body::before, .tk-slate-body::after { content: ""; position: absolute; top: 14px; width: 16px; height: 16px; border: 0 solid rgba(242,239,234,0.35); pointer-events: none; }
.tk-slate-body::before { left: 12px; border-width: 2px 0 0 2px; }
.tk-slate-body::after { right: 12px; border-width: 2px 2px 0 0; }

/* ---------- the timeline ---------- */
@media screen { body.tk-body { padding-bottom: var(--tl-h) !important; } }
.tk-tl { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: var(--tl-h); display: grid; grid-template-columns: 188px minmax(0, 1fr) auto; align-items: stretch;
  background: #0B0C0E; border-top: 1px solid var(--line); box-shadow: 0 -18px 40px rgba(0,0,0,0.45); font-family: var(--display); user-select: none; -webkit-user-select: none; }
.tk-tl-read { display: grid; align-content: center; gap: 6px; padding: 0 18px; border-right: 1px solid var(--line); min-width: 0; }
.tk-tl-tc { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 600; letter-spacing: 0.04em; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-tl-tc i { width: 8px; height: 8px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 10px rgba(229,72,77,0.8); animation: blink 1.2s steps(1) infinite; flex: none; }
.tk-tl-sc { font-size: 13px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-tl-track { position: relative; padding: 22px 14px 10px; cursor: ew-resize; touch-action: pan-y; min-width: 0; }
.tk-tl-track.drag { cursor: grabbing; }
/* ruler: a small tick every 12px, a taller one every 60px */
.tk-tl-ruler { position: absolute; left: 14px; right: 14px; top: 0; height: 18px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #3A3F45 0 1px, transparent 1px 60px) 0 100% / 100% 10px no-repeat, repeating-linear-gradient(90deg, #262A2F 0 1px, transparent 1px 12px) 0 100% / 100% 5px no-repeat; }
.tk-tl-lanes { position: relative; display: grid; grid-template-rows: 1fr 14px; gap: 4px; height: 100%; }
.tk-tl-clips, .tk-tl-audio { display: flex; gap: 2px; min-width: 0; }
.tk-tl-clip { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 4px; overflow: hidden; cursor: pointer; text-align: left;
  font: 600 12px/1 var(--display); color: #8A9097; background: #1A1D21 repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255,255,255,0.025) 6px 12px);
  box-shadow: inset 0 0 0 1px #262A2F; transition: flex-grow .45s cubic-bezier(.2,.8,.2,1), background-color .2s, color .2s; }
/* filled clips: picture on the timeline, with sprocket holes along the top and bottom edges */
.tk-tl-clip.is-done { color: #1A1407; background: linear-gradient(180deg, #F0C266, #D99A2F); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.tk-tl-clip.is-done::before, .tk-tl-clip.is-done::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; background: repeating-linear-gradient(90deg, rgba(0,0,0,0.32) 0 4px, transparent 4px 9px); pointer-events: none; }
.tk-tl-clip.is-done::before { top: 3px; }
.tk-tl-clip.is-done::after { bottom: 3px; }
.tk-tl-clip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.tk-tl-clip b { font-weight: 700; font-variant-numeric: tabular-nums; opacity: .75; position: relative; flex: none; }
.tk-tl-clip:hover { color: var(--fg); background-color: #22262B; }
.tk-tl-clip.is-done:hover { color: #1A1407; filter: brightness(1.08); }
.tk-tl-clip.on { box-shadow: inset 0 0 0 2px var(--fg); color: var(--fg); }
.tk-tl-clip.is-done.on { color: #1A1407; box-shadow: inset 0 0 0 2px #FFF4DC, 0 0 18px rgba(232,176,75,0.35); }
.tk-tl-clip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 1; }
/* audio lane: a waveform under every scene that has material */
.tk-tl-wave { flex: 1 1 0; min-width: 0; border-radius: 3px; background: #15181B; transition: flex-grow .45s cubic-bezier(.2,.8,.2,1); }
.tk-tl-wave.is-done { background: #12302B url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14' viewBox='0 0 48 14'%3E%3Cpath d='M0 7h48' stroke='%2338D9C5' stroke-opacity='.35'/%3E%3Cpath d='M2 5v4M5 3v8M8 6v2M11 2v10M14 4v6M17 5v4M20 1v12M23 4v6M26 6v2M29 3v8M32 5v4M35 2v10M38 4v6M41 6v2M44 3v8M47 5v4' stroke='%2338D9C5' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 48px 100% repeat-x; }
.tk-tl-head { position: absolute; top: -22px; bottom: -6px; left: 0; width: 2px; margin-left: -1px; background: var(--tally); box-shadow: 0 0 12px rgba(229,72,77,0.75); pointer-events: none; z-index: 2; }
.tk-tl-head::before { content: ""; position: absolute; top: 0; left: 50%; width: 13px; height: 12px; transform: translateX(-50%); background: var(--tally); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.tk-tl-head.glide { transition: left .45s cubic-bezier(.2,.8,.2,1); }
.tk-tl-side { display: flex; align-items: center; gap: 6px; padding: 0 14px; border-left: 1px solid var(--line); }
.tk-tl-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: var(--r1); background: transparent; color: var(--muted); cursor: pointer; }
.tk-tl-btn:hover { color: var(--fg); border-color: var(--muted); }
.tk-tl-btn[aria-pressed="false"] { color: #5D636A; }
.tk-tl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-tl-btn .tk-ico { width: 19px; height: 19px; margin: 0; }
.tk-toasts { bottom: calc(var(--tl-h) + 16px); }
body.tk-viewing .tk-tl { display: none; }

/* hard cut: one black frame with the scene card when you change step */
.tk-cut { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; background: #000; opacity: 0; pointer-events: none; transition: opacity .2s ease-out; }
.tk-cut.on { opacity: 1; transition: opacity .06s linear; }
.tk-cut div { text-align: center; padding: 0 20px; }
.tk-cut b { display: block; font: 400 clamp(56px, 9vw, 120px)/0.9 var(--headline); text-transform: uppercase; color: var(--fg); }
.tk-cut small { display: block; margin-top: 14px; font: 600 15px/1 var(--display); letter-spacing: 0.06em; color: var(--accent); font-variant-numeric: tabular-nums; }
.tk-cut.wrap b { color: var(--accent); }
.tk-cut.wrap small { color: var(--fg); }

@media (max-width: 900px) {
  .tk-body { --tl-h: 62px; }
  .tk-steps { display: none; }
  .tk-tl { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: env(safe-area-inset-bottom, 0px); height: calc(var(--tl-h) + env(safe-area-inset-bottom, 0px)); }
  .tk-tl-read, .tk-tl-ruler { display: none; }
  .tk-tl-track { padding: 8px 6px 6px 10px; }
  .tk-tl-lanes { grid-template-rows: 1fr 8px; gap: 3px; }
  .tk-tl-clip { justify-content: center; padding: 0 4px; font-size: 11px; }
  .tk-tl-clip span { display: none; }
  .tk-tl-clip.on span { display: inline; }
  .tk-tl-clip.on, .tk-tl-wave.on { flex-grow: 4 !important; }
  .tk-tl-head { top: -8px; bottom: -6px; }
  .tk-tl-head::before { width: 10px; height: 8px; }
  .tk-tl-side { padding: 0 10px 0 6px; border-left: 0; }
  .tk-tl-pal { display: none !important; }
  .tk-toasts { bottom: calc(var(--tl-h) + 12px); }
}
@media (prefers-reduced-motion: reduce) {
  .tk-tl-tc i { animation: none; }
  .tk-tl-clip, .tk-tl-wave, .tk-tl-head.glide { transition: none; }
  .tk-cut { display: none; }
}
.tk-meter-bar i { background: var(--accent); }

/* free version: Toolkit Pro reminders */
.tk-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 18px 0 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r2, 12px); font-size: 14px; line-height: 1.45; color: var(--muted); }
.tk-promo span { flex: 1 1 260px; }
.tk-promo a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tk-nudge { position: fixed; left: 24px; bottom: 24px; z-index: 1150; width: min(340px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--r2, 12px); background: var(--surface); color: var(--fg); box-shadow: 0 20px 50px rgba(0,0,0,.45); animation: tk-nudge-in .3s ease-out; }
.tk-nudge b { font-family: var(--headline); font-weight: 400; text-transform: uppercase; font-size: 22px; line-height: 1; padding-right: 24px; }
.tk-nudge p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.tk-nudge .btn { justify-self: start; margin-top: 4px; }
.tk-nudge-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.tk-nudge-x:hover { color: var(--fg); }
.tk-nudge-x:focus-visible, .tk-promo a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-nudge.out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes tk-nudge-in { from { opacity: 0; transform: translateY(10px); } }
.tk-banner.is-lit { animation: tk-lit 1.6s ease-out; }
@keyframes tk-lit { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.tk-body .tk-nudge { bottom: calc(var(--tl-h, 0px) + 16px); }
@media (max-width: 700px) { .tk-nudge { left: 16px; right: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .tk-nudge, .tk-banner.is-lit { animation: none; } }
