body:has(#workspace:not([hidden])) .nav-work { display:none; }
body:has(#workspace:not([hidden])) main { padding-top:2rem; }
#workspace {
  display:grid; grid-template-columns:12.75rem minmax(0,1fr); grid-template-rows:max-content 1fr;
  gap:.8rem clamp(1.3rem,3vw,3rem); align-items:start;
}
.ws-sidebar { grid-column:1; grid-row:1; padding:1.05rem; background:#193d30; color:#fffef9; border-radius:1rem; }
.ws-rail-heading h1 { font-size:1.08rem; font-weight:650; letter-spacing:-.035em; margin:.25rem .5rem 1rem; }
.ws-rail-heading #new-draft { display:flex; align-items:center; justify-content:center; gap:.35rem; width:100%; background:var(--accent); color:#112f21; border:0; }
.ws-rail-heading #new-draft:hover { background:#c8ec65; }
.ws-nav { display:grid; gap:.18rem; margin-top:1rem; }
.ws-nav a { padding:.63rem .83rem; border-radius:.48rem; text-decoration:none; font-size:.93rem; font-weight:550; color:#e6ede2; }
.ws-nav a:hover { background:#2c4c3e; }
.ws-nav a[aria-current] { color:white; background:#365a46; box-shadow:inset 3px 0 var(--accent); }
.ws-content { container: workspace-content / inline-size; grid-column:2; grid-row:1 / 3; min-width:0; }
.ws-user { grid-column:1; grid-row:2; padding:.55rem .7rem; }
.ws-user p { overflow-wrap:anywhere; color:var(--muted); font-size:.83rem; margin:0; }
.ws-user button { font-size:.82rem; padding:.25rem 0; }
.ws-section-title, .ws-toolbar, .ws-storage { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.ws-view { background:#fffef9; padding:clamp(1.15rem,3.3vw,2.6rem); border:1px solid var(--line); border-radius:1rem; min-width:0; }
.ws-section-title { margin-bottom:1.5rem; }
.ws-section-title h2 { font-size:clamp(1.85rem,3.3vw,2.9rem); letter-spacing:-.06em; margin:0; }
.ws-secondary { color:var(--green); background:white; border-color:var(--line); font-size:.89rem; }
.ws-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.ws-toolbar { justify-content: flex-start; align-items: flex-end; margin-bottom: 1rem; }
.ws-toolbar label { margin: 0; min-width: min(100%,12rem); }
.ws-toolbar input, .ws-toolbar select { min-height: 2.85rem; }
.ws-posts, .ws-sequence { list-style: none; margin: 0; padding: 0; }
.ws-posts li { display: flex; justify-content:space-between;align-items:center; gap:1rem; padding:1rem 0;border-top:1px solid var(--line); }
.ws-posts li a { font-weight: 650; overflow-wrap: anywhere; }
.ws-posts small, .ws-meta { display: block; font-size: .83rem; color: var(--muted); }
.ws-state { border: 1px solid var(--line); background: var(--paper); border-radius: 2rem; padding:.15rem .7rem; font-size:.85rem; flex:none; }
.ws-state[data-state=failed] { background:#ffebe7; color:#712e20; }
.ws-state[data-state=awaiting_approval], .ws-state[data-state=published], .ws-state[data-state=landed_as_draft] { background:#e5f3ce; }
.ws-empty { color: var(--muted); padding: 1.6rem 0; margin: 0; }
.ws-composer, .ws-settings { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1rem,4vw,3rem); align-items: start; }
.ws-destination { border-radius: 12px; padding:1.25rem; background:var(--paper); }
.ws-field-title, .ws-destination h3, .ws-settings h3 { font-weight:650; font-size:1.15rem; margin-bottom:.45rem; }
.ws-file { position:relative; margin:0; cursor:pointer; }
.ws-file input[type=file] { opacity:0; position:absolute; inset:0; width:100%; height:100%; cursor:pointer; margin:0; padding:0; }
.ws-file:focus-within { outline:3px solid var(--green); outline-offset:2px; }
.ws-file:has(:disabled) { opacity:.6; }
.ws-sequence { margin: 1.2rem 0; display:grid; gap:.65rem; }
.ws-sequence li { display:grid; grid-template-columns:3.3rem minmax(0,1fr); align-items:center;column-gap:.75rem; padding:.5rem;border:1px solid var(--line);border-radius:.55rem; }
.ws-sequence li:has(> video) { grid-template-columns:minmax(0,1fr); gap:.65rem; }
.ws-sequence video { display:block; width:100%; height:auto; max-height:min(55vh,24rem); object-fit:contain; background:var(--ink); border-radius:.35rem; }
.ws-sequence img { width:3.3rem; height:3.6rem; object-fit:cover; border-radius:.35rem; }
.ws-sequence strong { display:block; font-size:.89rem; overflow-wrap:anywhere; }
.ws-item-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.ws-item-actions button { padding:.35rem .55rem; font-size:.85rem; }
.ws-sequence .ws-item-actions button { font-size:.8rem; border:0; text-decoration:underline; padding:.2rem .25rem; }
.ws-storage { align-items:center; justify-content:flex-start; margin-bottom:1.5rem; }
.ws-storage label { margin:0; font-size:.89rem;color:var(--muted); }
.ws-storage meter { height:.8rem; width:8rem; }
.ws-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,12.6rem),1fr));gap:.9rem; margin:1.4rem 0; }
.ws-media-card { border:1px solid var(--line);border-radius:.75rem;overflow:hidden; background:white; }
.ws-media-card>img, .ws-media-card>video { width:100%;height:9.5rem; object-fit:cover;display:block;background:var(--ink); }
.ws-card-info { padding:.7rem .85rem .85rem; }
.ws-card-info strong {overflow-wrap:anywhere; font-size:.96rem; }
.ws-card-info .ws-item-actions {margin-top:.7rem; }
.ws-settings { grid-template-columns:1fr 1fr; margin-bottom:2rem; }
#connections-view details { max-width:none;margin:0; }
#queue-count, #upload-status {margin:.6rem 0 0; }
#queue-count:empty, #upload-status:empty { display:none; }
#library-view #more-media { margin-top:.5rem; }
@media (max-width:700px) {
  .ws-composer, .ws-settings {grid-template-columns:minmax(0,1fr); }
  .ws-section-title, .ws-toolbar, .ws-storage {flex-wrap:wrap; gap:.6rem; }
  .ws-toolbar label { min-width:0; flex:1; }
  .ws-posts li {align-items:flex-start;flex-wrap:wrap;gap:.3rem; }
  .ws-settings section+section {border-top:1px solid var(--line);padding-top:1rem; }
}
#key-label { margin-top:1rem; padding:.85rem; background:var(--paper); border-radius:.55rem; }
#key-label label { margin-bottom:.4rem; }
@media (max-width:440px) {
  .ws-queue-actions { gap:.5rem; }
  .ws-queue-actions > * { display:inline-flex; align-items:center; min-height:44px; font-size:.85rem; }
  .ws-queue-actions :is(.button,button) { padding:.45rem; }
  #library-view .ws-toolbar { flex-direction:column; align-items:stretch; }
  #library-view .ws-toolbar .button { align-self:flex-start; }
}
#report-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
#report-table caption { text-align:left; margin-bottom:.5rem; }
#report-table th, #report-table td { padding:.65rem .35rem; border-bottom:1px solid var(--line); text-align:right; }
#report-table th:first-child { text-align:left; }
#report-table tbody th { font-weight:500; }
.ws-draft-block { border-top:1px solid var(--line); padding-top:1.7rem; margin-top:1.7rem; }
#draft-message { color:var(--muted); font-size:.88rem; }
#draft-conflict { margin-top:.7rem; }

.ws-queue-filters { display:flex; align-items:center; gap:.32rem; flex-wrap:wrap; padding-bottom:1.15rem; }
.ws-connect-prompt { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.75rem; padding:1rem; border-radius:.65rem; background:#e9efdf; margin-bottom:1rem; }
.ws-connect-prompt h3, .ws-connect-prompt p { margin:0; }
.ws-connect-prompt p { color:var(--muted); font-size:.92rem; }
.ws-connect-prompt a { max-width:100%; font-size:.87rem; }
.ws-queue-filters button, .ws-queue-filters select {
  font:inherit; font-size:.84rem; font-weight:550; line-height:1.3; margin:0; width:auto; min-height:2.35rem;
  border:1px solid var(--line); background:#fffef9; border-radius:2rem; color:var(--green); padding:.42rem .8rem;
}
.ws-queue-filters button[aria-pressed="true"], .ws-queue-filters select:has(option:checked:not([value=""])) { background:var(--green); border-color:var(--green); color:white; }
.ws-queue-filters button:hover { border-color:var(--green); }
.ws-queue-filters select { cursor:pointer; }
.ws-posts .ws-delivery { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.3rem 1rem; padding:1.05rem 0; }
.ws-delivery-body { min-width:0; }
.ws-posts .ws-post-title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:1rem; line-height:1.38; text-decoration:none; }
.ws-posts .ws-post-title:hover, .ws-posts .ws-post-title:focus-visible { text-decoration:underline; }
.ws-meta { margin-top:.23rem; }
.ws-posts .ws-provider-error { color:#873b2d; margin:.3rem 0 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ws-posts .ws-state { justify-self:start; white-space:nowrap; border-color:transparent; font-size:.76rem; font-weight:560; line-height:1.4; padding:.28rem .65rem; text-decoration:none; }
.ws-state[data-state="queued"], .ws-state[data-state="sent"] {color:#38566a; background:#eaf1f4;}
.ws-state[data-state="awaiting_approval"] {color:#714913; background:#fbedd0;}
.ws-posts a.ws-state:hover {text-decoration:underline;}
.ws-state[data-state="failed"] {background:#f9e8e0;}
.ws-week-bar { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1rem 1.25rem; border-radius:.8rem; background:#e9efdf; }
.ws-week-bar h3 { font-size:clamp(1.12rem,2.4vw,1.6rem); letter-spacing:-.045em; line-height:1.18; margin:0; }
.ws-week-actions { display:flex; align-items:center; gap:.25rem; }
.ws-week-actions button { background:#fffef9; border-color:#bac8b8; white-space:nowrap; line-height:1; min-height:2.4rem; padding:.5rem .65rem; font-size:.83rem; }
#calendar-prev, #calendar-next { font-size:1.45rem; min-width:2.4rem; padding:.2rem; }
.ws-week-actions button:hover { background:#dbe7cd; }
.ws-calendar-filters { align-items:start; gap:.85rem; margin:1rem 0 1.5rem; }
.ws-calendar-filters label { flex:1; min-width:0; font-size:.84rem; }
.ws-calendar-filters label:first-child { flex:0 1 10rem; }
#calendar-account { overflow:hidden; text-overflow:ellipsis; }
.ws-calendar-filters input, .ws-calendar-filters select { margin-top:.25rem; padding:.55rem .6rem; border-color:#b8c3b5; border-radius:.45rem; min-height:2.5rem; }
.ws-agenda-day + .ws-agenda-day { margin-top:1.25rem; }
.ws-agenda-day h4 { display:flex; align-items:baseline; gap:.5rem; margin:.45rem 0; font-size:1rem; }
.ws-today { font-size:.75rem; font-weight:500; color:var(--green); border-radius:2rem; background:#e2efc9; padding:.08rem .45rem; }
.ws-agenda-day .ws-delivery { grid-template-columns:minmax(4.5rem,max-content) minmax(0,1fr) auto; }
.ws-agenda-time { color:var(--muted); font-size:.8rem; font-variant-numeric:tabular-nums; }
.ws-retry { padding:.25rem .65rem; }
#calendar-status:empty { display:none; }
#calendar-status { margin:.5rem 0; }
.ws-empty { padding:1.4rem; border-radius:.65rem; background:#f1f3e9; }
#draft-list li { padding:.7rem 0; }
#draft-list li a { text-decoration:none; }
#draft-list li a:hover { text-decoration:underline; }
#draft-list button { font-size:.82rem; border-color:var(--line); }
@media (max-width:920px) {
  #workspace { grid-template-columns:10.5rem minmax(0,1fr); column-gap:1rem; }
  .ws-sidebar { padding:.85rem; }
  .ws-content .ws-view { padding:1.4rem; }
  .ws-agenda-day .ws-delivery { grid-template-columns:minmax(0,1fr) auto; }
  .ws-agenda-time { grid-column:1 / -1; }
}
@media (max-width:760px) {
  body:has(#workspace:not([hidden])) main { padding-top:1rem; }
  #workspace { display:flex; flex-direction:column; gap:.9rem; }
  #workspace > * { width:100%; }
  .ws-sidebar { padding:.8rem; }
  .ws-rail-heading { display:flex; flex-wrap:wrap; row-gap:.4rem; justify-content:space-between; align-items:center; }
  .ws-rail-heading h1 { margin:0 .25rem; font-size:1.05rem; }
  .ws-rail-heading #new-draft { width:auto; padding:.48rem .75rem; font-size:.83rem; }
  .ws-nav { margin-top:.65rem; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.18rem; }
  .ws-nav a { text-align:center; font-size:.82rem; padding:.5rem .15rem; }
  .ws-nav a[aria-current] { box-shadow:none; }
  .ws-user { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.2rem .25rem; }
  .ws-content .ws-view { padding:1rem; }
  .ws-content .ws-section-title { margin-bottom:1rem; }
  .ws-posts .ws-delivery, .ws-agenda-day .ws-delivery { grid-template-columns:minmax(0,1fr); gap:.45rem; }
  .ws-posts .ws-state { font-size:.74rem; }
  .ws-queue-filters { gap:.3rem; padding-bottom:.85rem; }
  .ws-queue-filters button, .ws-queue-filters select { padding:.42rem .65rem; font-size:.8rem; }
  .ws-calendar-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
  .ws-calendar-filters label:last-child { grid-column:1/-1; }
  .ws-calendar-filters > * { min-width:0; }
  .ws-week-bar { flex-wrap:wrap; gap:.65rem; padding:.75rem; }
  #draft-list li { flex-wrap:nowrap; gap:.7rem; align-items:center; }
  .ws-section-title .ws-secondary { font-size:.8rem; }
}
.private-test {background:var(--paper);border-left:3px solid #8da65f;padding:1rem;margin:0 0 1rem}
.private-test h3 {font-size:.92rem;margin-bottom:.25rem}
.private-test p {margin:0;white-space:pre-line;overflow-wrap:anywhere}

#batch-open {display:block; margin-top:.6rem;}
:is(#batch-dialog,#archive-removal) {box-sizing:border-box; width:min(39rem,calc(100% - 1.5rem)); max-height:88dvh; overflow:auto; border:1px solid var(--line); border-radius:1rem; padding:clamp(1rem,3vw,1.8rem); color:var(--ink); background:var(--paper);}
:is(#batch-dialog,#archive-removal)::backdrop {background:rgba(15,34,24,.47);}
.batch-head {display:flex; align-items:baseline; justify-content:space-between; gap:1rem;}
.batch-head h2 {margin:0; font-size:clamp(1.3rem,4vw,1.8rem);}
#batch-files,#batch-status {overflow-wrap:anywhere;}
.batch-account {border-top:1px solid var(--line); padding:.7rem 0;}
.batch-account .batch-pick {display:flex; gap:.6rem; align-items:center; font-weight:600; margin:0;}
.batch-pick input {width:1.05rem; height:1.05rem;}
.batch-account fieldset {min-width:0; border:0; padding:.6rem 0 0;}
.batch-account select,.batch-account input,.batch-account textarea {max-width:100%;}
#batch-summary,#batch-results {list-style:none; padding:0; margin:.8rem 0;}
#batch-summary li,#batch-results li {border:1px solid var(--line); border-radius:.6rem; margin:.6rem 0; padding:.8rem; overflow-wrap:anywhere;}
#batch-summary p,#batch-results p {margin:.4rem 0; white-space:pre-line;}
#batch-summary small {display:block;}
#batch-status:empty {display:none;}

:is(#accounts,#imported-history-list) :is(.account-brief,.account-label) {flex:1 0 100%; min-width:0; padding:.35rem 0 0; margin:0; border:0; background:transparent;}
:is(.account-brief,.account-label) summary {width:fit-content; font-size:.86rem;}
:is(.account-brief,.account-label) :is(p,label,button) {font-size:.85rem;}
.account-brief textarea {display:block; width:100%; min-height:6rem;}
:is(.account-brief,.account-label) p:empty {display:none;}

.ws-inbox-copy {grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:.35rem .65rem;align-items:center;}
.ws-inbox-copy button {padding:.35rem .65rem;min-height:2.45rem;font-size:.85rem;}
.ws-inbox-copy .hint {margin:0;max-width:35rem;}
.ws-inbox-copy .hint:empty {margin:0;}
.ws-inbox-copy textarea {width:100%;margin:0;}

.account-label form {display:flex;align-items:end;flex-wrap:wrap;gap:.5rem;}
.account-label label {min-width:0;flex:1 1 12rem;}
.account-label input {width:100%;box-sizing:border-box;}
#selected-account-id,.batch-pick {overflow-wrap:anywhere;}

.private-test .profile-guidance {margin:.65rem 0 0;}
.profile-guidance p {white-space:pre-wrap;}

#library-view .release-panel { max-width:48rem; margin:0 0 1.25rem; padding:1rem; }
.release-tools, .release-file { display:flex; align-items:center; gap:.75rem; }
.release-tools { align-items:flex-end; flex-wrap:wrap; }
.release-tools label { flex:1 1 14rem; min-width:0; margin:0; }
.release-tools select { width:100%; }
.release-files { list-style:none; margin:.6rem 0; padding:0; }
.release-file { flex-wrap:wrap; justify-content:space-between; padding:.55rem 0; border-bottom:1px solid var(--line); }
.release-file label { display:flex; flex:1 1 12rem; align-items:center; gap:.55rem; min-width:0; margin:0; }
.release-file span { min-width:0; overflow-wrap:anywhere; }
.release-file small { display:block; color:var(--muted); }
#release-confirm { padding:.25rem .75rem .75rem; border-left:.2rem solid var(--green); }
#release-feedback:empty, #release-totals:empty { display:none; }
.batch-check {margin-top:.65rem; border-top:1px solid var(--line); padding-top:.35rem;}
.batch-check[data-result="blocked"] p:first-child {font-weight:600;}

.ws-queue-search select { width:100%; min-width:0; text-overflow:ellipsis; }
.ws-queue-search label { max-width:26rem; }
@media (max-width:600px) {
  .ws-queue-search label:first-child { flex:1 0 100%; }
  .ws-queue-search input { width:100%; }
}


@container workspace-content (max-width: 34rem) {
  .ws-composer { grid-template-columns: minmax(0, 1fr); }
  .ws-queue-search { flex-wrap: wrap; }
}
@container workspace-content (max-width: 16rem) {
  .ws-section-title h2, .ws-destination .hint { overflow-wrap: anywhere; }
  .ws-view button, .ws-view .button { max-width: 100%; overflow-wrap: anywhere; }
}
