/* Kadr sky identity. The artwork belongs to the application chrome, never to document pages. */
:root {
  --bg: #dceeff;
  --surface: #fff;
  --surface-raised: #fff;
  --surface-soft: #edf5ff;
  --surface-blue: #e2efff;
  --border: #cbdcf3;
  --text: #102d68;
  --muted: #4e699a;
  --accent: #0868e9;
  --accent-strong: #0643a7;
  --accent-soft: #e2efff;
  --button-bg: #0968ec;
  --button-fg: #fff;
  --success-bg: #def6ef;
  --success-text: #087d61;
  --danger-bg: #fff0ee;
  --danger-text: #bd3b3b;
  --focus: #73adff;
  --shadow: 0 12px 36px rgba(9, 57, 131, .12);
  --sidebar-width: 224px;
  --inspector-width: 330px;
}
:root[data-theme="dark"] {
  --bg: #081b45;
  --surface: #132f64;
  --surface-raised: #1b3a72;
  --surface-soft: #17396f;
  --surface-blue: #1d467d;
  --border: #42649b;
  --text: #edf5ff;
  --muted: #b9cff3;
  --accent: #8dc1ff;
  --accent-strong: #d5eaff;
  --accent-soft: #24528c;
  --button-bg: #1775ec;
  --button-fg: #fff;
  --success-bg: #114f56;
  --success-text: #a5f0da;
  --danger-bg: #5d2f41;
  --danger-text: #ffd5d7;
  --focus: #a5ceff;
  --shadow: 0 16px 42px rgba(0, 9, 36, .3);
}

body.product-shell,
body.auth-page,
body.admin-shell {
  background: linear-gradient(180deg, rgba(0, 53, 145, .08), rgba(191, 224, 255, .04)),
    url('/assets/sky-mountains.png') center center / cover fixed no-repeat;
}
:root[data-theme="dark"] body.product-shell {
  background: linear-gradient(180deg, rgba(3, 15, 48, .8), rgba(5, 33, 80, .68)),
    url('/assets/sky-mountains.png') center center / cover fixed no-repeat;
}

/* Shared controls and brand. */
.product-shell button,
.product-shell input,
.product-shell select,
.product-shell textarea,
.auth-page button,
.auth-page input {
  border-radius: 10px;
}
.product-shell button.primary,
.auth-primary {
  box-shadow: 0 8px 21px rgba(0, 94, 224, .22);
}
.product-shell button.primary:hover,
.auth-primary:hover { filter: brightness(1.07); }
.product-shell .icon-button:hover { background: rgba(225, 239, 255, .88); }
.product-shell :focus-visible,
.auth-page :focus-visible,
.admin-shell :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.product-brand {
  position: fixed;
  top: 15px;
  left: 22px;
  z-index: 35;
  margin: 0;
  padding: 0;
  color: white;
  font: 27px/1.1 Georgia, 'Times New Roman', serif;
  letter-spacing: -.5px;
  white-space: nowrap;
}
.product-brand b { color: white; font-weight: 400; }
.product-brand small { display: none; }
.product-brand .brand-mark,
.auth-mark,
.admin-brand-mark {
  background: none;
  border-radius: 0;
}
.product-brand img,
.mobile-brand img,
.auth-brand img,
.admin-brand img { display: block; object-fit: contain; filter: brightness(0) invert(1); }
.mobile-brand { display: none; }

/* Desktop shell: a light glass workspace framed by an airy blue sidebar. */
.product-shell .sidebar {
  top: 76px;
  bottom: 16px;
  left: 16px;
  width: calc(var(--sidebar-width) - 30px);
  height: auto;
  padding: 13px 9px;
  gap: 10px;
  background: linear-gradient(160deg, rgba(15, 93, 197, .6), rgba(78, 158, 231, .36));
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(16, 68, 149, .13), inset 0 1px 0 rgba(255, 255, 255, .4);
  backdrop-filter: blur(18px);
}
.sidebar .product-brand { display: flex; }
.product-shell .sidebar .new-document {
  background: rgba(255, 255, 255, .94);
  color: #0758ca;
  border: 1px solid rgba(255, 255, 255, .8);
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
}
.product-shell .main-nav button,
.product-shell .sidebar-bottom > button,
.product-shell .recent-documents button,
.product-shell .sidebar-foot,
.product-shell .sidebar-section-title,
.product-shell .recent-empty { color: #f6fbff; }
.product-shell .main-nav button,
.product-shell .sidebar-bottom > button { min-height: 46px; font-size: 12px; padding-inline: 13px; }
.product-shell .main-nav button.active,
.product-shell .sidebar-bottom > button.active {
  color: #0754c6;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 18px rgba(8, 61, 145, .12);
}
.product-shell .sidebar button:not(.active):hover { background: rgba(255, 255, 255, .17); color: white; }
.product-shell .nav-count { color: #0954bc; }
.product-shell .sidebar .nav-count { background: #fff; }
.product-shell .sidebar .recent-documents button.active { color: #0855c3; background: rgba(255,255,255,.93); }
.product-shell .sidebar-bottom { border-color: rgba(255, 255, 255, .3); }
.product-shell .sidebar-profile { border-color: rgba(255, 255, 255, .3); }
.product-shell .sidebar-profile small { color: #dfedff; }
.product-shell .sidebar-foot button { color: white; }
.product-shell .profile-avatar { border-radius: 50%; }

.product-shell .product-topbar {
  height: 70px;
  padding: 0 24px 0 12px;
  background: linear-gradient(90deg, rgba(4, 68, 162, .31), rgba(3, 74, 179, .13));
  border: 0;
  color: #fff;
}
.product-shell .topbar-path,
.product-shell .breadcrumb-brand,
.product-shell .topbar-actions,
.product-shell .save-status { color: #f6faff; }
.product-shell .save-status::before { width: 8px; height: 8px; background: #49dac0; }
.product-shell .save-status[data-state="error"]::before { background: #ffb4a7; }
.product-shell .product-topbar .icon-button { color: #fff; }
.product-shell .product-topbar .icon-button:hover { background: rgba(255, 255, 255, .18); }

/* Library: compact, scannable rows instead of oversized cards. */
.product-shell .library-page,
.product-shell .settings-page {
  margin: 12px 20px 18px 0;
  padding: 27px 28px 30px;
  background: rgba(250, 253, 255, .86);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 20px;
  box-shadow: 0 20px 52px rgba(26, 96, 173, .13);
  backdrop-filter: blur(20px);
}
.product-shell .page-heading { margin-bottom: 22px; }
.product-shell .page-heading h1,
.product-shell .library-empty h2 {
  color: #092e78;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -.035em;
}
.product-shell .page-heading h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.08; margin-bottom: 8px; }
.product-shell .heading-dot { color: #0b6cf0; }
.product-shell .page-heading p:not(.eyebrow) { color: #526d9e; font-size: 13px; }
.product-shell .eyebrow { color: #0c61d8; }
.product-shell .library-controls { gap: 12px; margin-bottom: 11px; padding-bottom: 11px; }
.product-shell .segmented { border-color: #d5e4f7; background: #f2f7fe; border-radius: 12px; }
.product-shell .segmented button.active { background: #0b6ced; color: #fff; box-shadow: 0 4px 12px rgba(0, 94, 230, .2); }
.product-shell .search-field { background: rgba(255, 255, 255, .9); border-radius: 10px; }
.product-shell .search-field input[type="search"] { max-width: 275px; width: 22vw; }
.product-shell .document-grid {
  display: block;
  overflow: hidden;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #dce9fa;
  border-radius: 15px;
}
.product-shell .document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #e2ecfa;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.product-shell .document-card:last-child { border-bottom: 0; }
.product-shell .document-card:hover { background: #f3f8ff; box-shadow: none; }
.product-shell .document-card .card-open {
  display: grid;
  grid-template-columns: 43px minmax(150px, 1.1fr) minmax(180px, 1.3fr) 56px 76px;
  align-items: center;
  column-gap: 12px;
  min-height: 76px;
  padding: 9px 12px;
  text-align: left;
}
.product-shell .card-top { display: contents; }
.product-shell .file-symbol { grid-column: 1; grid-row: 1; background: #eaf3ff; color: #0966df; }
.product-shell .document-card h2 { grid-column: 2; grid-row: 1; margin: 0; color: #0b3581; font-size: 13px; font-weight: 650; white-space: normal; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-shell .card-preview { grid-column: 3; grid-row: 1; min-height: 0; color: #516c9d; font: 12px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-line-clamp: 2; }
.product-shell .card-format { grid-column: 4; grid-row: 1; justify-self: center; padding: 5px 7px; border-radius: 6px; background: #e3efff; color: #075aca; font-weight: 700; letter-spacing: 0; }
.product-shell .card-status { grid-column: 5; grid-row: 1; justify-self: start; border: 0; border-radius: 20px; background: #e7f0ff; color: #065ccd; white-space: nowrap; }
.product-shell .card-status.done { background: #ddf7ee; color: #078567; }
.product-shell .card-footer { display: grid; grid-template-columns: minmax(0,1fr) 26px 26px; gap: 0 3px; padding: 7px 10px 7px 2px; border: 0; }
.product-shell .card-footer span { grid-column: 1; font-size: 10px; white-space: nowrap; }
.product-shell .card-footer span:nth-child(2) { margin: 0; color: #849bc2; }
.product-shell .card-footer button:nth-of-type(1) { grid-column: 2; grid-row: 1 / 3; }
.product-shell .card-footer button:nth-of-type(2) { grid-column: 3; grid-row: 1 / 3; }
.product-shell .new-card { width: 100%; min-height: 54px; flex-direction: row; border: 0; border-radius: 0; background: #f5f9ff!important; color: #0c63d9!important; }

/* Workspace: editorial canvas on top of sky. Pages and text canvases stay plain white. */
.product-shell .workspace-page { padding: 0 16px 16px 0; }
.product-shell .document-heading { padding: 9px 4px 10px; }
.product-shell .document-title { color: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 400; }
.product-shell .document-title:hover { border-color: rgba(255,255,255,.55); }
.product-shell .doc-symbol,
.product-shell .document-meta { color: #f4f9ff; }
.product-shell .doc-symbol { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.1); }
.product-shell .document-heading .icon-button,
.product-shell .document-heading .action-menu summary { color: #fff; }
.product-shell .document-heading .secondary { color: #fff; background: rgba(9, 75, 177, .3); border-color: rgba(255,255,255,.43); }
.product-shell .document-heading .secondary:hover { background: rgba(9, 75, 177, .52); }
.product-shell .editor-toolbar { padding: 0 3px 9px; gap: 8px; }
.product-shell .editor-tabs button { color: #f6faff; }
.product-shell .editor-tabs button[aria-selected="true"] { color: #0754c5; background: rgba(255,255,255,.97); border-color: rgba(255,255,255,.9); }
.product-shell .editor-controls select { color: #073c90; background: rgba(255,255,255,.97); }
.product-shell .editor-controls .secondary { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(0,61,156,.26); }
.product-shell .editor-controls .icon-button { color: #fff; }
.product-shell .import-notice { margin: 0 0 9px; background: #fff7ed; border-color: #f4d6ad; color: #583c1c; }
.product-shell .import-notice { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 2px 13px; padding: 8px 12px; }
.product-shell .import-notice details { color: #76593b; }
.product-shell .editor-layout { border-top: 0; gap: 10px; }
.product-shell .editor-stage { padding: 0 0 0 2px; }
.product-shell .scopebar { color: #f7fbff; min-height: 31px; padding: 3px 0; }
.product-shell .scopebar button { color: #fff; }
.product-shell .editor-pane,
.product-shell .compare-pane,
.product-shell .inspector {
  border: 1px solid rgba(214, 232, 255, .9);
  border-radius: 14px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 15px 38px rgba(8, 55, 137, .15);
}
.product-shell .editor-pane .pane-head,
.product-shell .compare-pane > .panel-head { color: #47699e; background: #fff; }
.product-shell .editor-pane .pane-head span { color: #1a4388; }
.product-shell .editor-pane .preview-toggle { color: #075ed8; font-weight: 650; }
.product-shell .editor-pane > textarea,
:root[data-theme="dark"] .product-shell .editor-pane > textarea {
  background: #fff;
  color: #152b50;
  font-family: Georgia, 'Times New Roman', serif;
}
.product-shell .doc-preview,
:root[data-theme="dark"] .product-shell .doc-preview { background: #d7e9fc; padding: 10px; }
.product-shell .doc-page,
:root[data-theme="dark"] .product-shell .doc-page {
  background: #fff !important;
  color: #14233d !important;
  box-shadow: 0 7px 25px rgba(23, 64, 117, .17);
}
.product-shell .editor-statusbar { color: #fff; }
.product-shell .inspector { overflow: hidden; }
.product-shell .inspector-tabs { background: #fff; }
.product-shell .inspector-tabs button { color: #647eab; }
.product-shell .inspector-tabs button[aria-selected="true"] { color: #075ed8; background: #eaf3ff; }
.product-shell .review-panel,
.product-shell .overview-panel,
.product-shell .history-panel { background: #fff; color: #12336f; }
.product-shell .review-summary,
.product-shell .issue-filters { background: #fff; }
.product-shell .compare-pane .diff-view { background: #fff; }
.product-shell .count-badge { border-radius: 50%; }
.workspace-expanded .product-shell .workspace-page,
.product-shell.workspace-expanded .workspace-page { padding: 0; }
.product-shell.workspace-expanded .editor-toolbar { background: rgba(6, 66, 160, .73); border-bottom-color: rgba(255,255,255,.3); }
.product-shell.workspace-expanded .editor-stage { padding: 0; }
.product-shell.workspace-expanded .doc-preview { padding: 4px; }
.product-shell.workspace-expanded #expandWorkspaceBtn { color: #0b5bd1; background: #fff; }

/* Account and data screens retain the blue setting, with legible white cards. */
.product-shell .account-page { padding: 23px 25px 28px 0; }
.product-shell .account-page .page-heading h1 { color: #fff; }
.product-shell .account-page .page-heading p:not(.eyebrow),
.product-shell .account-page .eyebrow { color: #eef6ff; }
.product-shell .account-layout { max-width: none; }
.product-shell .account-card,
.product-shell .settings-card { background: rgba(255,255,255,.96); border-color: rgba(255,255,255,.8); box-shadow: 0 18px 42px rgba(10, 70, 148, .13); }
.product-shell .account-card h2,
.product-shell .settings-card h2 { color: #0b3887; font-family: Georgia, 'Times New Roman', serif; font-size: 23px; font-weight: 400; }
.product-shell .account-card .muted,
.product-shell .settings-card .muted { color: #4e699a; }
.product-shell .account-section-icon { background: #e8f2ff; color: #0a64dd; }
.product-shell .account-storage-card progress { accent-color: #0c6ced; }
.product-shell .account-page .account-exit { background: rgba(255,255,255,.95); padding: 18px; border-radius: 13px; }
.product-shell .account-page .admin-console-link { color: #075acf; background: #fff; }

/* Dialogs keep their real functions while adopting the same visual language. */
.product-shell dialog { border-color: #cde0f8; border-radius: 18px; box-shadow: 0 25px 80px rgba(0, 31, 93, .33); }
.product-shell dialog::backdrop { background: rgba(3, 26, 76, .56); backdrop-filter: blur(5px); }
.product-shell .prompt-dialog { width: min(960px, calc(100vw - 30px)); max-width: 960px; }
.product-shell .prompt-heading h2 { color: #0a367f; font: 400 31px Georgia, 'Times New Roman', serif; }
.product-shell #promptPreview { background: #f5f9ff; color: #163f83; border-color: #d3e3f8; }
.product-shell .prompt-note { color: #44669e; background: #eef6ff; border-radius: 10px; padding: 10px 12px; }

/* Login and recovery use the same sky without reproducing the mockups' fake sign-in methods. */
body.auth-page {
  --auth-bg: #dceeff;
  --auth-surface: rgba(255,255,255,.97);
  --auth-ink: #0b3079;
  --auth-muted: #4e699a;
  --auth-line: #cbdef7;
  --auth-brand: #0964df;
  --auth-soft: #e7f2ff;
  --auth-danger: #b62f41;
  min-height: 100dvh;
}
.auth-page .auth-header { max-width: 1450px; }
.auth-page .auth-brand { color: #fff; font: 28px Georgia, 'Times New Roman', serif; }
.auth-page .auth-brand b { font-weight: 400; }
.auth-page .auth-header-note { color: #fff; }
.auth-page .auth-layout { max-width: 1260px; gap: 65px; margin-top: clamp(24px, 7vh, 90px); }
.auth-page .auth-story h1 { color: #fff; text-shadow: 0 5px 25px rgba(0,48,137,.24); }
.auth-page .auth-story h1 span { color: #eef8ff; }
.auth-page .auth-eyebrow,
.auth-page .auth-description,
.auth-page .auth-assurance { color: #eef7ff; }
.auth-page .auth-panel,
.auth-page .auth-paper { background: rgba(255,255,255,.97); border-color: rgba(255,255,255,.83); box-shadow: 0 22px 60px rgba(5,62,151,.22); backdrop-filter: blur(18px); }
.auth-page .auth-panel { border-radius: 22px; }
.auth-page .auth-panel h2 { color: #0b327d; font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.auth-page .auth-tabs { background: #eef5ff; }
.auth-page .auth-tabs [aria-selected="true"] { color: #085fd8; }
.auth-page .auth-primary { background: #0868e9; }
.auth-page .auth-footer { color: #fff; }

/* Administrator sees only saved texts. The visuals do not imply extra powers. */
body.admin-shell { --bg:#dceeff; --surface:#fff; --surface-soft:#edf5ff; --border:#cbdef7; --text:#102d68; --muted:#4e699a; --accent:#0868e9; --accent-soft:#e2efff; --focus:#73adff; }
.admin-shell .admin-topbar { background: rgba(6,73,171,.38); border: 0; color: #fff; }
.admin-shell .admin-brand { color: #fff; font: 25px Georgia, 'Times New Roman', serif; }
.admin-shell .admin-brand b { color: #fff; font-weight: 400; }
.admin-shell .admin-top-label,
.admin-shell .admin-topbar nav a,
.admin-shell .admin-topbar nav button { color: #fff; border-color: rgba(255,255,255,.5); }
.admin-shell .admin-heading h1 { color: #fff; font: 400 clamp(34px, 4.3vw, 57px)/1.1 Georgia, 'Times New Roman', serif; letter-spacing: -.035em; }
.admin-shell .admin-heading p:not(.admin-eyebrow),
.admin-shell .admin-eyebrow { color: #f4f9ff; }
.admin-shell .admin-stats > div,
.admin-shell .admin-panel { background: rgba(255,255,255,.97); border-color: rgba(255,255,255,.83); box-shadow: 0 15px 35px rgba(7,65,144,.13); }
.admin-shell .admin-stats strong { color: #0a3889; font-family: Georgia, 'Times New Roman', serif; }
.admin-shell .admin-panel-head h2 { color: #0a3889; font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 400; }
.admin-shell .admin-outline { background: rgba(255,255,255,.96); color: #0a56c4; }

/* The day scene is intentionally visible around white reading surfaces. */
:root[data-theme="dark"] body.product-shell {
  background: linear-gradient(180deg, rgba(2, 13, 43, .16), rgba(4, 23, 61, .2)),
    url('/assets/sky-night.png') center center / cover fixed no-repeat;
}

:root[data-theme="dark"] .product-shell .product-brand,
:root[data-theme="dark"] .product-shell .product-brand b,
:root[data-theme="dark"] .product-shell .mobile-brand { color: #e7ebef; }
:root[data-theme="dark"] .product-shell .product-brand img,
:root[data-theme="dark"] .product-shell .mobile-brand img { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .product-shell .sidebar,
:root[data-theme="dark"] .product-shell .product-topbar { background: rgba(8, 38, 91, .82); border-color: rgba(183, 216, 255, .42); box-shadow: none; }
:root[data-theme="dark"] .product-shell .sidebar .new-document { background: #0a68e9; border-color: #0a68e9; color: #fff; }
:root[data-theme="dark"] .product-shell .sidebar .new-document:hover { background: #2783f4; color: #fff; }
:root[data-theme="dark"] .product-shell .main-nav button,
:root[data-theme="dark"] .product-shell .sidebar-bottom > button,
:root[data-theme="dark"] .product-shell .recent-documents button,
:root[data-theme="dark"] .product-shell .sidebar-foot,
:root[data-theme="dark"] .product-shell .sidebar-section-title,
:root[data-theme="dark"] .product-shell .recent-empty,
:root[data-theme="dark"] .product-shell .topbar-path,
:root[data-theme="dark"] .product-shell .breadcrumb-brand,
:root[data-theme="dark"] .product-shell .topbar-actions,
:root[data-theme="dark"] .product-shell .save-status,
:root[data-theme="dark"] .product-shell .product-topbar .icon-button { color: #e8f3ff; }
:root[data-theme="dark"] .product-shell .main-nav button.active,
:root[data-theme="dark"] .product-shell .sidebar-bottom > button.active,
:root[data-theme="dark"] .product-shell .sidebar .recent-documents button.active { color: #e5eff8; background: #28578d; }
:root[data-theme="dark"] .product-shell .sidebar button:not(.active):hover,
:root[data-theme="dark"] .product-shell .product-topbar .icon-button:hover { background: #1c4d8c; color: #fff; }
:root[data-theme="dark"] .product-shell .sidebar .nav-count { color: #c7def1; background: #25568d; }
:root[data-theme="dark"] .product-shell .sidebar-bottom,
:root[data-theme="dark"] .product-shell .sidebar-profile { border-color: #3c6094; }
:root[data-theme="dark"] .product-shell .sidebar-profile small { color: #c3d8f2; }
:root[data-theme="dark"] .product-shell .library-page,
:root[data-theme="dark"] .product-shell .settings-page,
:root[data-theme="dark"] .product-shell .account-card,
:root[data-theme="dark"] .product-shell .account-page .account-exit,
:root[data-theme="dark"] .product-shell dialog { background: #102a55; border-color: #3c6094; box-shadow: 0 18px 42px rgba(0, 13, 43, .27); color: #ecf0f3; }
:root[data-theme="dark"] .product-shell .page-heading h1,
:root[data-theme="dark"] .product-shell .library-empty h2,
:root[data-theme="dark"] .product-shell .account-card h2,
:root[data-theme="dark"] .product-shell .settings-card h2,
:root[data-theme="dark"] .product-shell .prompt-heading h2 { color: #edf0f4; }
:root[data-theme="dark"] .product-shell .page-heading p:not(.eyebrow),
:root[data-theme="dark"] .product-shell .account-card .muted,
:root[data-theme="dark"] .product-shell .settings-card .muted { color: #bcd1ee; }
:root[data-theme="dark"] .product-shell .document-grid,
:root[data-theme="dark"] .product-shell .document-card,
:root[data-theme="dark"] .product-shell .segmented { background: #14315d; border-color: #3c6094; }
:root[data-theme="dark"] .product-shell .search-field { background: #193967; border-color: #5072a0; color: #b6c4d0; }
:root[data-theme="dark"] .product-shell .search-field input[type="search"] { color: #ecf0f3; }
:root[data-theme="dark"] .product-shell .search-field input[type="search"]::placeholder { color: #aeb9c5; opacity: 1; }
:root[data-theme="dark"] .product-shell .document-card:hover,
:root[data-theme="dark"] .product-shell .new-card { background: #1d4278 !important; }
:root[data-theme="dark"] .product-shell .new-card { color: #bfdbf3 !important; }
:root[data-theme="dark"] .product-shell .document-card h2,
:root[data-theme="dark"] .product-shell .card-preview { color: #e0e6ec; }
:root[data-theme="dark"] .product-shell .file-symbol,
:root[data-theme="dark"] .product-shell .card-format,
:root[data-theme="dark"] .product-shell .card-status { background: #235586; color: #d2e6f6; }
:root[data-theme="dark"] .product-shell .document-title,
:root[data-theme="dark"] .product-shell .doc-symbol,
:root[data-theme="dark"] .product-shell .document-meta,
:root[data-theme="dark"] .product-shell .document-heading .icon-button,
:root[data-theme="dark"] .product-shell .document-heading .action-menu summary,
:root[data-theme="dark"] .product-shell .scopebar,
:root[data-theme="dark"] .product-shell .scopebar button,
:root[data-theme="dark"] .product-shell .editor-tabs button,
:root[data-theme="dark"] .product-shell .editor-controls .icon-button,
:root[data-theme="dark"] .product-shell .editor-statusbar { color: #e1e7ed; }
:root[data-theme="dark"] .product-shell .doc-symbol { background: #1a4273; border-color: #5475a1; }
:root[data-theme="dark"] .product-shell .document-heading .secondary,
:root[data-theme="dark"] .product-shell .editor-controls .secondary { color: #e2ebf2; background: #1a4273; border-color: #5d81b0; }
:root[data-theme="dark"] .product-shell .editor-tabs button[aria-selected="true"] { color: #eaf1f7; background: #27588c; border-color: #7296c4; }
:root[data-theme="dark"] .product-shell .editor-pane .preview-toggle,
:root[data-theme="dark"] .product-shell .eyebrow { color: #a2c4e6; }
:root[data-theme="dark"] .product-shell .editor-controls select { color: #e3eaf1; background: #193b6c; border-color: #6586b3; }
:root[data-theme="dark"] .product-shell .editor-pane,
:root[data-theme="dark"] .product-shell .compare-pane,
:root[data-theme="dark"] .product-shell .inspector { background: #102a55; border-color: #3c6094; box-shadow: 0 15px 34px rgba(0, 13, 43, .27); }
:root[data-theme="dark"] .product-shell .editor-pane .pane-head,
:root[data-theme="dark"] .product-shell .compare-pane > .panel-head,
:root[data-theme="dark"] .product-shell .inspector-tabs,
:root[data-theme="dark"] .product-shell .review-panel,
:root[data-theme="dark"] .product-shell .overview-panel,
:root[data-theme="dark"] .product-shell .history-panel,
:root[data-theme="dark"] .product-shell .review-summary,
:root[data-theme="dark"] .product-shell .issue-filters { background: #102a55; color: #e7ebef; }
:root[data-theme="dark"] .product-shell .editor-pane .pane-head span,
:root[data-theme="dark"] .product-shell .inspector-tabs button { color: #c1d6f3; }
:root[data-theme="dark"] .product-shell .inspector-tabs button[aria-selected="true"] { color: #e6f0f8; background: #28578d; }
:root[data-theme="dark"] .product-shell .doc-preview { background: #183d70; }
:root[data-theme="dark"] .product-shell .compare-pane .diff-view {
  --surface: #fff; --surface-soft: #f4f6f8; --border: #dce2e8;
  --text: #263342; --muted: #5d6a78; --accent: #356fa6;
  background: #fff; color: #263342;
}
:root[data-theme="dark"] .product-shell.workspace-expanded .editor-toolbar { background: #102a55; border-color: #3c6094; }
:root[data-theme="dark"] .product-shell .settings-card { background: #183866; border-color: #3c6094; }
:root[data-theme="dark"] .product-shell .account-page .page-heading h1 { color: #edf0f4; }
:root[data-theme="dark"] .product-shell .account-page .page-heading p:not(.eyebrow),
:root[data-theme="dark"] .product-shell .account-page .eyebrow { color: #c4d8f1; }
:root[data-theme="dark"] .product-shell .account-section-icon { background: #235586; color: #c4def4; }
:root[data-theme="dark"] .product-shell #promptPreview { background: #193967; color: #e0e7ee; border-color: #5c7eac; }
:root[data-theme="dark"] .product-shell .prompt-note { background: #193b6c; color: #c2cfda; }

@media (max-width: 1100px) {
  .product-shell .document-card .card-open { grid-template-columns: 38px minmax(130px, 1fr) minmax(150px, 1fr) 52px 72px; column-gap: 8px; }
  .product-shell .document-card { grid-template-columns: minmax(0, 1fr) 122px; }
  .product-shell .card-footer { grid-template-columns: minmax(0,1fr) 25px 25px; padding-right: 6px; }
  .product-shell .card-footer span:nth-child(2) { display: none; }
}
@media (max-width: 900px) {
  .product-shell .document-card .card-open { grid-template-columns: 36px minmax(0, 1fr) 58px; row-gap: 4px; }
  .product-shell .document-card h2 { grid-column: 2; }
  .product-shell .card-preview { grid-column: 2; grid-row: 2; }
  .product-shell .card-format { grid-column: 3; }
  .product-shell .card-status { grid-column: 3; grid-row: 2; }
}
@media (max-width: 800px) {
  .product-shell .product-brand { display: none; }
  .product-shell .sidebar { inset: 0 auto 0 0; width: min(270px, 82vw); border-radius: 0 18px 18px 0; padding-top: 76px; }
  .product-brand { top: 18px; left: 18px; }
  .mobile-brand { display: inline-flex; align-items: center; gap: 7px; color: #fff; font: 20px Georgia, 'Times New Roman', serif; white-space: nowrap; }
  .product-shell .product-main { margin-left: 0; }
  .product-shell .product-topbar { height: 59px; padding: 0 13px; }
  .product-shell .breadcrumb-brand,
  .product-shell .breadcrumb-slash { display: none; }
  .product-shell .library-page,
  .product-shell .settings-page { margin: 8px 10px 12px; padding: 20px 16px; }
  .product-shell .workspace-page { padding: 0 8px 8px; }
  .product-shell .document-heading { padding: 8px 2px; }
  .product-shell .editor-stage { padding: 0; }
  .product-shell .editor-layout { gap: 0; }
  .product-shell .inspector { border-radius: 13px 0 0 13px; }
  .product-shell .account-page { padding: 13px 11px 20px; }
}
@media (max-width: 560px) {
  body.auth-page,
  body.admin-shell { background-attachment: scroll, scroll; }
  .product-shell .topbar-path { gap: 5px; min-width: 0; }
  .product-shell .mobile-brand { font-size: 17px; }
  .product-shell .mobile-brand img { width: 20px; height: 20px; }
  .product-shell #pageLabel { display: none; }
  .product-shell .save-status { max-width: 100px; font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .product-shell .page-heading h1 { font-size: 38px; }
  .product-shell .library-controls { gap: 7px; }
  .product-shell .search-field { flex-basis: 100%; order: 3; margin: 0; }
  .product-shell .search-field input[type="search"] { width: 100%; max-width: none; }
  .product-shell .document-card { grid-template-columns: minmax(0,1fr) 79px; }
  .product-shell .document-card .card-open { grid-template-columns: 31px minmax(0,1fr); min-height: 85px; padding: 10px 7px; column-gap: 7px; }
  .product-shell .file-symbol { width: 29px; height: 36px; }
  .product-shell .document-card h2 { grid-column: 2; grid-row: 1; font-size: 12px; }
  .product-shell .card-preview { grid-column: 2; grid-row: 2; font-size: 10px; -webkit-line-clamp: 2; }
  .product-shell .card-format { display: none; }
  .product-shell .card-status { grid-column: 2; grid-row: 3; font-size: 9px; }
  .product-shell .card-footer { grid-template-columns: 26px 26px; padding: 7px 3px; gap: 5px; }
  .product-shell .card-footer span { display: none; }
  .product-shell .card-footer button:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .product-shell .card-footer button:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .product-shell .document-title { font-size: 17px; }
  .product-shell .document-actions { margin-left: 0; }
  .product-shell .editor-tabs button { font-size: 11px; }
  .product-shell .editor-pane .pane-head { min-height: 39px; }
  /* Fit mode reflows the approximate preview at phone width for legible reading. */
  .product-shell.doc-zoom-fit .doc-preview .doc-page {
    zoom: 1 !important;
    width: 100% !important;
    min-height: 100% !important;
    padding: 30px 24px !important;
    font-size: 12pt;
  }
  .product-shell.doc-zoom-fit .doc-preview .doc-page-number {
    margin: 0 0 14px 12px;
  }
  .auth-page .auth-header { padding: 19px 20px; }
  .auth-page .auth-brand { font-size: 23px; }
  .auth-page .auth-layout { margin: 5px auto 25px; }
  .auth-page .auth-story { margin: 5px 4px 18px; }
  .auth-page .auth-story h1 { font-size: 29px; }
  .auth-page .auth-description { color: #40556c; }
  .auth-page .auth-panel { padding: 23px 20px; }
  .admin-shell .admin-main { padding: 24px 12px; }
  .admin-shell .admin-heading { flex-wrap: wrap; gap: 12px; }
  .admin-shell .admin-heading > div { min-width: 0; width: 100%; }
  .admin-shell .admin-heading .admin-outline { margin-left: auto; }
  .admin-shell .admin-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .product-shell *, .auth-page *, .admin-shell * { scroll-behavior: auto; transition-duration: .01ms; animation-duration: .01ms; }
}
