/* Interface surfaces are separate from client colors and the video's own colors. */
:root {
  --panel: #fff;
  --subtle: #eef1ed;
  --hover: #f1f3ef;
  --field-line: #cdd3ce;
  --brand-wash: color-mix(in srgb, var(--accent) 8%, var(--panel));
  --brand-text: color-mix(in srgb, var(--accent) 40%, #021816);
  --brand-marker: var(--accent);
  --brand-edge: color-mix(in srgb, var(--accent) 28%, var(--line));
  --positive-bg: #e3eee7;
  --positive-ink: #28513d;
  --pending-bg: #f2eee4;
  --pending-ink: #6a5424;
  --review-bg: #eceef2;
  --review-ink: #4f5667;
  --editing-bg: #e5edfb;
  --editing-ink: #365f9a;
}
:root[data-color-mode="dark"] {
  --ink: #e7efeb;
  --gray: #bdc9c3;
  --muted: #a4b3ab;
  --paper: #101b19;
  --panel: #192622;
  --subtle: #22322c;
  --hover: #283a32;
  --line: #35473e;
  --field-line: #4c6257;
  --brand-wash: color-mix(in srgb, var(--accent) 18%, var(--panel));
  --brand-text: color-mix(in srgb, var(--accent) 28%, #fff);
  --brand-marker: color-mix(in srgb, var(--accent) 50%, #fff);
  --brand-edge: color-mix(in srgb, var(--accent) 35%, var(--line));
  --positive-bg: #223d2f;
  --positive-ink: #b0d9bd;
  --pending-bg: #3b3423;
  --pending-ink: #e0cd9b;
  --review-bg: #2c3340;
  --review-ink: #c5ccdc;
  --editing-bg: #24374d;
  --editing-ink: #abcaf0;
}
body { color: var(--ink); background: var(--paper); }
button, summary { color: inherit; }
input, textarea, select { background-color: var(--panel); border-color: var(--field-line); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { accent-color: #718f83; }
select option { color: var(--ink); background: var(--panel); }
[data-color-mode="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23bdc9c3' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.sidebar, .role-switch button.active, .btn, .icon-btn, .asset-card, .panel,
.filter.active, .post-row, .modal-header, .review-comments, .review-actions,
.comment-form, .version-item, .notice.neutral, .journey,
.review-modal, .review-modal .review-toolbar, .review-modal .review-comments,
.review-modal .review-composer, .review-modal .comment-form-footer,
.comment-menu>div, .asset-menu>div,
.thumbnail-menu summary, .thumbnail-menu>div,
.chat-workspace, .chat-dialog, .chat-message-menu>div,
.chat-compose textarea, .chat-day span, .chat-demo select { background-color: var(--panel); }
.topbar { background: color-mix(in srgb, var(--panel) 96%, transparent); }
.btn:hover, .nav button:hover, .chat-message:hover,
.chat-message-menu button:hover { background: var(--hover); }
.btn.primary { background: var(--action); color: var(--action-ink); border-color: var(--action); }
.btn.primary:hover { background: #98aeac; border-color: #98aeac; }
.btn.dark, .skip, #toast { background: #021816; color: #fff; border-color: #021816; }
[data-color-mode="dark"] .btn.dark {
  background: var(--subtle); color: var(--ink); border-color: var(--field-line);
}
.btn.text { background: transparent; }
.blank, .library-empty { background: var(--panel); border-color: var(--line); }
.demo-label { border-color: var(--field-line); color: var(--gray); }
#toast.error { color: var(--accent-ink); }
.notice, .error-message, .filming-note-conflict, .chat-connection {
  background: var(--pending-bg); border-color: var(--field-line); color: var(--pending-ink);
}
.notice.soft { background: var(--positive-bg); border-color: var(--line); color: var(--ink); }
.notice.neutral { color: var(--ink); }
.status.needs_review, .status.draft { background: var(--pending-bg); color: var(--pending-ink); }
.status.approved, .status.approved_proposal, .filming-confirmed-label, .chat-needs-reply {
  background: var(--positive-bg); color: var(--positive-ink); border-color: var(--line);
}
.status.changes_requested, .status-picker.status-changes_requested { background: var(--review-bg); color: var(--review-ink); border-color: var(--line); }
.status.in_progress, .status-picker.status-in_progress { background: var(--editing-bg); color: var(--editing-ink); border-color: var(--line); }
.status.on_hold, .status.canceled { background: var(--subtle); color: var(--muted); }
.status-picker { background: var(--subtle); color: var(--gray); border-color: var(--field-line); }
.status-picker.status-approved { background: var(--positive-bg); color: var(--positive-ink); border-color: var(--line); }
.review-status-form { border-color: var(--line); }
.review-status-form p, .card-status-label { color: var(--muted); }
.avatar { background: var(--subtle); color: var(--ink); }
.nav .count { background: var(--surface); color: #021816; }
/* Keep poster artwork and preview logos consistent in both viewing modes. */
.poster { background: #021816; }
.poster.p1 { background: var(--surface); color: #021816; }
.poster.p2 { background: #494e52; }
.poster.p3 { background: #ceccc3; color: #021816; }
.poster.p4 { background: var(--accent); color: var(--accent-ink); }
.poster.p5 { background: #dce2de; color: #021816; }
.poster.p6 { background: #344943; }
.poster.p7 { background: #a3b1ae; color: #021816; }
.video-poster, .review-player { background: #101413; }
.brand-preview-tile { color: #021816; }
.brand-preview-header, .settings-image { background: #fff; color: #021816; }

/* Client identity stays above Dashboard, without truncating the company name. */
.sidebar { padding-top: 24px; overflow-y: auto; }
.company-brand { margin: 0 4px 22px; padding: 0 7px 22px; border-bottom: 1px solid var(--brand-edge); position: relative; }
.company-brand::before { content: ''; display: block; width: 36px; height: 4px; background: var(--brand-marker); border-radius: 4px; margin-bottom: 18px; }
.company-logo { min-height: 48px; display: flex; align-items: center; margin-bottom: 16px; }
.company-logo.has-logo { background: #fff; border-radius: 9px; padding: 12px; min-height: 65px; }
.company-logo img { display: block; width: 100%; max-height: 48px; object-fit: contain; object-position: left center; }
.company-monogram { width: 52px; height: 52px; border-radius: 12px; background: var(--surface); color: #021816; display: grid; place-items: center; font-size: 21px; font-weight: 700; }
.company-name { font-size: 24px; line-height: 1.12; font-weight: 700; letter-spacing: -.035em; overflow-wrap: anywhere; }
.company-brand .portal-label { margin: 9px 0 0; font-size: 13px; letter-spacing: .04em; color: var(--muted); }
.nav button.active { background: var(--brand-wash); color: var(--brand-text); box-shadow: inset 3px 0 var(--brand-marker); }
.filter.active { border-color: var(--brand-edge); color: var(--brand-text); }
.response-inbox { background: var(--brand-wash); border-color: var(--brand-edge); }
.response-inbox>header>span, .response-request .filming-time { color: var(--brand-text); }
.response-request { border-color: var(--brand-edge); }
.filming-date-chip, .filming-response-detail, .filming-approval-check { background: var(--subtle); border-color: var(--line); }
.filming-date-chip span { color: var(--muted); }
.filming-date-chip strong { color: var(--ink); }

/* The same pill and sliding sun/moon thumb used in Production Desk. */
.prototype-controls { display: flex; align-items: center; gap: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.topbar-refresh { width: 44px; height: 44px; flex: none; }
.theme-toggle { width: 50px; height: 44px; padding: 4px; border: 0; background: transparent; border-radius: 24px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.theme-toggle-track { width: 42px; height: 24px; border-radius: 20px; background: #e5ece5; border: 1px solid #d5ddd6; position: relative; display: block; }
.theme-toggle-thumb { position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; color: #53675c; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 1px 3px #02181620; transition: transform .18s ease; }
.theme-toggle svg { grid-area: 1/1; width: 13px; height: 13px; stroke-width: 1.8; }
.theme-moon { display: none; }
[data-color-mode="dark"] .theme-toggle-track { background: #354c40; border-color: #516c5b; }
[data-color-mode="dark"] .theme-toggle-thumb { transform: translateX(18px); background: #d9e9de; color: #243f30; }
[data-color-mode="dark"] .theme-sun { display: none; }
[data-color-mode="dark"] .theme-moon { display: block; }
.theme-toggle:hover .theme-toggle-track { border-color: #82998a; }

/* Conversation surfaces and metadata remain readable in either mode. */
.chat-rail { background: var(--subtle); }
.chat-rail-label, .chat-room, .chat-message-menu summary { color: var(--gray); }
.chat-room.selected, .chat-client.selected { background: var(--brand-wash); color: var(--brand-text); }
.chat-room:hover { background: var(--hover); color: var(--ink); }
.chat-rail-section:last-of-type .chat-room-symbol { background: var(--panel); }
.chat-unread { background: #344d49; color: #fff; }
.chat-avatar { background: var(--surface); color: #021816; }
.chat-avatar.staff { background: #374f4b; color: #fff; }
.chat-day, .chat-day span { border-color: var(--line); }
.chat-day span, .chat-message-by time, .chat-message-by small,
.chat-message.removed .chat-message-body, .chat-compose-footer>span { color: var(--muted); }
.chat-message-body { color: var(--ink); }
.chat-message blockquote, .chat-compose-context>div { background: var(--subtle); color: var(--gray); border-color: var(--brand-edge); }
.chat-message blockquote b { color: var(--ink); }
.chat-message-menu[open] summary { background: var(--subtle); }
.chat-compose { background: var(--panel); border-color: var(--field-line); }
.chat-compose:focus-within { border-color: var(--brand-text); }
.chat-client small, .chat-text-button { color: var(--brand-text); }
.chat-send-state:not(:empty), .chat-dialog-error { color: var(--pending-ink); }
.chat-new { background: var(--positive-bg); color: var(--positive-ink); border-color: var(--field-line); }

@media (max-width: 1280px) { .local-indicator { display: none; } }
@media (max-width: 800px) {
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; padding: 10px 18px; }
  .topbar-left { min-width: 0; }
  .topbar-left>span:not(.local-indicator) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { display: contents; }
  .topbar-actions { grid-row: 1; grid-column: 2; }
  .prototype-controls { grid-column: 1/-1; justify-content: space-between; gap: 10px; min-width: 0; }
  .prototype-controls .workspace-select { flex: 1; min-width: 0; max-width: 210px; font-size: 14px; }
  .role-switch { flex: none; }
  .role-switch button { font-size: 14px; padding: 7px 10px; }
  .sidebar { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle-thumb { transition: none; } }

:is(.notification-advanced,.profile-advanced,.billing-methods) > summary { cursor: pointer; font-weight: 650; padding-block: 8px; }
.notification-advanced { margin-top: 18px; }
.notification-panel .chat-device-notifications { margin: 0 0 20px; }
#recent-updates { margin-bottom: 16px; }
.profile-settings .profile-advanced { grid-column: 1/-1; }
.profile-settings > form:first-child { grid-column: 1/-1; }
