:root {
  --ink: #192d26;
  --muted: #65736d;
  --line: #dce3df;
  --green: #1c6749;
  --time-duration: #78409a;
  --surface: #f5f7f5;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
summary {
  cursor: pointer;
  touch-action: manipulation;
}
button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 13px;
  min-height: 44px;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover {
  background: #edf3ef;
}
button:active {
  background: #e1eae4;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #398961;
  outline-offset: 2px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #c5d0c9;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-height: 44px;
}
textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}
a {
  color: #21674b;
}
small,
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.primary,
.go {
  background: #1b6648;
  color: #fff;
  border-color: #1b6648;
}
.primary:hover,
.go:hover {
  background: #145136;
}
.danger {
  color: #ad342d;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.workspace {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  gap: 8px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
}
.brand b {
  width: 32px;
  height: 32px;
  background: #173f30;
  color: white;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.topbar h1 {
  font-size: 20px;
  font-weight: 650;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-pill {
  font-size: 12px;
  color: var(--green);
  white-space: nowrap;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 6px;
}
.offline {
  color: #a46511;
}
.main-menu {
  position: relative;
}
.main-menu summary {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 10px 14px;
  min-height: 44px;
  white-space: nowrap;
}
.main-menu summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: 50px;
  width: 210px;
  background: white;
  padding: 8px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 45px #172d2625;
  z-index: 30;
}
.menu-panel button {
  text-align: left;
  border: 0;
}
.menu-panel small {
  padding: 10px;
}
.livebar {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #e9f2eb;
  border: 1px solid #d0dfd4;
  border-radius: 12px;
  padding: 8px 12px;
  flex-shrink: 0;
}
.current {
  min-width: 0;
  flex: 1;
}
.current strong {
  display: block;
  font-size: 21px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-label {
  font-size: 12px;
  color: #326345;
}
.compact-clock {
  min-width: 105px;
  border-left: 1px solid #c6d8cc;
  padding-left: 20px;
}
.compact-clock strong {
  display: block;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.compact-clock small {
  display: block;
  font-size: 11px;
}
.compact-clock .late {
  color: #b53b2b;
}
.up-next {
  display: flex;
  flex-direction: column;
  max-width: 220px;
  min-width: 110px;
  font-size: 15px;
}
.up-next span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.segments {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e9eeea;
  flex-shrink: 0;
}
.segments button {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 7px 14px;
}
.segments button.selected {
  background: white;
  box-shadow: 0 1px 5px #20392918;
}
.toolbar-tools {
  display: flex;
  gap: 6px;
  overflow: auto;
  align-items: center;
}
.toolbar-tools button {
  font-size: 14px;
  padding: 8px 11px;
  flex-shrink: 0;
}
.table-wrap {
  flex: 1;
  min-height: 140px;
  overflow: auto;
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.rundown {
  border-spacing: 0;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  font-size: 17px;
  line-height: 1.55;
}
.rundown th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f0f3f0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  border-bottom: 1px solid #ccd6cf;
  padding: 8px 10px;
}
.rundown th.title-head {
  left: 44px;
  z-index: 6;
}
.rundown th:first-child {
  left: 0;
  z-index: 6;
}
.rundown td {
  border-bottom: 1px solid #e0e6e1;
  padding: 8px 10px;
  vertical-align: top;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: inherit;
}
.rundown tr {
  background: #fff;
}
.rundown td.seq {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 44px;
  color: #657b6b;
  font-size: 13px;
  text-align: center;
}
.rundown td.title {
  position: sticky;
  left: 44px;
  z-index: 2;
  box-shadow: 1px 0 #d8e2da;
}
.rundown tr.live {
  background: #d7efbf;
}
.rundown tr.live td.seq {
  border-left: 4px solid #48a02f;
}
.rundown tr.standby {
  background: #ffeab1;
}
.rundown tr.standby td.seq {
  border-left: 4px solid #dd9e0c;
}
.rundown tr.done {
  background: #f2f4f2;
  color: #65716a;
}
.rundown tr.skipped {
  background: #f6f3ef;
  color: #7d7169;
}
.title-button,
.time-button {
  display: block;
  background: none;
  border: 0;
  text-align: left;
  padding: 0;
  white-space: normal;
  width: 100%;
  font-weight: 600;
  font-size: 18px;
  min-height: 44px;
}
.time-button {
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.time-button span {
  display: block;
}
.duration {
  font-size: 15px;
  color: var(--time-duration);
  font-weight: 600;
}
.time-button .duration {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid #ded1e8;
  border-radius: 6px;
  background: #eee7f4;
  color: #63347f;
  line-height: 1.4;
}
.cue-clock { color: inherit; }
.time-duration-label { color: var(--time-duration); }
.title-edit-icon { display: inline-block; margin-left: 6px; font-size: 15px; color: #50685a; font-weight: 400; }
.rundown .time-head, .rundown td.time, .rundown .time-button { text-align: center; }
.cue-end {
  font-size: 12px;
  white-space: nowrap;
}
.time-conflict {
  color: #b33b2e;
  font-size: 12px;
}
.badge {
  display: inline-block;
  border: 1px solid #cbd8ce;
  color: #556958;
  border-radius: 5px;
  padding: 2px 6px;
  margin-top: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.live .badge {
  background: #c1e8ac;
  color: #27551c;
  border-color: #a1cd89;
}
.standby .badge {
  background: #ffe092;
  color: #795207;
  border-color: #e2c36e;
}
.tiny {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.cell-edit {
  display: block;
  min-height: 44px;
  line-height: 1.5;
}
.cell-edit[role="button"] {
  cursor: text;
}
.cell-edit[role="button"]:hover {
  background: #17392306;
  border-radius: 5px;
}
.row-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 170px;
}
.row-tools button {
  font-size: 13px;
  padding: 7px 10px;
  min-width: 40px;
}
.drag-handle {
  display: block;
  margin: 0 auto;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 26px;
  touch-action: none;
  cursor: grab;
  min-width: 32px;
}
.column-handle {
  border: 0;
  background: transparent;
  padding: 0 8px;
  min-height: 30px;
  text-align: center;
  width: 100%;
  font-size: 14px;
  touch-action: none;
  cursor: grab;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resize {
  position: absolute;
  right: -6px;
  top: 0;
  bottom: 0;
  width: 18px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  z-index: 8;
}
.resize:after {
  content: "";
  display: block;
  position: absolute;
  left: 8px;
  top: 15px;
  bottom: 15px;
  width: 2px;
  background: #bdcdc0;
}
.resize:hover {
  background: #25664420;
}
.large .rundown {
  font-size: 21px;
}
.large .title-button {
  font-size: 22px;
}
.large .time-button {
  font-size: 21px;
}
.large .rundown td {
  padding-top: 12px;
  padding-bottom: 12px;
}
.footnote {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 6px;
}
.footnote i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 3px;
}
.live-dot {
  background: #53a537;
}
.standby-dot {
  background: #e2aa24;
}
.offline-banner {
  background: #fff0cd;
  color: #845618;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  flex-shrink: 0;
}
.workspace:has(.card) {
  height: auto;
  min-height: 100dvh;
  padding-bottom: 24px;
}
.card h2 {
  font-size: 21px;
  margin-bottom: 12px;
}
.card p {
  line-height: 1.7;
  margin-bottom: 15px;
}
.card .toolbar {
  margin-bottom: 15px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field {
  display: block;
  margin: 14px 0;
}
.field span {
  display: block;
  font-size: 14px;
  margin-bottom: 7px;
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 10px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  min-height: 35px;
}
.check input,
[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.member {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.member small {
  display: block;
}
.history-item {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.history-item pre {
  white-space: pre-wrap;
  font: 14px/1.7 inherit;
  color: var(--muted);
}
dialog {
  max-width: 760px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  color: var(--ink);
  box-shadow: 0 24px 80px #102c2833;
}
dialog::backdrop {
  background: #10282360;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 23px;
  margin-bottom: 12px;
}
dialog .muted {
  font-size: 14px;
  margin-bottom: 15px;
}
.column-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.column-setting input:not([type="checkbox"]) {
  flex: 1;
  min-width: 0;
}
.mapping-list {
  max-height: 32vh;
  overflow: auto;
  padding: 0 8px 0 0;
}
.mapping-row {
  display: grid;
  grid-template-columns: 24px minmax(70px, 1fr) 20px minmax(130px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.preview-table {
  max-height: 260px;
  overflow: auto;
  margin-top: 12px;
}
.preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.preview-table td,
.preview-table th {
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
}
.import-errors {
  background: #fff0ed;
  color: #a93424;
  border-radius: 10px;
  padding: 12px;
}
.template-link {
  display: inline-block;
  margin: 8px 0;
}
.auth {
  max-width: 470px;
  margin: 10vh auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
}
.auth h1 {
  font-size: 26px;
  margin: 20px 0 12px;
}
.auth p {
  margin-bottom: 20px;
  line-height: 1.7;
}
.auth button {
  width: 100%;
  margin-top: 12px;
}
.auth .eyebrow {
  font-size: 12px;
  margin-top: 15px;
  color: var(--muted);
}
.code {
  font-size: 26px;
  word-break: break-all;
  letter-spacing: 3px;
  background: #ecf3eb;
  padding: 20px;
}
.empty,
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #193a2c;
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  max-width: 90vw;
  z-index: 200;
  display: none;
  box-shadow: 0 10px 35px #0002;
}
.drag-preview {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  background: #fffef3f0;
  border: 1px solid #649572;
  border-radius: 12px;
  padding: 15px 22px;
  box-shadow: 0 15px 35px #132a3033;
  max-width: 320px;
  font-size: 18px;
  font-weight: 600;
  transform: rotate(-1deg);
}
.dragging {
  opacity: 0.35;
}
.drop-before td {
  box-shadow: inset 0 4px #328260 !important;
}
.drop-after td {
  box-shadow: inset 0 -4px #328260 !important;
}
.col-before {
  box-shadow: inset 4px 0 #328260;
}
.col-after {
  box-shadow: inset -4px 0 #328260;
}
@media (max-width: 1000px) {
  .workspace {
    padding: 0 12px;
    gap: 10px;
  }
  .topbar {
    gap: 12px;
    min-height: 56px;
  }
  .topbar h1 {
    font-size: 18px;
  }
  .brand span {
    display: none;
  }
  .livebar {
    gap: 15px;
  }
  .up-next {
    max-width: 160px;
  }
  .toolbar-tools #follow {
    display: none;
  }
  .toolbar {
    align-items: flex-start;
  }
  .toolbar-tools {
    padding-bottom: 2px;
  }
}
@media (max-width: 700px) {
  .workspace {
    padding: 0 8px;
    gap: 8px;
  }
  .topbar {
    gap: 8px;
    min-height: 58px;
  }
  .status-pill {
    font-size: 0;
  }
  .status-pill .dot {
    width: 9px;
    height: 9px;
  }
  .topbar h1 {
    font-size: 16px;
  }
  .main-menu summary {
    padding: 9px;
  }
  .livebar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }
  .current {
    flex-basis: 55%;
  }
  .current strong {
    font-size: 18px;
  }
  .compact-clock {
    padding-left: 12px;
    min-width: 90px;
  }
  .compact-clock strong {
    font-size: 23px;
  }
  .up-next {
    flex: 1;
    max-width: none;
    min-width: 100px;
  }
  .livebar .row button {
    font-size: 13px;
    padding: 8px 10px;
  }
  .toolbar {
    flex-direction: column;
    gap: 6px;
  }
  .toolbar-tools {
    max-width: 100%;
    width: 100%;
  }
  .segments button {
    min-height: 44px;
  }
  .footnote {
    font-size: 10px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .rundown th.title-head,
  .rundown td.title {
    position: static;
  }
  .rundown th:first-child,
  .rundown td.seq {
    position: static;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .auth {
    margin: 5vh 12px;
  }
  .card {
    padding: 16px;
  }
  .member {
    flex-wrap: wrap;
  }
  dialog {
    padding: 18px;
  }
  .mapping-row {
    gap: 6px;
  }
}
/* Compact production table; touch targets remain 44 px. */
.rundown td + td { border-left: 1px solid #213c2d0b; }
.rundown td.seq { padding: 12px 4px 8px; }
.drag-handle span { display: block; font-size: 12px; line-height: 16px; }
.drag-handle span + span { font-size: 20px; }
.rundown th { padding: 5px 10px; }
.column-handle { min-height: 44px; }
.segments button { min-height: 44px; }
.title-button { line-height: 1.35; }
.badge { margin-top: 2px; padding: 1px 5px; }
.time-button { line-height: 1.4; }
.row-tools { flex-wrap: nowrap; }
.row-tools button { min-width: 44px; padding: 7px 8px; }
.rundown tr.live td { border-bottom-color: #b4d397; }
.rundown tr.standby td { border-bottom-color: #e8c96e; }
.personal-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.personal-scroll > .table-wrap { min-height: 200px; max-height: 65dvh; }
.focus-board { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.focus-card { border: 1px solid var(--line); border-top: 4px solid #becac1; background: #fff; border-radius: 12px; overflow: hidden; min-width: 0; }
.focus-live { border-color: #a1c786; border-top-color: #4c862c; background: #eff8e9; }
.focus-standby { border-color: #e0c47d; border-top-color: #c58b0a; background: #fff8e5; }
.focus-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 1px solid #253d2412; }
.focus-heading > div:first-child { min-width: 0; }
.focus-label { font-size: 13px; font-weight: 650; color: #546259; }
.focus-live .focus-label { color: #376620; }
.focus-standby .focus-label { color: #8a5b00; }
.focus-heading h2 { font-size: 23px; line-height: 1.35; letter-spacing: -.02em; overflow-wrap: anywhere; margin-top: 6px; }
.focus-clock { text-align: right; flex-shrink: 0; }
.focus-clock strong { display: block; font-size: 26px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.focus-clock small { display: block; font-size: 11px; }
.focus-clock .late { color: #b33b2e; }
.focus-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; padding: 16px; }
.focus-field-label { display: block; font-size: 13px; font-weight: 600; color: #59685d; margin-bottom: 5px; }
.focus-field .cell-edit { font-size: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.focus-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.focus-empty { padding: 16px; font-size: 16px; color: var(--muted); }
.other-standby { grid-column: 1 / -1; padding: 8px 12px; border-radius: 8px; background: #ffeab1; }
.personal-table-heading { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 16px 2px 10px; }
.personal-table-heading span { font-size: 13px; color: var(--muted); }
.focus-board.large .focus-heading h2 { font-size: 27px; }
.focus-board.large .cell-edit { font-size: 24px; }
@media (max-width: 1000px) {
  .focus-heading { flex-wrap: wrap; }
  .focus-clock { text-align: left; }
}
@media (max-width: 700px) {
  .focus-board { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .focus-heading { padding: 12px; }
  .focus-fields { padding: 12px; }
  .focus-heading h2 { font-size: 21px; }
  .focus-field .cell-edit { font-size: 18px; }
  .focus-actions { padding: 0 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .drag-preview {
    transform: none;
  }
}
@media (prefers-contrast: more) {
  :root {
    --muted: #34483b;
    --line: #7c9082;
  }
}

.sheet-notice { position: sticky; top: 0; z-index: 2; padding: 12px; background: #fff0cd; color: #845618; border-radius: 8px; margin-bottom: 12px; }

.duration-editor { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 12px 0 18px; }
.duration-editor legend { font-weight: 650; padding: 0 6px; }
.duration-parts { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.duration-parts input { width: 100%; font-size: 24px; font-variant-numeric: tabular-nums; }
.duration-shortcuts, .preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.duration-shortcuts button, .preset-buttons button { min-height: 44px; }
.company-presets { margin: 16px 0; padding: 12px; background: #f0f5f1; border-radius: 10px; }
.company-presets summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; }
.import-review { padding: 10px 0; border-bottom: 1px solid #c9895633; }
.import-warnings { background: #fff0cd; color: #684508; padding: 12px; border-radius: 8px; margin-bottom: 12px; }

.show-clocks { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; flex-shrink: 0; text-align: left; padding: 8px 0; }
.show-clock { min-width: 152px; padding: 10px 14px; border: 1px solid #d9e2dc; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px #183d2b08; }
.show-clock.current-clock { background: #edf6ef; border-color: #bad5c2; }
.show-clock:nth-child(2) { background: #eef3f9; border-color: #c7d6e7; }
.show-clock:nth-child(2) strong { color: #345a7d; }
.show-clock small { display: block; font-size: 13px; line-height: 1.5; color: var(--muted); white-space: nowrap; }
.show-clock strong { display: block; font-size: 25px; line-height: 1.25; font-variant-numeric: tabular-nums; font-weight: 650; }
.show-clock.current-clock strong { color: var(--green); }
@media (max-width: 1000px) {
  .show-clocks { gap: 12px; }
  .show-clock { min-width: 136px; padding: 9px 12px; }
  .show-clock small { font-size: 12px; }
  .show-clock strong { font-size: 23px; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; padding-top: 8px; gap: 4px 8px; }
  .topbar > :not(.show-clocks) { order: 0; }
  .show-clocks { order: 1; flex-basis: 100%; gap: 8px; }
  .show-clock { min-width: 0; padding: 9px 8px; border-radius: 10px; }
  .show-clock small { font-size: 11px; }
  .show-clock strong { font-size: 21px; }
}

@media (max-width: 360px) {
  .show-clocks { gap: 5px; }
  .show-clock { padding: 8px 5px; }
  .show-clock small { font-size: 10px; }
  .show-clock strong { font-size: 19px; }
}

.controls-collapsed .livebar, .controls-collapsed .toolbar { display: none; }
#controls-toggle { flex-shrink: 0; white-space: nowrap; min-height: 44px; font-size: 13px; padding: 8px 10px; }
@media (max-width: 700px) { #controls-toggle { font-size: 12px; padding: 8px; } }

.column-filter { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; padding: 2px 0; }
.filter-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.column-filter > button { flex-shrink: 0; min-height: 40px; padding: 7px 12px; font-size: 13px; }
.column-checks { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.column-check { display: inline-flex; gap: 7px; align-items: center; min-height: 40px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 14px; cursor: pointer; flex-shrink: 0; }
.column-check:has(input:checked) { background: #eaf2ec; }
.column-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); cursor: pointer; }
.column-check:focus-within { outline: 2px solid var(--green); outline-offset: -2px; }
@media (max-width: 700px) {
  .column-filter { flex-wrap: wrap; gap: 6px; }
  .column-checks { flex-basis: 100%; }
  .column-check { font-size: 13px; min-height: 44px; padding: 6px 8px; }
}

.identity-menu { position: relative; flex-shrink: 0; }
.identity-menu summary { list-style: none; cursor: pointer; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.identity-menu summary::-webkit-details-marker { display: none; }
.identity-name { display: block; font-size: 13px; font-weight: 650; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-role { display: block; font-size: 11px; color: var(--muted); }
.identity-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; max-width: calc(100vw - 24px); padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 12px 45px #172d2625; z-index: 31; font-size: 14px; overflow-wrap: anywhere; }
.identity-panel p { margin-top: 10px; line-height: 1.5; }
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; padding-top: 8px; }
  .topbar > :not(.show-clocks) { order: 0; }
  .show-clocks { order: 1; flex-basis: 100%; }
  .show-clock { min-width: 0; }
}
@media (max-width: 700px) {
  .topbar .brand, .topbar h1 { order: -1; }
  .topbar h1 { flex-basis: calc(100% - 48px); }
  .identity-menu { margin-left: auto; }
  .identity-menu summary { padding: 5px 10px; }
  .identity-panel { right: -60px; }
}

.note-placeholder { color: var(--green); font-size: 15px; }
#field-value { font-size: 18px; min-height: 200px; }
#note-conflict { margin-top: 16px; padding: 14px; background: #fff5df; border: 1px solid #d8b96e; border-radius: 10px; }
#note-conflict pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0; }

.done-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #aab5ad; }
#company-full { margin: 12px 0; }
.column-checks { flex-wrap: wrap; overflow-y: auto; max-height: 132px; }
@media (max-width: 700px) { .column-checks { flex-wrap: nowrap; max-height: none; } }

.audio-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.audio-tools span { font-size: 14px; color: var(--muted); }

#field-form:has(#add-music) #field-value { min-height: 300px; }

.column-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.column-tools button { min-height: 40px; padding: 7px 12px; font-size: 13px; }
.edit-columns-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 13px; cursor: pointer; }
.edit-columns-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.editing-columns { flex-wrap: wrap; padding: 8px; background: #f0f5f1; border: 1px solid #b9cdbf; border-radius: 10px; }
.editing-columns .column-tools, .editing-columns .column-checks { flex-basis: 100%; }
.column-tools small { color: var(--muted); }
.column-count { font-size: 12px; color: var(--muted); white-space: nowrap; }

.host-reader { height: 100dvh; display: flex; flex-direction: column; background: #f2f5f2; padding: 16px 24px 10px; gap: 14px; overflow: hidden; }
.host-reader-header { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.host-reader-header > div { flex: 1; min-width: 0; }
.host-eyebrow { color: #596f63; font-size: 13px; margin-bottom: 4px; }
.host-reader h1 { font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.host-wall-clock { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.host-reader-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.host-follow { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 650; white-space: nowrap; }
.host-follow input { width: 20px; height: 20px; accent-color: var(--green); }
#host-select { flex: 1; min-width: 140px; width: 0; max-width: 440px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.host-font-tools { display: flex; gap: 6px; margin-left: auto; }
.host-script-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); background: white; border-radius: 14px; }
.host-script-page { max-width: 1080px; margin: auto; padding: 40px 48px 60px; }
.host-script-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 28px; }
.host-script-heading h2 { width: 100%; font-size: 30px; line-height: 1.5; overflow-wrap: anywhere; }
.host-script-state { font-size: 14px; font-weight: 650; color: #506359; }
.host-script-state.live { color: #1c6749; }
.host-script-position { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.host-script-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; color: #20362b; letter-spacing: .025em; }
.host-next-title { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 16px; color: #52665b; }
.host-reader-foot { display: flex; justify-content: space-between; gap: 10px; color: #596f63; font-size: 12px; flex-shrink: 0; }
@media (max-width: 700px) {
  .host-reader { padding: 10px; gap: 8px; }
  .host-reader-header { flex-wrap: wrap; gap: 8px 12px; }
  .host-reader-header > div { flex-basis: calc(100% - 80px); }
  .host-wall-clock { font-size: 18px; }
  .host-reader-tools { gap: 6px; }
  #host-select { order: 1; flex-basis: 100%; max-width: none; }
  .host-font-tools { width: 100%; justify-content: flex-end; }
  .host-script-page { padding: 24px 18px 40px; }
  .host-script-heading h2 { font-size: 24px; }
  .host-reader-foot { flex-wrap: wrap; }
}
.column-check label { cursor: pointer; }
.column-check input.column-name-input { width: 158px; height: 36px; min-height: 36px; padding: 5px 8px; border: 1px solid #acbfb3; background: white; border-radius: 6px; cursor: text; font-size: 14px; }
.quick-column-handle { touch-action: none; user-select: none; cursor: grab; min-width: 28px; min-height: 36px; padding: 3px; border: 0; background: transparent; }
.quick-column-handle:active { cursor: grabbing; background: #d8e7dc; }
.column-check.col-before { box-shadow: inset 3px 0 var(--green); }
.column-check.col-after { box-shadow: inset -3px 0 var(--green); }
.column-check.dragging { opacity: .45; }
@media (max-width: 700px) { .column-tools { flex-shrink: 1; } }

.editing-columns { padding: 12px; gap: 10px; background: #f7faf8; border-color: #b8cbbf; box-shadow: 0 2px 8px #192d2608; }
.editing-columns .column-tools { padding-bottom: 10px; border-bottom: 1px solid #dce6df; }
.editing-columns .edit-columns-toggle { font-weight: 650; }
.editing-columns .column-check { background: #fff; border: 1px solid #dce6df; padding: 4px 8px; gap: 6px; }
.editing-columns .column-check:has(input[type=checkbox]:checked) { border-color: #abc7b5; }
.editing-columns .column-checks { max-height: 174px; align-items: stretch; padding: 2px; }
.draft-status { font-size: 12px; font-weight: 600; color: #785414; background: #fff3d8; padding: 5px 9px; border-radius: 6px; }
.quick-column-handle { min-width: 36px; min-height: 44px; }
.column-name-input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.column-help { width: 100%; font-size: 13px; }
.column-help summary { min-height: 32px; padding: 6px 0; font-weight: 600; }
.column-help dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; margin: 8px 0; max-height: 200px; overflow: auto; padding: 8px; background: white; border-radius: 8px; }
.column-help dt { font-weight: 650; margin-bottom: 4px; }
.column-help dd { margin: 0; line-height: 1.6; color: #4d6157; }
@media (max-width: 700px) {
  .editing-columns .column-checks { flex-wrap: wrap; max-height: 205px; }
  .editing-columns .column-check { width: 100%; }
  .editing-columns .column-name-input { flex: 1; min-width: 0; max-width: calc(100% - 66px); }
  .column-tools small { flex-basis: 100%; line-height: 1.5; }
}

.remove-column { min-height: 36px; padding: 5px 9px; color: #904643; background: #fff8f7; border-color: #e7cfcb; font-size: 13px; }
.removed-columns { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; }
.removed-columns summary { cursor: pointer; padding: 6px 0; }
.removed-columns p { color: var(--muted); margin: 8px 0; }
.removed-columns > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }

.rundown th[data-column="section"] { padding-left: 6px; padding-right: 6px; }

.rundown th[data-column="section"] .column-handle { padding: 0; white-space: normal; line-height: 1.3; }

.rundown .column-handle { padding: 0 2px; white-space: normal; line-height: 1.3; overflow-wrap: anywhere; }
#auto-column-widths[aria-pressed="true"] { color: var(--green); background: #e8f1eb; border-color: #b7cdbf; }

.rundown .column-handle { position: relative; }
.rundown .column-handle::before { content: "⠿"; position: absolute; left: -7px; top: 50%; transform: translateY(-50%); font-size: 11px; opacity: .45; }

/* Tight working columns: preserve type size and remove horizontal padding. */
.rundown th, .rundown td, .rundown th[data-column="section"] { padding-left: 4px; padding-right: 4px; }
.rundown td.seq { padding-left: 2px; padding-right: 2px; }
.rundown .row-tools { flex-wrap: wrap; gap: 2px; }
.rundown .row-tools button { padding-left: 6px; padding-right: 6px; }
.title-edit-icon { margin-left: 3px; }

.execution-summary { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font-size: 15px; line-height: 1.45; color: #30463b; }
.execution-delta { display: inline-block; padding: 2px 7px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.execution-delta.over { color: #963d35; background: #f7e7e4; }
.execution-delta.under { color: #176451; background: #d9efe5; }
.execution-delta.neutral { color: #4b6256; background: #e7ede9; }
.execution-skipped { font-size: 15px; color: #647067; }

.pre-go { color: #624b17; background: #f5eedc; border-color: #d9c998; font-weight: 600; }
.pre-go:hover { background: #eee1ba; }

.note-entry { display: block; }
.note-entry + .note-entry { margin-top: 8px; padding-top: 6px; border-top: 1px solid #d7dfd9; }
.note-scope { display: block; font-size: 12px; color: #446657; margin-bottom: 2px; font-weight: 600; }
.note-scope.private { color: #70448b; }
.note-context { padding: 12px 14px; margin-bottom: 14px; border-radius: 8px; background: #eef3f0; }
.note-context p { white-space: pre-wrap; margin: 6px 0 0; }

.show-clock.current-clock strong.overdue { color: #bd3038; }

.start-comparison { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.planned-clock { display: inline-block; padding: 2px 4px; border: 1px solid #cddce8; border-radius: 5px; background: #e8f0f7; font-size: 11px; line-height: 1.4; color: #365975; white-space: nowrap; }
.start-comparison .execution-delta { font-size: 11px; line-height: 1.4; }

.test-badge { display: inline-block; padding: 4px 8px; border: 1px solid #e2cf9f; border-radius: 7px; background: #fbf3db; color: #745817; font-size: 12px; white-space: nowrap; }

.time-button .start-comparison .duration { margin-top: 0; }

/* Cloud project entrance; the rundown workspace retains its compact layout. */
.cloud-shell{max-width:1200px;margin:0 auto;padding:28px 24px 60px}.cloud-header,.cloud-toolbar{display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap}.cloud-header{border-bottom:1px solid #d9e2de;padding-bottom:22px;margin-bottom:34px}.cloud-shell>h1{font-size:32px;line-height:1.3;margin:0 0 12px;color:#183f32}.cloud-shell .cloud-toolbar{margin-bottom:20px}.cloud-shell small{color:#5a7168}.project-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));gap:20px}.project-card{margin:0;display:flex;flex-direction:column;gap:10px}.project-card h2{font-size:22px;line-height:1.5;overflow-wrap:anywhere}.project-card .row{margin-top:auto;flex-wrap:wrap}.cloud-login{max-width:560px;margin:40px auto}.cloud-login h2{font-size:26px}.cloud-login p{line-height:1.8;margin:20px 0}.cloud-shell #cloud-message,#cloud-form-error{color:#9c3434;white-space:pre-wrap}.cloud-shell .member{gap:16px}.cloud-shell .member small{display:block;overflow-wrap:anywhere}.cloud-shell button{min-height:44px}.cloud-shell .row{flex-wrap:wrap}@media(max-width:600px){.cloud-shell{padding:20px 16px 40px}.cloud-shell>h1{font-size:27px}.cloud-toolbar .row{width:100%}.cloud-shell .member{align-items:flex-start;flex-wrap:wrap}}
