:root {
  color-scheme: light;
  --ink: #24222a;
  --muted: #6f6a78;
  --paper: #f4f2f7;
  --panel: #ffffff;
  --line: #ded9e8;
  --accent: #8a78b8;
  --accent-strong: #66548f;
  --accent-soft: #f0edf8;
  --warn: #8f3f24;
  --shadow: 0 18px 46px rgba(44, 37, 58, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
  color: var(--ink);
}

body.launch-locked .topbar,
body.launch-locked main {
  display: none;
}

body:not(.launch-locked) .launch-screen {
  display: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.compact-upload {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.primary:hover {
  background: var(--accent-strong);
}

.ghost,
.compact-upload {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.ghost:hover,
.compact-upload:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 120, 184, 0.18);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.launch-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.launch-panel {
  width: min(980px, 100%);
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 28px;
}

.launch-brand h1 {
  font-family: "Old English Text MT", "Blackadder ITC", "Goudy Old Style", Georgia, fantasy;
  font-size: 4rem;
  line-height: 0.85;
  color: var(--accent);
}

.launch-brand p {
  color: #3b3448;
  font-family: "OCR A Std", "Andale Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.launch-production-picker {
  display: grid;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 8;
}

.brand h1 {
  font-family: "Old English Text MT", "Blackadder ITC", "Goudy Old Style", Georgia, fantasy;
  font-size: clamp(2.8rem, 5vw, 5.4rem);
  font-weight: 700;
  line-height: 0.82;
  color: var(--accent);
}

.brand p {
  margin-top: 6px;
  color: #3b3448;
  font-family: "OCR A Std", "Andale Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(0.72rem, 1.2vw, 1rem);
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions,
.button-row,
.empty-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row select {
  width: auto;
  min-width: 156px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

#api-status-label.connected {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: #d8d0ef;
}

#api-status-label.disconnected {
  background: #f9ebe7;
  color: var(--warn);
  border-color: #e8c0b5;
}

main {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 24px 28px;
}

.empty-production-panel {
  min-height: calc(100vh - 150px);
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
}

.empty-production-inner {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 36px;
  display: grid;
  justify-items: start;
  gap: 16px;
}

.empty-production-inner h2 {
  color: var(--accent-strong);
  font-size: 1.8rem;
}

.empty-production-inner p,
.panel-header p,
.help {
  color: var(--muted);
  font-size: 0.92rem;
}

body.has-production .empty-production-panel {
  display: none;
}

body:not(.has-production) .sidebar-menu,
body:not(.has-production) .main-panel,
body:not(.has-production) #save-production-btn {
  display: none;
}

.sidebar-menu {
  display: grid;
  align-content: start;
  gap: 12px;
}

.sidebar-menu {
  position: sticky;
  top: 132px;
  align-self: start;
}

.tabs {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.tab {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  justify-content: flex-start;
  width: 100%;
}

.tab.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #ded6f1;
}

.production-card,
.processor-card,
.main-panel,
.split-content article,
.status-grid div {
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
}

.production-card,
.processor-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
}

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

.status-grid div {
  min-height: 72px;
  padding: 13px;
  border-radius: 8px;
}

.status-grid strong {
  display: block;
  font-size: 1.55rem;
  color: var(--accent-strong);
}

.collab-admin-panel {
  display: grid;
  gap: 12px;
}

.workspace-status-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8f4ff;
}

.workspace-status-panel strong,
.workspace-status-panel span {
  display: block;
}

.workspace-status-panel strong {
  color: var(--accent-strong);
}

.workspace-status-panel span {
  color: var(--muted);
  font-size: 0.9rem;
}

#workspace-status-badge {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

#workspace-status-badge.ready {
  border-color: #d8d0ef;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

#workspace-status-badge.error {
  border-color: #e8c0b5;
  color: var(--warn);
  background: #f9ebe7;
}

.cloud-production-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.setup-checklist {
  display: grid;
  gap: 8px;
}

.setup-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}

.setup-step span {
  color: var(--muted);
  font-size: 0.88rem;
}

.setup-step.ready {
  border-color: #d8d0ef;
  background: var(--accent-soft);
}

.setup-step.error {
  border-color: #e8c0b5;
  background: #f9ebe7;
}

.advanced-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaff;
}

.advanced-settings summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-strong);
}

.advanced-settings[open] {
  display: grid;
  gap: 12px;
}

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

.collab-member-form button {
  align-self: end;
}

.status-grid span,
.meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.section-heading,
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.section-heading span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.upload-drop {
  min-height: 84px;
  border: 1px dashed #bcb2d8;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
  background: #fbfaff;
  cursor: pointer;
}

.upload-drop span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.upload-drop small {
  color: var(--muted);
  font-weight: 600;
}

.main-panel {
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
}

.tab-panel {
  display: none;
  min-height: calc(100vh - 158px);
  padding: 18px;
}

.tab-panel.active {
  display: grid;
  align-content: start;
  gap: 16px;
}

#script-text,
#notes-email {
  min-height: 260px;
  line-height: 1.5;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.stage-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.stage-wide {
  grid-column: 1 / -1;
}

.wide-button {
  width: 100%;
}

.inline-select {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
}

.inline-select select {
  min-width: 110px;
}

.stage-attendance-tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.stage-attendance-tab {
  background: white;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  min-height: 36px;
}

.stage-attendance-tab + .stage-attendance-tab {
  border-left: 1px solid var(--line);
}

.stage-attendance-tab.active {
  background: var(--accent);
  color: white;
}

.stage-conflict-sort {
  justify-content: flex-start;
}

.stage-file-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  padding-right: 4px;
}

.stage-file-group {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  padding: 6px 9px;
  text-transform: uppercase;
}

.stage-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 11px;
}

.file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 750;
  text-decoration: none;
}

.attendance-review-list {
  display: grid;
  gap: 10px;
}

.attendance-review-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaff;
  padding: 10px;
}

.attendance-status-choice.selected {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.hidden {
  display: none;
}

.script-source {
  margin-top: -4px;
}

.script-view-tabs {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.script-view-tab {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.script-view-tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.script-viewer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: 56vh;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.script-viewer.source-open {
  max-height: 30vh;
}

.script-line {
  display: grid;
  grid-template-columns: 54px minmax(260px, 1fr) 78px 78px 78px 78px 78px;
  gap: 10px;
  padding: 4px 10px;
  border-bottom: 1px solid #f1edf7;
  min-height: 28px;
  align-items: start;
  min-width: 920px;
}

.script-line-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 34px;
  background: #fbfaff;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.script-line:hover {
  background: var(--accent-soft);
}

.script-line-highlight {
  background: #fff !important;
  box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 999px rgba(138, 120, 184, 0.14);
}

.line-number {
  color: var(--muted);
  text-align: right;
  user-select: none;
}

.line-text {
  white-space: pre-wrap;
}

.line-cue-cell {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}

.line-cue-cell span {
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.script-pdf-viewer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-height: 62vh;
  overflow: hidden;
}

.pdf-shell {
  position: relative;
  height: 72vh;
  min-height: 520px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
}

.pdf-cue-gutter {
  background: var(--accent-soft);
  border-right: 1px solid var(--line);
  cursor: context-menu;
}

.pdf-sync-scroll-layer {
  position: absolute;
  inset: 0 0 0 18px;
  cursor: default;
}

.script-pdf-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.context-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  justify-content: flex-start;
  background: transparent;
  color: var(--ink);
}

.context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.split-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.split-content article {
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  box-shadow: none;
}

.compact-list,
.suggestion-list,
.table-list,
.document-output,
.timeline-list {
  display: grid;
  gap: 10px;
}

.empty,
.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfaff;
}

.item-row,
.suggestion-card,
.doc-section,
.table-row,
.cue-row,
.person-row,
.timeline-row,
.rehearsal-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.item-row strong,
.table-row strong {
  display: block;
  margin-bottom: 4px;
}

.suggestion-card {
  display: grid;
  gap: 10px;
}

.suggestion-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.suggestion-card h3 {
  font-size: 1rem;
}

.suggestion-location {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 4px 0 0;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-content: flex-start;
}

.suggestion-location:hover {
  color: var(--accent);
}

.script-jump {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-content: flex-start;
}

.script-jump:hover {
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.warn {
  background: #f9ebe7;
  color: var(--warn);
}

.evidence {
  color: #4b4655;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.doc-section h3 {
  color: var(--accent-strong);
  margin-bottom: 8px;
}

.doc-section ul {
  margin: 0;
  padding-left: 20px;
}

.table-row,
.cue-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.6fr) minmax(0, 1.6fr) minmax(90px, 0.5fr) auto;
  gap: 12px;
  align-items: start;
}

.person-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.1fr) minmax(160px, 1fr) minmax(130px, 0.7fr) auto;
  gap: 12px;
  align-items: start;
}

.design-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.design-grid {
  display: grid;
  gap: 12px;
}

.design-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.design-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.design-setDesign {
  border-left-color: #5d8f7b;
}

.design-setDressing {
  border-left-color: #b3884f;
}

.design-costumes {
  border-left-color: #b86f82;
}

.design-card-top,
.design-card-actions {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.design-card h4 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.design-card-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.design-field {
  border: 1px solid #eee8f6;
  border-radius: 7px;
  background: #fbfaff;
  padding: 9px;
  min-height: 68px;
}

.design-field span,
.design-attachments strong {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.design-field p {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.design-attachments {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.quick-change-field {
  display: grid;
  align-content: end;
  gap: 7px;
}

.quick-change-field input {
  width: auto;
  min-height: 22px;
  justify-self: start;
}

.quick-change-field[hidden] {
  display: none;
}

.attachment-links,
.attachment-list {
  display: grid;
  gap: 6px;
}

.attachment-links a {
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.attachment-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfaff;
}

.cue-row p {
  margin-top: 5px;
}

.site-map-pane {
  display: grid;
  gap: 10px;
}

.site-map-pane[hidden] {
  display: none;
}

.site-map-preview {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaff;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  cursor: zoom-in;
}

.site-map-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
}

.site-map-preview span {
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.fullscreen-preview {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(20, 18, 26, 0.86);
  padding: 24px;
  cursor: zoom-out;
}

.fullscreen-preview.hidden {
  display: none;
}

.fullscreen-preview-frame {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  width: min(1120px, 94vw);
  height: min(820px, 90vh);
  color: white;
}

.fullscreen-preview-frame h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.fullscreen-close {
  justify-self: end;
  background: white;
}

.fullscreen-preview img,
.fullscreen-preview iframe,
.fullscreen-file {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: white;
}

.fullscreen-preview img {
  object-fit: contain;
}

.fullscreen-file {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink);
}

.ghost.danger {
  color: #8d332d;
  border-color: #e1bcb8;
  background: #fff8f7;
}

.cue-actions {
  justify-content: flex-end;
}

.timeline-week {
  color: var(--accent-strong);
  margin-top: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.5fr) minmax(0, 1.2fr) auto;
  gap: 12px;
  align-items: start;
}

.timeline-date-label {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
}

.timeline-row p {
  margin-top: 5px;
}

.schedule-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.4fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: start;
}

.schedule-row p,
.person-row p {
  margin-top: 5px;
}

.rehearsal-banner {
  background: var(--accent-soft);
  border-color: #d8d0ef;
}

.rehearsal-control-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 0.7fr) minmax(260px, 1.2fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.break-panel {
  display: grid;
  grid-template-columns: auto minmax(82px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

#break-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: "OCR A Std", "Andale Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 1.05rem;
}

.rehearsal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.rehearsal-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  gap: 12px;
  padding: 14px;
  order: 1;
}

.rehearsal-wide {
  grid-column: 1 / -1;
}

.collapsible-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 1.1rem;
}

.attendance-panel.collapsed {
  order: 3;
  gap: 0;
  padding: 8px 10px;
  min-height: 0;
}

.attendance-panel:not(.collapsed) {
  order: 0;
}

.attendance-panel.collapsed .collapsible-heading {
  justify-content: flex-end;
}

.attendance-panel.collapsed h3 {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.attendance-list {
  display: grid;
  gap: 12px;
}

.attendance-group {
  display: grid;
  gap: 8px;
}

.attendance-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  color: var(--ink);
}

.attendance-row input {
  width: auto;
  margin-top: 4px;
}

.attendance-row small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-top: 3px;
}

.attendance-called {
  border-color: #9ed2af;
  background: #f1fbf4;
}

.attendance-conflict {
  border-color: #ddb0aa;
  background: #fff1ef;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(460px, calc(100vw - 36px));
  transform: translateY(140%);
  transition: transform 180ms ease;
  background: var(--ink);
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 30;
}

#toast.visible {
  transform: translateY(0);
}

.print-frame {
  position: fixed;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  width: min(620px, calc(100vw - 32px));
}

#new-production-dialog {
  width: min(980px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(36, 34, 42, 0.34);
  backdrop-filter: blur(3px);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.dialog-card textarea {
  min-height: 130px;
}

.new-production-card {
  max-height: calc(100vh - 42px);
  overflow: auto;
}

.new-production-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 16px;
}

.new-production-fields {
  display: grid;
  align-content: start;
  gap: 14px;
}

.new-production-calendar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaff;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.calendar-toolbar,
.new-calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-toolbar strong {
  font-size: 1rem;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.performance-dot {
  background: var(--accent);
}

.rehearsal-dot {
  background: #2e7d5b;
}

.calendar-help {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.new-calendar-weekdays,
.new-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.new-calendar-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.new-calendar-day {
  aspect-ratio: 1;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 42px;
  padding: 4px;
  position: relative;
}

.new-calendar-day:hover {
  border-color: var(--accent);
}

.new-calendar-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.new-calendar-day.performance {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.new-calendar-day.rehearsal {
  background: #ebf7f1;
  border-color: #2e7d5b;
  color: #1f6849;
}

.new-calendar-day.today::after {
  background: currentColor;
  border-radius: 999px;
  bottom: 5px;
  content: "";
  height: 4px;
  left: calc(50% - 2px);
  position: absolute;
  width: 4px;
}

.incident-dialog-card {
  max-height: calc(100vh - 42px);
  overflow: auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

code {
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 2px 5px;
}

@media (max-width: 1120px) {
  main {
    grid-template-columns: 230px minmax(0, 1fr);
  }

}

@media (max-width: 820px) {
  .topbar,
  .top-actions,
  .section-heading,
  .panel-header,
  .suggestion-top {
    align-items: stretch;
    flex-direction: column;
  }

  main {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .sidebar-menu {
    position: static;
  }

  .tabs,
  .split-content,
  .status-grid,
  .table-row,
  .cue-row,
  .person-row,
  .timeline-row,
  .schedule-row,
  .design-entry-grid,
  .design-card-fields,
  .stage-grid,
  .stage-file-row,
  .new-production-grid,
  .two-col,
  .cloud-production-grid,
  .break-panel,
  .rehearsal-control-panel,
  .rehearsal-grid,
  .collab-member-form {
    grid-template-columns: 1fr;
  }

  .design-card-top,
  .design-card-actions,
  .workspace-status-panel,
  .setup-step {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions button,
  .button-row button,
  .button-row .file-download,
  .button-row select,
  .compact-upload {
    width: 100%;
  }
}
