@font-face {
  font-family: "Savorads Harmony";
  src: local("HarmonyOS Sans SC"), local("HarmonyOS Sans SC Regular"), url("fonts/HarmonyOS-Sans-SC-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --font-body: "Savorads Harmony", "HarmonyOS Sans SC", system-ui, sans-serif;
  --font-title: "Savorads Harmony", "HarmonyOS Sans SC", system-ui, sans-serif;
  --font-title-latin: "Savorads Harmony", "HarmonyOS Sans SC", system-ui, sans-serif;
  --font: var(--font-body);
  --project-font: var(--font-body);
  --rl-canvas: #f2f0ea;
  --rl-canvas-2: #e7e5df;
  --rl-panel: #fffef9;
  --rl-panel-soft: #f8f6ef;
  --rl-ink: #141414;
  --rl-muted: #686868;
  --rl-faint: #8d8d8d;
  --rl-line: #171717;
  --rl-line-soft: rgba(20, 20, 20, 0.24);
  --rl-purple: #9854f4;
  --rl-purple-soft: #e7d3ff;
  --rl-blue: #59c6f2;
  --rl-blue-soft: #d6f3ff;
  --rl-orange: #f15a2b;
  --rl-orange-soft: #ffd8c9;
  --rl-green: #63cf83;
  --rl-green-soft: #d8f5de;
  --rl-yellow: #f5cc46;
  --rl-danger: #d92d20;
  --rl-radius-xs: 8px;
  --rl-radius-sm: 12px;
  --rl-radius-md: 18px;
  --rl-radius-lg: 26px;
  --rl-radius-xl: 34px;
  --rl-stroke: 2px;
  --rl-shadow-sm: 3px 3px 0 var(--rl-line);
  --rl-shadow-md: 6px 6px 0 var(--rl-line);
  --rl-shadow-lg: 10px 10px 0 var(--rl-line);
  --rl-focus: 0 0 0 4px rgba(152, 84, 244, 0.25);
  --rl-motion: 160ms cubic-bezier(.2, .8, .2, 1);
  --grid-margin: clamp(18px, 2.5vw, 40px);
  --grid-gutter: 18px;
}

body.theme-dark {
  --rl-canvas: #0d0d0d;
  --rl-canvas-2: #191919;
  --rl-panel: #171717;
  --rl-panel-soft: #222222;
  --rl-ink: #f7f5ef;
  --rl-muted: #b5b2aa;
  --rl-faint: #8f8c85;
  --rl-line: #f4f0e8;
  --rl-line-soft: rgba(244, 240, 232, 0.28);
  --rl-purple-soft: #3a2453;
  --rl-blue-soft: #163745;
  --rl-orange-soft: #4a281c;
  --rl-green-soft: #1c3e26;
  --rl-shadow-sm: 3px 3px 0 rgba(244, 240, 232, 0.82);
  --rl-shadow-md: 6px 6px 0 rgba(244, 240, 232, 0.86);
  --rl-shadow-lg: 10px 10px 0 rgba(244, 240, 232, 0.9);
}

html,
body,
body * {
  font-family: var(--font-body);
}

button,
input,
select,
textarea {
  font-family: var(--font-body);
}

html,
body {
  color: var(--rl-ink);
  background: var(--rl-canvas);
}

body,
body.theme-light,
body.theme-dark,
body.theme-light #app,
body.theme-dark #app {
  color: var(--rl-ink);
  background-color: var(--rl-canvas);
  background-image:
    radial-gradient(circle at 8% 11%, color-mix(in srgb, var(--rl-purple) 18%, transparent) 0 7%, transparent 7.2%),
    radial-gradient(circle at 93% 86%, color-mix(in srgb, var(--rl-blue) 16%, transparent) 0 9%, transparent 9.2%);
}

h1,
h2,
h3,
strong,
.page-title,
.splash-brand,
.brand,
.project-title,
.step,
.btn,
.panel-header h3,
.shot-card-title,
.scene-shot-title,
.cs-kicker,
.cs-section-heading,
.cs-side-summary > strong,
.activity-head strong,
.activity-item .name,
.dropdown .panel-head,
.storyboard-heading,
.storyboard-view-switch button {
  font-family: var(--font-title);
  font-synthesis: none;
}

.brand {
  font-family: var(--font-title-latin);
}

p,
span,
label,
td,
textarea,
input,
select,
.cell-input,
.cell-textarea,
.shot-card-content,
.scene-shot-content,
.sb-card-text,
.callsheet-field {
  font-family: var(--font-body);
}

.cell-input,
.cell-textarea,
.combo-input {
  font-family: var(--font-body);
}

button,
input,
select,
textarea,
[tabindex] {
  transition: border-color var(--rl-motion), background var(--rl-motion), color var(--rl-motion), box-shadow var(--rl-motion), transform var(--rl-motion);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none !important;
  box-shadow: var(--rl-focus) !important;
}

/* Shell */
#app {
  isolation: isolate;
  min-height: 100%;
}

.topbar {
  min-height: 74px;
  height: auto;
  padding: 10px var(--grid-margin);
  gap: 20px;
  border: 0;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  background: color-mix(in srgb, var(--rl-panel) 94%, transparent);
  color: var(--rl-ink);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right,
.toolbar-left,
.toolbar-right {
  gap: 9px;
}

.brand {
  width: 42px;
  height: 42px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 14px;
  background: var(--rl-orange);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--rl-shadow-sm);
}

.back-btn,
.icon-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 12px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.back-btn:hover,
.icon-btn:hover {
  background: var(--rl-blue);
  color: #111;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--rl-line);
}

.back-btn:active,
.icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.project-title {
  max-width: 270px;
  padding: 8px 10px;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--rl-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-title:hover,
.project-title:focus {
  border-color: var(--rl-line);
  background: var(--rl-panel-soft);
}

.file-badge {
  padding: 5px 10px;
  border: 1.5px solid var(--rl-line);
  border-radius: 999px;
  background: var(--rl-panel);
  color: var(--rl-muted);
  font-size: 11px;
  font-weight: 700;
}

.file-badge.saved {
  border-color: var(--rl-line);
  background: var(--rl-green-soft);
  color: var(--rl-ink);
}

.file-badge.dirty {
  border-color: var(--rl-line);
  background: var(--rl-orange-soft);
  color: var(--rl-ink);
}

.steps {
  gap: 6px;
  padding: 5px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 18px;
  background: var(--rl-panel-soft);
  color: var(--rl-muted);
}

.step {
  height: 38px;
  padding: 0 15px;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--rl-muted);
  font-size: 13px;
  font-weight: 800;
}

.step:hover {
  border-color: var(--rl-line);
  background: var(--rl-panel);
  color: var(--rl-ink);
}

.step.active,
body.theme-dark .step.active {
  border: var(--rl-stroke) solid var(--rl-line);
  background: var(--rl-purple);
  color: #fff;
  box-shadow: 2px 2px 0 var(--rl-line);
}

.step.active::after,
.step-sep {
  display: none;
}

/* Controls */
.btn,
.btn-icon {
  min-height: 38px;
  padding: 8px 14px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 12px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 2px 2px 0 var(--rl-line);
}

.btn:hover,
.btn.outline:hover,
.btn.ghost:hover,
.btn-icon:hover {
  border-color: var(--rl-line);
  background: var(--rl-blue-soft);
  color: var(--rl-ink);
  filter: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--rl-line);
}

.btn:active,
.btn-icon:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn.ghost,
.btn.outline,
body.theme-dark .btn.ghost,
body.theme-dark .btn.outline {
  border-color: var(--rl-line);
  background: var(--rl-panel);
  color: var(--rl-ink);
}

.btn.primary,
.btn.accent,
body.theme-dark .btn.primary,
body.theme-dark .btn.accent {
  border-color: var(--rl-line);
  background: var(--rl-purple);
  color: #fff;
  box-shadow: var(--rl-shadow-sm);
}

.btn.primary:hover,
.btn.accent:hover,
body.theme-dark .btn.primary:hover,
body.theme-dark .btn.accent:hover {
  border-color: var(--rl-line);
  background: var(--rl-orange);
  color: #fff;
  box-shadow: var(--rl-shadow-md);
}

.btn.danger-outline,
body.theme-dark .btn.danger-outline {
  border-color: var(--rl-line);
  background: var(--rl-orange-soft);
  color: var(--rl-danger);
}

.btn.lg {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 15px;
  font-size: 14px;
}

.btn.accent.split {
  margin-left: -11px;
  border-left-color: var(--rl-line);
  box-shadow: var(--rl-shadow-sm);
}

#btnAddShot.btn.accent {
  padding-right: 14px;
}

.link-btn {
  color: var(--rl-ink);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--rl-purple);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--rl-purple);
}

.toolbar,
.storyboard-toolbar {
  min-height: 72px;
  padding: 12px var(--grid-margin);
  gap: 18px;
  border: 0;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  background: color-mix(in srgb, var(--rl-panel) 94%, transparent);
  color: var(--rl-ink);
  box-shadow: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.page-title,
.storyboard-heading .page-title {
  margin: 0;
  color: var(--rl-ink);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
}

.shot-count,
.storyboard-heading .shot-count {
  padding: 4px 9px;
  border: 1.5px solid var(--rl-line);
  border-radius: 999px;
  background: var(--rl-yellow);
  color: #171717;
  font-size: 11px;
  font-weight: 800;
}

.dirty-dot {
  color: var(--rl-orange);
}

.dropdown,
.dropdown.panel,
.combo-pick-menu,
.storyboard-fields-panel {
  padding: 8px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 18px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: var(--rl-shadow-md);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dropdown button,
.combo-pick-item {
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--rl-ink);
}

.dropdown button:hover,
.combo-pick-item:hover {
  border-color: var(--rl-line);
  background: var(--rl-purple-soft);
  color: var(--rl-ink);
}

.panel-row select,
.font-family-custom,
.frame-lib-filters input,
.callsheet-field input,
.callsheet-field select,
.callsheet-field textarea {
  border: 1.5px solid var(--rl-line);
  border-radius: 10px;
  background: var(--rl-panel-soft);
  color: var(--rl-ink);
}

.panel-row select:focus,
.font-family-custom:focus,
.frame-lib-filters input:focus,
.callsheet-field input:focus,
.callsheet-field select:focus,
.callsheet-field textarea:focus {
  border-color: var(--rl-purple);
  background: var(--rl-panel);
}

.theme-switch-track {
  border: 2px solid var(--rl-line);
  background: var(--rl-purple);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.theme-switch-knob {
  border: 1px solid var(--rl-line);
}

.toggle-inline input,
.row-check,
.storyboard-fields-panel input,
.cs-template-picker input,
.cs-rundown-option input {
  accent-color: var(--rl-purple);
}

/* Home */
.splash {
  padding: clamp(22px, 4vw, 54px) var(--grid-margin);
  background:
    radial-gradient(circle at 10% 8%, var(--rl-orange) 0 8%, transparent 8.2%),
    radial-gradient(circle at 92% 88%, var(--rl-blue) 0 10%, transparent 10.2%),
    var(--rl-canvas);
}

.home-shell {
  width: min(1380px, 100%);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
}

.home-hero,
.activity-panel {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-xl);
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: var(--rl-shadow-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-hero {
  min-height: 520px;
  padding: clamp(32px, 5vw, 72px);
}

.home-hero::before {
  top: -72px;
  right: -52px;
  width: 235px;
  height: 235px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 50%;
  background: var(--rl-purple);
  opacity: 1;
}

.home-hero::after {
  right: 38px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 50% 50% 0 0;
  background: var(--rl-green);
  opacity: 1;
}

.activity-panel::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  background: linear-gradient(90deg, var(--rl-orange) 0 25%, var(--rl-purple) 25% 52%, var(--rl-blue) 52% 76%, var(--rl-green) 76%);
}

.splash-brand {
  max-width: 8ch;
  color: var(--rl-ink);
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: .92;
  text-wrap: balance;
}

.splash-desc {
  margin: 20px 0 28px;
  color: var(--rl-muted);
  font-size: 16px;
}

.home-session {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 16px;
  background: var(--rl-purple-soft);
  color: var(--rl-ink);
  box-shadow: 3px 3px 0 var(--rl-line);
}

.activity-panel {
  padding: 42px 24px 22px;
}

.activity-head strong {
  color: var(--rl-ink);
  font-size: 24px;
  font-weight: 900;
}

.activity-sub,
.home-primary-meta,
.activity-empty {
  color: var(--rl-muted);
}

.activity-item.project-card {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 16px;
  background: var(--rl-panel-soft);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.activity-item.project-card:nth-child(4n + 1) { background: var(--rl-purple-soft); }
.activity-item.project-card:nth-child(4n + 2) { background: var(--rl-blue-soft); }
.activity-item.project-card:nth-child(4n + 3) { background: var(--rl-orange-soft); }
.activity-item.project-card:nth-child(4n + 4) { background: var(--rl-green-soft); }

.activity-item.project-card:hover {
  border-color: var(--rl-line);
  background: var(--rl-panel);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--rl-line);
}

.project-card-rail {
  border-left: var(--rl-stroke) solid var(--rl-line);
  background: color-mix(in srgb, var(--rl-ink) 8%, transparent);
}

.tag {
  border: 1.5px solid var(--rl-line);
  border-radius: 999px;
  background: var(--rl-panel);
  color: var(--rl-ink);
}

/* Editor table */
.table-wrap {
  padding: 24px var(--grid-margin) 54px;
  background:
    linear-gradient(var(--rl-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rl-line-soft) 1px, transparent 1px),
    var(--rl-canvas);
  background-size: 32px 32px;
}

.shot-table {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-md);
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: var(--rl-shadow-md);
}

.shot-table thead th {
  padding: 13px 14px 13px 10px;
  border-right: 1.5px solid var(--rl-line);
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  background: var(--rl-purple);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 800;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.shot-table thead th:nth-child(4n + 2) { background: var(--rl-orange); }
.shot-table thead th:nth-child(4n + 3) { background: #1788b4; }
.shot-table thead th:nth-child(4n + 4) { background: #2f9d51; }

.shot-table tbody td,
body.theme-dark .shot-table tbody td {
  padding: 10px;
  border-right: 1.5px solid var(--rl-line);
  border-bottom: 1.5px solid var(--rl-line);
  background: var(--rl-panel);
  color: var(--rl-ink);
}

.shot-table tbody tr:nth-child(even) td,
body.theme-dark .shot-table tbody tr:nth-child(even) td {
  background: var(--rl-panel-soft);
}

.shot-table tbody tr:hover td,
body.theme-dark .shot-table tbody tr:hover td {
  background: var(--rl-blue-soft);
}

.shot-table tbody tr.selected td,
body.theme-dark .shot-table tbody tr.selected td {
  background: var(--rl-purple-soft);
  box-shadow: inset 0 2px 0 var(--rl-purple), inset 0 -2px 0 var(--rl-purple);
}

.shot-table tbody tr.selected td:first-child {
  box-shadow: inset 2px 0 0 var(--rl-purple), inset 0 2px 0 var(--rl-purple), inset 0 -2px 0 var(--rl-purple);
}

.shot-table tbody tr.selected td:last-child {
  box-shadow: inset -2px 0 0 var(--rl-purple), inset 0 2px 0 var(--rl-purple), inset 0 -2px 0 var(--rl-purple);
}

.col-resizer::after {
  background: rgba(255,255,255,.36);
}

.drag-handle {
  border: 1.5px solid var(--rl-line);
  border-radius: 10px;
  background: var(--rl-yellow);
  color: #111;
  box-shadow: 2px 2px 0 var(--rl-line);
}

.drag-handle:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.cell-input,
.cell-textarea,
.combo-field {
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--rl-ink);
}

.cell-input:hover,
.cell-textarea:hover,
.combo-field:hover {
  border-color: var(--rl-line);
  background: var(--rl-panel);
}

.cell-input:focus,
.cell-textarea:focus,
.combo-field:focus-within {
  border-color: var(--rl-line);
  background: var(--rl-panel);
  box-shadow: inset 0 -3px 0 var(--rl-purple);
}

.cell-input::placeholder,
.cell-textarea::placeholder {
  color: var(--rl-faint);
}

.combo-pick {
  border-left: 1px solid transparent;
  color: var(--rl-muted);
}

.combo-field:focus-within .combo-pick {
  border-left-color: var(--rl-line-soft);
}

.image-box {
  border: var(--rl-stroke) dashed var(--rl-line);
  border-radius: 15px;
  background: var(--rl-panel-soft);
}

.image-box:hover,
.image-box.is-paste-target,
.image-box:focus-visible {
  border-color: var(--rl-line);
  background: var(--rl-blue-soft);
  box-shadow: 4px 4px 0 var(--rl-line);
  transform: translate(-1px, -1px);
}

.image-box.has-image {
  border-style: solid;
  border-color: var(--rl-line);
}

.image-actions-bar button,
.row-actions button {
  border: 1.5px solid var(--rl-line);
  border-radius: 9px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.image-actions-bar button:hover,
.row-actions button:hover {
  background: var(--rl-purple-soft);
  color: var(--rl-ink);
}

.empty-state {
  color: var(--rl-ink);
}

.empty-state .hint {
  color: var(--rl-muted);
}

/* Storyboard */
.storyboard-view,
body.theme-light .storyboard-view,
body.theme-dark .storyboard-view,
.storyboard-stage,
body.theme-light .storyboard-stage {
  background:
    radial-gradient(circle at 10% 8%, var(--rl-orange-soft) 0 8%, transparent 8.3%),
    radial-gradient(circle at 94% 90%, var(--rl-purple-soft) 0 12%, transparent 12.3%),
    var(--rl-canvas);
  color: var(--rl-ink);
}

.storyboard-view-switch {
  padding: 4px;
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 14px;
  background: var(--rl-panel);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.storyboard-view-switch button {
  height: 34px;
  padding: 0 15px;
  border: 1.5px solid transparent;
  border-radius: 9px;
  color: var(--rl-muted);
}

.storyboard-view-switch button:hover {
  border-color: var(--rl-line);
  background: var(--rl-blue-soft);
  color: var(--rl-ink);
}

.storyboard-view-switch button.active,
body.theme-light .storyboard-view-switch button.active {
  border: 1.5px solid var(--rl-line);
  background: var(--rl-purple);
  color: #fff;
  box-shadow: 2px 2px 0 var(--rl-line);
}

.storyboard-cols-label,
.storyboard-size-label,
.storyboard-info-switch,
body.theme-light .storyboard-cols-label,
body.theme-light .storyboard-size-label,
body.theme-light .storyboard-info-switch {
  color: var(--rl-muted);
}

.storyboard-cols-label select,
body.theme-light .storyboard-cols-label select,
.storyboard-fields-menu summary,
.storyboard-play-btn,
body.theme-light .storyboard-fields-menu summary,
body.theme-light .storyboard-play-btn {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 11px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.storyboard-fields-menu summary:hover,
.storyboard-play-btn:hover {
  border-color: var(--rl-line);
  background: var(--rl-orange);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--rl-line);
}

.size-slider,
body.theme-light .size-slider {
  height: 6px;
  border: 1px solid var(--rl-line);
  background: var(--rl-panel-soft);
}

.size-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--rl-line);
  background: var(--rl-purple);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.storyboard-info-switch .switch-track,
body.theme-light .storyboard-info-switch .switch-track {
  border: 1.5px solid var(--rl-line);
  background: var(--rl-panel-soft);
}

.storyboard-info-switch input:checked + .switch-track {
  background: var(--rl-green);
}

.storyboard-stage {
  padding: 26px var(--grid-margin);
}

.storyboard-board {
  gap: var(--sb-gap, 10px);
}

.sb-card {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 15px;
  background: #080808;
  box-shadow: 3px 3px 0 var(--rl-line);
}

.sb-card:nth-child(4n + 1) { --sb-accent: var(--rl-purple); }
.sb-card:nth-child(4n + 2) { --sb-accent: var(--rl-orange); }
.sb-card:nth-child(4n + 3) { --sb-accent: var(--rl-blue); }
.sb-card:nth-child(4n + 4) { --sb-accent: var(--rl-green); }

.sb-card:hover {
  border-color: var(--rl-line);
  box-shadow: 7px 7px 0 var(--sb-accent), 9px 9px 0 var(--rl-line);
  transform: translate(-3px, -3px);
}

.splash-brand,
.activity-head strong,
.page-title,
.cs-section-heading h2,
.callsheet-step h2,
.panel-header h3,
.storyboard-heading .page-title {
  font-family: var(--font-title);
  font-weight: 900;
}

.splash-brand {
  max-width: 100%;
  letter-spacing: -0.035em;
}

.splash-brand-latin,
.splash-brand-cn {
  display: block;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  font-family: inherit;
}

.splash-brand-mark {
  display: inline-block;
  margin-left: .08em;
  font-family: inherit;
  font-size: .28em;
  line-height: 0;
  letter-spacing: 0;
  vertical-align: super;
}

.sb-card-no {
  top: 8px;
  left: 8px;
  min-width: 20px;
  width: 20px;
  height: 18px;
  padding: 0 3px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 5px;
  background: rgba(255,255,255,.78);
  color: #151515;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  box-shadow: 1px 1px 0 rgba(0,0,0,.75);
}

.sb-card-info {
  padding-top: 22px;
}

.sb-card-meta,
.sb-card-text {
  font-family: var(--font-body);
}

.storyboard-status,
body.theme-light .storyboard-status,
body.theme-dark .storyboard-status {
  min-height: 42px;
  padding-inline: var(--grid-margin);
  border-top: var(--rl-stroke) solid var(--rl-line);
  background: var(--rl-panel);
  color: var(--rl-muted);
}

.storyboard-status b,
body.theme-light .storyboard-status b,
body.theme-dark .storyboard-status b {
  color: var(--rl-ink);
}

.storyboard-status i {
  border: 1.5px solid var(--rl-line);
  background: var(--rl-green);
  box-shadow: 2px 2px 0 var(--rl-line);
}

/* Shooting plan */
.schedule-view {
  background: var(--rl-canvas);
}

.shooting-plan-wrapper {
  gap: 22px;
  padding: 24px var(--grid-margin);
  background:
    radial-gradient(circle at 96% 5%, var(--rl-blue-soft) 0 11%, transparent 11.3%),
    var(--rl-canvas);
}

.shot-pool-panel,
.scene-groups-panel {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-lg);
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: var(--rl-shadow-md);
}

.shot-pool-panel {
  width: 320px;
}

.panel-header {
  min-height: 62px;
  padding: 15px 18px;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  background: var(--rl-purple-soft);
}

.scene-groups-panel > .panel-header {
  background: var(--rl-blue-soft);
}

.panel-header h3 {
  color: var(--rl-ink);
  font-size: 18px;
  font-weight: 900;
}

.panel-header .count {
  min-width: 32px;
  padding: 4px 9px;
  border: 1.5px solid var(--rl-line);
  border-radius: 999px;
  background: var(--rl-yellow);
  color: #111;
  box-shadow: 2px 2px 0 var(--rl-line);
}

.shot-pool-list,
.scene-groups-container {
  padding: 16px;
  gap: 14px;
}

.shot-card,
.scene-shot-card-full {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 15px;
  background: var(--rl-panel-soft);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.shot-card:nth-child(4n + 1) { background: var(--rl-purple-soft); }
.shot-card:nth-child(4n + 2) { background: var(--rl-blue-soft); }
.shot-card:nth-child(4n + 3) { background: var(--rl-orange-soft); }
.shot-card:nth-child(4n + 4) { background: var(--rl-green-soft); }

.shot-card:hover,
.scene-shot-card-full:hover {
  border-color: var(--rl-line);
  background: var(--rl-panel);
  box-shadow: 6px 6px 0 var(--rl-line);
  transform: translate(-2px, -2px);
}

.shot-card-image {
  border: 1.5px solid var(--rl-line);
  border-radius: 10px;
}

.shot-card-title,
.scene-shot-title,
.scene-shot-number {
  color: var(--rl-ink);
}

.shot-card-meta,
.shot-card-content,
.scene-shot-duration,
.scene-shot-content {
  color: var(--rl-muted);
}

.scene-shot-meta {
  color: var(--rl-purple);
  font-weight: 800;
}

.scene-group {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-md);
  background: var(--rl-panel);
  box-shadow: 5px 5px 0 var(--rl-line);
}

.scene-group:nth-child(4n + 1) .scene-group-header { background: var(--rl-purple-soft); }
.scene-group:nth-child(4n + 2) .scene-group-header { background: var(--rl-orange-soft); }
.scene-group:nth-child(4n + 3) .scene-group-header { background: var(--rl-blue-soft); }
.scene-group:nth-child(4n + 4) .scene-group-header { background: var(--rl-green-soft); }

.scene-group-header {
  margin: -14px -14px 12px;
  padding: 12px 14px;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  border-radius: 16px 16px 0 0;
}

.scene-group-name {
  border: 1.5px solid transparent;
  border-radius: 9px;
  color: var(--rl-ink);
  font-family: var(--font-title);
}

.scene-group-name:hover,
.scene-group-name:focus {
  border-color: var(--rl-line);
  background: var(--rl-panel);
}

.btn-icon {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.btn-icon:hover {
  background: var(--rl-orange);
  color: #fff;
}

.scene-group-drop-zone {
  border: var(--rl-stroke) dashed var(--rl-line);
  border-radius: 14px;
  background: var(--rl-panel-soft);
}

.scene-group-drop-zone.drag-over,
.scene-group.drag-target {
  border-color: var(--rl-line);
  border-style: solid;
  background: var(--rl-purple-soft);
  box-shadow: inset 0 0 0 3px var(--rl-purple);
}

.scene-shot-thumb {
  border-right: var(--rl-stroke) solid var(--rl-line);
  border-radius: 13px 0 0 13px;
}

.scene-group-stats {
  border-top: 1.5px solid var(--rl-line);
  color: var(--rl-muted);
}

.shooting-plan-size-control {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 12px;
  background: var(--rl-panel);
  color: var(--rl-muted);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.remove-btn-full {
  border: 1.5px solid var(--rl-line);
  border-radius: 8px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.remove-btn-full:hover {
  background: var(--rl-orange);
  color: #fff;
}

/* Call sheet workspace */
.callsheet-view,
.callsheet-wizard,
.callsheet-pro-shell {
  background: transparent;
  color: var(--rl-ink);
}

.callsheet-wizard {
  padding: 24px var(--grid-margin) 42px;
  background:
    radial-gradient(circle at 2% 98%, var(--rl-green-soft) 0 10%, transparent 10.3%),
    var(--rl-canvas);
}

.callsheet-pro-shell {
  width: min(1368px, 100%);
  gap: 22px;
}

.callsheet-editor-card,
.cs-side-summary,
.cs-subsection,
.cs-scene-plan,
.cs-crew-row,
.cs-arrival-batch,
.cs-person-card,
.cs-location-card,
.cs-template-picker label,
.cs-rundown-slider,
.cs-rundown-option {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-md);
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 3px 3px 0 var(--rl-line);
}

.callsheet-editor-card {
  padding: 24px;
  box-shadow: var(--rl-shadow-md);
}

.cs-side-summary {
  padding: 18px;
  background: var(--rl-purple-soft);
  box-shadow: var(--rl-shadow-md);
}

.cs-side-summary > div {
  border-top-color: var(--rl-line);
  color: var(--rl-muted);
}

.cs-side-summary > div b,
.cs-side-summary > strong {
  color: var(--rl-ink);
}

.cs-section-heading {
  margin: -24px -24px 20px;
  padding: 20px 24px;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  border-radius: 16px 16px 0 0;
  background: var(--rl-orange-soft);
}

.cs-section-heading h2,
.callsheet-step h2 {
  color: var(--rl-ink);
  font-size: 24px;
  font-weight: 900;
}

.cs-kicker {
  color: var(--rl-orange);
  font-size: 11px;
  font-weight: 900;
}

.cs-step-hint,
.step-desc {
  color: var(--rl-muted);
}

.cs-preset-bar,
.cs-available-scenes,
.cs-role-palette,
.cs-timeline-summary {
  border: var(--rl-stroke) dashed var(--rl-line);
  border-radius: 14px;
  background: var(--rl-blue-soft);
  color: var(--rl-muted);
}

.cs-chip {
  border: 1.5px solid var(--rl-line);
  border-radius: 999px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 2px 2px 0 var(--rl-line);
}

.cs-chip:hover {
  border-color: var(--rl-line);
  background: var(--rl-yellow);
  color: #111;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--rl-line);
}

.cs-chip.accent {
  border-color: var(--rl-line);
  background: var(--rl-purple);
  color: #fff;
}

.callsheet-field label {
  color: var(--rl-muted);
  font-weight: 800;
}

.callsheet-field input,
.callsheet-field select,
.callsheet-field textarea,
.cs-inline-field input,
.cs-crew-row input,
.cs-arrival-batch header input,
.cs-person-card input,
.cs-person-card select,
.cs-location-card input {
  border: 1.5px solid var(--rl-line);
  border-radius: 10px;
  background: var(--rl-panel-soft);
  color: var(--rl-ink);
}

.callsheet-field input:focus,
.callsheet-field select:focus,
.callsheet-field textarea:focus,
.cs-inline-field input:focus,
.cs-crew-row input:focus,
.cs-person-card input:focus,
.cs-person-card select:focus,
.cs-location-card input:focus {
  border-color: var(--rl-line);
  background: var(--rl-panel);
  box-shadow: inset 0 -3px 0 var(--rl-purple);
}

.cs-scene-order {
  border: 1.5px solid var(--rl-line);
  background: var(--rl-purple);
  color: #fff;
  box-shadow: 2px 2px 0 var(--rl-line);
}

.cs-scene-name,
.cs-time-result b,
.cs-total-duration b,
.cs-timeline-summary b {
  color: var(--rl-ink);
}

.cs-scene-shots,
.cs-time-result span,
.cs-total-duration span,
.cs-location-card label span {
  color: var(--rl-muted);
}

.cs-warning,
.cs-warning-block {
  border: 1.5px solid var(--rl-line);
  border-radius: 10px;
  background: var(--rl-yellow);
  color: #3f2f00;
}

.cs-arrival-batch.drag-over {
  border-color: var(--rl-line);
  background: var(--rl-purple-soft);
  box-shadow: 5px 5px 0 var(--rl-purple), 7px 7px 0 var(--rl-line);
}

.cs-person-drag {
  color: var(--rl-purple);
}

.cs-drop-placeholder,
.cs-empty {
  border: var(--rl-stroke) dashed var(--rl-line);
  border-radius: 14px;
  background: var(--rl-panel-soft);
  color: var(--rl-muted);
}

.cs-template-picker label:hover {
  background: var(--rl-blue-soft);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--rl-line);
}

.cs-template-picker label.selected {
  border-color: var(--rl-line);
  background: var(--rl-purple-soft);
  box-shadow: 5px 5px 0 var(--rl-purple), 7px 7px 0 var(--rl-line);
}

.cs-preview-stage {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-lg);
  background:
    linear-gradient(var(--rl-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rl-line-soft) 1px, transparent 1px),
    var(--rl-canvas-2);
  background-size: 22px 22px;
  box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--rl-panel) 55%, transparent);
}

.call-sheet-document {
  font-family: var(--font-body);
}

.call-sheet-page {
  border: 2px solid #151515;
  border-radius: 8px;
  box-shadow: 10px 10px 0 #151515;
}

.cs-doc-header h1,
.cs-doc-page-title h1,
.call-sheet-page section > h2,
.cs-rundown-scene-header h2 {
  font-family: var(--font-title);
}

.cs-doc-header,
.cs-doc-page-title {
  border-bottom-color: #151515;
}

.cs-doc-hero > div:nth-child(4n + 1),
.cs-doc-info-grid > div:nth-child(4n + 1) { background: #f0e2ff; }
.cs-doc-hero > div:nth-child(4n + 2),
.cs-doc-info-grid > div:nth-child(4n + 2) { background: #dff5ff; }
.cs-doc-hero > div:nth-child(4n + 3),
.cs-doc-info-grid > div:nth-child(4n + 3) { background: #ffe2d7; }
.cs-doc-hero > div:nth-child(4n + 4),
.cs-doc-info-grid > div:nth-child(4n + 4) { background: #dff6e3; }

.cs-doc-hero > div,
.cs-doc-info-grid > div,
.cs-doc-shot-card,
.cs-doc-shot-mini {
  border-color: #151515;
}

/* Modals and status */
.modal-backdrop {
  background: rgba(20, 20, 20, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.frame-lib-modal,
.report-modal {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: var(--rl-radius-lg);
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: var(--rl-shadow-lg);
}

.frame-lib-head,
.report-head {
  margin: -14px -14px 14px;
  padding: 16px 18px;
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  border-radius: 23px 23px 0 0;
  background: var(--rl-purple-soft);
}

.frame-lib-head strong,
.report-head strong {
  font-family: var(--font-title);
  font-size: 20px;
}

.frame-lib-sub,
.frame-lib-hint,
.frame-lib-empty {
  color: var(--rl-muted);
}

.frame-lib-card {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 15px;
  background: var(--rl-panel-soft);
  color: var(--rl-ink);
  box-shadow: 3px 3px 0 var(--rl-line);
}

.frame-lib-card:hover {
  border-color: var(--rl-line);
  background: var(--rl-blue-soft);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--rl-line);
}

.report-body {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 14px;
  background: var(--rl-panel-soft);
  color: var(--rl-ink);
}

.image-preview {
  border: var(--rl-stroke) solid #fff;
  box-shadow: 8px 8px 0 var(--rl-purple);
}

.image-crop-viewport,
.image-preview-stage video {
  border: var(--rl-stroke) solid #fff;
}

.statusbar {
  min-height: 34px;
  padding: 8px var(--grid-margin);
  border-top: var(--rl-stroke) solid var(--rl-line);
  background: var(--rl-panel);
  color: var(--rl-muted);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast {
  border: var(--rl-stroke) solid #111;
  border-radius: 14px;
  background: var(--rl-yellow);
  color: #111;
  box-shadow: 5px 5px 0 #111;
  font-weight: 800;
}

/* Legacy schedule */
.schedule-container,
.calendar-grid,
.day-planner {
  background: var(--rl-canvas);
  color: var(--rl-ink);
}

.calendar-header,
.day-planner-header {
  border-bottom: var(--rl-stroke) solid var(--rl-line);
  background: var(--rl-panel);
}

.calendar-title,
.day-planner-title,
.timeline-scene-title {
  color: var(--rl-ink);
  font-family: var(--font-title);
}

.calendar-day,
.timeline-item,
.shot-pool-item {
  border: var(--rl-stroke) solid var(--rl-line);
  border-radius: 14px;
  background: var(--rl-panel);
  color: var(--rl-ink);
  box-shadow: 3px 3px 0 var(--rl-line);
}

.calendar-day:not(.empty):hover,
.timeline-item:hover,
.shot-pool-item:hover {
  border-color: var(--rl-line);
  background: var(--rl-blue-soft);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--rl-line);
}

.calendar-day.has-shoot {
  border-color: var(--rl-line);
  background: var(--rl-purple-soft);
}

.day-number,
.shot-chip {
  color: var(--rl-ink);
}

.day-badge,
.shot-chip {
  border: 1.5px solid var(--rl-line);
  background: var(--rl-yellow);
  color: #111;
}

@media (max-width: 1279px) {
  :root { --grid-margin: 24px; }
  .steps { max-width: 46vw; overflow-x: auto; }
  .step { flex: 0 0 auto; }
  .callsheet-pro-shell { grid-template-columns: minmax(0, 1fr) 230px; }
}

@media (max-width: 959px) {
  :root { --grid-margin: 18px; }
  .topbar { position: static; align-items: flex-start; flex-wrap: wrap; }
  .topbar-left { flex: 1 1 auto; }
  .topbar-right { margin-left: auto; }
  .steps { order: 3; width: 100%; max-width: none; }
  .toolbar { position: static; align-items: flex-start; flex-wrap: wrap; }
  .toolbar-left,
  .toolbar-right { flex-wrap: wrap; }
  .toolbar-right { justify-content: flex-start; }
  .shooting-plan-wrapper { height: auto; min-height: calc(100vh - 180px); flex-direction: column; overflow: visible; }
  .shot-pool-panel { width: 100%; min-width: 0; max-height: 290px; }
  .scene-groups-panel { min-height: 540px; }
  .callsheet-pro-shell { grid-template-columns: 1fr; }
  .cs-side-summary { position: static; }
}

@media (max-width: 860px) {
  .home-shell { grid-template-columns: 1fr; }
  .home-hero { min-height: 420px; }
  .activity-panel { min-height: 300px; max-height: none; }
}

@media (max-width: 639px) {
  :root {
    --grid-margin: 12px;
    --grid-gutter: 12px;
    --rl-shadow-lg: 6px 6px 0 var(--rl-line);
  }
  .topbar { padding-block: 8px; }
  .brand,
  .file-badge,
  .back-btn { display: none; }
  .project-title { max-width: calc(100vw - 24px); padding-left: 0; }
  .topbar-right { width: 100%; margin-left: 0; overflow-x: auto; }
  .topbar-right .btn { flex: 0 0 auto; }
  .toolbar { padding-block: 10px; }
  .page-title,
  .storyboard-heading .page-title { font-size: 22px; }
  .table-wrap,
  .storyboard-stage,
  .shooting-plan-wrapper,
  .callsheet-wizard { padding-inline: var(--grid-margin); }
  .home-hero,
  .activity-panel { padding: 28px 20px; border-radius: 24px; }
  .splash-brand { font-size: 48px; }
  .scene-group { flex-basis: calc(100vw - 24px); width: calc(100vw - 24px); }
  .callsheet-editor-card { padding: 16px; }
  .cs-section-heading { margin: -16px -16px 16px; padding: 16px; }
  .frame-lib-grid { column-count: 2; }
}

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

/* Consistent Harmony hierarchy; regular face permits synthesized bold when no bold face is installed. */
body { font-synthesis:weight; }
body :is(h1,h2,.brand,.home-title) { font-weight:700; }
body :is(h3,.panel-head strong,.step,.btn,.link-btn) { font-weight:600; }
body :is(input,select,textarea,.col-name-input) { font-weight:400; }
body :is(.col-default-name,.col-status,.column-hint) { font-weight:400; }
