:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e8ebf2;
  --line-2: #f0f2f5;
  --text: #1d2129;
  --muted: #4e5969;
  --soft: #86909c;
  --primary: #4361ee;
  --primary-dark: #3651d9;
  --purple: #8b5cf6;
  --gradient: linear-gradient(135deg, #4361ee 0%, #8b5cf6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(67, 97, 238, 0.08), rgba(139, 92, 246, 0.08));
  --teal: #4361ee;
  --teal-2: rgba(67, 97, 238, 0.08);
  --amber: #ff7d00;
  --amber-2: rgba(255, 125, 0, 0.08);
  --red: #f53f3f;
  --red-2: rgba(245, 63, 63, 0.08);
  --blue: #3491fa;
  --success: #00b42a;
  --shadow: 0 2px 12px rgba(29, 33, 41, 0.06);
  --shadow-hover: 0 4px 20px rgba(67, 97, 238, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.release-version { color: var(--soft); font-size: 12px; margin: 0 0 12px; overflow-wrap: anywhere; }
.mobile-navigation-toggle { display:none !important; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

button,
a,
select,
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

input[type="checkbox"], input[type="radio"] {
  width:16px; height:16px; min-width:16px; min-height:16px; max-width:16px; max-height:16px;
  padding:0; margin:0; flex:0 0 16px; accent-color:var(--primary); cursor:pointer;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }

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

.login-screen {
  grid-column: 1 / -1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--gradient);
}

.login-panel {
  width: min(440px, 100%);
  background: white;
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.login-brand {
  border-bottom-color: var(--line);
  color: var(--text);
  padding: 0 0 16px;
}

.login-brand span {
  color: var(--muted);
}

#login-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

#login-form h1 {
  font-size: 25px;
}

#login-form p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.sidebar {
  background: #ffffff;
  color: var(--text);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gradient);
  color: white;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand span,
.sidebar-footer span {
  color: var(--soft);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-2);
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-context strong,
.sidebar-context span {
  display: block;
  max-width: 136px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-context strong {
  font-size: 13px;
}

.sidebar-context span {
  margin-top: 2px;
  color: var(--soft);
  font-size: 11px;
}

nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding: 10px 10px 16px;
}

.nav-section {
  padding: 0;
  border-radius: 10px;
}

.nav-section[open] {
  background: var(--surface-2);
}

.nav-section-title {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  list-style: none;
  user-select: none;
}

summary.nav-section-title {
  cursor: pointer;
}

summary.nav-section-title::-webkit-details-marker {
  display: none;
}

summary.nav-section-title::after {
  content: "›";
  margin-left: auto;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.15s ease;
}

.nav-section[open] > summary.nav-section-title::after {
  transform: rotate(90deg);
}

.nav-section-primary {
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
}

.nav-section-primary .nav-section-title {
  color: var(--text);
}

.nav-item {
  width: calc(100% - 8px);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 4px;
  padding: 0 12px;
  border: 0;
  border-left: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: var(--gradient-soft);
  color: var(--primary);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--primary);
  font-weight: 650;
}

.nav-ai-badge {
  margin-left: auto;
  border-radius: 4px;
  background: var(--gradient);
  color: white;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 650;
  line-height: 15px;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line-2);
  padding: 12px 18px 16px;
}

.sidebar-footer strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.sidebar-footer small {
  display: block;
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.main {
  min-width: 0;
  padding: 0 24px 34px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 -24px 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.topbar-title {
  min-width: 170px;
}

.topbar-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-ai-badge {
  border-radius: 8px;
  background: var(--gradient);
  color: white;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 650;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 760;
}

.topbar p,
.panel-head p {
  margin-top: 5px;
  color: var(--soft);
  font-size: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.client-select {
  min-width: 190px;
  font-weight: 700;
}

select,
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 6px;
  min-height: 38px;
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.primary,
.ghost {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}

.primary {
  background: var(--primary);
  color: white;
}

.primary:hover {
  background: var(--primary-dark);
}

.ghost {
  background: white;
  color: var(--muted);
  border-color: var(--line);
}

.ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 16px;
}

.agency-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 14px;
}

.agency-strip div {
  background: var(--gradient-soft);
  color: var(--text);
  border: 1px solid rgba(67, 97, 238, 0.1);
  border-radius: 10px;
  padding: 13px 15px;
}

.agency-strip span,
.agency-strip strong {
  display: block;
}

.agency-strip span {
  color: var(--soft);
  font-size: 12px;
}

.agency-strip strong {
  margin-top: 5px;
  font-size: 18px;
}

.kpi,
.panel {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: none;
}

.panel:hover,
.kpi:hover {
  box-shadow: var(--shadow);
}

.kpi {
  min-height: 118px;
  padding: 18px;
  border-top: 3px solid var(--line);
}

.kpi.good {
  border-top-color: var(--teal);
}

.kpi.warn {
  border-top-color: var(--amber);
}

.kpi.risk {
  border-top-color: var(--red);
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

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

.panel {
  padding: 18px;
}

.panel.wide,
.table-panel {
  grid-column: span 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.panel-head.compact {
  margin-bottom: 12px;
}

.panel h2 {
  font-size: 17px;
  line-height: 1.25;
}

.chart {
  height: 248px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 18px 6px 2px;
  border-top: 1px solid var(--line-2);
  background: repeating-linear-gradient(to top, transparent 0, transparent 47px, #eef2f3 48px);
}

.chart span {
  flex: 1;
  border-radius: 6px 6px 2px 2px;
  background: var(--gradient);
  min-height: 44px;
}

.model-list {
  display: grid;
  gap: 16px;
}

.model-row {
  display: grid;
  gap: 8px;
}

.model-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.model-row span {
  color: var(--muted);
}

.trend-chart {
  min-height: 250px;
  padding-top: 8px;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: 230px;
  overflow: visible;
}

.trend-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.trend-legend span::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  content: "";
}

.trend-legend .exposure::before {
  background: var(--primary);
}

.trend-legend .recommendation::before {
  background: var(--teal);
}

.trend-legend small {
  margin-left: auto;
}

.chart-grid {
  stroke: var(--line-2);
  stroke-width: 1;
}

.chart-y-label,
.chart-x-label {
  fill: var(--soft);
  font-size: 11px;
}

.trend-line {
  fill: none;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.trend-line.exposure,
.trend-point.exposure {
  stroke: var(--primary);
}

.trend-line.recommendation,
.trend-point.recommendation {
  stroke: var(--teal);
}

.trend-point {
  fill: white;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

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

.model-config-card,
.source-weight-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.model-config-card h3,
.source-weight-card h3 {
  font-size: 16px;
}

.model-test-status {
  color: var(--muted);
  line-height: 1.5;
}

.model-test-status.ready {
  color: var(--teal);
}

.model-test-status.failed {
  color: var(--red);
}

.compact-model-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.model-test-button {
  justify-self: start;
}

.model-test-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.source-weight-card label {
  grid-template-columns: 1fr 84px;
  align-items: center;
}

.access-control-panel {
  margin-bottom: 18px;
}

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

.access-users-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  margin-top: 18px;
}

.permission-card,
.permission-user-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

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

.permission-list .check-label {
  align-items: flex-start;
}

.permission-list span,
.permission-list small,
.table-panel td small {
  display: block;
}

.permission-list small,
.table-panel td small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.permission-user-form fieldset {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.permission-user-form legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.new-user-organization {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
}

.new-user-organization .check-label small {
  display: block;
  margin-top: 3px;
  color: var(--soft);
}

.new-user-organization-permissions {
  display: none;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-2);
}

.new-user-organization:has(> .check-label input:checked) .new-user-organization-permissions {
  display: grid;
}

.meter,
.mini-meter {
  height: 8px;
  background: #edf2f3;
  border-radius: 999px;
  overflow: hidden;
}

.meter i,
.mini-meter i {
  display: block;
  height: 100%;
  background: var(--teal);
}

.mini-meter {
  width: 86px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

th {
  background: #fafbfc;
  color: var(--muted);
  text-align: left;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
}

td {
  border-bottom: 1px solid var(--line-2);
  padding: 12px 8px;
  vertical-align: middle;
  color: #26343a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

td:first-child {
  width: 42%;
}

.selected-row td {
  background: rgba(67, 97, 238, 0.05);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-weight: 760;
  text-align: left;
}

.danger-link {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  font-weight: 760;
  text-align: left;
}

.tag,
.status,
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  background: rgba(52, 145, 250, 0.08);
  color: var(--blue);
}

.status.ok {
  background: rgba(0, 180, 42, 0.08);
  color: var(--success);
}

.status.mid {
  background: var(--amber-2);
  color: var(--amber);
}

.status.bad {
  background: var(--red-2);
  color: var(--red);
}

.insight-rail {
  grid-row: span 2;
}

.rec-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 10px;
  background: var(--surface-2);
}

.rec-card > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.priority {
  background: var(--gradient);
  color: white;
  min-width: 34px;
}

.rec-card h3 {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.35;
}

.rec-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.rec-card small {
  display: block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 12px;
}

.form-panel,
.report-page,
.draft {
  margin-top: 8px;
}

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

.storage-panel + .storage-panel { margin-top: 18px; }
.media-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.storage-panel .muted-line { margin: 18px 0; line-height: 1.7; }
.storage-panel .form-actions { gap: 10px; flex-wrap: wrap; }

.compact-form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

label span {
  font-weight: 700;
  color: var(--muted);
}

.span-2 {
  grid-column: span 2;
}

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

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

.library-case-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 15px;
}

.case-card-top,
.case-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.library-case-card h3 {
  font-size: 17px;
  line-height: 1.35;
}

.library-case-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-meta,
.case-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.case-meta span,
.case-tags span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  padding: 4px 7px;
  font-size: 12px;
}

.case-editor-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.span-3 {
  grid-column: 1 / -1;
}

.target-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.target-selector > strong {
  width: 100%;
}

.delivery-list {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.delivery-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  border-top: 1px solid var(--line-2);
  padding-top: 7px;
}

.delivery-list small,
.delivery-list a {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.delivery-list details { grid-column: 1 / -1; overflow-wrap: anywhere; }
.delivery-list summary { cursor: pointer; font-size: 13px; }
.delivery-list details small { display: block; margin-top: 6px; line-height: 1.65; }

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

.record-pagination { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:14px 0 0; margin-top:14px; border-top:1px solid var(--line); color:var(--soft); font-size:12px; }
.record-pagination > div { display:flex; gap:8px; }
.record-pagination button { min-height:34px; font-size:12px; }
[data-record-page] { min-width:0; }
.record-table-scroll { overflow-x:auto; max-width:100%; }
[data-record-page]:focus { outline:none; }
.page-loading { min-height:180px; display:grid; place-content:center; justify-items:center; gap:14px; color:var(--soft); }
.loading-bar { width:160px; height:6px; border-radius:6px; background:var(--gradient-soft); }

.gap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: #32434a;
  background: var(--surface-2);
}

.gap .icon {
  color: var(--amber);
}

.competitor {
  display: grid;
  grid-template-columns: 1fr 90px 90px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.competitor strong {
  font-size: 16px;
}

.competitor div span {
  display: block;
  font-size: 24px;
  font-weight: 780;
}

.competitor small,
.competitor p {
  color: var(--muted);
  font-size: 12px;
}

.competitor p {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}

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

.client-card strong,
.client-card span,
.client-card p {
  grid-column: 1 / -1;
}

.client-card strong {
  font-size: 20px;
}

.client-card span,
.client-card p,
.client-card small {
  color: var(--muted);
  font-size: 13px;
}

.client-card p {
  line-height: 1.65;
}

.client-card div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.client-card b,
.client-card small {
  display: block;
}

.client-card b {
  font-size: 24px;
}

pre {
  white-space: pre-wrap;
  margin: 0;
  background: #11191d;
  color: #ecf6f4;
  border-radius: 8px;
  padding: 18px;
  line-height: 1.7;
  font-size: 13px;
}

.report-block {
  border-top: 1px solid var(--line-2);
  padding: 18px 0 4px;
  min-width: 0;
  overflow-x: auto;
}

.report-block h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.report-block p,
.report-block li {
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

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

.report-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.report-metrics strong,
.report-metrics span,
.report-metrics small {
  display: block;
}

.report-metrics strong {
  font-size: 28px;
}

.report-metrics span,
.report-metrics small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.muted-line {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.geo-site-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.site-section-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.export-box {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid rgba(67, 97, 238, 0.2);
  border-radius: 8px;
  background: rgba(67, 97, 238, 0.05);
  padding: 13px;
}

.export-box.pending {
  border-color: var(--line);
  background: var(--surface-2);
}

.export-box span,
.export-box small {
  color: var(--muted);
  font-size: 13px;
}

.export-box a {
  color: var(--primary);
  font-weight: 760;
  text-decoration: none;
}

.publish-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.website-channel-summary,
.configured-accounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.website-channel-summary p,
.configured-accounts-head p,
.channel-filter-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.channel-account-panel {
  border-top: 1px solid var(--line);
}




.channel-filter-note {
  margin: 12px 0 0;
}

.channel-groups {
  display: grid;
  gap: 26px;
  padding: 22px 0 26px;
}

.channel-group h3 {
  margin-bottom: 12px;
  color: #66747a;
  font-size: 13px;
}

.channel-matrix {
  display: grid;
  grid-template-columns: repeat(10, minmax(72px, 1fr));
  gap: 10px;
}

.channel-card {
  min-width: 0;
  min-height: 104px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 5px;
  cursor: pointer;
}

.channel-card:hover,
.channel-card.active {
  border-color: var(--line);
  background: var(--surface-2);
}

.channel-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--channel-color);
  color: white;
  font-size: 17px;
  font-weight: 800;
}

.channel-card strong,
.channel-card small {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}

.channel-card strong {
  font-size: 12px;
}

.channel-card small {
  color: var(--muted);
  font-size: 10px;
}

.channel-card small.ready,
.account-state.ready {
  color: var(--success);
}

.channel-card small.pending,
.account-state.pending {
  color: var(--amber);
}

.account-state.off {
  color: var(--muted);
}

.configured-accounts-head {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 12px;
}

.configured-accounts-head h3 {
  font-size: 16px;
}

.channel-account-editor,
.distribution-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.channel-account-editor .form-actions {
  align-items: center;
  gap: 14px;
}

.adapter-hint {
  margin: 0;
  border-left: 3px solid var(--amber);
  background: var(--amber-2);
  color: #6b4e09;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
}

.site-content-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.publish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.publish-target-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.publish-target-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.publish-target-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.12);
}

.publish-target-item span,
.publish-target-item small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

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

.rich-editor-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.rich-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.rich-editor-head h3 {
  margin: 0;
  font-size: 16px;
}

.mini-button {
  min-height: 34px;
  padding: 7px 10px;
}

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

.rich-editor-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.rich-item-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rich-toolbar button {
  min-width: 32px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 760;
  cursor: pointer;
}

.rich-editor {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  line-height: 1.65;
  outline: none;
}

.rich-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

[data-rich-item="articleBody"] { grid-column: 1 / -1; min-width: 0; }
[data-rich-body="articleBody"] { min-height: 320px; max-height: 65vh; overflow: auto; overflow-wrap: anywhere; }
[data-rich-body="articleBody"] pre { white-space: pre-wrap; }
.omnipost-panel { grid-column: 1 / -1; }
.omnipost-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.omnipost-options .check-label { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.omnipost-options input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; margin-top: 3px; }
.omnipost-options small { display: block; font-weight: 400; line-height: 1.5; margin-top: 4px; }
.omnipost-options label:has(input:disabled) { opacity: .55; }

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.rich-editor p,
.rich-editor ul,
.rich-editor ol,
.rich-editor blockquote {
  margin: 0 0 8px;
}

.rich-editor ul,
.rich-editor ol {
  padding-left: 20px;
}

.rich-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.rich-editor th,
.rich-editor td {
  border: 1px solid var(--line);
  padding: 8px;
  min-width: 72px;
}

.rich-editor th {
  background: var(--surface-2);
}

.rich-editor figure {
  margin: 12px 0;
}

.rich-editor img,
.rich-editor video {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rich-editor figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.compact-empty {
  padding: 12px;
}

.publish-fields {
  display: contents;
}

.publish-fields[hidden] {
  display: none;
}

.check-label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 720;
}

.check-label input {
  width: 16px;
  height: 16px;
}

.publish-status {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 13px;
}

.publish-status span,
.publish-status small {
  color: var(--muted);
  font-size: 13px;
}

.publish-log-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.publish-log-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.publish-log-list span,
.publish-log-list small {
  color: var(--muted);
  font-size: 13px;
}

.ok-text {
  color: var(--success);
}

.bad-text {
  color: #b42318;
}

.site-section-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.site-section-list p {
  max-height: 180px;
  overflow: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin-top: 6px;
}

.site-preview-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  height: 560px;
}

.site-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.schema-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.schema-box summary {
  cursor: pointer;
  font-weight: 760;
}

.schema-box pre {
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
}

.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 22px;
  line-height: 1.7;
  background: var(--surface-2);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--gradient);
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.check-list,
.source-list {
  display: grid;
  gap: 10px;
}

.check-item,
.source-list article {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.check-item {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 6px 12px;
  align-items: start;
}

.check-item p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.check-item span {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.check-item.pass span {
  background: rgba(0, 180, 42, 0.08);
  color: var(--success);
}

.check-item.warn span {
  background: var(--amber-2);
  color: var(--amber);
}

.check-item.fail span {
  background: var(--red-2);
  color: var(--red);
}

.source-list article {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.source-list span,
.source-list small {
  color: var(--muted);
  font-size: 12px;
}

.source-list a {
  color: var(--blue);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.growth-input {
  margin: 8px 0 16px;
}

.growth-input label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.growth-input textarea {
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
}

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

.delivery-grid section {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.delivery-grid h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.delivery-grid article {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-top: 1px solid var(--line-2);
}

.delivery-grid article:first-of-type {
  border-top: 0;
}

.delivery-grid span,
.delivery-grid small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.strategy-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 24px;
  border: 1px solid #dfe7ff;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f6ff 68%, #eef2ff 100%);
  box-shadow: var(--shadow);
}

.strategy-hero h2 {
  margin: 7px 0 8px;
  font-size: 26px;
}

.strategy-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.strategy-score {
  width: 112px;
  height: 112px;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  border: 8px solid rgba(67, 97, 238, 0.12);
  border-radius: 50%;
  text-align: center;
}

.strategy-score strong {
  color: var(--primary);
  font-size: 31px;
}

.strategy-score span {
  color: var(--soft);
  font-size: 11px;
}

.canvas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.canvas-cell {
  min-height: 108px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.canvas-cell > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.canvas-cell > div > span {
  font-size: 13px;
  font-weight: 750;
}

.canvas-cell p {
  margin: 8px 0 0;
  max-height: 66px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.marketing-canvas .strategy-hero { padding: 16px 20px; margin-bottom: 12px; }
.marketing-canvas .panel { padding: 14px 18px; }
.marketing-canvas .panel-head { margin-bottom: 10px; }
.marketing-canvas .compact-kpis { margin: 12px 0 0; }
.marketing-canvas .canvas-cell .link-button { flex-shrink: 0; }
.marketing-canvas .canvas-cell p:focus-visible { outline: 2px solid var(--primary, #5367e8); outline-offset: 3px; }

.compact-kpis {
  margin: 14px 0;
}

.table-subline {
  display: block;
  margin-top: 4px;
  color: var(--soft);
}

.answer-evidence {
  margin-top: 8px;
  max-width: 460px;
}

.answer-evidence summary {
  color: var(--primary);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.answer-evidence pre {
  max-height: 280px;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 10px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.content-studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.content-library-panel,
.content-editor-panel {
  min-width: 0;
}

.content-editor-panel {
  position: sticky;
  top: 84px;
}

.workflow-builder {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  background: var(--surface-2);
}

.workflow-builder summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
}

#content-asset-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#content-asset-form > .workflow-builder,
#content-asset-form > label:has(.content-body-input),
#content-asset-form > .form-actions {
  grid-column: 1 / -1;
}

#content-asset-form [data-field="contentInstruction"] {
  min-height: 150px;
}

@media (max-width: 700px) {
  #content-asset-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.workflow-builder > p,
.workflow-builder > label,
.workflow-builder > button {
  margin-top: 12px;
}

.workflow-builder select,
.workflow-builder input,
.workflow-builder textarea {
  min-width: 0;
  max-width: 100%;
}

.workflow-patterns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

#keyword-preview-result {
  color: var(--teal);
  line-height: 1.7;
}

.content-asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.content-asset-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface-2);
}

.content-asset-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.content-asset-card h3 {
  font-size: 15px;
  line-height: 1.45;
}

.content-asset-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.content-body-input {
  min-height: 320px;
  resize: vertical;
  line-height: 1.65;
}

.source-domain-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.source-domain-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 12px;
}

.source-domain-list span {
  color: var(--muted);
}

.dependency-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.dependency-badge.live_ai {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.dependency-badge.ai_data,
.dependency-badge.ai_optional {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.09);
}

.dependency-badge.deterministic {
  color: var(--success);
  background: rgba(0, 180, 42, 0.08);
}

.dependency-badge.external_connector {
  color: var(--amber);
  background: var(--amber-2);
}

.dependency-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 180, 42, 0.16);
  border-radius: 8px;
  background: rgba(0, 180, 42, 0.05);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.dependency-note strong {
  color: var(--text);
}

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

.ai-platform-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.ai-platform-layout > .panel {
  min-width: 0;
}

.dependency-matrix > div {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 6px 10px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.dependency-matrix span:last-child {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.rec-card .mini-button {
  margin-top: 12px;
}

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

.asset-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface-2);
}

.asset-card img,
.asset-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.09), rgba(124, 58, 237, 0.08));
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.asset-card > div:last-child {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.asset-card span,
.asset-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnosis-report {
  display: grid;
  gap: 18px;
  color: #18213a;
}

.diagnosis-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 260px;
  overflow: hidden;
  padding: 34px 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 18%, rgba(122, 162, 255, 0.34), transparent 30%),
    linear-gradient(135deg, #111a38 0%, #203b89 56%, #5c4bc7 100%);
  box-shadow: 0 24px 60px rgba(36, 51, 112, 0.2);
  color: white;
}

.diagnosis-hero::after {
  position: absolute;
  right: -90px;
  bottom: -150px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.04), 0 0 0 84px rgba(255, 255, 255, 0.03);
  content: "";
}

.diagnosis-hero-copy,
.diagnosis-score-card,
.diagnosis-print {
  position: relative;
  z-index: 1;
}

.diagnosis-kicker {
  display: inline-block;
  margin-bottom: 22px;
  color: #b7ccff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.diagnosis-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.diagnosis-hero-copy > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.diagnosis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.diagnosis-meta span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.diagnosis-score-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  min-width: 164px;
  padding: 23px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.diagnosis-score-card small,
.diagnosis-score-card b {
  grid-column: 1 / -1;
}

.diagnosis-score-card small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.diagnosis-score-card strong {
  margin-top: 8px;
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.diagnosis-score-card > span {
  margin: 0 0 5px 8px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.diagnosis-score-card b {
  width: max-content;
  margin-top: 15px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbe7ff;
  color: #244595;
  font-size: 12px;
}

.diagnosis-score-card.excellent b,
.diagnosis-score-card.good b {
  background: #d9f7e8;
  color: #137a4d;
}

.diagnosis-score-card.poor b {
  background: #fff0d8;
  color: #a55500;
}

.diagnosis-print {
  position: absolute;
  right: 28px;
  bottom: 24px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.diagnosis-print:hover {
  border-color: white;
  color: white;
}

.diagnosis-overview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.45fr);
  gap: 16px;
}

.diagnosis-radar-card,
.diagnosis-dimension,
.diagnosis-section,
.diagnosis-data-strip,
.diagnosis-warning {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 26px rgba(29, 42, 86, 0.05);
}

.diagnosis-radar-card {
  display: grid;
  align-content: space-between;
  min-height: 470px;
  padding: 24px;
}

.diagnosis-radar-card h3 {
  margin: 8px 0 6px;
  font-size: 21px;
}

.diagnosis-radar-card p,
.diagnosis-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.diagnosis-section-no {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.diagnosis-radar {
  width: 100%;
  max-height: 360px;
}

.radar-grid polygon,
.radar-grid line {
  fill: rgba(67, 97, 238, 0.025);
  stroke: #dfe4f1;
  stroke-width: 1;
}

.radar-value {
  fill: rgba(75, 100, 238, 0.2);
  stroke: #4361ee;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.diagnosis-radar text {
  fill: #4e5969;
  font-size: 10px;
  font-weight: 700;
}

.diagnosis-dimension-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.diagnosis-dimension {
  padding: 18px;
}

.diagnosis-dimension:last-child {
  grid-column: 1 / -1;
}

.dimension-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
}

.dimension-head > span {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
}

.dimension-head h3 {
  margin: 0;
  font-size: 16px;
}

.dimension-head strong {
  font-size: 28px;
  letter-spacing: -0.05em;
}

.diagnosis-dimension > p {
  min-height: 36px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.dimension-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef0f5;
}

.dimension-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4361ee, #8b5cf6);
}

.dimension-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 12px;
}

.dimension-signals span {
  color: var(--soft);
  font-size: 10px;
}

.dimension-signals b {
  margin-right: 4px;
  color: var(--muted);
}

.diagnosis-data-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
}

.diagnosis-data-strip > div {
  padding: 18px 20px;
  border-right: 1px solid var(--line-2);
}

.diagnosis-data-strip > div:last-child {
  border-right: 0;
}

.diagnosis-data-strip span,
.diagnosis-data-strip strong {
  display: block;
}

.diagnosis-data-strip span {
  color: var(--soft);
  font-size: 11px;
}

.diagnosis-data-strip strong {
  margin-top: 6px;
  font-size: 25px;
}

.diagnosis-data-strip strong small {
  margin-left: 3px;
  color: var(--soft);
  font-size: 11px;
}

.diagnosis-warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px 20px;
  border-color: #f5d8ad;
  background: #fffaf2;
}

.diagnosis-warning > div:first-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #fff0d8;
  color: #b85d00;
}

.diagnosis-warning h3,
.diagnosis-warning p {
  margin: 0;
}

.diagnosis-warning h3 {
  margin-bottom: 5px;
  font-size: 14px;
}

.diagnosis-warning p {
  color: #7f592b;
  font-size: 12px;
  line-height: 1.65;
}

.diagnosis-section {
  padding: 24px;
}

.diagnosis-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.diagnosis-section-head h2 {
  margin: 6px 0 0;
  font-size: 22px;
}

.diagnosis-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.diagnosis-action-grid article {
  min-height: 190px;
  padding: 17px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fafbff);
}

.priority-chip {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 6px;
  background: #fff0ef;
  color: #c53a32;
  font-size: 10px;
  font-weight: 900;
}

.priority-chip.p1 {
  background: #fff4df;
  color: #aa6200;
}

.priority-chip.p2 {
  background: #edf2ff;
  color: #3651d9;
}

.diagnosis-action-grid small {
  display: block;
  margin-top: 16px;
  color: var(--primary);
  font-size: 11px;
}

.diagnosis-action-grid h3 {
  margin: 7px 0 9px;
  font-size: 14px;
  line-height: 1.45;
}

.diagnosis-action-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.diagnosis-plan article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fbfcff;
}

.diagnosis-plan article > span {
  color: #d6ddf2;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.diagnosis-plan small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.diagnosis-plan h3 {
  margin: 5px 0 9px;
  font-size: 15px;
}

.diagnosis-plan ul,
.chapter-grid ul {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

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

.chapter-grid details {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
}

.chapter-grid summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  cursor: pointer;
  list-style: none;
}

.chapter-grid summary::-webkit-details-marker {
  display: none;
}

.chapter-grid summary > span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
}

.chapter-grid summary strong {
  font-size: 13px;
}

.chapter-grid summary .icon {
  color: var(--soft);
  transition: transform 0.2s ease;
}

.chapter-grid details[open] summary .icon {
  transform: rotate(45deg);
}

.chapter-grid details > div {
  padding: 0 16px 16px 42px;
}

.chapter-grid details p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.agent-lead-workspace {
  margin-top: 18px;
}

.agent-lead-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
}

.agent-lead-count strong {
  font-size: 28px;
  color: var(--primary);
}

.agent-lead-count span {
  font-size: 12px;
}

.agent-lead-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 0.75fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--gradient-soft);
}

.agent-lead-filters label,
.agent-lead-followup-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.agent-lead-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.agent-lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 4px rgba(29, 33, 41, 0.04);
}

.agent-lead-card:hover {
  border-color: rgba(67, 97, 238, 0.28);
  box-shadow: var(--shadow-hover);
}

.agent-lead-summary {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.agent-lead-summary > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
}

.agent-lead-summary > div:first-child .status {
  grid-row: 1 / 3;
}

.agent-lead-summary h3 {
  font-size: 16px;
}

.agent-lead-summary strong {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.agent-lead-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.agent-lead-summary dl div,
.agent-lead-demand {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
}

.agent-lead-summary dt,
.agent-lead-demand span {
  color: var(--soft);
  font-size: 11px;
}

.agent-lead-summary dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.agent-lead-demand p {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-followup-history {
  border-top: 1px solid var(--line-2);
  padding-top: 11px;
}

.agent-followup-history summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.agent-followup-history > div {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.agent-followup-history article {
  padding-left: 12px;
  border-left: 2px solid rgba(67, 97, 238, 0.22);
}

.agent-followup-history article > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.agent-followup-history article p {
  margin: 4px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.agent-followup-history article small {
  color: var(--soft);
}

.agent-lead-followup-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border-radius: 9px;
  background: var(--surface-2);
}

.agent-lead-followup-form textarea {
  min-height: 120px;
}

.agent-lead-followup-form .primary {
  justify-self: end;
}

.agent-lead-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.agent-lead-pagination > div {
  display: flex;
  gap: 8px;
}

.agent-lead-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 860px) {
  body {
    min-width: 0;
  }

  #app {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-section {
    display: contents;
  }

  .nav-section-title {
    grid-column: 1 / -1;
    padding-left: 3px;
  }

  .nav-item {
    border-left: 0;
    border-radius: 6px;
    padding: 0 10px;
  }

  .nav-item.active {
    box-shadow: inset 3px 0 var(--primary);
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .topbar,
  .panel-head {
    height: auto;
    display: grid;
  }

  .toolbar,
  .kpi-grid,
  .agency-strip,
  .workspace-grid,
  .client-layout,
  .form-grid,
  .gap-grid,
  .competitor-grid,
  .content-grid,
  .case-library-grid,
  .case-form,
  .publish-grid,
  .publish-target-list,
  .canvas-grid,
  .content-studio-layout,
  .compact-model-fields,
  .role-permission-grid,
  .access-users-grid,
    .permission-list,
    .content-asset-list,
    .dependency-matrix,
    .asset-grid,
    .source-domain-list {
    grid-template-columns: 1fr;
    display: grid;
  }

  .diagnosis-hero,
  .diagnosis-overview-grid,
  .diagnosis-dimension-list,
  .diagnosis-data-strip,
  .diagnosis-action-grid,
  .diagnosis-plan,
  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .diagnosis-hero {
    padding: 26px 22px 82px;
  }

  .diagnosis-score-card {
    width: 164px;
    margin-top: 22px;
  }

  .diagnosis-print {
    right: auto;
    bottom: 22px;
    left: 22px;
  }

  .diagnosis-dimension:last-child {
    grid-column: auto;
  }

  .diagnosis-data-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-2);
  }

  .diagnosis-section-head {
    display: grid;
  }

  .strategy-hero {
    align-items: flex-start;
  }

  .content-editor-panel {
    position: static;
  }

  .channel-matrix {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }



  .website-channel-summary,
  .configured-accounts-head {
    align-items: stretch;
    display: grid;
  }

  .report-metrics {
    grid-template-columns: 1fr;
  }

  .agent-lead-filters,
  .agent-lead-card,
  .agent-lead-summary dl {
    grid-template-columns: 1fr;
  }

  .agent-lead-filter-actions,
  .agent-lead-pagination {
    align-items: stretch;
    display: grid;
  }

  .agent-lead-filter-actions .primary,
  .agent-lead-filter-actions .ghost,
  .agent-lead-followup-form .primary {
    justify-content: center;
    justify-self: stretch;
  }

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

  .span-2,
  .span-3,
  .insight-rail {
    grid-column: auto;
  }

  table {
    min-width: 760px;
  }

  .table-panel {
    overflow-x: auto;
  }
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    min-width: 0;
    background: white;
  }

  #app {
    display: block;
  }

  .sidebar,
  .topbar,
  .diagnosis-print {
    display: none !important;
  }

  .main {
    padding: 0;
  }

  .diagnosis-report {
    gap: 10px;
  }

  .diagnosis-hero {
    min-height: 210px;
    break-inside: avoid;
    print-color-adjust: exact;
  }

  .diagnosis-overview-grid,
  .diagnosis-dimension-list {
    grid-template-columns: 1fr 1fr;
  }

  .diagnosis-radar-card,
  .diagnosis-dimension,
  .diagnosis-data-strip,
  .diagnosis-warning,
  .diagnosis-action-grid article,
  .diagnosis-plan article,
  .chapter-grid details {
    break-inside: avoid;
    box-shadow: none;
  }

  .diagnosis-action-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .diagnosis-plan {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* Production workbench uses the existing panel and form language. */
.production-intro { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:24px; margin-bottom:20px; border:1px solid #dce5fb; border-radius:16px; background:linear-gradient(115deg,#f1f5ff,#f8fbff 65%,#effaf5); }
.production-intro h2 { margin:8px 0; font-size:23px; line-height:1.5; }
.production-intro p,.production-guide p { color:#63718a; line-height:1.8; margin:0; }
.production-intro .eyebrow { color:#3e60b8; font-size:11px; letter-spacing:.14em; font-weight:700; }
.production-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(270px,1fr); gap:20px; margin:20px 0; }
.production-grid > *,.production-form > * { min-width:0; }
.production-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.production-form label { display:flex; flex-direction:column; gap:8px; font-size:13px; color:#52627a; }
.production-form input:not([type=checkbox]),.production-form select,.production-form textarea { width:100%; min-width:0; padding:10px 12px; border:1px solid #dce3ed; border-radius:8px; font:inherit; color:#21314c; background:white; }
.production-form textarea { resize:vertical; min-height:90px; }
.production-form .check-line { flex-direction:row; align-items:center; line-height:1.7; }
.production-form .check-line input { flex:0 0 auto; }
.production-form .form-actions { align-items:end; }
.production-form button:disabled { opacity:.45; cursor:not-allowed; }
.production-guide ol { padding-left:22px; display:grid; gap:24px; margin:8px 0 28px; }
.production-guide li { padding-left:5px; color:#3459a7; }
.production-guide li strong { display:block; color:#293953; font-size:15px; margin-bottom:6px; }
.production-guide li span { color:#718097; font-size:13px; line-height:1.8; }
.production-settings { margin:20px 0; }
.production-settings > summary { cursor:pointer; font-weight:650; line-height:1.8; }
.production-settings > p { margin:14px 0 20px; }
.production-job { border:1px solid #e0e7f1; border-radius:12px; margin-bottom:16px; overflow:hidden; }
.production-job > summary { display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; padding:16px; cursor:pointer; background:#f7f9fd; line-height:1.6; }
.production-job > summary span { font-size:13px; color:#63718a; }
.production-job-meta { padding:14px 16px; display:flex; gap:14px; align-items:center; justify-content:space-between; flex-wrap:wrap; font-size:13px; }
.production-item { display:flex; justify-content:space-between; gap:16px; padding:16px; border-top:1px solid #edf0f6; align-items:center; }
.production-item > div:first-child { min-width:0; flex:1; }
.production-item strong { font-size:14px; line-height:1.7; }
.production-item p { margin:5px 0 0; font-size:12px; color:#64738b; overflow-wrap:anywhere; line-height:1.8; white-space:pre-wrap; }
.production-item .form-actions { flex-wrap:wrap; }
.production-warning,.production-item .production-warning { color:#a06419; background:#fff8ea; padding:8px 12px; border-radius:8px; margin:8px 16px; font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.production-item .production-warning { margin:8px 0; }
.production-attempt .link-button { font-size:12px; }
.production-publishing { margin-top:20px; }
.production-accounts { margin:0 0 20px; }
.production-account { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 16px; background:#f5f8fe; border-radius:10px; margin:8px 0; }
.production-account p { color:#718097; font-size:12px; }
.production-publications { margin-top:20px; }
#production-media-dialog { width:min(760px,94vw); max-height:90vh; padding:20px; border:1px solid #dce5f1; border-radius:16px; }
#production-media-dialog::backdrop { background:#1423399c; }
#production-media-dialog video { display:block; max-width:100%; height:min(62vh,620px); margin:auto; }
#production-media-dialog p { color:#63718a; font-size:13px; }
.media-upload { display:grid; gap:14px; margin:20px 0; padding:18px; border:1px solid #dfe5f5; border-radius:14px; background:linear-gradient(135deg,#fafbff,#f6f8ff); }
.media-upload-main { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; }
.media-file-picker { display:grid; grid-template-columns:42px minmax(0,1fr); gap:12px; align-items:center; min-width:0; padding:14px; border:1px dashed #aebce9; border-radius:11px; background:#fff; cursor:pointer; }
.media-file-picker:hover { border-color:var(--primary); box-shadow:0 4px 18px rgba(67,97,238,.08); }
.media-file-picker input[type=file] { grid-column:1/-1; width:100%; min-height:34px; padding:5px; border:0; background:#f6f8fc; color:var(--muted); cursor:pointer; }
.media-file-picker input[type=file]::file-selector-button { margin-right:10px; padding:7px 12px; border:0; border-radius:7px; background:#eaf0ff; color:var(--primary-dark); font-weight:700; cursor:pointer; }
.media-file-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:10px; background:var(--gradient-soft); color:var(--primary); }
.media-file-icon .icon { width:20px; height:20px; }
.media-file-picker strong,.media-consent strong { display:block; color:var(--text); font-size:14px; }
.media-file-picker small,.media-consent small { display:block; margin-top:4px; color:var(--soft); font-size:12px; font-weight:400; line-height:1.55; }
.media-upload-button { align-self:center; min-width:132px; min-height:42px; justify-content:center; }
.media-consent { position:relative; display:grid; grid-template-columns:18px minmax(0,1fr); gap:10px; align-items:start; padding:11px 12px; border-radius:9px; background:rgba(67,97,238,.045); cursor:pointer; }
.media-consent input { position:absolute; width:1px; height:1px; min-height:0; margin:0; padding:0; opacity:0; }
.media-consent input { min-width:0; max-width:1px; max-height:1px; flex-basis:1px; }
.media-check { display:grid; place-items:center; width:18px; height:18px; margin-top:1px; border:1.5px solid #9da9bb; border-radius:5px; background:#fff; transition:.15s ease; }
.media-consent input:checked + .media-check { border-color:var(--primary); background:var(--primary); }
.media-consent input:checked + .media-check::after { content:""; width:8px; height:4px; border-left:2px solid #fff; border-bottom:2px solid #fff; transform:translateY(-1px) rotate(-45deg); }
.media-consent input:focus-visible + .media-check { outline:3px solid rgba(67,97,238,.18); outline-offset:2px; }
.media-selector { padding:14px; border:1px solid #e1e6f0; border-radius:12px; min-width:0; }
.media-selector summary { cursor:pointer; font-weight:600; }
.media-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; max-height:320px; overflow:auto; }
.media-options label { display:flex; gap:8px; align-items:center; padding:8px; border:1px solid #e1e6f0; border-radius:8px; overflow-wrap:anywhere; min-width:0; }
.media-options input { flex:0 0 auto; width:16px; }
.media-options img { width:48px; height:48px; object-fit:cover; border-radius:6px; }
.asset-card video { width:100%; height:180px; background:#111827; object-fit:contain; }
.asset-card strong { overflow-wrap:anywhere; }
@media(max-width:1000px) { .production-grid { grid-template-columns:1fr; } }
@media(max-width:700px) {
  .rich-content-grid, .delivery-grid { grid-template-columns: minmax(0,1fr); }
  .rich-editor-head { flex-wrap: wrap; }
  .media-upload { padding:14px; }
  .media-upload-main { grid-template-columns:1fr; }
  .media-upload-button { min-height:42px; }
  .production-intro { padding:18px; align-items:flex-start; flex-direction:column; }
  .production-intro h2 { font-size:19px; }
  .production-form { grid-template-columns:1fr; }
  .production-form .span-2 { grid-column:1; }
  .production-item,.production-account { flex-direction:column; align-items:flex-start; }
  .production-job-meta { align-items:flex-start; flex-direction:column; }
  .production-publishing > .panel-head { flex-direction:column; align-items:flex-start; gap:12px; }
}

/* Keep check controls independent from text-input and permission-form sizing. */
#app input[type="checkbox"]:not([data-media-rights]), #app input[type="radio"] {
  width:16px; height:16px; min-width:16px; min-height:16px; max-width:16px; max-height:16px; padding:0; margin:0; flex:0 0 16px;
}
.media-selector .media-options label { flex-direction:row; }
.panel-head, .panel-actions, .case-actions, .toolbar { gap:12px; flex-wrap:wrap; }
.panel-head > div:first-child { min-width:0; }
.panel-head h2, .panel-head p, .check-label span { overflow-wrap:anywhere; }
.primary, .ghost { justify-content:center; line-height:1.4; white-space:normal; padding-top:8px; padding-bottom:8px; }
button:disabled { cursor:not-allowed; opacity:.45; }
.mini-button, .link-button, .danger-link { flex-shrink:0; }
.permission-list { max-height:340px; overflow:auto; padding-right:6px; }
.permission-card { display:flex; flex-direction:column; gap:14px; }
.permission-card > button { margin-top:auto; align-self:flex-end; }
.library-case-card > p, .content-asset-card > p { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
td .link-button { display:inline-flex; margin:4px 0; }
@media(max-width:900px) {
  .sidebar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px 14px; }
  .sidebar > .brand { flex:1; padding:0; min-width:160px; border:0; }
  .sidebar > .sidebar-context { display:none; }
  .sidebar > .mobile-navigation-toggle { display:inline-flex !important; }
  .sidebar > nav { display:none; width:100%; }
  .sidebar.navigation-open > nav { display:grid; }
  .toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:8px; }
  .toolbar > * { min-width:0; width:100%; }
  .toolbar > .client-select { grid-column:1/-1; }
  .panel-actions { display:flex; width:100%; }
  .form-actions { justify-content:flex-start; }
  .record-pagination { align-items:flex-start; }
  .permission-list { max-height:280px; }
}
@media(max-width:700px) {
  .asset-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .asset-card > img, .asset-card video { height:110px; }
  .asset-card > div { padding:10px; }
  .asset-card strong { font-size:12px; }
  .media-card-actions { gap:4px; }
  .media-card-actions .ghost { padding:6px; font-size:11px; min-height:32px; }
  .media-card-actions .danger-link { font-size:12px; }
}
/* Keep beginner choices compact and preserve native hidden state in grid layouts. */
[hidden] { display: none !important; }
.beginner-tip { padding: 12px 14px; border-radius: 12px; background: #eef4ff; color: #354a70; line-height: 1.7; }
.beginner-question-list { display: grid; gap: 12px; margin: 16px 0; }
.beginner-question-list .check-label { display: flex; align-items: flex-start; gap: 9px; line-height: 1.6; }
.beginner-question-list input[type="checkbox"] { flex: 0 0 16px; margin-top: 4px; }
[data-suggestion-results] { overflow-wrap: anywhere; }
.content-editor-panel .workflow-builder > label { display: grid; gap: 8px; margin: 12px 0; }
#content-asset-form > .beginner-tip,
#content-asset-form > label:has([data-field="contentTitle"]),
#content-asset-form > label:has([data-field="contentInstruction"]) { grid-column: 1 / -1; }
@media (min-width: 1100px) { .content-studio-layout { grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); } }
.question-row-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; min-width:180px; }
.question-batch-actions { margin:12px 0; gap:12px; }
.question-candidates { max-height:420px; overflow-y:auto; margin:12px 0; }
.question-candidate { display:flex; align-items:center; gap:12px; margin:8px 0; }
.question-candidate textarea { flex:1; min-width:0; min-height:64px; }
.question-candidate button { flex-shrink:0; }
:root .operator-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.operator-permissions { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.operator-permissions .operator-permission { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.operator-permission input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; margin: 0; }
.operator-group { border-bottom: 1px solid #e6eaf0; padding: 12px 0; }
.operator-group summary { cursor: pointer; font-size: 14px; }
.operator-group form { margin-top: 12px; }
.operator-account { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; padding: 16px 0; border-bottom: 1px solid #e6eaf0; }
.operator-account > div { flex: 1; min-width: 130px; }
.operator-account small { display: block; margin-top: 6px; }
.operator-account label { display: grid; gap: 6px; font-size: 13px; }
.operator-account-actions { flex: 1 0 100%; display: flex; align-items: center; gap: 12px; }
.customer-operators h3 { margin: 18px 0 12px; }
@media (max-width: 700px) { :root .operator-forms { grid-template-columns: 1fr; } .operator-account label { flex: 1 0 100%; min-width: 0; } }
.channel-login-entry { padding:16px; border:1px solid #dce3ff; border-radius:12px; background:#f6f8ff; }
.channel-login-entry small { display:block; margin-top:8px; color:#63718c; }
.channel-login-dialog { width:min(1160px,96vw); max-height:94vh; padding:20px; border:0; border-radius:16px; overflow:auto; box-shadow:0 24px 80px #17213d55; }
.channel-login-dialog::backdrop { background:#17213d99; }
.channel-login-head,.channel-login-foot { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.channel-login-head h2 { margin:0; font-size:20px; }.channel-login-head p,.channel-login-foot small { color:#66738c; }
.channel-login-screen { border:1px solid #d9dfeb; border-radius:10px; overflow:hidden; background:#f3f5fa; }
.channel-login-screen canvas { display:block; width:100%; height:auto; touch-action:none; }
.channel-login-controls { display:flex; align-items:end; flex-wrap:wrap; gap:8px; padding:12px 0; }.channel-login-controls label { flex:1 1 300px; }.channel-login-controls input { display:block; width:100%; margin-top:6px; }
.channel-login-dialog button { min-height:36px; flex-shrink:0; }.channel-login-foot { margin-top:8px; }
@media(max-width:600px){.channel-login-dialog{padding:12px}.channel-login-head,.channel-login-foot{align-items:stretch;flex-direction:column}.channel-login-screen{overflow:auto}.channel-login-screen canvas{width:900px;max-width:none}.channel-login-controls label{flex-basis:100%}}
/* Keep the publishing steps together without stretching the article editor. */
.article-publish-dialog{width:min(720px,calc(100vw - 32px));max-height:90vh;overflow:auto;border:1px solid #e2e6f0;border-radius:16px;padding:24px;color:#252a36}
.article-publish-dialog::backdrop{background:#17213b80}
.article-publish-dialog button:not(.primary){padding:7px 12px;border:1px solid #dce1eb;border-radius:8px;background:#fff;color:#536078;cursor:pointer}
.article-publish-dialog button:disabled{opacity:.5;cursor:default}
.article-publish-dialog h3{margin:24px 0 12px}
.article-publish-dialog p{color:#657087;font-size:14px;line-height:1.6}
.article-publish-dialog select,.article-publish-dialog input[type="datetime-local"]{width:100%;padding:10px;border:1px solid #dce1eb;border-radius:8px}
.publish-cover-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.publish-cover-grid label{display:grid;grid-template-columns:18px 1fr;align-items:center;gap:6px;padding:8px;border:1px solid #e2e6f0;border-radius:10px;cursor:pointer;min-width:0}
.publish-cover-grid input{width:16px!important;height:16px!important}
.publish-cover-grid img{width:100%;height:72px;object-fit:cover;border-radius:6px}
.publish-cover-grid span{grid-column:1/-1;font-size:12px;overflow-wrap:anywhere}
.publish-cover-grid label:has(input:checked){border-color:#5364ed;background:#f1f3ff}
@media(max-width:600px){.article-publish-dialog{padding:16px}.publish-cover-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Keep account management separate from the publishing queue. */
.channel-view-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.channel-view-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 4px; color: var(--muted); cursor: pointer; font-weight: 700; }
.channel-view-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.channel-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding-top: 18px; }
.channel-toolbar label, .channel-task-filter { display: grid; gap: 7px; font-size: 13px; }
.channel-search { flex: 1; min-width: 180px; }
.channel-toolbar input, .channel-toolbar select, .channel-task-filter select { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); color: var(--text); }
.channel-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px; padding: 20px 0; }
.channel-catalog .channel-card { min-height: 190px; border-color: var(--line); padding: 18px 12px; gap: 10px; }
.channel-catalog .channel-card strong { font-size: 15px; }
.channel-catalog .channel-card small { font-size: 12px; }
.channel-card-action { color: var(--primary); font-size: 13px; font-weight: 700; }
.channel-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(760px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; padding: 24px; background: var(--surface, white); color: var(--text); overflow-y: auto; box-sizing: border-box; }
.channel-drawer::backdrop { background: rgb(15 23 42 / 40%); }
.channel-drawer .publish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.channel-drawer .span-3 { grid-column: 1 / -1; }
.channel-drawer .publish-target-list { grid-template-columns: 1fr; }
.channel-drawer .panel-head { gap: 16px; }
.channel-drawer .panel-head h2 { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .channel-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .channel-toolbar .channel-search { flex-basis: calc(100% - 90px); min-width: 0; }
  .channel-toolbar label:not(.channel-search) { flex: 1; min-width: 0; }
  .channel-toolbar select, .channel-toolbar input { width: 100%; min-width: 0; }
  .channel-drawer { padding: 16px; }
  .channel-drawer .publish-grid { grid-template-columns: minmax(0, 1fr); }
  .channel-drawer .form-actions { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .channel-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .channel-toolbar .channel-search, .channel-toolbar > button { grid-column: 1 / -1; }
  .channel-toolbar > label { min-width: 0; }
}

.article-media-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.article-media-option { display:grid; grid-template-columns:20px minmax(0,1fr); gap:8px; align-content:start; border:1px solid var(--line); border-radius:10px; padding:10px; min-width:0; cursor:pointer; }
.article-media-option input { width:18px; height:18px; }
.article-media-option img,.article-media-option video { grid-column:1/-1; width:100%; height:120px; object-fit:contain; background:#f1f3f7; border-radius:6px; }
.article-media-option span { grid-column:1/-1; overflow-wrap:anywhere; font-size:13px; }
.article-media-picker .form-actions { margin-top:16px; flex-wrap:wrap; }
@media(max-width:600px) { .article-media-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .article-media-option img,.article-media-option video { height:90px; } }
.article-media-grid { max-height:45vh; overflow-y:auto; }

/* Industry research uses the existing panel and form system. */
.growth-reference-list { display:grid; gap:20px; }
.growth-reference { border-top:1px solid #e3e5ee; padding:20px 0; min-width:0; overflow-wrap:anywhere; }
.growth-prose { white-space:pre-wrap; max-height:360px; overflow:auto; line-height:1.8; }
.growth-research input:not([type=checkbox]), .growth-research select, .growth-research textarea { width:100%; min-width:0; }
.growth-research .form-grid>* { min-width:0; }

/* Inbox stays readable on narrow screens without hiding the reply editor. */
.inbox-notice { padding:12px 16px; background:#f0f5ff; border-radius:10px; color:#344054; margin-bottom:18px; line-height:1.7; }
.inbox-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:18px; }
.inbox-filters label { flex:1 1 140px; }
.inbox-layout { display:grid; grid-template-columns:minmax(230px,0.8fr) minmax(0,1.2fr); gap:20px; }
.inbox-list,.inbox-detail { min-width:0; }
.inbox-row { display:flex; flex-direction:column; gap:8px; text-align:left; width:100%; margin-bottom:8px; padding:14px; background:#fff; color:#344054; border:1px solid #e4e7ec; border-radius:10px; white-space:normal; overflow-wrap:anywhere; }
.inbox-row.selected { border-color:#6172f3; background:#f5f7ff; }
.inbox-row small { color:#667085; }
.inbox-detail { padding:18px; background:#f9fafb; border-radius:12px; overflow-wrap:anywhere; }
.inbox-detail blockquote { margin:14px 0; padding:12px; border-left:3px solid #a4bcfd; white-space:pre-wrap; }
.inbox-detail textarea { width:100%; resize:vertical; }
.inbox-detail .actions,.inbox-account .actions { flex-wrap:wrap; margin:12px 0; }
.inbox-form,.inbox-account-form { display:grid; gap:12px; margin:16px 0; }
.inbox-form label,.inbox-account-form label,.inbox-filters label { display:grid; gap:6px; }
.inbox-account { border-top:1px solid #eaecf0; padding:14px 0; overflow-wrap:anywhere; }
.inbox-account summary { cursor:pointer; font-weight:600; }
.inbox-form input,.inbox-form textarea,.inbox-account-form input,.inbox-filters select { width:100%; min-width:0; }
.inbox-account-form input[type=checkbox],.inbox-detail input[type=checkbox] { width:auto; }
@media(max-width:760px) { .inbox-layout { grid-template-columns:minmax(0,1fr); } .inbox-workbench .panel-head { flex-wrap:wrap; } .inbox-detail { padding:12px; } }

.inbox-detail label:has(input[type=checkbox]),.inbox-account-form label:has(input[type=checkbox]) { display:flex; align-items:flex-start; gap:8px; margin:12px 0; }
.inbox-detail .actions { display:flex; gap:8px; }

/* Individual permissions remain usable in the existing responsive forms. */
.personal-permissions { min-width:0; margin:14px 0; padding:16px; border:1px solid var(--line, #dce3ec); border-radius:10px; }
.personal-permissions .operator-permissions { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr)); }
.personal-permissions small { display:block; font-size:12px; overflow-wrap:anywhere; }
.operator-personal { grid-column:1/-1; min-width:0; }
.access-control-panel td { overflow-wrap:anywhere; }

.permission-users { min-width:0; }
.permission-user-card { min-width:0; border:1px solid #e6eaf0; border-radius:10px; padding:16px; margin-bottom:14px; overflow-wrap:anywhere; }
.permission-user-card details { margin-top:14px; }
.organization-permission-list { display:grid; gap:12px; }
.organization-permissions { margin:0; }
.personal-permissions .operator-permission { min-width:0; align-items:flex-start; }
.personal-permissions .operator-permission span { min-width:0; white-space:normal; }
.operator-personal { width:100%; }
@media(max-width:700px) { .personal-permissions .operator-permissions { grid-template-columns:1fr; } }

.readonly-content { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 12px; line-height: 1.7; }

/* Evidence workbench keeps long source text within its customer panel. */
.p0-workbench { min-width:0; display:grid; gap:16px; }
.p0-page-head { margin-bottom:0; padding-bottom:14px; border-bottom:1px solid var(--line-2); }
.p0-page-head h2 { font-size:17px; }
.p0-notice { margin:0; padding:12px 14px; border:1px solid #dce5ff; border-radius:10px; background:#f4f7ff; color:#49617f; line-height:1.55; }
.p0-workbench > h3 { margin:8px 0 -4px; font-size:17px; }
.p0-workbench > p { color:var(--muted); line-height:1.65; }
.p0-workbench form { display:grid; gap:14px; padding:2px 0 0; }
.p0-workbench label { display:grid; gap:6px; overflow-wrap:anywhere; }
.p0-workbench input:not([type=checkbox]),.p0-workbench select,.p0-workbench textarea { width:100%; min-width:0; padding:10px; border:1px solid #d0d5dd; border-radius:8px; background:white; }
.p0-workbench textarea { min-height:110px; }
.p0-workbench fieldset { border:1px solid #e4e7ec; border-radius:8px; min-width:0; }
.p0-workbench fieldset label,.p0-workbench label:has(input[type=checkbox]) { display:flex; align-items:center; }
.p0-workbench pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; max-height:520px; overflow:auto; }
.p0-card { border:1px solid #e4e7ec; border-radius:12px; padding:18px; margin:0; background:#fff; box-shadow:0 1px 2px rgba(29,33,41,.02); overflow-wrap:anywhere; }
.p0-form { border:1px solid #e4e7ec; border-radius:12px; padding:0 16px 14px; background:#fff; }
.p0-form summary { min-height:48px; display:flex; align-items:center; cursor:pointer; font-weight:650; color:var(--text); }
.p0-form[open] summary { border-bottom:1px solid var(--line-2); }
.p0-columns,.p0-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.p0-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
.p0-metric { display:grid; gap:10px; padding:16px; background:#f9fafb; border-radius:10px; }
.p0-metric strong { font-size:26px; }
.p0-metric small { color:#667085; }
.p0-evidence { max-width:100%; max-height:420px; object-fit:contain; }
.p0-links { display:flex; flex-wrap:wrap; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
@media(max-width:760px){.p0-columns,.p0-metrics {grid-template-columns:minmax(0,1fr);} .p0-card {padding:12px;} }
