/* Tools section. Loaded after /styles.css and reuses its tokens, type and rules. */

:root {
  --surface: #ffffff;
  --field: #ffffff;
  --danger: #9b2c22;
  --ok: #1f4d3a;
  --warn: #8a5a12;
}

/* —— Page head —— */

.tool-hero {
  padding-top: clamp(40px, 7vw, 96px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
}

.crumbs a {
  text-decoration: none;
  color: var(--ink-soft);
}

.crumbs a:hover {
  color: var(--ink);
}

.tool-title {
  margin-top: 22px;
  max-width: 20ch;
  font-size: clamp(36px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.tool-lede {
  margin-top: 22px;
  max-width: 40em;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* —— Privacy strip —— */

.privacy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-soft);
}

.privacy svg {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.privacy strong {
  color: var(--ink);
  font-weight: 500;
}

/* —— Tool panel —— */

.tool {
  padding-bottom: clamp(48px, 6vw, 80px);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 1px solid var(--rule-strong);
  padding: clamp(18px, 3vw, 36px);
}

.panel + .panel {
  margin-top: 16px;
}

.panel-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 3vw, 40px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.row-end {
  justify-content: flex-end;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 14px 16px;
}

.fields-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span,
.legend,
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field > span em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  line-height: 1.4;
  transition: border-color 0.2s;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23565b58' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-faint);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--ink);
  outline: none;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mono {
  font-family: var(--font-mono);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* Buttons. .button (primary) comes from styles.css. */

.button {
  min-height: 48px;
  border: 0;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  background: var(--ink-faint);
}

.button:disabled::before {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn:hover:not(:disabled) {
  border-color: var(--ink);
}

.btn:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
}

.btn-sm {
  min-height: 36px;
  min-width: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.btn-quiet:hover:not(:disabled) {
  border-color: var(--rule);
  color: var(--ink);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.btn[aria-pressed="true"],
.seg input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* Segmented radio group */

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.seg label {
  position: relative;
}

.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.seg span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.seg label:hover span {
  border-color: var(--ink);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: 15px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

input[type="range"] {
  width: 100%;
  height: 32px;
  margin: 0;
  accent-color: var(--ink);
}

input[type="color"] {
  flex: none;
  width: 48px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--rule);
  background: var(--surface);
  cursor: pointer;
}

/* —— Drop zone —— */

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 28px 20px;
  border: 1px dashed var(--ink-faint);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop:hover,
.drop.is-over {
  border-color: var(--ink);
  background: #f0f0ed;
}

.drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.drop-hint {
  font-size: 14px;
  color: var(--ink-soft);
}

.drop svg {
  color: var(--ink-soft);
}

.drop-compact {
  min-height: 110px;
}

/* —— Lists of files —— */

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.files:empty,
.results:empty {
  display: none;
}

.files li {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.files .idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.files .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.files .meta-line {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-faint);
}

.files .acts {
  display: flex;
  gap: 4px;
}

.status {
  min-height: 1.6em;
  font-size: 14px;
  color: var(--ink-soft);
}

.status.is-error {
  color: var(--danger);
}

.status.is-ok {
  color: var(--ok);
}

.note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.hidden {
  display: none !important;
}

/* —— Stats —— */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  border-top: 1px solid var(--rule-strong);
}

.stat {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--rule);
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-faint);
}

.pos {
  color: var(--ok);
}

.neg {
  color: var(--danger);
}

/* —— Tables —— */

.table-wrap {
  position: relative; /* keeps the visually hidden captions inside the scroll box */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--rule-strong);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.table td {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.table .r {
  text-align: right;
}

.table .input {
  min-width: 90px;
}

/* —— Output box —— */

.output {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
}

.output-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* —— Meter —— */

.meter {
  height: 6px;
  background: var(--rule);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--c, var(--ink));
  transition: width 0.4s var(--ease), background 0.4s;
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px 20px;
  font-size: 14px;
}

.checks li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink-soft);
}

.checks li::before {
  content: "—";
  flex: none;
  width: 1em;
  font-family: var(--font-mono);
  color: var(--ink-faint);
}

.checks li.is-yes {
  color: var(--ink);
}

.checks li.is-yes::before {
  content: "✓";
  color: var(--ok);
}

.checks li.is-bad::before {
  content: "!";
  color: var(--danger);
}

/* —— Swatches —— */

.swatches {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
  border: 1px solid var(--rule);
}

.swatch {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--rule);
}

.swatch:last-child {
  border-right: 0;
}

.swatch-chip {
  height: clamp(110px, 16vw, 200px);
}

.swatch-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--surface);
}

.swatch-hex {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.swatch .btn {
  margin-top: 6px;
  align-self: flex-start;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
}

/* —— Image picker canvas —— */

.canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background:
    repeating-conic-gradient(#ececea 0% 25%, #f7f7f5 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--rule);
}

.canvas-wrap canvas {
  display: block;
  max-width: 100%;
  max-height: 560px;
  cursor: crosshair;
  touch-action: none;
}

.canvas-wrap canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reticle {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.picked {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.picked-chip {
  width: 96px;
  height: 96px;
  border: 1px solid var(--rule);
}

.codes {
  display: grid;
  gap: 6px;
}

.code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 14px;
}

.code-line b {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  width: 3.5em;
  flex: none;
}

.code-line code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* —— Image compressor results —— */

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.results li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.results img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.results .meta-line {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
}

.saving {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* —— Page grid (page remover) —— */

.pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.page-tile {
  position: relative;
  aspect-ratio: 0.72;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.page-tile:hover {
  border-color: var(--ink);
}

.page-tile[aria-pressed="true"] {
  border-color: var(--danger);
  background: #f6e9e7;
  color: var(--danger);
  text-decoration: line-through;
}

.page-tile[aria-pressed="true"]::after {
  content: "×";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 13px;
  text-decoration: none;
}

/* —— Signature / invoice preview —— */

.preview-frame {
  min-height: 200px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--rule);
  background: #fff;
  overflow-x: auto;
}

.invoice-sheet {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px);
  background: #fff;
  border: 1px solid var(--rule);
  color: #111;
  font-size: 14px;
  line-height: 1.5;
}

.inv-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #111;
}

.inv-head h2 {
  font-size: 32px;
  letter-spacing: -0.03em;
}

.inv-logo {
  max-width: 160px;
  max-height: 64px;
  margin-bottom: 10px;
}

.inv-meta {
  text-align: right;
  font-size: 13px;
}

.inv-meta dl {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 14px;
  justify-content: end;
}

.inv-meta dt {
  color: #666;
}

.inv-meta dd {
  margin: 0;
}

.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 0;
}

.inv-parties p {
  white-space: pre-line;
}

.inv-label {
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #777;
}

.inv-items {
  width: 100%;
  border-collapse: collapse;
}

.inv-items th {
  padding: 8px 0;
  border-bottom: 1px solid #111;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

.inv-items td {
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

.inv-items .r {
  text-align: right;
  padding-left: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.inv-totals {
  width: min(100%, 300px);
  margin: 16px 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.inv-totals div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.inv-totals .grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid #111;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}

.inv-notes {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #ddd;
  white-space: pre-line;
  color: #444;
}

/* —— Content sections —— */

.tool-section {
  padding-top: clamp(56px, 7vw, 100px);
}

.tool-section .section-head {
  margin-bottom: clamp(28px, 4vw, 48px);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px var(--col-gap);
}

.steps li {
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.steps .step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.steps h3 {
  margin-top: 18px;
  font-size: 21px;
  line-height: 1.25;
}

.steps p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-soft);
}

.faq {
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  position: relative;
  display: block;
  padding: 20px 44px 20px 0;
  font-family: var(--font-display);
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 500;
  letter-spacing: -0.015em;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-soft);
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq .answer {
  max-width: 44em;
  padding: 0 0 22px;
  color: var(--ink-soft);
}

.faq .answer p + p {
  margin-top: 10px;
}

/* Tool cards (index + related) */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--col-gap);
}

.card {
  border-top: 1px solid var(--rule);
}

.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 0 28px;
  text-decoration: none;
}

.card .kicker {
  display: block;
}

.card h3 {
  margin-top: 14px;
  font-size: 21px;
  line-height: 1.2;
  transition: color 0.2s;
}

.card p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-soft);
}

.card .go {
  margin-top: auto;
  padding-top: 14px;
  font-size: 14px;
  font-weight: 500;
}

.card .go span {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

@media (hover: hover) {
  .card a:hover h3 {
    color: var(--accent);
  }

  .card a:hover .go span {
    transform: translateX(4px);
  }
}

.group-title {
  margin: clamp(40px, 5vw, 64px) 0 18px;
  font-size: 13px;
}

.group-title:first-child {
  margin-top: 0;
}

/* Sister sites strip */

.family {
  margin-top: clamp(64px, 8vw, 120px);
  padding: 28px 0 clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--rule-strong);
}

.family-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px var(--col-gap);
}

.family-list a {
  display: block;
  text-decoration: none;
}

.family-list strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.family-list span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-soft);
}

@media (hover: hover) {
  .family-list a:hover strong {
    color: var(--accent);
  }
}

/* Toast for copy feedback */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 80;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s;
  pointer-events: none;
}

.toast.is-on {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* —— Ad slots (only rendered when AdSense is configured) ——
   Height is reserved up front so a late-loading ad can't shift the page. */

.ad-slot {
  padding-top: clamp(40px, 5vw, 64px);
}

.ad-slot .label {
  margin-bottom: 8px;
}

.ad-slot ins {
  min-height: 280px;
  background: #f0f0ed;
}

/* —— Privacy policy —— */

.policy {
  padding-bottom: clamp(48px, 6vw, 80px);
}

.policy-section {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 12px var(--col-gap);
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.policy-section h2 {
  grid-row: span 6;
  font-size: 21px;
  line-height: 1.25;
}

.policy-section p {
  grid-column: 2;
  max-width: 42em;
  color: var(--ink-soft);
}

.policy-section a,
.privacy a {
  color: var(--ink);
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .policy-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .policy-section h2 {
    grid-row: auto;
  }

  .policy-section p {
    grid-column: 1;
  }
}

.conv-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 14px 12px;
}

.note.is-error {
  color: var(--danger);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

/* —— Responsive —— */

@media (max-width: 1024px) {
  .panel-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .cards,
  .family-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .steps,
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .fields-2,
  .inv-parties {
    grid-template-columns: minmax(0, 1fr);
  }

  .conv-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .conv-row > .field:first-child {
    grid-column: 1 / -1;
  }

  .swatches {
    grid-template-columns: minmax(0, 1fr);
  }

  .swatch {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .swatch:last-child {
    border-bottom: 0;
  }

  .swatch-chip {
    width: 38%;
    height: auto;
    min-height: 96px;
  }

  .swatch-body {
    flex: 1;
  }

  .inv-meta {
    text-align: left;
  }

  .inv-meta dl {
    justify-content: start;
  }
}

@media (max-width: 480px) {
  .family-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .files li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .files .idx {
    display: none;
  }

  .picked {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .picked-chip {
    width: 64px;
    height: 64px;
  }
}

/* —— Print (invoice) —— */

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff;
  }

  body.print-invoice > *:not(main),
  body.print-invoice main > *:not(.tool),
  body.print-invoice .tool > .wrap > *:not(.panel-preview),
  body.print-invoice .panel-preview > *:not(.invoice-sheet) {
    display: none !important;
  }

  body.print-invoice .panel-preview,
  body.print-invoice .tool,
  body.print-invoice .tool > .wrap {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    max-width: none;
  }

  body.print-invoice .invoice-sheet {
    max-width: none;
    padding: 0;
    border: 0;
  }

  .invoice-sheet * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
