/* Per-account interface themes. Franchise-inspired options use original colors and geometry only. */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.theme-picker span { opacity: .76; }
.theme-picker select {
  width: auto;
  min-width: 190px;
  margin: 0;
  padding: 7px 30px 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

/* Theme 1 — quiet, airy product UI with neutral surfaces and a restrained blue accent. */
body[data-theme="apple_minimal"] {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --paper: #f5f5f7;
  --surface: rgba(255, 255, 255, .92);
  --line: #d9d9de;
  --sage: #e8f3ff;
  --sage-ink: #0066cc;
  --amber: #fff4d6;
  --amber-ink: #8a5b00;
  --rose: #ffe8eb;
  --rose-ink: #b4233b;
  --lav: #efedff;
  --lav-ink: #5746a8;
  --shadow: 0 16px 42px rgba(0, 0, 0, .07);
  background:
    radial-gradient(circle at 80% -10%, rgba(0, 122, 255, .08), transparent 32rem),
    #f5f5f7;
  color: var(--ink);
}
body[data-theme="apple_minimal"] .app-shell { max-width: 1240px; }
body[data-theme="apple_minimal"] header {
  align-items: center;
  padding-bottom: 8px;
}
body[data-theme="apple_minimal"] h1,
body[data-theme="apple_minimal"] h2,
body[data-theme="apple_minimal"] h3 { color: #1d1d1f; letter-spacing: -.02em; }
body[data-theme="apple_minimal"] h1 { font-weight: 720; }
body[data-theme="apple_minimal"] .eyebrow { color: #6e6e73; letter-spacing: .11em; }
body[data-theme="apple_minimal"] .user-menu { color: #6e6e73; }
body[data-theme="apple_minimal"] .theme-picker select {
  border-color: #d2d2d7;
  background: rgba(255, 255, 255, .88);
  color: #1d1d1f;
}
body[data-theme="apple_minimal"] .workflow-callout {
  border: 1px solid rgba(0, 0, 0, .04);
  border-radius: 22px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .045);
  backdrop-filter: blur(18px);
}
body[data-theme="apple_minimal"] .workflow-callout b { color: #1d1d1f; }
body[data-theme="apple_minimal"] .workflow-callout span { color: #6e6e73; }
body[data-theme="apple_minimal"] .outline-button,
body[data-theme="apple_minimal"] .home-link,
body[data-theme="apple_minimal"] .account-manager-button,
body[data-theme="apple_minimal"] .reset-view {
  border-color: #d2d2d7 !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .82) !important;
  color: #0066cc !important;
  box-shadow: none;
}
body[data-theme="apple_minimal"] .edit-button,
body[data-theme="apple_minimal"] .primary,
body[data-theme="apple_minimal"] .search-submit {
  border: 0;
  border-radius: 999px;
  background: #0071e3;
  color: #fff;
  box-shadow: none;
}
body[data-theme="apple_minimal"] .workflow-summary button {
  min-height: 94px;
  border: 1px solid rgba(0, 0, 0, .035);
  border-radius: 20px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .045);
}
body[data-theme="apple_minimal"] .search-panel .search {
  border-color: transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .055);
}
body[data-theme="apple_minimal"] .note-search-panel .search { background: #f1f3fa; }
body[data-theme="apple_minimal"] .search-panel .search:focus-within {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .14);
}
body[data-theme="apple_minimal"] .filter { border-color: transparent; background: rgba(255, 255, 255, .88); }
body[data-theme="apple_minimal"] .filter.active { border-color: #1d1d1f; background: #1d1d1f; }
body[data-theme="apple_minimal"] .desktop-table,
body[data-theme="apple_minimal"] .product-card,
body[data-theme="apple_minimal"] .mobile-bulk-actions,
body[data-theme="apple_minimal"] .login-card,
body[data-theme="apple_minimal"] .modal {
  border-color: rgba(0, 0, 0, .055);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
body[data-theme="apple_minimal"] .desktop-table th,
body[data-theme="apple_minimal"] .bulk-bar { background: #fafafa; }
body[data-theme="apple_minimal"] input,
body[data-theme="apple_minimal"] select,
body[data-theme="apple_minimal"] textarea { border-color: #d2d2d7; background: #fff; color: #1d1d1f; }
body[data-theme="apple_minimal"] input:focus,
body[data-theme="apple_minimal"] select:focus,
body[data-theme="apple_minimal"] textarea:focus { outline: 2px solid rgba(0, 113, 227, .45); outline-offset: 1px; }
body[data-theme="apple_minimal"] .brand-mark { border-radius: 18px; background: #0071e3; color: #fff; }
body[data-theme="apple_minimal"] .note-previews span,
body[data-theme="apple_minimal"] .detail-grid,
body[data-theme="apple_minimal"] .layout-topbar,
body[data-theme="apple_minimal"] .batch-selectbar,
body[data-theme="apple_minimal"] .smart-position-tools { background: #f5f5f7; }

/* Theme 2 — stark black, graphite and white. Semantic colors intentionally desaturate. */
body[data-theme="modern_monochrome"] {
  color-scheme: dark;
  --tech-cyan: #f4f4f4;
  --tech-cyan-soft: rgba(255, 255, 255, .09);
  --tech-blue: #cfcfcf;
  --tech-amber: #dedede;
  --tech-red: #fff;
  --tech-line: rgba(255, 255, 255, .18);
  --tech-panel: rgba(20, 20, 20, .97);
  --tech-panel-2: rgba(28, 28, 28, .98);
  --ink: #f5f5f5;
  --muted: #a3a3a3;
  --paper: #080808;
  --surface: #161616;
  --line: #393939;
  background: linear-gradient(135deg, #050505, #111 55%, #080808);
}
body[data-theme="modern_monochrome"] #app { filter: grayscale(1); }
body[data-theme="modern_monochrome"] .app-shell::before {
  content: "SYSTEM // MONOCHROME";
  color: #9b9b9b;
}
body[data-theme="modern_monochrome"] header::after { background: linear-gradient(90deg, #fff, transparent); box-shadow: none; }
body[data-theme="modern_monochrome"] .workflow-callout {
  border-color: #444;
  background: linear-gradient(120deg, #202020, #101010 70%) !important;
  box-shadow: inset 3px 0 #ddd;
}
body[data-theme="modern_monochrome"] .edit-button,
body[data-theme="modern_monochrome"] .primary,
body[data-theme="modern_monochrome"] .search-submit {
  border-color: #eee;
  background: #eee;
  color: #080808;
  box-shadow: none;
}
body[data-theme="modern_monochrome"] .outline-button,
body[data-theme="modern_monochrome"] .home-link,
body[data-theme="modern_monochrome"] .account-manager-button,
body[data-theme="modern_monochrome"] .reset-view {
  border-color: #505050 !important;
  background: #151515 !important;
  color: #f1f1f1 !important;
}
body[data-theme="modern_monochrome"] .desktop-table,
body[data-theme="modern_monochrome"] .product-card,
body[data-theme="modern_monochrome"] .mobile-bulk-actions { border-color: #3b3b3b; background: #141414; }
body[data-theme="modern_monochrome"] .theme-picker select { border-color: #4d4d4d; background: #111; color: #fff; }

/* Theme 4 — original deep-red command center with warning-orange operational accents. */
body[data-theme="nerv_hq"] {
  color-scheme: dark;
  --ink: #fff3e9;
  --muted: #c2a99a;
  --paper: #090505;
  --surface: #1b0d0d;
  --line: #553025;
  --sage: #352013;
  --sage-ink: #ffb04a;
  --amber: #4a2a08;
  --amber-ink: #ffbd54;
  --rose: #461019;
  --rose-ink: #ff6470;
  --lav: #311825;
  --lav-ink: #f19ac4;
  --tech-cyan: #ff8a2a;
  --tech-cyan-soft: rgba(255, 127, 32, .14);
  --tech-blue: #ffcf70;
  --tech-amber: #ff9a2f;
  --tech-red: #ff334f;
  --tech-panel: rgba(25, 10, 10, .96);
  --tech-panel-2: rgba(39, 14, 12, .97);
  --tech-line: rgba(255, 133, 58, .28);
  --shadow: 0 18px 52px rgba(0, 0, 0, .48), 0 0 0 1px rgba(255, 91, 45, .05);
  background-color: #090505;
  background-image:
    linear-gradient(120deg, rgba(121, 10, 24, .16), transparent 45%),
    linear-gradient(rgba(255, 115, 42, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 115, 42, .04) 1px, transparent 1px),
    linear-gradient(145deg, #080404, #180908 55%, #070303);
  background-size: auto, 42px 42px, 42px 42px, auto;
}
body[data-theme="nerv_hq"] .app-shell::before {
  content: "OPERATIONS // CENTRAL COMMAND";
  color: rgba(255, 166, 82, .75);
}
body[data-theme="nerv_hq"] header { border-bottom-color: rgba(255, 120, 47, .28); }
body[data-theme="nerv_hq"] header::after {
  background: linear-gradient(90deg, #ff7b25, #a41428, transparent);
  box-shadow: 0 0 16px rgba(255, 99, 35, .65);
}
body[data-theme="nerv_hq"] h1,
body[data-theme="nerv_hq"] h2,
body[data-theme="nerv_hq"] h3 { color: #fff4e7; }
body[data-theme="nerv_hq"] h1 { text-shadow: 0 0 24px rgba(255, 94, 39, .25); }
body[data-theme="nerv_hq"] .eyebrow,
body[data-theme="nerv_hq"] .user-menu button,
body[data-theme="nerv_hq"] .text-button { color: #ff9a3d; }
body[data-theme="nerv_hq"] .workflow-callout {
  border-color: rgba(255, 117, 44, .42);
  background: linear-gradient(112deg, rgba(66, 14, 15, .98), rgba(24, 9, 9, .98) 70%) !important;
  box-shadow: inset 3px 0 0 #ff7a29, 0 18px 42px rgba(0, 0, 0, .3);
}
body[data-theme="nerv_hq"] .workflow-callout::after { background: linear-gradient(90deg, transparent, #ffbd54); }
body[data-theme="nerv_hq"] .outline-button,
body[data-theme="nerv_hq"] .home-link,
body[data-theme="nerv_hq"] .account-manager-button,
body[data-theme="nerv_hq"] .reset-view {
  border-color: rgba(255, 128, 54, .4) !important;
  background: linear-gradient(180deg, #2a1210, #140908) !important;
  color: #ffc070 !important;
}
body[data-theme="nerv_hq"] .edit-button,
body[data-theme="nerv_hq"] .primary,
body[data-theme="nerv_hq"] .search-submit {
  border-color: #ffad4e;
  background: linear-gradient(135deg, #ff9b31, #c33a22);
  color: #190705;
  box-shadow: 0 0 20px rgba(255, 92, 35, .2);
}
body[data-theme="nerv_hq"] .note-search-panel .search-submit { background: linear-gradient(135deg, #cc3244, #7d1628); color: #fff1e5; }
body[data-theme="nerv_hq"] .workflow-summary button,
body[data-theme="nerv_hq"] .desktop-table,
body[data-theme="nerv_hq"] .product-card,
body[data-theme="nerv_hq"] .mobile-bulk-actions {
  border-color: rgba(255, 123, 47, .26) !important;
  background: linear-gradient(145deg, rgba(38, 14, 13, .98), rgba(15, 7, 7, .98)) !important;
}
body[data-theme="nerv_hq"] .workflow-summary button::before,
body[data-theme="nerv_hq"] .product-card::before { background: #ff7d2d; box-shadow: 0 0 12px rgba(255, 96, 35, .65); }
body[data-theme="nerv_hq"] .search-panel .search {
  border-color: rgba(255, 123, 47, .34);
  background: rgba(17, 7, 7, .92);
}
body[data-theme="nerv_hq"] .search-panel .search:focus-within { border-color: #ff8f37; box-shadow: 0 0 18px rgba(255, 91, 35, .18); }
body[data-theme="nerv_hq"] .search-panel .search span { color: #ff953d; text-shadow: 0 0 12px rgba(255, 91, 35, .5); }
body[data-theme="nerv_hq"] .filter { border-color: #593024; background: #1b0d0c; color: #c8a692; }
body[data-theme="nerv_hq"] .filter.active { border-color: #ff8a32; background: rgba(255, 104, 33, .15); color: #ffca86; box-shadow: inset 0 -2px #ff7a29; }
body[data-theme="nerv_hq"] .desktop-table th,
body[data-theme="nerv_hq"] .bulk-bar { border-color: rgba(255, 118, 42, .22); background: #130808; color: #dc9563; }
body[data-theme="nerv_hq"] .desktop-table tr { background: rgba(28, 10, 10, .88); }
body[data-theme="nerv_hq"] .desktop-table tbody tr:hover { background: rgba(107, 28, 23, .28); }
body[data-theme="nerv_hq"] .theme-picker select,
body[data-theme="nerv_hq"] input,
body[data-theme="nerv_hq"] select,
body[data-theme="nerv_hq"] textarea {
  border-color: #5b3025;
  background: #130908;
  color: #fff2e8;
}
body[data-theme="nerv_hq"] .theme-picker select { background-color: #210d0b; }
body[data-theme="nerv_hq"] .login-card,
body[data-theme="nerv_hq"] .modal { border-color: rgba(255, 124, 48, .3); background: #180b0a; }
body[data-theme="nerv_hq"] .brand-mark { border-color: #ff8d36; background: linear-gradient(135deg, #8f1024, #32100c); color: #ffba61; }
body[data-theme="nerv_hq"] .note-previews span,
body[data-theme="nerv_hq"] .detail-grid,
body[data-theme="nerv_hq"] .layout-topbar,
body[data-theme="nerv_hq"] .batch-selectbar,
body[data-theme="nerv_hq"] .smart-position-tools { border-color: #4f291f; background: #170b09; }

@media (max-width: 980px) {
  .theme-picker { order: 4; width: 100%; justify-content: flex-end; }
}
@media (max-width: 759px) {
  .theme-picker { justify-content: stretch; }
  .theme-picker span { min-width: 56px; }
  .theme-picker select { min-width: 0; flex: 1; }
  body[data-theme="apple_minimal"] .workflow-callout { border-radius: 18px; }
}

/* M12 visual refinements */
body[data-theme="apple_minimal"] #app,
body[data-theme="psycho_pass"] #app,
body[data-theme="nerv_hq"] #app { position: relative; z-index: 1; }

/* Apple Minimal: macOS-like window chrome, glass layers, and native controls. */
body[data-theme="apple_minimal"] {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang TC", system-ui, sans-serif;
  background: #eef1f7;
}
body[data-theme="apple_minimal"]::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: -20vh -10vw;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 20%, rgba(105, 173, 255, .34), transparent 26rem),
    radial-gradient(circle at 86% 12%, rgba(184, 140, 255, .26), transparent 24rem),
    radial-gradient(circle at 74% 82%, rgba(104, 215, 208, .2), transparent 27rem),
    linear-gradient(145deg, #f7f9fc, #edf1f8 55%, #f8f9fc);
  filter: saturate(.9);
}
body[data-theme="apple_minimal"] .app-shell { padding-top: 34px; }
body[data-theme="apple_minimal"] header {
  position: relative;
  min-height: 112px;
  padding: 45px 22px 18px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 22px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 18px 48px rgba(59, 76, 112, .11), inset 0 0 0 1px rgba(0, 0, 0, .035);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
}
body[data-theme="apple_minimal"] header::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 19px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 22px 0 #febc2e, 44px 0 #28c840;
}
body[data-theme="apple_minimal"] header::after {
  content: "展價表";
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  color: #6e6e73;
  font-size: 12px;
  font-weight: 650;
}
body[data-theme="apple_minimal"] .theme-picker {
  padding: 4px 5px 4px 10px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  background: rgba(238, 238, 243, .84);
}
body[data-theme="apple_minimal"] .theme-picker select {
  padding-top: 6px;
  padding-bottom: 6px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .08);
}
body[data-theme="apple_minimal"] .workflow-callout {
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 14px 38px rgba(45, 66, 104, .09), inset 0 1px rgba(255, 255, 255, .75);
}
body[data-theme="apple_minimal"] .workflow-summary button {
  background: rgba(255, 255, 255, .82) !important;
  color: #3a3a3c !important;
  backdrop-filter: blur(18px);
}
body[data-theme="apple_minimal"] .workflow-summary button:nth-child(2) { color: #16834b !important; }
body[data-theme="apple_minimal"] .workflow-summary button:nth-child(3) { color: #c52b45 !important; }
body[data-theme="apple_minimal"] .workflow-summary button:nth-child(4) { color: #9a6500 !important; }
body[data-theme="apple_minimal"] .workflow-summary button:nth-child(5) { color: #5856d6 !important; }
body[data-theme="apple_minimal"] .workflow-summary button.active {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .18), 0 12px 32px rgba(0, 0, 0, .07);
}
body[data-theme="apple_minimal"] .toolbar {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 22px;
  background: rgba(255, 255, 255, .52);
  box-shadow: 0 12px 36px rgba(45, 66, 104, .075);
  backdrop-filter: blur(26px) saturate(1.25);
}
body[data-theme="apple_minimal"] .search-panel .search {
  background: rgba(246, 246, 248, .94);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .035);
}
body[data-theme="apple_minimal"] .search-submit { min-width: 84px; }
body[data-theme="apple_minimal"] .filter {
  border: 0;
  background: rgba(229, 229, 234, .82);
  color: #48484a;
}
body[data-theme="apple_minimal"] .filter.active {
  border: 0;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .1);
}
body[data-theme="apple_minimal"] .desktop-table {
  box-shadow: 0 18px 48px rgba(45, 66, 104, .1);
  backdrop-filter: blur(24px);
}
body[data-theme="apple_minimal"] .desktop-table th {
  background: rgba(242, 242, 247, .9);
  color: #6e6e73;
}
body[data-theme="apple_minimal"] .desktop-table tbody tr:hover { background: rgba(0, 122, 255, .035); }
body[data-theme="apple_minimal"] .status { border-radius: 999px; }
body[data-theme="apple_minimal"] dialog::backdrop { background: rgba(20, 24, 34, .3); backdrop-filter: blur(12px); }

/* Modern Monochrome: brighter silver and soft graphite instead of near-black. */
body[data-theme="modern_monochrome"] {
  color-scheme: light;
  --ink: #25272a;
  --muted: #6d7177;
  --paper: #e7e9ec;
  --surface: #f9f9fa;
  --line: #cfd2d6;
  --sage: #e6e8ea;
  --sage-ink: #34373b;
  --amber: #e0e2e5;
  --amber-ink: #4c4f54;
  --rose: #d9dbde;
  --rose-ink: #2f3236;
  --lav: #eef0f2;
  --lav-ink: #54575d;
  --shadow: 0 14px 38px rgba(34, 38, 44, .1);
  background:
    linear-gradient(rgba(255, 255, 255, .3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .3) 1px, transparent 1px),
    linear-gradient(145deg, #f1f2f4, #dfe2e6 58%, #eceef0);
  background-size: 32px 32px, 32px 32px, auto;
  color: var(--ink);
}
body[data-theme="modern_monochrome"] #app { filter: none; }
body[data-theme="modern_monochrome"] .app-shell::before {
  content: "STUDIO / MONOCHROME";
  display: block;
  margin-bottom: 12px;
  color: #73777d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
}
body[data-theme="modern_monochrome"] header {
  position: relative;
  padding-bottom: 18px;
  border-bottom: 2px solid #34363a;
}
body[data-theme="modern_monochrome"] header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 22%;
  height: 2px;
  background: #a5a8ad;
}
body[data-theme="modern_monochrome"] h1,
body[data-theme="modern_monochrome"] h2,
body[data-theme="modern_monochrome"] h3 { color: #202226; }
body[data-theme="modern_monochrome"] .eyebrow { color: #74777c; }
body[data-theme="modern_monochrome"] .theme-picker select,
body[data-theme="modern_monochrome"] input,
body[data-theme="modern_monochrome"] select,
body[data-theme="modern_monochrome"] textarea {
  border-color: #c5c8cc;
  background: #fff;
  color: #25272a;
}
body[data-theme="modern_monochrome"] .workflow-callout {
  border: 1px solid #c9ccd0;
  border-radius: 10px;
  background: linear-gradient(120deg, #fafafa, #e7e9eb) !important;
  box-shadow: inset 4px 0 #33363a, 0 10px 28px rgba(35, 39, 45, .07);
}
body[data-theme="modern_monochrome"] .workflow-callout b { color: #26282c; }
body[data-theme="modern_monochrome"] .workflow-callout span { color: #6f7378; }
body[data-theme="modern_monochrome"] .edit-button,
body[data-theme="modern_monochrome"] .primary,
body[data-theme="modern_monochrome"] .search-submit {
  border: 1px solid #2f3236;
  border-radius: 7px;
  background: #36393e;
  color: #fff;
}
body[data-theme="modern_monochrome"] .outline-button,
body[data-theme="modern_monochrome"] .home-link,
body[data-theme="modern_monochrome"] .account-manager-button,
body[data-theme="modern_monochrome"] .reset-view {
  border-color: #b8bbc0 !important;
  background: rgba(255, 255, 255, .8) !important;
  color: #35383d !important;
}
body[data-theme="modern_monochrome"] .workflow-summary button {
  border: 1px solid #d0d2d5;
  border-radius: 9px;
  background: linear-gradient(145deg, #fff, #e9ebed) !important;
  color: #393c41 !important;
  box-shadow: 0 8px 22px rgba(35, 39, 45, .07);
}
body[data-theme="modern_monochrome"] .workflow-summary button.active {
  outline: 2px solid #4a4d52;
  box-shadow: 0 9px 26px rgba(35, 39, 45, .12);
}
body[data-theme="modern_monochrome"] .search-panel .search {
  border-color: #c8cbd0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 7px 20px rgba(35, 39, 45, .06);
}
body[data-theme="modern_monochrome"] .filter { border-color: #c4c7cb; background: #f7f7f8; color: #666a70; }
body[data-theme="modern_monochrome"] .filter.active { border-color: #373a3f; background: #3b3e43; color: #fff; }
body[data-theme="modern_monochrome"] .desktop-table,
body[data-theme="modern_monochrome"] .product-card,
body[data-theme="modern_monochrome"] .mobile-bulk-actions,
body[data-theme="modern_monochrome"] .modal,
body[data-theme="modern_monochrome"] .login-card {
  border: 1px solid #c8cbd0;
  border-radius: 10px;
  background: rgba(250, 250, 251, .96);
  color: #282b2f;
  box-shadow: var(--shadow);
}
body[data-theme="modern_monochrome"] .desktop-table th,
body[data-theme="modern_monochrome"] .bulk-bar { background: #e8eaed; color: #676b70; }
body[data-theme="modern_monochrome"] .desktop-table td { border-top-color: #d9dbde; }
body[data-theme="modern_monochrome"] .status { border-radius: 5px; background: #e3e5e7 !important; color: #3d4045 !important; }
body[data-theme="modern_monochrome"] .note-previews span,
body[data-theme="modern_monochrome"] .detail-grid,
body[data-theme="modern_monochrome"] .layout-topbar,
body[data-theme="modern_monochrome"] .batch-selectbar,
body[data-theme="modern_monochrome"] .smart-position-tools { background: #eceef0; color: #55595f; }

/* Psycho-Pass: brighter data-grid atmosphere and a slow scanning beam. */
body[data-theme="psycho_pass"] {
  background-image:
    radial-gradient(ellipse at 14% 12%, rgba(49, 230, 223, .16), transparent 30rem),
    radial-gradient(ellipse at 88% 24%, rgba(79, 143, 255, .14), transparent 34rem),
    linear-gradient(rgba(57, 166, 173, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 166, 173, .065) 1px, transparent 1px),
    linear-gradient(145deg, #05090d, #0a151c 52%, #05090d);
  background-size: auto, auto, 30px 30px, 30px 30px, auto;
}
body[data-theme="psycho_pass"]::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .66;
  background:
    linear-gradient(90deg, transparent 6%, rgba(49, 230, 223, .12) 6.1%, transparent 6.25%),
    linear-gradient(90deg, transparent 82%, rgba(79, 143, 255, .11) 82.1%, transparent 82.3%),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(145, 255, 250, .025) 8px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 88%);
}
body[data-theme="psycho_pass"]::after {
  content: "";
  position: fixed;
  z-index: 0;
  left: 0;
  right: 0;
  top: 10%;
  height: 16vh;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(49, 230, 223, .055), rgba(49, 230, 223, .15), transparent);
  border-bottom: 1px solid rgba(100, 255, 247, .2);
  filter: blur(.2px);
}
body[data-theme="psycho_pass"] .app-shell {
  filter: drop-shadow(0 0 34px rgba(18, 113, 116, .08));
}
body[data-theme="psycho_pass"] header::before {
  content: "";
  position: absolute;
  right: 0;
  top: -9px;
  width: 94px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #31e6df 0 18px, transparent 18px 25px);
  opacity: .55;
}

/* NERV HQ: original honeycomb geometry, clipped panels, and warning bars. */
body[data-theme="nerv_hq"]::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background-image:
    linear-gradient(30deg, rgba(255, 105, 39, .3) 12%, transparent 12.5%, transparent 87%, rgba(255, 105, 39, .3) 87.5%, rgba(255, 105, 39, .3)),
    linear-gradient(150deg, rgba(255, 105, 39, .3) 12%, transparent 12.5%, transparent 87%, rgba(255, 105, 39, .3) 87.5%, rgba(255, 105, 39, .3)),
    linear-gradient(30deg, rgba(255, 105, 39, .3) 12%, transparent 12.5%, transparent 87%, rgba(255, 105, 39, .3) 87.5%, rgba(255, 105, 39, .3)),
    linear-gradient(150deg, rgba(255, 105, 39, .3) 12%, transparent 12.5%, transparent 87%, rgba(255, 105, 39, .3) 87.5%, rgba(255, 105, 39, .3)),
    linear-gradient(60deg, rgba(164, 20, 40, .25) 25%, transparent 25.5%, transparent 75%, rgba(164, 20, 40, .25) 75%);
  background-position: 0 0, 0 0, 42px 74px, 42px 74px, 0 0;
  background-size: 84px 148px;
  mask-image: radial-gradient(ellipse at 82% 16%, #000 0, rgba(0,0,0,.8) 26%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 82% 16%, #000 0, rgba(0,0,0,.8) 26%, transparent 72%);
}
body[data-theme="nerv_hq"]::after {
  content: "";
  position: fixed;
  z-index: 0;
  top: 0;
  right: 3vw;
  width: min(330px, 42vw);
  height: 10px;
  pointer-events: none;
  background: repeating-linear-gradient(120deg, #ff922f 0 13px, #7d1220 13px 26px);
  box-shadow: 0 0 18px rgba(255, 81, 30, .5);
}
body[data-theme="nerv_hq"] header::before {
  content: "CAUTION // ACTIVE OPERATIONS";
  position: absolute;
  right: 0;
  bottom: 5px;
  color: rgba(255, 160, 72, .66);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .2em;
}
body[data-theme="nerv_hq"] .workflow-summary button,
body[data-theme="nerv_hq"] .search-panel .search,
body[data-theme="nerv_hq"] .outline-button,
body[data-theme="nerv_hq"] .edit-button,
body[data-theme="nerv_hq"] .primary {
  border-radius: 0 !important;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
body[data-theme="nerv_hq"] .workflow-summary button { min-height: 96px; }
body[data-theme="nerv_hq"] .workflow-summary button:nth-child(1)::after,
body[data-theme="nerv_hq"] .workflow-summary button:nth-child(5)::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 30px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #ff8732 0 5px, transparent 5px 8px);
}
body[data-theme="nerv_hq"] .desktop-table,
body[data-theme="nerv_hq"] .product-card {
  box-shadow: inset 0 0 0 1px rgba(255, 122, 42, .08), 0 18px 46px rgba(0, 0, 0, .42);
}
body[data-theme="nerv_hq"] .desktop-table th {
  background-image: repeating-linear-gradient(120deg, transparent 0 16px, rgba(144, 16, 31, .12) 16px 28px);
}
body[data-theme="nerv_hq"] .theme-picker {
  border-left: 3px solid #ff812f;
  padding-left: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  body[data-theme="psycho_pass"]::after { animation: psycho-scan-field 8s linear infinite; }
  body[data-theme="nerv_hq"]::before { animation: nerv-grid-pulse 7s ease-in-out infinite; }
  @keyframes psycho-scan-field {
    from { transform: translateY(-28vh); opacity: .2; }
    45%, 55% { opacity: .95; }
    to { transform: translateY(105vh); opacity: .18; }
  }
  @keyframes nerv-grid-pulse { 0%, 100% { opacity: .24; } 50% { opacity: .42; } }
}

@media (max-width: 759px) {
  body[data-theme="apple_minimal"] .app-shell { padding-top: 18px; }
  body[data-theme="apple_minimal"] header { padding: 43px 14px 15px; }
  body[data-theme="apple_minimal"] header::after { display: none; }
  body[data-theme="apple_minimal"] .toolbar { padding: 11px; border-radius: 17px; }
  body[data-theme="modern_monochrome"] .app-shell::before { letter-spacing: .13em; }
  body[data-theme="nerv_hq"]::before { background-size: 62px 108px; }
  body[data-theme="nerv_hq"] header::before { display: none; }
  body[data-theme="nerv_hq"] .workflow-summary button { min-height: 84px; }
}

/* M13: edge-weighted alert honeycomb and an original public-safety emblem. */
body[data-theme="nerv_hq"]::before {
  opacity: .5;
  background-image:
    radial-gradient(circle at 4% 8%, rgba(255, 42, 58, .4), transparent 10rem),
    radial-gradient(circle at 96% 27%, rgba(255, 82, 34, .34), transparent 12rem),
    linear-gradient(30deg, rgba(255, 76, 43, .46) 12%, transparent 12.5%, transparent 87%, rgba(255, 76, 43, .46) 87.5%, rgba(255, 76, 43, .46)),
    linear-gradient(150deg, rgba(255, 76, 43, .46) 12%, transparent 12.5%, transparent 87%, rgba(255, 76, 43, .46) 87.5%, rgba(255, 76, 43, .46)),
    linear-gradient(30deg, rgba(255, 76, 43, .46) 12%, transparent 12.5%, transparent 87%, rgba(255, 76, 43, .46) 87.5%, rgba(255, 76, 43, .46)),
    linear-gradient(150deg, rgba(255, 76, 43, .46) 12%, transparent 12.5%, transparent 87%, rgba(255, 76, 43, .46) 87.5%, rgba(255, 76, 43, .46)),
    linear-gradient(60deg, rgba(166, 15, 36, .36) 25%, transparent 25.5%, transparent 75%, rgba(166, 15, 36, .36) 75%);
  background-position: 0 0, 0 0, 0 0, 0 0, 42px 74px, 42px 74px, 0 0;
  background-size: auto, auto, 84px 148px, 84px 148px, 84px 148px, 84px 148px, 84px 148px;
  mask-image: linear-gradient(90deg, #000 0 20%, transparent 37% 63%, #000 80% 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0 20%, transparent 37% 63%, #000 80% 100%);
  filter: drop-shadow(0 0 8px rgba(255, 49, 43, .22));
}
body[data-theme="psycho_pass"] header > div:first-child {
  position: relative;
  min-height: 58px;
  padding-left: 68px;
}
body[data-theme="psycho_pass"] header > div:first-child::after {
  content: "PUBLIC SAFETY";
  position: absolute;
  left: 0;
  top: 1px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  border: 1px solid rgba(101, 255, 246, .68);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 48%, rgba(49, 230, 223, .12) 49% 58%, transparent 59%),
    conic-gradient(from 20deg, rgba(49, 230, 223, .72), transparent 12% 24%, rgba(79, 143, 255, .64) 25% 35%, transparent 36% 60%, rgba(49, 230, 223, .72) 61% 72%, transparent 73%);
  color: #9ffff9;
  font-size: 5px;
  font-weight: 900;
  letter-spacing: .14em;
  box-shadow: inset 0 0 14px rgba(49, 230, 223, .12), 0 0 20px rgba(49, 230, 223, .2);
}
body[data-theme="psycho_pass"] header > div:first-child::before {
  content: "公安";
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 10px;
  width: 32px;
  height: 37px;
  display: grid;
  place-items: center;
  padding-bottom: 4px;
  clip-path: polygon(50% 0, 92% 16%, 84% 73%, 50% 100%, 16% 73%, 8% 16%);
  background: linear-gradient(160deg, rgba(116, 255, 247, .94), rgba(34, 120, 151, .92));
  color: #031015;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
  box-shadow: 0 0 14px rgba(49, 230, 223, .38);
}

@media (prefers-reduced-motion: no-preference) {
  body[data-theme="psycho_pass"] header > div:first-child::after { animation: public-safety-ring 9s linear infinite; }
  @keyframes public-safety-ring {
    0%, 82% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
  }
}

@media (max-width: 759px) {
  body[data-theme="nerv_hq"]::before {
    opacity: .32;
    background-size: auto, auto, 62px 108px, 62px 108px, 62px 108px, 62px 108px, 62px 108px;
    mask-image: linear-gradient(90deg, #000 0 12%, transparent 29% 71%, #000 88% 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0 12%, transparent 29% 71%, #000 88% 100%);
  }
  body[data-theme="psycho_pass"] header > div:first-child {
    min-height: 50px;
    padding-left: 57px;
  }
  body[data-theme="psycho_pass"] header > div:first-child::after {
    width: 47px;
    height: 47px;
    font-size: 4px;
  }
  body[data-theme="psycho_pass"] header > div:first-child::before {
    left: 10px;
    top: 8px;
    width: 27px;
    height: 32px;
    font-size: 8px;
  }
}

/* M14: original circular medical-cybernetics bureau seal. */
body[data-theme="psycho_pass"] header > div:first-child {
  min-height: 70px;
  padding-left: 184px;
}
body[data-theme="psycho_pass"] header > div:first-child::after {
  content: "⚕";
  top: 0;
  width: 66px;
  height: 66px;
  align-items: center;
  padding: 0;
  border: 2px solid #21f0e8;
  background:
    linear-gradient(90deg, transparent 14%, #22dcd7 15% 38%, transparent 39% 61%, #22dcd7 62% 85%, transparent 86%) center 21% / 82% 4px no-repeat,
    radial-gradient(circle, #061116 0 46%, transparent 47%),
    repeating-conic-gradient(from 0deg, rgba(49, 230, 223, .88) 0 4deg, transparent 4deg 16deg),
    #061116;
  color: #20dce4;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-size: 35px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 12px rgba(40, 237, 234, .55);
  box-shadow:
    inset 0 0 0 5px #061116,
    inset 0 0 0 6px rgba(49, 230, 223, .72),
    0 0 0 3px #061116,
    0 0 0 4px rgba(49, 230, 223, .75),
    0 0 22px rgba(49, 230, 223, .24);
}
body[data-theme="psycho_pass"] header > div:first-child::before {
  content: "PSB 103";
  left: 80px;
  top: 17px;
  width: 94px;
  height: 34px;
  display: block;
  padding: 0;
  clip-path: none;
  background: transparent;
  color: #eefcfd;
  font-family: "Arial Black", "Eurostile", "Noto Sans TC", sans-serif;
  font-size: 18px;
  font-weight: 950;
  line-height: 34px;
  letter-spacing: -.04em;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #187d8d, 0 0 13px rgba(49, 230, 223, .28);
  box-shadow: none;
}
body[data-theme="psycho_pass"] header > div:first-child h1 {
  position: relative;
}
body[data-theme="psycho_pass"] header > div:first-child h1::after {
  content: "PUBLIC SAFETY BUREAU // CYBERNETICS";
  display: block;
  margin-top: 3px;
  color: rgba(112, 243, 236, .58);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .16em;
  text-shadow: none;
}

@media (prefers-reduced-motion: no-preference) {
  body[data-theme="psycho_pass"] header > div:first-child::after {
    animation: bureau-seal-pulse 3.8s ease-in-out infinite;
  }
  @keyframes bureau-seal-pulse {
    0%, 100% { filter: brightness(.92); }
    50% { filter: brightness(1.18); }
  }
}

@media (max-width: 759px) {
  body[data-theme="psycho_pass"] header > div:first-child {
    min-height: 54px;
    padding-left: 128px;
  }
  body[data-theme="psycho_pass"] header > div:first-child::after {
    width: 49px;
    height: 49px;
    border-width: 1px;
    font-size: 26px;
    box-shadow:
      inset 0 0 0 4px #061116,
      inset 0 0 0 5px rgba(49, 230, 223, .72),
      0 0 0 2px #061116,
      0 0 0 3px rgba(49, 230, 223, .7),
      0 0 16px rgba(49, 230, 223, .2);
  }
  body[data-theme="psycho_pass"] header > div:first-child::before {
    left: 59px;
    top: 11px;
    width: 64px;
    height: 28px;
    font-size: 13px;
    line-height: 28px;
  }
  body[data-theme="psycho_pass"] header > div:first-child h1::after {
    font-size: 5px;
    letter-spacing: .08em;
  }
}
