:root {
  color-scheme: light;
  --canvas: #edf1f7;
  --paper: #fff;
  --ink: #152038;
  --subtle: #526179;
  --hairline: #dce4ef;
  --tint: #f4f7fc;
  --indigo: #3639ad;
  --indigo-dark: #28298a;
  --selection: #eeefff;
  --warning-bg: #fff4d7;
  --warning-ink: #77420a;
  --danger: #a32140;
  --radius: 16px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
button, input, select { min-height: 36px; }
button, input, select { border-radius: 8px; }
input, select { border: 1px solid #cbd6e5; background: var(--paper); padding: 8px 11px; }
input[type=checkbox] { min-height: auto; width: 15px; height: 15px; accent-color: var(--indigo); }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #6667df; outline-offset: 3px;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 2.25vw, 2.05rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 1.12rem; letter-spacing: -.02em; }
small { color: var(--subtle); }
.button, .primary, .quiet, .icon, .text-button, .pill {
  border: 1px solid transparent; background: transparent; padding: 7px 12px; font-weight: 650;
}
.button { background: var(--paper); border-color: #cbd6e5; white-space: nowrap; }
.button:hover:enabled, .icon:hover:enabled, .quiet:hover:enabled { background: var(--tint); }
.primary { background: var(--indigo); color: white; border-color: var(--indigo); white-space: nowrap; }
.primary:hover:enabled { background: var(--indigo-dark); }
.quiet { color: #384967; white-space: nowrap; }
.icon { border-color: #cbd6e5; background: var(--paper); width: 34px; min-width: 34px; min-height: 34px; padding: 0; font-size: 1.15rem; }
.icon.muted { border-color: transparent; color: var(--subtle); }
.danger { color: var(--danger); }
.text-button { text-align: left; min-height: 0; padding: 0; border: 0; border-radius: 3px; }
.text-button:hover { color: var(--indigo); text-decoration: underline; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px;
  background: var(--indigo); color: white; border-radius: 13px; font-size: 1.45rem; font-weight: 750;
}
.topbar, .projectbar, .statusbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.topbar { background: var(--paper); min-height: 72px; border-bottom: 1px solid var(--hairline); padding: 12px 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 1.24rem; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 2px; font-size: .79rem; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .primary span { margin-right: 5px; }
.projectbar { min-height: 53px; padding: 8px 24px; background: #e6ecf5; border-bottom: 1px solid #d5dfed; }
.project-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.project-name strong { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.project-icon { color: var(--indigo); font-size: 1.2rem; }
.modified { font-size: .72rem; color: var(--indigo-dark); padding: 3px 6px; background: var(--selection); border-radius: 6px; }
.workspace {
  display: grid; grid-template-columns: minmax(194px, .75fr) minmax(430px, 2.3fr) minmax(246px, 1fr);
  gap: 13px; padding: 16px; height: calc(100dvh - 163px); min-height: 555px;
}
.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--paper); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 17px 15px 11px; }
.panel-head small { display: block; padding-top: 3px; font-size: .76rem; }
.catalog .search, .bouquets .search, .catalog select { width: calc(100% - 30px); margin: 0 15px 10px; }
.search { padding-inline-start: 11px; background: #fcfdff; }
.tabs { display: flex; align-items: center; gap: 5px; margin: 0 15px 11px; }
.tabs button { min-height: 29px; padding: 4px 11px; background: var(--tint); border: 1px solid var(--hairline); font-size: .81rem; font-weight: 650; }
.tabs button[aria-pressed=true] { border-color: #d9dbfe; color: var(--indigo-dark); background: var(--selection); }
.bouquet-list, .catalog-list, .table-wrap { min-height: 0; overflow: auto; scrollbar-color: #b1bdd0 transparent; scrollbar-width: thin; }
.bouquet-list { padding: 2px 8px 12px; }
.bouquet-item {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) max-content; gap: 7px; align-items: center;
  text-align: left; width: 100%; background: transparent; border: 1px solid transparent;
  padding: 8px 7px; margin: 2px 0; min-height: 40px;
}
.bouquet-item:hover { background: var(--tint); }
.bouquet-item[aria-current=true] { color: #262878; background: var(--selection); border-color: #dce0ff; font-weight: 700; }
.grip { color: #63728b; font-size: 1.14rem; cursor: grab; line-height: 1; user-select: none; }
.grip:active { cursor: grabbing; }
.count { font-variant-numeric: tabular-nums; font-size: .74rem; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.editor { overflow: hidden; }
#active-editor { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.editor-title { display: flex; align-items: center; justify-content: space-between; padding: 20px 19px 13px; gap: 10px; }
.editor-title h1 { overflow-wrap: anywhere; }
.editor-title p { margin-top: 5px; color: var(--subtle); font-size: .9rem; }
.notice { display: flex; gap: 8px; align-items: center; padding: 9px 10px 9px 13px; margin: 0 15px 10px; border: 1px solid #f1d89c; border-radius: 10px; color: var(--warning-ink); background: var(--warning-bg); }
.notice div { min-width: 0; flex: 1; }
.notice strong, .notice small { display: block; }
.notice small { color: var(--warning-ink); margin-top: 2px; font-size: .74rem; }
.notice button { min-height: 32px; }
.editor-tools { display: flex; gap: 8px; padding: 0 15px 10px; align-items: center; }
.editor-tools input { flex: 1; min-width: 0; }
.selection { display: flex; align-items: center; padding: 4px 14px; gap: 5px; background: var(--selection); font-size: .85rem; }
.selection span { flex: 1; }
.table-wrap { flex: 1; padding: 0 10px 8px; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th { position: sticky; z-index: 1; top: 0; text-align: left; background: #eef2f8; padding: 9px 7px; color: #40506b; font-weight: 700; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 6px 7px; border-bottom: 1px solid #e8edf5; height: 51px; }
tr:hover td { background: #f8faff; }
tr.marked td { background: #f4f4ff; }
.handle-cell { width: 45px; white-space: nowrap; }
.handle-cell .grip { margin-right: 4px; display: inline-block; vertical-align: middle; }
.handle-cell input { vertical-align: middle; margin-inline: 0; }
.channel-name { min-width: 125px; }
.channel-name small { display: block; font-size: .71rem; margin-top: 1px; }
.type-cell { color: #435573; font-size: .8rem; }
.row-actions { text-align: right; white-space: nowrap; width: 72px; }
.row-actions .icon { width: 27px; min-width: 27px; min-height: 28px; font-size: .94rem; }
.icon.play { border-color: transparent; color: var(--indigo); }
.pill { display: inline-block; font-size: .71rem; font-weight: 700; padding: 4px 5px; white-space: nowrap; border-radius: 5px; min-height: 0; }
.warning { background: var(--warning-bg); color: var(--warning-ink); }
.neutral { background: var(--tint); color: #445779; }
.dash { color: var(--subtle); }
.catalog-list { padding: 0 10px 10px; flex: 1; }
.catalog-item { display: flex; align-items: center; gap: 7px; border: 1px solid #e1e8f1; padding: 7px 8px; border-radius: 9px; min-height: 55px; margin-bottom: 5px; }
.catalog-item:hover { border-color: #c3ccf1; background: #fbfcff; }
.catalog-item .icon { width: 30px; min-width: 30px; min-height: 30px; }
.catalog-text { flex: 1; min-width: 0; }
.catalog-text strong { font-size: .88rem; }
.catalog-text small { display: block; font-size: .73rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.more { align-self: center; margin: 0 0 8px; }
.empty-editor { margin: auto; width: min(94%, 520px); text-align: center; padding: 24px; }
.empty-editor p { color: var(--subtle); line-height: 1.5; margin-top: 8px; }
.empty-symbol { display: grid; place-items: center; width: 58px; height: 58px; color: var(--indigo); background: var(--selection); border-radius: 18px; font-size: 1.8rem; margin: 0 auto 15px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 19px; }
.drop-hint { color: var(--subtle); font-size: .8rem; margin-top: 17px; }
.inline-empty { text-align: center; color: var(--subtle); padding: 16px 8px; font-size: .85rem; }
.receiving-file { outline: 2px dashed var(--indigo); outline-offset: -6px; }
.drop-target { outline: 2px solid #7374da; outline-offset: -2px; background: var(--selection) !important; }
.statusbar { min-height: 37px; padding: 4px 23px 10px; color: #465777; font-size: .8rem; }
.statusbar > span:last-child { white-space: nowrap; }
dialog { width: min(640px, calc(100vw - 28px)); max-height: 86dvh; border: 1px solid var(--hairline); border-radius: 15px; padding: 0; color: var(--ink); box-shadow: 0 20px 65px #18285830; }
dialog::backdrop { background: #17213d65; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; gap: 8px; padding: 13px 15px; }
.dialog-heading { justify-content: space-between; border-bottom: 1px solid var(--hairline); }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--hairline); background: var(--tint); }
.dialog-body { display: grid; gap: 11px; padding: 15px; }
.field { display: grid; gap: 5px; font-weight: 650; font-size: .9rem; min-width: 0; }
.field select, .field input { width: 100%; }
.technical { color: var(--subtle); }
.technical label { margin-top: 9px; }
.detail-line { line-height: 1.5; color: var(--subtle); }
.review-list { display: grid; gap: 5px; max-height: 52dvh; overflow: auto; }
.review-row { display: flex; align-items: center; gap: 9px; padding: 8px 4px; border-bottom: 1px solid var(--hairline); }
.review-row > div { flex: 1; min-width: 0; }
.review-row small { display: block; margin-top: 4px; }
.login-layout { display: grid; min-height: 100dvh; place-items: center; padding: 16px; }
.login-card { display: grid; gap: 12px; width: min(100%, 410px); padding: 25px; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); }
.login-card p { color: var(--subtle); }
.login-card label { font-weight: 650; }
.form-error { color: var(--danger) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 930px) {
  .workspace { grid-template-columns: minmax(158px, .7fr) minmax(350px, 2fr); height: auto; }
  .bouquets, .editor { min-height: 570px; max-height: 76dvh; }
  .catalog { grid-column: 1 / -1; height: 390px; }
}
@media (max-width: 580px) {
  .topbar, .projectbar { padding: 8px 10px; flex-wrap: wrap; }
  .projectbar .top-actions { flex-wrap: wrap; gap: 0; }
  .workspace { display: flex; flex-direction: column; padding: 8px; }
  .bouquets { min-height: 155px; max-height: 250px; }
  .editor { min-height: 420px; }
  .catalog { height: 385px; }
  .editor-title { padding: 14px 10px; }
  .table-wrap { padding-inline: 4px; }
  th, td { padding-inline: 4px; }
  .row-actions { width: auto; }
  .notice { margin-inline: 7px; }
  .notice button { padding-inline: 6px; }
  .statusbar { flex-wrap: wrap; }
}
.current { background: #e6f4eb; color: #226141; }
