/*
 * PlanWed unified product interface.
 * This file is loaded after the legacy stylesheet so every screen shares one
 * predictable visual language while legacy feature CSS can be retired safely.
 */

:root {
  --pw-canvas: #f3f5fa;
  --pw-surface: #ffffff;
  --pw-surface-soft: #f8f9fc;
  --pw-surface-tint: #f0efff;
  --pw-ink: #182033;
  --pw-muted: #41495a;
  --pw-faint: #444c5c;
  --pw-line: #e4e8f0;
  --pw-brand: #44389f;
  --pw-brand-deep: #352878;
  --pw-brand-soft: #eeecfb;
  --pw-action: #44389f;
  --pw-action-deep: #352878;
  --pw-focus: #44389f;
  --pw-control-line: #737e90;
  --pw-green: #075c41;
  --pw-amber: #5c3900;
  --pw-red: #8c1232;
  --pw-blue: #17428a;
  --pw-shadow-xs: 0 1px 2px rgba(22,31,50,.04);
  --pw-shadow-sm: 0 8px 24px rgba(31,39,65,.055);
  --pw-shadow-md: 0 18px 46px rgba(31,39,65,.09);
  --pw-radius-sm: 10px;
  --pw-radius: 16px;
  --pw-radius-lg: 22px;
  --bg: var(--pw-canvas);
  --bg-card: var(--pw-surface);
  --bg-input: var(--pw-surface-soft);
  --text: var(--pw-ink);
  --text-muted: var(--pw-muted);
  --text-light: var(--pw-faint);
  --border: var(--pw-line);
  --primary: var(--pw-brand);
  --primary-dark: var(--pw-brand-deep);
  --primary-bg: var(--pw-brand-soft);
  --success: var(--pw-green);
  --warning: var(--pw-amber);
  --danger: var(--pw-red);
  --accent: var(--pw-red);
  --info: var(--pw-blue);
  --success-bg: #e6f4ef;
  --warning-bg: #fbf0dd;
  --danger-bg: #fde8ed;
  --info-bg: #e8f0ff;
  --radius: var(--pw-radius);
  --radius-sm: var(--pw-radius-sm);
  --shadow: var(--pw-shadow-sm);
  --shadow-lg: var(--pw-shadow-md);
}

.material-icon {
  width: 1em;
  height: 1em;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.15rem;
  fill: currentColor;
}
.icon-label { display:inline-flex; align-items:center; gap:.38rem; }
.icon-title { display:inline-flex; align-items:center; gap:.62rem; vertical-align:middle; }
.card-title-icon,.schedule-item-icon,.integration-card-icon,.task-card-icon,.empty-state-icon {
  width:2rem;
  height:2rem;
  display:inline-grid;
  place-items:center;
  flex:0 0 auto;
  border-radius:9px;
  color:var(--pw-brand);
  background:var(--pw-brand-soft);
}
.card-title-icon .material-icon,.schedule-item-icon .material-icon,.integration-card-icon .material-icon,.task-card-icon .material-icon,.empty-state-icon .material-icon { font-size:1.05rem; }
.icon-title .card-title-icon { width:1.9rem; height:1.9rem; }
.empty-state-icon { width:2.7rem; height:2.7rem; margin:0 auto .55rem; border-radius:13px; }
.empty-state-icon .material-icon { font-size:1.4rem; }
.feature-card-icon { width:2.8rem; height:2.8rem; display:grid; place-items:center; margin-bottom:1rem; border-radius:13px; color:var(--pw-brand); background:var(--pw-brand-soft); }
.feature-card-icon .material-icon { font-size:1.45rem; }
.icon-button { width:40px; min-width:40px; padding:0; display:inline-grid; place-items:center; }
.sidebar .nav-item .material-icon { font-size:1.08rem; }
.workspace-topbar button .material-icon { font-size:1rem; }
.workspace-topbar .workspace-context { min-width:0; }
.workspace-topbar .workspace-actions { display:flex; align-items:center; justify-content:flex-end; gap:.45rem; flex:0 0 auto; }
.dashboard-payment-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.75rem; padding:.65rem 0; border-bottom:1px solid var(--pw-line); }
.dashboard-payment-copy { min-width:0; overflow-wrap:anywhere; }
.dashboard-payment-amount { white-space:nowrap; }
.expense-summary-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; margin:0 0 1rem; }
.expense-summary-strip > div { min-width:0; display:flex; align-items:center; gap:.7rem; padding:.85rem 1rem; border:1px solid var(--pw-line); border-radius:var(--pw-radius); background:var(--pw-surface); box-shadow:var(--pw-shadow-xs); }
.expense-summary-strip > div > .material-icon { color:var(--pw-brand); font-size:1.3rem; }
.expense-summary-strip span { min-width:0; display:flex; flex-direction:column; gap:.12rem; }
.expense-summary-strip small { color:var(--pw-muted); font-size:.7rem; font-weight:700; }
.expense-summary-strip strong { overflow:hidden; color:var(--pw-ink); font-size:.96rem; text-overflow:ellipsis; white-space:nowrap; }
.workspace-topbar .workspace-context { min-width:0; }
.workspace-topbar .workspace-actions { display:flex; align-items:center; justify-content:flex-end; gap:.45rem; flex:0 0 auto; }
.expense-summary-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; margin:0 0 1rem; }
.expense-summary-strip > div { min-width:0; display:flex; align-items:center; gap:.7rem; padding:.85rem 1rem; border:1px solid var(--pw-line); border-radius:var(--pw-radius); background:var(--pw-surface); box-shadow:var(--pw-shadow-xs); }
.expense-summary-strip > div > .material-icon { color:var(--pw-brand); font-size:1.3rem; }
.expense-summary-strip span { min-width:0; display:flex; flex-direction:column; gap:.12rem; }
.expense-summary-strip small { color:var(--pw-muted); font-size:.7rem; font-weight:700; }
.expense-summary-strip strong { overflow:hidden; color:var(--pw-ink); font-size:.96rem; text-overflow:ellipsis; white-space:nowrap; }
.trip-tab,.trip-hub-nav button { display:inline-flex; align-items:center; gap:.42rem; }
.studio-tabs .material-icon,.platform-tabs .material-icon,.finance-tabs .material-icon,.communication-nav .material-icon,.live-section-tabs .material-icon,.library-type-tabs .material-icon,.action-filter-tabs .material-icon { font-size:1.08rem; }
.event-type-icon .material-icon { font-size:1.8rem; color:var(--pw-brand); }
.feed-icon .material-icon,.action-task-event .material-icon { font-size:1.15rem; }
.coverage-list > button > .material-icon { color:var(--pw-brand); font-size:1.2rem; }
.countdown-icon { width:2.15rem; height:2.15rem; margin-right:1rem; flex:0 0 auto; }

body { background: var(--pw-canvas); color: var(--pw-ink); }
/* Driver.js uses a white popover in both themes; its default progress gray
   misses enhanced text contrast against that surface. */
.driver-popover .driver-popover-progress-text { color: #30394b; }
#pwa-root {
  width:100%;
  height:100%;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
}
.app-layout { background: radial-gradient(circle at 78% -10%,rgba(98,88,238,.075),transparent 31%),var(--pw-canvas); }
.main-content { position: relative; }
.view-surface { width: min(100%,1530px); margin: 0 auto; padding-bottom: 2rem; animation: pw-view-enter .22s ease-out; }
.view-surface > div:not(.platform-studio) { width: 100%; }
@keyframes pw-view-enter { from { opacity:.25; transform:translateY(4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .view-surface { animation:none; } * { scroll-behavior:auto !important; } }

/* Shared headings and contextual top area */
.view-surface .page-header {
  min-height: 88px;
  margin: 0 0 1rem;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(225,229,239,.9);
  border-radius: var(--pw-radius-lg);
  background: linear-gradient(125deg,rgba(255,255,255,.98),rgba(248,248,255,.95));
  box-shadow: var(--pw-shadow-xs);
}
.view-surface .page-header > :first-child { min-width: 0; }
.view-surface .page-header > :last-child:not(:first-child) { margin-left: auto; }
.view-surface .page-title { color: var(--pw-ink); font-size: clamp(1.45rem,2.1vw,2.05rem); font-weight: 760; line-height: 1.08; letter-spacing: -.045em; }
.view-surface .page-subtitle,.view-surface .page-header p { max-width: 780px; margin-top: .35rem; color: var(--pw-muted) !important; font-size: .84rem !important; line-height: 1.55; }
.view-surface .eyebrow { margin-bottom: .36rem; color: var(--pw-brand); font-size: .65rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.section-heading { gap: 1rem; }
.section-heading h2,.section-heading h3,.panel-heading h2 { color: var(--pw-ink); letter-spacing: -.025em; }
.section-heading p,.panel-heading p { color: var(--pw-muted); line-height: 1.5; }

/* Buttons and controls */
.btn {
  min-height: 40px;
  padding: .62rem 1rem;
  border-radius: 11px;
  font-size: .82rem;
  font-weight: 720;
  line-height: 1;
  box-shadow: none;
}
.btn-sm { min-height: 34px; padding: .47rem .72rem; font-size: .74rem; }
.btn-primary { color: #fff; border: 1px solid transparent; background: linear-gradient(135deg,var(--pw-action),var(--pw-action-deep)); box-shadow: 0 7px 16px rgba(68,56,159,.2); }
.btn-primary:hover { background: linear-gradient(135deg,var(--pw-action-deep),#281d61); box-shadow: 0 10px 22px rgba(53,40,120,.28); }
.btn-outline { color: #41495a; border: 1px solid var(--pw-control-line); background: rgba(255,255,255,.96); }
.btn-outline:hover { color: var(--pw-brand); border-color: #aaa4f4; background: #f7f6ff; }
.btn-ghost { color: var(--pw-muted); background: transparent; }
.btn-success { color:#fff; background:#075c41; }
.btn-danger { color:#fff; background:#8c1232; }
.btn:focus-visible,.form-control:focus-visible,.nav-item:focus-visible,button:focus-visible,a:focus-visible { outline: 3px solid var(--pw-focus); outline-offset: 2px; }

.form-group { margin-bottom: .9rem; }
.form-label { margin-bottom: .4rem; color: var(--pw-muted); font-size: .75rem; font-weight: 720; letter-spacing: .01em; }
.form-control {
  min-height: 44px;
  padding: .7rem .82rem;
  color: var(--pw-ink);
  border: 1px solid var(--pw-control-line);
  border-radius: 11px;
  background-color: #fafbfc;
  font-size: .84rem;
  box-shadow: inset 0 1px 1px rgba(20,29,46,.018);
}
textarea.form-control { min-height: 92px; resize: vertical; }
.form-control:hover { border-color: #c9cfdb; }
.form-control:focus { border-color: #8d85ef; background-color: #fff; box-shadow: 0 0 0 4px rgba(98,88,238,.09); }
.field-help,.provider-note { color: var(--pw-muted); font-size: .72rem; line-height: 1.5; }
.check-label,.registration-check-option { color: #465064; font-size: .78rem; }
.check-label input,.registration-check-option input { accent-color: var(--pw-brand); }

/* Surfaces, lists and states */
.view-surface .card {
  border: 1px solid rgba(222,227,237,.94);
  border-radius: var(--pw-radius);
  background: rgba(255,255,255,.96);
  box-shadow: var(--pw-shadow-xs);
}
.view-surface .card:hover { transform: none; border-color: #d5dae7; box-shadow: var(--pw-shadow-sm); }
.view-surface form.card,.view-surface .compact-form,.view-surface .settings-form { box-shadow: var(--pw-shadow-sm); }
.data-list { gap: .6rem; }
.data-row {
  min-height: 66px;
  padding: .9rem 1rem;
  border: 1px solid rgba(222,227,237,.95);
  border-radius: 13px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--pw-shadow-xs);
}
.data-row:hover { border-color: #c9c4fa; background: #fcfcff; transform: translateY(-1px); box-shadow: var(--pw-shadow-sm); }
.data-row strong { color: #242d40; }
.data-row small,.data-row > div > div { line-height: 1.45; }
.muted-empty,.card.card-flat[style*="text-align:center"] {
  min-height: 112px;
  padding: 1.4rem !important;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--pw-muted) !important;
  border: 1px dashed #ccd2df !important;
  border-radius: var(--pw-radius) !important;
  background: rgba(255,255,255,.58) !important;
  box-shadow: none !important;
  text-align: center;
}
.platform-notice,.calendar-notice,.portal-save-message {
  padding: .8rem 1rem;
  border: 1px solid #cfcafa;
  border-radius: 11px;
  background: #f4f2ff;
  color: #4940b5;
  font-size: .8rem;
  font-weight: 650;
}
.workspace-alert { margin-bottom: 1rem; padding: .8rem 1rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; border-radius:13px; color:#fff; background:linear-gradient(135deg,#d93f69,#b62c58); box-shadow:0 10px 26px rgba(190,44,89,.18); }

/* Metrics and information density */
.metrics-grid,.trip-stats-row,.registration-summary-grid,.registration-metrics,.finance-overview-grid,.action-summary-grid,.communication-metrics,.account-metrics,.library-metrics,.incident-metrics { gap: .7rem; }
.metric-card,.trip-stat-card,.registration-summary-grid > div,.registration-metrics > div,.action-summary-grid > article,.communication-metrics > article,.incident-metrics > article {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(222,227,237,.95);
  border-radius: 15px;
  background: linear-gradient(145deg,#fff,#fafbfe);
  box-shadow: var(--pw-shadow-xs);
}
.metric-card:after,.trip-stat-card:after { content:""; position:absolute; left:0; right:0; bottom:0; height:3px; background:linear-gradient(90deg,var(--pw-brand),#8b84f4); opacity:.75; }
.metric-card .metric-card-icon { position:absolute; top:.85rem; right:.9rem; padding:.42rem; box-sizing:content-box; border-radius:10px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:1.05rem; }
.trip-stat-card > .material-icon { position:absolute; top:.8rem; right:.85rem; padding:.38rem; box-sizing:content-box; border-radius:9px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:1rem; }
.action-summary-grid > article,.communication-metrics > article { position:relative; }
.action-summary-grid > article > .material-icon,.communication-metrics > article > .material-icon { position:absolute; top:.75rem; right:.75rem; padding:.34rem; box-sizing:content-box; border-radius:8px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:.92rem; }
.studio-metric { position:relative; }
.studio-metric > .studio-metric-icon { position:absolute; top:.75rem; right:.75rem; padding:.34rem; box-sizing:content-box; border-radius:8px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:.92rem; }
.panel-icon { font-size:0 !important; color:var(--pw-brand); }
.panel-icon::before { content:""; width:1.05rem; height:1.05rem; display:block; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z'/%3E%3C/svg%3E") center/contain no-repeat; }
.panel-icon:has(.material-icon)::before { content:none; display:none; }
.panel-icon .material-icon { width:1.05rem; height:1.05rem; }
.album-strip button > span:first-child { width:1.05rem; height:1.05rem; display:block; overflow:hidden; font-size:0; color:var(--pw-brand); background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.metric-label,.trip-stat-label,.registration-summary-grid span,.registration-metrics span,.action-summary-grid span,.communication-metrics span,.incident-metrics span { color: var(--pw-muted); font-size: .65rem; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.metric-value,.trip-stat-value,.registration-summary-grid strong,.registration-metrics strong,.action-summary-grid strong,.communication-metrics strong,.incident-metrics strong { color: var(--pw-ink); font-size: clamp(1.35rem,2vw,1.9rem); font-weight: 770; letter-spacing: -.04em; }
.metric-sub { color: var(--pw-muted); font-size: .7rem; }
.progress-bar { height: 7px; border-radius: 99px; background: #e9ecf3; }
.progress-fill { border-radius: 99px; }
.tag { padding: .3rem .5rem; border-radius: 999px; font-size: .63rem; font-weight: 800; letter-spacing: .035em; text-transform: capitalize; }

/* Tabs, filters and segmented navigation */
.trip-tabs,.platform-tabs,.finance-tabs,.communication-nav,.live-section-tabs,.library-type-tabs,.action-filter-tabs,.calendar-toolbar {
  padding: .32rem;
  gap: .25rem;
  border: 1px solid rgba(222,227,237,.92);
  border-radius: 13px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--pw-shadow-xs);
  scrollbar-width: none;
}
.trip-tabs::-webkit-scrollbar,.platform-tabs::-webkit-scrollbar,.finance-tabs::-webkit-scrollbar,.communication-nav::-webkit-scrollbar,.live-section-tabs::-webkit-scrollbar,.library-type-tabs::-webkit-scrollbar,.action-filter-tabs::-webkit-scrollbar { display:none; }
.trip-tab,.platform-tabs button,.finance-tabs button,.communication-nav button,.live-section-tabs button,.library-type-tabs button,.action-filter-tabs button,.calendar-toolbar button {
  min-height: 38px;
  padding: .55rem .75rem;
  border: 0;
  border-radius: 9px;
  color: var(--pw-muted);
  background: transparent;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
}
.platform-tabs button,.finance-tabs button,.communication-nav button,.live-section-tabs button,.library-type-tabs button,.action-filter-tabs button,.calendar-toolbar button { display:inline-flex; align-items:center; justify-content:center; gap:.42rem; }
.action-filter-tabs button > span { display:inline-flex; align-items:center; gap:.35rem; }
.trip-tab.active,.platform-tabs button.active,.finance-tabs button.active,.communication-nav button.active,.live-section-tabs button.active,.library-type-tabs button.active,.action-filter-tabs button.active,.calendar-toolbar button.active {
  color: #fff;
  background: linear-gradient(135deg,#6960ef,#5147cf);
  box-shadow: 0 6px 14px rgba(98,88,238,.2);
}

/* Global dashboard and account surfaces */
.account-dashboard { display: grid; grid-template-columns:minmax(0,1fr); gap: 1rem; min-width:0; }
.account-dashboard > *, .view-surface > * { min-width:0; }
.account-hero .btn-outline { background:rgba(255,255,255,.96); border-color:rgba(255,255,255,.72); color:#392f70; }
.account-hero .btn-primary { background:#171b38; border-color:#171b38; color:#fff; }
.account-hero .btn-outline:hover { background:#fff; color:#251d58; }
.account-hero .btn-primary:hover { background:#242956; color:#fff; }
.account-hero { overflow:hidden; border-radius: 24px; box-shadow: var(--pw-shadow-md); }
.account-section,.account-action-centre,.dashboard-library,.account-feed { border-radius: 18px !important; }
.event-portfolio-grid { gap: .8rem; }
.event-portfolio-card { min-height: 210px; border: 1px solid var(--pw-line); border-radius: 17px; background: #fff; box-shadow: var(--pw-shadow-xs); }
.event-portfolio-card:hover { border-color:#b8b2f7; transform:translateY(-3px); box-shadow:var(--pw-shadow-md); }
.event-type-icon { border-radius: 13px; background: var(--pw-brand-soft); }
.account-task-list,.dashboard-library-items { gap: .55rem; }
.action-task-row,.dashboard-library-items button,.feed-row { border:1px solid transparent; border-radius:11px; }
.action-task-row:hover,.dashboard-library-items button:hover,.feed-row:hover { border-color:var(--pw-line); background:#f8f8ff; }

/* People, schedules, vendors, categories and collaborators */
.view-people .people-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.45rem; }
.view-people .trip-stats-row { grid-template-columns: repeat(4,minmax(0,1fr)); }
.people-import { border-left: 4px solid var(--pw-brand) !important; }
.seat-assignment { display:inline-flex; align-items:center; gap:.3rem; margin-top:.45rem; padding:.3rem .45rem; border-radius:7px; color:#4b43a8; background:#f0efff; font-size:.7rem; }
.seat-assignment .material-icon,.person-inline-meta .material-icon,.person-requirements .material-icon { font-size:.9rem; }
.person-inline-meta { color:var(--pw-muted); font-size:.8rem; }
.person-requirements { display:flex; flex-wrap:wrap; gap:.45rem .75rem; margin-top:.3rem; font-size:.78rem; }
.person-requirements span { display:inline-flex; align-items:center; gap:.3rem; }
.view-operations > div,.view-events > div,.view-categories > div,.view-contributors > div { display:grid; gap:.9rem; }
.view-operations .data-row { border-left: 3px solid var(--pw-brand); }
.view-categories form:not(.compact-form) { padding:1rem; border:1px solid var(--pw-line); border-radius:15px; background:#fff; box-shadow:var(--pw-shadow-xs); }
.view-categories form:not(.compact-form) .form-control { flex:1 1 240px; }
.view-vendors .data-row,.view-contributors .data-row { padding:1rem 1.1rem; }

/* Finance and expense management */
.finance-platform,.view-expenses > div,.view-expense_detail > div,.view-add_expense > div,.view-edit_expense > div,.view-add_transaction > div { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:.85rem; }
.finance-platform,.trip-hub,.calendar-page { container-type:inline-size; }
.finance-tabs { position:sticky; top:69px; z-index:30; }
.finance-overview-grid > article { border-top:3px solid var(--pw-brand); }
.approval-row,.reimbursement-row,.contribution-row,.ticket-order-row,.forecast-row,.deadline-list > div {
  border:1px solid var(--pw-line);
  border-radius:12px;
  background:#fff;
}
.allocation-builder,.conversion-preview,.ticket-sales-controls { border-radius:14px; background:#f8f9fc; }
.statement-net { border-radius:15px; }

/* Stacked content cards need their own rhythm because the base reset removes
   native heading and paragraph margins. Keep list/metric cards compact while
   giving explanatory cards a predictable title → copy → control cadence. */
.statement-grid > .card {
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.62rem;
}
.statement-grid > .card > .eyebrow { margin:0 0 .08rem; }
.statement-grid > .card > h2 { margin:0; line-height:1.2; }
.statement-grid > .card > p {
  margin:0 0 auto;
  color:var(--pw-muted);
  line-height:1.55;
}
.statement-grid > .card > .form-control { margin:0; }
.statement-grid > .card > .btn { align-self:flex-start; margin-top:.08rem; }

.trip-hub > .card,
.trip-hub-grid > .card,
.calendar-layer-grid > section.card:not(.calendar-alerts),
.registry-publish-card {
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.78rem;
}
.trip-hub > .card > :is(h2,h3,h4),
.trip-hub-grid > .card > :is(h2,h3,h4),
.calendar-layer-grid > section.card:not(.calendar-alerts) > :is(h2,h3,h4) {
  margin:0;
  line-height:1.25;
}
.trip-hub > .card > p,
.trip-hub-grid > .card > p,
.calendar-layer-grid > section.card:not(.calendar-alerts) > p {
  margin:0;
  line-height:1.55;
}
.trip-hub > .card > :is(.section-heading,.trip-stack,.trip-inline-form),
.trip-hub-grid > .card > :is(.section-heading,.trip-stack,.trip-inline-form,.trip-form-grid,.split-people,.balance-list),
.calendar-layer-grid > section.card:not(.calendar-alerts) > .section-heading,
.registry-publish-card > .section-heading {
  margin-top:0;
  margin-bottom:0;
}
.trip-hub > .card > :is(.btn,label.btn),
.trip-hub-grid > .card > :is(.btn,label.btn),
.calendar-layer-grid > section.card:not(.calendar-alerts) > .btn {
  align-self:flex-start;
  margin-top:0 !important;
}
.calendar-layer-grid > .subscription-card > .btn { align-self:center; }

/* Respond to the workspace width, not only the browser width. A persistent
   desktop sidebar can otherwise leave two cards squeezed into a phone-sized
   content column even though the viewport itself is wider than 768px. */
@container (max-width: 700px) {
  .statement-grid,
  .trip-hub-grid,
  .calendar-layer-grid {
    grid-template-columns:minmax(0,1fr);
  }
  .trip-alert-strip { grid-template-columns:minmax(0,1fr); }
  .trip-hub-summary { align-items:flex-start; flex-direction:column; }
  .calendar-sources { align-items:stretch; flex-direction:column; }
  .calendar-source-options { width:100%; justify-content:flex-start; }
}

/* Calendar */
.calendar-page { display:grid; gap:.9rem; }
.calendar-wrapper { overflow:hidden; border:1px solid var(--pw-line); border-radius:18px; background:#fff; box-shadow:var(--pw-shadow-sm); }
.calendar-header-day { padding:.7rem .35rem; color:var(--pw-muted); background:#f7f8fb; font-size:.64rem; font-weight:820; letter-spacing:.08em; text-transform:uppercase; }
.calendar-day { min-height:116px; padding:.5rem; border-color:#edf0f5; background:#fff; }
.calendar-day:hover { background:#fafaff; }
.calendar-day-number { width:25px; height:25px; display:grid; place-items:center; border-radius:8px; color:#626b7c; font-size:.72rem; }
.calendar-day.today .calendar-day-number { color:#fff; background:var(--pw-brand); }
.calendar-event { border-radius:7px; }
.calendar-sources,.calendar-alerts,.calendar-agenda,.subscription-card { border-radius:17px !important; }

/* Trips */
.view-trips > div { display:grid; gap:1rem; }
.trip-grid { gap:.8rem; }
.trip-card { overflow:hidden; border:1px solid var(--pw-line); border-radius:18px; background:#fff; box-shadow:var(--pw-shadow-xs); }
.trip-card:hover { border-color:#bcb6f5; transform:translateY(-3px); box-shadow:var(--pw-shadow-md); }
.trip-card-header { padding:1rem 1rem .75rem; }
.trip-type-badge,.trip-card-destination,.trip-card-dates,.trip-card-meta > span,.trip-overview-grid h4,.icon-label { display:flex; align-items:center; gap:.38rem; }
.trip-type-badge .material-icon,.trip-card-destination .material-icon,.trip-card-dates .material-icon,.trip-card-meta .material-icon { font-size:1rem; }
.trip-overview-grid h4 .material-icon { color:var(--pw-brand); }
.empty-state-icon { width:3.25rem; height:3.25rem; display:grid; place-items:center; margin:0 auto 1rem; border-radius:16px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:2rem; }
.trip-card-destination { color:var(--pw-muted); }
.trip-card-actions { border-top:1px solid #edf0f5; background:#fafbfc; }
.trip-hub,.trip-stack { gap:.75rem; }
.trip-hub-nav { padding:.35rem; border:1px solid var(--pw-line); border-radius:13px; background:#fff; }
.travel-row,.reservation-card { border:1px solid var(--pw-line); border-radius:12px; background:#fff; }
.trip-route-map,.trip-map-empty { border-radius:16px; }
.itinerary-day { border:1px solid var(--pw-line); border-radius:17px; background:#fff; box-shadow:var(--pw-shadow-xs); }
.itinerary-day-header { border-radius:17px 17px 0 0; background:#f7f7fd; }
.itinerary-item { border-radius:11px; }

/* Control center, live mode, tasks and communications */
.platform-page,.live-event-mode,.task-centre,.communication-hub { width:100%; max-width:100%; min-width:0; display:grid; gap:.9rem; }
.platform-tabs,.live-section-tabs,.communication-nav,.action-filter-tabs { width:100%; max-width:100%; min-width:0; }
.platform-page,.task-centre { grid-template-columns:minmax(0,1fr); }
.task-centre > *,.task-centre-toolbar { width:100%; max-width:100%; min-width:0; }
.platform-studio,.studio-section,.studio-split,.studio-panel,.studio-form-stack,.integration-grid,.integration-card { min-width:0; }
.view-studio .integration-grid { grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); }
.view-studio article.integration-card { width:100%; max-width:100%; display:grid; align-items:stretch; }
.view-studio article.integration-card > div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.5rem; }
.view-studio article.integration-card input,.view-studio article.integration-card select { min-width:0; width:100%; }
.platform-tabs,.live-section-tabs,.communication-nav { position:sticky; top:69px; z-index:32; }
.view-control .integration-card > div { display:block; min-width:0; }
.live-hero,.communication-hero { border-radius:22px; box-shadow:var(--pw-shadow-md); }
.live-command-grid,.communication-layout,.platform-split { gap:.8rem; }
.live-list,.chat-panel,.communication-composer,.task-create-form,.task-detail-panel,.portal-publishing-panel { border-radius:17px !important; }
.task-weekday-picker { display:flex; flex-wrap:wrap; gap:.45rem; }
.task-weekday-picker label { cursor:pointer; }
.task-weekday-picker input { position:absolute; opacity:0; pointer-events:none; }
.task-weekday-picker span { display:grid; min-width:44px; min-height:38px; place-items:center; padding:.4rem .65rem; border:1px solid var(--border); border-radius:10px; color:var(--text-muted); background:var(--bg-card); font-size:.78rem; font-weight:750; }
.task-weekday-picker input:checked + span { color:var(--primary); border-color:color-mix(in srgb,var(--primary) 55%,var(--border)); background:color-mix(in srgb,var(--primary) 10%,var(--bg-card)); }
.task-weekday-picker input:focus-visible + span { outline:3px solid var(--pw-focus); outline-offset:2px; }
.task-recurrence-editor { display:grid; gap:.8rem; }
.workflow-rule-stack { display:grid; gap:.4rem; padding:.75rem; border:1px solid color-mix(in srgb,var(--pw-brand) 28%,var(--pw-line)); border-radius:12px; background:color-mix(in srgb,var(--pw-brand) 6%,var(--pw-surface)); }
.workflow-rule-stack > strong { font-size:.78rem; color:var(--pw-muted); text-transform:uppercase; letter-spacing:.06em; }
.workflow-rule-stack > span { display:flex; align-items:center; justify-content:space-between; gap:.6rem; font-size:.85rem; }
.workflow-rule-stack button { border:0; background:transparent; color:var(--danger); cursor:pointer; font-size:1.15rem; }
.live-person,.live-run-item,.live-vendor-card,.reminder-rule,.communication-feed article,.operational-task {
  border:1px solid var(--pw-line);
  border-radius:12px;
  background:#fff;
}
.operational-task { border-left:3px solid #8a82ee !important; }
.operational-task.overdue { border-left-color:var(--pw-red) !important; }
.task-centre-toolbar { padding:.45rem; border-radius:14px; background:rgba(255,255,255,.8); }
.chat-stream { background:#f8f9fc; border-radius:12px; }
.chat-stream article { border-radius:12px; box-shadow:var(--pw-shadow-xs); }

/* Budget charts and analytical views */
.view-budget > div { display:grid; gap:.9rem; }
.view-budget canvas { max-height:420px; }
.insight-grid > .card { min-height:180px; }

/* Library and settings */
.library-page,.settings-page { display:grid; gap:.9rem; }
.library-toolbar { position:sticky; top:69px; z-index:31; border-radius:15px; background:rgba(255,255,255,.92); backdrop-filter:blur(15px); }
.library-type-tabs { scrollbar-width:none; }
.library-type-tabs::-webkit-scrollbar { display:none; }
.resource-card { overflow:hidden; border:1px solid var(--pw-line); border-radius:16px; background:#fff; box-shadow:var(--pw-shadow-xs); }
.resource-card:hover { border-color:#bbb5f5; transform:translateY(-2px); box-shadow:var(--pw-shadow-sm); }
.resource-icon { border-radius:12px; color:var(--pw-brand); background:var(--pw-brand-soft); }
.resource-icon .material-icon,.dashboard-library-items button > span:first-child .material-icon,.applied-resource > span .material-icon { font-size:1.2rem; }
.library-metrics > .card { position:relative; }
.library-metrics > .card > .material-icon { position:absolute; top:.85rem; right:.85rem; padding:.38rem; box-sizing:content-box; border-radius:9px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:1rem; }
.subscription-icon,.integration-card-icon { color:var(--pw-brand); }
.subscription-icon .material-icon { font-size:2rem; }
.reservation-card-icon { width:2rem; height:2rem; display:grid; place-items:center; border-radius:9px; color:var(--pw-brand); background:var(--pw-brand-soft); }
.reservation-card-icon .material-icon { font-size:1.05rem; }
.itinerary-item-location,.trip-map-empty,.task-metadata span,.task-dependency-summary span,.task-counts span,.task-detail-row > span { display:flex; align-items:center; gap:.35rem; }
.itinerary-item-location .material-icon,.task-metadata .material-icon,.task-dependency-summary .material-icon,.task-counts .material-icon { font-size:.92rem; }
.trip-map-empty > .material-icon { font-size:2rem; color:var(--pw-brand); }
.task-card-icon { width:1.75rem; height:1.75rem; margin-right:auto; }
.task-card-icon .material-icon { font-size:.92rem; }
.registry-gift-icon { color:var(--pw-brand); }
.registry-gift-icon .material-icon { font-size:1.35rem; }
.settings-form { max-width:980px; }
.settings-grid { gap:.8rem; }
.provider-server-state { display:flex; align-items:center; gap:.45rem; padding:.55rem .65rem; border-radius:10px; background:color-mix(in srgb,var(--danger) 8%,transparent); color:var(--danger); font-size:.78rem; font-weight:700; }
.provider-server-state .material-icon { width:17px; height:17px; }
.provider-server-state.configured { background:color-mix(in srgb,var(--warning) 10%,transparent); color:var(--warning); }
.provider-server-state.verified { background:color-mix(in srgb,var(--success) 10%,transparent); color:var(--success); }

/* Feature documentation centre */
.view-docs > .docs-centre { width:100%; max-width:none; margin:0 auto; }
.docs-centre { display:grid; gap:.9rem; min-width:0; }
.docs-header { background:linear-gradient(125deg,#fff,#f4f2ff) !important; }
.docs-toolbar { position:sticky; top:69px; z-index:35; display:grid; grid-template-columns:minmax(280px,1fr) auto; align-items:center; gap:.8rem; margin:0; padding:.65rem; border-radius:15px; background:rgba(255,255,255,.92); backdrop-filter:blur(15px); }
.docs-search { min-height:44px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.55rem; padding:0 .75rem; border:1px solid var(--pw-line); border-radius:11px; color:var(--pw-muted); background:var(--pw-surface-soft); }
.docs-search > .material-icon { color:var(--pw-brand); }
.docs-search input { min-width:0; width:100%; border:0; outline:0; color:var(--pw-ink); background:transparent; font:inherit; font-size:.82rem; }
.docs-search:focus-within { outline:3px solid var(--pw-focus); outline-offset:2px; }
.docs-search input::placeholder { color:var(--pw-faint); }
.docs-search button { width:30px; height:30px; display:grid; place-items:center; border:0; border-radius:8px; color:var(--pw-muted); background:transparent; cursor:pointer; }
.docs-search button:hover { color:var(--pw-brand); background:var(--pw-brand-soft); }
.docs-type-filters { display:flex; align-items:center; gap:.3rem; overflow-x:auto; scrollbar-width:none; }
.docs-type-filters::-webkit-scrollbar { display:none; }
.docs-type-filters button { min-height:38px; display:inline-flex; align-items:center; gap:.38rem; flex:0 0 auto; padding:.5rem .68rem; border:0; border-radius:9px; color:var(--pw-muted); background:transparent; font:700 .73rem inherit; cursor:pointer; }
.docs-type-filters button:hover { color:var(--pw-brand); background:var(--pw-brand-soft); }
.docs-type-filters button.active { color:#fff; background:linear-gradient(135deg,var(--pw-brand),var(--pw-brand-deep)); box-shadow:0 6px 14px rgba(98,88,238,.2); }
.docs-type-filters .material-icon { font-size:1rem; }
.docs-layout { display:grid; grid-template-columns:minmax(260px,300px) minmax(0,1fr); align-items:start; gap:.9rem; min-width:0; }
.docs-index { position:sticky; top:139px; max-height:calc(100dvh - 158px); display:grid; align-content:start; gap:.3rem; overflow-y:auto; margin:0; padding:.55rem; border-radius:16px; scrollbar-width:thin; }
.docs-index-heading { display:flex; align-items:center; justify-content:space-between; padding:.55rem .6rem .7rem; color:var(--pw-muted); font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; }
.docs-index-heading span { min-width:24px; height:24px; display:grid; place-items:center; border-radius:99px; color:var(--pw-brand); background:var(--pw-brand-soft); font-weight:800; }
.docs-index > button { width:100%; display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:.6rem; padding:.65rem; border:1px solid transparent; border-radius:11px; color:var(--pw-ink); background:transparent; text-align:left; font:inherit; cursor:pointer; transition:background .16s,border-color .16s,transform .16s; }
.docs-index > button:hover { border-color:var(--pw-line); background:var(--pw-surface-soft); transform:translateX(2px); }
.docs-index > button.active { border-color:rgba(98,88,238,.26); background:var(--pw-brand-soft); }
.docs-index > button > span:nth-child(2) { min-width:0; }
.docs-index > button strong,.docs-index > button small { display:block; overflow:hidden; text-overflow:ellipsis; }
.docs-index > button strong { color:var(--pw-ink); font-size:.78rem; line-height:1.25; }
.docs-index > button small { margin-top:.18rem; color:var(--pw-muted); font-size:.64rem; line-height:1.35; white-space:nowrap; }
.docs-index > button > .material-icon { color:var(--pw-faint); font-size:.92rem; }
.docs-index-icon { width:36px; height:36px; display:grid !important; place-items:center; border-radius:10px; color:var(--pw-brand); background:var(--pw-brand-soft); }
.docs-index-icon .material-icon { font-size:1.02rem; }
.docs-no-results { display:grid; justify-items:center; gap:.35rem; padding:1.5rem .8rem; color:var(--pw-muted); text-align:center; }
.docs-no-results .material-icon { color:var(--pw-brand); font-size:1.6rem; }
.docs-no-results p { margin:0; font-size:.72rem; }
.docs-article { display:grid; gap:.9rem; min-width:0; scroll-margin-top:150px; }
.docs-guide-hero { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:0; padding:1.2rem; border-radius:18px; background:linear-gradient(135deg,var(--pw-surface),var(--pw-surface-tint)); }
.docs-guide-copy { min-width:0; display:flex; align-items:flex-start; gap:.9rem; }
.docs-guide-icon { width:52px; height:52px; display:grid; place-items:center; flex:0 0 auto; border-radius:15px; color:#fff; background:linear-gradient(135deg,var(--pw-brand),#8e64ed); box-shadow:0 10px 22px rgba(98,88,238,.22); }
.docs-guide-icon .material-icon { font-size:1.45rem; }
.docs-guide-copy h1 { margin:.38rem 0 .28rem; color:var(--pw-ink); font-size:clamp(1.25rem,2.2vw,1.85rem); line-height:1.1; letter-spacing:-.035em; }
.docs-guide-copy p { max-width:760px; margin:0; color:var(--pw-muted); font-size:.82rem; line-height:1.55; }
.docs-audience-tags { display:flex; flex-wrap:wrap; gap:.28rem; }
.docs-audience-tags span { padding:.2rem .4rem; border-radius:99px; color:var(--pw-brand); background:var(--pw-brand-soft); font-size:.58rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.docs-guide-hero > .btn { flex:0 0 auto; }
.docs-screenshot-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:.65rem; }
.docs-screenshot-grid.has-secondary { grid-template-columns:repeat(2,minmax(0,1fr)); }
.docs-screenshot { position:relative; width:100%; display:block; overflow:hidden; padding:0; border:1px solid var(--pw-line); border-radius:18px; background:var(--pw-surface); box-shadow:var(--pw-shadow-sm); cursor:zoom-in; }
.docs-screenshot img { width:100%; height:auto; display:block; object-fit:contain; transition:transform .25s ease; }
.docs-screenshot:hover img { transform:scale(1.012); }
.docs-screenshot > span { display:flex; align-items:center; gap:.5rem; padding:.75rem 1rem; border-top:1px solid var(--pw-line); color:var(--pw-ink); background:var(--pw-surface); font-size:.8rem; font-weight:650; text-align:left; line-height:1.5; }
.docs-demo-notice { margin:0; color:var(--pw-ink); font-size:.875rem; line-height:1.6; }
.docs-screenshot > span .material-icon { font-size:.95rem; }
.docs-feature-section,.docs-steps { margin:0; padding:1.15rem; border-radius:18px; }
.docs-feature-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin-top:.75rem; }
.docs-feature-grid > article { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:start; gap:.6rem; min-width:0; padding:.72rem; border:1px solid var(--pw-line); border-radius:11px; background:var(--pw-surface-soft); }
.docs-feature-grid > article > span { width:34px; height:34px; display:grid; place-items:center; border-radius:9px; color:var(--pw-green); background:color-mix(in srgb,var(--pw-green) 10%,transparent); }
.docs-feature-grid .material-icon { font-size:.95rem; }
.docs-feature-grid h3 { margin:0; color:var(--pw-ink); font-size:.78rem; line-height:1.3; }
.docs-feature-grid p { margin:.18rem 0 0; color:var(--pw-muted); font-size:.69rem; line-height:1.48; }
.docs-steps > h2 { margin:.25rem 0 .75rem; }
.docs-steps ol { display:grid; gap:.5rem; margin:0; padding:0; list-style:none; counter-reset:none; }
.docs-steps li { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:center; gap:.65rem; padding:.62rem .7rem; border-radius:10px; background:var(--pw-surface-soft); }
.docs-steps li > span { width:32px; height:32px; display:grid; place-items:center; border-radius:9px; color:#fff; background:var(--pw-brand); font-size:.72rem; font-weight:850; }
.docs-steps li p { margin:0; color:var(--pw-ink); font-size:.75rem; line-height:1.5; }
.docs-tip { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:start; gap:.65rem; margin-top:.8rem; padding:.75rem; border:1px solid rgba(98,88,238,.2); border-radius:11px; background:var(--pw-brand-soft); }
.docs-tip > .material-icon { width:38px; height:38px; padding:.55rem; box-sizing:border-box; border-radius:10px; color:var(--pw-brand); background:var(--pw-surface); }
.docs-tip strong { display:block; color:var(--pw-ink); font-size:.75rem; }
.docs-tip p { margin:.15rem 0 0; color:var(--pw-muted); font-size:.7rem; line-height:1.5; }
.docs-related { margin:0; padding:1.15rem; border-radius:18px; }
.docs-related-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; margin-top:.75rem; }
.docs-related-grid > button { min-width:0; display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:.6rem; padding:.72rem; border:1px solid var(--pw-line); border-radius:12px; color:var(--pw-ink); background:var(--pw-surface-soft); text-align:left; font:inherit; cursor:pointer; transition:border-color .16s,background .16s,transform .16s; }
.docs-related-grid > button:hover { border-color:rgba(98,88,238,.3); background:var(--pw-brand-soft); transform:translateY(-2px); }
.docs-related-grid > button > span { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; color:var(--pw-brand); background:var(--pw-surface); }
.docs-related-grid > button > div { min-width:0; }
.docs-related-grid strong,.docs-related-grid small { display:block; }
.docs-related-grid strong { font-size:.75rem; line-height:1.3; }
.docs-related-grid small { display:-webkit-box; overflow:hidden; margin-top:.2rem; color:var(--pw-muted); font-size:.64rem; line-height:1.4; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.docs-related-grid > button > .material-icon { color:var(--pw-faint); font-size:.95rem; }
.docs-pager { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
.docs-pager > button { min-width:0; display:flex; align-items:center; gap:.7rem; padding:.85rem .95rem; border:1px solid var(--pw-line); border-radius:14px; color:var(--pw-ink); background:var(--pw-surface); font:inherit; text-align:left; cursor:pointer; box-shadow:var(--pw-shadow-sm); }
.docs-pager > button:last-child { justify-content:flex-end; text-align:right; }
.docs-pager > button:not(:disabled):hover { border-color:rgba(98,88,238,.3); color:var(--pw-brand); background:var(--pw-brand-soft); }
.docs-pager > button:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; }
.docs-pager > button span { min-width:0; display:grid; gap:.12rem; }
.docs-pager small { color:var(--pw-muted); font-size:.65rem; font-weight:750; letter-spacing:.06em; text-transform:uppercase; }
.docs-pager strong { overflow:hidden; font-size:.75rem; text-overflow:ellipsis; white-space:nowrap; }
.docs-pager .material-icon { flex:0 0 auto; font-size:1rem; }
.docs-lightbox { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:clamp(.75rem,3vw,2.5rem); background:rgba(5,9,18,.9); backdrop-filter:blur(12px); }
.docs-lightbox img { max-width:min(1500px,94vw); max-height:86vh; border:1px solid rgba(255,255,255,.15); border-radius:16px; box-shadow:0 30px 90px rgba(0,0,0,.5); }
.docs-lightbox > button { position:fixed; top:1rem; right:1rem; width:44px; height:44px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.2); border-radius:12px; color:#fff; background:rgba(255,255,255,.1); cursor:pointer; }
.docs-lightbox > span { position:fixed; left:50%; bottom:1rem; transform:translateX(-50%); padding:.45rem .7rem; border-radius:9px; color:#fff; background:rgba(0,0,0,.6); font-size:.72rem; }

@media (max-width: 1200px) {
  .docs-toolbar { position:static; grid-template-columns:minmax(0,1fr); }
  .docs-article { scroll-margin-top:90px; }
  .docs-layout { grid-template-columns:minmax(0,1fr); }
  .docs-index { position:static; max-height:none; grid-auto-flow:column; grid-auto-columns:minmax(235px,270px); overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
  .docs-index::-webkit-scrollbar { display:none; }
  .docs-index-heading { display:none; }
  .docs-index > button:hover { transform:none; }
}

@media (max-width: 620px) {
  .docs-guide-hero { align-items:stretch; flex-direction:column; }
  .docs-guide-copy { align-items:flex-start; flex-direction:column; }
  .docs-guide-hero > .btn { width:100%; }
  .docs-feature-grid { grid-template-columns:minmax(0,1fr); }
  .docs-screenshot-grid.has-secondary { grid-template-columns:minmax(0,1fr); }
  .docs-related-grid { grid-template-columns:minmax(0,1fr); }
  .docs-screenshot img { height:auto; }
  .docs-type-filters { width:100%; }
  .docs-lightbox { align-items:center; }
  .docs-pager { grid-template-columns:minmax(0,1fr); }
}

/* Landing and authentication */
.auth-shell { background:radial-gradient(circle at 12% 8%,rgba(117,105,255,.18),transparent 34%),linear-gradient(140deg,#111629,#252a50 62%,#554ac7); }
.auth-card { border:1px solid rgba(255,255,255,.8); border-radius:24px; box-shadow:0 28px 70px rgba(10,14,30,.28); }
.landing-page { color:var(--pw-ink); background:var(--pw-canvas); }
.landing-header { border-bottom:1px solid var(--pw-line); background:var(--pw-surface); box-shadow:var(--pw-shadow-xs); }

/* Creation flow */
.create-workspace-page { width:min(100%,760px); margin:0 auto; padding:clamp(1rem,4vw,3.2rem) 1rem; }
.create-workspace-page .page-header { margin-bottom:1rem; padding:1.2rem 1.25rem; border:1px solid var(--pw-line); border-radius:20px; background:linear-gradient(125deg,#fff,#f5f3ff); box-shadow:var(--pw-shadow-sm); }
.create-workspace-page > .card { padding:1.35rem; border:1px solid var(--pw-line); border-radius:20px; box-shadow:var(--pw-shadow-md); }
.create-workspace-page form { display:grid; gap:.1rem; }

/* Participant portal and public experiences */
.portal-shell { background:radial-gradient(circle at 92% 0,rgba(98,88,238,.08),transparent 28%),#f4f5f9; }
.portal-header { border-radius:0 0 28px 28px; box-shadow:0 15px 40px rgba(17,23,43,.13); }
.portal-main { gap:1rem; }
.portal-summary-card,.portal-invitation,.portal-timeline-card,.portal-message,.portal-chat,.portal-response,.portal-contributions { border:1px solid var(--pw-line); border-radius:17px !important; box-shadow:var(--pw-shadow-xs); }
.portal-timeline-item { border-radius:12px; }
.portal-inbox-bar { border-radius:17px; background:#fff; box-shadow:var(--pw-shadow-xs); }
.portal-communication-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(260px,.65fr); gap:16px; align-items:start; }
.portal-consent-card { padding:20px; }
.portal-consent-card h3 { margin:5px 0 7px; }
.portal-consent-card > p { margin:0 0 14px; color:var(--pw-muted); line-height:1.55; }
.portal-consent-card > label { display:grid; gap:9px; padding:13px 0; border-top:1px solid var(--pw-line); }
.portal-consent-card > label span,.portal-consent-card > label strong,.portal-consent-card > label small { display:block; }
.portal-consent-card > label small { margin-top:3px; color:var(--pw-muted); line-height:1.35; }
.registry-public-shell,.public-event-site { color:var(--pw-ink); }
.registry-public-card { border:1px solid #e6e2dc; border-radius:18px; box-shadow:0 8px 24px rgba(44,38,31,.055); }
.registry-public-card:hover { transform:translateY(-3px); box-shadow:0 18px 38px rgba(44,38,31,.1); }
.registry-public-anonymous { border-radius:17px; }
.organization-member-list { display:grid !important; width:min(100%,680px); gap:8px !important; }
.organization-member { display:grid; grid-template-columns:minmax(170px,1fr) 110px auto; gap:9px; align-items:center; padding:9px 10px; border:1px solid var(--pw-line); border-radius:12px; background:var(--pw-surface); }
.organization-member > span:first-child,.organization-member > span:first-child strong,.organization-member > span:first-child small { display:block; min-width:0; }
.organization-member > span:first-child small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.library-history { margin-bottom:16px; padding:20px; }
.library-version-list { display:grid; gap:8px; }
.library-version-list article { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 12px; border:1px solid var(--pw-line); border-radius:12px; background:var(--pw-surface); }
.library-version-list article span:first-child,.library-version-list article strong,.library-version-list article small { display:block; }
.library-version-list article small { margin-top:3px; color:var(--pw-muted); }

/* Responsive redesign */
@media (max-width: 1100px) {
  .view-surface .page-header { min-height:76px; }
  .workspace-topbar .workspace-context { flex:1 1 auto; overflow:hidden; }
  .workspace-topbar .workspace-context strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .workspace-topbar .workspace-actions button:not(.topbar-search) { min-width:38px; padding:.55rem; font-size:0; }
  .workspace-topbar .workspace-actions button .material-icon { font-size:1.05rem; }
  .workspace-topbar .topbar-search kbd { display:none; }
  .view-people .trip-stats-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .calendar-day { min-height:100px; }
}

@media (max-width: 768px) {
  .portal-communication-grid { grid-template-columns:1fr; }
  .organization-member { grid-template-columns:1fr; align-items:stretch; }
  .workspace-topbar .workspace-actions { gap:.25rem; }
  .expense-summary-strip { grid-template-columns:1fr; gap:.5rem; }
  .expense-summary-strip > div { padding:.72rem .85rem; }
  .account-dashboard,.account-hero,.account-section,.account-metrics,.event-portfolio-grid,.account-two-column { width:100%; max-width:100%; }
  .account-hero h1 { font-size:clamp(1.75rem,9vw,2.25rem); overflow-wrap:anywhere; }
  .view-surface { padding-bottom:1.5rem; }
  .view-surface .page-header {
    min-height:auto;
    margin-bottom:.75rem;
    padding:.95rem 1rem;
    align-items:flex-start !important;
    flex-direction:column !important;
    border-radius:17px;
  }
  .view-surface .page-header > :last-child:not(:first-child) { width:100%; margin-left:0; }
  .view-surface .page-header .btn { flex:1; }
  .view-surface .page-title { font-size:1.45rem; }
  .view-surface .page-subtitle,.view-surface .page-header p { font-size:.78rem !important; }
  .view-surface .card { padding:1rem; border-radius:14px; }
  .form-row { gap:0; }
  .data-row { min-height:60px; padding:.8rem; }
  .metrics-grid,.trip-stats-row,.registration-summary-grid,.registration-metrics,.finance-overview-grid,.action-summary-grid,.communication-metrics,.account-metrics,.incident-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
  .metric-card,.trip-stat-card,.registration-summary-grid > div,.registration-metrics > div,.action-summary-grid > article,.communication-metrics > article,.incident-metrics > article { min-height:98px; padding:.82rem; }
  .metric-value,.trip-stat-value,.registration-summary-grid strong,.registration-metrics strong,.action-summary-grid strong,.communication-metrics strong,.incident-metrics strong { font-size:1.35rem; }
  .trip-tabs,.platform-tabs,.finance-tabs,.communication-nav,.live-section-tabs,.library-type-tabs,.action-filter-tabs,.calendar-toolbar { position:static; overflow-x:auto; flex-wrap:nowrap; scrollbar-width:none; }
  .trip-tabs::-webkit-scrollbar,.platform-tabs::-webkit-scrollbar,.finance-tabs::-webkit-scrollbar,.communication-nav::-webkit-scrollbar,.live-section-tabs::-webkit-scrollbar,.library-type-tabs::-webkit-scrollbar,.action-filter-tabs::-webkit-scrollbar { display:none; }
  .trip-tab,.platform-tabs button,.finance-tabs button,.communication-nav button,.live-section-tabs button,.library-type-tabs button,.action-filter-tabs button { flex:0 0 auto; white-space:nowrap; }
  .workspace-alert { align-items:stretch; flex-direction:column; }
  .workspace-alert .btn { width:100%; }
  .view-people .people-actions { width:100%; justify-content:stretch; }
  .view-people .people-actions .btn { flex:1 1 120px; }
  .calendar-wrapper { border-radius:14px; }
  .calendar-day { min-height:82px; padding:.3rem; }
  .calendar-day-number { width:21px; height:21px; }
  .event-portfolio-grid,.trip-grid,.resource-grid { grid-template-columns:1fr; }
  .event-portfolio-card,.trip-card { min-height:auto; }
  .live-hero,.communication-hero { border-radius:17px; }
  .create-workspace-page { padding:.75rem; }
  .create-workspace-page .page-header { flex-direction:column; align-items:flex-start; }
  .create-workspace-page .page-header .btn { width:100%; }
  .portal-header { border-radius:0 0 20px 20px; }
  .view-control .integration-card { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; }
  .view-control .integration-card > div { min-width:0; display:block; }
  .view-control .integration-card > div h2 { font-size:1.05rem; overflow-wrap:anywhere; }
  .view-control .integration-card > button { width:100%; grid-column:1 / -1; }
  .view-studio .integration-intro { width:100%; max-width:100%; display:grid; gap:.75rem; align-items:start; }
  .view-studio .integration-readiness { text-align:left; }
  .view-studio .integration-grid { width:100%; max-width:100%; grid-template-columns:minmax(0,1fr); }
  .view-studio article.integration-card { width:100%; max-width:100%; display:grid; }
}

.mobile-header .mobile-brand .mobile-wordmark { font-size:1rem;font-weight:800;letter-spacing:-.04em;color:var(--pw-ink); }
.mobile-header .mobile-brand .mobile-wordmark b { color:var(--pw-brand); }

@media (max-width: 430px) {
  .metrics-grid,.trip-stats-row,.registration-summary-grid,.registration-metrics,.finance-overview-grid,.action-summary-grid,.communication-metrics,.account-metrics,.incident-metrics { grid-template-columns:1fr 1fr; }
  .view-surface .page-header { padding:.85rem; }
  .btn { font-size:.78rem; }
  .calendar-day { min-height:70px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --pw-canvas:#0c1322;
    --pw-surface:#151e31;
    --pw-surface-soft:#19243a;
    --pw-surface-tint:#24244a;
    --pw-ink:#edf0f7;
    --pw-muted:#b8c3d6;
    --pw-faint:#a8b4c8;
    --pw-line:#26344c;
    --pw-brand:#c4bfff;
    --pw-brand-deep:#b5afff;
    --pw-brand-soft:#29294d;
    --pw-action:#44389f;
    --pw-action-deep:#352878;
    --pw-focus:#c4bfff;
    --pw-control-line:#7d8ca6;
    --pw-green:#b9f5dd;
    --pw-amber:#ffdda3;
    --pw-red:#ffc2cf;
    --pw-blue:#bdd6ff;
    --bg:var(--pw-canvas);
    --bg-card:var(--pw-surface);
    --bg-input:var(--pw-surface-soft);
    --text:var(--pw-ink);
    --text-muted:var(--pw-muted);
    --text-light:var(--pw-faint);
    --border:var(--pw-line);
    --primary:var(--pw-brand);
    --primary-dark:var(--pw-brand-deep);
    --primary-bg:var(--pw-brand-soft);
    --success-bg:#173b32;
    --warning-bg:#3c2d13;
    --danger-bg:#3e1d28;
    --info-bg:#172e4d;
    --accent:var(--pw-red);
    --info:var(--pw-blue);
  }
  .app-layout { background:radial-gradient(circle at 78% -10%,rgba(115,103,255,.12),transparent 30%),var(--pw-canvas); }
  .docs-header { background:linear-gradient(125deg,#151e31,#1b2240) !important; }
  .docs-toolbar { background:rgba(21,30,49,.92); }
  .view-surface .page-header,.view-surface .card,.data-row,.metric-card,.trip-stat-card,.registration-summary-grid > div,.registration-metrics > div,.action-summary-grid > article,.communication-metrics > article,.incident-metrics > article,.trip-tabs,.platform-tabs,.finance-tabs,.communication-nav,.live-section-tabs,.library-type-tabs,.action-filter-tabs,.calendar-toolbar,.trip-card,.itinerary-day,.calendar-wrapper,.calendar-day,.resource-card,.live-person,.live-run-item,.live-vendor-card,.reminder-rule,.communication-feed article,.operational-task,.travel-row,.reservation-card { background:var(--pw-surface); border-color:var(--pw-line); }
  .view-surface .page-header { background:linear-gradient(125deg,#151e31,#1b2240); }
  .form-control { color:var(--pw-ink); border-color:#33435d; background-color:var(--pw-surface-soft); }
  .form-control:focus { background-color:#1d2941; }
  .btn-outline { color:#d0d6e2; border-color:#34445f; background:#19243a; }
  .data-row strong,.section-heading h2,.section-heading h3,.panel-heading h2,.view-surface .page-title,.metric-value,.trip-stat-value { color:var(--pw-ink); }
  .muted-empty,.card.card-flat[style*="text-align:center"] { color:var(--pw-muted) !important; border-color:#34435b !important; background:rgba(20,29,48,.7) !important; }
  .calendar-header-day,.trip-card-actions,.itinerary-day-header,.chat-stream,.allocation-builder,.conversion-preview,.ticket-sales-controls,.task-centre-toolbar { background:#111a2b; }
  .calendar-day:hover,.data-row:hover,.action-task-row:hover,.dashboard-library-items button:hover,.feed-row:hover { background:var(--pw-surface-soft); }
  .view-categories form:not(.compact-form) { background:var(--pw-surface); border-color:var(--pw-line); }
}

/* Usability hardening: responsive workspaces, clear navigation, and safe review flows. */
.view-surface,.library-page,.library-workspace,.library-workspace > *,.library-toolbar,.library-type-tabs,.resource-grid,.organization-grid { min-width:0; max-width:100%; }
.view-trips > div,.trip-hub,.trip-hub > *,.trip-hub-grid,.trip-hub-grid > * { min-width:0; max-width:100%; }
.trip-hub-nav { width:100%; max-width:100%; min-width:0; }
.trip-hub-nav button { flex:0 0 auto; }
.nav-group { display:block; margin-bottom:.72rem; }
.nav-group .nav-section-label { margin:.2rem .75rem .25rem; }
.calendar-toolbar { justify-content:space-between; flex-wrap:wrap; }
.calendar-month-controls,.calendar-view-toggle { display:flex; align-items:center; gap:.55rem; }
.calendar-month-controls strong { min-width:150px; text-align:center; }
.calendar-view-toggle { padding:.25rem; border:1px solid var(--pw-line); border-radius:11px; background:var(--pw-surface-soft); }
.calendar-view-toggle button { display:flex; align-items:center; gap:.35rem; padding:.48rem .65rem; border:0; border-radius:8px; color:var(--pw-muted); background:transparent; font:700 .76rem inherit; cursor:pointer; }
.calendar-view-toggle button.active { color:#fff; background:var(--pw-brand); box-shadow:0 5px 14px rgba(99,91,255,.2); }
.calendar-agenda-list { display:grid; gap:.55rem; }
.calendar-agenda-row { width:100%; display:grid; grid-template-columns:84px 38px minmax(0,1fr) auto; align-items:center; gap:.7rem; padding:.82rem .9rem; border:1px solid var(--pw-line); border-radius:13px; color:var(--pw-ink); background:var(--pw-surface); text-align:left; font:inherit; cursor:pointer; }
.calendar-agenda-row:hover { border-color:rgba(99,91,255,.38); background:var(--pw-brand-soft); }
.calendar-agenda-row time,.calendar-agenda-row > span:nth-child(3) { display:grid; gap:.1rem; min-width:0; }
.calendar-agenda-row time span,.calendar-agenda-row small { color:var(--pw-muted); font-size:.7rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.calendar-agenda-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:var(--pw-brand); background:var(--pw-brand-soft); }
.channel-picker label.channel-unavailable { opacity:.55; cursor:not-allowed; background:var(--pw-surface-soft); }
.channel-picker label.channel-unavailable input { cursor:not-allowed; }
.assistant-draft { border-color:rgba(99,91,255,.28); }
.assistant-draft-list { display:grid; gap:.5rem; margin-top:.8rem; }
.assistant-draft-list > label { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:start; gap:.75rem; padding:.8rem; border:1px solid var(--pw-line); border-radius:11px; background:var(--pw-surface-soft); cursor:pointer; }
.assistant-draft-list > label.selected { border-color:rgba(99,91,255,.42); background:var(--pw-brand-soft); }
.assistant-draft-list input { margin-top:.2rem; accent-color:var(--pw-brand); }
.assistant-draft-list strong,.assistant-draft-list small { display:block; }
.assistant-draft-list small { margin-top:.18rem; color:var(--pw-muted); }
.assistant-draft-actions { display:flex; justify-content:flex-end; gap:.55rem; margin-top:1rem; }
/* The Registration Engine supersedes the older limited RSVP-question form. */
.registration-engine + .portal-publishing-panel + .platform-split { display:none; }

@media (max-width: 768px) {
  .view-library { overflow:hidden; }
  .view-library .library-page,.view-library .library-workspace,.view-library .organization-panel { width:100%; overflow:hidden; }
  .view-library .library-toolbar { width:100%; display:grid; grid-template-columns:minmax(0,1fr); gap:.65rem; }
  .view-library .library-toolbar > .form-control { width:100%; }
  .view-library .library-type-tabs { width:100%; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; padding-bottom:.4rem; }
  .view-library .library-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .view-library .resource-grid { grid-template-columns:minmax(0,1fr); }
  .view-library .organization-grid { grid-template-columns:minmax(0,1fr); }
  .view-library .organization-member-form { grid-template-columns:minmax(0,1fr); }
  .view-library .organization-row { align-items:flex-start; flex-direction:column; }
  .view-library .organization-row > div:last-child { width:100%; justify-content:flex-start; }
  .view-trips { overflow:hidden; }
  .view-trips .trip-hub-nav { overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; }
  .calendar-toolbar { gap:.7rem; }
  .calendar-month-controls,.calendar-view-toggle { width:100%; justify-content:center; }
  .calendar-agenda-row { grid-template-columns:62px 34px minmax(0,1fr) auto; gap:.5rem; padding:.72rem; }
  .calendar-agenda-row > .material-icon { font-size:1rem; }
  .platform-tabs,.studio-tabs,.live-section-tabs,.trip-tabs,.communication-nav { box-shadow:inset -18px 0 18px -20px rgba(15,23,42,.75); scroll-snap-type:x proximity; }
  .platform-tabs button,.studio-tabs button,.live-section-tabs button,.trip-tabs button,.communication-nav button { scroll-snap-align:start; }
  .mobile-nav-group { width:100%; margin:0 0 .75rem; padding-bottom:.45rem; border-bottom:1px solid var(--pw-line); }
  .mobile-nav-group .nav-item { width:100%; margin:2px 0; padding:.75rem; border-radius:9px; }
  .assistant-card { align-items:flex-start; }
  .assistant-card .btn { width:100%; }
  .assistant-draft-list > label { grid-template-columns:auto minmax(0,1fr); }
  .assistant-draft-list > label > .tag { grid-column:2; justify-self:start; }
  .assistant-draft-actions { display:grid; grid-template-columns:1fr; }
}

/* Explicit appearance preference. The resolved choice is applied before React renders. */
:root[data-theme="light"] {
  color-scheme:light;
  --pw-canvas:#f3f5fa;
  --pw-surface:#ffffff;
  --pw-surface-soft:#f8f9fc;
  --pw-surface-tint:#f0efff;
  --pw-ink:#182033;
  --pw-muted:#41495a;
  --pw-faint:#444c5c;
  --pw-line:#e4e8f0;
  --pw-brand:#44389f;
  --pw-brand-deep:#352878;
  --pw-brand-soft:#eeecfb;
  --pw-action:#44389f;
  --pw-action-deep:#352878;
  --pw-focus:#44389f;
  --pw-control-line:#737e90;
  --pw-green:#075c41;
  --pw-amber:#5c3900;
  --pw-red:#8c1232;
  --pw-blue:#17428a;
  --bg:var(--pw-canvas);
  --bg-card:var(--pw-surface);
  --bg-sidebar:#ffffff;
  --bg-input:var(--pw-surface-soft);
  --bg-dropdown:#ffffff;
  --text:var(--pw-ink);
  --text-muted:var(--pw-muted);
  --text-light:var(--pw-faint);
  --border:var(--pw-line);
  --primary:var(--pw-brand);
  --primary-dark:var(--pw-brand-deep);
  --primary-bg:var(--pw-brand-soft);
  --success-bg:#e6f4ef;
  --warning-bg:#fbf0dd;
  --danger-bg:#fde8ed;
  --info-bg:#e8f0ff;
  --accent:var(--pw-red);
  --info:var(--pw-blue);
  --shadow:var(--pw-shadow-sm);
  --shadow-lg:var(--pw-shadow-md);
}

:root[data-theme="dark"] {
  color-scheme:dark;
  --pw-canvas:#0c1322;
  --pw-surface:#151e31;
  --pw-surface-soft:#19243a;
  --pw-surface-tint:#24244a;
  --pw-ink:#edf0f7;
  --pw-muted:#b8c3d6;
  --pw-faint:#a8b4c8;
  --pw-line:#26344c;
  --pw-brand:#c4bfff;
  --pw-brand-deep:#b5afff;
  --pw-brand-soft:#29294d;
  --pw-action:#44389f;
  --pw-action-deep:#352878;
  --pw-focus:#c4bfff;
  --pw-control-line:#7d8ca6;
  --pw-green:#b9f5dd;
  --pw-amber:#ffdda3;
  --pw-red:#ffc2cf;
  --pw-blue:#bdd6ff;
  --bg:var(--pw-canvas);
  --bg-card:var(--pw-surface);
  --bg-sidebar:#0f1729;
  --bg-input:var(--pw-surface-soft);
  --bg-dropdown:var(--pw-surface-soft);
  --text:var(--pw-ink);
  --text-muted:var(--pw-muted);
  --text-light:var(--pw-faint);
  --border:var(--pw-line);
  --primary:var(--pw-brand);
  --primary-dark:var(--pw-brand-deep);
  --primary-bg:var(--pw-brand-soft);
  --success-bg:#173b32;
  --warning-bg:#3c2d13;
  --danger-bg:#3e1d28;
  --info-bg:#172e4d;
  --accent:var(--pw-red);
  --info:var(--pw-blue);
  --shadow:0 1px 3px rgba(0,0,0,.2),0 4px 24px rgba(0,0,0,.3);
  --shadow-lg:0 4px 12px rgba(0,0,0,.3),0 12px 40px rgba(0,0,0,.4);
}

.theme-toggle { width:100%; min-height:38px; margin:0 0 .55rem; padding:.55rem .7rem; display:flex; align-items:center; justify-content:center; gap:.48rem; border:1px solid #30374d; border-radius:10px; color:#c8cede; background:rgba(255,255,255,.045); font:700 .76rem inherit; cursor:pointer; }
.theme-toggle:hover { color:#fff; border-color:#48516c; background:rgba(255,255,255,.08); }
.theme-toggle .material-icon { font-size:1rem; }
.mobile-theme-toggle { flex:0 0 auto; }

:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-layout { background:radial-gradient(circle at 78% -10%,rgba(115,103,255,.12),transparent 30%),var(--pw-canvas); }
:root[data-theme="dark"] .workspace-topbar { color:var(--pw-ink); background:rgba(15,20,35,.88); border-color:#273047; }
:root[data-theme="dark"] .docs-header { background:linear-gradient(125deg,#151e31,#1b2240) !important; }
:root[data-theme="dark"] .docs-toolbar,
:root[data-theme="dark"] .studio-tabs { background:rgba(21,30,49,.92); }
:root[data-theme="dark"] .view-surface .page-header,
:root[data-theme="dark"] .view-surface .card,
:root[data-theme="dark"] .data-row,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .trip-stat-card,
:root[data-theme="dark"] .registration-summary-grid > div,
:root[data-theme="dark"] .registration-metrics > div,
:root[data-theme="dark"] .action-summary-grid > article,
:root[data-theme="dark"] .communication-metrics > article,
:root[data-theme="dark"] .incident-metrics > article,
:root[data-theme="dark"] .trip-tabs,
:root[data-theme="dark"] .trip-hub-nav,
:root[data-theme="dark"] .platform-tabs,
:root[data-theme="dark"] .finance-tabs,
:root[data-theme="dark"] .communication-nav,
:root[data-theme="dark"] .live-section-tabs,
:root[data-theme="dark"] .library-type-tabs,
:root[data-theme="dark"] .action-filter-tabs,
:root[data-theme="dark"] .calendar-toolbar,
:root[data-theme="dark"] .trip-card,
:root[data-theme="dark"] .itinerary-day,
:root[data-theme="dark"] .calendar-wrapper,
:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .resource-card,
:root[data-theme="dark"] .live-person,
:root[data-theme="dark"] .live-run-item,
:root[data-theme="dark"] .live-vendor-card,
:root[data-theme="dark"] .reminder-rule,
:root[data-theme="dark"] .communication-feed article,
:root[data-theme="dark"] .operational-task,
:root[data-theme="dark"] .travel-row,
:root[data-theme="dark"] .reservation-card,
:root[data-theme="dark"] .studio-panel,
:root[data-theme="dark"] .venue-create-row,
:root[data-theme="dark"] .venue-designer,
:root[data-theme="dark"] .site-preview,
:root[data-theme="dark"] .integration-intro,
:root[data-theme="dark"] .integration-card { color:var(--pw-ink); background:var(--pw-surface); border-color:var(--pw-line); }
:root[data-theme="dark"] .trip-hub-nav button { color:var(--pw-muted); }
:root[data-theme="dark"] .trip-hub-nav button.active { color:#fff; }
:root[data-theme="dark"] .view-surface .page-header { background:linear-gradient(125deg,#151e31,#1b2240); }
:root[data-theme="dark"] .studio-metric { background:linear-gradient(145deg,var(--pw-surface),#111a2d); }
:root[data-theme="dark"] .coverage-list button,
:root[data-theme="dark"] .studio-empty,
:root[data-theme="dark"] .automation-list article,
:root[data-theme="dark"] .procurement-column,
:root[data-theme="dark"] .album-strip button,
:root[data-theme="dark"] .professional-summary button,
:root[data-theme="dark"] .calendar-header-day,
:root[data-theme="dark"] .trip-card-actions,
:root[data-theme="dark"] .itinerary-day-header,
:root[data-theme="dark"] .chat-stream,
:root[data-theme="dark"] .allocation-builder,
:root[data-theme="dark"] .conversion-preview,
:root[data-theme="dark"] .ticket-sales-controls,
:root[data-theme="dark"] .task-centre-toolbar { background:#111a2b; border-color:var(--pw-line); }
:root[data-theme="dark"] .procurement-column article { background:#1a2540; }
:root[data-theme="dark"] .venue-board { background-color:#111a2d; background-image:linear-gradient(#27334a 1px,transparent 1px),linear-gradient(90deg,#27334a 1px,transparent 1px); }
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .app-layout .form-control { color:var(--pw-ink); border-color:var(--pw-control-line); background-color:var(--pw-surface-soft); }
:root[data-theme="dark"] .form-control:focus { background-color:#1d2941; }
:root[data-theme="dark"] .btn-outline { color:#d0d6e2; border-color:var(--pw-control-line); background:#19243a; }
:root[data-theme="dark"] .data-row strong,
:root[data-theme="dark"] .section-heading h2,
:root[data-theme="dark"] .section-heading h3,
:root[data-theme="dark"] .panel-heading h2,
:root[data-theme="dark"] .view-surface .page-title,
:root[data-theme="dark"] .metric-value,
:root[data-theme="dark"] .trip-stat-value { color:var(--pw-ink); }
:root[data-theme="dark"] .muted-empty,
:root[data-theme="dark"] .card.card-flat[style*="text-align:center"] { color:var(--pw-muted) !important; border-color:#34435b !important; background:rgba(20,29,48,.7) !important; }
:root[data-theme="dark"] .calendar-day:hover,
:root[data-theme="dark"] .data-row:hover,
:root[data-theme="dark"] .action-task-row:hover,
:root[data-theme="dark"] .dashboard-library-items button:hover,
:root[data-theme="dark"] .feed-row:hover { background:#19243a; }
:root[data-theme="dark"] .view-categories form:not(.compact-form) { background:var(--pw-surface); border-color:var(--pw-line); }

:root[data-theme="light"] body,
:root[data-theme="light"] .app-layout { background:radial-gradient(circle at 78% -10%,rgba(98,88,238,.075),transparent 31%),var(--pw-canvas); }
:root[data-theme="light"] .workspace-topbar { color:var(--pw-ink); background:rgba(255,255,255,.82); border-color:rgba(225,230,240,.9); }
:root[data-theme="light"] .docs-header,
:root[data-theme="light"] .view-surface .page-header { background:linear-gradient(125deg,rgba(255,255,255,.98),rgba(248,248,255,.95)) !important; }
:root[data-theme="light"] .docs-toolbar,
:root[data-theme="light"] .studio-tabs { background:rgba(255,255,255,.88); }
:root[data-theme="light"] .form-control,
:root[data-theme="light"] .app-layout .form-control { color:var(--pw-ink); border-color:var(--pw-control-line); background-color:#f9fafc; }
:root[data-theme="light"] .form-control:focus { background-color:#fff; }
:root[data-theme="light"] .btn-outline { color:var(--pw-ink); border-color:var(--pw-control-line); background:#fff; }
:root[data-theme="light"] .studio-panel,
:root[data-theme="light"] .venue-create-row,
:root[data-theme="light"] .venue-designer,
:root[data-theme="light"] .site-preview,
:root[data-theme="light"] .integration-intro,
:root[data-theme="light"] .integration-card { background:var(--pw-surface); }
:root[data-theme="light"] .studio-metric { background:linear-gradient(145deg,#fff,#f8f9fc); }
:root[data-theme="light"] .coverage-list button,
:root[data-theme="light"] .studio-empty,
:root[data-theme="light"] .automation-list article,
:root[data-theme="light"] .procurement-column,
:root[data-theme="light"] .album-strip button,
:root[data-theme="light"] .professional-summary button { background:var(--pw-surface-soft); }

/* WCAG contrast roles: readable brand text and dark action fills are separate
 * so the same component remains AAA in both light and dark themes. */
.workspace-topbar button { color:var(--pw-brand); background:var(--pw-brand-soft); }
.workspace-topbar button.active,
.studio-pulse,
.segmented-control button.active,
.segmented button.active,
.trip-hub-nav button.active,
.calendar-day.today .calendar-day-number,
.calendar-view-toggle button.active,
.docs-steps li > span,
.activity-hero-score,
.activity-filter-tabs button.active,
.workspace-tool-tabs button.active,
.quick-sum-result {
  color:#fff !important;
  background:var(--pw-action) !important;
  border-color:var(--pw-action) !important;
}
.trip-tab.active,
.platform-tabs button.active,
.finance-tabs button.active,
.communication-nav button.active,
.live-section-tabs button.active,
.library-type-tabs button.active,
.action-filter-tabs button.active,
.calendar-toolbar button.active,
.docs-type-filters button.active {
  color:#fff;
  background:linear-gradient(135deg,var(--pw-action),var(--pw-action-deep));
}
.docs-guide-icon,.onboarding-hero-icon {
  color:#fff;
  background:linear-gradient(135deg,var(--pw-action),var(--pw-action-deep));
}
.account-hero,.live-hero > div,.assistant-orb {
  color:#fff;
  background:linear-gradient(135deg,#352878,#44389f 58%,#6f1234);
}
.studio-hero { background:linear-gradient(125deg,#11182d 0%,#272d52 58%,#44389f 135%); }
.auth-shell { background:radial-gradient(circle at 12% 8%,rgba(196,191,255,.13),transparent 34%),linear-gradient(140deg,#111629,#272d52 62%,#44389f); }

/* Sidebar labels were previously visually faint (roughly 3–5:1). */
.sidebar-brand p,.sidebar .nav-section-label,.event-switcher label,.sidebar-account small { color:#b8c3d6; }
.sidebar .nav-item,.sidebar-account .btn,.sidebar-command-button { color:#c7cede; }
.sidebar .nav-item > .material-icon { color:#d8deea; }

/* Status text and its tint are paired rather than relying on transparent
 * brand colors whose effective contrast varies by parent surface. */
.tag-shared { color:var(--pw-brand); background:var(--pw-brand-soft); }
.tag-success { color:var(--success); background:var(--success-bg); }
.tag-warning { color:var(--warning); background:var(--warning-bg); }
.tag-danger,.tag-bride { color:var(--danger); background:var(--danger-bg); }
.tag-groom { color:var(--info); background:var(--info-bg); }

:root[data-theme="dark"] .btn-success { color:#071d16; background:#b9f5dd; }
:root[data-theme="dark"] .btn-danger { color:#2b0711; background:#ffc2cf; }
:root[data-theme="light"] .calendar-header-day { color:var(--pw-muted); background:var(--pw-surface-soft); }
:root[data-theme="light"] .muted-empty,
:root[data-theme="light"] .card.card-flat[style*="text-align:center"] { color:var(--pw-muted) !important; border-color:var(--pw-line) !important; background:var(--pw-surface-soft) !important; }
:root[data-theme="dark"] .forecast-row,
:root[data-theme="dark"] .deadline-list > div { color:var(--pw-ink); border-color:var(--pw-line); background:var(--pw-surface); }
.mobile-nav-group .nav-section-label { color:var(--pw-muted); }
.calendar-day-number { color:var(--pw-muted); opacity:1; }
.calendar-day.today .calendar-day-number,
.calendar-day.wedding-day .calendar-day-number { color:#fff; background:var(--pw-action); opacity:1; }
.calendar-day.wedding-day { color:#fff; border-color:var(--pw-action); background:var(--pw-action); }
.trip-days-badge { color:#fff; background:var(--pw-action); }
.trip-status-badge { color:#fff; }

/* Guided setup, event starters, and account-wide command palette */
.sidebar-command-button { width:100%; min-height:40px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.5rem; margin:0 0 .7rem; padding:.55rem .62rem; border:1px solid #30384f; border-radius:10px; color:#aeb6ca; background:rgba(255,255,255,.045); font:700 .72rem inherit; text-align:left; cursor:pointer; }
.sidebar-command-button:hover { color:#fff; border-color:#48516c; background:rgba(255,255,255,.08); }
.sidebar-command-button .material-icon { font-size:1rem; }
.sidebar-command-button kbd,.topbar-search kbd { padding:.15rem .3rem; border:1px solid currentColor; border-radius:5px; opacity:.65; font:700 .6rem inherit; }

/* Desktop sidebar can collapse to a persistent, accessible icon rail. */
@media (min-width: 769px) {
  .app-layout > .sidebar { overflow-x:hidden; transition:width .2s ease,padding .2s ease; }
  .sidebar-collapse-toggle { width:31px; height:31px; margin-left:auto; flex:0 0 auto; display:grid; place-items:center; padding:0; border:1px solid rgba(255,255,255,.12); border-radius:9px; color:#c9cfdf; background:rgba(255,255,255,.055); cursor:pointer; transition:background .15s ease,color .15s ease; }
  .sidebar-collapse-toggle:hover { color:#fff; background:rgba(255,255,255,.11); }
  .sidebar-collapse-toggle:focus-visible { outline:3px solid var(--pw-focus); outline-offset:2px; }
  .sidebar-collapse-toggle .material-icon { font-size:1.1rem; }
  .sidebar.collapsed { width:76px!important; padding:1.1rem .55rem!important; }
  .sidebar.collapsed .sidebar-brand { flex-direction:column; gap:.6rem!important; padding:.3rem 0 .8rem!important; }
  .sidebar.collapsed .sidebar-brand > div,.sidebar.collapsed .event-switcher,.sidebar.collapsed .nav-section-label,.sidebar.collapsed .nav-label,.sidebar.collapsed .sidebar-command-button > span,.sidebar.collapsed .sidebar-command-button kbd,.sidebar.collapsed .sidebar-account small,.sidebar.collapsed .sidebar-account strong,.sidebar.collapsed .theme-toggle > span,.sidebar.collapsed .sidebar-logout > span { display:none!important; }
  .sidebar.collapsed .sidebar-collapse-toggle { margin:0; }
  .sidebar.collapsed .global-back { margin-bottom:.45rem; }
  .sidebar.collapsed .nav-group { margin-bottom:.3rem; }
  .sidebar.collapsed .nav-item { min-height:50px; justify-content:center; gap:0!important; padding:.45rem!important; }
  .sidebar.collapsed .nav-item > .material-icon { width:36px; height:36px; flex:0 0 36px; padding:4px; border-radius:10px; }
  .sidebar.collapsed .sidebar-account { padding:.7rem 0 .1rem; }
  .sidebar.collapsed .sidebar-command-button,.sidebar.collapsed .theme-toggle,.sidebar.collapsed .sidebar-logout { display:grid; place-items:center; width:44px; min-width:44px; height:42px; min-height:42px; margin:.42rem auto; padding:0; }
  .sidebar.collapsed :is(.sidebar-command-button,.theme-toggle,.sidebar-logout) .material-icon { width:24px; height:24px; }
  .sidebar.collapsed .sidebar-command-button { grid-template-columns:1fr; }
  .sidebar.collapsed .sidebar-account > div { display:flex; justify-content:center; margin:.42rem auto; padding:0; }
  .sidebar.collapsed .sidebar-account > div > span { grid-row:auto; width:38px; height:38px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-layout > .sidebar { transition:none; }
}
.workspace-topbar .topbar-search { display:inline-flex; align-items:center; gap:.38rem; color:var(--pw-muted); background:transparent; border:1px solid var(--pw-line); }
.workspace-topbar .topbar-search:hover { color:var(--pw-brand); background:var(--pw-brand-soft); }
.workspace-topbar .topbar-search .material-icon { font-size:.95rem; }

.starter-template-section { margin:1rem 0 1.2rem; padding-top:1.1rem; border-top:1px solid var(--pw-line); }
.starter-template-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
.starter-template-card { min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.7rem; padding:.8rem; border:1px solid var(--pw-line); border-radius:13px; color:var(--pw-ink); background:var(--pw-surface-soft); font:inherit; text-align:left; cursor:pointer; }
.starter-template-card:hover,.starter-template-card.selected { border-color:color-mix(in srgb,var(--pw-brand) 55%,var(--pw-line)); background:var(--pw-brand-soft); box-shadow:0 7px 20px rgba(80,70,190,.08); }
.starter-template-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; color:var(--pw-brand); background:var(--pw-surface); }
.starter-template-card > span:nth-child(2) { min-width:0; display:grid; gap:.12rem; }
.starter-template-card small { color:var(--pw-brand); font-size:.65rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.starter-template-card strong { overflow:hidden; color:var(--pw-ink); font-size:.78rem; text-overflow:ellipsis; white-space:nowrap; }
.starter-template-card em { color:var(--pw-muted); font-size:.66rem; font-style:normal; }
.starter-template-card > i { color:var(--pw-brand); }
.starter-preview { display:grid; gap:.45rem; margin-top:.65rem; padding:.75rem .85rem; border:1px dashed color-mix(in srgb,var(--pw-brand) 32%,var(--pw-line)); border-radius:12px; background:color-mix(in srgb,var(--pw-brand-soft) 55%,transparent); }
.starter-preview > strong { color:var(--pw-ink); font-size:.72rem; }
.starter-preview > div { display:flex; flex-wrap:wrap; gap:.35rem .75rem; }
.starter-preview span { display:inline-flex; align-items:center; gap:.25rem; color:var(--pw-muted); font-size:.66rem; }
.starter-preview .material-icon { color:var(--pw-green); font-size:.85rem; }

.onboarding-overlay,.command-overlay { position:fixed; inset:0; z-index:20000; display:grid; place-items:center; padding:1rem; background:rgba(7,11,23,.72); backdrop-filter:blur(12px); }
.onboarding-dialog { position:relative; width:min(760px,calc(100vw - 2rem)); max-height:calc(100dvh - 2rem); overflow-y:auto; padding:clamp(1.25rem,3vw,2rem); border:1px solid rgba(255,255,255,.12); border-radius:24px; color:var(--pw-ink); background:var(--pw-surface); box-shadow:0 35px 100px rgba(0,0,0,.38); }
.onboarding-close { position:absolute; top:1rem; right:1rem; width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--pw-line); border-radius:11px; color:var(--pw-muted); background:var(--pw-surface-soft); cursor:pointer; }
.onboarding-progress { display:flex; gap:.3rem; margin-bottom:1.3rem; }
.onboarding-progress span { width:32px; height:4px; border-radius:99px; background:var(--pw-line); }
.onboarding-progress span.active { background:var(--pw-brand); }
.onboarding-step { animation:onboardingIn .24s ease; }
.onboarding-step > h1 { max-width:600px; margin:.3rem 0 .55rem; font-size:clamp(1.65rem,4vw,2.45rem); line-height:1.05; letter-spacing:-.05em; }
.onboarding-step > p { max-width:620px; margin:0 0 1.25rem; color:var(--pw-muted); line-height:1.6; }
.onboarding-hero-icon { width:58px; height:58px; display:grid; place-items:center; margin-bottom:1rem; border-radius:17px; color:#fff; background:linear-gradient(135deg,var(--pw-brand),#9b63ef); box-shadow:0 14px 32px rgba(98,88,238,.28); }
.onboarding-hero-icon .material-icon { font-size:1.7rem; }
.onboarding-benefits { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; margin:1.25rem 0; }
.onboarding-benefits > span { min-width:0; display:grid; grid-template-columns:auto 1fr; gap:.12rem .55rem; padding:.85rem; border:1px solid var(--pw-line); border-radius:13px; background:var(--pw-surface-soft); }
.onboarding-benefits .material-icon { grid-row:1/3; color:var(--pw-brand); }
.onboarding-benefits b { font-size:.75rem; }
.onboarding-benefits small { overflow:hidden; color:var(--pw-muted); font-size:.63rem; text-overflow:ellipsis; white-space:nowrap; }
.onboarding-step > .btn-block { justify-content:center; }
.onboarding-workspaces,.onboarding-pack-list { display:grid; gap:.5rem; max-height:340px; overflow-y:auto; padding:.1rem; }
.onboarding-workspaces > button,.onboarding-pack-list > button { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.75rem; padding:.8rem; border:1px solid var(--pw-line); border-radius:13px; color:var(--pw-ink); background:var(--pw-surface-soft); font:inherit; text-align:left; cursor:pointer; }
.onboarding-workspaces > button:hover,.onboarding-workspaces > button.selected,.onboarding-pack-list > button:hover,.onboarding-pack-list > button.selected { border-color:var(--pw-brand); background:var(--pw-brand-soft); }
.onboarding-workspaces > button > span { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; color:var(--pw-brand); background:var(--pw-surface); }
.onboarding-workspaces button div,.onboarding-pack-list button span { min-width:0; display:grid; gap:.15rem; }
.onboarding-workspaces strong,.onboarding-pack-list strong { overflow:hidden; font-size:.78rem; text-overflow:ellipsis; white-space:nowrap; }
.onboarding-workspaces small,.onboarding-pack-list small { color:var(--pw-muted); font-size:.66rem; }
.onboarding-pack-list > button > .material-icon:first-child { color:var(--pw-brand); }
.onboarding-type-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; }
.onboarding-type-grid > button { display:flex; flex-direction:column; align-items:flex-start; gap:.55rem; min-height:200px; padding:1rem; border:1px solid var(--pw-line); border-radius:15px; color:var(--pw-ink); background:var(--pw-surface-soft); font:inherit; text-align:left; cursor:pointer; }
.onboarding-type-grid > button:hover { border-color:var(--pw-brand); transform:translateY(-2px); box-shadow:var(--pw-shadow-sm); }
.onboarding-type-grid > button > span { width:44px; height:44px; display:grid; place-items:center; border-radius:12px; color:var(--pw-brand); background:var(--pw-brand-soft); }
.onboarding-type-grid strong { font-size:.9rem; }
.onboarding-type-grid small { color:var(--pw-muted); font-size:.68rem; line-height:1.5; }
.onboarding-type-grid em { display:inline-flex; align-items:center; gap:.2rem; margin-top:auto; color:var(--pw-brand); font-size:.68rem; font-style:normal; font-weight:800; }
.onboarding-type-grid em .material-icon { font-size:.9rem; }
.onboarding-actions { display:flex; justify-content:space-between; gap:.65rem; margin-top:1.1rem; }
@keyframes onboardingIn { from { opacity:0; transform:translateY(5px); } }

.command-overlay { place-items:start center; padding-top:min(14vh,120px); }
.command-dialog { width:min(680px,calc(100vw - 2rem)); overflow:hidden; border:1px solid rgba(255,255,255,.13); border-radius:19px; color:var(--pw-ink); background:var(--pw-surface); box-shadow:0 35px 100px rgba(0,0,0,.45); }
.command-input { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.7rem; padding:.8rem 1rem; border-bottom:1px solid var(--pw-line); }
.command-input > .material-icon { color:var(--pw-brand); }
.command-input input { min-width:0; border:0; outline:0; color:var(--pw-ink); background:transparent; font:650 .92rem inherit; }
.command-input:focus-within { outline:3px solid var(--pw-focus); outline-offset:-3px; }
.command-input input::placeholder { color:var(--pw-faint); }
.command-input kbd,.command-dialog footer kbd { padding:.18rem .35rem; border:1px solid var(--pw-line); border-radius:6px; color:var(--pw-muted); background:var(--pw-surface-soft); font:750 .6rem inherit; }
.command-results { max-height:min(58vh,480px); overflow-y:auto; padding:.45rem; }
.command-section-label { padding:.45rem .6rem .3rem; color:var(--pw-faint); font-size:.65rem; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.command-results > button { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.7rem; padding:.65rem .7rem; border:0; border-radius:11px; color:var(--pw-ink); background:transparent; font:inherit; text-align:left; cursor:pointer; }
.command-results > button.active,.command-results > button:hover { background:var(--pw-brand-soft); }
.command-result-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:var(--pw-brand); background:var(--pw-surface-soft); }
.command-results button > span:nth-child(2) { min-width:0; display:grid; gap:.14rem; }
.command-results strong { overflow:hidden; font-size:.76rem; text-overflow:ellipsis; white-space:nowrap; }
.command-results small { overflow:hidden; color:var(--pw-muted); font-size:.64rem; text-overflow:ellipsis; white-space:nowrap; }
.command-results em { color:var(--pw-faint); font-size:.58rem; font-style:normal; text-transform:capitalize; }
.command-empty { min-height:140px; display:grid; place-items:center; align-content:center; gap:.35rem; color:var(--pw-muted); text-align:center; font-size:.72rem; }
.command-empty .material-icon { color:var(--pw-faint); font-size:1.7rem; }
.command-dialog footer { display:flex; align-items:center; gap:1rem; padding:.6rem 1rem; border-top:1px solid var(--pw-line); color:var(--pw-faint); background:var(--pw-surface-soft); font-size:.65rem; }
.command-dialog footer span { display:flex; align-items:center; gap:.28rem; }
.command-dialog footer span:last-child { margin-left:auto; }

:root[data-theme="dark"] .starter-template-card,
:root[data-theme="dark"] .onboarding-benefits > span,
:root[data-theme="dark"] .onboarding-workspaces > button,
:root[data-theme="dark"] .onboarding-pack-list > button,
:root[data-theme="dark"] .onboarding-type-grid > button { background:#111a2b; }

@media(max-width:768px) {
  .mobile-command-toggle { flex:0 0 auto; }
  .workspace-topbar .topbar-search kbd { display:none; }
  .workspace-topbar .topbar-search { padding:.45rem; font-size:0; }
  .starter-template-grid,.onboarding-type-grid { grid-template-columns:1fr; }
  .onboarding-benefits { grid-template-columns:1fr; }
  .onboarding-dialog { padding:1.1rem; border-radius:18px; }
  .onboarding-type-grid > button { min-height:auto; }
  .command-overlay { padding:.55rem; padding-top:7vh; }
  .command-dialog { width:100%; }
  .command-dialog footer span:last-child { display:none; }
  .command-results { max-height:64vh; }
}

@media(max-width:430px) {
  .mobile-header > select { max-width:92px !important; }
  .onboarding-step > h1 { padding-right:2rem; }
  .starter-template-grid { grid-template-columns:minmax(0,1fr); }
}
:root[data-theme="light"] .procurement-column article { background:#fff; }
:root[data-theme="light"] .venue-board { background-color:#f9fafc; background-image:linear-gradient(#e9edf4 1px,transparent 1px),linear-gradient(90deg,#e9edf4 1px,transparent 1px); }

/* 2026 full-product UI sweep -------------------------------------------------
   These rules deliberately sit last. They provide one layout contract for
   cards, dense operational rows and feature panes that were built at
   different times, without changing their domain behavior. */
.view-surface :is(article,section,form,div) { min-width:0; }
.view-surface :is(h1,h2,h3,h4,p,strong,small,span) { overflow-wrap:anywhere; }
.view-surface .section-heading { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; }
.view-surface .section-heading > :first-child { flex:1 1 260px; min-width:0; }
.view-surface .section-heading > :last-child:not(:first-child) { flex:0 0 auto; }
.view-surface :is(.card,.studio-panel,.compact-form,.settings-form) > :first-child { margin-top:0; }
.view-surface :is(.card,.studio-panel,.compact-form,.settings-form) > :last-child { margin-bottom:0; }

.operational-task { padding:1rem 1.05rem; }
.operational-task-header { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; }
.operational-task-status { flex:1 1 auto; min-width:0; align-items:center; }
.operational-task-status .tag { max-width:100%; }
.task-counts { position:static; top:auto; right:auto; flex:0 0 auto; align-items:center; justify-content:flex-end; padding:.28rem .42rem; border:1px solid var(--pw-line); border-radius:9px; color:var(--pw-muted); background:var(--pw-surface-soft); }
.task-counts span { white-space:nowrap; }
.operational-task h3 { margin-top:.72rem; font-size:1rem; line-height:1.35; }
.task-metadata { row-gap:.5rem; }
.task-metadata span { min-width:0; }
.task-dependency-summary span { max-width:100%; }
.task-centre { container-type:inline-size; }

.data-row > div,.feed-row > span,.travel-row > div,.approval-row > div,.ticket-order-row > div,.participant-row > div { min-width:0; }
.data-row :is(strong,small),.feed-row :is(strong,small),.travel-row :is(strong,small) { overflow-wrap:anywhere; }
.form-row > *,.trip-form-grid > *,.finance-two-forms > *,.platform-split > *,.studio-split > * { min-width:0; }
.view-surface :is(input,select,textarea,.form-control) { max-width:100%; }

/* Kanban stages must remain readable; the board scrolls instead of crushing words. */
.view-surface .procurement-board { max-width:100%; overscroll-behavior-inline:contain; scrollbar-width:thin; }
.view-surface .procurement-column { min-width:205px; flex:0 0 205px; }
.view-surface .procurement-column article { min-width:0; }

@container (max-width: 880px) {
  .task-centre-layout.has-detail { grid-template-columns:minmax(0,1fr); }
  .task-detail-panel { position:static; max-height:none; }
}

@container (max-width: 520px) {
  .operational-task-header { align-items:stretch; flex-direction:column; gap:.55rem; }
  .task-counts { align-self:flex-start; }
  .task-metadata { display:grid; grid-template-columns:minmax(0,1fr); }
}

/* A persistent sidebar leaves a tablet-sized content canvas on many laptops.
   Keep operational navigation and two-column tools fully visible in that state. */
@media (min-width: 769px) and (max-width: 1200px) {
  .platform-tabs,.live-section-tabs,.communication-nav,.trip-hub-nav {
    position:static;
    flex-wrap:wrap;
    overflow:visible;
    box-shadow:none;
  }
  .platform-tabs button,.live-section-tabs button,.communication-nav button,.trip-hub-nav button { flex:1 1 118px; }
  .studio-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); overflow:visible; box-shadow:none; }
  .studio-tabs button { min-width:0; }
  .studio-health strong { white-space:nowrap; }
  .communication-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .finance-platform > .metrics-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .finance-overview-grid,.finance-two-forms,.statement-grid,.platform-split,.studio-split { grid-template-columns:minmax(0,1fr); }
  .communication-layout { grid-template-columns:minmax(0,1fr); }
  .live-command-grid { grid-template-columns:minmax(0,1fr); }
  .communication-composer { position:static; }
  .communication-card-top { flex-wrap:wrap; }
  .communication-card-top small { white-space:normal; }
  .communication-policy { grid-template-columns:auto minmax(0,1fr); }
  .communication-policy > small { grid-column:2; }
}

@media (max-width: 900px) and (min-width: 769px) {
  .app-layout > .sidebar { width:220px; padding:.8rem .65rem; }
  .app-layout > .main-content { padding:0 1.1rem 2.5rem; }
  .app-layout .workspace-topbar { margin:0 -1.1rem 1.25rem; padding:0 1.1rem; }
  .workspace-topbar .workspace-actions button:not(.topbar-search) { padding:.55rem; font-size:0; }
  .workspace-topbar .workspace-actions button .material-icon { font-size:1.05rem; }

  /* The permanent navigation leaves a compact content canvas at this width. */
  .communication-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .communication-metrics > article:last-child { grid-column:1 / -1; }
  .communication-layout { grid-template-columns:minmax(0,1fr); }
  .communication-composer { position:static; }
  .communication-card-top { flex-wrap:wrap; }
  .communication-card-top small { white-space:normal; }
}

@media (max-width: 768px) {
  .view-surface { width:100%; overflow-x:clip; }
  /* Mobile already has workspace context, search and navigation in the app
     header. Repeating them in the desktop workspace bar wastes a full row. */
  .workspace-topbar { display:none !important; }
  .mobile-header {
    justify-content:flex-start;
    gap:.55rem;
    margin:0 -.8rem .8rem;
    padding:.6rem .8rem;
    padding-top:calc(.75rem + env(safe-area-inset-top, 0px));
    top:0;
  }
  .mobile-menu-overlay { top:calc(66px + env(safe-area-inset-top, 0px)) !important; }
  .mobile-header .mobile-workspace-select { margin-left:auto; }
  .mobile-header-actions { display:flex; align-items:center; gap:.35rem; margin-left:auto; }
  .mobile-header .mobile-workspace-select + .mobile-header-actions { margin-left:0; }
  .mobile-header-actions > button { width:44px; min-width:44px; height:44px; min-height:44px; padding:0; }

  /* The active destination belongs to the navigation rail; keep its indicator
     flush with the rail instead of rendering a detached floating pill. */
  .mobile-nav { padding-top:0; }
  .mobile-nav button { position:relative; min-height:56px; padding-top:.45rem; border-radius:0 0 10px 10px; }
  .mobile-nav button.active::before { content:""; position:absolute; top:-1px; left:28%; right:28%; height:3px; border-radius:0 0 4px 4px; background:var(--pw-brand); }
  .view-surface .section-heading > :last-child:not(:first-child) { max-width:100%; }
  .view-surface .section-heading > :last-child:not(:first-child).btn { flex:1 1 auto; }
  .operational-task { padding:.9rem; }
  .operational-task-header { align-items:center; }
  .task-counts { padding:.25rem .38rem; }
  .task-detail-controls,.task-inline-action,.task-comment-form { grid-template-columns:minmax(0,1fr); }
  .task-detail-row { grid-template-columns:auto minmax(0,1fr); }
  .task-detail-row > :is(button,.tag):last-child { grid-column:2; justify-self:start; }
  .communication-hero,.live-hero,.assistant-card,.offline-pack-card { align-items:stretch; flex-direction:column; }
  .communication-hero .btn,.live-hero .btn,.offline-pack-card .btn { width:100%; }
  .approval-row,.reimbursement-row,.contribution-row,.ticket-order-row,.travel-row { align-items:flex-start; flex-wrap:wrap; }
  .approval-actions { width:100%; }
  .approval-actions .btn { flex:1 1 120px; }
  .finance-overview-grid,.finance-two-forms,.statement-grid,.platform-split,.studio-split,.communication-layout,.live-command-grid { grid-template-columns:minmax(0,1fr); }
  .form-row,.trip-form-grid { grid-template-columns:minmax(0,1fr); }
  .view-surface .card { padding:.9rem; }

  /* Mobile navigation must feel intentional, not like desktop tabs were cropped. */
  .trip-tabs,.platform-tabs,.finance-tabs,.communication-nav,.live-section-tabs,.library-type-tabs,.action-filter-tabs {
    max-width:100%;
    padding-right:1.35rem;
    overscroll-behavior-inline:contain;
    scroll-padding-inline:.35rem 1.35rem;
    scroll-snap-type:x proximity;
    touch-action:pan-x;
    -webkit-overflow-scrolling:touch;
  }
  .trip-tab,.platform-tabs button,.finance-tabs button,.communication-nav button,.live-section-tabs button,.library-type-tabs button,.action-filter-tabs button { scroll-snap-align:start; }
  .docs-type-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); overflow:visible; }
  .docs-type-filters button { min-width:0; justify-content:center; padding:.5rem .35rem; font-size:.66rem; white-space:nowrap; }

  /* Keep data rows readable when names, statuses and money compete for width. */
  .view-vendors .vendor-list-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.7rem; align-items:start; }
  .view-vendors .vendor-list-main { min-width:0; flex-wrap:wrap; align-items:center !important; }
  .view-vendors .vendor-list-main > strong { min-width:0; flex:1 1 170px; overflow-wrap:anywhere; }
  .view-vendors .vendor-list-status { flex:0 0 auto; white-space:nowrap; word-break:normal; overflow-wrap:normal; }
  .view-vendors .vendor-list-total { grid-column:1 / -1; width:100%; justify-content:space-between; }
  .view-vendors .vendor-list-total > strong { white-space:nowrap; }

  .view-people .people-list-row { display:grid; grid-template-columns:minmax(0,1fr); gap:.8rem; }
  .view-people .people-list-info { width:100%; min-width:0; }
  .view-people .people-list-info > div { overflow-wrap:anywhere; }
  .view-people .people-list-actions { width:100%; display:grid !important; grid-template-columns:minmax(0,1fr) auto auto; gap:.45rem !important; }
  .view-people .people-list-actions .form-control { width:100% !important; min-width:0; }
  .view-people .people-list-actions .btn { padding-inline:.75rem; }

  .trip-detail-title-row { width:100%; display:grid !important; grid-template-columns:minmax(0,1fr) auto; align-items:start !important; gap:.65rem !important; }
  .trip-detail-title-row > .btn { grid-column:1 / -1; width:max-content !important; }
  .trip-detail-title-row .page-title { min-width:0; display:flex; align-items:flex-start; gap:.35rem; overflow-wrap:anywhere; }
  .trip-detail-title-row .trip-status-badge { flex:0 0 auto; white-space:nowrap; word-break:normal; overflow-wrap:normal; }
  .trip-detail-header > .btn { width:100%; }

  .studio-hero { display:grid; grid-template-columns:minmax(0,1fr) 84px; gap:.8rem; }
  .studio-health { width:84px; min-width:84px; padding:.72rem .45rem; text-align:center; }
  .studio-health span,.studio-health strong,.studio-health small { white-space:normal; word-break:normal; overflow-wrap:normal; }
  .studio-health span { letter-spacing:.045em; }
  .studio-health strong { white-space:nowrap; }
  .studio-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); overflow:visible; box-shadow:none; }
  .studio-tabs button { min-width:0; }
}

@media (max-width: 430px) {
  .operational-task-header { align-items:stretch; flex-direction:column; }
  .task-counts { align-self:flex-start; }
  .action-summary-grid,.communication-metrics,.registration-summary-grid,.registration-metrics,.incident-metrics { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .view-surface .section-heading > :last-child:not(:first-child) { width:100%; }
  .view-surface .section-heading > :last-child:not(:first-child).tag { width:auto; }
  .mobile-header { gap:.4rem; }
  .mobile-header .mobile-brand { gap:.3rem !important; }
  .mobile-header .mobile-brand .mobile-wordmark { font-size:.95rem; }
  .mobile-header .mobile-workspace-select { min-width:0; max-width:84px !important; }
  .mobile-header-actions { gap:.25rem; }
}

@media (max-width: 350px) {
  .mobile-header .mobile-brand span { display:none; }
  .mobile-header .mobile-workspace-select { max-width:76px !important; }
  .docs-type-filters button { padding-inline:.2rem; }
  .docs-type-filters .material-icon { display:none; }
}

/* Operational activity and evidence-backed assistant drafts. */
.activity-centre,.assistant-operational-briefing { display:grid; gap:1rem; }
.activity-hero { display:flex; align-items:center; justify-content:space-between; gap:1.25rem; padding:1.35rem 1.45rem; border:1px solid color-mix(in srgb,var(--pw-brand) 28%,var(--pw-line)); border-radius:18px; background:linear-gradient(135deg,color-mix(in srgb,var(--pw-brand) 10%,var(--pw-surface)),var(--pw-surface)); }
.activity-hero h2,.assistant-briefing-heading h2 { margin:.22rem 0 .35rem; }
.activity-hero p,.assistant-briefing-heading p { margin:0; color:var(--pw-muted); }
.activity-hero-score { min-width:104px; padding:.8rem 1rem; text-align:center; border-radius:14px; background:var(--pw-brand); color:#fff; }
.activity-hero-score strong,.activity-hero-score span { display:block; }
.activity-hero-score strong { font-size:1.75rem; }
.activity-hero-score span { font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; opacity:.85; }
.activity-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.75rem; }
.activity-summary-grid article { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.7rem; padding:.85rem 1rem; border:1px solid var(--pw-line); border-radius:14px; background:var(--pw-surface); }
.activity-summary-grid article > .material-icon { color:var(--pw-brand); }
.activity-summary-grid article strong { font-size:1.35rem; }
.activity-summary-grid article.danger { border-color:color-mix(in srgb,#ef476f 45%,var(--pw-line)); }
.activity-summary-grid article.warning { border-color:color-mix(in srgb,#f59e0b 45%,var(--pw-line)); }
.activity-filter-tabs { display:flex; gap:.5rem; overflow-x:auto; }
.activity-filter-tabs button { border:1px solid var(--pw-line); border-radius:999px; padding:.55rem .85rem; color:var(--pw-muted); background:var(--pw-surface); white-space:nowrap; }
.activity-filter-tabs button.active { color:#fff; border-color:var(--pw-brand); background:var(--pw-brand); }
.activity-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); gap:1rem; align-items:start; }
.activity-signal-list { display:grid; gap:.7rem; }
.activity-signal { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:.85rem; align-items:center; padding:.95rem 1rem; border-left:4px solid var(--pw-line); }
.activity-signal.critical { border-left-color:#ef476f; }
.activity-signal.warning { border-left-color:#f59e0b; }
.activity-signal h3 { margin:.3rem 0 .15rem; font-size:1rem; }
.activity-signal p { margin:0; color:var(--pw-muted); }
.activity-signal-icon,.assistant-section-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; color:var(--pw-brand); background:color-mix(in srgb,var(--pw-brand) 12%,var(--pw-surface)); }
.activity-clear { display:flex; align-items:center; gap:.75rem; }
.activity-clear > .material-icon { color:#16a34a; }
.activity-clear :is(h3,p) { margin:.15rem 0; }
.activity-history { max-height:650px; overflow:auto; }
.activity-history-row { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.7rem; padding:.72rem 0; border-top:1px solid var(--pw-line); }
.activity-history-row > span { color:var(--pw-muted); }
.activity-history-row strong,.activity-history-row small { display:block; }
.activity-history-row small { margin-top:.18rem; color:var(--pw-muted); overflow-wrap:anywhere; }
.portal-security-panel { display:grid; gap:.2rem; }
.portal-privacy-notice { margin:1rem 0; }
.portal-privacy-notice summary { display:flex; align-items:center; gap:.55rem; color:var(--pw-ink); font-weight:800; cursor:pointer; }
.portal-privacy-notice summary::marker { color:var(--pw-brand); }
.portal-privacy-notice summary .material-icon { color:var(--pw-brand); }
.portal-privacy-notice p { color:var(--pw-muted); }
.portal-privacy-notice small { display:block; color:var(--pw-muted); }
.portal-security-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.8rem; padding:.8rem 0; border-top:1px solid var(--pw-line); }
.portal-security-row strong,.portal-security-row small { display:block; }
.portal-security-row small { margin-top:.15rem; color:var(--pw-muted); }
.security-severity { display:grid; width:38px; height:38px; place-items:center; border-radius:11px; color:#9a6700; background:color-mix(in srgb,#f59e0b 14%,var(--pw-surface)); }
.security-severity.critical { color:#b42318; background:color-mix(in srgb,#ef476f 14%,var(--pw-surface)); }
.communication-policy { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.75rem; padding:.75rem .9rem; border:1px solid var(--pw-line); border-radius:12px; background:var(--pw-surface-soft); }
.communication-policy > .material-icon { color:var(--pw-brand); }
.communication-policy strong,.communication-policy span { display:block; }
.communication-policy span,.communication-policy small,.settings-section-help { color:var(--pw-muted); }
.communication-template-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin:.75rem 0 1rem; }
.communication-template-picker button { display:flex; align-items:center; gap:.5rem; min-height:42px; padding:.65rem .75rem; border:1px solid var(--pw-line); border-radius:10px; background:var(--pw-surface-soft); color:var(--pw-ink); font:inherit; font-size:.82rem; font-weight:700; text-align:left; cursor:pointer; }
.communication-template-picker button:hover { border-color:var(--pw-brand); color:var(--pw-brand); }
.communication-template-picker button:focus-visible { border-color:var(--pw-brand); color:var(--pw-brand); outline:3px solid var(--pw-focus); outline-offset:2px; }
.communication-consent-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr); gap:1rem; align-items:start; }
.consent-table { padding:0; overflow:hidden; }
.consent-table-head,.consent-table-row { display:grid; grid-template-columns:minmax(180px,1.35fr) repeat(3,minmax(120px,.65fr)); gap:.65rem; align-items:center; padding:.72rem .85rem; }
.consent-table-head { color:var(--pw-muted); font-size:.72rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; background:var(--pw-surface-soft); }
.consent-table-row { border-top:1px solid var(--pw-line); }
.consent-table-row strong,.consent-table-row small { display:block; }
.consent-table-row small { margin-top:.15rem; color:var(--pw-muted); }
.consent-table-row select { min-width:0; font-size:.8rem; }
.consent-table-row .consent-consented { border-color:color-mix(in srgb,#16a34a 45%,var(--pw-line)); }
.consent-table-row .consent-opted_out { border-color:color-mix(in srgb,#ef476f 45%,var(--pw-line)); }
.delivery-queue { position:sticky; top:82px; }
.delivery-queue article { display:grid; gap:.45rem; padding:.8rem 0; border-top:1px solid var(--pw-line); }
.delivery-queue article > div strong,.delivery-queue article > div small { display:block; }
.delivery-queue article small { color:var(--pw-muted); }
.delivery-queue article .tag { justify-self:start; }
.settings-section-help { max-width:760px; margin-top:-.3rem; }
.settings-communication-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.settings-toggle { display:flex; gap:.7rem; align-items:flex-start; padding:.75rem; border:1px solid var(--pw-line); border-radius:12px; background:var(--pw-surface-soft); }
.settings-toggle input { margin-top:.2rem; }
.settings-toggle strong,.settings-toggle small { display:block; }
.settings-toggle small { margin-top:.2rem; color:var(--pw-muted); }
.assistant-operational-briefing { margin-top:.25rem; }
.assistant-briefing-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; }
.assistant-briefing-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem; }
.assistant-briefing-grid > .card { position:relative; min-width:0; }
.assistant-briefing-grid h3 { margin:.65rem 0; }
.assistant-number-row { display:flex; flex-wrap:wrap; gap:.5rem; }
.assistant-number-row span { padding:.45rem .55rem; border-radius:9px; background:var(--pw-surface-soft); color:var(--pw-muted); }
.assistant-number-row b { color:var(--pw-ink); }
.assistant-next-item { display:grid; gap:.12rem; padding:.6rem 0; border-top:1px solid var(--pw-line); }
.assistant-next-item small { color:var(--pw-muted); }
.assistant-announcement-draft > strong { display:block; }
.assistant-announcement-draft p { color:var(--pw-muted); }
.assistant-briefing-split { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem; }
.assistant-risk { display:grid; grid-template-columns:8px minmax(0,1fr); gap:.65rem; padding:.7rem 0; border-top:1px solid var(--pw-line); }
.assistant-risk > span { width:8px; height:8px; margin-top:.35rem; border-radius:50%; background:#f59e0b; }
.assistant-risk.critical > span { background:#ef476f; }
.assistant-risk.good > span { background:#16a34a; }
.assistant-risk p { margin:.15rem 0 0; color:var(--pw-muted); }
.assistant-group-suggestion { display:grid; gap:.2rem; padding:.7rem 0; border-top:1px solid var(--pw-line); }
.assistant-group-suggestion span { color:var(--pw-muted); }

/* Workspace notes, touch scribbles, and lightweight offline tools. */
.workspace-tools { display:grid; gap:1rem; }
.workspace-tools-header { align-items:flex-end; }
.connection-badge { display:inline-flex; align-items:center; gap:.45rem; padding:.52rem .75rem; border:1px solid var(--pw-line); border-radius:999px; color:var(--pw-muted); background:var(--pw-surface); font-size:.78rem; font-weight:800; white-space:nowrap; }
.connection-badge > span { width:8px; height:8px; border-radius:50%; background:#16a34a; box-shadow:0 0 0 4px color-mix(in srgb,#16a34a 14%,transparent); }
.connection-badge.offline > span { background:#f59e0b; box-shadow:0 0 0 4px color-mix(in srgb,#f59e0b 16%,transparent); }
.workspace-tool-tabs { display:flex; gap:.45rem; padding:.3rem; width:max-content; max-width:100%; overflow:auto; border:1px solid var(--pw-line); border-radius:14px; background:var(--pw-surface-soft); }
.workspace-tool-tabs button { display:flex; align-items:center; gap:.48rem; padding:.66rem .9rem; border:0; border-radius:10px; color:var(--pw-muted); background:transparent; font:inherit; font-size:.84rem; font-weight:800; white-space:nowrap; cursor:pointer; }
.workspace-tool-tabs button.active { color:#fff!important; background:var(--pw-action)!important; box-shadow:0 5px 14px color-mix(in srgb,var(--pw-action) 26%,transparent); }
.workspace-tool-notice { padding:.7rem .9rem; border:1px solid color-mix(in srgb,#ef476f 40%,var(--pw-line)); border-radius:11px; color:#b42318; background:color-mix(in srgb,#ef476f 8%,var(--pw-surface)); }
.workspace-tool-notice.success { border-color:color-mix(in srgb,#16a34a 36%,var(--pw-line)); color:#15803d; background:color-mix(in srgb,#16a34a 8%,var(--pw-surface)); }
.notes-workspace { display:grid; grid-template-columns:260px minmax(0,1fr); gap:1rem; align-items:start; }
.notes-sidebar { position:sticky; top:82px; padding:.8rem; }
.notes-sidebar-head { display:flex; align-items:center; justify-content:space-between; gap:.7rem; padding:.15rem .1rem .7rem; }
.notes-sidebar-head strong,.notes-sidebar-head small { display:block; }
.notes-sidebar-head small { margin-top:.12rem; color:var(--pw-muted); font-size:.75rem; }
.notes-search { display:flex; align-items:center; gap:.45rem; min-height:40px; padding:0 .7rem; border:1px solid var(--pw-line); border-radius:10px; background:var(--pw-surface-soft); }
.notes-search .material-icon { color:var(--pw-muted); }
.notes-search input { min-width:0; width:100%; border:0; outline:0; color:var(--pw-ink); background:transparent; font:inherit; font-size:.82rem; }
.notes-search:focus-within { outline:3px solid var(--pw-focus); outline-offset:2px; }
.notes-list { display:grid; gap:.35rem; max-height:calc(100vh - 285px); margin-top:.65rem; overflow:auto; }
.notes-list > button { --note-accent:var(--pw-brand); display:grid; grid-template-columns:auto minmax(0,1fr); gap:.58rem; align-items:start; width:100%; padding:.7rem; border:1px solid transparent; border-radius:10px; color:var(--pw-ink); background:transparent; font:inherit; text-align:left; cursor:pointer; }
.notes-list > button:hover,.notes-list > button.active { border-color:color-mix(in srgb,var(--note-accent) 34%,var(--pw-line)); background:color-mix(in srgb,var(--note-accent) 8%,var(--pw-surface)); }
.notes-list > button.active { box-shadow:inset 3px 0 var(--note-accent); }
.note-list-icon { display:grid; place-items:center; width:30px; height:30px; border-radius:8px; color:var(--note-accent); background:color-mix(in srgb,var(--note-accent) 12%,var(--pw-surface)); }
.notes-list strong,.notes-list small { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notes-list strong { font-size:.84rem; }
.notes-list small { margin-top:.2rem; color:var(--pw-muted); font-size:.68rem; }
.notes-empty-list { display:grid; justify-items:center; gap:.2rem; padding:1.5rem .7rem; color:var(--pw-muted); text-align:center; }
.notes-empty-list strong,.notes-empty-list small { white-space:normal; }
.note-editor { --note-accent:var(--pw-brand); min-width:0; padding:1rem 1.1rem; border-top:4px solid var(--note-accent); }
.note-color-violet { --note-accent:#6d5dfc!important; }.note-color-blue { --note-accent:#2563eb!important; }.note-color-green { --note-accent:#16a34a!important; }.note-color-amber { --note-accent:#d97706!important; }.note-color-rose { --note-accent:#e11d48!important; }.note-color-slate { --note-accent:#64748b!important; }
.note-editor-top { display:flex; align-items:center; gap:.8rem; }
.note-title-input { min-width:0; flex:1; padding:.3rem 0; border:0; outline:0; color:var(--pw-ink); background:transparent; font:inherit; font-size:1.35rem; font-weight:850; }
.note-title-input:focus-visible { outline:3px solid var(--pw-focus); outline-offset:3px; border-radius:5px; }
.note-title-input::placeholder { color:var(--pw-muted); }
.note-editor-actions { display:flex; gap:.35rem; }
.note-editor-actions .active { border-color:var(--note-accent); color:var(--note-accent); }
.note-readonly { display:flex; align-items:center; gap:.45rem; margin:.75rem 0; padding:.65rem .75rem; border-radius:9px; color:var(--pw-muted); background:var(--pw-surface-soft); font-size:.78rem; }
.note-meta-controls { display:flex; align-items:flex-end; gap:1rem; margin:.75rem 0; }
.note-meta-controls > label { display:grid; gap:.32rem; color:var(--pw-muted); font-size:.7rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.note-meta-controls select { min-width:155px; padding:.5rem .65rem; font-size:.78rem; text-transform:none; }
.note-color-picker { display:flex; gap:.35rem; min-height:36px; align-items:center; }
.note-color-picker button,.pen-colors button { width:21px; height:21px; padding:0; border:2px solid var(--pw-surface); border-radius:50%; background:currentColor; box-shadow:0 0 0 1px var(--pw-line); cursor:pointer; }
.note-color-picker button[aria-pressed="true"],.pen-colors button[aria-pressed="true"] { box-shadow:0 0 0 2px var(--pw-surface),0 0 0 4px currentColor; }
.note-color-picker .violet { color:#6d5dfc; }.note-color-picker .blue { color:#2563eb; }.note-color-picker .green { color:#16a34a; }.note-color-picker .amber { color:#d97706; }.note-color-picker .rose { color:#e11d48; }.note-color-picker .slate { color:#64748b; }
.note-format-toolbar { display:flex; gap:.25rem; padding:.35rem; border:1px solid var(--pw-line); border-bottom:0; border-radius:10px 10px 0 0; background:var(--pw-surface-soft); }
.note-format-toolbar button { display:grid; place-items:center; width:34px; height:32px; border:1px solid transparent; border-radius:7px; color:var(--pw-muted); background:transparent; font:inherit; font-weight:900; cursor:pointer; }
.note-format-toolbar button:hover:not(:disabled) { border-color:var(--pw-line); color:var(--note-accent); background:var(--pw-surface); }
.rich-note-editor { border:1px solid var(--pw-line); border-radius:10px; overflow:hidden; background:var(--pw-surface); }
.rich-note-editor .note-format-toolbar { border:0; border-bottom:1px solid var(--pw-line); border-radius:0; }
.note-rich-surface { min-height:330px; padding:1rem; outline:0; color:var(--pw-ink); background:var(--pw-surface); font-size:.92rem; line-height:1.65; overflow-wrap:anywhere; }
.note-rich-surface:focus { box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--note-accent) 22%,transparent); }
.note-rich-surface[data-empty="true"]::before { content:attr(data-placeholder); color:var(--pw-faint); pointer-events:none; }
.note-rich-surface :is(h2,h3) { margin:.75rem 0 .3rem; line-height:1.3; }
.note-rich-surface h3 { font-size:1.12rem; }
.note-rich-surface :is(p,ul,ol) { margin:.3rem 0 .65rem; }
.note-rich-surface :is(ul,ol) { padding-left:1.55rem; }
.note-rich-surface .pw-checklist { padding-left:0; list-style:none; }
.note-rich-surface .pw-checklist li { position:relative; min-height:27px; padding-left:31px; cursor:text; }
.note-rich-surface .pw-check-toggle { position:absolute; left:2px; top:.24rem; display:grid; place-items:center; width:17px; height:17px; border:2px solid color-mix(in srgb,var(--note-accent) 55%,var(--pw-line)); border-radius:5px; color:#fff; background:var(--pw-surface); cursor:pointer; font-size:.72rem; font-weight:900; line-height:1; text-decoration:none; }
.note-rich-surface .pw-check-toggle:focus-visible { outline:2px solid var(--note-accent); outline-offset:2px; }
.note-rich-surface .pw-checklist li[data-checked="1"] { color:var(--pw-muted); text-decoration:line-through; }
.note-rich-surface .pw-checklist li[data-checked="1"] .pw-check-toggle { border-color:var(--note-accent); background:var(--note-accent); }
.rich-note-hint { display:flex; align-items:center; gap:.35rem; padding:.58rem .75rem; border-top:1px solid var(--pw-line); color:var(--pw-muted); background:var(--pw-surface-soft); }
.scribble-section { margin-top:.85rem; border:1px solid var(--pw-line); border-radius:11px; overflow:hidden; }
.scribble-section summary { display:flex; justify-content:space-between; align-items:center; gap:.7rem; padding:.72rem .85rem; background:var(--pw-surface-soft); cursor:pointer; list-style:none; }
.scribble-section summary::-webkit-details-marker { display:none; }
.scribble-section summary > span { display:flex; align-items:center; gap:.45rem; font-weight:800; }
.scribble-section summary small { color:var(--pw-muted); }
.scribble-pad { padding:.8rem; background:var(--pw-surface); }
.scribble-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.55rem; margin-bottom:.7rem; }
.scribble-toolbar label { display:flex; align-items:center; gap:.4rem; color:var(--pw-muted); font-size:.72rem; font-weight:800; }
.pen-colors { display:flex; gap:.35rem; padding:.2rem; }
.pen-colors button { color:var(--pen-color); background:var(--pen-color); }
.scribble-pad canvas { display:block; width:100%; aspect-ratio:20/9; border:1px dashed color-mix(in srgb,var(--note-accent) 35%,var(--pw-line)); border-radius:9px; background:#fff; cursor:crosshair; touch-action:none; }
.scribble-pad > small { display:flex; align-items:center; gap:.35rem; margin-top:.55rem; color:var(--pw-muted); }
.note-editor-footer { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-top:.85rem; }
.note-editor-footer > span { color:var(--pw-muted); font-size:.75rem; }
.note-template-panel { grid-column:1/-1; max-width:760px; justify-self:center; }
.note-template-panel > button { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:.7rem; align-items:center; width:100%; padding:.72rem 0; border:0; border-top:1px solid var(--pw-line); color:var(--pw-ink); background:transparent; font:inherit; text-align:left; cursor:pointer; }
.note-template-panel > button:hover { color:var(--pw-brand); }
.note-template-panel strong,.note-template-panel small { display:block; }
.note-template-panel small { margin-top:.15rem; color:var(--pw-muted); }
.note-template-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:10px; color:var(--pw-brand); background:color-mix(in srgb,var(--pw-brand) 10%,var(--pw-surface)); }
.tool-card-heading { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.8rem; align-items:start; margin-bottom:1rem; }
.tool-card-heading > span { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; color:var(--pw-brand); background:color-mix(in srgb,var(--pw-brand) 12%,var(--pw-surface)); }
.tool-card-heading h2,.tool-card-heading p { margin:.18rem 0; }
.tool-card-heading p { color:var(--pw-muted); }
.workspace-calculator-grid,.offline-tools-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; align-items:start; }
.tool-card { min-width:0; }
.calculator-input-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; }
.calculator-input-grid label { display:grid; gap:.3rem; color:var(--pw-muted); font-size:.76rem; font-weight:800; }
.calculator-results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin-top:.9rem; }
.calculator-results > div { padding:.7rem .75rem; border:1px solid var(--pw-line); border-radius:10px; background:var(--pw-surface-soft); }
.calculator-results span,.calculator-results strong { display:block; }
.calculator-results span { color:var(--pw-muted); font-size:.72rem; }
.calculator-results strong { margin-top:.18rem; font-size:1.05rem; }
.calculator-results .calculator-total { border-color:color-mix(in srgb,var(--pw-brand) 35%,var(--pw-line)); background:color-mix(in srgb,var(--pw-brand) 8%,var(--pw-surface)); }
.tool-disclaimer { display:block; margin-top:.7rem; color:var(--pw-muted); }
.quick-sum-input { resize:vertical; }
.quick-sum-result { display:flex; justify-content:space-between; align-items:baseline; margin:.8rem 0; padding:.85rem 1rem; border-radius:11px; color:#fff; background:var(--pw-brand); }
.quick-sum-result strong { font-size:1.35rem; }
.tic-board { display:grid; grid-template-columns:repeat(3,minmax(0,88px)); justify-content:center; gap:.45rem; }
.tic-board button { aspect-ratio:1; border:1px solid var(--pw-line); border-radius:12px; color:var(--pw-brand); background:var(--pw-surface-soft); font:inherit; font-size:2rem; font-weight:900; cursor:pointer; }
.tic-board button:hover:empty { border-color:var(--pw-brand); background:color-mix(in srgb,var(--pw-brand) 8%,var(--pw-surface)); }
.tic-status { display:flex; justify-content:space-between; align-items:center; gap:.8rem; max-width:260px; margin:1rem auto 0; }
.decision-result { display:grid; gap:.2rem; margin-top:.8rem; padding:1rem; border:1px solid color-mix(in srgb,var(--pw-brand) 35%,var(--pw-line)); border-radius:11px; text-align:center; background:color-mix(in srgb,var(--pw-brand) 8%,var(--pw-surface)); }
.decision-result span { color:var(--pw-muted); font-size:.72rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.decision-result strong { color:var(--pw-brand); font-size:1.35rem; }

@media (max-width: 900px) {
  .activity-layout,.assistant-briefing-split,.communication-consent-layout,.notes-workspace,.workspace-calculator-grid,.offline-tools-grid { grid-template-columns:minmax(0,1fr); }
  .notes-sidebar { position:static; }
  .notes-list { max-height:240px; }
  .activity-history { max-height:none; }
  .delivery-queue { position:static; }
  .communication-policy { grid-template-columns:auto minmax(0,1fr); }
  .communication-policy > small { grid-column:2; }
}

@media (max-width: 1120px) {
  .note-editor-top { align-items:stretch; flex-direction:column; }
  .note-editor-actions { align-self:flex-end; }
}

@media (max-width: 640px) {
  .activity-hero,.assistant-briefing-heading { align-items:stretch; flex-direction:column; }
  .activity-hero-score { width:100%; }
  .activity-summary-grid,.assistant-briefing-grid,.settings-communication-grid { grid-template-columns:minmax(0,1fr); }
  .activity-signal { grid-template-columns:auto minmax(0,1fr); }
  .activity-signal > .btn { grid-column:2; justify-self:start; }
  .portal-security-row { grid-template-columns:auto minmax(0,1fr); }
  .portal-security-row > .btn { grid-column:2; justify-self:start; }
  .communication-policy { grid-template-columns:minmax(0,1fr); }
  .communication-policy > small { grid-column:auto; }
  .communication-template-picker { grid-template-columns:minmax(0,1fr); }
  .consent-table { overflow-x:auto; }
  .consent-table-head,.consent-table-row { min-width:660px; }
  .workspace-tools-header { align-items:flex-start; }
  .workspace-tool-tabs { width:100%; }
  .workspace-tool-tabs button { flex:1; justify-content:center; }
  .note-editor { padding:.8rem; }
  .note-editor-top,.note-editor-footer { align-items:stretch; flex-direction:column; }
  .note-editor-actions { overflow-x:auto; }
  .note-meta-controls { align-items:stretch; flex-direction:column; }
  .note-rich-surface { min-height:300px; }
  .scribble-toolbar { align-items:flex-start; }
  .calculator-input-grid,.calculator-results { grid-template-columns:minmax(0,1fr); }
}
