.draft-workspace{background:var(--surface);border:1px solid var(--edge);border-radius:6px;overflow:hidden}
.draft-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 10px;background:var(--surface-raised);font-size:12px}
.draft-table-scroll{overflow-x:auto}.draft-table{width:100%;min-width:1524px;border-collapse:collapse;table-layout:fixed}
.draft-table th{font-size:12px;text-align:left;font-weight:500;padding:10px;border:1px solid var(--edge);color:var(--secondary)}

.draft-table td{border:1px solid var(--edge);padding:0;vertical-align:top;height:76px}.draft-table .is-selected td{background:var(--surface-raised)}
[data-theme] .draft-table :is(input,textarea){display:block;width:100%;min-width:0;border:0;border-radius:0;background:transparent;font-size:14px;line-height:1.5;padding:10px;box-sizing:border-box}
.draft-table textarea{min-height:76px;height:76px;resize:vertical}.draft-table input{height:42px}.draft-table input[type=number]{font-variant-numeric:tabular-nums}
.draft-table :is(input,textarea):focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
.draft-table .draft-fcl{font-size:12px;padding:10px;overflow-wrap:anywhere}.draft-fcl-hint{display:block;color:var(--secondary);font-size:12px;margin-top:3px}
.draft-fcl select{width:100%;font-size:12px;padding:5px;margin-top:6px;background:var(--surface);color:var(--ink)}
.draft-footer{color:var(--secondary);flex-wrap:wrap}.draft-footer [data-draft-total]{white-space:nowrap}
.package-workflow-actions{display:flex;gap:6px;align-items:center}.package-title-button{padding:0;border:0;background:transparent;text-align:left;color:inherit}
@media(max-width:640px),(pointer:coarse){[data-theme] .draft-table :is(input,textarea){font-size:16px;min-height:44px}.draft-table th:first-child,.draft-table td:first-child{position:sticky;left:0;z-index:1;background:var(--surface)}.draft-table .is-selected td:first-child{background:var(--surface-raised)}}

.workflow-short{display:none}
.draft-lesson-setup{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px;background:var(--surface-raised)}
.draft-lesson-setup span,.draft-lesson-setup small{display:block;margin-top:4px}.draft-lesson-setup small{color:var(--secondary);font-size:12px}
.draft-condition-toolbar,.draft-setup-heading,.draft-setup-actions,.draft-setup-tabs{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.draft-condition-toolbar{padding:10px 16px;font-size:13px}
.draft-setup-panel{padding:16px;border-block:1px solid var(--edge);background:var(--surface)}.draft-setup-tabs{justify-content:flex-start;margin-block:12px}.draft-setup-tabs [aria-pressed=true]{background:var(--hover)}
.draft-setup-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-block:12px}.draft-setup-fields label{display:block;min-width:0;font-size:12px;color:var(--secondary)}
[data-theme] .draft-setup-fields :is(input,select){display:block;width:100%;min-width:0;margin-top:5px;padding:8px;font-size:14px;background:var(--surface);color:var(--ink);border:1px solid var(--edge);border-radius:4px;min-height:38px}
.draft-setup-actions{justify-content:flex-start;margin-top:16px}.draft-setup-panel small{font-size:12px;color:var(--secondary)}.draft-setup-error{color:var(--ink);border-left:3px solid currentColor;padding-left:8px}
.draft-table .draft-condition-strip td{height:auto;padding:0;border-block:1px solid var(--edge)}.draft-condition-strip button{display:block;width:100%;min-height:36px;box-sizing:border-box;text-align:left;border:0;border-radius:0;font-size:12px;padding:8px 12px;white-space:normal}.draft-condition-strip--conditions td,.draft-condition-strip--conditions button{background:var(--atc-bg)}.draft-condition-strip--conditions td{border-inline-start:4px solid var(--atc)}.draft-condition-strip--conditions strong{color:var(--atc)}.draft-condition-strip--reposition td,.draft-condition-strip--reposition button{background:var(--warning-bg)}.draft-condition-strip--reposition td{border-inline-start:4px solid var(--warning-edge)}.draft-condition-strip--reposition strong{color:var(--warning-ink)}.draft-condition-strip button:hover{filter:brightness(.97)}:root[data-theme=dark] .draft-condition-strip button:hover{filter:brightness(1.12)}.draft-condition-strip button:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.draft-condition-strip small{color:var(--secondary)}
@media(max-width:640px){.draft-lesson-setup{align-items:flex-start;flex-wrap:wrap;padding:12px}.draft-setup-panel{padding:12px}.draft-setup-fields{grid-template-columns:repeat(2,minmax(0,1fr))}[data-theme] .draft-setup-fields :is(input,select){font-size:16px;min-height:44px}.draft-setup-tabs button,.draft-condition-toolbar button,.draft-setup-actions button,.draft-lesson-setup button{min-height:44px}.draft-table .draft-condition-strip td:first-child{position:static}}
@media(max-width:640px){.workflow-long{display:none}.workflow-short{display:inline}[data-theme] .topbar .workspace-toolbar-end .workflow-review{width:auto;min-width:58px;max-width:none;height:32px;min-height:32px;padding:4px 8px;white-space:nowrap}.topbar .package-title-button{max-width:100%}.topbar .package-title-button strong{display:block;font-size:14px!important;overflow:hidden;text-overflow:ellipsis}.topbar .package-title-button small{display:block}}

.lesson-tab{display:inline-flex;align-items:center;flex:none;min-width:0}.lesson-switcher .lesson-tab-menu{margin:0;padding:4px 7px;min-width:28px;min-height:40px;border:0;background:transparent;color:var(--secondary);border-radius:4px}.lesson-switcher .lesson-tab-menu:hover{background:var(--hover);color:var(--ink)}.lesson-option-actions{display:flex;flex-direction:column;align-items:stretch;gap:10px}.lesson-option-actions button{text-align:left;min-height:44px}@media(max-width:640px),(pointer:coarse){.lesson-switcher .lesson-tab-menu{min-width:44px;min-height:44px}}

.lesson-choice[hidden]{display:none!important}[data-theme] .lesson-tab-name{min-width:80px;max-width:260px;min-height:40px;padding:6px 10px;font:inherit;font-size:14px;color:var(--ink);background:var(--surface);border:1px solid var(--ui-focus);border-radius:3px}[data-theme] #modal.lesson-delete-dialog{width:360px;max-width:calc(100vw - 32px);min-width:0;height:max-content;min-height:0;max-height:calc(100dvh - 32px);margin:auto;padding:20px;box-sizing:border-box}[data-theme] #modal.lesson-delete-dialog h2{font-size:18px;margin:0 0 10px}[data-theme] #modal.lesson-delete-dialog p{font-size:14px;margin:8px 0}[data-theme] #modal.lesson-delete-dialog .actions{margin-top:16px;justify-content:flex-end}@media(max-width:640px),(pointer:coarse){[data-theme] .lesson-tab-name{min-height:44px;font-size:16px;max-width:210px}}

.draft-table td{position:relative}.draft-table td.remote-selection{box-shadow:inset 0 0 0 2px var(--collaborator)}.draft-table td.remote-edit{box-shadow:inset 4px 0 var(--collaborator);background:var(--surface-raised)}.draft-remote-label{position:absolute;right:2px;bottom:1px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:1px 4px;background:var(--surface);color:var(--ink);border:1px solid var(--collaborator);font-size:11px;pointer-events:none}

.draft-table td.remote-selection{outline:2px solid var(--collaborator);outline-offset:-2px;z-index:2}.draft-table td.remote-edit::after{content:"";position:absolute;inset:0;border-left:3px solid var(--collaborator);pointer-events:none;z-index:3}.draft-remote-label{z-index:4}.draft-table td:is(.remote-selection,.remote-edit) textarea{padding-bottom:28px}
/* Exercises sheet (redesign step 3): number chip, start time, M badge, FCL tags, WX and reposition rows. */
.draft-table th.draft-no,.draft-table td.draft-no{width:44px;text-align:center}
.draft-table th.draft-start,.draft-table td.draft-start{width:52px;font-variant-numeric:tabular-nums;color:var(--secondary);font-size:12px;text-align:center}
.draft-table th.draft-m,.draft-table td.draft-m{width:36px;text-align:center}
.draft-no-chip{display:inline-block;min-width:26px;padding:2px 5px;border-radius:999px;background:var(--navy);color:#fff;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums}
.draft-no-chip.sub{background:transparent;color:var(--navy);border:1px solid var(--navy)}
:root[data-theme=dark] .draft-no-chip{color:#0d1726}
:root[data-theme=dark] .draft-no-chip.sub{color:var(--navy)}
.draft-m-toggle{position:relative;display:inline-grid;place-items:center;width:24px;height:24px;cursor:pointer}
.draft-m-toggle input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
.draft-m-toggle span{display:grid;place-items:center;width:22px;height:22px;border-radius:4px;border:1px dashed var(--edge);color:var(--secondary);font-size:11px;font-weight:700}
.draft-m-toggle input:checked+span{background:var(--mandatory);border:1px solid var(--mandatory);color:#fff}
.draft-m-toggle input:focus-visible+span{outline:2px solid var(--ui-focus,#673580);outline-offset:2px}
.draft-m-toggle input:disabled+span{opacity:.35}
.draft-fcl-tags{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.fcl-tag{display:inline-block;background:var(--fcl-tag);color:var(--fcl-tag-ink);font-size:11px;font-weight:600;padding:1px 6px;border-radius:3px;font-variant-numeric:tabular-nums}
.draft-condition-strip--conditions td,.draft-condition-strip--conditions button{background:var(--wx-bar);color:var(--wx-ink)}
.draft-condition-strip--conditions td{border-inline-start:4px solid var(--wx-bar)}
.draft-condition-strip--conditions strong{color:var(--wx-ink)}
.draft-condition-strip--conditions small{color:#c9d1d9}
.draft-condition-strip--reposition td,.draft-condition-strip--reposition button{background:transparent}
.draft-condition-strip--reposition td{border-inline-start:0}
.draft-condition-strip--reposition button{display:inline-block;width:auto;margin:4px 0 4px 132px;border:1.5px dashed var(--warning-edge);border-radius:999px;padding:4px 12px;background:var(--warning-bg)}
@media(max-width:850px){.draft-condition-strip--reposition button{margin-left:8px}}
button.draft-no-chip{min-height:0;border:0;line-height:1.4;cursor:pointer;font-family:inherit}
button.draft-no-chip.sub{border:1px solid var(--navy)}
button.draft-no-chip:hover{filter:brightness(1.25)}
.draft-profile{margin-bottom:12px}
:root[data-theme] .draft-table button.draft-no-chip{display:inline-block;min-width:26px;min-height:0;padding:2px 6px;border-radius:999px;background:var(--navy);color:#fff;font-size:11px;font-weight:700;border:1px solid var(--navy)}
:root[data-theme] .draft-table button.draft-no-chip.sub{background:transparent;color:var(--navy)}
:root[data-theme=dark] .draft-table button.draft-no-chip{color:#0d1726}
:root[data-theme=dark] .draft-table button.draft-no-chip.sub{color:var(--navy)}

/* Wide sheet scrolls sideways; #, Start and Exercise stay fixed on the left (phone: # and Exercise). */
.draft-table th.draft-title{width:240px}.draft-table th.draft-dur{width:70px}.draft-table th.draft-alt{width:90px}.draft-table th.draft-ms{width:220px}.draft-table th.draft-fcl-head{width:160px}.draft-table th.draft-allowed{width:132px}.draft-table th:nth-last-child(2){width:260px}
.draft-table :is(th,td):is(.draft-no,.draft-start,.draft-title){position:sticky;z-index:2;background:var(--surface)}
.draft-table :is(th,td).draft-no{left:0}.draft-table :is(th,td).draft-start{left:44px}.draft-table :is(th,td).draft-title{left:96px;box-shadow:4px 0 6px -4px rgba(0,0,0,.25)}
.draft-table .is-selected td:is(.draft-no,.draft-start,.draft-title){background:var(--surface-raised)}
.draft-table th.draft-title,.draft-table td.draft-title input{font-weight:600}
.draft-condition-strip td>*{position:sticky;left:0;max-width:calc(100vw - 48px)}
.draft-table td.draft-allowed{padding:8px 6px;text-align:center;white-space:nowrap}
.draft-mode-toggle{display:inline-flex;margin:2px;cursor:pointer}
.draft-mode-toggle input{position:absolute;opacity:0;width:1px;height:1px}
.draft-mode-toggle span{display:inline-block;min-width:24px;padding:3px 6px;border:1px solid var(--edge);border-radius:4px;font-size:11px;font-weight:700;color:var(--secondary);background:var(--surface)}
.draft-mode-toggle input:checked+span{background:var(--navy);border-color:var(--navy);color:#fff}
:root[data-theme=dark] .draft-mode-toggle input:checked+span{color:#0d1726}
.draft-mode-toggle input:focus-visible+span{outline:2px solid var(--ui-focus);outline-offset:1px}
@media(max-width:640px){.draft-table :is(th,td).draft-start{position:static}.draft-table :is(th,td).draft-title{left:44px}.draft-table th.draft-title{width:170px}}
/* Separate borders so the fixed columns carry their own borders while the rest scrolls underneath. */
.draft-table{border-collapse:separate;border-spacing:0}
.draft-table :is(th,td){border-width:0 1px 1px 0}
.draft-table tr>:first-child{border-left-width:1px}
.draft-table thead th{border-top-width:1px}
.draft-table th.draft-title{width:280px}
@media(max-width:640px){.draft-table th.draft-title{width:170px}}
/* Flight group rows: one card-style row where each flight starts (report flight cards). */
.draft-table tr.draft-flight-row td{height:auto;padding:0;border-left-width:1px;background:var(--flight-1-tint,#eef3fb)}
.draft-table tr.draft-flight-row.f2 td{background:var(--flight-2-tint,#f3eefa)}
.draft-flight-card{position:sticky;left:0;display:inline-flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding:8px 12px;max-width:calc(100vw - 48px);box-sizing:border-box;border-left:4px solid var(--flight-1,#1a4f9c)}
.f2 .draft-flight-card{border-left-color:var(--flight-2,#5a3592)}
.draft-flight-card b{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--flight-1,#1a4f9c)}
.f2 .draft-flight-card b{color:var(--flight-2,#5a3592)}
.draft-flight-card span{font-weight:600}
.draft-flight-card small{color:var(--secondary)}
/* Detail pane beside the Sheet; a bottom sheet on narrow screens. */
.sheet-layout.with-detail{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:12px;align-items:start}
.sheet-detail{position:sticky;top:8px;max-height:calc(100dvh - 16px);overflow:auto;background:var(--surface);border:1px solid var(--edge);border-radius:6px}
.sheet-detail .editor{position:static;max-height:none;border:0;box-shadow:none;width:auto}
.sheet-detail-context{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 10px;background:var(--surface-raised);border-bottom:1px solid var(--edge);font-size:13px}
.sheet-detail-flight{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--flight-1,#1a4f9c)}
.sheet-detail-flight.f2{color:var(--flight-2,#5a3592)}
.sheet-detail-time{color:var(--secondary);font-variant-numeric:tabular-nums}
.sheet-detail-actions{margin-left:auto;display:flex;gap:4px}
[data-theme] .sheet-detail-actions button{min-height:30px;padding:3px 10px;font-size:12px}
@media(max-width:1100px){.sheet-layout.with-detail{display:block}.sheet-detail{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:40;max-height:70dvh;border-radius:12px 12px 0 0;box-shadow:0 -8px 24px rgba(0,0,0,.2)}}
.sheet-layout.with-detail{grid-template-columns:minmax(0,1fr) 460px}
.sheet-detail .editor[data-editor-tab] .editor-content-columns{display:block;overflow:visible}
.sheet-detail .editor[data-editor-tab] .editor-content-columns>section+section{margin-top:16px}
@media(max-width:1100px){.sheet-layout.with-detail{display:block}}
[data-theme] .draft-footer .draft-fit{min-height:28px;padding:2px 10px;font-size:12px;margin-left:8px}
/* Dark theme: the light mandatory red needs dark text for 4.5:1 contrast. */
:root[data-theme=dark] .draft-m-toggle input:checked+span{color:#1b0b0b}
