/*
 * EmlogStudio daylight mode
 * A single white-series system: paper-white surfaces, clear blue-green type,
 * quiet mint and sky accents.  Dark mode remains entirely outside this scope.
 */

html[data-theme="light"] {
  color-scheme: light;
  --day-canvas: #f4f9fc;
  --day-surface: #ffffff;
  --day-surface-soft: #f1f8fc;
  --day-surface-mint: #eaf7f6;
  --day-line: #d8e7ef;
  --day-line-strong: #bdd7e4;
  --day-ink: #173b50;
  --day-muted: #557589;
  --day-subtle: #627f91;
  --day-teal: #007d70;
  --day-teal-bright: #009c8b;
  --day-blue: #1478b8;
  --day-blue-soft: #e8f5fc;
  --day-gold: #af6a08;
  --day-danger: #ca5b58;
  --bg: var(--day-canvas);
  --panel: var(--day-surface);
  --panel-strong: var(--day-surface);
  --panel-soft: var(--day-surface-soft);
  --line: var(--day-line);
  --line-strong: var(--day-line-strong);
  --text: var(--day-ink);
  --muted: var(--day-muted);
  --subtle: var(--day-subtle);
  --green: var(--day-teal);
  --green-bright: var(--day-teal-bright);
  --green-dark: var(--day-surface-mint);
  --blue: var(--day-blue);
  --amber: var(--day-gold);
  --red: var(--day-danger);
  --accent-rgb: 0, 125, 112;
  --shadow: 0 14px 32px rgba(28, 98, 131, .10);
  --feedback-ink: var(--day-ink);
  --feedback-muted: var(--day-muted);
  --feedback-soft: #365d70;
  --feedback-panel: var(--day-surface);
  --feedback-line: rgba(18, 110, 157, .16);
  --feedback-glow: rgba(0, 125, 112, .15);
}

html[data-theme="light"],
html[data-theme="light"] body {
  background-color: var(--day-canvas);
}

html[data-theme="light"] body {
  color: var(--day-ink);
  background:
    radial-gradient(ellipse 42% 34% at 92% -5%, rgba(79, 184, 235, .18), transparent 72%),
    radial-gradient(ellipse 37% 31% at 0 100%, rgba(42, 190, 168, .12), transparent 75%),
    linear-gradient(140deg, #ffffff 0%, #f7fbfe 53%, #eff9fb 100%);
}

html[data-theme="light"] ::selection {
  color: #0b3145;
  background: rgba(53, 169, 211, .28);
}

html[data-theme="light"] .glass {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .88) 54%, rgba(239, 249, 253, .88)),
    var(--day-surface);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 14px 32px rgba(28, 98, 131, .09);
}

html[data-theme="light"] :is(.sidebar::after, .detail-panel::before) {
  opacity: .48;
}

/* Shell and navigation --------------------------------------------------------------- */
html[data-theme="light"] :is(.brand-name, .profile-name, .page-title p, .profile-role, .switcher-label, .workspace-switcher) {
  color: var(--day-muted);
}

html[data-theme="light"] :is(.switcher, .profile) {
  color: #315d72;
}

html[data-theme="light"] .switcher {
  background: rgba(241, 248, 252, .76);
  border-color: rgba(18, 110, 157, .12);
}

html[data-theme="light"] .nav-item {
  color: #3d7188;
}

html[data-theme="light"] :is(.nav-item:hover, .profile:hover, .switcher:hover) {
  color: #006f71;
  background: #eff8f6;
}

html[data-theme="light"] .nav-item.active {
  color: #075c67;
  background: #e6f5f1;
  border-color: rgba(0, 125, 112, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 8px 20px rgba(20, 120, 184, .10);
}

html[data-theme="light"] .nav-item.is-pjax-pending {
  color: #075c67;
  background: rgba(20, 120, 184, .10);
}

html[data-theme="light"] :is(.page-title h1, .detail-header h2, .detail-title-line h3, .content-heading h2, .content-heading h3, .article-title, .article-heading h1) {
  color: var(--day-ink);
}

html[data-theme="light"] :is(.search-box input, .login-field input, .form-field input, .form-field textarea, .comment-form-card input, .comment-form-card textarea, .dialog input, .dialog textarea) {
  color: var(--day-ink);
  background: rgba(255, 255, 255, .92);
  border-color: rgba(18, 110, 157, .17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] :is(.search-box input::placeholder, input::placeholder, textarea::placeholder) {
  color: #7797aa;
}

html[data-theme="light"] :is(.shortcut, .search-box .icon) {
  color: #46768d;
  background-color: rgba(20, 120, 184, .07);
}

html[data-theme="light"] :is(.icon-button, .mobile-menu, .round-button, .dialog-close) {
  color: #416f84;
  background: rgba(255, 255, 255, .86);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94), 0 5px 14px rgba(28, 98, 131, .07);
}

html[data-theme="light"] :is(.icon-button:hover, .icon-button:focus-visible, .mobile-menu:hover, .mobile-menu:focus-visible, .round-button:hover, .round-button:focus-visible, .dialog-close:hover, .dialog-close:focus-visible) {
  color: #006f71;
  background: #edfaff;
  border-color: rgba(0, 125, 112, .36);
  box-shadow: 0 0 0 3px rgba(20, 120, 184, .08), 0 8px 19px rgba(28, 98, 131, .10);
}

html[data-theme="light"] :is(.primary-button, .complete-button, .login-submit, .form-actions button[type="submit"]) {
  color: #ffffff;
  background: linear-gradient(135deg, #008a7a 0%, #167fba 100%);
  border-color: rgba(0, 105, 105, .35);
  box-shadow: 0 9px 20px rgba(20, 120, 184, .18), inset 0 1px 0 rgba(255, 255, 255, .28);
}

html[data-theme="light"] :is(.primary-button:hover, .complete-button:hover, .login-submit:hover, .form-actions button[type="submit"]:hover) {
  color: #ffffff;
  background: linear-gradient(135deg, #00a38e 0%, #2496d2 100%);
}

/* Shared content surfaces ------------------------------------------------------------- */
html[data-theme="light"] :is(.content-panel, .content-card, .post-table, .post-table-wrap, .category-group, .archive-card, .moments-card, .about-card, .friend-card, .site-footer, .comment-form-card, .comment-list, .profile-dashboard, .profile-dashboard-card, .profile-recent-card, .profile-page-card, .login-shell, .error-card) {
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96), 0 12px 26px rgba(28, 98, 131, .07);
}

html[data-theme="light"] :is(.post-table-row, .detail-header, .workspace-switcher, .site-footer, .article-meta, .comment-item, .profile-recent-card li, .profile-dashboard-nav) {
  border-color: rgba(18, 110, 157, .12);
}

html[data-theme="light"] :is(.post-table-row:hover, .comment-item:hover, .profile-recent-card li:hover) {
  background: linear-gradient(90deg, rgba(20, 120, 184, .045), rgba(0, 157, 139, .05));
}

html[data-theme="light"] :is(.post-table-head, .table-metric, .post-table-row time, .article-meta, .article-summary, .comment-meta, .site-footer, .site-footer-copy) {
  color: var(--day-muted);
}

html[data-theme="light"] :is(.post-title, .post-title a, .comment-author) {
  color: #173e54;
}

html[data-theme="light"] :is(.detail-button, .pagination a, .pagination span, .category-filter button, .timeline-switch, .profile-dashboard-nav button) {
  color: #4c7489;
  background: rgba(255, 255, 255, .80);
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.detail-button:hover, .pagination a:hover, .pagination .current, .category-filter button.active, .timeline-switch.active, .profile-dashboard-nav button.active) {
  color: #006f71;
  background: linear-gradient(125deg, rgba(20, 120, 184, .10), rgba(0, 157, 139, .10));
  border-color: rgba(0, 125, 112, .30);
}

html[data-theme="light"] .toast {
  color: #173e54;
  background: rgba(255, 255, 255, .98);
  border-color: rgba(0, 125, 112, .24);
  box-shadow: 0 16px 38px rgba(28, 98, 131, .17);
}

html[data-theme="light"] :is(.dialog, .dialog-surface, .comment-image-dialog, .announcement-detail-dialog, .announcement-link-dialog) {
  color: var(--day-ink);
  background:
    radial-gradient(circle at 90% 0, rgba(79, 184, 235, .14), transparent 32%),
    #ffffff;
  border-color: var(--day-line);
  box-shadow: 0 25px 66px rgba(18, 77, 108, .21);
}

html[data-theme="light"] :is(dialog::backdrop, .dialog-backdrop) {
  background: rgba(10, 47, 69, .32);
}

/* Home: bright statistics, pale category workspace, readable monitoring ---------------- */
html[data-theme="light"] body.emstudio-view-home .stats-style-fusion .stat-card {
  color: var(--day-ink);
  background:
    linear-gradient(130deg, rgba(255, 255, 255, .96), rgba(244, 251, 255, .90)),
    #ffffff;
  border-color: rgba(18, 110, 157, .17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 10px 24px rgba(28, 98, 131, .09);
}

html[data-theme="light"] body.emstudio-view-home .stats-style-fusion .stat-fusion-canvas {
  opacity: .72;
}

html[data-theme="light"] body.emstudio-view-home .stats-style-fusion .stat-fusion-field {
  opacity: .28;
}

html[data-theme="light"] body.emstudio-view-home .stats-style-fusion .stat-card::before {
  border-top-color: rgba(20, 120, 184, .18);
  box-shadow: 0 -4px 12px rgba(20, 120, 184, .05);
}

html[data-theme="light"] body.emstudio-view-home .stats-style-fusion .stat-card::after {
  background: radial-gradient(circle, rgba(255, 255, 255, .72), transparent 70%);
}

html[data-theme="light"] body.emstudio-view-home :is(.stat-label, .stat-number) {
  color: var(--day-ink);
}

html[data-theme="light"] body.emstudio-view-home :is(.stat-number small, .stat-trend) {
  color: var(--day-muted);
}

html[data-theme="light"] body.emstudio-view-home .stat-icon {
  color: #08766e;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(18, 110, 157, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 4px 12px rgba(28, 98, 131, .08);
}

html[data-theme="light"] body.emstudio-view-home .board-card {
  background:
    radial-gradient(ellipse 42% 62% at 90% 0, rgba(79, 184, 235, .10), transparent 72%),
    linear-gradient(145deg, #ffffff, #f5fbfe 62%, #edf9f8);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 12px 26px rgba(28, 98, 131, .08);
}

html[data-theme="light"] body.emstudio-view-home .board-card::before {
  background: radial-gradient(circle at 67% 55%, rgba(0, 157, 139, .10), transparent 37%);
}

html[data-theme="light"] body.emstudio-view-home .task-groups {
  background: transparent;
}

html[data-theme="light"] body.emstudio-view-home .task-group {
  background: rgba(255, 255, 255, .86);
  border-color: rgba(18, 110, 157, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96), 0 4px 10px rgba(28, 98, 131, .045);
}

html[data-theme="light"] body.emstudio-view-home .group-heading {
  color: #244c60;
}

html[data-theme="light"] body.emstudio-view-home .group-count {
  color: #52798b;
  background: #eaf5fa;
}

html[data-theme="light"] body.emstudio-view-home .group-heading .icon {
  color: #63869a;
}

html[data-theme="light"] body.emstudio-view-home .task-row {
  color: #557689;
}

html[data-theme="light"] body.emstudio-view-home .task-row:hover {
  color: #155468;
  background: rgba(20, 120, 184, .06);
}

html[data-theme="light"] body.emstudio-view-home .task-row.selected {
  color: #075f68;
  background: #e8f5f3;
  box-shadow: inset 2px 0 0 rgba(0, 125, 112, .58);
}

html[data-theme="light"] body.emstudio-view-home .task-due {
  color: #6d8a9b;
}

html[data-theme="light"] body.emstudio-view-home .document-stage::before {
  background: radial-gradient(ellipse, rgba(79, 184, 235, .16), rgba(0, 157, 139, .06) 34%, transparent 72%);
}

html[data-theme="light"] body.emstudio-view-home .category-deck-panel::after {
  border-color: rgba(20, 120, 184, .15);
  box-shadow: inset 0 0 22px rgba(0, 157, 139, .045);
}

html[data-theme="light"] .home-middle-region.deck-layout-normal .file-card,
html[data-theme="light"] .home-middle-region.deck-layout-orbit .file-card-front {
  color: #183f53;
  background:
    linear-gradient(108deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .16) 57%, transparent 78%),
    #eaf7fc;
  border-color: rgba(18, 110, 157, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94), 8px 12px 22px rgba(28, 98, 131, .19);
}

@supports (background: color-mix(in srgb, #000 25%, #fff)) {
  html[data-theme="light"] .home-middle-region.deck-layout-normal .file-card,
  html[data-theme="light"] .home-middle-region.deck-layout-orbit .file-card-front {
    background:
      linear-gradient(108deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .16) 57%, transparent 78%),
      color-mix(in srgb, var(--deck-card-color, #4a5550) 31%, #f7fcff);
  }
}

html[data-theme="light"] .home-middle-region.deck-layout-orbit .file-card-back {
  opacity: .92;
  background:
    linear-gradient(116deg, rgba(255, 255, 255, .65), transparent 58%),
    #e5f4fa;
  border-color: rgba(18, 110, 157, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94), 5px 9px 17px rgba(28, 98, 131, .14);
}

@supports (background: color-mix(in srgb, #000 25%, #fff)) {
  html[data-theme="light"] .home-middle-region.deck-layout-orbit .file-card-back {
    background:
      linear-gradient(116deg, rgba(255, 255, 255, .65), transparent 58%),
      color-mix(in srgb, var(--deck-card-color, #4a5550) 24%, #f7fcff);
  }
}

html[data-theme="light"] :is(.home-middle-region.deck-layout-normal .file-card::before, .home-middle-region.deck-layout-orbit .file-card-front::before) {
  opacity: .34;
  background:
    repeating-linear-gradient(0deg, rgba(14, 91, 119, .20) 0 5px, transparent 5px 12px),
    repeating-linear-gradient(90deg, rgba(14, 91, 119, .16) 0 5px, transparent 5px 12px);
  border-color: rgba(14, 91, 119, .16);
}

html[data-theme="light"] :is(.home-middle-region.deck-layout-normal .file-card::after, .home-middle-region.deck-layout-orbit .file-card-front::after) {
  background:
    linear-gradient(103deg, transparent 26%, rgba(255, 255, 255, .60) 45%, transparent 61%),
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 46%, rgba(16, 105, 139, .06));
}

html[data-theme="light"] :is(.home-middle-region .file-title, .home-middle-region .file-meta) {
  color: #173f53;
  text-shadow: none;
}

html[data-theme="light"] :is(.home-middle-region.deck-layout-normal .file-card:hover, .home-middle-region.deck-layout-normal .file-card:focus-visible, .home-middle-region.deck-layout-orbit .file-card:hover .file-card-front, .home-middle-region.deck-layout-orbit .file-card:focus-visible .file-card-front) {
  color: #103b50;
  background:
    linear-gradient(108deg, rgba(255, 255, 255, .82), rgba(224, 249, 245, .50) 58%, transparent 79%),
    #dff5f5;
  border-color: rgba(0, 125, 112, .48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .97), 9px 14px 22px rgba(28, 98, 131, .20);
}

@supports (background: color-mix(in srgb, #000 25%, #fff)) {
  html[data-theme="light"] :is(.home-middle-region.deck-layout-normal .file-card:hover, .home-middle-region.deck-layout-normal .file-card:focus-visible, .home-middle-region.deck-layout-orbit .file-card:hover .file-card-front, .home-middle-region.deck-layout-orbit .file-card:focus-visible .file-card-front) {
    background:
      linear-gradient(108deg, rgba(255, 255, 255, .82), rgba(224, 249, 245, .50) 58%, transparent 79%),
      color-mix(in srgb, var(--deck-card-hover, #08743d) 28%, #f4fcff);
  }
}

html[data-theme="light"] :is(.home-middle-region.deck-layout-orbit .file-card:hover .file-title, .home-middle-region.deck-layout-orbit .file-card:focus-visible .file-title) {
  color: #103b50;
}

html[data-theme="light"] .progress-document {
  color: #173f53;
  background:
    linear-gradient(108deg, rgba(255, 255, 255, .90), rgba(232, 247, 253, .84) 58%, rgba(227, 249, 245, .78)),
    #ffffff;
  border-color: rgba(18, 110, 157, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 12px 18px 28px rgba(28, 98, 131, .18);
}

html[data-theme="light"] :is(.progress-top, .progress-close, .progress-value) {
  color: #173f53;
}

html[data-theme="light"] :is(.progress-period, .progress-value small) {
  color: var(--day-muted);
}

html[data-theme="light"] :is(.progress-close:hover, .progress-close:focus-visible) {
  background: rgba(20, 120, 184, .08);
  border-color: rgba(18, 110, 157, .16);
}

html[data-theme="light"] .deck-settings-trigger {
  color: #416f84;
  background: rgba(255, 255, 255, .94);
  border-color: rgba(18, 110, 157, .17);
  box-shadow: 0 6px 15px rgba(28, 98, 131, .12);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor {
  color: var(--day-ink);
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(241, 249, 253, .90));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 10px 22px rgba(28, 98, 131, .07);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-header h2 {
  color: var(--day-ink);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-live {
  color: var(--day-muted);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-item {
  color: var(--day-muted);
  background: rgba(255, 255, 255, .76);
  border-color: rgba(18, 110, 157, .13);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-item > .icon {
  color: #008b80;
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-item > span {
  color: var(--day-muted);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-item strong {
  color: var(--day-ink);
}

html[data-theme="light"] body.emstudio-view-home :is(.footer-monitor-item strong small, .footer-monitor-item strong em, .footer-monitor-item p) {
  color: var(--day-subtle);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-link:hover {
  color: #075e68;
  background: linear-gradient(135deg, rgba(20, 120, 184, .08), rgba(0, 157, 139, .07));
  border-color: rgba(0, 125, 112, .24);
}

html[data-theme="light"] body.emstudio-view-home .footer-monitor-link .footer-monitor-arrow {
  color: #53778a;
}

/* The monitor has a compact, late-defined dark theme.  Keep each text tier
   explicit here so its values remain readable after a PJAX swap as well. */
html[data-theme="light"] body.emstudio-view-home .workspace-footer-stack .footer-monitor .footer-monitor-item {
  color: #4b6f82;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(240, 249, 253, .90));
  border-color: rgba(18, 110, 157, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] body.emstudio-view-home .workspace-footer-stack .footer-monitor .footer-monitor-item > span {
  color: #4e7184;
}

html[data-theme="light"] body.emstudio-view-home .workspace-footer-stack .footer-monitor .footer-monitor-item strong,
html[data-theme="light"] body.emstudio-view-home .workspace-footer-stack .footer-monitor .footer-monitor-item strong output {
  color: #173b50;
}

html[data-theme="light"] body.emstudio-view-home .workspace-footer-stack .footer-monitor .footer-monitor-item :is(strong small, strong em, p) {
  color: #58798b;
}

html[data-theme="light"] body.emstudio-view-home .workspace-footer-stack .footer-monitor .footer-monitor-link .footer-monitor-arrow {
  color: #315f76;
}

/* Home detail rail --------------------------------------------------------------------- */
html[data-theme="light"] .detail-panel {
  color: var(--day-ink);
}

html[data-theme="light"] .detail-header h2 .icon {
  color: #007d70;
}

html[data-theme="light"] :is(.detail-id, .detail-row dt) {
  color: var(--day-muted);
}

html[data-theme="light"] :is(.detail-description, .detail-row dd, .detail-row .icon) {
  color: #365f74;
}

html[data-theme="light"] .high-badge {
  color: #007d70;
  background: #e8f8f3;
  border-color: rgba(0, 125, 112, .20);
}

html[data-theme="light"] .mini-avatar {
  color: #ffffff;
  background: #386b7c;
}

html[data-theme="light"] .mini-avatar::after {
  border-color: #ffffff;
}

html[data-theme="light"] .tag {
  color: #436f83;
  background: #f2f9fc;
  border-color: rgba(18, 110, 157, .13);
}

html[data-theme="light"] .ai-card,
html[data-theme="light"] .recommendation-card {
  color: #264d61;
  background:
    radial-gradient(circle at 92% 0, rgba(79, 184, 235, .12), transparent 37%),
    linear-gradient(145deg, #ffffff, #eef9fc);
  border-color: rgba(18, 110, 157, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 8px 18px rgba(28, 98, 131, .07);
}

html[data-theme="light"] :is(.ai-card h4, .recommendation-header h4) {
  color: #1b465c;
}

html[data-theme="light"] .ai-card ul {
  color: var(--day-muted);
}

html[data-theme="light"] .suggestion-button {
  color: #047069;
  background: #eaf8f5;
  border-color: rgba(0, 125, 112, .20);
}

html[data-theme="light"] :is(.suggestion-button:hover, .suggestion-button:focus-visible) {
  color: #00635f;
  background: #def5ef;
  border-color: rgba(0, 125, 112, .34);
}

html[data-theme="light"] .recommendation-header > span {
  color: var(--day-muted);
}

html[data-theme="light"] .recommendation-list li {
  color: #264d61;
  background: color-mix(in srgb, var(--recommend-color, var(--day-teal)) 9%, #ffffff);
  border-color: color-mix(in srgb, var(--recommend-color, var(--day-teal)) 20%, #d8e7ef);
}

html[data-theme="light"] .recommendation-list a {
  color: #315d72;
}

html[data-theme="light"] .recommendation-list li:hover {
  background: color-mix(in srgb, var(--recommend-color, var(--day-teal)) 15%, #ffffff);
  border-color: color-mix(in srgb, var(--recommend-color, var(--day-teal)) 35%, #c0dce8);
}

html[data-theme="light"] .recommendation-list li:hover a {
  color: #075f68;
}

/* Article reading surfaces -------------------------------------------------------------- */
html[data-theme="light"] .article-reader {
  --article-text: #24495e;
  --article-muted: #5c7c90;
  --article-surface: #ffffff;
  --article-surface-raised: #f1f8fc;
  --article-border: #d8e7ef;
  --article-accent-soft: rgba(20, 120, 184, .09);
  --article-accent-line: rgba(0, 125, 112, .28);
}

html[data-theme="light"] .article-reader .article-hero {
  min-height: 176px;
  gap: clamp(18px, 2.3vw, 28px);
  padding: clamp(21px, 2.6vw, 30px);
  background:
    radial-gradient(circle at 90% 0, rgba(79, 184, 235, .14), transparent 35%),
    linear-gradient(145deg, #ffffff, #f1f9fc);
  border-color: var(--day-line);
}

html[data-theme="light"] .article-reader .article-heading h1 {
  color: #173c52;
  font-size: clamp(27px, 2.45vw, 36px);
}

html[data-theme="light"] .article-reader .article-heading > p {
  color: var(--day-muted);
}

html[data-theme="light"] .article-reader .article-cover {
  height: clamp(128px, 13vw, 162px);
  border-color: rgba(18, 110, 157, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92), 0 10px 22px rgba(28, 98, 131, .14);
}

html[data-theme="light"] .article-reader .article-main {
  padding: clamp(24px, 2.7vw, 38px);
  background: #ffffff;
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 12px 26px rgba(28, 98, 131, .07);
}

html[data-theme="light"] .article-breadcrumb,
html[data-theme="light"] .article-reader .article-toc,
html[data-theme="light"] .article-reader .article-comments {
  color: var(--day-muted);
  background: rgba(255, 255, 255, .92);
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.article-breadcrumb a, .article-reader .article-toc a) {
  color: #3c6d84;
}

html[data-theme="light"] .article-breadcrumb [aria-current="page"] {
  color: #244d62;
}

html[data-theme="light"] .article-reader .article-meta :is(> span, > a, .article-author) {
  color: #4f7488;
}

html[data-theme="light"] .article-toolbelt {
  color: var(--day-muted);
  background: linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(241, 249, 252, .84));
  border: 1px solid var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 7px 17px rgba(28, 98, 131, .05);
}

html[data-theme="light"] :is(.article-reading-signals, .article-tool-action) {
  color: #4e7488;
}

html[data-theme="light"] .article-reading-signals > span {
  color: #496f83;
  background: #f6fbfd;
  border-color: rgba(18, 110, 157, .13);
}

html[data-theme="light"] .article-tool-action b {
  color: #5f8194;
}

html[data-theme="light"] :is(.article-tool-action:hover, .article-tool-action:focus-visible) {
  color: #006f71;
  background: rgba(0, 157, 139, .09);
}

html[data-theme="light"] :is(.article-tool-action.is-active, .article-tool-action[aria-pressed="true"]) {
  color: #00877a;
}

html[data-theme="light"] :is(.article-tool-action.is-active b, .article-tool-action[aria-pressed="true"] b) {
  color: #007d70;
}

html[data-theme="light"] .article-document-bar {
  color: #5d7d90;
  background: #f4fafd;
  border-color: var(--day-line);
}

html[data-theme="light"] .article-reader .article-content {
  color: var(--article-text);
  font-size: clamp(16px, 1.04vw, 18px);
  line-height: 1.84;
}

html[data-theme="light"] .article-reader .article-content :where(h1, h2, h3, h4, h5, h6, strong, th) {
  color: #173c52;
}

html[data-theme="light"] .article-reader .article-content :where(h1, h2, h3, h4, h5, h6) {
  margin-top: 1.42em;
}

html[data-theme="light"] .article-reader .article-content h2 {
  color: #173c52;
  font-size: clamp(24px, 2vw, 30px);
}

html[data-theme="light"] .article-reader .article-content :where(a) {
  color: #087b99;
  text-decoration-color: rgba(8, 123, 153, .30);
}

html[data-theme="light"] .article-reader .article-content blockquote {
  color: #3f6d80;
  background: linear-gradient(125deg, #eefaff, #edf9f6);
  border-color: #57b3ae;
}

html[data-theme="light"] .article-reader .article-content :where(table, th, td) {
  border-color: var(--day-line);
}

html[data-theme="light"] .article-reader .article-content th {
  background: #eef8fc;
}

html[data-theme="light"] .article-reader .article-content :where(code, kbd, samp) {
  color: #136b68;
  background: #eff8f6;
  border-color: rgba(0, 125, 112, .17);
}

html[data-theme="light"] .article-reader .article-toc h2 {
  color: #1b465c;
}

html[data-theme="light"] .article-toc > header button {
  color: #436f83;
  background: #f3faff;
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.article-toc > header button:hover, .article-toc > header button:focus-visible) {
  color: #006f71;
  background: #e9f8f5;
  border-color: rgba(0, 125, 112, .25);
}

html[data-theme="light"] .article-reader .article-toc nav a {
  color: #4b7185;
}

html[data-theme="light"] .article-reader .article-toc nav a::before {
  background: #6f96a8;
}

html[data-theme="light"] :is(.article-reader .article-toc nav a:hover, .article-reader .article-toc nav a:focus-visible, .article-reader .article-toc nav a.is-active) {
  color: #00736d;
  background: rgba(0, 157, 139, .10);
}

html[data-theme="light"] .article-toc-progress {
  background: #e5f0f5;
}

html[data-theme="light"] :is(.article-neighbor-card, .article-recommended-card) {
  color: #183f53;
  background: linear-gradient(145deg, #ffffff, #edf8fc);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 8px 18px rgba(28, 98, 131, .07);
}

html[data-theme="light"] :is(.article-neighbor-card strong, .article-recommended-head h2, .article-recommended-body strong) {
  color: #183f53;
}

html[data-theme="light"] :is(.article-neighbor-direction, .article-recommended-body span) {
  color: #007d70;
}

/* Archive, tools and standalone views --------------------------------------------------- */
html[data-theme="light"] .emstudio-archive {
  --archive-surface: #ffffff;
  --archive-surface-raised: #f1f8fc;
  --archive-line: #d8e7ef;
  --archive-muted: #5d7e90;
}

html[data-theme="light"] .emstudio-archive-hero {
  background:
    radial-gradient(circle at 88% 5%, rgba(20, 120, 184, .16), transparent 33%),
    linear-gradient(112deg, #ffffff, #f1f9fc 58%, #e9faf6);
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.emstudio-archive-hero h2, .emstudio-archive-hero p, .emstudio-archive-card h3, .emstudio-archive-card a) {
  color: #183f53;
}

html[data-theme="light"] .emstudio-traffic-shell {
  --traffic-bg: #ffffff;
  --traffic-panel: #ffffff;
  --traffic-panel-2: #f1f8fc;
  --traffic-line: #d8e7ef;
  --traffic-text: #173b50;
  --traffic-muted: #5d7e90;
  --traffic-accent: #007d70;
  --traffic-blue: #1478b8;
  --traffic-amber: #b56b00;
  --traffic-red: #ca5b58;
}

html[data-theme="light"] .emstudio-traffic-shell :is(.emstudio-traffic-console, .emstudio-traffic-lock) {
  background:
    radial-gradient(circle at 85% 0, rgba(79, 184, 235, .14), transparent 35%),
    #ffffff;
}

html[data-theme="light"] .emstudio-traffic-shell :is(.emstudio-traffic-lock-copy h2, .emstudio-traffic-hero h2, .emstudio-traffic-metrics strong, .emstudio-traffic-behavior strong, .emstudio-traffic-card h3) {
  color: #173b50;
}

html[data-theme="light"] .emstudio-traffic-shell :is(input, .emstudio-traffic-live, .emstudio-traffic-tabs) {
  color: #4e7488;
  background: #f5fbfd;
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-ai-shell {
  --ai-bg: #ffffff;
  --ai-panel: #ffffff;
  --ai-panel-2: #f1f8fc;
  --ai-line: #d8e7ef;
  --ai-text: #173b50;
  --ai-muted: #5d7e90;
  --ai-human: #007d70;
  --ai-search: #1478b8;
  --ai-training: #b56b00;
  --ai-verify: #009c8b;
}

html[data-theme="light"] :is(.emstudio-ai-console, .emstudio-ai-clock, .emstudio-ai-toolbar) {
  background:
    radial-gradient(circle at 86% 2%, rgba(79, 184, 235, .14), transparent 35%),
    #ffffff;
}

html[data-theme="light"] .emstudio-ai-shell :is(.emstudio-ai-heading h2, .emstudio-ai-section-head h3, .emstudio-ai-metrics h3, .emstudio-ai-explain p strong) {
  color: #173b50;
}

html[data-theme="light"] .emstudio-gallery-toolbar {
  color: #5d7e90;
  background: rgba(255, 255, 255, .92);
}

html[data-theme="light"] .emstudio-gallery-toolbar b {
  color: #214b60;
}

html[data-theme="light"] .tag-orbit-shell {
  color: #1c4256;
  background:
    radial-gradient(circle at 50% 48%, rgba(20, 120, 184, .12), transparent 31%),
    radial-gradient(circle at 72% 28%, rgba(0, 157, 139, .09), transparent 31%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(234, 247, 255, .84));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96), 0 12px 28px rgba(28, 98, 131, .09);
}

html[data-theme="light"] .tag-orbit-shell :is(h2, h3, strong) {
  color: #173d51;
}

/* Feedback, profile and auxiliary pages ------------------------------------------------ */
html[data-theme="light"] .feedback-float-nav {
  background: linear-gradient(150deg, rgba(255, 255, 255, .96), rgba(234, 247, 255, .86));
  border-color: var(--day-line);
  box-shadow: 0 15px 36px rgba(28, 98, 131, .14), inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] .feedback-float-nav::before {
  opacity: .62;
}

html[data-theme="light"] .feedback-float-button {
  color: #416f83;
  background: rgba(255, 255, 255, .92);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 4px 12px rgba(28, 98, 131, .08);
}

html[data-theme="light"] :is(.feedback-float-button:hover, .feedback-float-button:focus-visible, .feedback-float-button[aria-expanded="true"]) {
  color: #007d70;
  background: #edfaff;
  border-color: rgba(0, 125, 112, .40);
  box-shadow: 0 8px 20px rgba(28, 98, 131, .12), 0 0 0 3px rgba(20, 120, 184, .08);
}

html[data-theme="light"] .feedback-float-button::after {
  color: #244d60;
  background: rgba(255, 255, 255, .98);
  border-color: var(--day-line);
  box-shadow: 0 8px 20px rgba(28, 98, 131, .13);
}

html[data-theme="light"] .feedback-float-button-primary {
  color: #ffffff;
  background: linear-gradient(145deg, #009b87, #1478b8);
  border-color: rgba(0, 105, 105, .36);
}

html[data-theme="light"] :is(.feedback-qr-popover, .feedback-dialog, .feedback-dialog-surface, .feedback-select-menu) {
  color: var(--day-ink);
  background:
    radial-gradient(circle at 90% 0, rgba(79, 184, 235, .14), transparent 34%),
    #ffffff;
  border-color: var(--day-line);
  box-shadow: 0 20px 45px rgba(28, 98, 131, .17), inset 0 1px 0 rgba(255, 255, 255, .96);
}

html[data-theme="light"] :is(.feedback-select-trigger, .feedback-field input, .feedback-field textarea, .feedback-admin-reply-form textarea) {
  color: #173d50;
  background: rgba(255, 255, 255, .94);
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.feedback-select-menu button:hover, .feedback-select-menu button[aria-selected="true"], .feedback-entry:hover) {
  color: #006f71;
  background: linear-gradient(110deg, rgba(20, 120, 184, .09), rgba(0, 157, 139, .09));
}

html[data-theme="light"] .feedback-dialog::backdrop {
  background: rgba(10, 47, 69, .34);
}

html[data-theme="light"] .feedback-mail-badge {
  color: #603b00;
  border-color: #ffffff;
}

html[data-theme="light"] .emstudio-view-profile :is(.profile-dashboard, .profile-dashboard-card, .profile-recent-card, .profile-dashboard-content, .announcement-popover, .announcement-detail-panel, .announcement-item, .announcement-composer) {
  color: #214a5d;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(234, 247, 255, .78)),
    #ffffff;
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96), 0 10px 24px rgba(28, 98, 131, .08);
}

html[data-theme="light"] .emstudio-view-profile :is(.profile-dashboard h1, .profile-dashboard h2, .profile-dashboard h3, .profile-dashboard h4, .announcement-popover h2, .announcement-item h3, .announcement-detail-panel h2) {
  color: #173d51;
}

html[data-theme="light"] .emstudio-view-profile :is(.profile-dashboard p, .profile-dashboard small, .announcement-item p, .announcement-detail-content, .announcement-popover-empty) {
  color: #5f8092;
}

/* Personal centre: the dashboard has its own dark-mode component tokens and
   literal text colours.  Define its complete daylight contrast ladder instead
   of relying on inherited panel text colour. */
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard {
  --profile-surface: #ffffff;
  --profile-surface-soft: #f1f8fc;
  --profile-line: #d8e7ef;
  --profile-muted: #557589;
  --profile-subtle: #627f91;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-hero {
  color: #173b50;
  background:
    radial-gradient(ellipse 44% 125% at 90% 105%, rgba(0, 157, 139, .13), transparent 68%),
    radial-gradient(ellipse 42% 86% at 64% 6%, rgba(79, 184, 235, .12), transparent 66%),
    linear-gradient(132deg, #ffffff 0%, #f7fcff 54%, #edf9f8 100%);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 14px 30px rgba(28, 98, 131, .09);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-avatar {
  background: linear-gradient(145deg, #edf9f8, #d9eff7);
  border-color: rgba(18, 110, 157, .20);
  box-shadow: 0 12px 22px rgba(28, 98, 131, .15), inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-avatar > span {
  border-color: #ffffff;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-identity h2 {
  color: #173b50;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard :is(.profile-user-handle, .profile-user-bio) {
  color: #557589;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-role-badge {
  color: #087a70;
  background: rgba(0, 157, 139, .09);
  border-color: rgba(0, 125, 112, .20);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-role-badge .icon {
  color: #009685;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-hero-stats {
  border-left-color: rgba(18, 110, 157, .15);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-hero-stats > div + div {
  border-left-color: rgba(18, 110, 157, .11);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-hero-stats strong {
  color: #173b50;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-hero-stats span {
  color: #567789;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-edit-button {
  color: #08766e;
  background: rgba(255, 255, 255, .82);
  border-color: rgba(0, 125, 112, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 7px 16px rgba(28, 98, 131, .08);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-edit-button .icon {
  color: #008f80;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-edit-button:hover,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-edit-button:focus-visible {
  color: #006a64;
  background: #edf9f7;
  border-color: rgba(0, 125, 112, .38);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav {
  background: linear-gradient(155deg, rgba(255, 255, 255, .99), rgba(235, 247, 253, .88));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 12px 24px rgba(28, 98, 131, .08);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-nav-caption {
  color: #628195;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button {
  color: #3f6c81;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button > .icon:first-child,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav .profile-nav-arrow {
  color: #66879a;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button:hover,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button:focus-visible {
  color: #075f68;
  background: rgba(20, 120, 184, .06);
  border-color: rgba(18, 110, 157, .13);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button.active {
  color: #075f68;
  background: linear-gradient(100deg, rgba(20, 120, 184, .13), rgba(0, 157, 139, .08));
  border-color: rgba(0, 125, 112, .25);
  box-shadow: inset 3px 0 0 #009b87;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button.active > .icon:first-child,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav button.active .profile-nav-arrow {
  color: #008d80;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-nav .logout-item {
  color: #b85f5c;
  border-top-color: rgba(184, 95, 92, .15);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid > article {
  background: linear-gradient(138deg, rgba(255, 255, 255, .98), rgba(236, 248, 253, .88));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 9px 20px rgba(28, 98, 131, .07);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid > article:hover {
  background: linear-gradient(138deg, #ffffff, #eaf8f7);
  border-color: rgba(0, 125, 112, .26);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid span:not(.profile-stat-icon) {
  color: #557589;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid strong {
  color: #173b50;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid b {
  color: #087e73;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid > article:nth-child(2) b {
  color: #1478b8;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-stat-grid > article:nth-child(3) b {
  color: #a46a13;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card {
  background: linear-gradient(142deg, rgba(255, 255, 255, .98), rgba(237, 248, 253, .88));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 11px 24px rgba(28, 98, 131, .08);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-section-kicker {
  color: #608094;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card h3,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-dashboard-content .panel-heading h3 {
  color: #173b50;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card :is(header > a, li b, .profile-activity-meta time, li p a) {
  color: #456f83;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card li {
  border-top-color: rgba(18, 110, 157, .12);
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card li > i {
  border-color: #ffffff;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card li p a {
  color: #214c61;
}

html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card li p a:hover,
html[data-theme="light"] body.emstudio-view-profile .profile-dashboard .profile-recent-card li p a:focus-visible {
  color: #007d70;
}

html[data-theme="light"] .emstudio-view-profile :is(.announcement-editor, .announcement-editor-toolbar, .announcement-editor-surface, .announcement-editor-upload-card) {
  color: #214a5d;
  background: #f8fcff;
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.emstudio-friend-entry, .emstudio-friend-apply-page .glass) {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(234, 247, 255, .78)),
    #ffffff;
}

/* Daylight completion: spacing rhythm and independent views --------------------------- */
/* Category groups use one explicit gap instead of a margin stack, so the pale canvas
   does not exaggerate uneven seams between each group. */
html[data-theme="light"] body.emstudio-view-home .task-groups {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 0 8px 8px;
}

html[data-theme="light"] body.emstudio-view-home .task-group,
html[data-theme="light"] body.emstudio-view-home .task-group:last-child {
  margin-bottom: 0;
  border-radius: 14px;
}

html[data-theme="light"] body.emstudio-view-home .group-heading {
  min-height: 40px;
  padding-inline: 13px;
}

html[data-theme="light"] body.emstudio-view-home .task-list {
  gap: 3px;
  padding: 0 7px 7px;
}

html[data-theme="light"] body.emstudio-view-home .task-row {
  min-height: 34px;
  border-radius: 9px;
}

/* The four-colour preset drawer is also an independent surface. */
html[data-theme="light"] .deck-fusion-preset-heading {
  color: #173b50;
}

html[data-theme="light"] .deck-fusion-preset-heading small {
  color: #5b7b8e;
}

html[data-theme="light"] .deck-fusion-preset {
  color: #365f73;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(240, 249, 253, .90));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] .deck-fusion-preset:hover,
html[data-theme="light"] .deck-fusion-preset.is-selected {
  background: linear-gradient(135deg, rgba(231, 247, 252, .98), rgba(233, 249, 246, .94));
  border-color: rgba(0, 125, 112, .34);
}

html[data-theme="light"] .deck-fusion-preset-art {
  background: #edf8fc;
  border-color: rgba(18, 110, 157, .18);
}

html[data-theme="light"] .deck-fusion-preset-copy b {
  color: #214b60;
}

html[data-theme="light"] .deck-fusion-preset-copy small {
  color: #5d7e90;
}

/* Archive ----------------------------------------------------------------------------- */
html[data-theme="light"] .emstudio-archive {
  --archive-surface: #ffffff;
  --archive-surface-raised: #f1f8fc;
  --archive-line: #d8e7ef;
  --archive-muted: #58798c;
  --archive-accent: #007d70;
  --archive-accent-rgb: 0, 125, 112;
}

html[data-theme="light"] .emstudio-archive-hero {
  background:
    radial-gradient(circle at 90% 8%, rgba(79, 184, 235, .20), transparent 37%),
    linear-gradient(118deg, #ffffff 0%, #f4fbfe 56%, #eaf8f5 100%);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 14px 28px rgba(28, 98, 131, .08);
}

html[data-theme="light"] .emstudio-archive-planet {
  border-color: rgba(0, 125, 112, .30);
  background:
    radial-gradient(ellipse at 31% 96%, rgba(0, 157, 139, .18), transparent 30%),
    radial-gradient(ellipse at 48% 84%, rgba(79, 184, 235, .18), transparent 47%),
    linear-gradient(165deg, rgba(250, 254, 255, .94), rgba(218, 239, 246, .94) 67%);
  box-shadow: inset 0 -20px 42px rgba(0, 125, 112, .08), 0 4px 18px rgba(28, 98, 131, .10);
}

html[data-theme="light"] .emstudio-archive-planet i {
  border-top-color: rgba(18, 110, 157, .27);
}

html[data-theme="light"] :is(.emstudio-archive-hero h2, .emstudio-archive-total strong, .emstudio-archive-month-card, .emstudio-archive-month-copy strong, .emstudio-archive-empty h3) {
  color: #173b50;
}

html[data-theme="light"] :is(.emstudio-archive-total > span, .emstudio-archive-total small, .emstudio-archive-years a, .emstudio-archive-years a span, .emstudio-archive-index-note strong, .emstudio-archive-index-note small, .emstudio-archive-month-stamp span, .emstudio-archive-month-copy small, .emstudio-archive-month-count, .emstudio-archive-arrow) {
  color: #5b7c8e;
}

html[data-theme="light"] .emstudio-archive-years {
  background: linear-gradient(155deg, #ffffff, #eef8fc);
  border-color: var(--day-line);
  box-shadow: 0 12px 24px rgba(28, 98, 131, .08), inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] .emstudio-archive-years a:hover,
html[data-theme="light"] .emstudio-archive-years a:focus-visible,
html[data-theme="light"] .emstudio-archive-years a.is-current {
  color: #007d70;
  background: rgba(0, 157, 139, .08);
}

html[data-theme="light"] .emstudio-archive-node::before,
html[data-theme="light"] .emstudio-archive-node::after {
  background: rgba(18, 110, 157, .18);
}

html[data-theme="light"] .emstudio-archive-node i,
html[data-theme="light"] .emstudio-archive-month-card::before {
  background: #f5fbfd;
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.emstudio-archive-node i::before, .emstudio-archive-node i::after) {
  border-color: #5d8293;
  background-color: #5d8293;
}

html[data-theme="light"] .emstudio-archive-month-card {
  background: linear-gradient(115deg, #ffffff, #eef8fc);
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 6px 14px rgba(28, 98, 131, .045);
}

html[data-theme="light"] .emstudio-archive-month-card:hover {
  background: linear-gradient(115deg, #ffffff, #e9f8f6);
  border-color: rgba(0, 125, 112, .34);
}

html[data-theme="light"] .emstudio-archive-empty {
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(239, 249, 253, .90));
  border-color: rgba(0, 125, 112, .22);
}

/* Friend links and friend-link application -------------------------------------------- */
html[data-theme="light"] :is(.emstudio-friend-entry__copy > span, .emstudio-friend-entry__copy p, .emstudio-friend-apply__hero p, .emstudio-friend-apply__steps small, .emstudio-friend-apply__terminal small, .emstudio-friend-apply__fields label, .emstudio-friend-apply__fields label > span small, .emstudio-friend-apply__footer > span, .emstudio-friend-apply__unavailable p) {
  color: #58798c;
}

html[data-theme="light"] :is(.emstudio-friend-entry__copy h3, .emstudio-friend-apply__hero h1, .emstudio-friend-apply__steps strong, .emstudio-friend-apply__terminal strong, .emstudio-friend-apply__unavailable strong) {
  color: #173b50;
}

html[data-theme="light"] :is(.emstudio-friend-entry__action, .emstudio-friend-apply__back) {
  color: #08766e;
  background: rgba(255, 255, 255, .84);
  border-color: rgba(0, 125, 112, .23);
}

html[data-theme="light"] :is(.emstudio-friend-entry__action:hover, .emstudio-friend-entry__action:focus-visible, .emstudio-friend-apply__back:hover, .emstudio-friend-apply__back:focus-visible) {
  color: #006b65;
  background: #eaf8f6;
  border-color: rgba(0, 125, 112, .40);
}

html[data-theme="light"] .emstudio-friend-apply__steps {
  background: var(--day-line);
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-friend-apply__steps li {
  background: linear-gradient(145deg, #ffffff, #f0f9fc);
}

html[data-theme="light"] :is(.emstudio-friend-apply__form, .emstudio-friend-apply__unavailable) {
  background: linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(238, 248, 253, .88));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 10px 22px rgba(28, 98, 131, .07);
}

html[data-theme="light"] :is(.emstudio-friend-apply__terminal, .emstudio-friend-apply__footer) {
  background: rgba(239, 248, 252, .72);
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-friend-apply__fields input,
html[data-theme="light"] .emstudio-friend-apply__fields textarea {
  color: #173b50;
  background: #ffffff;
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.emstudio-friend-apply__fields input::placeholder, .emstudio-friend-apply__fields textarea::placeholder) {
  color: #7b99a9;
}

html[data-theme="light"] .emstudio-friend-apply__submit {
  color: #ffffff;
  background: linear-gradient(135deg, #008a7a, #167fba);
  border-color: rgba(0, 105, 105, .35);
}

html[data-theme="light"] .emstudio-friend-entry__missing {
  color: #9a6415;
  background: rgba(229, 166, 76, .10);
  border-color: rgba(175, 106, 8, .22);
}

html[data-theme="light"] .emstudio-friend-apply__terminal em,
html[data-theme="light"] .emstudio-friend-apply__form.is-success .emstudio-friend-apply__footer > span {
  color: #087e73;
}

html[data-theme="light"] .emstudio-friend-apply__form.has-error .emstudio-friend-apply__footer > span {
  color: #b65450;
}

/* Traffic report ----------------------------------------------------------------------- */
html[data-theme="light"] .emstudio-traffic-shell {
  --traffic-bg: #ffffff;
  --traffic-panel: #ffffff;
  --traffic-panel-2: #f1f8fc;
  --traffic-line: #d8e7ef;
  --traffic-text: #173b50;
  --traffic-muted: #58798c;
  --traffic-accent: #007d70;
  --traffic-blue: #1478b8;
  --traffic-amber: #af6a08;
  --traffic-red: #ca5b58;
}

html[data-theme="light"] :is(.emstudio-traffic-lock, .emstudio-traffic-console) {
  background:
    radial-gradient(circle at 85% 0, rgba(79, 184, 235, .14), transparent 35%),
    #ffffff;
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 14px 28px rgba(28, 98, 131, .08);
}

html[data-theme="light"] :is(.emstudio-traffic-lock-copy h2, .emstudio-traffic-hero h2, .emstudio-traffic-metrics strong, .emstudio-traffic-behavior strong, .emstudio-traffic-card h3, .emstudio-traffic-donut-chart::after, .emstudio-traffic-total-strip strong, .emstudio-traffic-compare strong, .emstudio-traffic-rank-item strong) {
  color: #173b50;
}

html[data-theme="light"] :is(.emstudio-traffic-lock label, .emstudio-traffic-metrics span, .emstudio-traffic-stream time, .emstudio-traffic-stream small, .emstudio-traffic-rank-item span, .emstudio-traffic-table-wrap th, .emstudio-traffic-table-wrap td) {
  color: #58798c;
}

html[data-theme="light"] :is(.emstudio-traffic-lock input, .emstudio-traffic-live, .emstudio-traffic-tabs, .emstudio-traffic-filters input, .emstudio-traffic-filters select, .emstudio-traffic-filters button, .emstudio-traffic-pagination button) {
  color: #3e6b80;
  background: #f4fafc;
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-traffic-tabs button:hover {
  color: #006f71;
  background: rgba(0, 157, 139, .08);
}

html[data-theme="light"] .emstudio-traffic-donut-chart::after {
  background: #ffffff;
}

html[data-theme="light"] .emstudio-traffic-stream strong {
  color: #244f63;
}

html[data-theme="light"] .emstudio-traffic-rank-item i {
  background: #e7f1f5;
}

html[data-theme="light"] .emstudio-traffic-pagination button.is-active,
html[data-theme="light"] .emstudio-traffic-filters button[type="submit"] {
  color: #ffffff;
  background: #007d70;
}

/* AI monitor --------------------------------------------------------------------------- */
html[data-theme="light"] .emstudio-ai-shell {
  --ai-bg: #ffffff;
  --ai-panel: #ffffff;
  --ai-panel-2: #f1f8fc;
  --ai-line: #d8e7ef;
  --ai-text: #173b50;
  --ai-muted: #58798c;
  --ai-human: #007d70;
  --ai-search: #1478b8;
  --ai-training: #af6a08;
  --ai-verify: #009c8b;
}

html[data-theme="light"] :is(.emstudio-ai-console, .emstudio-ai-clock, .emstudio-ai-toolbar) {
  background:
    radial-gradient(circle at 86% 2%, rgba(79, 184, 235, .14), transparent 35%),
    #ffffff;
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-ai-heading h2,
html[data-theme="light"] .emstudio-ai-clock time {
  color: #173b50;
}

html[data-theme="light"] .emstudio-ai-tabs button:hover:not(:disabled) {
  color: #006f71;
  background: rgba(0, 157, 139, .08);
}

html[data-theme="light"] .emstudio-ai-metric-icon {
  background: rgba(255, 255, 255, .72);
}

/* Photo wall keeps the image caption overlay dark for legibility, while every page
   surface, dialog frame and share panel follows the daylight system. */
html[data-theme="light"] .emstudio-gallery-toolbar {
  color: #58798c;
  background: rgba(255, 255, 255, .94);
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-gallery-toolbar b,
html[data-theme="light"] .emstudio-gallery-empty h2 {
  color: #173b50;
}

html[data-theme="light"] .emstudio-gallery-wall {
  background:
    linear-gradient(rgba(20, 120, 184, .055) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(0, 157, 139, .045) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(145deg, #ffffff, #edf9fc);
  border: 1px solid var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 12px 26px rgba(28, 98, 131, .08);
}

html[data-theme="light"] .emstudio-gallery-card {
  background: #ffffff;
  border-color: var(--day-line);
  box-shadow: 0 8px 20px rgba(28, 98, 131, .10), inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] .emstudio-gallery-image {
  background: #eaf4f8;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="light"] .emstudio-gallery-card:hover {
    background: #ffffff;
    border-color: rgba(0, 125, 112, .38);
    box-shadow: 0 14px 26px rgba(28, 98, 131, .14), 0 0 18px rgba(0, 157, 139, .06);
  }
}

html[data-theme="light"] .emstudio-gallery-dialog,
html[data-theme="light"] .emstudio-gallery-share-panel {
  background: #ffffff;
  border-color: var(--day-line-strong);
  box-shadow: 0 24px 70px rgba(18, 77, 108, .22), inset 0 1px 0 rgba(255, 255, 255, .98);
}

html[data-theme="light"] :is(.emstudio-gallery-dialog > header, .emstudio-gallery-dialog > footer, .emstudio-gallery-share-panel > header, .emstudio-gallery-share-buttons) {
  background: #f1f8fc;
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-gallery-stage {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 157, 139, .08), transparent 40%),
    #eaf4f8;
}

html[data-theme="light"] :is(.emstudio-gallery-dialog > header > span, .emstudio-gallery-dialog > footer p, .emstudio-gallery-share-copy strong) {
  color: #173b50;
}

html[data-theme="light"] :is(.emstudio-gallery-dialog button, .emstudio-gallery-dialog > footer a, .emstudio-gallery-share-buttons button) {
  color: #456f83;
  background: #ffffff;
  border-color: var(--day-line);
}

html[data-theme="light"] .emstudio-gallery-share-copy p {
  color: #58798c;
}

/* About, link directory, login and error views ---------------------------------------- */
html[data-theme="light"] :is(.about-hero, .about-grid article, .site-timeline, .friend-card, .link-apply) {
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(237, 248, 253, .88));
  border-color: var(--day-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 10px 22px rgba(28, 98, 131, .07);
}

html[data-theme="light"] :is(.about-hero h2, .about-grid h3, .site-timeline h3, .friend-card h3, .link-apply h3) {
  color: #173b50;
}

html[data-theme="light"] :is(.about-hero p, .about-grid p, .site-timeline p, .friend-card p, .link-apply label, .account-form > label, .account-form .field-row label) {
  color: #58798c;
}

html[data-theme="light"] .about-monogram {
  color: #08766e;
  background: linear-gradient(145deg, #eefaf8, #dceff8);
  border-color: rgba(18, 110, 157, .19);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 16px 20px 36px rgba(28, 98, 131, .12);
}

html[data-theme="light"] :is(.about-actions button, .about-actions a) {
  color: #416f83;
  background: #ffffff;
  border-color: var(--day-line);
}

html[data-theme="light"] :is(.link-apply input, .account-form input, .account-form textarea) {
  color: #173b50;
  background: #ffffff;
  border-color: var(--day-line);
}

html[data-theme="light"] .login-screen {
  background:
    radial-gradient(circle at 74% 16%, rgba(79, 184, 235, .20), transparent 25%),
    radial-gradient(circle at 18% 82%, rgba(0, 157, 139, .12), transparent 30%),
    linear-gradient(145deg, #ffffff, #edf9ff);
}

html[data-theme="light"] .login-story {
  background:
    radial-gradient(circle at 35% 52%, rgba(0, 157, 139, .12), transparent 25%),
    linear-gradient(145deg, #ffffff, #eff9fc 55%);
  border-color: var(--day-line);
}

html[data-theme="light"] .login-form-side {
  color: #173b50;
  background: rgba(255, 255, 255, .88);
}

html[data-theme="light"] :is(.login-brand, .login-copy h1, .login-deck strong, .login-form h2) {
  color: #173b50;
}

html[data-theme="light"] :is(.login-copy p, .login-story > footer, .login-back, .login-form header p, .login-field, .login-deck > span) {
  color: #58798c;
}

html[data-theme="light"] .login-field > div {
  background: #ffffff;
  border-color: var(--day-line);
}

html[data-theme="light"] .login-field input {
  color: #173b50;
}

html[data-theme="light"] .login-field :is(.icon, div > button) {
  color: #5e8092;
}

html[data-theme="light"] .error-screen {
  background:
    radial-gradient(circle at 50% 8%, rgba(20, 120, 184, .17), transparent 35%),
    #f6fbff;
}

html[data-theme="light"] .error-card > strong,
html[data-theme="light"] .error-card h1 {
  color: #173b50;
}

html[data-theme="light"] .error-card > p {
  color: #58798c;
}

html[data-theme="light"] .error-search button {
  color: #ffffff;
  background: #007d70;
  border-color: #007d70;
}

html[data-theme="light"] .login-screen {
  background:
    radial-gradient(circle at 74% 16%, rgba(79, 184, 235, .20), transparent 25%),
    radial-gradient(circle at 18% 82%, rgba(0, 157, 139, .12), transparent 30%),
    linear-gradient(145deg, #ffffff, #edf9ff);
}

html[data-theme="light"] :is(.login-story, .login-form-side) {
  color: #193e52;
}

html[data-theme="light"] .error-screen {
  background:
    radial-gradient(circle at 50% 8%, rgba(20, 120, 184, .17), transparent 35%),
    #f6fbff;
}

/* Theme control and loading state ------------------------------------------------------ */
html[data-theme="light"] .feedback-theme-toggle {
  color: #a76000;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 213, 105, .88) 0 8%, transparent 31%),
    linear-gradient(145deg, #fffdf6, #eef9ff);
  border-color: rgba(213, 138, 30, .38);
  box-shadow: 0 6px 16px rgba(192, 129, 27, .15), inset 0 1px 0 rgba(255, 255, 255, .98);
}

.feedback-theme-toggle .theme-toggle-moon { display: none; }

html[data-theme="light"] .feedback-theme-toggle .theme-toggle-sun { display: none; }
html[data-theme="light"] .feedback-theme-toggle .theme-toggle-moon { display: block; }

html[data-theme="light"] :is(.feedback-theme-toggle:hover, .feedback-theme-toggle:focus-visible) {
  color: #895000;
  border-color: rgba(213, 138, 30, .58);
  background: linear-gradient(145deg, #fff4d9, #eef9ff);
}

html[data-theme="light"].emstudio-pjax-loading::before,
html[data-theme="light"].emstudio-page-leaving::before {
  color: #17485d;
  background:
    radial-gradient(circle at 18px 50%, #19b69f 0 3px, transparent 3.5px),
    linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(235, 248, 255, .97));
  border-color: rgba(20, 120, 184, .25);
  box-shadow: 0 10px 26px rgba(28, 98, 131, .13), 0 0 0 4px rgba(20, 120, 184, .045);
}

@media (max-width: 760px) {
  html[data-theme="light"] .article-reader .article-hero {
    min-height: 0;
    padding: 21px;
  }

  html[data-theme="light"] .article-reader .article-main {
    padding: 22px;
  }

  html[data-theme="light"] .article-reader .article-content {
    font-size: 16px;
  }
}

/* Theme mode is an atomic palette change.  Animating every glass surface,
 * shadow and border only while entering daylight causes a one-way full-page
 * repaint; local hover and button transitions remain defined by their own
 * components. */

@media (forced-colors: active) {
  html[data-theme="light"] :is(.glass, .feedback-float-nav, .feedback-float-button, .task-group, .footer-monitor-item) {
    border-color: CanvasText;
    box-shadow: none;
  }
}
