:root {
  color-scheme: light;
  --bg: #efeee7;
  --surface: #fbfaf6;
  --surface-soft: #f2f0e8;
  --ink: #101114;
  --muted: #687179;
  --line: #d8d4c8;
  --green: #1fbf82;
  --green-soft: #dff8ec;
  --blue: #315cff;
  --blue-soft: #e7ebff;
  --coral: #ff6048;
  --coral-soft: #ffe8e2;
  --amber: #c68114;
  --amber-soft: #fff0c7;
  --violet: #7557ff;
  --violet-soft: #eeeaff;
  --acid: #d8ff3e;
  --shadow: 0 18px 44px rgba(16, 17, 20, 0.12);
  --shadow-strong: 0 24px 70px rgba(16, 17, 20, 0.24);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(216, 255, 62, 0.28), transparent 28vw),
    radial-gradient(circle at 88% 7%, rgba(117, 87, 255, 0.18), transparent 28vw),
    linear-gradient(180deg, #15161a 0 310px, rgba(21, 22, 26, 0) 310px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

.app-frame {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 17, 20, 0.88);
  color: #fff;
  backdrop-filter: blur(22px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  box-shadow: 0 14px 28px rgba(216, 255, 62, 0.22);
  font-weight: 850;
  letter-spacing: 0;
}

.brand strong,
.brand em {
  display: block;
  font-style: normal;
}

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand em {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-link {
  border-radius: 999px;
  padding: 9px 13px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 680;
}

.nav-link:hover,
.nav-link.active {
  background: #fff;
  color: var(--ink);
}

.header-actions,
.command-controls,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.command-band {
  min-height: 190px;
  margin-bottom: 16px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 17, 20, 0.98), rgba(16, 17, 20, 0.88)),
    radial-gradient(circle at 18% 20%, rgba(216, 255, 62, 0.3), transparent 24vw),
    radial-gradient(circle at 84% 24%, rgba(117, 87, 255, 0.36), transparent 22vw);
  color: #fff;
  box-shadow: var(--shadow-strong);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--acid);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.select-field {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.select-field select {
  min-width: 140px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 720;
}

.segmented,
.mini-tabs {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 3px;
}

.seg-button,
.mini-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.seg-button.active,
.mini-tab.active {
  background: var(--ink);
  color: #fff;
}

.ghost-button,
.dark-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 780;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.dark-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.dark-button:hover,
.ghost-button:hover {
  box-shadow: 0 12px 28px rgba(16, 17, 20, 0.16);
}

.app-header .ghost-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.app-header .dark-button {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
}

.icon-button {
  width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.connection-pill,
.metric-pill,
.risk-label,
.status-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 820;
}

.connection-pill {
  color: var(--ink);
  background: var(--acid);
}

.metric-pill {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.status-strip > div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.status-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card,
.panel,
.creative-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 246, 0.94);
  box-shadow: var(--shadow);
}

.kpi-card:hover,
.panel:hover,
.creative-card:hover {
  border-color: rgba(16, 17, 20, 0.28);
  box-shadow: 0 24px 54px rgba(16, 17, 20, 0.16);
}

.kpi-card {
  min-height: 132px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin: 10px 0 8px;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.delta {
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 800;
}

.delta.up {
  color: var(--green);
  background: var(--green-soft);
}

.delta.down {
  color: var(--coral);
  background: var(--coral-soft);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(330px, 0.82fr);
  gap: 16px;
  margin-bottom: 16px;
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  margin-bottom: 16px;
}

.account-panel {
  margin-bottom: 16px;
}

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

.customer-metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.customer-metric span,
.customer-metric em,
.account-number em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.customer-metric strong {
  display: block;
  margin: 8px 0 5px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.05;
}

.material-gauge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.material-gauge-card {
  min-height: 118px;
  border: 1px solid rgba(16, 17, 20, 0.12);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(16, 17, 20, 0.96), rgba(16, 17, 20, 0.88)),
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  grid-template-areas: "copy ring";
  align-items: center;
  gap: 16px;
}

.gauge-ring {
  grid-area: ring;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  padding: 8px;
  background: conic-gradient(var(--accent) calc(var(--gauge) * 1%), rgba(255, 255, 255, 0.14) 0);
  display: grid;
  place-items: center;
}

.gauge-ring::before {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  content: "";
  background: var(--ink);
}

.gauge-ring span {
  grid-area: 1 / 1;
  z-index: 1;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.material-gauge-copy {
  grid-area: copy;
  min-width: 0;
}

.material-gauge-card strong,
.material-gauge-card p,
.material-gauge-card em {
  display: block;
  margin: 0;
}

.material-gauge-card strong {
  font-size: 18px;
  line-height: 1.25;
}

.material-gauge-card em {
  margin-top: 10px;
  color: rgba(244, 240, 230, 0.62);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.strategy-list,
.account-list {
  display: grid;
  gap: 10px;
}

.strategy-card {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  background: var(--surface-soft);
  position: relative;
  overflow: hidden;
}

.strategy-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
  background: var(--line);
}

.strategy-card.good {
  border-color: rgba(215, 255, 47, 0.58);
  background: linear-gradient(90deg, rgba(215, 255, 47, 0.16), rgba(35, 225, 166, 0.07)), rgba(244, 240, 230, 0.05);
}

.strategy-card.bad {
  border-color: rgba(255, 106, 79, 0.58);
  background: linear-gradient(90deg, rgba(255, 106, 79, 0.18), rgba(255, 106, 79, 0.06)), rgba(244, 240, 230, 0.05);
}

.strategy-card.watch {
  border-color: rgba(255, 209, 102, 0.52);
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.16), rgba(255, 209, 102, 0.05)), rgba(244, 240, 230, 0.05);
}

.strategy-card.good::before {
  background: var(--acid);
}

.strategy-card.watch::before {
  background: var(--amber);
}

.strategy-card.bad::before {
  background: var(--coral);
}

.strategy-index {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.strategy-card.good .strategy-index {
  background: var(--acid);
  color: var(--ink-dark);
}

.strategy-card.watch .strategy-index {
  background: var(--amber);
  color: var(--ink-dark);
}

.strategy-card.bad .strategy-index {
  background: var(--coral);
  color: #fff;
}

.strategy-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.strategy-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.account-list {
  max-height: 536px;
  overflow: auto;
  padding-right: 2px;
}

.account-row {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(82px, 0.14fr)) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.account-row:hover,
.account-row.active {
  border-color: rgba(45, 104, 232, 0.42);
  background: #fff;
  box-shadow: 0 10px 28px rgba(45, 104, 232, 0.08);
}

.account-main strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.account-main em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.account-number strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.empty-state {
  min-height: 88px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.wide-empty {
  grid-column: 1 / -1;
}

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

.material-health-card {
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-soft);
}

.material-health-card span,
.material-health-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.material-health-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 26px;
  line-height: 1;
}

.material-gap {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.material-gap p {
  margin-bottom: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.55;
}

.material-field-grid {
  display: grid;
  gap: 10px;
}

.material-field-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-soft);
}

.material-field-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.material-field-card strong {
  font-size: 14px;
}

.material-field-card span {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.material-field-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.panel {
  padding: 18px;
}

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

.panel-header p,
.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.trend-panel canvas {
  min-height: 280px;
}

.legend-list,
.driver-list,
.action-list,
.tag-score-list,
.formula-box,
.brief-grid {
  display: grid;
  gap: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.risk-label.high,
.status-pill.bad {
  color: var(--coral);
  background: var(--coral-soft);
}

.risk-label.medium,
.status-pill.watch {
  color: var(--amber);
  background: var(--amber-soft);
}

.risk-label.low,
.status-pill.good {
  color: var(--green);
  background: var(--green-soft);
}

.driver-row {
  display: grid;
  grid-template-columns: 118px 1fr 62px;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.driver-name {
  font-size: 13px;
  font-weight: 760;
}

.driver-bar,
.score-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.driver-fill,
.score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.driver-value {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.action-item,
.brief-card,
.formula-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-soft);
}

.action-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.priority {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.action-title {
  font-weight: 820;
  font-size: 14px;
}

.action-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.table-panel {
  margin-bottom: 18px;
  padding-bottom: 10px;
}

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

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td strong {
  display: block;
  font-size: 13px;
}

.subtext {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.section-heading {
  margin-bottom: 12px;
}

.creative-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.creative-pager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.creative-pager > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.creative-pager strong {
  color: var(--ink);
}

.small-button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.creative-card {
  overflow: hidden;
}

.creative-visual {
  position: relative;
  height: 168px;
  padding: 14px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(135deg, rgba(15, 159, 110, 0.92), rgba(45, 104, 232, 0.82)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0 12px, transparent 12px 24px);
}

.creative-visual.has-thumb {
  background: #111820;
}

.creative-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creative-visual.has-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.02), rgba(8, 14, 22, 0.68));
}

.creative-card:nth-child(2n) .creative-visual {
  background:
    linear-gradient(135deg, rgba(225, 95, 70, 0.9), rgba(120, 87, 215, 0.82)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0 10px, transparent 10px 22px);
}

.creative-card:nth-child(3n) .creative-visual {
  background:
    linear-gradient(135deg, rgba(191, 123, 24, 0.9), rgba(15, 159, 110, 0.82)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 9px, transparent 9px 19px);
}

.creative-title {
  position: relative;
  z-index: 1;
  font-weight: 850;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.creative-body {
  padding: 14px;
}

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

.mini-metric {
  border-radius: 12px;
  padding: 8px;
  background: var(--surface-soft);
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.mini-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

.creative-advice {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.creative-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.creative-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 860;
}

.creative-action.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.creative-action:hover {
  border-color: var(--ink);
  box-shadow: 0 10px 24px rgba(16, 17, 20, 0.14);
}

.tag-pill {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 760;
}

.tag-score-row {
  display: grid;
  grid-template-columns: 118px 1fr 68px;
  align-items: center;
  gap: 12px;
}

.score-fill {
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.formula-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
}

.formula-index {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 850;
}

.formula-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-panel {
  border-color: #cad8d2;
}

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

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

.brief-card strong {
  display: block;
  margin-bottom: 8px;
}

.brief-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(24, 32, 39, 0.38);
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(620px, 100vw);
  height: 100vh;
  padding: 22px;
  overflow-y: auto;
  background: #fff;
  box-shadow: var(--shadow-strong);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.settings-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.api-form {
  display: grid;
  gap: 16px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--surface-soft);
}

.switch-row strong,
.switch-row em {
  display: block;
  font-style: normal;
}

.switch-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.switch-row input {
  width: 46px;
  height: 26px;
  accent-color: var(--green);
}

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

.form-grid label {
  display: grid;
  gap: 7px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(45, 104, 232, 0.1);
}

.advanced-settings {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-soft);
}

.advanced-settings summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
}

.advanced-settings .form-grid {
  margin-top: 12px;
}

.save-state {
  min-height: 40px;
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px));
  border-radius: 14px;
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow-strong);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .analytics-grid,
  .customer-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .creative-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-gauge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .ghost-button,
  .header-actions .dark-button {
    flex: 1 1 120px;
  }

  .workspace {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .command-band {
    min-height: 0;
    padding: 20px;
    border-radius: 22px;
    display: grid;
  }

  h1 {
    font-size: 34px;
    line-height: 1.12;
  }

  .select-field,
  .select-field select,
  .segmented {
    width: 100%;
  }

  .seg-button {
    flex: 1;
  }

  .status-strip,
  .kpi-grid,
  .customer-metrics,
  .material-gauge-grid,
  .material-health-grid,
  .creative-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .account-row {
    grid-template-columns: 1fr 1fr;
  }

  .account-main,
  .account-row .status-pill {
    grid-column: 1 / -1;
  }

  .driver-row,
  .tag-score-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .creative-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-value {
    text-align: left;
  }

  .action-item {
    grid-template-columns: auto 1fr;
  }

  .action-item .status-pill {
    grid-column: 2;
    justify-self: start;
  }
}

/* Vision Win / Higgsfield style refresh */
:root {
  color-scheme: dark;
  --bg: #090a0a;
  --stage: #101112;
  --surface: #151619;
  --surface-soft: #1f2024;
  --paper: #f4f0e6;
  --paper-soft: #e9e3d5;
  --ink: #f7f4ec;
  --ink-dark: #101114;
  --muted: #a7a79d;
  --line: rgba(244, 240, 230, 0.14);
  --line-strong: rgba(244, 240, 230, 0.28);
  --acid: #d7ff2f;
  --green: #23e1a6;
  --green-soft: rgba(35, 225, 166, 0.14);
  --blue: #8c73ff;
  --blue-soft: rgba(140, 115, 255, 0.16);
  --coral: #ff6a4f;
  --coral-soft: rgba(255, 106, 79, 0.14);
  --amber: #ffd166;
  --amber-soft: rgba(255, 209, 102, 0.14);
  --violet: #8c73ff;
  --violet-soft: rgba(140, 115, 255, 0.16);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  --shadow-strong: 0 32px 90px rgba(0, 0, 0, 0.44);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(215, 255, 47, 0.13) 0, rgba(215, 255, 47, 0) 220px),
    linear-gradient(90deg, rgba(215, 255, 47, 0.06) 0 1px, transparent 1px 92px),
    linear-gradient(180deg, rgba(244, 240, 230, 0.05) 0 1px, transparent 1px 92px),
    var(--bg);
}

.app-frame {
  background: linear-gradient(180deg, rgba(244, 240, 230, 0.03), rgba(9, 10, 10, 0));
}

.app-header {
  min-height: 86px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 10, 0.9);
}

.brand {
  gap: 14px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(244, 240, 230, 0.2), 0 18px 36px rgba(215, 255, 47, 0.14);
}

.brand-logo img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.brand-mark {
  display: none;
}

.brand strong {
  color: #fff;
  font-size: 20px;
  font-weight: 920;
}

.brand em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.top-nav {
  gap: 8px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 18px;
  color: rgba(247, 244, 236, 0.64);
  font-size: 15px;
}

.nav-link:hover,
.nav-link.active {
  border-color: rgba(244, 240, 230, 0.18);
  background: var(--paper);
  color: var(--ink-dark);
}

.workspace {
  width: min(1680px, calc(100% - 48px));
  padding: 30px 0 54px;
}

.command-band {
  min-height: 430px;
  margin-bottom: 18px;
  padding: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(115deg, #101112 0%, #111214 46%, #191823 100%),
    linear-gradient(180deg, rgba(215, 255, 47, 0.14), rgba(215, 255, 47, 0));
  box-shadow: var(--shadow-strong);
  align-items: stretch;
}

.hero-copy {
  display: flex;
  min-width: min(680px, 100%);
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  color: var(--acid);
  font-size: 14px;
  font-weight: 920;
}

h1 {
  max-width: 760px;
  color: #fff;
  font-size: 76px;
  font-weight: 940;
  line-height: 0.9;
  text-transform: none;
}

.hero-subtitle {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(247, 244, 236, 0.68);
  font-size: 16px;
  line-height: 1.65;
}

.command-controls {
  width: min(640px, 100%);
  align-content: end;
  justify-content: flex-end;
}

.hero-logo-card {
  width: 160px;
  height: 160px;
  margin-left: auto;
  border: 1px solid rgba(244, 240, 230, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: var(--paper);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

.hero-logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.select-field,
.account-picker,
.date-field {
  min-height: 58px;
  border: 1px solid rgba(244, 240, 230, 0.18);
  border-radius: 8px;
  background: rgba(247, 244, 236, 0.08);
  color: var(--muted);
}

.select-field {
  width: 100%;
  padding: 10px 14px;
}

.account-picker {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.account-picker > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
}

.account-picker input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 820;
}

.account-picker input::placeholder {
  color: rgba(247, 244, 236, 0.58);
}

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

.account-picker-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(244, 240, 230, 0.18);
  border-radius: 8px;
  background: rgba(244, 240, 230, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.account-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 340px;
  overflow: auto;
  border: 1px solid rgba(215, 255, 47, 0.28);
  border-radius: 8px;
  padding: 8px;
  background: #101114;
  box-shadow: var(--shadow-strong);
}

.account-picker-option {
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.account-picker-option:hover,
.account-picker-option.active {
  border-color: rgba(215, 255, 47, 0.42);
  background: rgba(215, 255, 47, 0.1);
}

.account-picker-option strong,
.account-picker-option span {
  display: block;
  overflow-wrap: anywhere;
}

.account-picker-option strong {
  color: #fff;
  font-size: 13px;
}

.account-picker-option span,
.account-picker-empty {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-picker-empty {
  padding: 14px;
}

.select-field select {
  width: 100%;
  min-width: 240px;
  color: #fff;
}

.select-field select option {
  background: #111214;
  color: #fff;
}

.date-console {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.segmented,
.mini-tabs {
  border: 1px solid rgba(244, 240, 230, 0.14);
  border-radius: 8px;
  background: rgba(244, 240, 230, 0.82);
  padding: 4px;
}

.seg-button,
.mini-tab {
  min-height: 42px;
  border-radius: 7px;
  padding: 9px 16px;
  color: rgba(16, 17, 20, 0.62);
  font-weight: 900;
}

.seg-button.active,
.mini-tab.active {
  background: #101114;
  color: #fff;
}

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

.date-field {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  cursor: pointer;
}

.date-field span {
  font-size: 11px;
  font-weight: 860;
}

.date-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 820;
  cursor: pointer;
}

.ghost-button,
.dark-button,
.icon-button {
  border-radius: 8px;
  font-weight: 900;
}

.ghost-button {
  border-color: var(--line-strong);
  background: rgba(244, 240, 230, 0.08);
  color: var(--ink);
}

.dark-button,
.app-header .dark-button {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink-dark);
}

.app-header .ghost-button {
  border-color: rgba(244, 240, 230, 0.22);
  background: rgba(244, 240, 230, 0.08);
  color: #fff;
}

.connection-pill {
  background: var(--acid);
  color: var(--ink-dark);
}

.status-strip,
.kpi-grid,
.customer-grid,
.analytics-grid,
.split-grid {
  gap: 16px;
}

.status-strip > div,
.kpi-card,
.panel,
.creative-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 22, 25, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.status-strip > div,
.kpi-card {
  background:
    linear-gradient(180deg, rgba(244, 240, 230, 0.08), rgba(244, 240, 230, 0.02)),
    #151619;
}

.kpi-card:hover,
.panel:hover,
.creative-card:hover {
  border-color: rgba(215, 255, 47, 0.44);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.status-strip span,
.kpi-label,
.customer-metric span,
.customer-metric em,
.account-number em,
.panel-header p,
.section-heading p,
.subtext,
.material-health-card span,
.material-health-card em,
.material-gap p,
.material-field-card p,
.strategy-card p,
.brief-card p,
.formula-text,
.account-main em {
  color: var(--muted);
}

.kpi-value,
.customer-metric strong,
.material-health-card strong,
.status-strip strong,
.account-number strong {
  color: #fff;
}

.customer-metric,
.material-health-card,
.material-field-card,
.action-item,
.brief-card,
.formula-step,
.strategy-card,
.mini-metric,
.empty-state,
.material-gap p,
.advanced-settings,
.switch-row,
.save-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 240, 230, 0.06);
  color: var(--ink);
}

.material-gauge-card {
  border-color: rgba(244, 240, 230, 0.16);
  background:
    linear-gradient(135deg, rgba(14, 15, 16, 0.98), rgba(31, 32, 36, 0.94)),
    linear-gradient(180deg, rgba(215, 255, 47, 0.12), rgba(215, 255, 47, 0));
}

.gauge-ring::before {
  background: #101114;
}

.strategy-card.good,
.strategy-card.bad {
  background: rgba(244, 240, 230, 0.06);
}

.strategy-index,
.priority {
  background: var(--acid);
  color: var(--ink-dark);
}

.account-search {
  display: grid;
  gap: 8px;
  margin: -4px 0 14px;
}

.account-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
}

.account-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 10px 13px;
  background: rgba(244, 240, 230, 0.08);
  color: var(--ink);
  font-weight: 760;
}

.account-search input:focus {
  border-color: rgba(215, 255, 47, 0.62);
  box-shadow: 0 0 0 4px rgba(215, 255, 47, 0.1);
}

.account-row {
  border-color: var(--line);
  background: rgba(244, 240, 230, 0.06);
  color: var(--ink);
}

.account-row:hover,
.account-row.active {
  border-color: rgba(215, 255, 47, 0.54);
  background: rgba(215, 255, 47, 0.08);
}

.creative-card {
  background: #131416;
}

.creative-visual {
  height: 210px;
  background:
    linear-gradient(135deg, rgba(215, 255, 47, 0.9), rgba(140, 115, 255, 0.68)),
    #101114;
}

.creative-card:nth-child(2n) .creative-visual,
.creative-card:nth-child(3n) .creative-visual {
  background:
    linear-gradient(135deg, rgba(244, 240, 230, 0.86), rgba(215, 255, 47, 0.72)),
    #101114;
}

.creative-title {
  color: #fff;
}

.creative-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tag-pill,
.material-field-card span,
.metric-pill {
  background: rgba(215, 255, 47, 0.14);
  color: var(--acid);
}

.score-fill {
  background: linear-gradient(90deg, var(--acid), var(--green));
}

.creative-action {
  border-color: rgba(244, 240, 230, 0.18);
  background: rgba(244, 240, 230, 0.08);
  color: var(--ink);
}

.creative-action.primary {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink-dark);
}

.settings-drawer {
  border-left: 1px solid var(--line);
  background: #101114;
  color: var(--ink);
}

.drawer-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.form-grid input,
.form-grid select {
  border-radius: 8px;
  border-color: var(--line);
  background: rgba(244, 240, 230, 0.08);
  color: var(--ink);
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: rgba(215, 255, 47, 0.62);
  box-shadow: 0 0 0 4px rgba(215, 255, 47, 0.1);
}

.icon-button {
  background: rgba(244, 240, 230, 0.1);
  color: var(--ink);
}

.toast {
  border: 1px solid rgba(244, 240, 230, 0.16);
  border-radius: 8px;
  background: #101114;
}

.sync-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px);
}

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

.sync-dialog {
  width: min(520px, 100%);
  border: 1px solid rgba(215, 255, 47, 0.28);
  border-radius: 8px;
  padding: 18px;
  background: #101114;
  box-shadow: var(--shadow-strong);
}

.sync-dialog-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
}

.sync-dialog strong,
.sync-dialog p,
.sync-dialog em {
  display: block;
  margin: 0;
}

.sync-dialog strong {
  color: #fff;
  font-size: 16px;
}

.sync-dialog p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.sync-dialog em {
  color: var(--acid);
  font-style: normal;
  font-weight: 920;
}

.sync-orb {
  width: 14px;
  height: 42px;
  border-radius: 999px;
  background: var(--acid);
}

.sync-track {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(244, 240, 230, 0.1);
}

.sync-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acid), var(--green));
  transition: width 0.32s ease;
}

.sync-track span.is-indeterminate {
  background:
    linear-gradient(90deg, var(--acid), var(--green)),
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0.34) 0 10px, transparent 10px 22px);
  background-size: 100% 100%, 44px 44px;
  animation: sync-stripes 0.9s linear infinite;
}

@keyframes sync-stripes {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 0, 44px 0;
  }
}

@media (max-width: 980px) {
  .command-band {
    min-height: 0;
    display: grid;
  }

  .command-controls {
    width: 100%;
    justify-content: stretch;
  }

  .hero-logo-card {
    width: 120px;
    height: 120px;
    margin: 0;
  }

  h1 {
    font-size: 54px;
    line-height: 0.96;
  }

  .date-console {
    grid-template-columns: 1fr;
  }
}

/* V1 customer workspace: role-safe presentation and responsive refinement */
body {
  overflow-x: hidden;
}

body .customer-only {
  display: none !important;
}

body:not([data-role="internal"]) .internal-only {
  display: none !important;
}

body[data-role="customer"] .customer-role-pill {
  display: inline-flex !important;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(35, 225, 166, 0.32);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--green);
  background: rgba(35, 225, 166, 0.1);
  font-size: 12px;
  font-weight: 880;
  white-space: nowrap;
}

body[data-role="customer"] .status-strip {
  grid-template-columns: minmax(0, 1fr);
}

body[data-role="customer"] .status-strip .customer-freshness {
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body[data-role="customer"] .status-strip .customer-freshness span,
body[data-role="customer"] .status-strip .customer-freshness strong {
  margin: 0;
}

body[data-role="customer"] .customer-material-note {
  display: block !important;
  margin: 12px 0 0;
  border: 1px solid rgba(35, 225, 166, 0.24);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  background: rgba(35, 225, 166, 0.07);
  font-size: 13px;
  line-height: 1.6;
}

body[data-role="customer"] .content-insight-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1100px) {
  .workspace {
    width: calc(100% - 32px);
  }

  .command-band {
    min-height: 360px;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    align-items: stretch;
  }

  .hero-copy {
    min-width: 0;
  }

  .hero-copy h1 {
    font-size: 50px;
    line-height: 0.98;
  }

  .command-controls {
    width: 100%;
    display: grid;
    align-content: end;
  }

  .hero-logo-card {
    display: none;
  }

  .date-console {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .customer-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid,
  .customer-grid,
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .creative-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    padding: 13px 16px;
  }

  .top-nav {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .header-actions {
    width: auto;
    justify-content: flex-end;
  }

  body[data-role="customer"] .user-pill {
    display: none;
  }

  .command-band {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    padding: 24px;
    gap: 22px;
  }

  .hero-copy h1 {
    font-size: 42px;
    line-height: 1;
  }

  .material-gauge-grid,
  .material-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel,
  .kpi-card {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .auth-screen {
    padding: 12px;
  }

  .auth-card {
    min-height: 0;
    padding: 20px;
    gap: 24px;
  }

  .auth-card h1 {
    font-size: 42px;
    line-height: 0.98;
  }

  body[data-role="customer"] .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
  }

  body[data-role="customer"] .header-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  body[data-role="customer"] .customer-role-pill,
  body[data-role="customer"] .user-pill {
    display: none !important;
  }

  .brand {
    gap: 9px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

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

  .brand em {
    font-size: 10px;
  }

  .nav-link {
    min-height: 42px;
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
  }

  .workspace {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .command-band {
    margin-bottom: 12px;
    padding: 18px;
    gap: 18px;
  }

  .hero-copy h1 {
    font-size: 34px;
    line-height: 1.02;
  }

  .hero-subtitle {
    margin-top: 12px;
    font-size: 14px;
  }

  .account-picker {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .account-picker > span {
    grid-column: 1 / -1;
  }

  .account-picker-toggle {
    width: 42px;
    height: 42px;
  }

  .segmented,
  .mini-tabs {
    width: 100%;
  }

  .seg-button,
  .mini-tab {
    min-width: 0;
    min-height: 44px;
    flex: 1;
    padding: 9px 8px;
  }

  .date-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .date-field {
    min-width: 0;
  }

  .date-field input {
    min-width: 0;
    font-size: 12px;
  }

  body[data-role="customer"] .status-strip .customer-freshness {
    min-height: 54px;
    padding: 10px 13px;
  }

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

  .kpi-card,
  .customer-metric {
    min-height: 112px;
    padding: 13px;
  }

  .kpi-value,
  .customer-metric strong {
    font-size: 24px;
  }

  .panel {
    padding: 15px;
  }

  .panel-header,
  .section-heading {
    gap: 10px;
  }

  .section-heading {
    flex-direction: column;
  }

  .material-gauge-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-health-card {
    min-height: 96px;
    padding: 11px;
  }

  .material-health-card strong {
    font-size: 23px;
  }

  .trend-panel canvas {
    height: 250px !important;
  }

  .creative-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .creative-visual {
    height: 205px;
  }

  .creative-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .creative-pager > div {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
  }

  .ghost-button,
  .dark-button,
  .creative-action,
  .account-picker-option {
    min-height: 44px;
  }
}

@media (max-width: 390px) {
  .workspace {
    width: calc(100% - 16px);
  }

  .command-band {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 31px;
  }

  .kpi-label,
  .customer-metric span,
  .customer-metric em {
    font-size: 11px;
  }

  .kpi-value,
  .customer-metric strong {
    font-size: 22px;
  }

  .material-gauge-card {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 10px;
    padding: 13px;
  }

  .gauge-ring {
    width: 82px;
    height: 82px;
  }
}

@media (max-width: 760px) {
  .workspace {
    width: calc(100% - 24px);
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .command-band {
    padding: 22px;
  }

  h1 {
    font-size: 42px;
    line-height: 1;
  }

  .hero-logo-card {
    display: none;
  }

  .date-fields {
    grid-template-columns: 1fr;
  }

  .account-picker {
    width: 100%;
  }

  .creative-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.strategy-card {
  position: relative;
  overflow: hidden;
}

.strategy-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
  background: var(--line-strong);
}

.strategy-card.good {
  border-color: rgba(35, 225, 166, 0.66);
  background:
    linear-gradient(90deg, rgba(35, 225, 166, 0.2), rgba(35, 225, 166, 0.04)),
    #1a1f1d;
}

.strategy-card.watch {
  border-color: rgba(255, 209, 102, 0.66);
  background:
    linear-gradient(90deg, rgba(255, 209, 102, 0.2), rgba(255, 209, 102, 0.04)),
    #211f19;
}

.strategy-card.bad {
  border-color: rgba(255, 106, 79, 0.66);
  background:
    linear-gradient(90deg, rgba(255, 106, 79, 0.22), rgba(255, 106, 79, 0.04)),
    #211a19;
}

.strategy-card.good::before {
  background: var(--green);
}

.strategy-card.watch::before {
  background: var(--amber);
}

.strategy-card.bad::before {
  background: var(--coral);
}

.strategy-card.good .strategy-index {
  background: var(--green);
  color: var(--ink-dark);
}

.strategy-card.watch .strategy-index {
  background: var(--amber);
  color: var(--ink-dark);
}

.strategy-card.bad .strategy-index {
  background: var(--coral);
  color: #fff;
}

.replica-card,
.shoot-task {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(244, 240, 230, 0.055);
  display: grid;
  gap: 12px;
}

.replica-card {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
}

.replica-rank,
.shoot-task > span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--acid);
  color: var(--ink-dark);
  font-size: 13px;
  font-weight: 940;
}

.replica-card strong,
.shoot-task strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
}

.replica-card p,
.shoot-task p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.replica-card em {
  color: var(--acid);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.replica-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.shoot-task {
  grid-template-columns: 34px minmax(0, 1fr);
}

.shoot-task.good {
  border-color: rgba(35, 225, 166, 0.5);
  background: rgba(35, 225, 166, 0.08);
}

.shoot-task.watch {
  border-color: rgba(255, 209, 102, 0.5);
  background: rgba(255, 209, 102, 0.08);
}

.shoot-task.bad {
  border-color: rgba(255, 106, 79, 0.5);
  background: rgba(255, 106, 79, 0.08);
}

.shoot-task.good > span {
  background: var(--green);
}

.shoot-task.watch > span {
  background: var(--amber);
}

.shoot-task.bad > span {
  background: var(--coral);
  color: #fff;
}

@media (max-width: 760px) {
  .replica-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .replica-card em {
    grid-column: 2;
    white-space: normal;
  }
}

.auth-screen {
  min-height: 100vh;
  padding: 34px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(215, 255, 47, 0.14), rgba(140, 115, 255, 0.1)),
    #090a0a;
}

.auth-card {
  width: min(1080px, 100%);
  min-height: 560px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 38px;
  background:
    linear-gradient(115deg, rgba(16, 17, 18, 0.98), rgba(18, 19, 24, 0.94)),
    radial-gradient(circle at 84% 20%, rgba(215, 255, 47, 0.2), transparent 30vw);
  box-shadow: var(--shadow-strong);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.75fr);
  align-items: center;
  gap: 36px;
}

.auth-card h1 {
  font-size: clamp(46px, 7vw, 86px);
}

.auth-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(244, 240, 230, 0.06);
  display: grid;
  gap: 14px;
}

.auth-form h2 {
  color: #fff;
  font-size: 22px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 10px 13px;
  background: rgba(244, 240, 230, 0.08);
  color: var(--ink);
}

.auth-message {
  grid-column: 2;
  min-height: 22px;
  margin: 0;
  color: var(--coral);
  font-size: 13px;
  font-weight: 760;
}

.user-pill {
  max-width: 260px;
  min-height: 34px;
  border: 1px solid rgba(244, 240, 230, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--ink);
  background: rgba(244, 240, 230, 0.08);
  font-size: 12px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-admin-drawer {
  width: min(920px, 100vw);
}

.admin-page {
  width: min(1500px, calc(100% - 48px));
}

.admin-hero {
  min-height: 280px;
}

.admin-console {
  margin-bottom: 22px;
}

.no-permission-panel {
  max-width: 780px;
  margin: 0 auto;
}

.no-permission-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1fr);
  gap: 18px;
}

.user-list,
.permission-account-list {
  display: grid;
  gap: 8px;
}

.user-list {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 2px;
}

.user-row {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(244, 240, 230, 0.06);
  color: var(--ink);
  text-align: left;
  display: grid;
  gap: 6px;
}

.user-row.active,
.user-row:hover {
  border-color: rgba(215, 255, 47, 0.52);
  background: rgba(215, 255, 47, 0.08);
}

.user-row strong,
.user-row em,
.user-row small {
  display: block;
}

.user-row strong {
  color: #fff;
  font-size: 13px;
}

.user-row em,
.user-row small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.permission-account-list {
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(244, 240, 230, 0.04);
}

.permission-account-list.disabled {
  max-height: none;
}

.permission-account {
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.permission-account:hover {
  border-color: rgba(215, 255, 47, 0.38);
  background: rgba(215, 255, 47, 0.06);
}

.permission-account input {
  width: 18px;
  height: 18px;
  accent-color: var(--acid);
}

.permission-account strong,
.permission-account em {
  display: block;
  overflow-wrap: anywhere;
}

.permission-account strong {
  color: #fff;
  font-size: 13px;
}

.permission-account em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.industry-source-panel {
  margin-bottom: 24px;
}

.source-health {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 201, 92, 0.44);
  border-radius: 999px;
  color: #ffc95c;
  background: rgba(255, 201, 92, 0.09);
  font-size: 12px;
  font-weight: 860;
}

.source-health.ready {
  border-color: rgba(39, 217, 191, 0.42);
  color: var(--green);
  background: rgba(39, 217, 191, 0.09);
}

.industry-source-form {
  display: grid;
  gap: 18px;
}

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

.source-config-grid label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.source-config-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.source-config-grid input,
.source-config-grid select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: rgba(244, 240, 230, 0.06);
}

.source-config-grid input:focus,
.source-config-grid select:focus {
  border-color: rgba(215, 255, 47, 0.68);
  box-shadow: 0 0 0 3px rgba(215, 255, 47, 0.08);
}

.source-config-grid em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.5;
}

.source-document-field {
  grid-column: 1 / -1;
}

.source-mapping-note {
  padding: 14px 16px;
  border-left: 3px solid var(--acid);
  background: rgba(215, 255, 47, 0.055);
  display: grid;
  gap: 5px;
}

.source-mapping-note strong {
  color: #fff;
  font-size: 13px;
}

.source-mapping-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.source-sheet-result {
  padding-top: 2px;
}

.source-sheet-result > strong {
  display: block;
  margin-bottom: 9px;
  color: #fff;
  font-size: 13px;
}

.source-sheet-result > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.source-sheet-result span {
  padding: 6px 9px;
  border: 1px solid rgba(39, 217, 191, 0.32);
  border-radius: 999px;
  color: var(--green);
  background: rgba(39, 217, 191, 0.07);
  font-size: 11px;
  font-weight: 760;
}

.source-form-actions {
  justify-content: flex-end;
}

body[data-role="customer"] .command-controls {
  align-content: end;
}

body[data-role="customer"] .connection-pill {
  background: rgba(215, 255, 47, 0.14);
  color: var(--acid);
}

.creative-visual.no-thumb {
  background:
    linear-gradient(135deg, rgba(244, 240, 230, 0.08), rgba(244, 240, 230, 0.035)),
    #101114 !important;
  border-bottom: 1px solid var(--line);
}

.creative-visual.no-thumb::before {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px dashed rgba(244, 240, 230, 0.2);
  border-radius: 10px;
}

.creative-placeholder {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 128px;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.creative-preview-link {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(244, 240, 230, 0.28);
  border-radius: 8px;
  background: rgba(13, 14, 15, 0.82);
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.creative-preview-link:hover,
.creative-preview-link:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d0e0f;
  outline: none;
}

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

  .auth-message {
    grid-column: auto;
  }

  .source-config-grid {
    grid-template-columns: 1fr;
  }

  .source-document-field {
    grid-column: auto;
  }
}

/* Final mobile overrides stay last so the original V1 rules cannot widen them. */
@media (max-width: 600px) {
  .auth-screen {
    padding: 12px;
  }

  .auth-card {
    min-height: 0;
    padding: 20px;
    gap: 24px;
  }

  .auth-card h1 {
    font-size: 42px;
    line-height: 0.98;
  }

  .workspace {
    width: calc(100% - 20px);
  }

  .command-band {
    padding: 18px;
  }

  .date-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .source-form-actions button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .workspace {
    width: calc(100% - 16px);
  }

  .command-band {
    padding: 16px;
  }
}

/* Customer workspace hardening for compact desktops, iPad and touch screens. */
body[data-role="customer"] .hero-copy {
  min-width: 0;
  flex: 1 1 680px;
}

body[data-role="customer"] .command-controls {
  min-width: 0;
  flex: 1 1 520px;
}

body[data-role="customer"] .date-console,
body[data-role="customer"] .date-fields,
body[data-role="customer"] .date-field,
body[data-role="customer"] .date-field input {
  min-width: 0;
  max-width: 100%;
}

body[data-role="customer"] .account-picker input {
  min-height: 42px;
}

body[data-role="customer"] .account-picker-toggle,
body[data-role="customer"] #logoutButton,
body[data-role="customer"] .creative-action,
body[data-role="customer"] .creative-pager .ghost-button {
  min-height: 44px;
}

body[data-role="customer"] .account-picker-toggle {
  width: 44px;
  height: 44px;
}

body[data-role="customer"] .creative-preview-link {
  min-height: 42px;
}

@media (max-width: 1180px) {
  body[data-role="customer"] .app-header {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding: 12px 18px;
  }

  body[data-role="customer"] .brand {
    grid-column: 1;
    grid-row: 1;
  }

  body[data-role="customer"] .header-actions {
    width: auto;
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  body[data-role="customer"] .top-nav {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-role="customer"] .top-nav::-webkit-scrollbar {
    display: none;
  }

  body[data-role="customer"] .brand-logo {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 600px) {
  body[data-role="customer"] .account-picker {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
}

/* Official hot-material derivation workspace. */
body.modal-open {
  overflow: hidden;
}

.hot-material-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 28px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
}

.hot-material-dialog {
  width: min(1040px, 100%);
  min-height: 520px;
  margin: 2vh auto;
  border: 1px solid rgba(244, 240, 230, 0.24);
  border-radius: 8px;
  background: #111214;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.hot-material-header {
  position: sticky;
  top: -28px;
  z-index: 3;
  min-height: 86px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 18, 20, 0.96);
  backdrop-filter: blur(16px);
}

.hot-material-header h2 {
  margin: 4px 0 0;
  font-size: 25px;
  letter-spacing: 0;
}

.hot-material-kicker {
  color: var(--acid);
  font-size: 12px;
  font-weight: 850;
}

.hot-material-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #202226;
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.hot-material-close:hover,
.hot-material-close:focus-visible {
  border-color: var(--acid);
  color: var(--acid);
  outline: none;
}

.hot-material-body {
  padding: 24px;
}

.hot-material-origin {
  min-height: 92px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #18191c;
}

.hot-material-origin span,
.hot-material-origin strong,
.hot-material-origin em {
  display: block;
}

.hot-material-origin > div > span,
.hot-material-origin em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.hot-material-origin strong {
  margin: 5px 0;
  color: #fff;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.hot-material-product {
  flex: 0 0 auto;
  border: 1px solid rgba(35, 225, 166, 0.34);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--green);
  background: rgba(35, 225, 166, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.hot-material-section-heading {
  margin: 26px 0 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.hot-material-section-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hot-material-section-heading span {
  min-width: 55px;
  color: var(--acid);
  font-size: 12px;
  font-weight: 850;
}

.hot-material-section-heading strong {
  color: #fff;
  font-size: 19px;
}

.hot-material-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

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

.hot-material-strategy {
  min-height: 84px;
  padding: 14px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1b1c1f;
  cursor: pointer;
}

.hot-material-strategy.selected {
  border-color: rgba(215, 255, 47, 0.55);
  background: rgba(215, 255, 47, 0.07);
}

.hot-material-strategy input,
.hot-material-candidate input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--acid);
}

.hot-material-strategy strong,
.hot-material-strategy em {
  display: block;
}

.hot-material-strategy strong {
  color: #fff;
  font-size: 14px;
}

.hot-material-strategy em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.hot-material-advanced-toggle {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17181b;
  color: #fff;
  cursor: pointer;
}

.hot-material-advanced-toggle:hover,
.hot-material-advanced-toggle:focus-visible {
  border-color: rgba(215, 255, 47, 0.55);
  outline: none;
}

.hot-material-advanced-toggle span {
  font-size: 13px;
  font-weight: 800;
}

.hot-material-advanced-toggle em {
  color: var(--acid);
  font-size: 12px;
  font-style: normal;
}

.hot-material-strategies-advanced {
  margin-top: 10px;
}

.hot-material-raw-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151619;
}

.hot-material-raw-panel.has-files {
  border-color: rgba(215, 255, 47, 0.42);
}

.hot-material-raw-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.hot-material-raw-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hot-material-raw-heading span {
  border-radius: 999px;
  padding: 4px 7px;
  color: #111;
  background: var(--acid);
  font-size: 10px;
  font-weight: 900;
}

.hot-material-raw-heading strong {
  color: #fff;
  font-size: 16px;
}

.hot-material-raw-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.hot-material-raw-drop {
  min-height: 86px;
  margin-top: 14px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px dashed rgba(244, 240, 230, 0.28);
  border-radius: 8px;
  background: #1b1c1f;
  cursor: pointer;
}

.hot-material-raw-drop:hover,
.hot-material-raw-drop:focus-within {
  border-color: var(--acid);
  background: rgba(215, 255, 47, 0.05);
}

.hot-material-raw-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hot-material-raw-drop strong {
  color: #fff;
  font-size: 14px;
}

.hot-material-raw-drop span {
  color: var(--muted);
  font-size: 11px;
}

.hot-material-raw-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hot-material-raw-item {
  min-width: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202125;
}

.hot-material-raw-item video {
  width: 72px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
  background: #08090a;
}

.hot-material-raw-item strong,
.hot-material-raw-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-material-raw-item strong {
  color: #fff;
  font-size: 12px;
}

.hot-material-raw-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.hot-material-raw-item button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.hot-material-raw-item button:hover,
.hot-material-raw-item button:focus-visible {
  border-color: var(--coral);
  color: #fff;
  outline: none;
}

.hot-material-raw-capability {
  margin-top: 12px;
  padding: 11px 12px;
  border-left: 3px solid var(--amber);
  background: rgba(191, 123, 24, 0.09);
}

.hot-material-raw-capability strong {
  color: #fff;
  font-size: 12px;
}

.hot-material-raw-capability p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.hot-material-notice,
.hot-material-success {
  margin-top: 18px;
  border: 1px solid rgba(35, 225, 166, 0.3);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(35, 225, 166, 0.07);
}

.hot-material-notice.warning {
  border-color: rgba(225, 95, 70, 0.45);
  background: rgba(225, 95, 70, 0.08);
}

.hot-material-notice strong,
.hot-material-success strong {
  color: #fff;
  font-size: 14px;
}

.hot-material-notice p,
.hot-material-success p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hot-material-loading {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
}

.hot-material-loading span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(244, 240, 230, 0.16);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: hot-material-spin 800ms linear infinite;
}

@keyframes hot-material-spin {
  to { transform: rotate(360deg); }
}

.hot-material-task-head {
  margin-top: 18px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.hot-material-task-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hot-material-task-head > div > strong {
  color: #fff;
  font-size: 14px;
}

.hot-material-task-head > em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.hot-material-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  color: #111;
  background: var(--acid);
  font-size: 11px;
  font-weight: 900;
}

.hot-material-status.status-failed,
.hot-material-status.status-expired {
  color: #fff;
  background: var(--coral);
}

.hot-material-status.status-adopted,
.hot-material-status.status-reviewable {
  background: var(--green);
}

.hot-material-progress {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #18191c;
}

.hot-material-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hot-material-progress strong {
  color: var(--acid);
}

.hot-material-progress-track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #303238;
}

.hot-material-progress-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--acid);
  transition: width 240ms ease;
}

.hot-material-progress p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hot-material-candidates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hot-material-candidate {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191a1d;
}

.hot-material-candidate.selected {
  border-color: rgba(215, 255, 47, 0.55);
}

.hot-material-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #08090a;
}

.hot-material-video video,
.hot-material-video-empty {
  width: 100%;
  height: 100%;
}

.hot-material-video video {
  display: block;
  object-fit: contain;
}

.hot-material-video-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.hot-material-video-error {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 20px;
  background: #0c0d0f;
  color: var(--muted);
  text-align: center;
}

.hot-material-video.has-error .hot-material-video-error {
  display: grid;
}

.hot-material-video-error strong {
  color: #fff;
  font-size: 13px;
}

.hot-material-video-error button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--acid);
  border-radius: 6px;
  background: transparent;
  color: var(--acid);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.hot-material-video-error button:hover,
.hot-material-video-error button:focus-visible {
  background: var(--acid);
  color: #111;
  outline: none;
}

.hot-material-candidate > label {
  min-height: 70px;
  padding: 12px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.hot-material-candidate strong,
.hot-material-candidate em {
  display: block;
  overflow-wrap: anywhere;
}

.hot-material-candidate strong {
  color: #fff;
  font-size: 13px;
}

.hot-material-candidate em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.hot-material-footer {
  margin-top: 22px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.hot-material-footer > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.hot-material-footer .creative-action {
  width: auto;
  min-width: 160px;
  min-height: 44px;
  padding-inline: 18px;
}

@media (max-width: 700px) {
  .hot-material-modal {
    padding: 0;
  }

  .hot-material-dialog {
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .hot-material-header {
    top: 0;
    min-height: 74px;
    padding: 15px;
  }

  .hot-material-body {
    padding: 15px;
  }

  .hot-material-origin,
  .hot-material-section-heading,
  .hot-material-task-head,
  .hot-material-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hot-material-product {
    align-self: flex-start;
  }

  .hot-material-section-heading p {
    text-align: left;
  }

  .hot-material-strategies,
  .hot-material-candidates,
  .hot-material-raw-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .hot-material-raw-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .hot-material-raw-heading p {
    text-align: left;
  }

  .hot-material-task-head > div {
    align-items: flex-start;
  }

  .hot-material-footer .creative-action {
    width: 100%;
  }
}
