/* Owner-approved Monday Night, shared by desktop-width and mobile web routes.
   Keep artwork, avatars, layout and card dimensions unchanged. */
body, body.studio-web {
  color-scheme: dark;
  --bg: #11141b;
  --side: #171c26;
  --surface: #222936;
  --soft: #2c3443;
  --raised: #343e50;
  --control: #1b222e;
  --text: #f4f7fd;
  --muted: #c5cedc;
  --subtle: #b3bfd1;
  --line: #788aa5;
  --line-soft: #354155;
  --line-strong: #93a4bc;
  --hover: #2c3443;
  --selected: #203d61;
  --selected-muted: #c2d7f4;
  --accent: #8bbcff;
  --action: #3563e9;
  --action-hover: #2e52ca;
  --action-ink: #ffffff;
  --sky-line: #93a4bc;
  --success: #76e3b3;
  --warning: #f7ce78;
  --error: #ff9eab;
  --coral: #ff9eab;
  --scrollbar-thumb: #65758d;
  --chrome: #171c26;
  --chrome-rail: #171c26;
  --chat-wash: #1b222e;
  --shadow: 0 18px 44px -14px rgb(6 15 24 / 58%);
  --studio-ai: #c9acff;
  --studio-radius-control: 4px;
  --studio-radius-card: 6px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Keep the hierarchy consistent across the rail, lists, work area and drawers. */
body.studio-web #sidebar,
body.studio-web .group-list-panel,
body.studio-web #group-members-disclosure,
body.studio-web #preview-panel {
  border-color: var(--line-soft);
}
body.studio-web #main > .main-top,
body.studio-web #mobile-navigation {
  border-color: var(--line-soft);
  background: var(--chrome);
  color: var(--text);
}
body.studio-web #sidebar {
  background: var(--chrome-rail);
}
body.studio-web.drive-monday-active #sidebar #cloud-drive-nav.active {
  background: var(--selected);
  color: var(--text);
}
body.studio-web #sidebar .nav-row.active,
body.studio-web .group-list-item.active {
  background: var(--selected);
  color: var(--text);
}
body.studio-web #sidebar .nav-row.active::before {
  background: var(--action);
}
body.studio-web .group-list-item.active {
  box-shadow: none;
}
body.studio-web :is(.nav-row, .group-list-item, .history-item, .task-file-row, .pw-doc):hover {
  background: var(--hover);
}

/* One control language for the existing actions and editing surfaces. */
body.studio-web :is(.icon-button, .quiet-button, .pw-link, .pw-secondary) {
  border-radius: var(--studio-radius-control);
}
body.studio-web :is(.primary-button, .pw-primary) {
  border-radius: var(--studio-radius-control);
  background: var(--action);
  color: var(--action-ink);
  font-weight: 700;
}
body.studio-web :is(.primary-button, .pw-primary):hover:not(:disabled) {
  background: var(--action-hover);
}
body.studio-web :is(.pw-secondary, .pw-visual-select) {
  border-color: var(--line);
  background: var(--control);
}
body.studio-web :is(button, a, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}
body.studio-web :is(input, textarea)::placeholder {
  color: var(--subtle);
}
body.studio-web :is(.tab.active, .knowledge-nav button[aria-current="page"]) {
  color: var(--text);
  border-bottom-color: var(--action);
}

/* Cards share a quiet border and a single radius; their contents stay unchanged. */
body.studio-web :is(
  .file-card, .board-card, .pw-type, .pw-doc, .pw-compose,
  .acct-panel, .acct-summary, .meeting-hall, .group-result.task-delivery
) {
  border-color: var(--line-soft);
  border-radius: var(--studio-radius-card);
}
body.studio-web :is(.file-card, .board-card, .pw-type, .pw-doc):hover {
  border-color: var(--line-strong);
}
body.studio-web :is(dialog, [popover]) {
  border-color: var(--line);
  color: var(--text);
}

/* Collaboration keeps the blue action, green delivery and violet AI meanings. */
body.studio-web .group-text.message {
  color: var(--text);
  border-color: var(--line-soft);
  background: var(--surface);
}
body.studio-web #group-composer {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
body.studio-web #group-composer:focus-within {
  border-color: var(--accent);
  box-shadow: none;
}
body.studio-web .group-result.task-delivery[data-status="completed"] {
  border-left: 3px solid var(--success);
}
body.studio-web .conversation-identity[data-kind="agent"],
body.studio-web .member-profile-label .conversation-identity,
body.studio-web .panel-section-heading-agents .panel-section-icon {
  color: var(--studio-ai);
}
body.studio-web .panel-section-heading-agents .panel-section-icon {
  background: color-mix(in srgb, var(--studio-ai) 14%, transparent);
}
body.studio-web .conversation-agent-purpose {
  color: var(--muted);
}
body.studio-web .group-list-item.active :is(em, time) {
  color: var(--selected-muted);
}
body.studio-web .panel-section-heading-deliveries .panel-section-icon {
  color: var(--accent);
}

/* Canvas tools follow the workbench chrome without altering the artwork. */
body.studio-web .pw-top,
body.studio-web .pw-inspector {
  border-color: var(--line-soft);
}
body.studio-web .pw-type.is-selected,
body.studio-web .pw-doc[aria-current="true"],
body.studio-web .pw-visual-option.is-selected {
  border-color: var(--accent);
  background: var(--selected);
}

/* Chrome and every business surface use the same palette; generated documents
   and image canvases keep their own authored colors. */
body.studio-web :is(#main, #workspace, #account-view) {
  background: var(--bg);
}
body.studio-web :is(.group-list-panel, #group-members-disclosure, #preview-panel) {
  background: var(--side);
}
body.studio-web :is(.group-context-menu, .context-menu, .pw-resource-menu,
  .composer-skill-menu, .composer-popover, .member-menu, .nav-menu, [popover], dialog) {
  background: var(--surface);
  border-color: var(--line-soft);
  border-radius: 6px;
}
body.studio-web :is(.quiet-button, .icon-button, .composer-tool, .pw-secondary, .pw-link) {
  color: var(--muted);
}
body.studio-web :is(.primary-button, .pw-primary, .calendar-new, .send-button,
  .calendar-day.today time, .group-send, #group-send) {
  background: var(--action);
  color: var(--action-ink);
  box-shadow: none;
}
body.studio-web :is(.calendar-new, .calendar-view-switch, .calendar-view-switch button,
  .skill-filter, .acct-filters button, .my-ai-skill-filters button, .nav-row) {
  border-radius: var(--studio-radius-control);
}
body.studio-web :is(.calendar-new, .primary-button, .pw-primary):hover:not(:disabled) {
  background: var(--action-hover);
  color: var(--action-ink);
}
body.studio-web :is(.group-result.task-delivery, .board-card, .pw-doc,
  .acct-panel, .acct-summary, .crm-surface, .calendar-agenda article) {
  background: var(--surface);
}
body.studio-web :is(.group-text a, .message a, .delivery-answer a, .calendar-event-chip) {
  color: var(--accent);
}
body.studio-web .my-ai-update-row strong {
  background: none;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
}
body.studio-web :is(.skill-filter, .acct-filters button, .my-ai-skill-filters button,
  .calendar-view-switch button)[aria-pressed=true] {
  background: var(--selected);
  color: var(--text);
}
body.studio-web :is(.nav-row, .group-list-item, .history-item).active {
  background: var(--selected);
  color: var(--text);
}
body.studio-web :is(input, textarea, select) {
  caret-color: var(--text);
}
body.studio-web :is(input, textarea, select, button, a, summary, [tabindex]):focus-visible {
  outline-color: var(--accent);
}
body.studio-web ::selection { background: var(--selected); color: var(--text); }
body.studio-web { scrollbar-color: var(--scrollbar-thumb) var(--side); }
body.studio-web :is(.drive-size, .drive-date, .crm-main td, .calendar-date, time) {
  font-variant-numeric: tabular-nums;
}

/* Route-local legacy values inherit the shared palette; the approved cloud-drive
   composition and authored documents remain unchanged. */
body.studio-web :is(#cloud-drive-view, #drive-edit-dialog, #drive-nas-dialog,
  #drive-quota-dialog, #drive-preview-dialog) {
  --text: inherit;
  --bg: inherit;
  --side: inherit;
  --surface: inherit;
  --hover: inherit;
  --line-soft: inherit;
  --muted: inherit;
  --selected: inherit;
  --action: inherit;
}
body.studio-web :is(#cloud-drive-view, #drive-edit-dialog, #drive-nas-dialog,
  #drive-quota-dialog, #drive-preview-dialog) .primary-button {
  background: var(--action);
  color: var(--action-ink);
}
body.studio-web :is(#cloud-drive-view, #drive-edit-dialog, #drive-nas-dialog,
  #drive-quota-dialog, #drive-preview-dialog) .primary-button:hover:not(:disabled) {
  background: var(--action-hover);
}
/* Sharper hierarchy without changing type size, geometry or authored content. */
body.studio-web :is(.agents-heading h1, .kb-heading-title h1,
  .skills-page-heading h1, .mcp-heading h1, .pw-heading h1,
  .drive-heading h1, .drive-column-heading h2, .panel-section-heading,
  .calendar-heading, #group-title) {
  font-weight: 700;
  letter-spacing: -0.02em;
}
body.studio-web #cloud-drive-view .drive-column-heading {
  background: var(--side);
}
body.studio-web #cloud-drive-view :is(.drive-column, .drive-search input) {
  background: var(--control);
}
body.studio-web #cloud-drive-view :is(.drive-column-controls, #drive-crumbs, .drive-column-footer) {
  background: var(--side);
}
body.studio-web #cloud-drive-view .drive-name[data-drive-folder] svg { color: var(--studio-ai); }
body.studio-web #cloud-drive-view :is(.quiet-button, .primary-button, .drive-search input) {
  border-color: var(--line);
}
body.studio-web #cloud-drive-view .primary-button {
  border-color: var(--action);
}
body.studio-web #cloud-drive-view .drive-column-heading {
  border-left-color: var(--success);
}
body.studio-web #cloud-drive-view .drive-folders-column .drive-column-heading {
  border-left-color: var(--studio-ai);
}
body.studio-web #cloud-drive-view .drive-column-heading h2 { color: var(--success); }
body.studio-web #cloud-drive-view .drive-folders-column .drive-column-heading h2 { color: var(--studio-ai); }
body.studio-web #cloud-drive-view #drive-recent-ranges button[aria-pressed=true] {
  color: var(--selected-muted);
  box-shadow: inset 0 -2px var(--accent);
}
body.studio-web #cloud-drive-view ::selection { background: var(--selected); color: var(--text); }
body.studio-web #cloud-drive-view .drive-row {
  background: var(--surface);
  border-left-color: transparent;
}
body.studio-web #cloud-drive-view .drive-row:hover { background: var(--hover); }
body.studio-web #boards-view .board-list-page .board-card[data-board-kind="official"] :is(.board-card-icon, .board-card-footer),
body.studio-web :is(.information-view, .my-ai-tabs [aria-current="page"],
  #web-update-notice button, #studio-state-notice button) {
  color: var(--accent);
}
body.studio-web :is(.drive-location, .drive-recent-row .drive-date,
  .drive-date-group, .drive-footer) { color: var(--muted); }
body.studio-web #mobile-navigation button { color: var(--muted); }
body.studio-web #mobile-navigation button[aria-current] { color: var(--accent); }

@media (max-width: 760px) {
  body.studio-web #mobile-menu #sidebar #skills-nav {
    display: flex !important;
  }
  body.studio-web #mobile-menu #sidebar #production-workshop-nav {
    display: none !important;
  }
  body.studio-web #mobile-navigation {
    background: var(--side);
  }
  body.studio-web #mobile-navigation button[aria-current] {
    color: var(--accent);
  }
  body.studio-web :is(.pw-type, .pw-doc, .group-result.task-delivery) {
    border-radius: var(--studio-radius-card);
  }
}

/* Finish pass: usable results, compact history, and stable navigation chrome. */
body.studio-web :is(.pw-compose h1, .drive-heading h1, .kb-heading h1,
  .my-ai-heading h1, .board-list-page h1) {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
body.studio-web .agent-seat { border-radius: var(--studio-radius-card); }
body.studio-web :is(button, a, input, textarea, select, summary, [tabindex]):focus-visible {
  outline-color: var(--accent);
}
body.studio-web .pw-image-history-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  overflow: hidden;
  border-radius: 4px;
  background: var(--control);
}
body.studio-web .pw-image-history-thumb > .result-icon {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}
body.studio-web .pw-image-history-thumb :is(img) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.studio-web .pw-doc-main { flex: 1; }
body.studio-web .pw-doc small { font-size: 12px; }
body.studio-web .delivery-action-menu {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
}
body.studio-web .delivery-selection-content > footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
body.studio-web .delivery-selection-content > footer button svg {
  width: 16px;
  height: 16px;
  flex: none;
}
body.studio-web .delivery-more[hidden],
body.studio-web .delivery-action-menu[hidden] { display: none !important; }
body.studio-web .delivery-hero-preview { position: relative; }
body.studio-web .delivery-hero-type {
  position: absolute;
  bottom: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
}
body.studio-web .delivery-hero-preview:has(.delivery-thumbnail) .delivery-hero-type {
  display: none;
}
body.studio-web .delivery-hero-preview > .result-icon > :is(img) {
  object-fit: contain;
}
body.studio-web .kb-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
}
body.studio-web .kb-load-error p { margin: 0; }
body.studio-web .kb-load-error button { min-height: 44px; }

@media (max-width: 760px) {
  body.studio-web :is(.pw-compose h1, .drive-heading h1, .kb-heading h1,
    .my-ai-heading h1, .board-list-page h1) { font-size: 22px; }
  body.studio-web #cloud-drive-view .drive-recent-column:is(
    [data-state="empty"], [data-state="loading"], [data-state="error"]) {
    height: auto;
    min-height: 0;
    grid-template-rows: 48px 48px auto;
  }
  body.studio-web #cloud-drive-view .drive-recent-column:is(
    [data-state="empty"], [data-state="loading"], [data-state="error"]) .drive-column-footer {
    display: none;
  }
  body.studio-web #cloud-drive-view .drive-recent-column .drive-empty {
    height: auto;
    min-height: 56px;
    padding: 12px 14px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }
  body.studio-web #cloud-drive-view .drive-recent-column .drive-empty svg {
    width: 20px;
    height: 20px;
  }
  body.studio-web .delivery-selection-content > footer {
    gap: 12px;
    justify-content: space-between;
  }
  body.studio-web .delivery-selection-content > footer > .primary-button {
    flex: 1;
    min-width: 120px;
    min-height: 44px;
    font-size: 15px;
  }
  body.studio-web .delivery-more {
    flex: none;
    min-width: 80px;
    min-height: 44px;
    border: 1px solid var(--line);
    font-size: 14px;
  }
  body.studio-web .delivery-action-menu {
    position: fixed;
    z-index: 120;
    display: grid;
    min-width: 176px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--studio-radius-card);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  body.studio-web .delivery-action-menu button {
    width: 100%;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 12px;
    justify-content: flex-start !important;
    color: var(--text);
    font-size: 14px;
    text-align: left;
  }
  body.studio-web .delivery-action-menu button:hover {
    background: var(--hover);
  }
  body.studio-web .delivery-action-menu .delivery-delete { color: var(--error); }
  body.studio-web #main > .main-top:has(.studio-update-notice) {
    height: auto !important;
    min-height: 48px !important;
    flex-wrap: wrap;
    gap: 0 8px;
    padding-bottom: 4px !important;
  }
  body.studio-web .main-top > .studio-update-notice {
    position: static;
    order: 10;
    display: flex;
    flex: 0 0 100%;
    justify-content: space-between;
    min-height: 40px;
    margin: 0;
    padding: 0 12px;
    border-color: var(--line-soft);
    border-radius: 4px;
  }
  body.studio-web:not(.mobile-room):not(.mobile-delivery)
    .main-top:has(.studio-update-notice) .studio-wordmark {
    display: flex !important;
    top: 12px;
  }
  body.studio-web .main-top:has(#web-update-notice) #studio-state-notice {
    display: none;
  }
}

/* Canvas native Office artifacts inherit the approved Studio surface. */
.pw-office-inputs { margin: 16px 0; }
.pw-office-inputs > small { margin-left: 12px; color: var(--muted); }
.pw-office-upload { display: inline-flex; align-items: center; position: relative; cursor: pointer; }
.pw-office-upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pw-office-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.pw-office-inputs ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
.pw-office-inputs li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--control); border-radius: 4px; max-width: 100%; }
.pw-office-inputs li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-office-steps { margin: 12px 0; padding: 0; list-style: none; color: var(--muted); }
.pw-office-steps li { margin: 8px 0; }
.pw-office-steps [data-status="completed"] span { color: var(--success); }
.pw-office-steps [data-status="failed"] span { color: var(--error); }
.pw-office-artifacts { margin-top: 16px; }
.pw-office-file { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.pw-office-file > div { min-width: 0; }
.pw-office-file h3 { margin: 0 0 6px; overflow-wrap: anywhere; font-size: 18px; }
.pw-office-file p { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pw-office-file-type { display: grid; place-items: center; width: 56px; height: 66px; flex: 0 0 56px; color: var(--accent); border: 1px solid var(--line-soft); border-radius: 4px; font-size: 12px; font-weight: 700; }
.pw-office-result .pw-ppt-edit textarea { min-height: 96px; }
.pw-office-result .pw-ppt-complete { color: var(--success); }
.pw-office-host .pw-resource-row > .pw-ppt-menu { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.pw-office-host .pw-ppt-menu summary { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; }
.pw-office-host .pw-ppt-menu button { min-height: 40px; text-align: left; }
.pw-office-host .pw-ppt-menu div { border-radius: 6px; border-color: var(--line-soft); }
.pw-office-host .pw-image-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pw-office-host .pw-image-settings .pw-field { display: block; margin-bottom: 8px; }
.pw-office-host .pw-image-settings > div { min-width: 0; }
.pw-office-host .pw-image-settings > div > button { width: 100%; min-width: 0; min-height: 40px; white-space: normal; overflow-wrap: anywhere; }
.pw-office-host[data-office-kind="excel"] .pw-office-file-type { color: #082e22; background: #00c875; border-color: transparent; }
.pw-office-host[data-office-kind="document"] .pw-office-file-type { color: #102542; background: #579bfc; border-color: transparent; }
.pw-type[data-pw-enter="excel"] .pw-type-art { background: #153e32; }
.pw-type[data-pw-enter="document"] .pw-type-art { background: #203d61; }
@media (max-width: 600px) {
  .pw-office-file { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .pw-office-file > button { grid-column: 2; justify-self: start; min-height: 44px; }
  .pw-office-inputs > small { display: block; margin: 10px 0 0; }
  .pw-office-result .pw-start-actions { flex-wrap: wrap; }
  .pw-office-host .pw-ppt-menu summary, .pw-office-host .pw-ppt-menu button { min-height: 44px; }
}
