/* ==========================================================================
 * E-Invoice Lens — Warm Archival Paper & Prussian Ink Studio Stylesheet
 * - Zero external CDN dependencies
 * - WCAG 2.2 AA contrast & focus rings, tabular-nums, responsive split-pane
 * - Bulletproof @media print isolation for clean A4 / US Letter PDFs
 * ========================================================================== */

:root {
  --bg-canvas: #f4f3ee;
  --bg-surface: #ffffff;
  --bg-subtle: #faf9f6;
  --bg-stage: #e9e6de;
  --border-color: #dfddd5;
  --border-strong: #c5c2b7;

  --text-primary: #18181b;
  --text-secondary: #4a4a52;
  --text-muted: #6c6c75;

  --accent: #1e3a5f;
  --accent-hover: #152b47;
  --accent-tint: #ebf1f8;
  --accent-ink: #ffffff;

  --pass: #0f5c43;
  --pass-tint: #e8f5ef;
  --warn: #92400e;
  --warn-tint: #fef3c7;
  --fail: #b91c1c;
  --fail-tint: #fef2f2;
  --info: #164e63;
  --info-tint: #e6f2f6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Iowan Old Style', Georgia, 'Palatino Linotype', Palatino, serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow-sheet: 0 12px 32px rgba(24, 24, 27, 0.11), 0 2px 6px rgba(24, 24, 27, 0.06);
  --shadow-modal: 0 24px 56px rgba(24, 24, 27, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #ffffff;
  padding: 8px 14px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
 * Header
 * ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #b7decb;
  background: var(--pass-tint);
  color: var(--pass);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.privacy-pill:hover {
  background: #d7eee3;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  padding: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  padding: 5px 9px;
  border-radius: 4px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.mobile-view-switch {
  display: none;
  background: var(--bg-canvas);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.switch-btn {
  border: 0;
  background: transparent;
  padding: 6px 13px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
}

.switch-btn.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
 * Buttons
 * ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  min-height: 36px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:focus-visible,
.privacy-pill:focus-visible,
.lang-btn:focus-visible,
.sample-chip:focus-visible,
.drop-zone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-canvas);
  color: var(--text-primary);
}

.btn-pro {
  background: var(--warn-tint);
  color: var(--warn);
  border-color: #eab308;
}

.btn-pro:hover {
  background: #fde68a;
}

.btn-pro.is-unlocked {
  background: var(--pass-tint);
  color: var(--pass);
  border-color: #86efac;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--fail);
  border-color: #fecaca;
}

.btn-danger-ghost:hover {
  background: var(--fail-tint);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
  min-height: 32px;
}

.btn-full {
  width: 100%;
}

/* ==========================================================================
 * Workspace Split Layout
 * ========================================================================== */

.workspace {
  max-width: 1580px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(380px, 0.96fr) minmax(460px, 1.04fr);
  gap: 22px;
  align-items: start;
}

.inspector-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

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

.panel-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.drop-title {
  margin: 8px 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drop-sub {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-bar-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
}

.sample-chip {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.sample-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sample-chip.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-pass {
  background: var(--pass-tint);
  color: var(--pass);
}

.badge-warn {
  background: var(--warn-tint);
  color: var(--warn);
}

.badge-fail {
  background: var(--fail-tint);
  color: var(--fail);
}

.badge-info {
  background: var(--info-tint);
  color: var(--info);
}

.badge-neutral {
  background: var(--bg-canvas);
  color: var(--text-secondary);
}

/* Contextual Batch Prompt Banner */
.batch-prompt {
  border: 1px solid #d97706;
  background: #fffbeb;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.batch-prompt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.batch-prompt-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #78350f;
}

.batch-prompt-text {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: #78350f;
}

.batch-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Format & KPI Summary Strip */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.meta-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

/* Alerts & Checks Lists */
.alert-list,
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.45;
  border: 1px solid var(--border-color);
}

.alert-item.is-error {
  background: var(--fail-tint);
  border-color: #fecaca;
  color: var(--fail);
}

.alert-item.is-warning {
  background: var(--warn-tint);
  border-color: #fde68a;
  color: var(--warn);
}

.alert-item.is-info {
  background: var(--info-tint);
  border-color: #bae6fd;
  color: var(--info);
}

.alert-code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  margin-right: 6px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.83rem;
}

.check-msg {
  color: var(--text-secondary);
}

.disclaimer-note {
  margin: 12px 0 0;
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* Payment Safety Box */
.iban-display {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.iban-memory-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.iban-memory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Batch Table */
.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.batch-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.batch-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.batch-table th,
.batch-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.batch-table th {
  background: var(--bg-subtle);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.batch-table tbody tr {
  cursor: pointer;
}

.batch-table tbody tr:hover {
  background: var(--accent-tint);
}

.batch-table tbody tr.is-selected {
  background: var(--accent-tint);
  font-weight: 600;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Share & Growth Bar */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
 * Preview Pane — Printable A4/Letter Invoice Sheet
 * ========================================================================== */

.preview-pane {
  position: sticky;
  top: 76px;
}

.preview-stage {
  background: var(--bg-stage);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.invoice-sheet {
  background: #ffffff;
  color: #18181b;
  border-radius: 4px;
  padding: 34px 36px;
  box-shadow: var(--shadow-sheet);
  min-height: 620px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.demo-stamp {
  background: #fef3c7;
  border: 1px dashed #b45309;
  color: #92400e;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
}

.sheet-kicker {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.sheet-doc-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
}

.sheet-meta-right {
  text-align: right;
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sheet-meta-right strong {
  color: var(--text-primary);
}

.sheet-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.party-label {
  margin: 0 0 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.party-name {
  margin: 0 0 3px;
  font-size: 0.98rem;
  font-weight: 700;
}

.party-lines {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  white-space: pre-line;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sheet-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 6px;
  border-bottom: 1.5px solid #d4d4d8;
}

.sheet-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #eceae4;
  vertical-align: top;
}

.sheet-bottom-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}

.sheet-box {
  background: #faf9f6;
  border: 1px solid #e4e2da;
  border-radius: 6px;
  padding: 13px 15px;
  font-size: 0.84rem;
}

.sheet-box-title {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}

.totals-row.is-grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1.5px solid #cbd5e1;
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--accent);
}

.sheet-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: pre-line;
}

.sheet-footer-credit {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eceae4;
  font-size: 0.72rem;
  color: #71717a;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ==========================================================================
 * Below-Fold GEO / Guide & FAQ Section
 * ========================================================================== */

.guide-section {
  max-width: 1580px;
  width: 100%;
  margin: 12px auto 32px;
  padding: 0 20px;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-top: 10px;
}

.guide-table th,
.guide-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.guide-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.9rem;
}

.faq-item p {
  margin: 8px 0 2px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
 * Footer
 * ========================================================================== */

.app-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 18px 20px;
}

.footer-inner {
  max-width: 1580px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.privacy-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.84rem;
}

.footer-nav a {
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* ==========================================================================
 * Modals (Pro Upgrade + Privacy Inspector)
 * ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.56);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 120;
}

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

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-modal);
}

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

.modal-title {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 750;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.btn-close {
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
}

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

.tier-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-box-featured {
  border: 2px solid var(--pass);
  background: #f3fbf7;
}

.tier-box h3 {
  margin: 0;
  font-size: 0.92rem;
}

.tier-price {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tier-box ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tier-box ul li {
  margin-bottom: 4px;
}

.key-input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.text-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.92rem;
}

.key-feedback {
  margin: 8px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 1.2em;
}

.key-feedback.is-valid {
  color: var(--pass);
}

.key-feedback.is-invalid {
  color: var(--fail);
}

.modal-section {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
}

.demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.storage-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.storage-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}

/* Toast Region */
.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-primary);
  color: #ffffff;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 550;
  max-width: 360px;
  box-shadow: var(--shadow-modal);
}

/* ==========================================================================
 * Responsive Breakpoints
 * ========================================================================== */

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    position: static;
  }

  .mobile-view-switch {
    display: inline-flex;
  }

  .workspace[data-mobile-view="inspector"] .preview-pane {
    display: none;
  }

  .workspace[data-mobile-view="preview"] .inspector-pane {
    display: none;
  }

  .guide-grid,
  .tier-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sheet-header,
  .sheet-parties,
  .sheet-bottom-grid,
  .meta-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .sheet-meta-right {
    text-align: left;
  }

  .invoice-sheet {
    padding: 20px 16px;
  }

  .text-input {
    font-size: 16px; /* Prevents iOS auto-zoom */
  }
}

/* ==========================================================================
 * Clean @media print Isolation (A4 / Letter PDF output)
 * ========================================================================== */

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

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .skip-link,
  .app-header,
  .inspector-pane,
  .guide-section,
  .app-footer,
  .modal-backdrop,
  .toast-region {
    display: none !important;
  }

  .workspace {
    display: block !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .preview-pane {
    display: block !important;
    position: static !important;
  }

  .preview-stage {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
  }

  .invoice-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet-table tr,
  .sheet-box {
    break-inside: avoid;
  }
}
