:root {
  --bg: #eef2f4;
  --surface: #ffffff;
  --surface-alt: #f7f9fa;
  --ink: #14242a;
  --muted: #61747c;
  --line: #d9e2e5;
  --brand: #126b73;
  --brand-dark: #0b4f56;
  --brand-soft: #dff1f1;
  --accent: #d88a26;
  --danger: #a43f3f;
  --danger-soft: #f9e7e5;
  --success: #2f7758;
  --success-soft: #e5f3eb;
  --warning: #8a661d;
  --shadow: 0 18px 45px rgba(25, 54, 62, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
button, .button { min-height: 42px; }
code, pre { font-family: "SFMono-Regular", Consolas, monospace; }
pre { max-width: 100%; overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #10272d; color: #d9f0f0; }

.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; color: #d9e7e9; background: #10272d; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, #26a2a8, #136a72); color: white; font-weight: 800; letter-spacing: -.05em; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: #91a8ad; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 5px; margin: 42px 0; }
.sidebar nav a { display: block; padding: 11px 13px; border-radius: 10px; color: #b8c9cd; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: rgba(255,255,255,.08); }
.logout { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 6px; font-size: 12px; color: #91a8ad; overflow-wrap: anywhere; }

.main { min-width: 0; padding: 32px clamp(20px, 4vw, 58px) 60px; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.topbar h1 { margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1.06; letter-spacing: -.035em; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.panel, .metric, .project-card, .provider-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: clamp(20px, 3vw, 30px); margin-bottom: 24px; min-width: 0; }
.panel h2, .project-card h2, .provider-card h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.02em; }
.panel h3 { margin: 24px 0 10px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; }
.section-heading { margin: 28px 0 14px; }
.section-heading:first-of-type { margin-top: 0; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metrics-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric { padding: 22px; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 3px 0; font-size: 34px; line-height: 1; letter-spacing: -.04em; }
.metric.warning { border-color: #ead5b1; background: #fffaf2; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.two-column.wide-left { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); }
.three-column { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.project-card { padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
.project-card p { color: var(--muted); }
.project-card dl { display: grid; gap: 8px; margin: 0; }
.project-card dl div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.project-card dt { color: var(--muted); }
.project-card dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.actions, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-actions { justify-content: flex-end; padding-top: 10px; }
.provider-card { padding: 24px; display: flex; gap: 18px; align-items: flex-start; }
.provider-card.ok { border-top: 4px solid var(--success); }
.provider-card.missing { border-top: 4px solid var(--danger); }
.provider-icon { display: grid; place-items: center; flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-size: 23px; font-weight: 800; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 750; line-height: 1.2; white-space: normal; text-align: center; }
.button:hover { border-color: #afc1c6; color: var(--ink); background: var(--surface-alt); }
.button.primary { border-color: var(--brand); background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-dark); }
.button.danger { border-color: var(--danger); background: var(--danger); color: white; }
.button.danger.secondary { background: var(--danger-soft); color: var(--danger); }
.link-button { padding: 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-weight: 700; }
.inline { display: inline; }

label { display: grid; gap: 6px; color: #334950; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #c8d4d8; border-radius: 10px; background: white; color: var(--ink); padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,107,115,.12); }
textarea { resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 18px; }
.checkbox-row label, label.check { display: flex; align-items: center; gap: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 160px; }
.hint, .muted, small { color: var(--muted); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--surface-alt); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
td strong, td small { display: block; }
td code { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 28px; color: var(--muted); text-align: center; }

.badge, .tag, .status { display: inline-flex; align-items: center; max-width: 100%; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.badge { background: var(--brand-soft); color: var(--brand-dark); }
.tag { background: #eef3f5; color: #456067; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.status { background: #e9eef0; color: #52666d; }
.status.active, .status.approved, .status.delivered, .status.done, .status.converted { background: var(--success-soft); color: var(--success); }
.status.failed, .status.bounced, .status.complained, .status.unsubscribed, .status.blocked, .status.rejected { background: var(--danger-soft); color: var(--danger); }
.status.queued, .status.enriching, .status.sent, .status.accepted, .status.submitted { background: #fff0d8; color: var(--warning); }
.status.draft, .status.imported, .status.enriched, .status.needs_review, .status.edited, .status.generated { background: #e8eef8; color: #405f91; }
.status.archived, .status.canceled, .status.paused { background: #eceeef; color: #6d777b; }
.status-list { display: grid; gap: 10px; }
.status-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.status-list > div:last-child { border-bottom: 0; }

.notice, .callout { margin-bottom: 20px; padding: 15px 17px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.notice.success { border-color: #b9dec9; background: var(--success-soft); color: #245d45; }
.notice.danger { border-color: #ebc1bd; background: var(--danger-soft); color: #7e3232; }
.callout { margin-top: 22px; background: var(--brand-soft); border-color: #bcdede; }
.callout p { margin: 4px 0 0; }
.danger-zone { border-color: #e7c1bd; }
.danger-text { color: var(--danger); }
.info-panel { background: linear-gradient(160deg, #ffffff, #f1f7f7); }
.info-panel ol { padding-left: 22px; }
.step { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 0 16px; border-radius: 50%; color: white; background: var(--brand); font-weight: 800; }

.tabs { min-width: 0; }
.tab-buttons { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tab-buttons button { border: 0; border-radius: 8px; background: transparent; padding: 9px 14px; color: var(--muted); font-weight: 800; cursor: pointer; white-space: nowrap; }
.tab-buttons button.active { background: var(--brand); color: white; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.editor { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.editor summary { cursor: pointer; font-weight: 800; margin-bottom: 16px; }
.block-list, .evidence-list, .timeline { display: grid; gap: 12px; }
.block, .evidence-list article, .timeline > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.block strong, .block code { display: block; }
.block p { white-space: pre-wrap; }
.evidence-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.evidence-list blockquote { margin: 12px 0; color: #3d555d; }
.data-list { display: grid; gap: 12px; margin: 0; }
.data-list div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.data-list dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.data-list dd { margin: 4px 0 0; overflow-wrap: anywhere; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at top left, #dbecee, transparent 42%), #10272d; }
.login-card { width: min(460px, 100%); padding: 34px; border-radius: 22px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-card h1 { margin: 28px 0 5px; font-size: 34px; }
.login-brand { color: var(--ink); }

@media (max-width: 1150px) {
  .metrics-grid.compact { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .three-column { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px; }
  .sidebar nav { display: flex; overflow-x: auto; margin: 20px 0 8px; }
  .sidebar nav a { white-space: nowrap; }
  .logout { display: none; }
  .main { padding: 24px 18px 48px; }
  .metrics-grid, .metrics-grid.compact { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-column, .two-column.wide-left { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}
@media (max-width: 620px) {
  .topbar { display: grid; }
  .top-actions { justify-content: flex-start; }
  .metrics-grid, .metrics-grid.compact, .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .inline-form { width: 100%; }
  .inline-form input, .inline-form select, .inline-form .button { width: 100%; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1 1 100%; }
}
.qr-code { width: min(280px, 100%); height: auto; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.recovery-grid code { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); text-align: center; font-size: 17px; letter-spacing: .08em; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-text { font-size: 17px !important; line-height: 1.25 !important; overflow-wrap: anywhere; }
.form-narrow { max-width: 520px; }
@media (max-width: 1000px) { .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .mapping-grid, .recovery-grid { grid-template-columns: 1fr; } }


/* AI target-group assistant */
.orchestrator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
}
.orchestrator-hero h2 { max-width: 760px; margin-bottom: 10px; }
.orchestrator-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.orchestrator-stats div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.orchestrator-stats span,
.orchestrator-stats strong { display: block; overflow-wrap: anywhere; }
.orchestrator-stats span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.orchestrator-stats strong { margin-top: 8px; font-size: 20px; }
.feature-list { display: grid; gap: 10px; margin: 18px 0 0; padding-left: 20px; }
.orchestrator-plan { margin-top: 18px; }
.code-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}
.orchestrator-preview { padding-top: 8px; }
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.candidate-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
}
.candidate-card strong,
.candidate-card span,
.candidate-card small { display: block; overflow-wrap: anywhere; }
.candidate-card span { margin-top: 6px; }
.candidate-card small { margin-top: 3px; color: var(--muted); }

@media (max-width: 1050px) {
  .orchestrator-hero { grid-template-columns: 1fr; }
  .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .orchestrator-stats,
  .candidate-grid { grid-template-columns: 1fr; }
}

/* v1.4.1 background processing visibility */
.job-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.job-strip > div {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #dfe7ea);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.job-strip span { color: var(--muted, #64757c); font-size: .84rem; }
.job-strip strong { font-size: 1.2rem; }
.notice.danger { border-color: #e8b4b4; background: #fff1f1; color: #7f1d1d; }
.status.enrichment_queued,
.status.draft_queued { background: #fff7d6; color: #735c00; }
.status.enriching,
.status.drafting { background: #e5f4ff; color: #075985; }
@media (max-width: 760px) {
  .job-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v1.4.2 global process feedback */
.process-loader[hidden] { display: none !important; }
.process-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 31, 37, .52);
  backdrop-filter: blur(5px);
}
.process-loader-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}
.process-loader-card strong,
.process-loader-card p,
.process-loader-card small { display: block; }
.process-loader-card strong { font-size: 18px; }
.process-loader-card p { margin: 6px 0; color: var(--muted); }
.process-loader-card small { color: var(--brand); font-weight: 800; }
.process-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: gi-spin .8s linear infinite;
}
.is-processing { cursor: progress; }
@keyframes gi-spin { to { transform: rotate(360deg); } }

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.bulk-actions label { min-width: 220px; }
.delete-warning { font-size: 12px; color: var(--danger); }

/* v1.4.6 campaign AI cost controls and DIN letter branding */
.settings-group {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}
.settings-group legend {
  padding: 0 8px;
  font-weight: 800;
  color: var(--ink);
}
.notice.compact { margin-top: 12px; padding: 12px 14px; }
.logo-settings {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}
.logo-settings .inline-form { margin-top: 14px; }
.logo-preview {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 22px;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: 16px;
  background: white;
  color: var(--muted);
  text-align: center;
}
.logo-preview img { width: min(240px, 100%); max-height: 100px; object-fit: contain; }
.logo-preview small { overflow-wrap: anywhere; }
@media (max-width: 850px) { .logo-settings { grid-template-columns: 1fr; } }

/* v1.4.8 PNG branding and automatic logo color extraction */
.color-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.color-control input[type="color"] { width: 58px; min-height: 42px; padding: 4px; }
.color-control code { font-size: 12px; color: var(--muted); }
.color-control.is-auto input[type="color"] { opacity: .48; cursor: not-allowed; }
.accent-detection {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: 13px;
}
.accent-swatch {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  background: var(--detected-accent);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

/* v1.5.0 project/language text library */
.text-library { gap: 22px; }
.text-library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(145deg, #fff 0%, #eef7f7 100%);
}
.text-library-hero h2 { max-width: 780px; }
.text-pack-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.78);
}
.text-pack-status span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.text-pack-status strong { min-width: 0; overflow-wrap: anywhere; }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.preset-option {
  position: relative;
  display: block;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.preset-option:hover { border-color: #a9c4c8; transform: translateY(-1px); }
.preset-option.selected,
.preset-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,107,115,.1); background: #f6fbfb; }
.preset-option input { position: absolute; top: 15px; right: 15px; width: 18px; height: 18px; }
.preset-option-copy { display: grid; gap: 8px; padding-right: 28px; }
.preset-option-copy strong { font-size: 16px; color: var(--ink); }
.preset-option-copy small { line-height: 1.45; }
.settings-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-alt);
}
.locale-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.locale-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 800;
}
.locale-tab span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: white; font-size: 11px; }
.locale-tab.active { border-color: var(--brand); background: var(--brand); color: white; }
.locale-tab.active span { color: var(--brand-dark); }
.text-block-grid { display: grid; gap: 14px; }
.text-block-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}
.text-block-card.is-inactive { opacity: .7; }
.text-block-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.text-block-title { min-width: 0; }
.text-block-title h3 { margin: 8px 0 2px; }
.text-block-title code { display: block; color: var(--muted); overflow-wrap: anywhere; }
.text-block-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.text-block-actions form { margin: 0; }
.block-subject { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--brand); background: white; border-radius: 0 9px 9px 0; }
.block-preview { margin: 14px 0; white-space: pre-wrap; color: #30484f; }
.text-block-card > footer { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.block-editor,
.new-block-editor,
.advanced-editor { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 13px; }
.block-editor > summary,
.new-block-editor > summary,
.advanced-editor > summary { cursor: pointer; color: var(--brand); font-weight: 800; }
.block-editor form,
.new-block-editor form { margin-top: 16px; }
.new-block-editor { margin-top: 22px; padding: 17px; border: 1px dashed #aebfc4; border-radius: 15px; background: #fbfdfd; }
.compact-fields { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.empty-state { padding: 34px; border: 1px dashed var(--line); border-radius: 15px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 17px; }
.signal-rule-panel { padding: 0; overflow: hidden; }
.signal-rule-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  cursor: pointer;
  list-style: none;
}
.signal-rule-panel > summary::-webkit-details-marker { display: none; }
.signal-rule-panel > summary strong { display: block; font-size: 20px; }
.signal-rule-panel[open] > summary { border-bottom: 1px solid var(--line); }
.signal-rule-panel > .table-wrap,
.signal-rule-panel > .editor { margin: 0 28px 24px; }
@media (max-width: 900px) {
  .text-library-hero { grid-template-columns: 1fr; }
  .text-block-card > header { display: grid; }
  .text-block-actions { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .preset-grid { grid-template-columns: 1fr; }
  .settings-strip { display: grid; }
  .locale-tabs { display: grid; grid-template-columns: 1fr; }
  .locale-tab { justify-content: space-between; }
  .text-block-actions .button { width: 100%; }
  .text-block-actions form { flex: 1 1 100%; }
  .signal-rule-panel > summary { padding: 18px; }
  .signal-rule-panel > .table-wrap,
  .signal-rule-panel > .editor { margin: 0 18px 18px; }
}
