:root {
  --bg: #f3f5f8;
  --bg-soft: #eef2f7;
  --panel: #ffffff;
  --panel-2: #fbfcfe;
  --line: rgba(28, 41, 62, 0.08);
  --text: #1d2738;
  --muted: #7f8ca3;
  --green: #2f66f5;
  --green-2: #2458dc;
  --orange: #2f66f5;
  --red: #ef5350;
  --blue: #95a4ba;
  --teal: #f0b323;
  --shadow: 0 8px 24px rgba(24, 35, 52, 0.06);
  --radius: 13px;
}

[data-theme="light"] {
  --panel: rgba(255, 255, 255, 0.96);
  --panel-2: rgba(247, 250, 255, 0.96);
  --line: rgba(16, 33, 63, 0.09);
  --text: #10213f;
  --muted: #5f6f91;
  --shadow: 0 14px 28px rgba(15, 35, 71, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  background: linear-gradient(180deg, #f5f7fb 0%, #f1f4f8 100%);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e6ebf3;
  background: rgba(255, 255, 255, 0.9);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}

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

.brand-badge {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #4b82ff, #2f66f5);
  color: #fff;
  font-weight: 800;
}

.brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-name span {
  color: #2f66f5;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 102, 245, 0.22);
  background: rgba(47, 102, 245, 0.08);
  color: #2f66f5;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: 0.18s ease;
  font-family: inherit;
}

.primary-btn {
  background: linear-gradient(180deg, #3a73ff, #2f66f5);
  color: #fff;
  border-color: rgba(47, 102, 245, 0.35);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(47, 102, 245, 0.2);
}

.ghost-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.small-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) 1fr;
  gap: 12px;
  padding: 12px;
}

.layout.layout-top-params {
  grid-template-columns: 1fr;
}

.layout.sidebar-collapsed {
  grid-template-columns: 1fr;
}

.layout.sidebar-collapsed .sidebar {
  display: none;
}

.sidebar-fab {
  position: fixed;
  left: 0;
  top: 96px;
  z-index: 6;
  border: 1px solid rgba(47, 102, 245, 0.2);
  background: #fff;
  color: #2f66f5;
  border-radius: 0 12px 12px 0;
  border-left: 0;
  width: 34px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 12px 24px rgba(24, 35, 52, 0.12);
  cursor: pointer;
  font-weight: 700;
}

.sidebar-fab.hidden {
  display: none;
}

.layout.layout-top-params + .sidebar-fab {
  top: 140px;
}

.layout.layout-top-params + .sidebar-fab {
  display: none !important;
}

.sidebar,
.dashboard {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
}

.layout.layout-top-params .sidebar {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  align-items: start;
  align-content: start;
  padding-bottom: 0;
}

.layout.layout-top-params .sidebar > .sidebar-toolbar {
  display: none;
}

.layout.layout-top-params .sidebar > .panel {
  height: 100%;
  min-width: 0;
}

.layout.view-invoice .sidebar {
  padding-bottom: 520px;
}

.layout.layout-top-params.view-invoice .sidebar {
  padding-bottom: 0;
}

.sidebar input[type="number"],
.sidebar input[type="text"],
.sidebar input[type="date"],
.sidebar select,
.sidebar textarea {
  font-size: 0.84rem;
}


.sidebar-toolbar {
  padding: 10px;
}

.sidebar-inline-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: -2px 0 4px;
}

.sidebar-inline-toggle-btn {
  min-width: 92px;
  height: 26px;
  border-radius: 0 0 12px 12px;
  border: 1px solid #dfe7f3;
  border-top: 0;
  background: linear-gradient(180deg, #fbfdff, #f3f7fe);
  color: #2f66f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(18, 37, 68, 0.08);
}

.sidebar-inline-toggle-btn:hover {
  transform: translateY(-1px);
}

.sidebar-inline-toggle-icon {
  font-size: 0.88rem;
  line-height: 1;
}

.sidebar-inline-toggle-label {
  line-height: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid #e3ebf6;
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 16px 16px 14px;
  position: relative;
}

.modal-card h3 {
  margin: 0 28px 8px 0;
  font-size: 1rem;
  color: #1f2d45;
}

.modal-card p {
  margin: 0;
  color: #556983;
  font-size: 0.86rem;
  line-height: 1.5;
}

.modal-card p + p {
  margin-top: 8px;
}

.modal-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #4f627d;
  font-size: 0.82rem;
  user-select: none;
}

.modal-checkbox-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #2f66f5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid #e4ebf4;
  border-radius: 9px;
  background: #f8fbff;
  color: #5e708d;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.sidebar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-toggle-row strong {
  display: block;
  font-size: 0.88rem;
  color: #2c3a52;
}

.sidebar-toggle-row p {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: #72829f;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.panel h2 {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.72rem;
  color: #7f8ca3;
}

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
  min-width: 0;
}

.field:last-child {
  margin-bottom: 0;
}

.subpanel {
  border: 1px solid #e8edf4;
  border-radius: 12px;
  padding: 12px;
  background: #fbfcff;
  margin-bottom: 12px;
}

.subpanel h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: #33435f;
}

.field > span,
.row-between span {
  color: #617089;
  font-size: 0.84rem;
}

.field > * {
  min-width: 0;
}

.field small.hint {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

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

.row-between strong {
  color: #2f66f5;
  font-size: 0.9rem;
}

.input-shell,
input[type="number"],
select,
input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e8edf4;
  background: #f6f8fb;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="number"]:focus,
select:focus,
input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus,
input[type="range"]:focus-visible {
  border-color: rgba(47, 102, 245, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 102, 245, 0.12);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

[data-theme="light"] .input-shell,
[data-theme="light"] input[type="number"],
[data-theme="light"] select,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="date"],
[data-theme="light"] textarea {
  background: #f7faff;
  border-color: rgba(16, 33, 63, 0.08);
}

.input-shell.with-suffix {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.input-shell.with-suffix input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
  color: #2f66f5;
  font-size: 1.6rem;
  font-weight: 700;
  min-width: 0;
  outline: none;
}

.input-shell.with-suffix small {
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  color: #98a4b7;
  font-size: 0.72rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 10px;
  background: #f5f7fb;
  border: 1px solid #e8edf4;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}

.segmented.segmented-2 {
  grid-template-columns: 1fr 1fr;
}

.segmented.segmented-3 {
  grid-template-columns: 1fr 1fr;
}

.segmented-btn {
  border: 0;
  border-radius: 7px;
  padding: 8px 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.76rem;
}

[data-theme="light"] .segmented {
  background: #f4f8ff;
  border-color: rgba(16, 33, 63, 0.08);
}

.segmented-btn.active {
  background: linear-gradient(180deg, #fff, #fff);
  color: #2f66f5;
  border: 1px solid rgba(47, 102, 245, 0.35);
}

.view-tabs {
  padding: 10px;
}

.view-tabs .segmented {
  margin-bottom: 0;
}

.segmented.segmented-main-tabs {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
}

.segmented-main-tabs .segmented-btn {
  padding: 8px 6px;
  font-size: 0.82rem;
}

#viewContactBtn {
  grid-column: auto;
}

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

.reminders-disclaimer {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.custom-reminders-block {
  margin-top: 10px;
}

.reminders-form-panel .field > span,
.reminders-form-panel .row-between span {
  font-size: 0.8rem;
}

.reminders-form-panel .field small.hint {
  font-size: 0.68rem;
}

.reminders-form-panel input[type="text"],
.reminders-form-panel input[type="date"] {
  padding: 7px 9px;
  font-size: 0.84rem;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.custom-reminders-editor {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.custom-reminder-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.custom-reminder-row .small-btn {
  min-width: 34px;
  height: 32px;
  font-size: 0.8rem;
}

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

.reminder-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.reminder-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.reminder-item-head strong {
  font-size: 0.86rem;
  color: var(--text);
}

.reminder-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.reminder-dates > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(247, 250, 255, 0.9);
  padding: 7px 9px;
}

.reminder-dates span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  margin-bottom: 2px;
}

.reminder-dates strong {
  font-size: 0.78rem;
}

.reminder-item .muted {
  font-size: 0.74rem;
  line-height: 1.4;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafbfd;
  border: 1px solid #eef2f7;
  border-radius: 9px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

[data-theme="light"] .toggle-card {
  background: rgba(16, 33, 63, 0.02);
  border-color: rgba(16, 33, 63, 0.06);
}

.toggle-card strong {
  display: block;
  font-size: 0.84rem;
}

.toggle-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.switch {
  position: relative;
  width: 40px;
  height: 24px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #dfe6ef;
  border-radius: 999px;
  transition: 0.2s ease;
}

.switch span::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}

.switch input:checked + span {
  background: rgba(47, 102, 245, 0.9);
}

.switch input:checked + span::before {
  transform: translateX(16px);
  background: #fff;
}

.conditional.hidden {
  display: none;
}

.dashboard {
  display: grid;
  align-content: start;
  gap: 12px;
}

.simulation-view {
  display: grid;
  align-content: start;
  gap: 12px;
}

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

.metric-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 106, 20, 0.08), transparent 65%);
}

.top-metrics .metric-card:first-child {
  background: linear-gradient(135deg, #2f66f5 0%, #3d7bff 100%);
  color: #fff;
  border-color: rgba(47, 102, 245, 0.25);
  box-shadow: 0 14px 28px rgba(47, 102, 245, 0.18);
}

.top-metrics .metric-card:last-child {
  background: linear-gradient(135deg, #0f1b36 0%, #101f44 100%);
  color: #fff;
  border-color: rgba(16, 31, 68, 0.3);
  box-shadow: 0 14px 28px rgba(16, 31, 68, 0.16);
}

.metric-label {
  margin: 0;
  color: #8998b0;
  font-size: 0.76rem;
}

.top-metrics .metric-card:first-child .metric-label,
.top-metrics .metric-card:last-child .metric-label {
  color: rgba(255, 255, 255, 0.78);
}

.metric-card h3 {
  margin: 10px 0 6px;
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  color: #2f66f5;
  line-height: 1;
  letter-spacing: -0.02em;
}

.top-metrics .metric-card:first-child h3,
.top-metrics .metric-card:last-child h3 {
  color: #fff;
}

.metric-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.top-metrics .metric-card:first-child .metric-sub,
.top-metrics .metric-card:last-child .metric-sub {
  color: rgba(255, 255, 255, 0.72);
}

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

.breakdown-panel h2,
.details-panel h2,
.history-panel h2 {
  margin: 0;
  font-size: 0.92rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(47, 102, 245, 0.18);
  color: #2f66f5;
  background: rgba(47, 102, 245, 0.06);
  padding: 4px 8px;
  font-size: 0.72rem;
}

.breakdown-content {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  align-items: center;
}

.donut-wrap {
  display: grid;
  place-items: center;
}

.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg 360deg);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.22);
}

.donut::before {
  content: "";
  position: absolute;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #edf1f6;
}

.donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 2px;
}

.donut-center span {
  color: var(--muted);
  font-size: 0.72rem;
}

.donut-center strong {
  font-size: 1.05rem;
}

.breakdown-list {
  display: grid;
  gap: 8px;
}

.line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fbfcff;
  border: 1px solid #eef2f7;
}

.line-item span {
  color: #5f6f89;
  font-size: 0.78rem;
}

.line-item strong {
  font-feature-settings: "tnum";
}

.line-item.line-warn strong {
  color: var(--orange);
}

.line-item.line-danger strong {
  color: var(--red);
}

.line-item.line-muted strong {
  color: var(--blue);
}

.line-item.line-accent strong {
  color: var(--teal);
}

.line-item.total {
  border-color: rgba(47, 102, 245, 0.18);
  background: rgba(47, 102, 245, 0.04);
}

.line-item.total strong {
  color: #2f66f5;
  font-size: 0.92rem;
}

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

.detail-box {
  border-radius: 10px;
  border: 1px solid #eef2f7;
  background: #fbfcff;
  padding: 8px 10px;
}

.detail-box .k {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  margin-bottom: 3px;
}

.detail-box .v {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.info-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border-color: rgba(47, 102, 245, 0.14);
  background: linear-gradient(180deg, #f6f9ff, #fbfdff);
}

.info-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(47, 102, 245, 0.35);
  color: #2f66f5;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.info-panel h3 {
  margin: 0 0 6px;
  font-size: 0.86rem;
}

.info-panel p {
  margin: 0;
  color: #64748c;
  line-height: 1.45;
  font-size: 0.76rem;
}

.info-panel .info-footnote {
  margin-top: 8px;
  color: #2f66f5;
  font-size: 0.72rem;
}

.history-panel.hidden {
  display: none;
}

.invoice-view.hidden {
  display: none;
}

.tools-view.hidden,
.content-view.hidden {
  display: none;
}

.tools-view,
.content-view {
  display: grid;
  gap: 16px;
}

.tools-summary-panel .muted {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.tool-card h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.tool-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.tool-result-box {
  border: 1px solid #e7edf6;
  background: #f8fbff;
  border-radius: 10px;
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}

.tool-result-box span {
  color: #64748c;
  font-size: 0.76rem;
}

.tool-result-box strong {
  color: #1d2b45;
  font-size: 1rem;
}

.tool-hint {
  display: block;
  margin-top: 8px;
  color: #5f6f89;
}

.content-panel > p {
  margin: 6px 0 0;
  font-size: 0.78rem;
}

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2f66f5;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.contact-email-link:hover {
  text-decoration: underline;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.content-article h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.content-article h4 {
  margin: 10px 0 6px;
  font-size: 0.8rem;
  color: #22314a;
}

.content-article p {
  margin: 0;
  color: #506179;
  line-height: 1.45;
  font-size: 0.8rem;
}

.content-list {
  margin: 0;
  padding-left: 16px;
  color: #506179;
  line-height: 1.45;
  font-size: 0.79rem;
}

.content-list li + li {
  margin-top: 4px;
}

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

.faq-item {
  border: 1px solid #e8edf4;
  border-radius: 10px;
  background: #fbfdff;
  padding: 2px 10px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 9px 0;
  color: #1e2c43;
}

.faq-item p {
  margin: 0 0 10px;
  color: #5d6f89;
  font-size: 0.79rem;
  line-height: 1.45;
}

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

.glossary-item {
  border: 1px solid #e8edf4;
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px;
}

.glossary-item h3 {
  margin: 0 0 4px;
  font-size: 0.82rem;
}

.glossary-item p {
  margin: 0;
  color: #5d6f89;
  font-size: 0.77rem;
  line-height: 1.4;
}

.invoice-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 2.8fr);
  gap: 12px;
  align-items: start;
}

.invoice-form {
  display: grid;
  font-size: 0.88rem;
}

.invoice-form .field {
  gap: 5px;
  margin-bottom: 10px;
}

.invoice-form .field > span,
.invoice-form .row-between span {
  font-size: 0.84rem;
}

.invoice-form input[type="number"],
.invoice-form input[type="text"],
.invoice-form input[type="date"],
.invoice-form select,
.invoice-form textarea {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.invoice-form textarea {
  min-height: 58px;
}

.invoice-form .subpanel {
  padding: 9px;
  margin-bottom: 8px;
}

.invoice-form .subpanel h3 {
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.logo-upload-card {
  border: 1px dashed #ccd8ee;
  border-radius: 10px;
  background: linear-gradient(180deg, #fcfeff, #f7faff);
  padding: 9px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
}

.logo-file-name {
  color: #5f6f89;
  font-size: 0.82rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-lines-editor {
  display: grid;
  gap: 6px;
}

.invoice-line-row {
  display: grid;
  grid-template-columns: 1.55fr 0.55fr 0.7fr auto;
  gap: 8px;
  align-items: center;
}

.invoice-line-row .line-qty,
.invoice-line-row .line-price {
  text-align: center;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 7px 8px;
}

.invoice-line-row .line-desc {
  font-size: 0.86rem;
  padding: 7px 9px;
}

.invoice-line-row .line-remove {
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  justify-self: end;
}

.invoice-preview-wrap {
  min-width: 0;
  position: sticky;
  top: 84px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.invoice-rules-panel h3 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #2a3a56;
}

.invoice-rules-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #4f5f78;
  font-size: 0.78rem;
  line-height: 1.38;
}

.invoice-rules-panel .muted {
  margin: 8px 0 0;
  font-size: 0.73rem;
  line-height: 1.35;
}

.invoice-preview {
  background: #fff;
  color: #1f2a37;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 35, 71, 0.08);
  box-shadow: 0 22px 45px rgba(15, 35, 71, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  background-image:
    radial-gradient(circle at 92% 8%, rgba(22, 199, 115, 0.08), transparent 34%),
    radial-gradient(circle at 8% 10%, rgba(65, 132, 255, 0.06), transparent 38%);
}

.invoice-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fcfeff, #f7fbff);
}

.invoice-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-branding h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}

.invoice-branding p {
  margin: 2px 0 0;
  color: #66758f;
  font-size: 0.82rem;
}

#invoiceLogoPreview {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e6ebf3;
  background: #fff;
}

.invoice-meta {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.invoice-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(31, 42, 55, 0.03);
}

.invoice-meta span {
  color: #66758f;
  font-size: 0.82rem;
}

.invoice-client-box {
  border: 1px solid #e7edf4;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.invoice-client-box span {
  display: block;
  color: #66758f;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.invoice-client-box strong {
  display: block;
  margin-bottom: 4px;
}

.invoice-client-box pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  color: #24324c;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  border: 1px solid #ebf0f7;
  border-radius: 12px;
  overflow: hidden;
}

.invoice-table th,
.invoice-table td {
  text-align: left;
  border-bottom: 1px solid #edf1f7;
  padding: 10px 8px;
  font-size: 0.9rem;
}

.invoice-table th {
  color: #66758f;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f7faff;
}

.invoice-table th:nth-child(n + 2),
.invoice-table td:nth-child(n + 2) {
  text-align: right;
}

.invoice-totals {
  margin-left: auto;
  width: min(320px, 100%);
  display: grid;
  gap: 8px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px 12px;
}

.invoice-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f7;
}

.invoice-totals .grand-total {
  border-bottom: 0;
  margin-top: 2px;
  padding-top: 10px;
}

.invoice-totals .grand-total strong {
  color: #0b9c56;
  font-size: 1.1rem;
}

.invoice-payment-box {
  margin-top: 14px;
  border: 1px dashed #d8e3f3;
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.invoice-payment-box span {
  display: block;
  color: #66758f;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.invoice-payment-box pre {
  margin: 0;
  white-space: pre-wrap;
  color: #22324d;
  font: inherit;
}

.invoice-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: #5e6f8d;
  line-height: 1.4;
}

.invoice-note-legal {
  border-top: 1px solid #edf1f7;
  padding-top: 10px;
  color: #596a88;
}

/* PDF-style invoice redesign (based on context/facture_exemple.pdf) */
.invoice-preview {
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  border-radius: 8px;
  padding: 20px 24px;
  border: 1px solid #d8dce2;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  background-image: none;
  width: 100%;
}

.invoice-pdf-header {
  margin-bottom: 12px;
}

.invoice-pdf-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-pdf-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.invoice-pdf-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: #111;
}

.invoice-pdf-divider {
  margin-top: 10px;
  border-top: 2px solid #7f7f7f;
}

.invoice-pdf-top-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  margin: 16px 0 18px;
}

.invoice-pdf-party h4,
.invoice-pdf-client-block h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  font-weight: 800;
  color: #222;
}

.invoice-pdf-party p,
.invoice-pdf-party pre,
.invoice-pdf-client-block pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  color: #2b2b2b;
  font-size: 0.86rem;
  line-height: 1.55;
  font-weight: 400;
}

.invoice-pdf-party p + p {
  margin-top: 2px;
}

.invoice-pdf-party pre,
.invoice-pdf-client-block pre {
  margin-bottom: 0;
}

.invoice-pdf-meta {
  display: grid;
  align-content: start;
  gap: 3px;
  justify-items: end;
}

.invoice-pdf-meta div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: flex-end;
  width: 100%;
}

.invoice-pdf-meta span {
  font-size: 0.8rem;
  color: #222;
  font-weight: 700;
  text-transform: uppercase;
}

.invoice-pdf-meta strong {
  font-size: 0.84rem;
  color: #111;
  font-weight: 800;
}

.invoice-pdf-client-block {
  margin: 10px 0 18px;
}

.invoice-pdf-client-block pre {
  font-size: 0.84rem;
  line-height: 1.55;
}

.invoice-pdf-client-block p {
  margin: 2px 0 0;
  white-space: pre-wrap;
  font: inherit;
  color: #2b2b2b;
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 400;
}

.invoice-pdf-party p strong,
.invoice-pdf-client-block p strong {
  font-weight: 700;
}

.invoice-pdf-table {
  width: 100%;
  margin: 4px 0 0;
  border-collapse: collapse;
  border: 1px solid #bdbdbd;
  border-radius: 0;
}

.invoice-pdf-table th,
.invoice-pdf-table td {
  border: 1px solid #bdbdbd;
  padding: 9px 8px;
  font-size: 0.78rem;
}

.invoice-pdf-table th {
  background: var(--invoice-table-header-color, #000);
  color: #fff;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 0.75rem;
}

.invoice-pdf-table td {
  color: #111;
  background: #fff;
  vertical-align: top;
  line-height: 1.45;
}

.invoice-pdf-table td:first-child {
  width: 44%;
}

.invoice-pdf-table td:nth-child(n + 2) {
  text-align: center;
  font-weight: 600;
}

.invoice-pdf-table td:last-child {
  text-align: right;
  font-weight: 800;
}

.invoice-pdf-bottom-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 14px;
  align-items: start;
}

.invoice-pdf-payment-box {
  border: 1px solid #8f8f8f;
  padding: 10px 12px;
  min-height: 92px;
}

.invoice-pdf-payment-box h4 {
  margin: 0 0 4px;
  font-size: 0.84rem;
  font-weight: 800;
}

.invoice-pdf-payment-box p {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: #333;
  font-weight: 600;
}

.invoice-pdf-payment-box pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  color: #222;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 600;
}

.invoice-pdf-total-box {
  justify-self: end;
  width: min(320px, 100%);
}

.invoice-pdf-total-box > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #111;
}

.invoice-pdf-total-box .total-ttc {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #bdbdbd;
}

.invoice-pdf-total-box .total-ttc strong {
  font-size: 1.15rem;
  color: #111;
}

.invoice-pdf-total-box .invoice-note {
  margin-top: 6px;
  font-size: 0.68rem;
  color: #222;
  font-weight: 700;
  line-height: 1.25;
}

.invoice-note:empty {
  display: none;
}

.invoice-pdf-legal {
  margin-top: 28px;
  text-align: center;
}

.invoice-pdf-legal .invoice-note-legal {
  border-top: 0;
  padding-top: 0;
  margin: 0 auto 8px;
  font-size: 0.64rem;
  line-height: 1.35;
  color: #333;
  max-width: 92%;
  text-transform: uppercase;
}

.invoice-pdf-legal .invoice-footer-note {
  margin: 0;
  padding: 0;
  border-top: 0;
  background: transparent;
  color: #555;
  font-size: 0.62rem;
  line-height: 1.3;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
  display: grid;
  gap: 6px;
}

.history-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.history-item .muted {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-actions button {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 6px 9px;
  cursor: pointer;
}

.footer {
  padding: 14px 18px 20px;
  border-top: 1px solid var(--line);
  color: #7384ab;
  font-size: 0.78rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

.footer p + p {
  margin-top: 6px;
}

.footer-guides {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.footer-guides-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9aa8c0;
}

.footer-guides a {
  font-size: 0.82rem;
  color: #5d7ab5;
  text-decoration: none;
}

.footer-guides a:hover {
  text-decoration: underline;
  color: var(--brand);
}

.footer-clear-btn {
  margin-top: 10px;
  font-size: 0.74rem;
  padding: 6px 10px;
}

.hidden {
  display: none;
}

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

  .sidebar {
    order: 2;
  }

  .dashboard {
    order: 1;
  }

  .layout.view-invoice .sidebar {
    padding-bottom: 0;
  }

  .layout.layout-top-params .sidebar {
    grid-template-columns: 1fr 1fr;
    order: 0;
  }

}

@media (max-width: 760px) {
  .layout {
    padding: 8px;
    gap: 8px;
  }

  .dashboard,
  .simulation-view,
  .tools-view,
  .content-view {
    gap: 8px;
  }

  .panel {
    padding: 10px;
  }

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

  .segmented-main-tabs .segmented-btn {
    font-size: 0.74rem;
    padding: 8px 6px;
    line-height: 1.15;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 10px;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }

  .top-actions .ghost-btn,
  .top-actions .primary-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .beta-badge {
    font-size: 0.62rem;
    padding: 3px 7px;
  }

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

  .breakdown-content {
    grid-template-columns: 1fr;
  }

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

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

  .invoice-form,
  .invoice-form .subpanel,
  .invoice-form .field,
  .reminders-form-panel .field,
  .custom-reminder-row,
  .custom-reminder-row > * {
    min-width: 0;
  }

  .invoice-form input[type="text"],
  .invoice-form input[type="date"],
  .invoice-form input[type="number"],
  .invoice-form textarea,
  .reminders-form-panel input[type="text"],
  .reminders-form-panel input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
  }

  .invoice-form input[type="date"],
  .reminders-form-panel input[type="date"] {
    font-size: 0.8rem;
    padding: 7px 8px;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  .invoice-builder > .panel-header {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .invoice-builder > .panel-header .primary-btn {
    width: 100%;
  }

  .layout.layout-top-params .sidebar {
    grid-template-columns: 1fr;
    order: 0;
  }

  .tools-grid,
  .tool-form-grid,
  .tool-result-grid,
  .content-grid,
  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .logo-upload-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .logo-file-name {
    white-space: normal;
  }

  .invoice-preview-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .invoice-preview {
    min-width: 620px;
  }

  .invoice-pdf-bottom-grid {
    grid-template-columns: 1fr;
  }

  .invoice-preview {
    padding: 18px;
  }

  .invoice-pdf-table th,
  .invoice-pdf-table td {
    padding: 7px 6px;
    font-size: 0.74rem;
  }

  .invoice-pdf-party p,
  .invoice-pdf-client-block p,
  .invoice-pdf-party pre,
  .invoice-pdf-client-block pre {
    font-size: 0.78rem;
    line-height: 1.35;
  }

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

  .invoice-line-row .line-remove {
    grid-column: 2;
  }

  .invoice-line-row > * {
    min-width: 0;
  }

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

  .custom-reminder-row .custom-reminder-remove {
    justify-self: stretch;
    width: 100%;
  }

  .donut {
    width: 170px;
    height: 170px;
  }

  .donut::before {
    width: 116px;
    height: 116px;
  }

  .history-item-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .modal-card {
    padding: 14px 14px 12px;
    border-radius: 14px;
  }

  .modal-card h3 {
    font-size: 0.95rem;
  }

  .modal-card p {
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .segmented.segmented-main-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .brand {
    gap: 8px;
  }

  .brand-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.82rem;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .beta-badge {
    font-size: 0.58rem;
    padding: 3px 6px;
  }

  .view-tabs {
    padding: 8px;
  }

  .reminders-form-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .custom-reminder-row > * {
    min-width: 0;
  }

  .invoice-form input[type="date"],
  .reminders-form-panel input[type="date"] {
    font-size: 0.78rem;
    padding: 6px 8px;
    min-inline-size: 0;
  }

  .reminder-dates {
    grid-template-columns: 1fr;
  }

  .sidebar-inline-toggle-wrap {
    margin: -2px 0 6px;
  }

  .input-shell.with-suffix input {
    font-size: 1.25rem;
  }

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

  .invoice-line-row .line-remove {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }

  .invoice-preview {
    min-width: 560px;
  }

  .invoice-pdf-party p,
  .invoice-pdf-client-block p,
  .invoice-pdf-party pre,
  .invoice-pdf-client-block pre {
    font-size: 0.74rem;
    line-height: 1.32;
  }
}

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

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar,
  .footer,
  .modal-overlay,
  .sidebar,
  .sidebar-fab,
  .view-tabs,
  #simulationView,
  #historyPanel,
  .invoice-form,
  .invoice-builder > .panel-header {
    display: none !important;
  }

  #invoicePreview {
    position: static;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 6mm 7mm;
    font-size: 10pt;
  }

  .invoice-preview-wrap,
  .invoice-grid,
  .invoice-builder,
  .dashboard,
  .layout,
  #invoiceView {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .invoice-preview-wrap {
    overflow: visible !important;
    min-width: 0 !important;
  }

  .invoice-rules-panel {
    display: none !important;
  }

  .invoice-pdf-header,
  .invoice-pdf-top-grid,
  .invoice-pdf-client-block,
  .invoice-pdf-bottom-grid,
  .invoice-pdf-payment-box,
  .invoice-pdf-total-box,
  .invoice-pdf-legal {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-pdf-table {
    width: 100% !important;
    table-layout: fixed;
    break-inside: auto;
    page-break-inside: auto;
  }

  .invoice-pdf-table th,
  .invoice-pdf-table td {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  .invoice-pdf-top-grid {
    grid-template-columns: 1.15fr 0.85fr !important;
    margin: 5mm 0 5mm;
    gap: 6mm;
  }

  .invoice-pdf-meta {
    justify-items: end !important;
  }

  .invoice-pdf-meta div {
    justify-content: flex-end !important;
  }

  .invoice-pdf-client-block {
    margin: 2mm 0 5mm;
  }

  .invoice-pdf-table {
    margin-top: 2mm;
  }

  .invoice-pdf-table th,
  .invoice-pdf-table td {
    padding: 2.4mm 1.8mm;
    font-size: 9pt;
  }

  .invoice-pdf-bottom-grid {
    margin-top: 8mm;
    gap: 5mm;
  }

  .invoice-pdf-legal {
    margin-top: 7mm;
  }

  .invoice-pdf-title {
    font-size: 24pt;
  }

  .invoice-pdf-party h4,
  .invoice-pdf-client-block h4 {
    margin-bottom: 4px;
    font-size: 9.2pt;
  }

  .invoice-pdf-party p,
  .invoice-pdf-party pre,
  .invoice-pdf-client-block pre,
  .invoice-pdf-client-block p {
    font-size: 8.5pt;
    line-height: 1.28;
  }

  .invoice-pdf-meta {
    gap: 1.2mm;
  }

  .invoice-pdf-meta span,
  .invoice-pdf-meta strong {
    font-size: 8.2pt;
    white-space: nowrap;
  }

  .invoice-pdf-payment-box {
    min-height: 0;
    padding: 2.6mm 3mm;
  }

  .invoice-pdf-payment-box h4 {
    margin-bottom: 2px;
    font-size: 8.5pt;
  }

  .invoice-pdf-payment-box p {
    margin-bottom: 2px;
    font-size: 7.6pt;
  }

  .invoice-pdf-payment-box pre {
    font-size: 7.8pt;
    line-height: 1.22;
  }

  .invoice-pdf-total-box > div {
    padding: 1.2mm 0;
    font-size: 8.8pt;
  }

  .invoice-pdf-total-box .total-ttc {
    margin-top: 2mm;
    padding-top: 2mm;
  }

  .invoice-pdf-total-box .total-ttc strong {
    font-size: 12pt;
  }

  .invoice-pdf-total-box .invoice-note {
    margin-top: 2mm;
    font-size: 7pt;
    line-height: 1.15;
  }

  .invoice-pdf-legal .invoice-note-legal {
    font-size: 6.4pt;
    line-height: 1.2;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
