/* Evolvion Tools - shared stylesheet */

:root {
  --accent: #1a56db;
  --accent-hover: #1648b8;
  --heading: #111827;
  --body: #4b5563;
  --muted: #6b7280;
  --faint: #9ca3af;
  --border: #e5e7eb;
  --border-dash: #d1d5db;
  --section: #fafafa;
  --error: #b91c1c;
  --warn: #b45309;
  --ok: #047857;
  --radius-btn: 6px;
  --radius-card: 8px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05);
  --max-content: 1080px;
  --max-wide: 1360px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.25;
  margin: 0 0 16px;
}

h1 {
  font-size: 32px;
  font-weight: 600;
}

h2 {
  font-size: 20px;
  font-weight: 600;
}

h3 {
  font-size: 16px;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

/* Layout */

.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* Top nav */

.site-nav {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: relative;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--heading);
}

.site-nav .container,
.site-nav .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.nav-logo {
  width: 26px;
  height: 26px;
  display: block;
}

.wordmark:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--body);
  font-size: 14px;
}

.nav-links a[aria-current="page"] {
  color: var(--heading);
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.install-btn {
  font-size: 13px;
  color: var(--accent);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 5px 11px;
  cursor: pointer;
}

.install-btn:hover {
  border-color: var(--accent);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--section);
  margin-top: 56px;
}

.site-footer .container,
.site-footer .container-wide {
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

/* Landing hero */

.hero {
  background: var(--section);
  border-bottom: 1px solid var(--border);
  padding: 72px 0 64px;
  text-align: center;
}

.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 40px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero .lede {
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto 24px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: center;
  font-size: 14px;
  color: var(--heading);
}

.trust-row .icon {
  color: var(--accent);
  margin-right: 6px;
}

/* Landing tool cards */

.tools-section {
  padding: 48px 0 8px;
}

.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.tool-card {
  display: block;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
  color: var(--body);
}

.tool-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.tool-card:hover .tool-card-cta {
  text-decoration: underline;
}

.icon-tile {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 20px;
  background: #ffffff;
}

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

.tool-card p {
  margin-bottom: 12px;
}

.tool-card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.tool-card-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

/* Landing trust strip */

.trust-strip {
  margin: 40px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #ffffff;
}

.trust-strip > div {
  padding: 20px 24px;
}

.trust-strip > div + div {
  border-left: 1px solid var(--border);
}

.trust-strip h3 {
  font-size: 14px;
  margin-bottom: 4px;
}

.trust-strip p {
  font-size: 13px;
  margin: 0;
}

/* Tool page header + toolbar */

.tool-bar {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.tool-bar .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.tool-bar h1 {
  font-size: 22px;
  margin: 0;
}

.tool-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 0;
}

.tool-sub .icon {
  color: var(--accent);
}

.tool-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Buttons */

.btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(26, 86, 219, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 9px 14px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  background: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

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

.btn-secondary {
  background: #ffffff;
  color: var(--heading);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--faint);
}

.btn-small {
  padding: 6px 10px;
  font-size: 13px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Overflow menu */

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  min-width: 220px;
  padding: 4px;
  z-index: 40;
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--heading);
  border-radius: 4px;
  cursor: pointer;
}

.menu button:hover {
  background: var(--section);
}

.menu button.danger {
  color: var(--error);
}

.menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Workspace: form rail + preview canvas */

.workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  align-items: stretch;
}

.form-rail {
  padding: 20px 24px 40px 0;
  border-right: 1px solid var(--border);
}

.preview-canvas {
  background: var(--section);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workspace-outer {
  border-bottom: 1px solid var(--border);
}

/* Collapsible form sections */

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #ffffff;
  margin-bottom: 12px;
}

.form-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-card);
}

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

.form-section > summary .icon {
  color: var(--faint);
  transition: transform 0.15s ease;
}

.form-section[open] > summary .icon {
  transform: rotate(180deg);
}

.form-section-body {
  padding: 4px 16px 16px;
}

/* Forms */

.field {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--heading);
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--heading);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 7px 10px;
  line-height: 1.4;
}

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

input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  display: block;
  font-size: 13px;
  color: var(--error);
  margin-top: 4px;
}

.field-ok {
  display: block;
  font-size: 13px;
  color: var(--ok);
  margin-top: 4px;
}

.field-hint {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

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

input[type="file"] {
  font-size: 13px;
}

.add-logo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--border-dash);
  border-radius: var(--radius-btn);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}

.add-logo-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Segmented control */

.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  overflow: hidden;
}

.segmented label {
  flex: 1;
  margin: 0;
  font-weight: 400;
}

.segmented label + label {
  border-left: 1px solid var(--border);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  text-align: center;
  font-size: 13px;
  padding: 7px 6px;
  color: var(--heading);
  cursor: pointer;
  background: #ffffff;
}

.segmented input:checked + span {
  background: var(--accent);
  color: #ffffff;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.segmented span:hover {
  background: var(--section);
}

.segmented input:checked + span:hover {
  background: var(--accent);
}

/* Chips (due-date quick picks) */

.quick-picks {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  font: inherit;
  font-size: 12px;
  color: var(--body);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 3px 10px;
  cursor: pointer;
}

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

/* Line items */

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

.item-row:first-child {
  padding-top: 2px;
}

.item-row-desc input {
  margin-bottom: 6px;
}

.item-row-nums {
  display: grid;
  grid-template-columns: 70px 100px minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.item-amount {
  text-align: right;
  font-size: 13px;
  color: var(--heading);
  white-space: nowrap;
}

.remove-row-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  width: 30px;
  height: 32px;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.remove-row-btn:hover {
  color: var(--error);
  border-color: var(--error);
}

.add-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  padding: 8px 0 4px;
  cursor: pointer;
}

.add-item-btn:hover {
  text-decoration: underline;
}

/* Totals */

.totals {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 13px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.totals-row.grand {
  font-weight: 600;
  color: var(--heading);
  font-size: 15px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 6px;
}

/* Invoice preview sheet */

.preview-toolbar {
  width: 100%;
  max-width: 660px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.invoice-preview {
  width: 100%;
  max-width: 660px;
  aspect-ratio: 210 / 297;
  height: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 48px;
  font-size: 13px;
  color: #111827;
}

.inv-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.inv-logo {
  max-height: 64px;
  max-width: 200px;
  display: block;
  margin-bottom: 8px;
}

.inv-business-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 4px;
}

.inv-business-name.has-logo {
  color: #111827;
}

.inv-doc-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
  color: #111827;
  margin: 0;
  white-space: nowrap;
}

.inv-meta {
  text-align: right;
  margin-top: 8px;
  line-height: 1.7;
  white-space: nowrap;
}

.inv-meta span {
  color: var(--faint);
  margin-right: 6px;
}

.inv-addr {
  white-space: pre-line;
  line-height: 1.6;
  color: #4b5563;
  font-size: 12px;
}

.inv-billto {
  margin-bottom: 28px;
}

.inv-billto h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 0 0 4px;
}

.inv-billto .inv-client-name {
  font-weight: 600;
  color: #111827;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.inv-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  border-bottom: 1px solid #111827;
  padding: 6px 8px 6px 0;
}

.inv-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 8px 8px 0;
  vertical-align: top;
  font-size: 12px;
}

.inv-table th.num,
.inv-table td.num {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

.inv-totals {
  max-width: 240px;
  margin-left: auto;
  margin-bottom: 28px;
  font-size: 12px;
}

.inv-totals .totals-row.grand {
  font-size: 15px;
}

.inv-nogst-note {
  font-size: 11px;
  color: #4b5563;
  text-align: right;
  margin: 4px 0 0;
}

.inv-payment {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.inv-payment h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 0 0 8px;
}

.inv-payment dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 16px;
  margin: 0;
  font-size: 12px;
}

.inv-payment dt {
  color: var(--faint);
}

.inv-payment dd {
  margin: 0;
  color: #111827;
}

.inv-notes {
  white-space: pre-line;
  color: #4b5563;
  font-size: 11px;
}

.preview-toggle {
  display: none;
}

/* Compressor */

.settings-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #ffffff;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  margin: 20px 0 12px;
}

.setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.setting label {
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}

.setting input[type="range"] {
  width: 130px;
}

.setting select,
.setting input[type="text"],
.setting input[type="number"] {
  width: auto;
  font-size: 13px;
  padding: 5px 8px;
}

.setting .range-value {
  color: var(--muted);
  min-width: 24px;
}

.setting-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

.drop-zone {
  border: 2px dashed var(--border-dash);
  border-radius: var(--radius-card);
  background: var(--section);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: #ffffff;
}

.drop-zone .icon {
  font-size: 24px;
  color: var(--accent);
}

.drop-zone p {
  margin: 8px 0 4px;
  color: var(--heading);
  font-weight: 500;
}

.drop-zone .field-hint {
  margin: 0 0 12px;
}

.batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #ffffff;
  padding: 10px 16px;
  margin-top: 12px;
}

.batch-bar .summary-line {
  font-size: 14px;
  color: var(--heading);
  font-weight: 500;
  margin: 0;
}

.batch-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.progress-track {
  width: 140px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s ease;
}

.file-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.file-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  margin-bottom: 6px;
  background: #ffffff;
  font-size: 13px;
}

.file-row img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--section);
}

.file-row .file-name {
  color: var(--heading);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row .file-status {
  color: var(--muted);
  white-space: nowrap;
}

.file-row .file-saved {
  color: var(--ok);
  font-weight: 600;
  white-space: nowrap;
}

.file-row .file-error {
  color: var(--error);
  white-space: normal;
}

.file-row .file-warn {
  color: var(--warn);
  font-weight: 400;
  font-size: 12px;
}

/* Content / SEO sections */

.content-section {
  border-top: 1px solid var(--border);
  background: var(--section);
  margin-top: 48px;
  padding: 48px 0;
}

.content-section .container {
  max-width: 720px;
}

.content-section h2 {
  margin-bottom: 16px;
}

.faq dt {
  font-weight: 600;
  color: var(--heading);
  margin-top: 16px;
}

.faq dd {
  margin: 4px 0 0;
}

/* Status line */

.status-line {
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 20px;
}

.status-line.ok {
  color: var(--ok);
}

.status-line.err {
  color: var(--error);
}

/* Responsive */

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 380px minmax(0, 1fr);
  }

  .invoice-preview {
    padding: 32px;
  }
}

/* Tablets portrait */
@media (max-width: 920px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }

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

  .form-rail {
    border-right: none;
    padding-right: 0;
  }

  .preview-canvas {
    border-top: 1px solid var(--border);
    padding: 24px 16px;
  }

  .preview-toggle {
    display: inline-flex;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .trust-strip > div + div {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: 30px;
  }
}

/* Large phones and small tablets */
@media (max-width: 700px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 16px 12px;
    z-index: 50;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }

  .nav-links a:last-of-type {
    border-bottom: none;
  }

  .nav-links .install-btn {
    margin-top: 8px;
    min-height: 44px;
  }

  .settings-bar {
    gap: 12px;
    padding: 12px 14px;
  }

  .setting-divider {
    display: none;
  }

  .setting {
    width: 100%;
    gap: 10px;
  }

  .setting label {
    min-width: 72px;
  }

  .setting input[type="range"] {
    flex: 1;
    width: auto;
  }

  .setting select,
  .setting input[type="text"],
  .setting input[type="number"] {
    flex: 1;
    width: auto !important;
  }
}

/* Phones */
@media (max-width: 640px) {
  .container,
  .container-wide {
    padding: 0 16px;
  }

  h1 {
    font-size: 26px;
  }

  .tool-bar h1 {
    font-size: 20px;
  }

  .tool-bar .container-wide {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .tool-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    justify-content: center;
    padding: 10px 8px;
    font-size: 14px;
  }

  .tool-actions .btn-primary {
    flex-basis: 100%;
  }

  .tool-actions .menu-wrap {
    flex: 1 1 calc(50% - 4px);
    display: flex;
  }

  .tool-actions .menu-wrap .btn {
    width: 100%;
  }

  .btn,
  .btn-small {
    min-height: 40px;
  }

  .chip {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
  }

  .remove-row-btn {
    width: 40px;
    height: 42px;
  }

  .item-row-nums {
    grid-template-columns: 64px minmax(0, 1fr) auto 40px;
  }

  .field-row,
  .field-row-3 {
    grid-template-columns: 1fr;
  }

  .form-section-body {
    padding: 4px 12px 14px;
  }

  .invoice-preview {
    padding: 20px;
    aspect-ratio: auto;
    min-height: 420px;
    font-size: 12px;
  }

  .inv-top {
    flex-direction: column;
    gap: 12px;
  }

  .inv-doc-title,
  .inv-meta {
    text-align: left;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .file-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    row-gap: 6px;
  }

  .file-row .file-status {
    grid-column: 2 / -1;
  }

  .file-row .btn {
    min-height: 40px;
  }

  .batch-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .batch-progress {
    justify-content: space-between;
  }

  .progress-track {
    flex: 1;
  }

  .content-section {
    padding: 32px 0;
    margin-top: 32px;
  }

  .site-footer .container,
  .site-footer .container-wide {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Print: only the invoice preview */

@media print {
  body.printing-invoice * {
    visibility: hidden;
  }

  body.printing-invoice .invoice-preview,
  body.printing-invoice .invoice-preview * {
    visibility: visible;
  }

  body.printing-invoice .invoice-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    border: none;
    box-shadow: none;
    padding: 0;
    aspect-ratio: auto;
    min-height: 0;
  }

  .site-nav,
  .site-footer,
  .tool-bar,
  .preview-toolbar {
    display: none;
  }
}
