:root {
  --brand-primary: #0B3D91;
  --brand-secondary: #D4A017;
  --brand-support: #F5F7FA;
  --brand-heading-font: Inter;
  --brand-body-font: Arial;
  --ink: #182230;
  --muted: #667085;
  --line: #d7dde8;
  --paper: var(--brand-support);
  --panel: #ffffff;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(20, 83, 45, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 320px;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--brand-body-font), Inter, Arial, sans-serif;
  word-break: normal;
  overflow-wrap: normal;
  overflow-x: hidden;
  overflow-y: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  word-break: normal;
  overflow-wrap: normal;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

h1,
h2,
h3,
p {
  word-break: normal;
  overflow-wrap: normal;
}

h1,
h2,
h3 {
  font-family: var(--brand-heading-font), Inter, Arial, sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

table {
  width: 100%;
  max-width: none;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

small {
  color: var(--muted);
  font-weight: 600;
}

#app {
  width: 100%;
  max-width: none;
  min-height: 100vh;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  background: var(--brand-primary);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffe8a3;
  font-weight: 800;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.brand p {
  color: #fff;
  font-weight: 800;
}

.brand span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
  overflow-y: visible;
}

.topbar,
.section-heading,
.panel-title,
.report-preview header,
.record-card header {
  width: 100%;
  max-width: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar > div:first-child,
.section-heading > div:first-child,
.welcome-panel > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.top-actions,
.auth-actions,
.quick-actions,
.form-actions,
.row-actions,
.table-actions,
.export-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-welcome {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px;
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

.owner-entry-card {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(20, 83, 45, 0.18);
  border-left: 5px solid var(--brand-primary);
  border-radius: 8px;
  background: #f7fbf8;
}

.owner-entry-card span {
  color: var(--brand-secondary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.owner-entry-card strong {
  color: var(--brand-primary);
  font-size: 1.35rem;
}

.owner-entry-card p {
  margin: 0;
  color: var(--muted);
}

.spems-shell {
  width: 100%;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.spems-sidebar,
.spems-workspace,
.spems-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.spems-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.spems-brand {
  display: grid;
  gap: 4px;
  padding: 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.spems-brand span {
  color: var(--brand-secondary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.spems-brand strong {
  color: var(--brand-primary);
}

.spems-sidebar button {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font-weight: 800;
  text-align: left;
}

.spems-sidebar button.active,
.spems-sidebar button:hover {
  border-color: rgba(20, 83, 45, 0.18);
  background: #f0f7f2;
  color: var(--brand-primary);
}

.spems-workspace {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.spems-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.spems-header h2 {
  color: var(--brand-primary);
}

.spems-header-actions,
.spems-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

.spems-kpi-grid,
.spems-chart-grid,
.spems-integration-grid,
.spems-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.spems-kpi small {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.spems-panel {
  padding: 18px;
}

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

.spems-bars {
  display: grid;
  gap: 12px;
}

.spems-bar {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.spems-bar div,
.spems-gantt-bar {
  min-width: 120px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.spems-bar i,
.spems-gantt-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.spems-alert-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.spems-integration-grid article,
.spems-report-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.spems-upload {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 11px 14px;
  border: 1px dashed var(--brand-primary);
  border-radius: 8px;
  color: var(--brand-primary);
  font-weight: 900;
}

.spems-upload input {
  display: none;
}

.spems-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.spems-evidence-list span {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f0f7f2;
  color: var(--brand-primary);
  font-weight: 800;
}

.spems-report-preview {
  box-shadow: none;
}

.elite-strategy-report {
  width: 100%;
}

.consulting-cover,
.executive-summary-box,
.consulting-callout,
.consulting-figure {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.consulting-cover {
  min-height: 420px;
  display: grid;
  align-content: center;
  border-top: 6px solid var(--brand-secondary);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.elite-cover {
  position: relative;
  overflow: hidden;
  gap: 14px;
  padding: clamp(24px, 4vw, 48px);
  border: 0;
  border-top: 8px solid var(--brand-secondary);
  background:
    linear-gradient(135deg, rgba(20, 83, 45, 0.08), rgba(201, 151, 43, 0.1)),
    #fff;
}

.elite-cover::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border: 38px solid rgba(20, 83, 45, 0.08);
  border-radius: 50%;
}

.cover-logo-slot {
  width: 112px;
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(20, 83, 45, 0.35);
  border-radius: 8px;
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.cover-logo-slot.has-logo {
  width: min(180px, 45vw);
  min-height: auto;
  padding: 0;
  border: 0;
  place-items: start;
}

.cover-logo-slot img,
.report-logo-preview img {
  max-width: 100%;
  max-height: 86px;
  object-fit: contain;
  object-position: left center;
}

.report-branding-section {
  background: #fbfcfe;
}

.report-logo-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.report-logo-preview {
  width: 150px;
  min-height: 86px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-logo-preview.has-logo {
  place-items: center start;
  border-style: solid;
}

.checkbox-question {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-question input {
  width: auto;
  margin-top: 5px;
}

.cover-confidentiality {
  max-width: 760px;
  margin-top: 14px;
  color: #475467;
  font-size: 13px;
  font-style: italic;
}

.consulting-cover h1 {
  max-width: 860px;
  color: var(--brand-primary);
  font-size: 2rem;
  line-height: 1.2;
}

.cover-subtitle {
  max-width: 760px;
  color: #344054;
  font-size: 16px;
  font-weight: 700;
}

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

.cover-meta-grid span,
.snapshot-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  overflow-wrap: anywhere;
}

.cover-meta-grid strong,
.snapshot-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--brand-primary);
  font-size: 12px;
  text-transform: uppercase;
}

.snapshot-grid article:nth-child(even) {
  background: #fffbeb;
}

.executive-summary-box {
  border-left: 5px solid var(--brand-primary);
  background: #f7fbf8;
}

.consulting-callout {
  border-left: 5px solid var(--brand-secondary);
  background: #fffbeb;
}

.consulting-callout p {
  margin: 6px 0 0;
}

.consulting-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.consulting-table th,
.consulting-table td {
  padding: 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.consulting-table th {
  background: #f1f5f3;
  color: var(--brand-primary);
  font-weight: 900;
}

.consulting-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.report-toc {
  display: grid;
  gap: 7px;
  padding-left: 0;
}

.report-toc a {
  display: block;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--brand-primary);
  font-weight: 800;
  text-decoration: none;
}

.report-toc span {
  display: inline-block;
  min-width: 28px;
  color: var(--brand-secondary);
}

.flow-figure {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.flow-figure span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-primary);
  font-weight: 900;
}

.flow-figure b {
  color: var(--brand-secondary);
}

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

.pestle-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.consulting-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.invoice-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

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

.invoice-form-grid label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 800;
}

.invoice-form-grid input,
.invoice-form-grid select,
.invoice-form-grid textarea,
.invoice-items-editor input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.full-field {
  grid-column: 1 / -1;
}

.invoice-client-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.invoice-client-list button {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: #344054;
  text-align: left;
}

.invoice-client-list button:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.invoice-register .row-actions {
  flex-wrap: nowrap;
}

.invoice-status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-weight: 900;
  white-space: nowrap;
}

.invoice-status.paid {
  background: #ecfdf3;
  color: #067647;
}

.invoice-status.overdue,
.invoice-status.cancelled {
  background: #fff1f3;
  color: #b42318;
}

.invoice-status.sent,
.invoice-status.partially-paid {
  background: #fffaeb;
  color: #b54708;
}

.invoice-preview-shell {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.invoice-document {
  display: grid;
  gap: 18px;
  color: #182230;
}

.invoice-doc-header,
.invoice-doc-grid {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  border-bottom: 2px solid var(--line);
  padding-bottom: 18px;
}

.invoice-doc-header h1 {
  color: var(--brand-primary);
  font-size: 2.6rem;
  line-height: 1;
}

.invoice-doc-header h2 {
  color: var(--brand-secondary);
}

.invoice-company-block {
  display: grid;
  gap: 3px;
  text-align: right;
}

.invoice-doc-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-doc-table th,
.invoice-doc-table td {
  padding: 10px;
  border: 1px solid var(--line);
}

.invoice-doc-table th {
  background: #f1f5f3;
  color: var(--brand-primary);
}

.invoice-total-box {
  width: min(380px, 100%);
  margin-left: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.invoice-total-box p {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
}

.invoice-total-due {
  color: var(--brand-primary);
  font-size: 1.2rem;
}

.invoice-payment-block,
.invoice-signature {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.invoice-payment-block pre {
  white-space: pre-wrap;
  font: inherit;
  color: #344054;
}

.invoice-signature div {
  width: min(320px, 100%);
  height: 52px;
  border-bottom: 1px solid #344054;
}

.social-dashboard-grid,
.social-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

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

.social-form-grid label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 800;
}

.social-form-grid input,
.social-form-grid select,
.social-form-grid textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.social-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  background: #fffbeb;
  border-color: #fedf89;
}

.social-api-fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.social-api-fieldset legend {
  padding: 0 6px;
  color: var(--brand-primary);
  font-weight: 900;
}

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

.social-settings-grid article,
.social-schedule-details span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.social-connection-card {
  align-content: start;
}

.social-connection-card p,
.social-connection-card small {
  margin: 0;
  color: #667085;
}

.social-settings-grid span,
.social-schedule-details span {
  overflow-wrap: anywhere;
  color: #667085;
}

.social-calendar {
  display: grid;
  gap: 10px;
}

.social-calendar article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.social-platform-bars {
  display: grid;
  gap: 12px;
}

.social-platform-bar {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.social-platform-bar div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.social-platform-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.social-post-preview {
  display: grid;
  gap: 12px;
}

.social-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.social-preview-top span,
.social-preview-top strong,
.social-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-weight: 900;
}

.social-status.published {
  background: #ecfdf3;
  color: #067647;
}

.social-status.published-externally {
  background: #ecfdf3;
  color: #067647;
}

.social-status.published-manually,
.social-status.published-via-api {
  background: #ecfdf3;
  color: #067647;
}

.social-status.failed {
  background: #fff1f3;
  color: #b42318;
}

.social-status.failed-api-posting {
  background: #fff1f3;
  color: #b42318;
}

.social-status.scheduled,
.social-status.scheduled-internally,
.social-status.approved,
.social-status.ready-for-manual-posting,
.social-status.ready-to-publish-manually,
.social-status.generated {
  background: #fffaeb;
  color: #b54708;
}

.social-status.draft {
  background: #eef2f6;
  color: #344054;
}

.social-post-preview img,
.social-image-placeholder {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  object-fit: cover;
}

.social-image-placeholder {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.social-caption {
  margin: 0;
  color: #344054;
  font-weight: 800;
}

.social-final-text {
  white-space: pre-wrap;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #182230;
  font: inherit;
}

.social-tags {
  color: var(--brand-primary);
  font-weight: 800;
}

.ai-intake-panel {
  border-color: #b7e4c7;
  background: #fbfffc;
}

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

.ai-intake-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 800;
}

.ai-intake-form input,
.ai-intake-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.ai-intake-status,
.ai-intake-preview .note {
  color: #067647;
  font-weight: 800;
}

.social-approved-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-weight: 900;
}

.social-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 24, 40, 0.6);
}

.social-modal {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(820px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 24px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.25);
}

.social-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.breadcrumbs {
  color: #667085;
  font-size: 0.92rem;
  font-weight: 800;
}

.modal-close {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #344054;
  font-weight: 900;
  cursor: pointer;
}

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

  .spems-sidebar {
    position: static;
  }

  .spems-header,
  .spems-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .spems-kpi-grid,
  .spems-chart-grid,
  .spems-integration-grid,
  .spems-report-grid,
  .spems-field-grid,
  .invoice-layout,
  .invoice-form-grid,
  .social-dashboard-grid,
  .social-layout,
  .social-form-grid,
  .ai-intake-form,
  .social-settings-grid,
  .social-schedule-details {
    grid-template-columns: 1fr;
  }

  .invoice-doc-header,
  .invoice-doc-grid {
    flex-direction: column;
  }

  .invoice-company-block {
    text-align: left;
  }
}

.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-primary);
  font-weight: 800;
  text-decoration: underline;
}

.auth-page {
  width: 100%;
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: start center;
  padding: 28px 0;
}

.auth-card {
  width: min(100%, 680px);
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand-secondary);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin-bottom: 8px;
}

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

.auth-form-grid label:first-child,
.auth-form-grid label:last-child {
  grid-column: 1 / -1;
}

.auth-message {
  padding: 12px 14px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffaeb;
  color: #93370d;
  font-weight: 800;
}

.auth-switch {
  color: #344054;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
}

.dev-verification-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--brand-secondary);
  border-radius: 8px;
  background: #fffdf4;
}

.dev-verification-box strong {
  color: #344054;
}

.dev-verification-box span {
  color: var(--brand-primary);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-control-center .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-section-grid {
  display: grid;
  gap: 18px;
}

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

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.role-badge.owner {
  background: #111827;
  color: #ffe8a3;
}

.role-badge.admin {
  background: #eef4ff;
  color: #1849a9;
}

.role-badge.verified {
  background: #ecfdf3;
  color: #067647;
}

.role-badge.pending {
  background: #fffaeb;
  color: #b54708;
}

.role-badge.suspended {
  background: #fff5f5;
  color: var(--danger);
}

.admin-user-table small {
  display: block;
  margin-top: 4px;
  color: var(--brand-secondary);
}

.quick-actions {
  align-content: start;
  justify-content: flex-start;
}

.page-stack {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-btn {
  background: var(--brand-primary);
  color: #fff;
}

.secondary-btn,
.icon-btn {
  border-color: var(--line);
  background: #fff;
  color: var(--brand-primary);
}

.danger-btn,
.icon-btn.danger {
  border-color: #fecdca;
  background: #fff5f5;
  color: var(--danger);
}

.welcome-panel,
.panel,
.metric-card,
.record-card,
.module-card,
.report-preview,
.form-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.welcome-panel {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(260px, 360px);
  gap: 24px;
  padding: 24px;
  border-top: 5px solid var(--brand-secondary);
}

.metric-grid {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel,
.record-card,
.module-card,
.report-preview {
  width: 100%;
  max-width: none;
  padding: 20px;
}

.panel-title h3 {
  margin: 0;
}

.panel-title span,
.report-preview header span,
.module-card > span,
.record-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-grid {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

.form-grid label:has(textarea),
.form-actions {
  grid-column: 1 / -1;
}

.records-grid,
.report-list {
  display: grid;
  gap: 14px;
}

.record-card {
  display: grid;
  gap: 14px;
}

.detail-list {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ecfdf3;
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
}

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

.module-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 230px;
}

.module-card.ready {
  border-top: 5px solid var(--brand-secondary);
}

.report-preview {
  display: grid;
  gap: 16px;
}

.export-grid {
  padding-top: 6px;
}

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

.intake-outline article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.intake-outline span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 800;
}

.intake-outline h3 {
  align-self: center;
  margin: 0;
}

.intake-outline p {
  grid-column: 2;
}

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

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

.strategy-module {
  align-items: start;
}

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

.strategy-section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.strategy-section legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.strategy-section legend span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 14px;
}

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

.strategy-question {
  align-content: start;
  padding: 14px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.strategy-question span {
  color: var(--ink);
  font-size: 14px;
}

.strategy-question textarea,
.strategy-question select,
.strategy-question input {
  width: 100%;
}

.strategy-question textarea {
  min-height: 118px;
  line-height: 1.5;
}

.partner-one-field {
  border-left: 4px solid var(--brand-primary);
}

.partner-two-field {
  border-left: 4px solid var(--brand-secondary);
}

.strategy-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.digital-intake-pack {
  margin-bottom: 18px;
}

.digital-intake-pack p {
  margin: 8px 0 14px;
  color: #344054;
}

.intake-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.intake-source-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}

.intake-current-source,
.uploaded-file-card,
.draft-save-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  color: #344054;
  overflow-wrap: anywhere;
}

.uploaded-file-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-left: 5px solid var(--brand-primary);
}

.uploaded-file-card span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef6f0;
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
}

.draft-save-status {
  margin-top: 10px;
  background: #fffbeb;
  border-left: 5px solid var(--brand-secondary);
  font-size: 12px;
  font-weight: 800;
}

.intake-summary {
  display: block;
  margin-top: 14px;
}

.generated-report {
  width: 100%;
  max-width: none;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.generated-report header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 8px;
}

.generated-report-section {
  padding-top: 18px;
}

.generated-report-section h3 {
  margin-bottom: 8px;
  color: var(--brand-primary);
  font-size: 20px;
}

.generated-report-section h4 {
  margin: 14px 0 8px;
  color: #344054;
  font-size: 16px;
}

.generated-report-section p {
  margin-bottom: 10px;
  color: #344054;
}

.quality-warning {
  border: 1px solid #f6c453;
  border-left: 5px solid #d97706;
  background: #fffbeb;
  color: #7c2d12;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
}

.quality-warning ul {
  margin: 8px 0 0 18px;
}

.seo-elements-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-top: 28px;
  background: #f8fafc;
}

.seo-elements-box dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.seo-elements-box dt {
  font-weight: 700;
  color: var(--brand-primary);
}

.seo-elements-box dd {
  margin: 4px 0 0;
  color: #344054;
}

.seo-metadata-text {
  white-space: pre-wrap;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  font-family: inherit;
}

.autofill-status {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand-primary);
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px;
}

.autofill-status p {
  margin: 6px 0 0;
}

.autofill-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.autofill-metrics span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.strategy-question.autofill-confident {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.14);
}

.strategy-question.autofill-review {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.16);
}

.strategy-question.autofill-missing {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

.publishing-report section {
  margin: 26px 0;
}

.publishing-report h1 {
  font-size: 34px;
  color: var(--brand-primary);
}

.publishing-report h2 {
  margin: 22px 0 10px;
  color: var(--brand-primary);
}

.publishing-report h3 {
  margin: 18px 0 8px;
  color: #344054;
}

.book-cover-page {
  min-height: 520px;
  display: grid;
  align-content: center;
  text-align: center;
  border: 1px solid var(--line);
  border-top: 8px solid var(--brand-secondary);
  border-radius: 8px;
  padding: 48px;
  background: #fffdf7;
}

.chapter-opening {
  border-left: 5px solid var(--brand-secondary);
  background: #fffbeb;
  padding: 16px;
  border-radius: 8px;
  margin: 14px 0 18px;
}

.cover-preview-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.ebook-cover-preview {
  aspect-ratio: 2 / 3;
  display: grid;
  align-content: space-between;
  padding: 28px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(150deg, #061b40, #0B3D91 55%, #D4A017);
  box-shadow: var(--shadow);
}

.ebook-cover-preview h3 {
  color: #fff;
  font-size: 28px;
}

.ebook-cover-preview p,
.ebook-cover-preview span,
.ebook-cover-preview strong {
  color: #fff;
}

.publishing-studio,
.publishing-studio * {
  min-width: 0;
}

.publishing-studio {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.publishing-studio .strategy-form,
.publishing-studio .strategy-section,
.publishing-studio .generated-report {
  max-width: 100%;
  overflow: visible;
}

.manuscript-workbench,
.book-cover-studio {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.book-progress-grid,
.cover-format-grid,
.publishing-steps {
  display: grid;
  gap: 12px;
  max-width: 100%;
}

.book-progress-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 14px 0;
}

.book-progress-grid article,
.cover-preview-empty,
.chapter-workspace-preview,
.cover-studio-subsection {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
}

.book-progress-grid strong {
  display: block;
  font-size: 24px;
  color: var(--brand-primary);
}

.book-progress-grid span,
.cover-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.publishing-steps {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 14px 0 18px;
}

.publishing-steps span {
  border: 1px solid rgba(20, 83, 45, 0.18);
  background: #f0fdf4;
  color: var(--brand-primary);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 13px;
}

.cover-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.cover-action-row button {
  white-space: normal;
}

.cover-format-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  margin-top: 16px;
}

.cover-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cover-toolbar span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
}

.cover-production-preview p,
.cover-production-preview td,
.chapter-workspace-preview p,
.publishing-report p,
.publishing-report li {
  overflow-wrap: anywhere;
}

.ebook-cover-preview i {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 10px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 800;
}

.wrap-cover-preview {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}

.wrap-cover-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(44px, var(--spine, 72px)) minmax(280px, 1fr);
  min-width: 780px;
  min-height: 360px;
  border: 2px dashed rgba(20, 83, 45, 0.35);
  background: #fff;
}

.wrap-cover-grid section {
  margin: 0;
  padding: 20px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 10px;
}

.wrap-cover-grid section:last-child {
  border-right: none;
}

.cover-spine {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-align: center;
  align-content: center !important;
  justify-content: center;
  background: var(--brand-primary);
  color: #fff;
  padding: 12px 4px !important;
}

.cover-spine span,
.cover-spine small {
  color: #fff;
}

.barcode-box {
  justify-self: end;
  align-self: end;
  width: 128px;
  height: 78px;
  border: 2px solid #111827;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  color: #111827;
}

.cover-check-table {
  min-width: 760px;
}

.resume-preview .generated-report-section p {
  color: #1d2939;
  line-height: 1.65;
}

.candidate-table {
  margin: 8px 0 14px;
  border: 1px solid var(--line);
}

.candidate-table th,
.candidate-table td {
  border: 1px solid var(--line);
}

.logo-preview-grid,
.upload-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.logo-preview-card,
.upload-reference-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.logo-preview-card.selected {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.12);
}

.visual-logo-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #eef2f6;
  border-radius: 8px;
}

.branding-upload-thumb,
.upload-reference-grid img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.branding-settings-panel {
  border-top: 5px solid var(--brand-secondary);
}

.brand-preview-strip,
.brand-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.brand-preview-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand-preview-card span {
  font-weight: 800;
  color: var(--brand-primary);
}

.brand-preview-card img {
  width: 100%;
  max-width: 180px;
  height: 76px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, var(--brand-support));
  padding: 8px;
}

.brand-preview-card strong {
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.brand-upload-control em {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.upload-note,
.limitation-note {
  display: block;
  margin-top: 10px;
  color: #667085;
  font-style: normal;
}

.ai-logo-studio-output {
  border-top: 1px solid var(--line);
  margin-top: 18px;
}

.ai-logo-status {
  min-height: 22px;
  margin: 12px 0;
  color: #344054;
}

.ai-logo-status.loading {
  color: var(--brand-primary);
  font-weight: 700;
}

.ai-logo-status.error {
  color: #b42318;
  font-weight: 700;
}

.ai-logo-result {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-logo-result img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-logo-result pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
}

.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.palette-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  background: #fff;
}

.palette-swatch i {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.letterhead-preview {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: #fff;
  color: #182230;
}

.visual-letterhead {
  position: relative;
  width: min(100%, 794px);
  min-height: 1123px;
  margin-inline: auto;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.12);
}

.letterhead-watermark {
  position: absolute;
  inset: 38% auto auto 50%;
  transform: translate(-50%, -50%);
  color: color-mix(in srgb, var(--preview-primary) 10%, transparent);
  font-size: 150px;
  font-weight: 900;
  pointer-events: none;
}

.letterhead-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-top: 8px solid var(--preview-primary);
  border-bottom: 2px solid var(--preview-secondary);
}

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

.visual-letterhead-logo {
  max-width: 360px;
}

.visual-letterhead-logo img,
.visual-letterhead-logo .visual-logo-svg {
  max-width: 190px;
  max-height: 100px;
  object-fit: contain;
  border: 0;
}

.letterhead-logo span {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--preview-primary);
  color: #fff;
  font-weight: 800;
}

.letterhead-logo strong {
  color: var(--preview-primary);
  font-size: 24px;
}

.letterhead-logo em,
.letterhead-contact,
.letterhead-footer {
  color: #667085;
  font-style: normal;
}

.letterhead-contact {
  text-align: right;
}

.letterhead-body {
  min-height: 720px;
  padding: 30px 36px;
}

.letterhead-signature {
  padding: 20px 36px;
  color: #344054;
}

.letterhead-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
}

.modern-left-header .letterhead-header {
  border-top: 0;
  border-left: 18px solid var(--preview-primary);
}

.top-bar-design .letterhead-header {
  background: var(--preview-primary);
  color: #fff;
}

.top-bar-design .letterhead-logo strong,
.top-bar-design .letterhead-logo em,
.top-bar-design .letterhead-contact {
  color: #fff;
}

.minimal-executive .letterhead-header {
  border-top: 0;
  border-bottom: 1px solid var(--preview-accent);
}

.footer-focused-design .letterhead-header {
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.footer-focused-design .letterhead-footer {
  border-top: 8px solid var(--preview-primary);
  background: #f8fafc;
}

.website-frame {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.website-frame .site-page {
  max-width: none;
}

.website-frame .site-hero {
  padding: 42px 24px;
}

.website-frame .site-hero h1 {
  font-size: 34px;
}

.code-preview {
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #101828;
  color: #f2f4f7;
  white-space: pre-wrap;
  font-size: 12px;
}

.accounting-module {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.esm-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 100%;
  align-items: start;
}

.esm-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f2e22;
  color: #fff;
  box-shadow: var(--shadow);
}

.esm-brand {
  display: grid;
  gap: 4px;
}

.esm-brand strong {
  color: #ffe8a3;
  font-size: 22px;
}

.esm-brand span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.esm-sidebar nav {
  display: grid;
  gap: 6px;
}

.esm-sidebar button {
  min-height: 38px;
  width: 100%;
  display: flex;
  align-items: center;
  border-radius: 8px;
  border: 0;
  padding: 9px 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
  font-weight: 800;
}

.esm-sidebar button:hover,
.esm-sidebar button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.esm-nav-group {
  display: grid;
  gap: 4px;
}

.esm-nav-group summary {
  list-style: none;
}

.esm-nav-group summary::-webkit-details-marker {
  display: none;
}

.esm-nav-group small {
  padding: 0 10px 7px;
  color: rgba(255, 255, 255, 0.62);
}

.esm-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.esm-active-panel {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.esm-active-panel > header {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.esm-active-body {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.esm-hero,
.esm-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.esm-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-top: 5px solid var(--brand-secondary);
}

.esm-hero-status {
  display: grid;
  align-content: center;
  justify-items: end;
  min-width: 190px;
}

.esm-hero-status strong {
  color: var(--brand-primary);
  font-size: 24px;
}

.esm-hero-status span {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.esm-dashboard {
  display: grid;
  gap: 18px;
}

.esm-section {
  overflow: hidden;
}

.esm-section summary {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}

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

.esm-section summary span {
  color: var(--brand-primary);
  font-size: 20px;
  font-weight: 800;
}

.esm-section-body {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.esm-chart-row,
.esm-alert-list,
.esm-activity {
  display: grid;
  gap: 12px;
}

.esm-bar {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
}

.esm-bar div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.esm-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-primary);
}

.esm-bar.warn i {
  background: #d92d20;
}

.esm-bar.neutral i {
  background: var(--brand-secondary);
}

.esm-bar strong {
  text-align: right;
}

.esm-alert-list {
  margin: 0;
  padding-left: 18px;
}

.esm-alert-list li,
.esm-activity li {
  color: #344054;
  line-height: 1.5;
}

.esm-activity {
  margin: 0;
  padding: 0;
  list-style: none;
}

.esm-activity li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.ratio-table {
  min-width: 1100px;
}

.accounting-module .metric-grid,
.accounting-module .panel,
.accounting-module .generated-report {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.accounting-main-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.accounting-full-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.mini-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.mini-form.stacked {
  grid-template-columns: 1fr;
}

.mini-form input,
.mini-form select,
.mini-form textarea,
.mini-form button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.accounting-module .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.accounting-module table {
  min-width: 720px;
}

.accounting-module .candidate-table {
  min-width: 780px;
}

.accounting-module .audit-table {
  min-width: 1180px;
}

.report-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.report-index-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-index-card.active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.12);
}

.report-index-card h3 {
  margin: 0 0 6px;
}

.report-index-card p {
  margin: 0;
  color: var(--muted);
}

.single-report {
  width: 100%;
  max-width: none;
  background: #fff;
}

.single-report-header {
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.single-report-header h1 {
  margin: 0 0 14px;
  color: var(--brand-primary);
}

.single-report-header dl {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
}

.single-report-header dt {
  font-weight: 800;
  color: #344054;
}

.single-report-header dd {
  margin: 0;
}

.single-report-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.audit-value {
  max-width: 260px;
  max-height: 140px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  color: #344054;
}

.accounting-module .export-grid,
.accounting-report-toolbar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.accounting-report-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.accounting-report-toolbar label {
  min-width: 220px;
}

.financial-table .number-cell {
  text-align: right;
  white-space: nowrap;
}

.financial-table .statement-section td {
  background: #eef4f0;
  color: var(--brand-primary);
  font-weight: 800;
}

.financial-table .statement-total td {
  border-top: 2px solid var(--brand-primary);
  background: #fbfcfe;
  font-weight: 800;
}

.status-ok,
.status-warn {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
}

.status-ok {
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.status-warn {
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.inline-status {
  display: inline-flex;
  width: auto;
  padding: 4px 8px;
  white-space: nowrap;
}

.statement-notes {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-secondary);
  border-radius: 8px;
  background: #fbfcfe;
}

.statement-notes h4 {
  margin: 0 0 10px;
  color: var(--brand-primary);
}

.statement-notes ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.statement-notes li {
  color: #344054;
  line-height: 1.55;
}

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

  .esm-sidebar {
    position: static;
    max-height: none;
  }

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

  .accounting-main-grid {
    grid-template-columns: 1fr;
  }

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

  .logo-preview-grid,
  .upload-reference-grid,
  .logo-option-grid,
  .letterhead-option-grid,
  .selected-brand-preview {
    grid-template-columns: 1fr;
  }

  .visual-letterhead {
    min-height: 880px;
  }

  .ai-logo-result {
    grid-template-columns: 1fr;
  }

  .letterhead-header {
    flex-direction: column;
  }

  .letterhead-contact {
    text-align: left;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .sidebar,
  .topbar,
  .nav-list,
  .toast,
  .form-grid,
  .mini-form,
  .export-grid,
  .row-actions,
  button,
  input,
  select,
  textarea {
    display: none !important;
  }

  .app-shell,
  .main,
  .page-stack,
  .generated-report,
  .single-report {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  table {
    border-collapse: collapse;
    width: 100%;
  }

  th,
  td {
    border: 1px solid #777;
    color: #000;
  }

  tr,
  .generated-report-section,
  .statement-notes {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

@media (max-width: 760px) {
  .cover-meta-grid,
  .snapshot-grid,
  .intake-source-grid {
    grid-template-columns: 1fr;
  }

  .esm-hero,
  .esm-activity li {
    display: grid;
  }

  .esm-hero-status {
    justify-items: start;
  }

  .esm-sidebar nav,
  .esm-bar {
    grid-template-columns: 1fr;
  }

  .esm-bar strong {
    text-align: left;
  }

  .accounting-report-toolbar {
    display: grid;
  }
}

.empty-report {
  border-style: dashed;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 380px;
  border-radius: 8px;
  padding: 12px 16px;
  background: #101828;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Global responsive safety layer */
body,
.main,
.page-stack,
.panel,
.record-card,
.module-card,
.report-preview,
.generated-report,
.generated-report-section,
.social-module,
.strategy-module,
.accounting-module,
.spems-workspace,
.esm-workspace {
  min-width: 0;
  max-width: 100%;
}

p,
li,
dd,
td,
th,
small,
span,
strong,
pre,
a,
.social-final-text,
.social-caption,
.social-tags,
.letterhead-contact,
.letterhead-footer,
.generated-report,
.report-preview,
.module-card {
  overflow-wrap: anywhere;
  word-break: normal;
}

pre,
.social-final-text,
.generated-report pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
}

img,
svg,
canvas,
video,
iframe {
  max-width: 100%;
}

.table-wrap,
.generated-report table,
.single-report table {
  max-width: 100%;
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

.table-wrap table,
.social-post-table,
.accounting-module table,
.generated-report table {
  min-width: 680px;
}

.export-grid,
.row-actions,
.form-actions,
.strategy-action-bar,
.top-actions,
.social-modal-actions {
  max-width: 100%;
}

.export-grid > *,
.row-actions > *,
.form-actions > *,
.strategy-action-bar > *,
.top-actions > * {
  min-width: min(180px, 100%);
  white-space: normal;
}

.global-nav-access {
  position: sticky;
  top: 12px;
  z-index: 45;
  display: grid;
  justify-items: start;
  gap: 10px;
  margin: 0 0 16px;
  pointer-events: none;
}

.global-nav-button,
.global-nav-panel {
  pointer-events: auto;
}

.back-to-top-button {
  width: fit-content;
  margin: 22px 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff;
  color: var(--brand-primary);
  font-weight: 900;
  box-shadow: var(--shadow);
}

.page-bottom-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.global-nav-button {
  min-height: 46px;
  border: 1px solid rgba(20, 83, 45, 0.28);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.global-nav-panel {
  width: min(380px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.22);
}

.global-nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.global-nav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.global-nav-links button {
  width: 100%;
}

.global-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.global-breadcrumbs button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-primary);
  font-weight: 900;
}

.brand-workspace-tabs,
.brand-designer-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

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

.module-tabs,
.brand-workspace-tabs.module-tabs {
  align-items: stretch;
}

.module-tabs .tab-button,
.audio-video-tabs button,
.brand-workspace-tabs .tab-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #fff;
  color: var(--brand-primary);
  font-weight: 900;
  box-shadow: none;
}

.module-tabs .tab-button.active,
.audio-video-tabs .active,
.brand-workspace-tabs .tab-button.active {
  border-color: var(--brand-primary);
  background: linear-gradient(180deg, rgba(20, 83, 45, 0.1), rgba(201, 151, 43, 0.08));
  color: var(--brand-primary);
  box-shadow: inset 0 -4px 0 var(--brand-secondary), 0 0 0 4px rgba(20, 83, 45, 0.12);
}

.active-tab-panel {
  border-top: 5px solid var(--brand-secondary);
}

.brand-workspace-card,
.brand-designer-panel {
  min-width: 0;
}

.brand-workspace-card > span,
.brand-mode-grid span {
  color: var(--brand-secondary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.brand-mode-grid span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #f8fafc;
  color: var(--brand-primary);
  letter-spacing: 0;
  text-transform: none;
}

.strategy-action-bar.compact {
  margin-top: 12px;
}

.visual-letterhead,
.letterhead-preview,
.logo-option-card,
.letterhead-option-card,
.selected-brand-preview {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

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

  .sidebar {
    position: static !important;
    height: auto !important;
    max-height: none;
  }

  .app-shell:not(.nav-open) .sidebar .nav-list {
    display: none;
  }

  .app-shell.nav-open .sidebar .nav-list {
    display: grid;
  }

  .main {
    overflow-x: clip;
  }
}

@media (max-width: 900px) {
  .social-dashboard-grid,
  .social-layout,
  .social-form-grid,
  .ai-intake-form,
  .brand-workspace-tabs,
  .brand-designer-workspace,
  .logo-preview-grid,
  .upload-reference-grid,
  .logo-option-grid,
  .letterhead-option-grid,
  .selected-brand-preview,
  .ai-logo-result {
    grid-template-columns: 1fr !important;
  }

  .social-preview-top,
  .social-modal-actions,
  .topbar,
  .section-heading,
  .panel-title,
  .spems-header,
  .esm-active-panel > header {
    display: grid;
  }

  .social-final-text {
    max-height: 48vh;
  }

  .visual-letterhead {
    min-height: 760px;
  }

  .global-nav-access {
    position: sticky;
    top: 8px;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 45;
    margin: 0 0 12px;
    justify-items: stretch;
  }

  .global-nav-button,
  .global-nav-panel,
  .back-to-top-button {
    width: 100%;
  }

  .back-to-top-button {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 14px 12px 92px !important;
  }

  .panel,
  .record-card,
  .module-card,
  .report-preview,
  .generated-report,
  .form-grid {
    padding: 14px !important;
  }

  .nav-list,
  .metric-grid,
  .module-grid,
  .form-grid,
  .strategy-question-grid,
  .social-settings-grid,
  .social-schedule-details,
  .global-nav-links {
    grid-template-columns: 1fr !important;
  }

  .top-actions > *,
  .quick-actions > *,
  .export-grid > *,
  .row-actions > *,
  .form-actions > *,
  .strategy-action-bar > *,
  .primary-btn,
  .secondary-btn,
  .danger-btn,
  .icon-btn {
    width: 100%;
  }

  .social-platform-bar {
    grid-template-columns: 1fr;
  }

  .social-modal-backdrop {
    padding: 10px;
    align-items: start;
  }

  .social-modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .visual-letterhead {
    min-height: 640px;
  }

  .letterhead-header {
    flex-direction: column;
  }

  .letterhead-contact {
    text-align: left;
  }
}

.resume-photo-upload-preview {
  width: 110px;
  height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.resume-source-panel {
  border-left: 5px solid var(--brand-primary);
}

.resume-upload-zone,
.uploaded-documents-panel,
.extracted-review-panel {
  display: grid;
  gap: 14px;
}

.uploaded-documents-panel {
  padding: 16px;
  border: 1px solid #b7e4c7;
  border-radius: 8px;
  background: #f0fdf4;
}

.uploaded-documents-panel.empty,
.extracted-review-panel.empty {
  border-style: dashed;
  background: #fbfcfe;
}

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

.uploaded-doc-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.uploaded-doc-card strong {
  overflow-wrap: anywhere;
}

.uploaded-doc-card span,
.uploaded-doc-card em {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.uploaded-doc-card span {
  background: #eef4ff;
  color: #1849a9;
}

.uploaded-doc-card em {
  background: #ecfdf3;
  color: #067647;
  font-style: normal;
}

.uploaded-doc-card.photo span {
  background: #f4ebff;
  color: #6941c6;
}

.uploaded-doc-card.pdf span {
  background: #fff1f3;
  color: #c01048;
}

.uploaded-doc-card.docx span {
  background: #eff8ff;
  color: #175cd3;
}

.extracted-review-panel {
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

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

.extracted-review-grid label {
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}

.resume-document,
.cover-letter-document {
  width: min(100%, 860px);
  min-height: 1120px;
  margin: 18px auto;
  padding: 54px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.12);
}

.resume-doc-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 2px solid #111827;
}

.resume-document-title {
  margin: 0 0 10px;
  color: #667085;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resume-doc-header h1,
.cover-letter-document h1 {
  margin: 0;
  color: #111827;
  font-size: 40px;
  line-height: 1.08;
}

.resume-doc-header h2 {
  margin: 8px 0 0;
  color: var(--brand-primary);
  font-size: 18px;
  font-weight: 800;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.resume-photo {
  width: 118px;
  height: 140px;
  border: 3px solid #fff;
  outline: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.resume-doc-body {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.resume-doc-section {
  break-inside: avoid;
}

.resume-doc-section h3 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #d0d5dd;
  color: #111827;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.resume-doc-section p,
.cover-letter-document p {
  color: #1f2937;
  line-height: 1.55;
}

.resume-experience-item {
  margin-bottom: 14px;
}

.resume-experience-item h4 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 16px;
}

.resume-doc-section ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.resume-doc-section li {
  margin: 4px 0;
  line-height: 1.45;
}

.resume-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.resume-doc-table th {
  background: #f2f4f7;
  color: #111827;
  font-size: 11px;
}

.resume-doc-table th,
.resume-doc-table td {
  border: 1px solid #d0d5dd;
  padding: 8px 10px;
}

.resume-document.modern-professional {
  padding: 0;
  overflow: hidden;
}

.resume-document.modern-professional .resume-doc-header {
  padding: 42px 48px;
  border: 0;
  background: var(--brand-primary);
}

.resume-document.modern-professional .resume-doc-header h1,
.resume-document.modern-professional .resume-doc-header h2,
.resume-document.modern-professional .resume-document-title,
.resume-document.modern-professional .resume-contact {
  color: #fff;
}

.resume-document.modern-professional .resume-doc-body {
  grid-template-columns: minmax(210px, 0.78fr) minmax(0, 1.4fr);
  gap: 22px 28px;
  padding: 36px 48px 48px;
}

.resume-document.modern-professional .resume-doc-section:nth-child(1),
.resume-document.modern-professional .resume-doc-section:nth-child(3) {
  grid-column: 1 / -1;
}

.resume-document.corporate-minimal {
  border-top: 10px solid var(--brand-secondary);
  box-shadow: none;
}

.resume-document.corporate-minimal .resume-doc-header {
  border-bottom: 1px solid #d0d5dd;
}

.resume-document.photo-center-top .resume-doc-header {
  display: grid;
  justify-items: center;
  text-align: center;
}

.resume-document.photo-top-left .resume-doc-header {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.resume-document.photo-top-left .resume-photo {
  flex: 0 0 auto;
}

.resume-document.photo-left-sidebar {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  padding: 0;
}

.resume-document.photo-left-sidebar .resume-doc-header {
  display: grid;
  align-content: start;
  padding: 38px 26px;
  border: 0;
  background: #111827;
  color: #fff;
}

.resume-document.photo-left-sidebar .resume-doc-header h1,
.resume-document.photo-left-sidebar .resume-doc-header h2,
.resume-document.photo-left-sidebar .resume-document-title,
.resume-document.photo-left-sidebar .resume-contact {
  color: #fff;
}

.resume-document.photo-left-sidebar .resume-doc-body {
  padding: 38px;
  margin: 0;
}

.cover-letter-document {
  min-height: 1000px;
}

.cover-letter-document h1 {
  margin-bottom: 30px;
  padding-bottom: 12px;
  border-bottom: 2px solid #111827;
  font-size: 30px;
}

.logo-option-grid,
.letterhead-option-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.logo-option-card,
.letterhead-option-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.logo-option-card.selected,
.letterhead-option-card.selected {
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 3px rgba(201, 151, 43, 0.16);
}

.logo-option-preview {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.logo-option-card dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
  font-size: 0.86rem;
}

.logo-option-card dt {
  color: var(--muted);
  font-weight: 900;
}

.logo-option-card dd {
  margin: 0;
}

.selected-brand-preview {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.selected-logo-image {
  display: block;
  max-width: 220px;
  max-height: 110px;
  object-fit: contain;
}

.no-logo-message {
  display: inline-flex;
  align-items: center;
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
}

.dev-field-map {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.dev-field-map summary {
  cursor: pointer;
  color: var(--brand-primary);
  font-weight: 900;
}

.dev-field-map pre {
  max-height: 360px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #101828;
  color: #f2f4f7;
  font-size: 12px;
}

.visual-letterhead.modern-top-bar .letterhead-header,
.visual-letterhead.modern-top-bar-design .letterhead-header {
  margin: -30px -30px 24px;
  padding: 24px 30px;
  background: var(--preview-primary);
  color: #fff;
}

.visual-letterhead.modern-top-bar .letterhead-logo strong,
.visual-letterhead.modern-top-bar .letterhead-logo em,
.visual-letterhead.modern-top-bar .letterhead-contact {
  color: #fff;
}

.visual-letterhead.executive-minimal .letterhead-header {
  border-bottom: 1px solid var(--preview-secondary);
  background: transparent;
}

.visual-letterhead.border-none {
  border-color: transparent;
}

.visual-letterhead.border-double-line {
  border: 4px double var(--preview-primary);
}

.visual-letterhead.border-top-bar {
  border-top: 12px solid var(--preview-primary);
}

.visual-letterhead.border-side-bar {
  border-left: 12px solid var(--preview-primary);
}

.visual-letterhead.border-framed {
  border: 3px solid var(--preview-primary);
}

.visual-letterhead.align-center .letterhead-contact,
.visual-letterhead.align-center .letterhead-footer,
.visual-letterhead.align-balanced .letterhead-footer {
  text-align: center;
}

.visual-letterhead.align-right .letterhead-contact,
.visual-letterhead.align-right .letterhead-footer {
  text-align: right;
}

.visual-letterhead.logo-position-center .letterhead-logo {
  align-items: center;
  text-align: center;
}

.visual-letterhead.logo-position-right .letterhead-header {
  flex-direction: row-reverse;
}

.visual-letterhead.logo-size-small .visual-letterhead-logo .visual-logo-svg,
.visual-letterhead.logo-size-small .visual-letterhead-logo img {
  max-width: 110px;
}

.visual-letterhead.logo-size-large .visual-letterhead-logo .visual-logo-svg,
.visual-letterhead.logo-size-large .visual-letterhead-logo img {
  max-width: 220px;
}

.visual-letterhead.logo-size-extra-large .visual-letterhead-logo .visual-logo-svg,
  .visual-letterhead.logo-size-extra-large .visual-letterhead-logo img {
  max-width: 280px;
}

@media (max-width: 900px) {
  .resume-document,
  .cover-letter-document,
  .resume-document.photo-left-sidebar {
    display: block;
    min-height: auto;
    padding: 26px;
  }

  .uploaded-doc-list,
  .extracted-review-grid {
    grid-template-columns: 1fr;
  }

  .resume-document.modern-professional .resume-doc-header,
  .resume-document.modern-professional .resume-doc-body,
  .resume-document.photo-left-sidebar .resume-doc-header,
  .resume-document.photo-left-sidebar .resume-doc-body {
    padding: 26px;
  }

  .resume-doc-header,
  .resume-document.modern-professional .resume-doc-body {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.platform-subtitle {
  margin-top: 6px;
  max-width: 780px;
  color: var(--muted);
  font-weight: 700;
}

.control-dashboard-grid,
.dashboard-insight-grid,
.platform-section-grid {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 16px;
}

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

.dashboard-insight-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

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

.control-card,
.platform-section-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.control-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.control-card span,
.platform-section-card .row-actions {
  color: var(--brand-secondary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-card strong {
  display: block;
  color: var(--brand-primary);
  font-size: 1.45rem;
  line-height: 1.2;
}

.control-card p,
.platform-section-card p {
  min-height: 0;
}

.platform-section-card {
  display: grid;
  gap: 12px;
}

.mini-chart-list,
.activity-list,
.readiness-list {
  display: grid;
  gap: 12px;
}

.dashboard-bar {
  display: grid;
  gap: 8px;
}

.dashboard-bar > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-weight: 800;
}

.dashboard-bar i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.dashboard-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.activity-list article,
.readiness-list span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.activity-list article {
  display: grid;
  gap: 3px;
}

.activity-list span {
  color: var(--brand-secondary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-list strong {
  color: var(--ink);
}

.notice-panel {
  border-left: 5px solid var(--brand-primary);
}

.report-engine-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ai-engine-cover {
  border-left: 5px solid var(--brand-primary);
  background: #f8fafc;
}

.ai-consultant-commentary p strong {
  color: var(--brand-primary);
}

.ai-report-table th {
  background: #eef4f8;
}

.ai-final-guidance {
  border: 1px solid var(--line);
  background: #fffdf7;
}

.ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.ai-status-badge span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f59e0b;
}

.ai-status-badge.active {
  border-color: rgba(20, 83, 45, 0.24);
  color: #0B3D91;
  background: #f0fdf4;
}

.ai-status-badge.active span {
  background: #16a34a;
}

.ai-status-badge.fallback {
  border-color: rgba(180, 83, 9, 0.24);
  color: #92400e;
  background: #fffbeb;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .metric-grid,
  .module-grid,
  .strategy-overview-grid,
  .control-dashboard-grid,
  .platform-section-grid,
  .dashboard-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-panel {
    grid-template-columns: 1fr;
  }
}

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

  .topbar,
  .section-heading,
  .report-preview header,
  .record-card header {
    display: grid;
  }

  .top-actions,
  .quick-actions,
  .primary-btn,
  .secondary-btn,
  .danger-btn,
  .icon-btn {
    width: 100%;
  }

  .nav-list,
  .metric-grid,
  .admin-control-center .metric-grid,
  .form-grid,
  .auth-form-grid,
  .module-grid,
  .strategy-overview-grid,
    .strategy-question-grid,
    .intake-outline,
  .report-engine-controls,
  .guide-grid,
  .control-dashboard-grid,
  .platform-section-grid,
  .dashboard-insight-grid {
    grid-template-columns: 1fr;
  }

  .strategy-action-bar,
  .generated-report header {
    display: grid;
  }

  .detail-list,
  .intake-outline article {
    grid-template-columns: 1fr;
  }

  .intake-outline p {
    grid-column: auto;
  }
}

/* Cross-module visibility and responsive overflow hardening.
   This final layer protects every module from clipped content while keeping
   print/export layouts separate below. */
html,
body,
#app {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  overflow-y: auto;
}

.app-shell,
.main,
.page-stack,
.module-page,
.module-shell,
.module-content,
.workspace,
.workspace-panel,
.panel,
.card,
.record-card,
.report-preview,
.report-preview-screen,
.generated-report,
.single-report,
.single-report-body,
.esm-workspace,
.esm-active-panel,
.social-module,
.post-workspace,
.intake-form,
.form-grid,
.strategy-module,
.book-module,
.resume-module,
.logo-letterhead-module,
.accounting-module {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.main {
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

.report-preview,
.report-preview-screen,
.generated-report,
.single-report,
.single-report-body,
.generated-report-section,
.report-output,
.preview-panel,
.social-preview-panel,
.esm-report-viewer,
.financial-statement-preview {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

.table-responsive,
.table-wrap,
.report-table-wrap,
.financial-table-wrap,
.journal-table-wrap,
.ledger-table-wrap,
.schedule-table-wrap,
.post-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table,
.table-wrap table,
.report-table-wrap table,
.financial-table-wrap table,
.journal-table-wrap table,
.ledger-table-wrap table,
.schedule-table-wrap table,
.post-table-wrap table {
  width: max-content;
  min-width: 100%;
  max-width: none;
}

table th,
table td {
  max-width: 380px;
  overflow-wrap: anywhere;
  white-space: normal;
  vertical-align: top;
}

table .number-cell,
table .amount-cell,
table .date-cell,
table .status-cell {
  white-space: nowrap;
}

.social-post-table,
.content-calendar-table,
.journal-table,
.ledger-table,
.cashbook-table,
.trial-balance-table,
.financial-table,
.budget-table {
  min-width: 1040px;
}

.ratio-table,
.financial-analysis-table {
  min-width: 1320px;
}

.social-layout,
.accounting-main-grid {
  grid-template-columns: 1fr !important;
}

.social-dashboard-grid,
.metric-grid,
.module-grid,
.strategy-overview-grid,
.control-dashboard-grid,
.platform-section-grid,
.dashboard-insight-grid,
.admin-control-center .metric-grid,
.report-card-grid,
.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)) !important;
}

.top-actions,
.quick-actions,
.form-actions,
.row-actions,
.strategy-action-bar,
.export-grid,
.report-actions,
.post-actions,
.module-actions,
.button-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  overflow: visible;
}

.top-actions > *,
.quick-actions > *,
.form-actions > *,
.row-actions > *,
.strategy-action-bar > *,
.export-grid > *,
.report-actions > *,
.post-actions > *,
.module-actions > *,
.button-row > *,
.action-row > * {
  min-width: min(180px, 100%);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn,
button,
a.button,
[role="button"] {
  max-width: 100%;
  white-space: normal;
}

input,
select,
textarea,
.rich-text,
.editable-field {
  max-width: 100%;
  min-width: 0;
}

.social-final-text,
.social-caption,
.social-hashtags,
.social-link,
.generated-caption,
.generated-post-body,
.recommendation-text,
.report-text,
.long-text,
.url-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.social-modal,
.preview-modal,
.dialog-panel,
.modal-content {
  width: min(960px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

.visual-letterhead,
.website-frame,
.ebook-cover-preview,
.book-cover-stage,
.logo-preview-stage,
.letterhead-preview-stage {
  max-width: 100%;
  overflow: auto !important;
}

.ai-status-badge,
.status-badge,
.platform-badge,
.role-badge {
  max-width: 100%;
  white-space: normal;
}

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

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .main {
    padding: 16px !important;
  }

  .topbar,
  .section-heading,
  .report-preview header,
  .generated-report header,
  .record-card header {
    display: grid !important;
    gap: 12px;
  }

  .top-actions,
  .quick-actions,
  .form-actions,
  .row-actions,
  .strategy-action-bar,
  .export-grid,
  .report-actions,
  .post-actions,
  .module-actions,
  .button-row,
  .action-row {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .top-actions > *,
  .quick-actions > *,
  .form-actions > *,
  .row-actions > *,
  .strategy-action-bar > *,
  .export-grid > *,
  .report-actions > *,
  .post-actions > *,
  .module-actions > *,
  .button-row > *,
  .action-row > *,
  .primary-btn,
  .secondary-btn,
  .danger-btn,
  .icon-btn {
    width: 100%;
  }

  .table-responsive table,
  .table-wrap table,
  .report-table-wrap table,
  .financial-table-wrap table,
  .journal-table-wrap table,
  .ledger-table-wrap table,
  .schedule-table-wrap table,
  .post-table-wrap table {
    min-width: 760px;
  }

  .social-post-table,
  .content-calendar-table,
  .journal-table,
  .ledger-table,
  .cashbook-table,
  .trial-balance-table,
  .financial-table,
  .budget-table {
    min-width: 900px;
  }

  .ratio-table,
  .financial-analysis-table {
    min-width: 1100px;
  }

  table th,
  table td {
    max-width: 280px;
  }
}

@media print {
  html,
  body,
  #app,
  .main,
  .report-preview,
  .report-preview-screen,
  .generated-report,
  .single-report,
  .single-report-body {
    overflow: visible !important;
  }

  .table-responsive,
  .table-wrap,
  .report-table-wrap,
  .financial-table-wrap,
  .journal-table-wrap,
  .ledger-table-wrap,
  .schedule-table-wrap,
  .post-table-wrap {
    overflow: visible !important;
  }

  .table-responsive table,
  .table-wrap table,
  .report-table-wrap table,
  .financial-table-wrap table,
  .journal-table-wrap table,
  .ledger-table-wrap table,
  .schedule-table-wrap table,
  .post-table-wrap table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  table th,
  table td {
    max-width: none;
    overflow-wrap: break-word;
  }
}

/* Root-cause scroll layer: wide module content must scroll inside its own
   workspace instead of being squeezed or clipped by parent grids/panels. */
.main,
.main-content,
.module-content,
.page-content,
.workspace,
.workspace-panel,
.esm-workspace,
.esm-active-body,
.social-module,
.accounting-module {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

.panel,
.card,
.record-card,
.module-card,
.esm-section,
.esm-active-panel,
.report-preview,
.report-preview-screen,
.generated-report,
.single-report,
.social-post-preview,
.post-workspace {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

.scroll-x,
.table-scroll,
.report-scroll,
.table-responsive,
.table-wrap,
.report-preview-wrapper,
.report-table-wrap,
.financial-table-wrap,
.journal-table-wrap,
.ledger-table-wrap,
.schedule-table-wrap,
.post-table-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  padding-bottom: 8px;
}

.scroll-x:focus,
.table-scroll:focus,
.report-scroll:focus,
.table-wrap:focus,
.report-preview-wrapper:focus {
  outline: 3px solid rgba(20, 83, 45, 0.22);
  outline-offset: 2px;
}

.scroll-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  max-width: 100%;
  margin: 6px 0 8px;
}

.scroll-control-row .secondary-btn {
  min-width: 120px;
}

.report-scroll,
.report-preview-wrapper {
  max-height: min(78vh, 900px);
  overflow-y: auto !important;
}

.post-table-wrap,
.schedule-table-wrap,
.journal-table-wrap,
.ledger-table-wrap,
.financial-table-wrap,
.report-table-wrap {
  max-height: min(72vh, 760px);
  overflow-y: auto !important;
}

.scroll-x table,
.table-scroll table,
.table-responsive table,
.table-wrap table,
.report-scroll table,
.report-preview-wrapper table {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 900px !important;
  max-width: none !important;
  border-collapse: collapse;
}

.scroll-x table.financial-table,
.scroll-x table.report-table,
.table-scroll table.financial-table,
.table-scroll table.report-table,
.table-wrap table.financial-table,
.table-wrap table.report-table,
.report-scroll table.financial-table,
.report-scroll table.report-table,
.report-preview-wrapper table.financial-table,
.report-preview-wrapper table.report-table,
.ratio-table,
.financial-analysis-table {
  min-width: 1200px !important;
}

.social-post-table {
  min-width: 1320px !important;
}

.scroll-x th,
.scroll-x td,
.table-scroll th,
.table-scroll td,
.table-wrap th,
.table-wrap td,
.report-scroll th,
.report-scroll td,
.report-preview-wrapper th,
.report-preview-wrapper td {
  min-width: 140px;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.scroll-x th:last-child,
.scroll-x td:last-child,
.table-scroll th:last-child,
.table-scroll td:last-child,
.table-wrap th:last-child,
.table-wrap td:last-child,
.report-scroll th:last-child,
.report-scroll td:last-child,
.report-preview-wrapper th:last-child,
.report-preview-wrapper td:last-child {
  min-width: 220px;
}

.scroll-x .number-cell,
.table-scroll .number-cell,
.table-wrap .number-cell,
.report-scroll .number-cell,
.report-preview-wrapper .number-cell {
  min-width: 130px;
  white-space: nowrap;
}

.social-layout,
.accounting-main-grid,
.esm-shell {
  min-width: 0 !important;
}

.social-layout,
.accounting-main-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.esm-shell {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) !important;
}

.social-dashboard-grid,
.metric-grid,
.esm-metrics,
.report-index-grid,
.social-settings-grid {
  min-width: 0 !important;
}

.social-caption,
.social-final-text,
.social-hashtags,
.social-link,
.social-schedule-details,
.esm-alert-list li,
.esm-activity li,
.statement-notes li,
.report-index-card p,
.panel-title p,
.generated-report p,
.generated-report li,
.generated-report td,
.recommendation-text,
.financial-commentary {
  overflow-wrap: anywhere !important;
  word-break: normal;
}

.row-actions,
.export-grid,
.form-actions,
.top-actions,
.social-modal-actions {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

@media (max-width: 1180px) {
  .esm-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .scroll-x table,
  .table-scroll table,
  .table-responsive table,
  .table-wrap table,
  .report-scroll table,
  .report-preview-wrapper table {
    min-width: 860px !important;
  }

  .scroll-x table.financial-table,
  .scroll-x table.report-table,
  .table-scroll table.financial-table,
  .table-scroll table.report-table,
  .table-wrap table.financial-table,
  .table-wrap table.report-table,
  .report-scroll table.financial-table,
  .report-scroll table.report-table,
  .report-preview-wrapper table.financial-table,
  .report-preview-wrapper table.report-table,
  .social-post-table,
  .ratio-table,
  .financial-analysis-table {
    min-width: 1080px !important;
  }

  .scroll-x th,
  .scroll-x td,
  .table-scroll th,
  .table-scroll td,
  .table-wrap th,
  .table-wrap td,
  .report-scroll th,
  .report-scroll td,
  .report-preview-wrapper th,
  .report-preview-wrapper td {
    min-width: 130px;
    max-width: 300px;
  }
}

@media print {
  .main,
  .main-content,
  .module-content,
  .page-content,
  .workspace,
  .workspace-panel,
  .esm-workspace,
  .esm-active-body,
  .social-module,
  .accounting-module,
  .scroll-x,
  .table-scroll,
  .report-scroll,
  .table-responsive,
  .table-wrap,
  .report-preview-wrapper {
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .scroll-x table,
  .table-scroll table,
  .table-responsive table,
  .table-wrap table,
  .report-scroll table,
  .report-preview-wrapper table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

.audio-video-module {
  overflow: visible;
}

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

.audio-video-tabs .active {
  box-shadow: 0 0 0 4px rgba(20, 83, 45, 0.14);
}

.audio-video-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

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

.media-preview-panel {
  overflow: visible;
}

.media-preview-shell {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.media-frame {
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-primary), #0f2e22 60%, var(--brand-secondary));
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.media-frame img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

.media-preview-shell.video .media-frame {
  aspect-ratio: 9 / 16;
}

.media-preview-shell.audio .media-frame {
  aspect-ratio: 1 / 1;
}

.media-frame strong {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.08;
}

.media-frame span {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
}

.media-frame small {
  color: #ffe8a3;
  font-weight: 900;
}

.media-output-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.media-output-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.media-output-block summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--brand-primary);
  font-weight: 900;
  background: #f8fafc;
}

.media-output-block pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: Inter, Arial, sans-serif;
  color: #344054;
}

.media-player {
  padding-bottom: 14px;
}

.media-player audio,
.media-player video {
  display: block;
  width: calc(100% - 28px);
  max-width: 100%;
  margin: 14px;
}

.media-player video {
  max-height: 520px;
  background: #101828;
  border-radius: 8px;
}

.media-progress,
.media-error {
  border-left: 5px solid var(--brand-secondary);
}

.media-queue-dashboard {
  display: grid;
  gap: 14px;
  overflow: visible;
}

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

.media-error {
  border-left-color: #d92d20;
  background: #fff7f7;
}

.media-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
  margin-top: 12px;
}

.media-progress-bar span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  animation: media-progress 1.1s ease-in-out infinite alternate;
  transition: width 0.25s ease;
}

.media-stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-stage-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.media-stage-list span.active {
  background: #fffbeb;
  border-color: var(--brand-secondary);
  color: #92400e;
}

.media-stage-list span.done {
  background: #ecfdf3;
  border-color: #16a34a;
  color: #166534;
}

@keyframes media-progress {
  from { transform: translateX(-18%); }
  to { transform: translateX(78%); }
}

.media-library-table table {
  min-width: 980px !important;
}

.seo-production-section {
  overflow: visible;
}

.seo-writer-module,
.seo-writer-module * {
  min-width: 0;
}

.seo-writer-module {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

.seo-writer-form,
.seo-writer-module .strategy-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.seo-writer-module .strategy-question-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  width: 100%;
  max-width: 100%;
}

.seo-writer-module .strategy-question,
.seo-writer-module .strategy-question textarea,
.seo-writer-module .strategy-question input,
.seo-writer-module .strategy-question select {
  min-width: 0;
  max-width: 100%;
}

.seo-writer-module .strategy-question textarea {
  resize: vertical;
}

.seo-writer-module .strategy-action-bar {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.seo-writer-module .strategy-action-bar button,
.seo-writer-module .export-grid button,
.seo-writer-module .export-grid a {
  white-space: normal;
}

.section-note {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 78ch;
  overflow-wrap: anywhere;
}

.seo-asset-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
  max-width: 100%;
  min-width: 0;
}

.seo-asset-preview pre,
.seo-social-table td,
.seo-social-table small,
.seo-generated-output-scroll,
.seo-generated-output-scroll p,
.seo-generated-output-scroll li,
.seo-generated-output-scroll dd,
.seo-elements-box dd,
.seo-metadata-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.seo-image-frame {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.seo-image-frame img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--border);
}

.asset-message {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.inline-notice {
  margin-top: 1rem;
  padding: 1rem;
}

.seo-social-table {
  min-width: 1200px;
}

.seo-social-scroll {
  border-radius: 8px;
}

.seo-generated-output-scroll {
  width: 100%;
  max-width: 100%;
  max-height: min(78vh, 920px);
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.seo-writer-module .generated-report {
  width: 100%;
  max-width: 100%;
  overflow: visible !important;
}

.seo-writer-module .generated-report header {
  flex-wrap: wrap;
}

.seo-writer-module .seo-elements-box {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.seo-writer-module .seo-elements-box dl {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.overflow-x-auto {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

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

@media (max-width: 900px) {
  .audio-video-tabs,
  .media-form-grid,
  .media-preview-shell,
  .seo-asset-preview,
  .compact-form {
    grid-template-columns: 1fr !important;
  }

  .media-preview-shell.video .media-frame,
  .media-preview-shell.audio .media-frame {
    width: min(100%, 360px);
    margin-inline: auto;
  }

  .seo-writer-module .generated-report,
  .seo-writer-module .strategy-section {
    padding: 16px;
  }

  .seo-writer-module .strategy-action-bar {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
  }

  .seo-writer-module .strategy-action-bar button,
  .seo-writer-module .export-grid button,
  .seo-writer-module .export-grid a {
    width: 100%;
  }
}
