:root {
  --bg: #09111c;
  --paper: rgba(17, 26, 39, 0.84);
  --paper-strong: #172234;
  --paper-soft: rgba(24, 35, 52, 0.72);
  --ink: #eef3f8;
  --muted: #98a6b7;
  --line: rgba(220, 229, 238, 0.12);
  --brand: #6fb6ff;
  --brand-strong: #dcecff;
  --accent: #d7a85a;
  --accent-soft: rgba(118, 120, 237, 0.10);
  --accent-strong: #f0c46e;
  --success: #76c7a5;
  --danger: #d0645b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.24);
}


:root[data-theme="light"],
body[data-theme="light"] {
  --bg: #e1e5f2;
  --paper: rgba(248, 250, 255, 0.94);
  --paper-strong: rgba(232, 237, 249, 0.98);
  --paper-soft: rgba(220, 226, 241, 0.92);
  --ink: #3d348b;
  --muted: #6a6ccf;
  --line: rgba(61, 52, 139, 0.14);
  --brand: #7678ed;
  --brand-strong: #3d348b;
  --accent: #f7b801;
  --accent-soft: rgba(247, 184, 1, 0.16);
  --accent-strong: #f18701;
  --success: #a7c957;
  --danger: #f35b04;
  --shadow: 0 24px 70px rgba(61, 52, 139, 0.10);
  --shadow-soft: 0 12px 32px rgba(61, 52, 139, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 168, 90, 0.18), transparent 24%),
    radial-gradient(circle at 84% 10%, rgba(111, 182, 255, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(36, 77, 102, 0.34), transparent 34%),
    linear-gradient(180deg, #0b1320 0%, #07101a 58%, #050a11 100%);
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(118, 120, 237, 0.10), transparent 24%),
    radial-gradient(circle at 84% 10%, rgba(118, 120, 237, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(118, 120, 237, 0.06), transparent 34%),
    linear-gradient(180deg, #e7ebf5 0%, #dde3f0 56%, #d2d9ea 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

body:not([data-authenticated="true"]) .app-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 32% 24%, rgba(118, 199, 165, 0.2), transparent 28%),
    radial-gradient(circle at 72% 18%, rgba(111, 182, 255, 0.16), transparent 26%),
    rgba(5, 10, 17, 0.82);
  backdrop-filter: blur(22px);
}

body[data-theme="light"] .login-gate {
  background:
    radial-gradient(circle at 32% 24%, rgba(118, 120, 237, 0.10), transparent 28%),
    radial-gradient(circle at 72% 18%, rgba(111, 182, 255, 0.12), transparent 26%),
    rgba(228, 233, 245, 0.88);
}

.login-gate[hidden] {
  display: none;
}

.auth-modal[hidden] {
  display: none;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 34px;
  border-radius: 30px;
  border: 1px solid rgba(118, 199, 165, 0.28);
  background:
    linear-gradient(145deg, rgba(20, 43, 54, 0.96), rgba(10, 18, 29, 0.98)),
    var(--paper);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 90px rgba(0, 0, 0, 0.46);
}

body[data-theme="light"] .login-card {
  border-color: rgba(215, 168, 90, 0.26);
  background: linear-gradient(145deg, rgba(236, 241, 252, 0.97), rgba(226, 231, 246, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 30px 90px rgba(61, 52, 139, 0.16);
}

body[data-theme="light"] .login-role-card {
  border-color: rgba(61, 52, 139, 0.12);
  background: rgba(227, 232, 243, 0.92);
}

body[data-theme="light"] .role-picker-option {
  border-color: rgba(61, 52, 139, 0.12);
  background: rgba(255, 255, 255, 0.74);
}

body[data-theme="light"] .role-picker-option.active {
  border-color: rgba(76, 161, 113, 0.35);
  background: rgba(111, 221, 178, 0.16);
}

.login-card h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
}

.login-role-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  background: rgba(28, 41, 61, 0.72);
}

.login-role-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.role-picker-grid {
  display: grid;
  gap: 10px;
}

.role-picker-option {
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.role-picker-option:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 182, 255, 0.34);
}

.role-picker-option.active {
  border-color: rgba(111, 221, 178, 0.5);
  background: rgba(92, 184, 138, 0.14);
}

.sidebar {
  padding: 34px 28px;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  border-right: 1px solid rgba(220, 229, 238, 0.1);
  background:
    linear-gradient(180deg, rgba(18, 29, 45, 0.9), rgba(10, 18, 29, 0.86)),
    linear-gradient(180deg, rgba(111, 182, 255, 0.08), rgba(215, 168, 90, 0.06));
  backdrop-filter: blur(22px);
}

body[data-theme="light"] .sidebar {
  border-right-color: rgba(61, 52, 139, 0.1);
  background: linear-gradient(180deg, rgba(239, 243, 251, 0.97), rgba(227, 232, 243, 0.94));
}

.workspace {
  padding: 34px;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.session-controls {
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-slider {
  position: relative;
  width: 76px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(118, 199, 165, 0.28);
  background: rgba(16, 28, 42, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-toggle-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(220, 229, 238, 0.72);
  z-index: 1;
}

.theme-toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.theme-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22354c, #142435);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, background 180ms ease;
}

.theme-toggle input:checked + .theme-toggle-slider {
  background: rgba(242, 228, 190, 0.68);
  border-color: rgba(215, 168, 90, 0.34);
}

.theme-toggle input:checked + .theme-toggle-slider .theme-toggle-knob {
  transform: translateX(34px);
  background: linear-gradient(135deg, #f7b801, #d7a85a);
}

.theme-toggle input:checked + .theme-toggle-slider .theme-toggle-icon-light {
  color: #7a5314;
}

.theme-toggle input:not(:checked) + .theme-toggle-slider .theme-toggle-icon-dark {
  color: #dcecff;
}

.theme-toggle input:focus-visible + .theme-toggle-slider {
  outline: 2px solid rgba(111, 182, 255, 0.7);
  outline-offset: 3px;
}

body[data-theme="light"] .theme-toggle-slider {
  background: rgba(240, 228, 205, 0.92);
  border-color: rgba(61, 52, 139, 0.12);
}

body[data-theme="light"] .theme-toggle-knob {
  background: linear-gradient(135deg, #1f3855, #2b537e);
}

body[data-theme="light"] .theme-toggle input:checked + .theme-toggle-slider .theme-toggle-knob {
  background: linear-gradient(135deg, #f4ca6d, #d7a85a);
}

.brand-block h1,
.hero h2,
.section-header h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: 2.4rem;
  line-height: 0.96;
  color: var(--brand-strong);
}

.hero h2 {
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.compact-copy {
  margin: 0;
}

.panel,
.hero,
.column {
  background: var(--paper);
  border: 1px solid rgba(220, 229, 238, 0.1);
  box-shadow: var(--shadow);
  border-radius: 30px;
}

.panel {
  padding: 22px;
  margin-top: 24px;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(31, 44, 64, 0.78), rgba(13, 23, 36, 0.9)),
    var(--paper);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 26px 70px rgba(0, 0, 0, 0.3);
}

.hero,
.column {
  padding: 26px;
}

.biller-hero-copy {
  display: none;
  max-width: 720px;
  gap: 10px;
}

.biller-hero-copy h2 {
  margin: 0;
}

.biller-hero-copy .muted {
  max-width: 640px;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(20, 38, 56, 0.78), rgba(10, 18, 29, 0.88)),
    var(--paper);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.session-bar .eyebrow {
  margin-bottom: 3px;
  font-size: 0.58rem;
}

.session-bar strong {
  color: var(--brand-strong);
  font-size: 0.9rem;
}

.session-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.session-avatar-wrap {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(220, 229, 238, 0.14);
  background: rgba(8, 16, 27, 0.42);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.session-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.session-avatar-fallback {
  color: var(--brand-strong);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.session-profile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.session-user-role {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.session-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(112, 203, 152, 0.28);
  background: rgba(52, 118, 85, 0.18);
  color: #b8f0cc;
  font-size: 0.82rem;
  font-weight: 700;
}

.review-inbox {
  padding: 16px 20px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(18, 30, 46, 0.78), rgba(10, 18, 29, 0.88));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  transition: max-height 180ms ease, padding 180ms ease;
}

.sidebar .review-inbox {
  margin-top: 16px;
  width: 100%;
}

.sidebar .review-inbox .section-header {
  gap: 12px;
}

.review-inbox[hidden] {
  display: none;
}


.review-notifications {
  display: grid;
  gap: 10px;
  max-height: 180px;
  overflow: auto;
}


.review-notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(112, 203, 152, 0.16);
  background: rgba(14, 26, 39, 0.74);
}

.review-notification-open {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.review-notification:hover {
  border-color: rgba(112, 203, 152, 0.34);
  background: rgba(18, 34, 51, 0.88);
}

.review-notification strong {
  color: var(--brand-strong);
  font-size: 0.92rem;
}

.review-notification span {
  color: var(--muted);
  font-size: 0.82rem;
}

.review-complete-btn {
  min-height: 38px;
  white-space: nowrap;
  padding: 0 14px;
}

.review-deck-dialog {
  width: min(1480px, calc(100vw - 32px));
}

.column {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.workspace-grid > .column:last-child {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.workspace-grid > .column:last-child .section-header {
  position: relative;
  z-index: 2;
}

.panel-heading,
.section-header,
.hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading-stack {
  display: grid;
  justify-items: stretch;
  gap: 14px;
}

.panel-actions-centered {
  justify-content: center;
  align-items: center;
}

.template-tree-panel[data-has-selection="true"] {
  border-color: rgba(240, 196, 110, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(240, 196, 110, 0.12),
    0 26px 70px rgba(0, 0, 0, 0.3);
}


.template-tree-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.template-tree-toggle {
  width: 100%;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background:
    linear-gradient(135deg, rgba(26, 42, 62, 0.92), rgba(12, 22, 35, 0.92)),
    rgba(20, 32, 48, 0.84);
  color: var(--ink);
  border-radius: 18px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.template-tree-toggle svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: var(--accent-strong);
  transition: transform 180ms ease;
}

.template-tree-toggle.collapsed svg {
  transform: rotate(-90deg);
}

.template-tree-selection-cue {
  margin-left: auto;
  border: 1px solid rgba(240, 196, 110, 0.28);
  background: rgba(240, 196, 110, 0.13);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.template-tree-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  min-height: 0;
}

.active-path {
  display: none !important;
}

.active-path-prefix,
.active-path-empty,
.active-path-separator,
.active-path-badge {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.active-path-prefix {
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.active-path-empty {
  color: rgba(238, 243, 248, 0.62);
}

.active-path-crumb {
  border: 1px solid rgba(220, 229, 238, 0.14);
  background: rgba(10, 18, 29, 0.68);
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.active-path-crumb.current {
  color: #07101a;
  border-color: transparent;
  background: linear-gradient(135deg, #f0c46e 0%, #d7a85a 100%);
}

.active-path-badge {
  border: 1px solid rgba(118, 199, 165, 0.24);
  background: rgba(118, 199, 165, 0.1);
  color: var(--success);
  border-radius: 999px;
  padding: 7px 9px;
}

.hero {
  justify-content: flex-end;
  background:
    linear-gradient(135deg, rgba(26, 40, 60, 0.78), rgba(12, 22, 35, 0.92)),
    linear-gradient(135deg, rgba(111, 182, 255, 0.08), rgba(215, 168, 90, 0.1));
  border: 1px solid rgba(215, 168, 90, 0.18);
}

.admin-panel {
  margin-top: 0;
  display: grid;
  gap: 12px;
  max-height: 230px;
  overflow: auto;
  border-color: rgba(118, 199, 165, 0.22);
  padding: 14px 18px;
  transition: max-height 180ms ease, padding 180ms ease;
}

.admin-panel[hidden] {
  display: none;
}

.admin-panel[data-collapsed="true"] {
  max-height: 76px;
  overflow: hidden;
}

.admin-panel[data-collapsed="true"] .admin-panel-body {
  display: none;
}

.admin-panel[data-collapsed="true"] .section-header {
  align-items: center;
}

.admin-panel[data-collapsed="true"] h3 {
  font-size: 1rem;
}

.admin-panel-body {
  display: grid;
  gap: 14px;
}

.admin-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(118, 199, 165, 0.28);
  background: rgba(8, 16, 27, 0.62);
  color: var(--success);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 180ms ease;
}

.admin-panel[data-collapsed="false"] .admin-toggle-btn svg {
  transform: rotate(180deg);
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 150px minmax(150px, 1.2fr) minmax(150px, 1.2fr) minmax(180px, 1.4fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-form .field {
  margin-top: 0;
}

.admin-users {
  display: grid;
  gap: 8px;
}

.admin-status {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--brand-strong);
}

.admin-user-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  background: rgba(8, 16, 27, 0.5);
}

.admin-user-actions {
  justify-content: flex-end;
}

.admin-user-row strong,
.admin-user-row span {
  display: block;
}

.admin-user-row strong {
  line-height: 1.35;
}

.admin-user-row span {
  margin-top: 2px;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.hero-actions,
.helper-row,
.story-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toolbar-icon-btn {
  position: relative;
  width: 50px;
  height: 50px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.toolbar-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  display: block;
}

.toolbar-btn-label {
  display: none;
}

.toolbar-icon-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translate(-50%, -4px);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(9, 17, 27, 0.96);
  border: 1px solid rgba(220, 229, 238, 0.12);
  color: #f4f8fb;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 12;
}

.toolbar-icon-btn:hover::after,
.toolbar-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toolbar-icon-btn-primary::after {
  background: rgba(17, 21, 28, 0.98);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.field span,
.mini-field span,
.search-field span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input,
.field textarea,
.field select,
.search-field input,
.mini-field select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 27, 0.72);
  padding: 14px 15px;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

.compact {
  margin-top: 0;
}

.compact input,
.compact textarea {
  padding: 12px 13px;
}

.chip-grid,
.deck-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-list {
  display: grid;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 6px;
  padding-bottom: 18px;
  scrollbar-gutter: stable;
}

.template-node {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  padding: 11px 10px 11px calc(12px + (var(--template-depth, 0) * 12px));
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.11);
  background:
    linear-gradient(135deg, rgba(31, 48, 70, 0.9), rgba(12, 24, 38, 0.96)),
    var(--paper-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  isolation: isolate;
}

.template-node:not([data-depth="0"]) {
  margin-left: calc(26px + ((var(--template-depth, 1) - 1) * 10px));
  width: auto;
  padding-left: 12px;
  background:
    linear-gradient(135deg, rgba(15, 31, 49, 0.88), rgba(7, 17, 29, 0.96)),
    var(--paper-soft);
  border-color: rgba(111, 182, 255, 0.16);
  box-shadow:
    inset 2px 0 0 rgba(111, 182, 255, 0.28),
    0 16px 34px rgba(0, 0, 0, 0.18);
}

.template-node[data-depth="0"] {
  border-color: rgba(240, 196, 110, 0.24);
  box-shadow:
    inset 3px 0 0 rgba(240, 196, 110, 0.78),
    var(--shadow-soft);
}

.template-node[data-depth="1"] {
  background:
    linear-gradient(135deg, rgba(18, 43, 62, 0.9), rgba(7, 20, 34, 0.96)),
    var(--paper-soft);
  border-color: rgba(111, 182, 255, 0.2);
  box-shadow:
    inset 2px 0 0 rgba(111, 182, 255, 0.5),
    0 16px 34px rgba(0, 0, 0, 0.18);
}

.template-node[data-depth="2"],
.template-node[data-depth="3"],
.template-node[data-depth="4"] {
  background:
    linear-gradient(135deg, rgba(17, 38, 42, 0.8), rgba(7, 16, 27, 0.96)),
    var(--paper-soft);
  border-color: rgba(118, 199, 165, 0.14);
  box-shadow:
    inset 2px 0 0 rgba(118, 199, 165, 0.32),
    0 16px 34px rgba(0, 0, 0, 0.16);
}

.template-node[data-selected="true"] {
  border-color: rgba(114, 214, 153, 0.52);
  background:
    radial-gradient(circle at 18% 20%, rgba(114, 214, 153, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(19, 59, 50, 0.96), rgba(8, 25, 31, 0.98)),
    var(--paper-soft);
  box-shadow:
    inset 3px 0 0 rgba(114, 214, 153, 0.92),
    0 0 0 1px rgba(114, 214, 153, 0.16),
    0 20px 44px rgba(20, 174, 102, 0.14),
    0 14px 34px rgba(0, 0, 0, 0.24);
}

.template-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  justify-content: start;
}

.template-node::before {
  display: none;
}

.template-node[data-depth="0"]::before {
  display: none;
}

.template-node::after {
  content: "";
  position: absolute;
  display: none;
}

.template-node[data-depth="0"]::after {
  display: none;
}

.template-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  padding-left: 28px;
}

.template-node:not([data-depth="0"]) .template-actions {
  padding-left: 28px;
}

.template-expand-btn,
.template-expand-spacer {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.template-expand-btn {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.template-expand-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 180ms ease;
}

.template-node[data-expanded="true"] .template-expand-btn svg {
  transform: rotate(90deg);
}

.template-expand-spacer {
  display: inline-block;
}

.chip {
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(20, 32, 48, 0.84);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  transition: 180ms ease;
}

.group-list .chip {
  width: min(100%, 220px);
  justify-content: flex-start;
  text-align: left;
  padding: 12px 13px;
  font-weight: 800;
  min-height: 44px;
  font-size: clamp(0.72rem, 0.9vw, 0.88rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-node[data-depth="0"] .template-chip {
  border-color: rgba(240, 196, 110, 0.32);
  background:
    linear-gradient(135deg, rgba(240, 196, 110, 0.17), rgba(19, 34, 52, 0.92));
  color: var(--brand-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.template-node[data-depth="1"] .template-chip {
  border-color: rgba(111, 182, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(111, 182, 255, 0.16), rgba(13, 35, 54, 0.82));
  color: #e4f5ff;
}

.template-node[data-depth="2"] .template-chip,
.template-node[data-depth="3"] .template-chip,
.template-node[data-depth="4"] .template-chip {
  border-color: rgba(118, 199, 165, 0.18);
  background:
    linear-gradient(135deg, rgba(118, 199, 165, 0.1), rgba(8, 18, 29, 0.82));
  color: #f0f6f4;
}

.template-chip {
  width: min(100%, 218px);
  position: relative;
  z-index: 1;
  display: block;
}

.template-chip.active {
  border-color: rgba(114, 214, 153, 0.72);
  background:
    linear-gradient(135deg, rgba(114, 214, 153, 0.28), rgba(20, 70, 55, 0.94));
  color: #dfffea;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(114, 214, 153, 0.18),
    0 14px 30px rgba(20, 174, 102, 0.2);
}

.template-chip.active::after {
  content: "selected";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(114, 214, 153, 0.42);
  background: rgba(29, 88, 64, 0.76);
  color: #9ef0bd;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.template-add-btn {
  border: 1px solid rgba(220, 229, 238, 0.14);
  background: rgba(20, 32, 48, 0.88);
  color: var(--brand-strong);
  border-radius: 12px;
  width: 31px;
  height: 31px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(20, 29, 41, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.template-clear-btn,
.template-edit-btn,
.template-delete-btn {
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(20, 32, 48, 0.86);
  color: var(--brand-strong);
  border-radius: 12px;
  width: 31px;
  height: 31px;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(20, 29, 41, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.template-clear-btn {
  width: auto;
  padding: 0 8px;
  color: var(--accent-strong);
  border-color: rgba(240, 196, 110, 0.24);
}

.template-clear-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.template-edit-btn {
  color: var(--brand);
}

.template-delete-btn {
  color: var(--danger);
  border-color: rgba(208, 100, 91, 0.26);
}

.template-edit-btn svg,
.template-delete-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 1;
  display: block;
}

.chip.active {
  background: linear-gradient(135deg, #f0c46e 0%, #d7a85a 100%);
  color: #07101a;
  border-color: transparent;
  box-shadow: 0 16px 30px rgba(215, 168, 90, 0.18);
}

.upload-zone {
  display: grid;
  gap: 8px;
  border: 1.5px dashed rgba(111, 182, 255, 0.32);
  border-radius: 20px;
  padding: 20px;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(25, 39, 58, 0.78), rgba(12, 22, 35, 0.68));
  cursor: pointer;
}

.upload-zone input {
  display: none;
}

.presentation-section {
  margin-top: 18px;
}

.filter-section {
  margin-top: 18px;
}

.compact-header {
  margin-bottom: 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.58fr);
  gap: 22px;
  min-height: 0;
  overflow: hidden;
}

.slide-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.storyboard {
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 16px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scroll-padding-top: 24px;
}

.slide-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.slide-card,
.story-item {
  border-radius: 26px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  background: linear-gradient(180deg, rgba(27, 40, 60, 0.88), rgba(13, 23, 36, 0.94));
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.deck-strip {
  margin-top: 18px;
}

.deck-pill {
  position: relative;
  width: 136px;
  padding: 9px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(27, 40, 60, 0.86), rgba(13, 23, 36, 0.92));
  border: 1px solid rgba(220, 229, 238, 0.1);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  border-top: 1px solid rgba(215, 168, 90, 0.24);
}

.deck-pill strong,
.deck-pill span {
  display: block;
}

.deck-pill.active {
  background: linear-gradient(180deg, rgba(111, 182, 255, 0.18), rgba(215, 168, 90, 0.14));
  border-color: rgba(111, 182, 255, 0.28);
}

.deck-pill-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  margin-bottom: 8px;
  background: linear-gradient(160deg, #172234 0%, #0b1421 100%);
}

.deck-pill strong {
  font-size: 0.82rem;
}

.deck-pill span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.deck-pill-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 0;
  background: rgba(7, 16, 26, 0.68);
  color: rgba(238, 243, 248, 0.82);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.78;
  backdrop-filter: blur(8px);
}

.deck-pill-delete:hover {
  background: rgba(208, 100, 91, 0.92);
  color: #fff;
  opacity: 1;
}

.deck-pill-delete svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  display: block;
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, #172234 0%, #0b1421 100%);
}

.slide-thumb,
.story-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-thumb {
  border-radius: 14px;
  min-height: 0;
  aspect-ratio: 16 / 9;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(160deg, #172234 0%, #0b1421 100%);
}

.add-slide-btn,
.primary-btn,
.secondary-btn,
.ghost-btn,
.mini-btn {
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: 160ms ease;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.mini-btn {
  padding: 12px 16px;
}

.add-slide-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: linear-gradient(135deg, #f0c46e 0%, #d7a85a 100%);
  color: #07101a;
  padding: 10px 14px;
  box-shadow: 0 16px 28px rgba(23, 50, 78, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  min-height: 42px;
  white-space: nowrap;
  max-width: calc(100% - 24px);
}

.slide-card-added {
  border-color: rgba(118, 199, 165, 0.26);
  background:
    linear-gradient(180deg, rgba(27, 40, 60, 0.76), rgba(13, 23, 36, 0.9)),
    linear-gradient(135deg, rgba(118, 199, 165, 0.08), rgba(111, 182, 255, 0.04));
}

.slide-card-added .thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(118, 199, 165, 0.08), rgba(8, 16, 27, 0.02));
}

.slide-card-added .add-slide-btn {
  background: linear-gradient(135deg, rgba(6, 16, 27, 0.88), rgba(11, 28, 39, 0.9));
  color: #f4fbf8;
  border-color: rgba(118, 199, 165, 0.48);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.add-slide-check {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  color: #06101b;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
}

.add-slide-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-slide-count {
  min-width: 34px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0c46e 0%, #d7a85a 100%);
  color: #07101a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(243, 91, 4, 0.18);
  flex: 0 0 auto;
}

.primary-btn {
  background: linear-gradient(135deg, #f0c46e 0%, #d7a85a 100%);
  color: #07101a;
  box-shadow: 0 16px 30px rgba(215, 168, 90, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.secondary-btn {
  background: linear-gradient(135deg, rgba(111, 182, 255, 0.16), rgba(111, 182, 255, 0.24));
  color: var(--brand-strong);
  border: 1px solid rgba(111, 182, 255, 0.18);
  box-shadow: 0 14px 26px rgba(118, 120, 237, 0.16);
}

.ghost-btn,
.mini-btn {
  background: rgba(20, 32, 48, 0.78);
  border: 1px solid rgba(220, 229, 238, 0.12);
  color: var(--brand-strong);
}

.story-actions {
  gap: 8px;
}

.story-actions .mini-btn {
  min-width: 82px;
  padding: 11px 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  border-width: 1.5px;
  background: rgba(20, 32, 48, 0.92);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-actions .icon-btn {
  min-width: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  border-color: rgba(111, 182, 255, 0.34);
  color: var(--brand-strong);
  background:
    linear-gradient(180deg, rgba(31, 45, 66, 0.98), rgba(13, 23, 36, 0.96));
}

.story-actions .icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
  flex: 0 0 auto;
}

.story-actions .move-up-btn,
.story-actions .move-down-btn {
  color: var(--brand-strong);
  border-color: rgba(111, 182, 255, 0.28);
}

.story-actions .remove-story-btn {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(159, 63, 53, 0.22);
}

.ghost-btn:hover,
.secondary-btn:hover,
.primary-btn:hover,
.mini-btn:hover,
.chip:hover,
.filter-chip:hover,
.add-slide-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(20, 29, 41, 0.1);
}

.story-item {
  padding: 12px;
  flex: 0 0 auto;
  min-height: 250px;
}

.story-item-focus {
  border-color: rgba(240, 196, 110, 0.48);
  box-shadow:
    0 0 0 1px rgba(240, 196, 110, 0.14),
    0 18px 42px rgba(240, 196, 110, 0.12);
}

.sidebar .panel {
  padding: 20px;
}

.sidebar .panel h2 {
  font-size: 1.2rem;
}

.sidebar .helper-row {
  gap: 8px;
}

.sidebar .secondary-btn,
.sidebar .ghost-btn {
  padding: 10px 14px;
  font-size: 0.88rem;
}

.sidebar .template-node {
  padding: 10px 9px 10px calc(10px + (var(--template-depth, 0) * 12px));
}

.sidebar .template-node:not([data-depth="0"]) {
  margin-left: calc(26px + ((var(--template-depth, 1) - 1) * 12px));
  padding-left: 9px;
}

.sidebar .group-list .chip {
  padding: 11px 12px;
  min-height: 40px;
  font-size: clamp(0.68rem, 0.82vw, 0.82rem);
}

.sidebar .template-add-btn,
.sidebar .template-clear-btn,
.sidebar .template-edit-btn,
.sidebar .template-delete-btn {
  width: 29px;
  height: 29px;
}

.sidebar .template-clear-btn {
  width: auto;
  min-width: 44px;
  padding: 0 7px;
  font-size: 0.66rem;
}

.sidebar .template-edit-btn svg,
.sidebar .template-delete-btn svg {
  width: 14px;
  height: 14px;
}

.workspace-grid > .column:last-child .section-header h3 {
  font-size: 1.5rem;
}

.workspace-grid > .column:last-child .eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.workspace-grid > .column:last-child .ghost-btn,
.workspace-grid > .column:last-child .mini-btn {
  padding: 10px 16px;
  font-size: 0.86rem;
}

#clearStoryboardBtn {
  min-height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(111, 182, 255, 0.16), rgba(111, 182, 255, 0.24));
  border: 1px solid rgba(111, 182, 255, 0.18);
  color: var(--brand-strong);
  box-shadow: 0 14px 26px rgba(118, 120, 237, 0.16);
  white-space: nowrap;
}

.workspace-grid > .column:last-child .stat-pill {
  padding: 8px 10px;
  font-size: 0.78rem;
}

.workspace-grid > .column:last-child .story-actions {
  gap: 6px;
}

.workspace-grid > .column:last-child .story-actions .mini-btn {
  min-width: 0;
  padding: 0;
  font-size: 0.8rem;
}

.workspace-grid > .column:last-child .story-actions .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.workspace-grid > .column:last-child .story-actions .icon-btn svg {
  width: 17px;
  height: 17px;
}

.workspace-grid > .column:last-child .story-title-input,
.workspace-grid > .column:last-child .story-position-field {
  font-size: 0.74rem;
}

.slide-source,
.story-step {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.73rem;
  color: var(--brand);
}

.mini-field {
  display: grid;
  gap: 6px;
  width: 100%;
}

.danger-link {
  color: var(--danger);
  background: transparent;
  border: 0;
  padding: 0;
}

.search-field {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.search-row {
  align-items: end;
  justify-content: flex-end;
  width: min(100%, 380px);
  margin-left: auto;
}

#addFullPresentationBtn {
  flex-basis: 100%;
  width: 100%;
  margin-left: 0;
  padding: 10px 14px;
  font-size: 0.82rem;
}

#addFullPresentationBtn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.search-field.active input {
  border-color: rgba(111, 182, 255, 0.52);
  background: rgba(11, 20, 33, 0.96);
  box-shadow: 0 0 0 3px rgba(111, 182, 255, 0.12);
}

.stats-bar {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.advanced-filters {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.filter-facet {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  background: linear-gradient(180deg, rgba(27, 40, 60, 0.84), rgba(13, 23, 36, 0.88));
  box-shadow: var(--shadow-soft);
}

.filter-facet-title {
  margin: 0 0 12px;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(20, 32, 48, 0.84);
  border-radius: 999px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  transition: 160ms ease;
}

.filter-chip strong {
  min-width: 22px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(111, 182, 255, 0.12);
  color: var(--brand-strong);
  font-size: 0.76rem;
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(111, 182, 255, 0.95) 0%, rgba(57, 105, 150, 0.95) 100%);
  border-color: transparent;
  color: #06101b;
}

.filter-chip.active strong {
  background: rgba(6, 16, 27, 0.16);
  color: #06101b;
}

.stat-pill {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(118, 120, 237, 0.16);
  color: var(--brand-strong);
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid rgba(118, 120, 237, 0.10);
}

.preview-modal[hidden] {
  display: none;
}

.auth-modal,
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

#loginRoleModal {
  z-index: 1105;
}

.auth-backdrop,
.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 12, 0.78);
  backdrop-filter: blur(10px);
}

.auth-dialog,
.preview-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: rgba(13, 23, 36, 0.98);
  border: 1px solid rgba(220, 229, 238, 0.12);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
  border-radius: 28px;
  padding: 20px;
}

.auth-dialog {
  width: min(430px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
}

.auth-dialog h3 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.auth-field {
  margin-top: 0;
}

.auth-error {
  margin: -4px 0 0;
  color: #ffd2cf;
  font-size: 0.86rem;
  font-weight: 800;
}

.dialog-message {
  white-space: normal;
}

.dialog-content {
  display: grid;
  gap: 12px;
}

.dialog-text-input {
  width: 100%;
}

.danger-confirm-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  color: #fff;
  background: var(--danger);
  box-shadow: 0 14px 28px rgba(208, 100, 91, 0.2);
}

.auth-actions {
  justify-content: flex-end;
}

.preview-topbar,
.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.preview-topbar .helper-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-add-btn-added {
  background: linear-gradient(135deg, rgba(92, 180, 126, 0.32), rgba(49, 111, 78, 0.38));
  border-color: rgba(120, 218, 158, 0.72);
  color: #ebfff2;
  box-shadow: 0 16px 32px rgba(49, 111, 78, 0.24);
}

.preview-add-btn-added:hover {
  border-color: rgba(154, 237, 188, 0.88);
  color: #f4fff7;
}

.preview-add-btn-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.preview-add-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(8, 21, 33, 0.46);
  border: 1px solid rgba(154, 237, 188, 0.36);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.preview-stage {
  margin-top: 18px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, #172234 0%, #0b1421 100%);
  border: 1px solid rgba(220, 229, 238, 0.1);
}

.preview-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0b1421;
}

.preview-meta {
  margin-top: 16px;
}

.import-dialog {
  width: min(760px, calc(100vw - 32px));
}

.editor-dialog {
  width: min(1400px, calc(100vw - 32px));
}

.import-db-form {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.import-db-profiles {
  display: grid;
  gap: 10px;
}

.editor-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.editor-viewport,
.editor-sidebar {
  border-radius: 24px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  background: rgba(20, 32, 48, 0.72);
}

.editor-viewport {
  padding: 16px;
  overflow: auto;
}

.editor-sidebar {
  padding: 16px;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.editor-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.editor-stage-shell {
  position: relative;
  width: 100%;
}

.editor-stage-surface {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: top left;
  background: #0b1421;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.editor-stage-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

.editor-image-override {
  position: absolute;
  z-index: 1;
}

.editor-image-override-frame {
  position: absolute;
  overflow: hidden;
  pointer-events: auto;
  transform-origin: center;
  z-index: 1;
  cursor: grab;
  touch-action: none;
  outline: 2px dashed rgba(255, 255, 255, 0.55);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(11, 20, 33, 0.28);
  transition: outline-color 140ms ease, box-shadow 140ms ease;
}

.editor-image-override-frame:hover {
  outline-color: rgba(245, 196, 91, 0.92);
  box-shadow: inset 0 0 0 1px rgba(245, 196, 91, 0.45);
}

.editor-image-override-frame.dragging {
  cursor: grabbing;
  outline-color: rgba(245, 196, 91, 0.98);
  box-shadow: inset 0 0 0 2px rgba(245, 196, 91, 0.52);
}

.editor-image-drag-hint {
  margin-top: 0.75rem;
}

.editor-image-sidebar-preview {
  margin-top: 0.75rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.editor-image-sidebar-preview img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.editor-inline-heading {
  margin-top: 1rem;
}

.editor-upload-zone {
  margin-top: 0.5rem;
  padding: 0.9rem;
}

.team-member-search-field {
  margin-top: 0.85rem;
}

.team-member-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.team-member-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 14px;
  padding: 0.55rem;
  display: grid;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}

.team-member-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.team-member-card span {
  font-size: 0.86rem;
  line-height: 1.25;
  word-break: break-word;
}

.team-member-card small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  word-break: break-word;
}

.import-team-library {
  margin-top: 1rem;
}

.team-member-admin-card .team-member-delete-btn {
  width: 100%;
}

.team-photo-card .thumb-wrap {
  aspect-ratio: 1 / 1;
}

.team-photo-card .slide-thumb {
  object-fit: cover;
}

.team-photo-caption {
  padding: 12px 14px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--brand-strong);
  word-break: break-word;
}

.editor-shape-mask {
  position: absolute;
  pointer-events: none;
  border-radius: 6px;
  z-index: 1;
}

.editor-shape {
  position: absolute;
  resize: none;
  overflow: hidden;
  border: 1px dashed rgba(111, 182, 255, 0.28);
  background: transparent;
  padding: 0;
  line-height: 1.15;
  white-space: pre-wrap;
  z-index: 2;
}

.editor-shape:focus {
  outline: none;
  border-color: var(--brand);
  background: transparent;
  box-shadow: 0 0 0 2px rgba(111, 182, 255, 0.16);
}

.editor-shape.align-center {
  display: flex;
  align-items: center;
}

.editor-shape.align-bottom {
  display: flex;
  align-items: flex-end;
}

@media (max-width: 760px) {
  .preview-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    padding: 16px;
    border-radius: 22px;
  }

  .preview-topbar,
  .preview-meta {
    display: grid;
  }
}

.empty-state {
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  border: 1.5px dashed rgba(220, 229, 238, 0.14);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}

.story-item-header,
.story-grid {
  display: grid;
  gap: 10px;
}

.story-item-header {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.story-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
  align-items: start;
}

.story-title-input,
.story-position-input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(111, 182, 255, 0.16);
  background: rgba(8, 16, 27, 0.82);
  color: var(--ink);
}

.story-title-input {
  min-height: 44px;
  padding: 9px 11px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  resize: none;
  overflow: hidden;
}

.story-position-field {
  display: grid;
  gap: 6px;
  width: 116px;
  max-width: 116px;
}

.story-position-field span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.story-position-input {
  height: 34px;
  padding: 7px 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--brand-strong);
}

.story-grid {
  grid-template-columns: 1fr;
  height: clamp(150px, 22vh, 210px);
  min-height: 150px;
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .app-shell,
  .workspace-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    overflow: visible;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    height: auto;
    overflow: visible;
    display: block;
  }

  .column {
    overflow: visible;
  }

  .group-list {
    display: grid;
    max-height: none;
    overflow: visible;
  }

  .template-node {
    width: auto;
  }
}

@media (max-width: 760px) {
  .sidebar,
  .workspace {
    padding: 18px;
  }

  .hero,
  .panel,
  .column {
    padding: 18px;
    border-radius: 20px;
  }

  .section-header,
  .panel-heading,
  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }
}


body[data-theme="light"] .session-bar,
body[data-theme="light"] .hero,
body[data-theme="light"] .review-inbox,
body[data-theme="light"] .panel,
body[data-theme="light"] .slide-card,
body[data-theme="light"] .story-item,
body[data-theme="light"] .presentation-section,
body[data-theme="light"] .filter-section,
body[data-theme="light"] .deck-chip,
body[data-theme="light"] .review-notification,
body[data-theme="light"] .search-field input,
body[data-theme="light"] .field input,
body[data-theme="light"] .field select,
body[data-theme="light"] .field textarea,
body[data-theme="light"] .admin-users,
body[data-theme="light"] .storyboard,
body[data-theme="light"] .slide-grid,
body[data-theme="light"] .deck-strip,
body[data-theme="light"] .advanced-filters {
  background-color: rgba(230, 236, 249, 0.84);
  color: var(--ink);
  border-color: rgba(61, 52, 139, 0.1);
}

body[data-theme="light"] .session-bar,
body[data-theme="light"] .hero,
body[data-theme="light"] .panel,
body[data-theme="light"] .review-inbox,
body[data-theme="light"] .story-item,
body[data-theme="light"] .slide-card,
body[data-theme="light"] .search-field input,
body[data-theme="light"] .field input,
body[data-theme="light"] .field select,
body[data-theme="light"] .field textarea,
body[data-theme="light"] .ghost-btn,
body[data-theme="light"] .secondary-btn,
body[data-theme="light"] .template-tree-toggle,
body[data-theme="light"] .admin-toggle-btn,
body[data-theme="light"] .mini-btn,
body[data-theme="light"] .review-notification {
  box-shadow: var(--shadow-soft);
}

body[data-theme="light"] .ghost-btn,
body[data-theme="light"] .secondary-btn,
body[data-theme="light"] .template-tree-toggle,
body[data-theme="light"] .admin-toggle-btn,
body[data-theme="light"] .mini-btn {
  background: rgba(255, 250, 243, 0.88);
  color: var(--ink);
  border-color: rgba(61, 52, 139, 0.12);
}

body[data-theme="light"] .primary-btn,
body[data-theme="light"] .toolbar-icon-btn-primary {
  color: #3d348b;
}

body[data-theme="light"] .eyebrow {
  color: #b6792c;
}

body[data-theme="light"] .review-notification:hover,
body[data-theme="light"] .ghost-btn:hover,
body[data-theme="light"] .secondary-btn:hover,
body[data-theme="light"] .template-tree-toggle:hover,
body[data-theme="light"] .admin-toggle-btn:hover,
body[data-theme="light"] .mini-btn:hover {
  background: rgba(244, 237, 226, 0.98);
}


html[data-theme="light"] body,
body[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] .session-bar,
html[data-theme="light"] .hero,
html[data-theme="light"] .panel,
html[data-theme="light"] .review-inbox,
html[data-theme="light"] .presentation-section,
html[data-theme="light"] .filter-section,
html[data-theme="light"] .slide-card,
html[data-theme="light"] .story-item,
html[data-theme="light"] .review-notification,
html[data-theme="light"] .search-field input,
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .template-tree-toggle,
html[data-theme="light"] .ghost-btn,
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .admin-toggle-btn,
html[data-theme="light"] .mini-btn {
  color: #3d348b;
  border-color: rgba(61, 52, 139, 0.12);
}

html[data-theme="light"] .session-bar,
html[data-theme="light"] .hero,
html[data-theme="light"] .panel,
html[data-theme="light"] .review-inbox,
html[data-theme="light"] .presentation-section,
html[data-theme="light"] .filter-section,
html[data-theme="light"] .slide-card,
html[data-theme="light"] .story-item,
html[data-theme="light"] .review-notification,
html[data-theme="light"] .search-field input,
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea {
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(244, 236, 225, 0.95));
}

html[data-theme="light"] .template-node,
html[data-theme="light"] .story-thumb-wrap,
html[data-theme="light"] .thumb-wrap,
html[data-theme="light"] .story-preview-box {
  background: linear-gradient(180deg, rgba(250, 244, 235, 0.98), rgba(239, 230, 217, 0.94));
}

html[data-theme="light"] .template-chip,
html[data-theme="light"] .group-list .chip,
html[data-theme="light"] .deck-chip,
html[data-theme="light"] .active-path-crumb,
html[data-theme="light"] .template-tree-selection-cue {
  background: rgba(244, 230, 203, 0.9);
  color: #f18701;
  border-color: rgba(197, 138, 47, 0.24);
}

html[data-theme="light"] .review-notification:hover,
html[data-theme="light"] .template-node:hover,
html[data-theme="light"] .ghost-btn:hover,
html[data-theme="light"] .secondary-btn:hover,
html[data-theme="light"] .mini-btn:hover,
html[data-theme="light"] .admin-toggle-btn:hover,
html[data-theme="light"] .template-tree-toggle:hover {
  background: linear-gradient(180deg, rgba(247, 240, 229, 0.98), rgba(238, 229, 216, 0.96));
}


html[data-theme="light"] .session-bar {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(244, 236, 225, 0.94));
  border-color: rgba(61, 52, 139, 0.1);
}

html[data-theme="light"] .session-avatar-wrap {
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(233, 239, 250, 0.95));
  border-color: rgba(61, 52, 139, 0.14);
}

html[data-theme="light"] .session-avatar-fallback {
  color: #313b82;
}

html[data-theme="light"] .session-user-role {
  color: #62709a;
}

html[data-theme="light"] .hero {
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.98), rgba(243, 235, 223, 0.95));
  border-color: rgba(215, 168, 90, 0.18);
}

html[data-theme="light"] .review-inbox,
html[data-theme="light"] .panel,
html[data-theme="light"] .presentation-section,
html[data-theme="light"] .filter-section,
html[data-theme="light"] .storyboard,
html[data-theme="light"] .admin-users,
html[data-theme="light"] .advanced-filters,
html[data-theme="light"] .slide-grid,
html[data-theme="light"] .deck-strip {
  background-color: transparent;
}

html[data-theme="light"] .template-node {
  border-color: rgba(61, 52, 139, 0.1);
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(220, 226, 243, 0.94));
  box-shadow: 0 10px 28px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .template-node:not([data-depth="0"]) {
  background: linear-gradient(180deg, rgba(250, 244, 235, 0.98), rgba(239, 231, 219, 0.94));
  border-color: rgba(118, 120, 237, 0.12);
  box-shadow: inset 2px 0 0 rgba(118, 120, 237, 0.18), 0 10px 24px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .template-node[data-depth="0"] {
  border-color: rgba(197, 138, 47, 0.22);
  box-shadow: inset 3px 0 0 rgba(197, 138, 47, 0.78), 0 12px 28px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .template-node[data-depth="1"] {
  border-color: rgba(118, 120, 237, 0.16);
  box-shadow: inset 2px 0 0 rgba(118, 120, 237, 0.28), 0 10px 24px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .template-node[data-depth="2"],
html[data-theme="light"] .template-node[data-depth="3"],
html[data-theme="light"] .template-node[data-depth="4"] {
  border-color: rgba(167, 201, 87, 0.14);
  box-shadow: inset 2px 0 0 rgba(167, 201, 87, 0.24), 0 10px 24px rgba(61, 52, 139, 0.07);
}

html[data-theme="light"] .template-node[data-selected="true"] {
  background: linear-gradient(180deg, rgba(239, 246, 243, 0.98), rgba(232, 242, 235, 0.95));
  border-color: rgba(167, 201, 87, 0.34);
  box-shadow: inset 3px 0 0 rgba(167, 201, 87, 0.92), 0 0 0 1px rgba(167, 201, 87, 0.12), 0 12px 30px rgba(167, 201, 87, 0.12);
}

html[data-theme="light"] .template-chip,
html[data-theme="light"] .chip,
html[data-theme="light"] .group-list .chip {
  color: #3d348b;
  border-color: rgba(61, 52, 139, 0.12);
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(243, 239, 255, 0.96));
}

html[data-theme="light"] .template-node[data-depth="0"] .template-chip {
  border-color: rgba(197, 138, 47, 0.28);
  background: linear-gradient(180deg, rgba(251, 239, 210, 0.95), rgba(246, 229, 192, 0.94));
  color: #f18701;
}

html[data-theme="light"] .template-node[data-depth="1"] .template-chip {
  border-color: rgba(118, 120, 237, 0.22);
  background: linear-gradient(180deg, rgba(220, 226, 243, 0.96), rgba(212, 219, 239, 0.94));
  color: #5f61c8;
}

html[data-theme="light"] .template-node[data-depth="2"] .template-chip,
html[data-theme="light"] .template-node[data-depth="3"] .template-chip,
html[data-theme="light"] .template-node[data-depth="4"] .template-chip {
  border-color: rgba(167, 201, 87, 0.18);
  background: linear-gradient(180deg, rgba(234, 246, 238, 0.96), rgba(221, 240, 228, 0.94));
  color: #2f6a4a;
}

html[data-theme="light"] .template-chip.active {
  background: linear-gradient(180deg, rgba(77, 161, 113, 0.16), rgba(77, 161, 113, 0.24));
  border-color: rgba(167, 201, 87, 0.44);
  color: #1f5138;
}

html[data-theme="light"] .template-chip.active::after {
  background: rgba(167, 201, 87, 0.18);
  border-color: rgba(167, 201, 87, 0.24);
  color: #2f6a4a;
}

html[data-theme="light"] .template-add-btn,
html[data-theme="light"] .template-clear-btn,
html[data-theme="light"] .template-edit-btn,
html[data-theme="light"] .template-delete-btn,
html[data-theme="light"] .admin-toggle-btn {
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(221, 227, 244, 0.95));
  border-color: rgba(61, 52, 139, 0.12);
  color: #5f61c8;
  box-shadow: 0 8px 18px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .template-clear-btn {
  color: #a06a19;
  border-color: rgba(197, 138, 47, 0.28);
}

html[data-theme="light"] .template-delete-btn {
  color: #c35d56;
  border-color: rgba(205, 106, 95, 0.22);
}

html[data-theme="light"] .deck-pill,
html[data-theme="light"] .slide-card,
html[data-theme="light"] .story-item {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(212, 219, 239, 0.96));
  border-color: rgba(61, 52, 139, 0.12);
  box-shadow: 0 14px 32px rgba(61, 52, 139, 0.1);
}

html[data-theme="light"] .deck-pill.active {
  background: linear-gradient(180deg, rgba(226, 231, 246, 0.97), rgba(224, 230, 247, 0.96));
  border-color: rgba(118, 120, 237, 0.24);
}

html[data-theme="light"] .deck-pill strong,
html[data-theme="light"] .slide-card strong,
html[data-theme="light"] .story-item strong,
html[data-theme="light"] .deck-pill,
html[data-theme="light"] .story-item,
html[data-theme="light"] .slide-card {
  color: #3d348b;
}

html[data-theme="light"] .deck-pill span,
html[data-theme="light"] .story-item span,
html[data-theme="light"] .slide-card span,
html[data-theme="light"] .story-position-field span {
  color: #6f70c9;
}

html[data-theme="light"] .deck-pill-thumb,
html[data-theme="light"] .thumb-wrap,
html[data-theme="light"] .story-thumb,
html[data-theme="light"] .story-preview-box {
  background: linear-gradient(180deg, rgba(210, 218, 238, 0.96), rgba(198, 208, 230, 0.92));
}

html[data-theme="light"] .deck-pill-delete {
  background: rgba(230, 236, 249, 0.84);
  border-color: rgba(61, 52, 139, 0.1);
  color: #6f70c9;
}

html[data-theme="light"] .add-slide-btn,
html[data-theme="light"] .primary-btn {
  background: linear-gradient(135deg, #f0c46e 0%, #d7a85a 100%);
  color: #3d348b;
  border-color: rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .ghost-btn,
html[data-theme="light"] .mini-btn,
html[data-theme="light"] .story-actions .mini-btn,
html[data-theme="light"] .story-actions .icon-btn {
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(221, 227, 244, 0.95));
  color: #3d348b;
  border-color: rgba(61, 52, 139, 0.12);
  box-shadow: 0 10px 22px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .slide-card-added {
  background: linear-gradient(180deg, rgba(239, 246, 243, 0.98), rgba(230, 240, 235, 0.95));
  border-color: rgba(167, 201, 87, 0.26);
}

html[data-theme="light"] .slide-card-added .add-slide-btn {
  background: linear-gradient(180deg, rgba(239, 246, 243, 0.98), rgba(238, 245, 232, 0.95));
  color: #2f6a4a;
  border-color: rgba(167, 201, 87, 0.28);
  box-shadow: 0 12px 24px rgba(167, 201, 87, 0.1);
}

html[data-theme="light"] .search-field input,
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .story-position-input,
html[data-theme="light"] .story-title-input {
  background: rgba(255, 252, 247, 0.98);
  color: #3d348b;
  border-color: rgba(61, 52, 139, 0.12);
}

html[data-theme="light"] .review-notification {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(245, 242, 255, 0.95));
  border-color: rgba(61, 52, 139, 0.1);
}

html[data-theme="light"] .review-notification strong {
  color: #3d348b;
}

html[data-theme="light"] .review-notification span {
  color: #6f70c9;
}

html[data-theme="light"] .sidebar .review-notification {
  grid-template-columns: 1fr;
  align-items: start;
}

html[data-theme="light"] .sidebar .review-complete-btn {
  justify-self: start;
}

html[data-theme="light"] .admin-user-row {
  background: linear-gradient(180deg, rgba(241, 236, 228, 0.98), rgba(229, 221, 208, 0.94));
  border-color: rgba(61, 52, 139, 0.1);
}

html[data-theme="light"] .admin-user-row strong {
  color: #3d348b;
}

html[data-theme="light"] .admin-user-row span {
  color: #a7c957;
}

html[data-theme="light"] .preview-dialog,
html[data-theme="light"] .review-deck-dialog,
html[data-theme="light"] .editor-dialog {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(212, 219, 239, 0.96));
  color: #3d348b;
}

html[data-theme="light"] .preview-topbar,
html[data-theme="light"] .editor-layout,
html[data-theme="light"] .editor-sidebar,
html[data-theme="light"] .preview-meta {
  color: #3d348b;
}

html[data-theme="light"] .preview-tag,
html[data-theme="light"] .deck-chip,
html[data-theme="light"] .stats-bar .chip {
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(221, 227, 244, 0.95));
  color: #3d348b;
  border-color: rgba(61, 52, 139, 0.12);
}


html[data-theme="light"] .search-field input::placeholder,
html[data-theme="light"] .field input::placeholder,
html[data-theme="light"] .field textarea::placeholder {
  color: #8b98aa;
}

html[data-theme="light"] .search-field.active input {
  background: rgba(255, 252, 247, 1);
  border-color: rgba(118, 120, 237, 0.34);
  box-shadow: 0 0 0 3px rgba(118, 120, 237, 0.1);
}

html[data-theme="light"] #addFullPresentationBtn,
html[data-theme="light"] #clearStoryboardBtn,
html[data-theme="light"] #clearSearchBtn,
html[data-theme="light"] #clearFiltersBtn,
html[data-theme="light"] .review-complete-btn {
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(221, 227, 244, 0.95));
  color: #3d348b;
  border: 1px solid rgba(61, 52, 139, 0.12);
  box-shadow: 0 10px 22px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] #addFullPresentationBtn:disabled {
  background: linear-gradient(180deg, rgba(242, 239, 255, 0.96), rgba(239, 231, 220, 0.88));
  color: #a0acba;
  border-color: rgba(61, 52, 139, 0.08);
  opacity: 1;
}

html[data-theme="light"] .deck-pill {
  position: relative;
}

html[data-theme="light"] .deck-pill.active::after {
  content: "✓";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(92, 189, 132, 0.96), rgba(167, 201, 87, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.78);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  z-index: 2;
  box-shadow: 0 10px 22px rgba(167, 201, 87, 0.24);
}

html[data-theme="light"] .deck-pill.active {
  border-color: rgba(167, 201, 87, 0.62);
  box-shadow: 0 0 0 3px rgba(167, 201, 87, 0.18), 0 18px 36px rgba(61, 52, 139, 0.12);
}

html[data-theme="light"] .deck-pill.active strong {
  color: #3d348b;
}

html[data-theme="light"] .deck-pill.active .deck-pill-thumb {
  box-shadow: 0 0 0 2px rgba(167, 201, 87, 0.12);
}

html[data-theme="light"] .deck-pill-delete {
  top: 8px;
  right: 8px;
}

html[data-theme="light"] .filter-facet {
  border-color: rgba(61, 52, 139, 0.1);
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(212, 219, 239, 0.96));
  box-shadow: 0 14px 30px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .filter-facet-title {
  color: #6f70c9;
}

html[data-theme="light"] .filter-chip {
  border-color: rgba(61, 52, 139, 0.12);
  background: linear-gradient(180deg, rgba(232, 237, 250, 0.98), rgba(221, 227, 244, 0.95));
  color: #3d348b;
}

html[data-theme="light"] .filter-chip strong {
  background: rgba(118, 120, 237, 0.1);
  color: #5f61c8;
}

html[data-theme="light"] .filter-chip.active {
  background: linear-gradient(180deg, rgba(226, 231, 246, 0.97), rgba(238, 228, 215, 0.96));
  border-color: rgba(118, 120, 237, 0.22);
  color: #3d348b;
}

html[data-theme="light"] .filter-chip.active strong {
  background: rgba(118, 120, 237, 0.14);
  color: #3d348b;
}

html[data-theme="light"] .sidebar .review-notification {
  gap: 10px;
}

html[data-theme="light"] .sidebar .review-notification-open {
  gap: 8px;
}

html[data-theme="light"] .sidebar .review-complete-btn {
  margin-top: 2px;
}

html[data-theme="light"] .toolbar-icon-btn::after {
  background: rgba(236, 241, 252, 0.97);
  border-color: rgba(61, 52, 139, 0.12);
  color: #3d348b;
  box-shadow: 0 12px 24px rgba(61, 52, 139, 0.1);
}


html[data-theme="light"] .ghost-btn,
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .primary-btn,
html[data-theme="light"] .mini-btn,
html[data-theme="light"] .template-tree-toggle,
html[data-theme="light"] .admin-toggle-btn,
html[data-theme="light"] .template-add-btn,
html[data-theme="light"] .template-clear-btn,
html[data-theme="light"] .template-edit-btn,
html[data-theme="light"] .template-delete-btn,
html[data-theme="light"] .theme-toggle-slider {
  border-width: 1.5px;
  border-color: rgba(61, 52, 139, 0.18);
}

html[data-theme="light"] .primary-btn {
  border-color: rgba(197, 138, 47, 0.34);
}

html[data-theme="light"] .template-tree-toggle,
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .ghost-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 22px rgba(61, 52, 139, 0.08);
}


html[data-theme="light"] .toolbar-icon-btn,
html[data-theme="light"] .ghost-btn,
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .primary-btn,
html[data-theme="light"] .mini-btn,
html[data-theme="light"] .template-tree-toggle,
html[data-theme="light"] .template-add-btn,
html[data-theme="light"] .template-clear-btn,
html[data-theme="light"] .template-edit-btn,
html[data-theme="light"] .template-delete-btn,
html[data-theme="light"] .admin-toggle-btn,
html[data-theme="light"] .review-complete-btn,
html[data-theme="light"] .theme-toggle-slider {
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

html[data-theme="light"] .toolbar-icon-btn,
html[data-theme="light"] .ghost-btn,
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .mini-btn,
html[data-theme="light"] .template-tree-toggle,
html[data-theme="light"] .template-add-btn,
html[data-theme="light"] .template-clear-btn,
html[data-theme="light"] .template-edit-btn,
html[data-theme="light"] .template-delete-btn,
html[data-theme="light"] .admin-toggle-btn,
html[data-theme="light"] .review-complete-btn {
  background: linear-gradient(180deg, rgba(226, 232, 246, 0.9), rgba(221, 227, 243, 0.92));
  border-color: rgba(61, 52, 139, 0.14);
  color: #3d348b;
  box-shadow:
    inset 0 1px 0 rgba(226, 232, 246, 0.9),
    inset 0 -1px 0 rgba(118, 120, 237, 0.32),
    0 8px 20px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .toolbar-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

html[data-theme="light"] .toolbar-icon-btn svg,
html[data-theme="light"] .template-edit-btn svg,
html[data-theme="light"] .template-delete-btn svg,
html[data-theme="light"] .story-actions .icon-btn svg,
html[data-theme="light"] .mini-btn svg {
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45));
}

html[data-theme="light"] .toolbar-icon-btn:hover,
html[data-theme="light"] .ghost-btn:hover,
html[data-theme="light"] .secondary-btn:hover,
html[data-theme="light"] .mini-btn:hover,
html[data-theme="light"] .template-tree-toggle:hover,
html[data-theme="light"] .template-add-btn:hover,
html[data-theme="light"] .template-clear-btn:hover,
html[data-theme="light"] .template-edit-btn:hover,
html[data-theme="light"] .template-delete-btn:hover,
html[data-theme="light"] .admin-toggle-btn:hover,
html[data-theme="light"] .review-complete-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(228, 234, 247, 0.92),
    inset 0 -1px 0 rgba(118, 120, 237, 0.28),
    0 12px 24px rgba(61, 52, 139, 0.1);
}

html[data-theme="light"] .primary-btn,
html[data-theme="light"] .toolbar-icon-btn-primary,
html[data-theme="light"] .add-slide-btn {
  background: linear-gradient(180deg, #f7b801 0%, #f35b04 100%);
  color: #3b2d21;
  border-color: rgba(241, 135, 1, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 172, 0.88),
    inset 0 -1px 0 rgba(241, 135, 1, 0.18),
    0 10px 24px rgba(243, 91, 4, 0.18);
}

html[data-theme="light"] .toolbar-icon-btn-primary svg,
html[data-theme="light"] .primary-btn svg {
  color: #3b2d21;
}

html[data-theme="light"] .theme-toggle-slider {
  background: linear-gradient(180deg, rgba(226, 232, 246, 0.9), rgba(214, 221, 240, 0.94));
  border-color: rgba(61, 52, 139, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(226, 232, 246, 0.9),
    inset 0 -1px 0 rgba(118, 120, 237, 0.28),
    0 8px 20px rgba(61, 52, 139, 0.08);
}

html[data-theme="light"] .theme-toggle-knob {
  background: linear-gradient(180deg, #ffffff 0%, #f0f1ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(228, 234, 247, 0.92),
    0 8px 18px rgba(61, 52, 139, 0.12);
}

html[data-theme="light"] .theme-toggle input:checked + .theme-toggle-slider .theme-toggle-knob {
  background: linear-gradient(180deg, #f7b801 0%, #f18701 100%);
}

html[data-theme="light"] .template-tree-toggle {
  border-radius: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

html[data-theme="light"] .story-actions .icon-btn,
html[data-theme="light"] .template-add-btn,
html[data-theme="light"] .template-edit-btn,
html[data-theme="light"] .template-delete-btn {
  border-radius: 14px;
}

html[data-theme="light"] .review-complete-btn {
  font-weight: 700;
  letter-spacing: -0.01em;
}


.compact-review-summary {
  display: block;
  padding: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.review-list-items {
  display: grid;
  gap: 14px;
  max-height: min(65vh, 720px);
  overflow: auto;
}

.review-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 35, 52, 0.9), rgba(14, 22, 34, 0.96));
  box-shadow: var(--shadow-soft);
}

.review-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

html[data-theme="light"] .review-list-item {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(212, 219, 239, 0.96));
  border-color: rgba(61, 52, 139, 0.12);
}


.review-inbox-body-static {
  display: grid;
  gap: 10px;
}

.review-inbox-open-btn {
  width: 100%;
  justify-content: center;
}

.review-list-dialog {
  width: min(980px, calc(100vw - 32px));
}

.review-list-body {
  display: grid;
  gap: 14px;
}


.template-tree-clear-btn {
  border: 1px solid rgba(240, 196, 110, 0.3);
  background: rgba(240, 196, 110, 0.1);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: 180ms ease;
}

.template-tree-clear-btn:hover {
  background: rgba(240, 196, 110, 0.18);
  border-color: rgba(240, 196, 110, 0.45);
}

html[data-theme="light"] .template-tree-clear-btn {
  border-color: rgba(61, 52, 139, 0.18);
  background: rgba(118, 120, 237, 0.08);
  color: #3d348b;
}


.template-tree-heading-row {
  display: grid;
  gap: 10px;
}


.template-tree-heading-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.template-tree-add-btn {
  white-space: nowrap;
}

.template-tree-panel[data-selection-state="active"] .template-tree-heading-top {
  grid-template-columns: 1fr;
}

.template-tree-panel[data-selection-state="active"] .template-tree-add-btn,
.template-tree-panel[data-selection-state="active"] .template-tree-clear-btn {
  width: 100%;
  justify-content: center;
}


.template-tree-selection-actions {
  display: grid;
  gap: 10px;
}

.template-tree-select-all-btn {
  border: 1px solid rgba(118, 120, 237, 0.26);
  background: rgba(118, 120, 237, 0.12);
  color: var(--brand);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: 180ms ease;
}

.template-tree-select-all-btn:hover {
  background: rgba(118, 120, 237, 0.18);
  border-color: rgba(118, 120, 237, 0.42);
}

.template-tree-panel[data-selection-state="active"] .template-tree-selection-actions {
  display: grid;
  gap: 10px;
}

.template-tree-panel[data-selection-state="active"] .template-tree-select-all-btn {
  width: 100%;
  justify-content: center;
}

html[data-theme="light"] .template-tree-select-all-btn {
  border-color: rgba(61, 52, 139, 0.18);
  background: rgba(118, 120, 237, 0.08);
  color: #3d348b;
}


.logo-library-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.logo-library-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-height: min(72vh, 760px);
}

.logo-library-sidebar,
.logo-library-main {
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 24px;
  background: rgba(16, 28, 42, 0.44);
  padding: 18px;
  min-height: 0;
}

.logo-library-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.logo-library-main {
  overflow: hidden;
}

.logo-search-field {
  width: 100%;
}

.logo-search-field input {
  width: 100%;
}

.logo-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: min(64vh, 680px);
  overflow: auto;
}

.logo-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: linear-gradient(180deg, rgba(24, 35, 52, 0.9), rgba(14, 22, 34, 0.96));
  box-shadow: var(--shadow-soft);
}

.logo-card.selected {
  border-color: rgba(167, 201, 87, 0.58);
  box-shadow: 0 0 0 1px rgba(167, 201, 87, 0.22), var(--shadow-soft);
}

.logo-card-select {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  gap: 10px;
  text-align: left;
}

.logo-card-preview-wrap {
  height: 116px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.logo-card-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-card-meta {
  display: grid;
  gap: 4px;
}

.logo-card-meta strong {
  font-size: 0.95rem;
}

.logo-card-meta span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  word-break: break-word;
}

.logo-card-actions {
  display: flex;
  justify-content: flex-end;
}

.logo-upload-zone {
  min-height: 148px;
}

html[data-theme="light"] .logo-library-sidebar,
html[data-theme="light"] .logo-library-main,
html[data-theme="light"] .logo-card {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(223, 229, 245, 0.95));
  border-color: rgba(61, 52, 139, 0.12);
}

html[data-theme="light"] .logo-card-preview-wrap {
  background: rgba(255, 255, 255, 0.98);
}

@media (max-width: 980px) {
  .logo-library-layout {
    grid-template-columns: 1fr;
  }

  .brief-format-options {
    grid-template-columns: 1fr;
  }
}


.logo-preview-dialog {
  width: min(1120px, calc(100vw - 32px));
}


.brief-dialog {
  width: min(1360px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  overflow-x: hidden;
}

.brief-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 300px;
  gap: 18px;
}

.brief-dialog .preview-topbar {
  flex-wrap: wrap;
}

.brief-dialog .preview-topbar > div:first-child {
  min-width: 0;
}

.brief-dialog .preview-topbar .helper-row {
  width: 100%;
  justify-content: flex-end;
}

.brief-completion-summary {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 22px;
  background: rgba(16, 28, 42, 0.38);
}

.brief-completion-copy,
.brief-completion-label,
.brief-completion-hint {
  margin: 0;
}

.brief-completion-copy {
  display: grid;
  gap: 6px;
}

.brief-completion-label {
  color: var(--text);
  font-weight: 700;
}

.brief-completion-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.brief-completion-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(118, 134, 188, 0.16);
}

.brief-completion-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, hsl(var(--brief-progress-hue, 0) 70% 58%) 0%, hsl(var(--brief-progress-hue, 0) 68% 42%) 100%);
}

#createBriefSubmitBtn[data-locked="true"] {
  background: linear-gradient(135deg, rgba(130, 140, 166, 0.9), rgba(102, 112, 138, 0.92));
  color: rgba(246, 248, 252, 0.9);
  box-shadow: none;
  border-color: rgba(220, 229, 238, 0.14);
}

.brief-grid,
.brief-sidebar {
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 24px;
  background: rgba(16, 28, 42, 0.44);
  padding: 20px;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.brief-field-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brief-step-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
  border: 1px solid rgba(220, 229, 238, 0.14);
  background: rgba(31, 44, 64, 0.9);
  color: var(--muted);
}

.brief-field.is-empty .brief-step-badge,
.brief-guidance-item.is-empty .brief-step-badge {
  background: rgba(208, 100, 91, 0.2);
  border-color: rgba(208, 100, 91, 0.44);
  color: #ffb9b2;
}

.brief-field.is-complete .brief-step-badge,
.brief-guidance-item.is-complete .brief-step-badge {
  background: rgba(118, 199, 165, 0.2);
  border-color: rgba(118, 199, 165, 0.44);
  color: #c9f6e3;
}

.brief-field.is-empty > span:last-of-type,
.brief-field.is-empty .brief-field-label > span:last-child {
  color: #ffb9b2;
}

.brief-field.is-complete > span:last-of-type,
.brief-field.is-complete .brief-field-label > span:last-child {
  color: var(--ink);
}

.brief-field.is-empty select {
  color: var(--muted);
  font-weight: 400;
}

.brief-field.is-complete select {
  color: var(--ink);
}

html[data-theme="light"] .brief-field.is-empty select {
  color: #8190ad;
}

.brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle {
  color: var(--muted);
}

.brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle svg {
  fill: currentColor;
}

.brief-field.is-complete #briefPracticeGroupSelect .brief-multiselect-toggle {
  color: var(--ink);
}

html[data-theme="light"] .brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle {
  color: #8190ad;
}

html[data-theme="light"] .brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle svg {
  fill: currentColor;
}

.brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle,
.brief-field.is-empty #briefGeographySelect .brief-multiselect-toggle {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle span:first-child,
.brief-field.is-empty #briefGeographySelect .brief-multiselect-toggle span:first-child {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.brief-field.is-empty #briefGeographySelect .brief-multiselect-toggle svg {
  fill: currentColor;
}

html[data-theme="light"] .brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle,
html[data-theme="light"] .brief-field.is-empty #briefGeographySelect .brief-multiselect-toggle {
  color: #8190ad;
}

html[data-theme="light"] .brief-field.is-empty #briefPracticeGroupSelect .brief-multiselect-toggle span:first-child,
html[data-theme="light"] .brief-field.is-empty #briefGeographySelect .brief-multiselect-toggle span:first-child {
  color: #8190ad;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

html[data-theme="light"] .brief-field.is-empty #briefGeographySelect .brief-multiselect-toggle svg {
  fill: currentColor;
}

.brief-field input,
.brief-field textarea,
.brief-field select,
.brief-field .brief-multiselect-toggle,
.brief-field .brief-multiselect-toggle span:first-child {
  font-size: 0.94rem;
  line-height: 1.45;
}

.brief-field-wide {
  grid-column: 1 / -1;
}

.brief-field-note {
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.brief-format-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brief-format-btn {
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(7, 16, 26, 0.64);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.brief-format-btn:hover {
  border-color: rgba(118, 131, 187, 0.28);
  color: var(--ink);
}

.brief-format-btn[data-selected="true"] {
  border-color: rgba(118, 199, 165, 0.34);
  background: rgba(84, 184, 135, 0.16);
  color: #c9f6e3;
}

.brief-field-note-wide {
  grid-column: 1 / -1;
  max-width: none;
}

html[data-theme="light"] .brief-field-note {
  color: #8190ad;
}

html[data-theme="light"] .brief-format-btn {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.99), rgba(245, 239, 227, 0.98));
  color: #596b9d;
  border-color: rgba(99, 116, 183, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .brief-format-btn:hover {
  color: #25326f;
  border-color: rgba(83, 101, 173, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(240, 236, 228, 0.98));
}

html[data-theme="light"] .brief-format-btn[data-selected="true"] {
  background: linear-gradient(135deg, rgba(219, 247, 231, 0.99), rgba(191, 233, 207, 0.98));
  border-color: rgba(57, 148, 104, 0.4);
  color: #1c6f4b;
  box-shadow: 0 8px 18px rgba(86, 165, 116, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.brief-multiselect {
  position: relative;
}

.brief-native-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}


.brief-search-select {
  position: relative;
}

.brief-search-input {
  width: 100%;
  min-height: 56px;
  padding: 0 46px 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(7, 16, 26, 0.64);
  color: var(--ink);
}

.brief-search-clear {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.brief-search-clear[hidden] {
  display: none !important;
}

.brief-search-clear:hover {
  background: rgba(220, 229, 238, 0.12);
  color: var(--ink);
}

.brief-search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

#briefPriority[data-priority="low"],
#briefDeadline[data-priority="low"] {
  border-color: rgba(82, 155, 255, 0.46);
  background: linear-gradient(135deg, rgba(76, 126, 255, 0.22), rgba(12, 28, 54, 0.82));
  color: #dbe9ff;
}

#briefPriority[data-priority="standard"],
#briefDeadline[data-priority="standard"] {
  border-color: rgba(100, 206, 137, 0.42);
  background: linear-gradient(135deg, rgba(88, 186, 118, 0.22), rgba(10, 33, 24, 0.82));
  color: #e8fff0;
}

#briefPriority[data-priority="high"],
#briefDeadline[data-priority="high"] {
  border-color: rgba(255, 176, 76, 0.46);
  background: linear-gradient(135deg, rgba(255, 170, 64, 0.24), rgba(54, 30, 6, 0.82));
  color: #fff0db;
}

#briefPriority[data-priority="urgent"],
#briefDeadline[data-priority="urgent"] {
  border-color: rgba(236, 97, 97, 0.5);
  background: linear-gradient(135deg, rgba(222, 78, 78, 0.26), rgba(56, 11, 11, 0.84));
  color: #ffe3e3;
}

.brief-search-select[data-open="true"] .brief-search-input {
  box-shadow: 0 0 0 3px rgba(95, 120, 255, 0.14);
}

.brief-search-empty {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(31, 44, 64, 0.42);
}

html[data-theme="light"] .brief-search-input {
  background: rgba(255, 253, 248, 0.98);
  color: #313b82;
  border-color: rgba(118, 131, 187, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .brief-search-clear {
  color: #8190ad;
}

html[data-theme="light"] .brief-search-clear:hover {
  background: rgba(118, 131, 187, 0.12);
  color: #313b82;
}

html[data-theme="light"] .brief-search-input::placeholder {
  color: #8190ad;
}

html[data-theme="light"] #briefPriority[data-priority="low"],
html[data-theme="light"] #briefDeadline[data-priority="low"] {
  border-color: rgba(74, 129, 227, 0.28);
  background: linear-gradient(135deg, rgba(232, 240, 255, 0.98), rgba(214, 228, 255, 0.96));
  color: #3356a6;
}

html[data-theme="light"] #briefPriority[data-priority="standard"],
html[data-theme="light"] #briefDeadline[data-priority="standard"] {
  border-color: rgba(84, 168, 112, 0.28);
  background: linear-gradient(135deg, rgba(234, 249, 239, 0.98), rgba(213, 243, 223, 0.96));
  color: #2f7a47;
}

html[data-theme="light"] #briefPriority[data-priority="high"],
html[data-theme="light"] #briefDeadline[data-priority="high"] {
  border-color: rgba(222, 146, 58, 0.28);
  background: linear-gradient(135deg, rgba(255, 244, 225, 0.98), rgba(255, 232, 196, 0.96));
  color: #a45a10;
}

html[data-theme="light"] #briefPriority[data-priority="urgent"],
html[data-theme="light"] #briefDeadline[data-priority="urgent"] {
  border-color: rgba(206, 92, 92, 0.3);
  background: linear-gradient(135deg, rgba(255, 236, 236, 0.98), rgba(255, 218, 218, 0.96));
  color: #a63c3c;
}

html[data-theme="light"] .brief-search-empty {
  background: rgba(244, 248, 255, 0.96);
  color: #8190ad;
}

#briefPracticeGroupSelect .brief-multiselect-menu {
  max-height: 420px;
}

.brief-multiselect-toggle {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(7, 16, 26, 0.64);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  font-size: 0.94rem;
  line-height: 1.45;
}
.brief-multiselect-toggle,
.brief-multiselect-option {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

#briefPracticeGroupSelect .brief-multiselect-menu {
  gap: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(90, 105, 165, 0.18);
  box-shadow: 0 18px 36px rgba(62, 77, 131, 0.18);
}

#briefPracticeGroupSelect .brief-multiselect-option {
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: #27325f;
  padding: 12px 14px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

#briefPracticeGroupSelect .brief-multiselect-option:hover {
  background: rgba(69, 92, 185, 0.08);
  border-color: rgba(69, 92, 185, 0.12);
}

#briefPracticeGroupSelect .brief-multiselect-option[data-selected="true"] {
  background: linear-gradient(135deg, #2b78d1 0%, #255fba 100%);
  border-color: rgba(30, 78, 154, 0.5);
  color: #f7fbff;
  box-shadow: 0 10px 22px rgba(37, 95, 186, 0.22);
}

#briefPracticeGroupSelect .brief-multiselect-option[data-selected="true"] .brief-multiselect-check {
  color: #ffffff;
}

#briefPracticeGroupSelect .brief-multiselect-check {
  color: #4d63c7;
}

html[data-theme="light"] #briefPracticeGroupSelect .brief-multiselect-toggle {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(250, 247, 240, 0.98));
  color: #33408d;
  border-color: rgba(118, 131, 187, 0.18);
}

html[data-theme="light"] #briefPracticeGroupSelect .brief-multiselect-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.98));
  border-color: rgba(92, 108, 168, 0.18);
}

.brief-multiselect-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.brief-multiselect-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(16, 28, 42, 0.96);
  box-shadow: var(--shadow-soft);
}

.brief-multiselect-menu[hidden] {
  display: none;
}

.brief-multiselect-option {
  width: 100%;
  border: 1px solid rgba(220, 229, 238, 0.1);
  border-radius: 14px;
  background: rgba(31, 44, 64, 0.72);
  color: var(--ink);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
}

.brief-multiselect-option[data-selected="true"] {
  border-color: rgba(118, 199, 165, 0.4);
  background: rgba(118, 199, 165, 0.14);
}

.brief-multiselect-check {
  width: 18px;
  text-align: center;
  color: var(--success);
  font-weight: 800;
}

.brief-sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
}

.brief-preview-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 24px;
  background: rgba(16, 28, 42, 0.44);
}

.brief-preview-panel-header {
  display: grid;
  gap: 12px;
}

.brief-preview-panel-wide {
  margin-top: 20px;
  gap: 18px;
  padding: 24px;
}

.brief-preview-panel-wide .brief-preview-panel-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.brief-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(220, 229, 238, 0.1);
  background: rgba(10, 18, 29, 0.58);
}

.brief-preview-stage-wide {
  min-height: 560px;
}

.brief-preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.brief-preview-empty,
.brief-preview-meta {
  margin: 0;
}

.brief-preview-controls,
.brief-preview-counter {
  margin: 0;
}

.brief-preview-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.brief-preview-panel-wide .brief-preview-controls {
  width: min(100%, 420px);
  max-width: 420px;
  justify-self: end;
}

.brief-preview-panel-wide .brief-preview-meta {
  max-width: 980px;
}

.brief-preview-controls .ghost-btn {
  min-width: 96px;
}

.brief-preview-counter {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.brief-preview-controls .ghost-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.brief-preview-empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.brief-preview-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.brief-sidebar h4 {
  margin: 0;
  font-size: 1.05rem;
}

.briefs-panel {
  display: grid;
  gap: 18px;
}

.briefs-search-block {
  display: grid;
  gap: 10px;
  width: min(100%, 560px);
}

.briefs-search-input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.12);
  background: rgba(7, 16, 26, 0.64);
  color: var(--ink);
  font: inherit;
}

.briefs-search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.briefs-search-input:focus {
  outline: none;
  border-color: rgba(118, 131, 187, 0.3);
  box-shadow: 0 0 0 3px rgba(95, 120, 255, 0.12);
}

.briefs-list {
  display: grid;
  gap: 14px;
}

.briefs-list-grouped {
  grid-template-columns: 1fr;
  gap: 24px;
}

.briefs-group {
  display: grid;
  gap: 14px;
}

.briefs-group-header h4,
.briefs-group-empty,
.brief-card-timestamp {
  margin: 0;
}

.briefs-group-header h4 {
  color: var(--text);
  font-size: 1.02rem;
}

.briefs-group-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.briefs-group-empty {
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 22px;
  background: rgba(16, 28, 42, 0.32);
  color: var(--muted);
  padding: 18px 20px;
}

@media (max-width: 980px) {
  .brief-preview-panel-wide .brief-preview-panel-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .brief-preview-panel-wide .brief-preview-controls {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .brief-preview-stage-wide {
    min-height: 360px;
  }
}

.brief-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(220, 229, 238, 0.12);
  border-radius: 22px;
  background: rgba(16, 28, 42, 0.44);
  padding: 18px 20px;
}

.brief-card-copy {
  display: grid;
  gap: 6px;
}

.brief-card-copy h4,
.brief-card-status,
.brief-card-meta {
  margin: 0;
}

.brief-card-status {
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.brief-card-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.brief-card-timestamp {
  color: var(--muted);
  font-size: 0.82rem;
}

.brief-card-progress,
.brief-card-progress-copy {
  margin: 0;
}

.brief-card-progress {
  display: grid;
  gap: 8px;
}

.brief-card-progress-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(118, 134, 188, 0.16);
}

.brief-card-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, hsl(var(--brief-progress-hue, 0) 70% 58%) 0%, hsl(var(--brief-progress-hue, 0) 68% 42%) 100%);
}

.brief-card-progress-copy {
  color: var(--muted);
  font-size: 0.82rem;
}

.brief-card-actions {
  align-self: end;
}

.brief-card-side {
  display: grid;
  gap: 14px;
  align-content: end;
  justify-items: start;
}

.brief-card--draft {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
}

.brief-card--draft .brief-card-side {
  align-self: stretch;
}

.brief-card--draft .brief-card-actions {
  align-self: start;
  justify-content: flex-start;
}

.brief-card--draft .open-brief-btn {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.brief-card--draft .open-brief-btn.is-ready {
  border-color: rgba(118, 199, 165, 0.3);
  background: rgba(84, 184, 135, 0.12);
  color: #c9f6e3;
}

.brief-card-side-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.brief-card--sent {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  align-items: start;
}

.brief-sent-eta-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(118, 199, 165, 0.18);
  background: rgba(84, 184, 135, 0.1);
}

.brief-sent-eta-label,
.brief-sent-eta-value,
.brief-sent-eta-copy {
  margin: 0;
}

.brief-sent-eta-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.brief-sent-eta-value {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
}

.brief-sent-eta-copy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.brief-card-actions--sent {
  justify-content: flex-end;
  width: 100%;
}

.brief-card-actions--sent .preview-sent-brief-btn {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

#briefModal[data-preview-only="true"] .brief-grid textarea,
#briefModal[data-preview-only="true"] .brief-grid input,
#briefModal[data-preview-only="true"] .brief-grid .brief-multiselect-toggle,
#briefModal[data-preview-only="true"] .brief-grid .brief-search-input,
#briefModal[data-preview-only="true"] .brief-grid .brief-format-btn,
#briefModal[data-preview-only="true"] .brief-grid select {
  cursor: default;
}

.brief-draft-readiness {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(220, 229, 238, 0.14);
  background: rgba(14, 24, 38, 0.32);
}

.brief-draft-readiness-title,
.brief-draft-readiness-copy {
  margin: 0;
}

.brief-draft-readiness-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.brief-draft-readiness-copy {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.brief-draft-readiness.is-ready {
  border-color: rgba(118, 199, 165, 0.32);
  background: rgba(84, 184, 135, 0.14);
}

.brief-draft-readiness.is-ready .brief-draft-readiness-title {
  color: #c9f6e3;
}

.brief-draft-readiness.is-pending {
  border-color: rgba(255, 183, 111, 0.22);
  background: rgba(255, 159, 67, 0.12);
}

.brief-draft-readiness.is-pending .brief-draft-readiness-title {
  color: #ffd7a3;
}

@media (max-width: 980px) {
  .brief-card--draft,
  .brief-card--sent {
    grid-template-columns: 1fr;
  }

  .brief-card--draft .brief-card-side,
  .brief-card--sent .brief-card-side {
    justify-items: stretch;
  }
}


.brief-guidance-list {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.brief-guidance-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.brief-guidance-copy {
  color: var(--muted);
  line-height: 1.55;
}

.brief-guidance-item.is-empty .brief-guidance-copy {
  color: #ffb9b2;
}

.brief-guidance-item.is-complete .brief-guidance-copy {
  color: #c9f6e3;
}

html[data-theme="light"] .brief-dialog {
  background:
    radial-gradient(circle at top left, rgba(255, 196, 115, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(246, 249, 255, 0.98), rgba(232, 238, 251, 0.96));
  border: 1px solid rgba(85, 99, 160, 0.14);
  box-shadow: 0 26px 60px rgba(71, 85, 141, 0.16);
}

html[data-theme="light"] .briefs-search-input {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(250, 247, 240, 0.98));
  color: #313b82;
  border-color: rgba(118, 131, 187, 0.18);
}

html[data-theme="light"] .briefs-search-input::placeholder {
  color: #8190ad;
}

html[data-theme="light"] .brief-grid,
html[data-theme="light"] .brief-sidebar,
html[data-theme="light"] .brief-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 246, 255, 0.94));
  border-color: rgba(78, 94, 156, 0.16);
  box-shadow: 0 12px 28px rgba(91, 107, 168, 0.08);
}

html[data-theme="light"] .brief-preview-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 246, 255, 0.94));
  border-color: rgba(78, 94, 156, 0.16);
  box-shadow: 0 12px 28px rgba(91, 107, 168, 0.08);
}

html[data-theme="light"] .brief-preview-stage {
  background: linear-gradient(180deg, rgba(233, 239, 252, 0.92), rgba(223, 230, 247, 0.94));
  border-color: rgba(78, 94, 156, 0.14);
}

html[data-theme="light"] .brief-preview-empty,
html[data-theme="light"] .brief-preview-meta,
html[data-theme="light"] .brief-preview-counter {
  color: #62709a;
}

html[data-theme="light"] .brief-completion-summary {
  background: linear-gradient(180deg, rgba(239, 243, 252, 0.96), rgba(230, 236, 248, 0.95));
  border-color: rgba(61, 52, 139, 0.12);
}

html[data-theme="light"] .brief-completion-label {
  color: #2d347d;
}

html[data-theme="light"] .brief-completion-hint {
  color: #62709a;
}

html[data-theme="light"] .brief-field-label,
html[data-theme="light"] .brief-card-copy h4,
html[data-theme="light"] .brief-sidebar h4,
html[data-theme="light"] #briefTitle {
  color: #2d347d;
}

html[data-theme="light"] .brief-card-meta,
html[data-theme="light"] .brief-card-timestamp,
html[data-theme="light"] .brief-card-progress-copy,
html[data-theme="light"] .brief-guidance-copy,
html[data-theme="light"] #briefStatus {
  color: #62709a;
}

html[data-theme="light"] .brief-card-status {
  color: #a45a11;
}

html[data-theme="light"] .brief-draft-readiness {
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(240, 245, 255, 0.94));
  border-color: rgba(78, 94, 156, 0.14);
}

html[data-theme="light"] .brief-draft-readiness-copy {
  color: #62709a;
}

html[data-theme="light"] .brief-card--draft .open-brief-btn.is-ready {
  border-color: rgba(65, 159, 128, 0.24);
  background: rgba(219, 247, 237, 0.98);
  color: #1f8f73;
}

html[data-theme="light"] .brief-card-side-note {
  color: #62709a;
}

html[data-theme="light"] .brief-sent-eta-card {
  background: linear-gradient(180deg, rgba(236, 250, 241, 0.98), rgba(223, 243, 230, 0.96));
  border-color: rgba(84, 168, 112, 0.24);
}

html[data-theme="light"] .brief-sent-eta-label,
html[data-theme="light"] .brief-sent-eta-copy {
  color: #62709a;
}

html[data-theme="light"] .brief-sent-eta-value {
  color: #2f7a47;
}

html[data-theme="light"] .brief-card-actions--sent .preview-sent-brief-btn {
  color: #313b82;
}

html[data-theme="light"] .brief-draft-readiness.is-ready {
  background: linear-gradient(180deg, rgba(232, 250, 242, 0.98), rgba(221, 243, 233, 0.96));
  border-color: rgba(65, 159, 128, 0.22);
}

html[data-theme="light"] .brief-draft-readiness.is-ready .brief-draft-readiness-title {
  color: #1f8f73;
}

html[data-theme="light"] .brief-draft-readiness.is-pending {
  background: linear-gradient(180deg, rgba(255, 246, 229, 0.98), rgba(255, 238, 209, 0.96));
  border-color: rgba(214, 142, 58, 0.22);
}

html[data-theme="light"] .brief-draft-readiness.is-pending .brief-draft-readiness-title {
  color: #b06a14;
}

html[data-theme="light"] .brief-step-badge {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 240, 253, 0.95));
  border-color: rgba(96, 117, 186, 0.22);
  color: #7482aa;
}

html[data-theme="light"] .brief-field.is-empty .brief-step-badge,
html[data-theme="light"] .brief-guidance-item.is-empty .brief-step-badge {
  background: rgba(255, 226, 220, 0.95);
  border-color: rgba(217, 122, 108, 0.44);
  color: #c56051;
}

html[data-theme="light"] .brief-field.is-complete .brief-step-badge,
html[data-theme="light"] .brief-guidance-item.is-complete .brief-step-badge {
  background: rgba(219, 247, 237, 0.98);
  border-color: rgba(65, 159, 128, 0.34);
  color: #1f8f73;
}

html[data-theme="light"] .brief-field.is-empty > span:last-of-type,
html[data-theme="light"] .brief-field.is-empty .brief-field-label > span:last-child,
html[data-theme="light"] .brief-guidance-item.is-empty .brief-guidance-copy {
  color: #d47161;
}

html[data-theme="light"] .brief-field.is-complete > span:last-of-type,
html[data-theme="light"] .brief-field.is-complete .brief-field-label > span:last-child,
html[data-theme="light"] .brief-guidance-item.is-complete .brief-guidance-copy {
  color: #1f8f73;
}

html[data-theme="light"] .brief-grid input,
html[data-theme="light"] .brief-grid select,
html[data-theme="light"] .brief-grid textarea,
html[data-theme="light"] .brief-multiselect-toggle {
  background: rgba(255, 253, 248, 0.98);
  color: #313b82;
  border-color: rgba(118, 131, 187, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .brief-grid input::placeholder,
html[data-theme="light"] .brief-grid textarea::placeholder {
  color: #8190ad;
}

html[data-theme="light"] .brief-multiselect-toggle svg,
html[data-theme="light"] .brief-grid select {
  color: #4956a3;
}

html[data-theme="light"] .brief-multiselect-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(92, 108, 168, 0.18);
  box-shadow: 0 18px 38px rgba(89, 104, 161, 0.18);
}

html[data-theme="light"] .brief-multiselect-option {
  background: rgba(244, 248, 255, 0.96);
  border-color: rgba(108, 123, 184, 0.14);
  color: #32408a;
}

html[data-theme="light"] .brief-multiselect-option[data-selected="true"] {
  background: rgba(223, 244, 237, 0.98);
  border-color: rgba(63, 154, 124, 0.34);
}

html[data-theme="light"] .brief-multiselect-check {
  color: #1f8f73;
}

@media (max-width: 980px) {
  .brief-layout {
    grid-template-columns: 1fr;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }
}

body[data-role="UBiller"] .sidebar,
body[data-role="UBiller"] .workspace-grid,
body[data-role="UBiller"] #adminPanel,
body[data-role="UBiller"] #reviewInbox {
  display: none !important;
}

body[data-role="UBiller"] .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-role="UBiller"] .workspace {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 18px;
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 32px;
  padding-bottom: 32px;
}

body[data-role="UBiller"] .hero {
  min-height: 120px;
  padding: 22px 26px;
  align-items: center;
  justify-content: space-between;
}

body[data-role="UBiller"] .hero-actions {
  justify-content: flex-end;
  align-items: center;
}

body[data-role="UBiller"] .hero-actions > *:not(#createBriefBtn) {
  display: none !important;
}

body[data-role="UBiller"] #createBriefBtn {
  display: inline-flex !important;
  min-width: 178px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  gap: 10px;
  background: linear-gradient(135deg, #f7b801 0%, #f18701 100%);
  border-color: transparent;
  color: #101826;
  box-shadow: 0 18px 34px rgba(241, 135, 1, 0.28);
}

body[data-role="UBiller"] #createBriefBtn svg {
  display: none;
}

body[data-role="UBiller"] #createBriefBtn .toolbar-btn-label {
  display: inline;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
}

body[data-role="UBiller"] .biller-hero-copy {
  display: grid !important;
  gap: 8px;
  justify-items: start;
  text-align: left;
}

body[data-role="UBiller"] .biller-hero-copy h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.08;
  max-width: 620px;
}

body[data-role="UBiller"] .biller-hero-copy .muted {
  font-size: 0.96rem;
  line-height: 1.5;
  max-width: 600px;
}

body[data-role="UBiller"] .workspace {
  overflow: auto;
}

body[data-role="UBiller"] .briefs-panel {
  display: grid !important;
  margin-top: 0;
  overflow: auto;
}

body[data-role="UBiller"] .briefs-list.briefs-list-grouped {
  grid-template-columns: 1fr;
}

body[data-role="UBiller"] .brief-card {
  min-height: 0;
  align-items: start;
}

body[data-role="UBiller"] .brief-card-actions {
  align-self: start;
}

body[data-role="UBiller"] .session-bar {
  width: 100%;
}

html[data-theme="light"] .brief-card {
  background: linear-gradient(180deg, rgba(236, 241, 252, 0.97), rgba(223, 229, 245, 0.95));
  border-color: rgba(61, 52, 139, 0.12);
}
