:root,
.invoice-pages,
.print-invoice {
  color-scheme: light;
  --ink: #20352e;
  --muted: #64746d;
  --green: #285c49;
  --green-dark: #194435;
  --mint: #e6f0e9;
  --cream: #f7f6f0;
  --line: #e3e9e3;
  --background: #fff;
  --surface: #fff;
  --panel: #fbfcfa;
  --footer: #fafbf9;
  --header: rgba(255, 255, 255, .96);
  --on-accent: #fff;
  --input-border: #cbd6cd;
  --checkbox-border: #a8bbae;
  --accent-border: #bad0bf;
  --hover-surface: #f7faf7;
  --warning-bg: #fff8e8;
  --warning-border: #e9d9b6;
  --hint-bg: #fffaf0;
  --preview-bg: #fff7dd;
  --preview-border: #e6c36a;
  --error-bg: #fff5f3;
  --error-border: #d99186;
  --alert-bg: #fdf0f0;
  --alert-border: #e2b4b4;
  --danger-text: #873a30;
  --danger-soft: #f7e9e6;
  --error-text: #b3261e;
  --success-text: #1f7a3d;
  --focus-ring: rgba(47, 111, 79, .25);
  --marker: #6a9a79;
  --guide-number: #7c9e86;
  --decoration-line: #edf1ed;
  --decoration-green: #d9e9dd;
  --decoration-gold: #f1dfbb;
  --select-arrow: 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='%23566' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --checkbox-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23285c4b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 10 3 3 7-7'/%3E%3C/svg%3E");
  --shadow: 0 16px 45px rgba(32, 53, 46, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-underline-offset: .2em; }
a:hover { color: var(--green-dark); }
a:focus-visible {
  outline: 3px solid #e5a64b;
  outline-offset: 4px;
  border-radius: 3px;
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--header);
}

.site-header__inner,
.site-footer__inner {
  width: min(1120px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.04em;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: var(--on-accent);
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
}

.brand__light { color: var(--green); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover { color: var(--green); }

main {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

main > h1 {
  max-width: 780px;
  margin: 0 0 20px;
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 720;
  letter-spacing: -.055em;
  line-height: 1.12;
}

main > h1 + p {
  margin: 0 0 38px;
  color: var(--muted);
  font-size: 1.12rem;
}

main h2 {
  margin: 48px 0 16px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 680;
  letter-spacing: -.035em;
  line-height: 1.25;
}

main h3 {
  margin: 32px 0 10px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 680;
  letter-spacing: -.02em;
}

main p { margin: 0 0 18px; }
main li { padding-left: 5px; }
main li + li { margin-top: 8px; }
main ul,
main ol { padding-left: 1.35rem; }
main li::marker { color: var(--marker); }

main > section:not(.hero):not(.limits):not(.guides) {
  margin: 42px 0;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

main > section h2 { margin-top: 0; }

table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  font-size: .95rem;
}

th {
  background: var(--mint);
  color: var(--green-dark);
  font-weight: 700;
  text-align: left;
}

th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td:first-child { width: 30%; font-weight: 650; }

main > p > small,
main small { color: var(--muted); font-size: .84rem; }

.hero {
  position: relative;
  display: grid;
  min-height: 390px;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  gap: 30px;
  margin: -4px 0 72px;
  padding: 52px 64px;
  overflow: hidden;
  border-radius: 26px;
  background: var(--cream);
}

.hero__content { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: .77rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 720;
  letter-spacing: -.065em;
  line-height: 1.04;
}

.hero h1 span { color: var(--green); }
.hero__intro {
  max-width: 480px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 1.08rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 9px;
  font-size: .93rem;
  font-weight: 650;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

input.button, button.button { border: 1px solid transparent; font-family: inherit; line-height: inherit; cursor: pointer; }

.button--danger { gap: 8px; background: #b3261e; color: #fff; }
.button--danger:hover, .button--danger:focus-visible { background: #8c1d18; color: #fff; }
.button--primary { background: var(--green); color: var(--on-accent); }
.button--primary:hover { background: var(--green-dark); color: var(--on-accent); }

.hero__art {
  position: relative;
  display: grid;
  min-height: 250px;
  place-items: center;
}

.hero-card {
  position: relative;
  z-index: 1;
  width: min(280px, 100%);
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(32, 53, 46, .13);
  font-size: .93rem;
  font-weight: 650;
  transform: rotate(3deg);
}

.hero-card__icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 13px;
  background: var(--mint);
  color: var(--green);
  font-size: 1.3rem;
}

.hero-card__line { height: 9px; margin-top: 22px; border-radius: 9px; background: var(--decoration-line); }
.hero-card__line--short { width: 58%; margin-top: 9px; }
.hero__spark { position: absolute; border-radius: 50%; background: var(--decoration-green); }
.hero__spark--one { top: 18px; right: 22px; width: 86px; height: 86px; }
.hero__spark--two { bottom: 13px; left: 8px; width: 46px; height: 46px; background: var(--decoration-gold); }

.simple-explainer {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--mint);
}

.simple-explainer p { margin: 0; }
.simple-explainer__icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 750;
}

.limits {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  margin: 65px 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.limits h2 { margin: 0 0 10px; }
.limits > div:first-child p:last-child { max-width: 330px; margin: 0; color: var(--muted); }
.limit-card {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  justify-content: center;
  padding: 19px;
  border-radius: 13px;
  background: var(--cream);
}

.limit-card span, .limit-card small { color: var(--muted); }
.limit-card strong { margin: 3px 0; color: var(--green-dark); font-size: 1.8rem; letter-spacing: -.04em; }
.limits__note { grid-column: 2 / 4; margin: -6px 0 0; color: var(--muted); font-size: .9rem; }

.guides { margin-top: 72px; }
.guides > h2 { margin-top: 0; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.guide-card {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.guide-card:hover { transform: translateY(-4px); border-color: var(--accent-border); box-shadow: var(--shadow); color: var(--ink); }
.guide-card__number { margin-bottom: 24px; color: var(--guide-number); font-size: .78rem; font-weight: 750; letter-spacing: .08em; }
.guide-card__title { margin-bottom: 7px; font-size: 1.1rem; font-weight: 700; }
.guide-card__text { max-width: 230px; color: var(--muted); font-size: .91rem; }
.guide-card__arrow { position: absolute; right: 22px; bottom: 19px; color: var(--green); font-size: 1.2rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--footer); }
.site-footer__inner { min-height: 72px; color: var(--muted); font-size: .82rem; }

@media (max-width: 760px) {
  .site-header__inner, .site-footer__inner { width: min(100% - 32px, 560px); }
  .site-header__inner { min-height: 68px; flex-wrap: wrap; gap: 0; padding: 12px 0; }
  .site-nav { width: 100%; justify-content: space-between; gap: 10px; padding-top: 10px; }
  .site-nav { flex-wrap: wrap; justify-content: flex-start; gap: 10px 18px; }
  .site-nav a { font-size: .78rem; }
  main { width: min(100% - 32px, 620px); padding: 36px 0 60px; }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 10px; margin: 0 0 50px; padding: 38px 26px 24px; border-radius: 19px; }
  .hero h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .hero__art { min-height: 190px; }
  .hero-card { width: 245px; }
  .limits { grid-template-columns: 1fr 1fr; margin: 48px 0; padding: 22px; }
  .limits > div:first-child { grid-column: 1 / -1; }
  .limits__note { grid-column: 1 / -1; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { min-height: 180px; }
  main > section:not(.hero):not(.limits):not(.guides) { padding: 22px; }
  table { display: block; overflow-x: auto; white-space: normal; }
  th, td { min-width: 150px; padding: 11px; }
  .site-footer__inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; padding: 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.button--secondary,
input.button--secondary, button.button--secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green);
}

.invoice-panel {
  margin: 28px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.invoice-panel h2 { margin-top: 0; }
.invoice-hint { border-color: var(--warning-border); background: var(--hint-bg); }
.invoice-hint li + li { margin-top: 12px; }
.invoice-hint--subtle { margin: 16px 0; padding: 12px 16px; font-size: .9rem; }
.invoice-hint--subtle h2 { margin-bottom: 4px; font-size: .95rem; font-weight: 650; }
.invoice-hint--subtle p { margin: 0; color: var(--muted); }
.invoice-hint--subtle .invoice-hint__answer { margin-bottom: 6px; color: var(--ink); font-size: 1.05rem; }
.invoice-hint--subtle .invoice-hint__more { font-size: .85rem; }
.invoice-hint__sources { margin-bottom: 0; font-size: .9rem; }
.e-invoice-note { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.e-invoice-note__icon { flex: 0 0 22px; margin-top: 2px; color: var(--green); }
.e-invoice-note__content { min-width: 0; font-size: .9rem; line-height: 1.6; }
.e-invoice-note h2 { margin: 0 0 8px; font-size: 1rem; line-height: 1.4; font-weight: 650; }
.e-invoice-note p { margin: 0 0 10px; color: var(--muted); }
.e-invoice-note strong { color: var(--ink); }
.e-invoice-note p:last-child { margin-bottom: 0; }
.e-invoice-note .invoice-hint__more { margin-top: 12px; font-size: .85rem; }

.invoice-new > h1 + p { margin-bottom: 16px; }
.invoice-new .invoice-form { margin-top: 0; }
.invoice-step { margin: 16px 0; scroll-margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.invoice-step__heading { display: flex; align-items: center; gap: 14px; padding: 20px; }
.invoice-step__heading h2 { margin: 0; font-size: 1.15rem; }
.invoice-step__number { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--green); color: var(--on-accent); font-weight: 700; }
.invoice-seller-details > summary { display: flex; align-items: center; gap: 12px; padding: 0 20px 16px; cursor: pointer; list-style: none; }
.invoice-seller-details > summary::-webkit-details-marker { display: none; }
.invoice-seller-summary { display: grid; flex: 1; gap: 3px; min-width: 0; color: var(--muted); font-size: .9rem; font-weight: 400; }
.invoice-seller-summary strong { color: var(--ink); font-size: 1rem; }
.invoice-seller-summary__action { display: inline-flex; flex: 0 0 auto; align-items: center; color: var(--green); }
.invoice-seller-summary__action svg { transition: transform .15s ease; }
.invoice-seller-details[open] .invoice-seller-summary__action svg { transform: rotate(180deg); }
.invoice-step__content { padding: 0 20px 20px; }
.invoice-step__content > .invoice-panel { margin: 0; padding: 4px 0 20px; border: 0; border-radius: 0; background: transparent; }
.invoice-step__content > .invoice-panel > :first-child { margin-top: 0; }
.invoice-step__content > .invoice-hint { margin: 12px 0; padding: 18px; border-radius: 12px; background: var(--hint-bg); }
.invoice-hint > h2 { font-size: 1rem; font-weight: 700; }
@media (max-width: 640px) {
  .invoice-step__heading { padding: 16px; gap: 10px; }
  .invoice-seller-details > summary { padding-right: 16px; padding-left: 16px; }
  .invoice-seller-summary { font-size: .82rem; }
  .invoice-step__content { padding: 0 16px 16px; }
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: .9rem; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.field select {
  appearance: none;
  padding-right: 38px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }

.date-picker { position: relative; }
.date-picker--enhanced input::-webkit-calendar-picker-indicator { display: none; }
.field-label { display: flex; align-items: center; gap: 7px; }
.field-label__icon { flex: 0 0 18px; color: var(--green); vertical-align: middle; }
.date-picker__calendar { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; box-sizing: border-box; width: min(360px, calc(100vw - 48px)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 32px rgba(20, 40, 32, .18); }
.date-picker__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.date-picker__calendar button { min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.date-picker__header button { width: 40px; font-size: 1.6rem; color: var(--green); }
.date-picker__weekdays, .date-picker__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.date-picker__weekdays { margin-bottom: 6px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.date-picker__days button { padding: 0; }
.date-picker__days button[aria-current="date"] { box-shadow: inset 0 0 0 1px var(--green); }
.date-picker__calendar button:hover { background: var(--mint); }
.date-picker__days button[aria-pressed="true"] { background: var(--green); color: var(--on-accent); font-weight: 700; }
.date-picker__calendar button:disabled { opacity: .35; cursor: default; }
.date-picker button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.date-picker__footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.date-picker__footer button { padding: 0 12px; color: var(--green); font-weight: 650; }

.rich-text { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rich-text:focus-within { border-color: var(--green, #2f6f4f); outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.rich-text__toolbar { display: flex; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); }
.rich-text__toolbar button { min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.rich-text__toolbar button.is-active { background: var(--mint, #e6efe8); border-color: var(--green); }
.rich-text__editor { min-height: 180px; max-height: 420px; overflow-y: auto; padding: 12px 14px; line-height: 1.5; outline: 0; }
.rich-text__editor p, .rich-text__editor div { margin: 0 0 .5em; }
.rich-text__editor ul, .rich-text__editor ol, .invoice-line-details ul, .invoice-line-details ol { margin: .3em 0; padding-left: 1.4em; }
.rich-text__editor ul, .invoice-line-details ul { list-style: disc outside; }
.rich-text__editor ol, .invoice-line-details ol { list-style: decimal outside; }
.rich-text__editor li + li, .invoice-line-details li + li { margin-top: 0; }
.invoice-line-details { font-size: .85em; font-weight: 400; }
.invoice-line-details p, .invoice-line-details div { margin: 0 0 .3em; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green, #2f6f4f); outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.field small { color: var(--muted); font-size: .8rem; }
.bookkeeping-category-help { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 14px 16px; border-radius: 10px; background: var(--mint); }
.form-errors { margin: 24px 0; padding: 18px 22px; border: 1px solid var(--error-border); border-radius: 12px; background: var(--error-bg); }
.form-errors p { font-weight: 700; }
.form-errors p, .form-errors ul { margin-bottom: 0; }
.invoice-lines { display: grid; gap: 14px; margin-bottom: 16px; }
.invoice-line {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.invoice-line__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.invoice-line__title { color: var(--green); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.invoice-line__body { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(240px, 1fr); gap: 20px; align-items: start; padding: 16px; }
.invoice-line__description, .invoice-line__pricing { display: grid; min-width: 0; gap: 14px; }
.invoice-line__body select { width: 100%; }
.invoice-line__total { grid-column: 1 / -1; margin: 0; text-align: right; font-size: 1.05rem; }
.invoice-line__remove {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--danger-text);
  cursor: pointer;
}
.invoice-line__remove:hover, .invoice-line__remove:focus-visible { background: var(--danger-soft); }
.button--remove { min-height: 44px; padding: 0 12px; border: 0; background: var(--danger-soft); color: var(--danger-text); cursor: pointer; }
.invoice-form__actions, .invoice-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.invoice-form__actions {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-bottom: 0;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line, #e3e8e4);
}
.invoice-draft-status { flex: 1 1 220px; min-width: 0; align-self: center; margin-left: auto; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.invoice-draft-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0; padding: 18px; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--mint); }
.invoice-draft-card > div { display: grid; gap: 4px; }
.invoice-draft-card small { color: var(--muted); }
.invoice-draft-card .invoice-draft-card__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.invoice-draft-card__actions form { margin: 0; }
.invoice-list { display: grid; gap: 10px; }
.invoice-list__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}
.invoice-list__item { scroll-margin-top: 24px; }
.invoice-list__item:target { outline: 2px solid var(--green-dark); outline-offset: 4px; }
.invoice-list__item:hover { border-color: var(--accent-border); background: var(--panel); }
.invoice-list__identity { display: flex; min-width: 0; flex-direction: column; overflow-wrap: anywhere; }
.invoice-list__identity small { color: var(--muted); }
.invoice-list__labels, .invoice-list__details { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.invoice-list__labels { gap: 8px; }
.invoice-list__labels .invoice-list__payment-button {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 4px 12px;
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--green-dark);
  font-size: .8rem;
  font-weight: 600;
  line-height: inherit;
}
.invoice-list__labels .invoice-list__payment-button:hover { background: var(--mint); border-color: var(--green); text-decoration: none; }
.invoice-list__label { padding: 4px 10px; border-radius: 20px; background: var(--mint); color: var(--green-dark); font-size: .8rem; font-weight: 650; }
.invoice-list__label--cancelled { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.invoice-list__label--pending { background: #ffddb0; color: #713b00; }
.invoice-list__label--link { text-decoration: none; }
.invoice-list__label--link:hover { text-decoration: underline; }
.invoice-list__details:empty { display: none; }
.invoice-list__number { color: var(--ink); text-decoration: none; }
.invoice-list__number:hover { text-decoration: underline; }
.invoice-list__amount--cancelled { text-decoration: line-through; }
.invoice-list__item:focus-within { outline: 2px solid var(--accent-border); outline-offset: 2px; }
.invoice-list__relation a { position: relative; z-index: 1; }
.invoice-list__number, .invoice-list__relation a, .invoice-draft-card small a { display: inline-block; white-space: nowrap; }
.invoice-list__relation { font-weight: 400; color: var(--muted); font-size: .9rem; }
.invoice-sheet-preview { position: relative; overflow-x: auto; padding: 1px; }
.invoice-pages--rendering { position: absolute; top: 0; left: 0; opacity: 0; pointer-events: none; }
.invoice-pages .pagedjs_page { position: relative; margin: 36px auto; outline: 1px solid var(--line); background: var(--surface); }
.invoice-page-number { position: absolute; bottom: 8mm; left: 25mm; right: 20mm; color: var(--muted); font-size: 9pt; text-align: right; }
.print-invoice { width: 210mm; min-height: 297mm; margin: 36px auto; padding: 20mm 20mm 20mm 25mm; outline: 1px solid var(--line); background: var(--surface); color: #000; font-size: 10pt; }
.print-invoice__header { position: relative; display: grid; grid-template-columns: 80mm 70mm; justify-content: space-between; min-height: 70mm; break-inside: avoid; }
.print-invoice__seller { grid-column: 2; grid-row: 1; text-align: right; line-height: 1.5; overflow-wrap: anywhere; }
/* Form B: page content starts at 20 mm; first address line starts at 62.7 mm. */
.print-invoice__recipient { grid-column: 1; grid-row: 1; margin: 0; padding-top: 42.7mm; font-size: 10pt; line-height: 4.5mm; overflow-wrap: anywhere; }
.print-invoice__return-address { position: absolute; top: 25mm; left: 0; width: 80mm; margin: 0; font-size: 7pt; line-height: 3mm; overflow-wrap: anywhere; }
.print-invoice__title { margin-top: 4mm; break-inside: avoid; }
.print-invoice__title .eyebrow { margin: 0 0 2mm; }
.print-invoice__title h1 { margin: 0; font-size: 16pt; overflow-wrap: anywhere; }
.print-invoice__subject { margin: 2mm 0 0; font-size: 12pt; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.print-invoice__correction { margin: 2mm 0 0; font-size: 10pt; line-height: 1.4; }
.invoice-meta { display: flex; flex-wrap: wrap; gap: 30px; margin: 28px 0; }
.invoice-meta div { display: grid; gap: 2px; }
.invoice-meta dt { color: var(--muted); font-size: .84rem; }
.invoice-meta dd { margin: 0; font-weight: 650; }
.invoice-table th, .invoice-table td { min-width: 0; }
.invoice-table { display: table; overflow: visible; table-layout: fixed; width: 100%; font-size: 10pt; white-space: normal; }
.invoice-table th, .invoice-table td { padding: 10px 8px; }
.invoice-table thead th:first-child, .invoice-position-row td:first-child { width: 48%; }
.invoice-table thead th:nth-child(2), .invoice-position-row td:nth-child(2) { width: 18%; }
.invoice-table thead th:nth-child(3), .invoice-table thead th:last-child, .invoice-position-row td:nth-child(3), .invoice-position-row td:last-child { width: 17%; }
.invoice-table--taxed thead th:first-child, .invoice-table--taxed .invoice-position-row td:first-child { width: 39%; }
.invoice-table--taxed thead th:nth-child(4), .invoice-table--taxed .invoice-position-row td:nth-child(4) { width: 9%; }
.invoice-table th:not(:first-child), .invoice-table td:not(:first-child) { white-space: nowrap; text-align: right; }
.invoice-position-row td:first-child { overflow-wrap: anywhere; font-weight: 650; }
.invoice-position-row--has-description td { padding-bottom: 2px; border-bottom: 0; }
.invoice-description-row { break-inside: auto; }
.invoice-description-row td { padding-top: 0; }
.invoice-description-row .invoice-line-details { margin-top: 0; }
.invoice-description-row .invoice-line-details > :first-child { margin-top: 0; }

.invoice-tax-note { margin-top: 30px; font-weight: 650; }
.invoice-tax-note__reference { white-space: nowrap; }
.invoice-payment { margin-top: 24px; page-break-inside: avoid; }
.invoice-payment h2 { font-size: 1.05rem; margin: 0 0 6px; }
.invoice-payment p { margin: 0 0 10px; }
.invoice-action-hints h2 { font-size: 1rem; font-weight: 700; }
.invoice-action-hints ul { margin-bottom: 0; }
.invoice-correction-hint__action { margin: 12px 0 0; }
.invoice-email-requirement { align-self: center; color: var(--muted); font-size: .9rem; }
.e-invoice-viewer input[type="file"] { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--surface); color: var(--ink); }
.e-invoice-viewer input[type="file"]::file-selector-button { margin-right: 12px; padding: 10px 14px; border: 1px solid var(--accent-border); border-radius: 8px; background: var(--mint); color: var(--green-dark); font: inherit; cursor: pointer; }
.e-invoice-viewer__document { padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow-wrap: anywhere; }
.e-invoice-viewer__document > h2 { margin-top: 0; }
.e-invoice-viewer__filename { color: var(--muted); }
.e-invoice-viewer__parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.e-invoice-viewer__address, .e-invoice-viewer__document td p, .e-invoice-viewer__details dd { white-space: pre-wrap; }
.e-invoice-viewer__details { margin: 20px 0; }
.e-invoice-viewer__details > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; padding: 6px 0; }
.e-invoice-viewer__details dt { color: var(--muted); }
.e-invoice-viewer__details dd { margin: 0; }
.e-invoice-viewer__totals { margin-left: auto; max-width: 520px; padding: 16px; border-radius: 12px; background: var(--mint); }
.e-invoice-viewer__totals > div { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.e-invoice-viewer__totals dd { text-align: right; font-weight: 650; }
.e-invoice-viewer__totals > div:last-child { border-top: 1px solid var(--accent-border); margin-top: 8px; padding-top: 14px; font-weight: 700; }
.e-invoice-viewer__totals > div:last-child dt { color: var(--ink); }
.e-invoice-viewer__table { overflow-x: auto; }
.e-invoice-viewer__table table { min-width: 620px; }
.e-invoice-viewer__table th:not(:first-child), .e-invoice-viewer__table td:not(:first-child) { text-align: right; }
.e-invoice-viewer__table td p { margin: 8px 0 0; }
.e-invoice-viewer__error { color: var(--error-text); }
.e-invoice-viewer__raw { margin-top: 32px; }
.flash-message { width: min(1000px, calc(100% - 48px)); margin: 16px auto; padding: 12px 16px; border-radius: 8px; background: var(--mint); color: var(--green-dark); }

@media screen and (max-width: 760px) {
  .e-invoice-viewer__document { padding: 20px; }
  .e-invoice-viewer__parties { grid-template-columns: 1fr; gap: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .invoice-line__body { grid-template-columns: 1fr; }
  .invoice-list__item { grid-template-columns: 1fr 1fr; }
  .invoice-draft-card { align-items: stretch; flex-direction: column; }
  .invoice-draft-status { flex-basis: 100%; width: 100%; margin-left: 0; text-align: left; }
  .print-invoice { margin: 20px 0; }
}

@media screen and (min-width: 761px) {
  [aria-labelledby="invoice-step-buyer"] .customer-name-field,
  [aria-labelledby="invoice-step-buyer"] .buyer-contact-name-field { grid-column: auto; }
}

@page { size: A4; margin: 20mm 20mm 20mm 25mm; }

@media print {
  .e-invoice-viewer__document { padding: 0; border: 0; }
  .e-invoice-viewer__table { overflow: visible; }
  .e-invoice-viewer__table table { min-width: 0; }
  .e-invoice-viewer__table tr { break-inside: avoid; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .site-header, .site-footer, .flash-message, .guest-notice, .no-print { display: none !important; }
  main { width: 100%; margin: 0; padding: 0; }
  .invoice-sheet-preview { overflow: visible; padding: 0; }
  .print-invoice { width: auto; min-height: 0; margin: 0; padding: 0; outline: 0; }
  .invoice-pages .pagedjs_page { margin: 0; outline: 0; }
  .invoice-pages--rendering { display: none; }
  .print-invoice__header { page-break-inside: avoid; }
  .invoice-table { page-break-inside: auto; }
  .invoice-position-row, .invoice-table tfoot tr { page-break-inside: avoid; }
}

.start-guide { margin: 0 0 56px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--mint); }
.start-guide h2 { margin-top: 0; }
.start-guide p { max-width: 640px; }
.start-guide__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.start-guide__form { display: inline; margin: 0; }
.start-guide__all { margin-top: 20px; }
.start-guide__all summary { cursor: pointer; color: var(--green); font-weight: 650; }
.start-guide__all ol { margin: 12px 0 0; padding: 0; list-style: none; }
.start-guide__all li { display: flex; gap: 8px; align-items: center; }
.start-guide__all li.is-done { color: var(--muted); }
.start-guide__undo { padding: 0; border: 0; background: none; color: var(--green); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.invoice-status { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--warning-border); border-radius: 12px; background: var(--warning-bg); }
.invoice-cancellation-note { margin: 24px 0 0; font-weight: 650; }
.revenue-notice { margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--mint); }
.revenue-notice--warning { border-color: var(--warning-border); background: var(--warning-bg); }
.revenue-notice--alert { border-color: var(--alert-border); background: var(--alert-bg); }
.revenue-notice h2 { margin: 0 0 8px; font-size: 1.15rem; }
.revenue-notice p { margin: 0 0 8px; }
.first-invoice-tip { margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--mint); }
.first-invoice-tip h2 { margin: 0 0 8px; font-size: 1.15rem; }
.first-invoice-tip p { margin: 0 0 8px; }
.first-invoice-tip__donate { font-size: .92rem; color: var(--muted); }
.guest-notice { width: min(1000px, calc(100% - 48px)); margin: 16px auto 0; padding: 12px 16px; border: 1px solid var(--warning-border); border-radius: 12px; background: var(--warning-bg); font-size: .92rem; }
.guest-notice p { margin: 0; }
.account-form { max-width: 440px; }
.account-form .field { margin-bottom: 16px; }
.site-nav form { display: inline; }
.site-nav__button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.site-nav__button:hover { color: var(--green); }
.form-note { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }
.customer-picker { margin-bottom: 16px; }
.service-kind { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 12px; padding: 0; border: 0; }
.service-kind legend { margin-bottom: 8px; padding: 0; font-size: .9rem; font-weight: 650; }
.service-kind label { display: inline-flex; align-items: center; gap: 8px; }
.service-kind input { width: auto; min-height: 0; }
[hidden] { display: none !important; }
.quantity-input { display: flex; gap: 6px; }
.quantity-input input { min-width: 0; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.quantity-input input::-webkit-outer-spin-button, .quantity-input input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.quantity-input__step { flex: none; width: 44px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.2rem; cursor: pointer; }
.quantity-input__step:hover { background: var(--mint); }
.quantity-label { display: flex; align-items: center; gap: 8px; }
.hours-calculator-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--accent-border); border-radius: 6px; background: var(--surface); color: var(--green); cursor: pointer; }
.hours-calculator-toggle:hover, .hours-calculator-toggle[aria-expanded="true"] { background: var(--mint); }
.hours-calculator-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hours-calculator { margin-top: 8px; padding: 10px; border-radius: 8px; background: var(--mint); font-size: .85rem; }
.field-calculator__body { display: grid; gap: 12px; }
.calculator-input { position: relative; flex: 1; min-width: 0; }
.calculator-input > input { width: 100%; }
.calculator-input:has(> .field-calculator) > input,
.calculator-input:has(> [data-line-quantity-target="priceCalculator"]:not([hidden])) > input { padding-left: 48px; }
.calculator-input > .field-calculator,
.calculator-input > [data-line-quantity-target="priceCalculator"] > .field-calculator { position: absolute; top: 0; bottom: 0; left: 8px; display: flex; align-items: center; }
.calculator-input .hours-calculator-toggle { border: 0; background: transparent; }
.calculator-input .hours-calculator-toggle:hover { background: var(--mint); }
.field-calculator__dialog::backdrop { background: rgba(0, 0, 0, .4); }
.field-calculator__dialog .hours-calculator { margin: 0; padding: 0; background: transparent; }
.field-calculator__body p { margin: 0; }
.field-calculator__body .button { justify-self: start; max-width: 100%; white-space: normal; }
.field-calculator__warning { display: grid; gap: 12px; }
.field-calculator__warning[hidden] { display: none; }
.field-calculator__rate { display: grid; gap: 8px; }
.field-calculator__rate[hidden] { display: none; }
.field-calculator__expression { padding: 8px 10px; border-radius: 6px; background: var(--surface); overflow-wrap: anywhere; font-weight: 650; }
.hours-calculator label { display: flex; flex-direction: column; gap: 4px; font-weight: 650; }
.hours-calculator input { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.hours-calculator textarea { width: 100%; min-height: 120px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }

.invoice-total { display: flex; flex-direction: column; align-items: flex-end; margin: 1rem 0 0; font-size: 1.25rem; }
.invoice-total small { color: var(--muted); font-size: .85rem; }



.invoice-preview-banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--preview-border); border-radius: 8px; background: var(--preview-bg); }


.checkbox-label { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 650; line-height: 1.5; cursor: pointer; }
.checkbox-label > span { min-width: 0; overflow-wrap: anywhere; }
.checkbox-field > small { padding-left: 32px; }
.invoice-payment-status__heading { font-size: .9rem; font-weight: 650; }
.invoice-payment-status { margin-top: 20px; }
.invoice-payment-status .checkbox-label { margin: 0; line-height: 1.4; }
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 22px;
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--checkbox-border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
input[type="checkbox"]:not(:disabled):hover { border-color: var(--green); }
input[type="checkbox"]:checked {
  border-color: var(--green);
  background-color: var(--mint);
  background-image: var(--checkbox-check);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
input[type="checkbox"]:disabled { opacity: .55; cursor: not-allowed; }
@media (forced-colors: active) {
  input[type="checkbox"] { appearance: auto; -webkit-appearance: auto; background-image: none; }
}

.iban-status { font-weight: 600; }
.iban-status:empty { display: none; }
.iban-status[data-state="ok"] { color: var(--success-text); }
.iban-status[data-state="error"] { color: var(--error-text); }


.invoice-subsection { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line, #e3e8e4); }
.invoice-subsection > h4 { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--green); font-weight: 650; font-size: 1.05rem; }
.invoice-subsection__hint { display: block; margin: 6px 0 12px; font-size: .9rem; font-weight: 400; }
.form-grid > .form-section-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--green); font-size: 1.05rem; font-weight: 650; }
.form-section-heading svg { flex: 0 0 22px; }
[aria-labelledby="invoice-step-seller"] .form-section-heading,
[aria-labelledby="invoice-step-buyer"] .form-section-heading { margin-top: 0; padding-top: 0; border-top: 0; }
[aria-labelledby="invoice-step-buyer"] .invoice-subsection { margin-top: 18px; padding-top: 0; border-top: 0; }

.address-autocomplete { position: relative; }
.address-suggestions { position: absolute; z-index: 20; left: 0; right: 0; top: 72px; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.address-suggestions li { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.address-suggestions li:hover, .address-suggestions li.is-active { background: var(--mint); }
.customer-name-field { position: relative; align-self: start; }
#invoice_buyer_hourly_rate::placeholder { color: var(--muted); opacity: .7; }
.customer-name-suggestions { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); max-height: 280px; overflow-y: auto; }
.customer-name-suggestions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.customer-name-suggestions li:hover, .customer-name-suggestions li[aria-selected="true"] { background: var(--mint); }
.address-status { color: var(--muted); }
.imprint-lookup { margin: 20px 0; }
.imprint-lookup__hint { display: block; margin-top: 8px; color: var(--muted); font-size: .85rem; }
.imprint-lookup__controls { display: flex; gap: 10px; }
.imprint-lookup__controls > input { flex: 1; min-width: 0; }
.form-popover { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 20px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.form-popover__heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.form-popover__heading > h3 { margin: 0; }
.form-popover__close { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.form-popover__close:hover { background: var(--mint); }
.form-popover__close:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media screen and (max-width: 760px) { .imprint-lookup__controls { flex-direction: column; } }
.imprint-lookup__button { gap: 10px; }
.imprint-lookup__button:disabled { cursor: progress; transform: none; }
.imprint-lookup__spinner { flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: imprint-lookup-spin .8s linear infinite; }
@keyframes imprint-lookup-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .imprint-lookup__spinner { animation: none; } }
.imprint-lookup [data-error="true"] { color: var(--error-text); }
.donate-promise { padding: 12px 16px; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--mint); }

/* Follow the system setting. Invoice paper keeps the light palette above. */
@media screen and (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e6eee8;
    --muted: #b0beb5;
    --green: #9cd5b7;
    --green-dark: #c2ead4;
    --mint: #233e31;
    --cream: #202b24;
    --line: #3d5145;
    --background: #121a16;
    --surface: #1b2720;
    --panel: #17221c;
    --footer: #17221c;
    --header: rgba(18, 26, 22, .96);
    --on-accent: #11271e;
    --input-border: #6e8378;
    --checkbox-border: #789083;
    --accent-border: #526f5b;
    --hover-surface: #26382c;
    --warning-bg: #382e1c;
    --warning-border: #806537;
    --hint-bg: #302a1d;
    --preview-bg: #382e1c;
    --preview-border: #9a7b3c;
    --error-bg: #3c2324;
    --error-border: #8f5653;
    --alert-bg: #3c2324;
    --alert-border: #8f5653;
    --danger-text: #ffb4a9;
    --danger-soft: #432a2a;
    --error-text: #ffb4a9;
    --success-text: #9bddad;
    --focus-ring: rgba(156, 213, 183, .4);
    --marker: #9cd5b7;
    --guide-number: #a3c4ae;
    --decoration-line: #35493c;
    --decoration-green: #2a4434;
    --decoration-gold: #4b3d26;
    --shadow: 0 16px 45px rgba(0, 0, 0, .28);
    --select-arrow: 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='%23b0beb5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --checkbox-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239cd5b7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 10 3 3 7-7'/%3E%3C/svg%3E");
  }
}

.address-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }
.field input.invoice-number-trigger { cursor: pointer; }
.money-input { display: flex; align-items: center; gap: 10px; }
.money-input > span { color: var(--muted); }
@media (max-width: 760px) {
  .address-row { grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); }
  .address-row > .field:last-child { grid-column: 1 / -1; }
}

.field-label-note { color: var(--muted); font-weight: 400; }

/* Invoice number formatter */
.invoice-number-editor { position: relative; margin-top: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.invoice-number-editor[hidden] { display: none; }
.invoice-number-editor h3 { margin: 0; font-size: 1.3rem; }
.invoice-number-editor .form-popover__heading { padding-right: 40px; }
.invoice-number-editor .form-popover__heading p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.invoice-number-editor .form-popover__heading .invoice-number-editor__notice { margin-top: 8px; color: var(--muted); font-size: .85rem; }
.invoice-number-editor .form-popover__heading > div { min-width: 0; }
.invoice-number-editor .form-popover__close { position: absolute; top: 20px; right: 20px; }
.invoice-number-templates-title { margin: 12px 0 8px; font-size: 1rem; }
.invoice-number-templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.invoice-number-template { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
@media (hover: hover) { .invoice-number-template:hover { background: var(--mint); } }
.invoice-number-template[aria-pressed="true"] { border-color: var(--green); background: var(--mint); box-shadow: inset 0 0 0 1px var(--green); }
.invoice-number-template:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.invoice-number-template__heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.invoice-number-template__badge { color: var(--green); font-size: .75rem; }
.invoice-number-template code { overflow-wrap: anywhere; font-size: .8rem; line-height: 1.5; color: var(--muted); }
.invoice-number-template__example { font-size: .85rem; overflow-wrap: anywhere; }
.invoice-number-template__example > span { font-weight: 650; }
.invoice-number-custom { margin-top: 22px; }
.invoice-number-feedback { min-height: 3em; margin: 0; }
.invoice-number-feedback small { display: block; font-size: .8rem; }
.invoice-number-feedback .field-error { color: var(--error-text); }
.invoice-number-token-help { margin-top: 8px; font-size: .85rem; }
.invoice-number-token-help p { margin: 8px 0; }
.invoice-number-token-help h4 { margin: 0; font-size: 1rem; font-weight: 600; }
.invoice-number-token-help dl { display: grid; gap: 10px; margin: 8px 0; }
.invoice-number-token-help dt { font-weight: 600; overflow-wrap: anywhere; }
.invoice-number-token-help dd { margin: 4px 0 0; color: var(--muted); }
.invoice-number-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.invoice-number-once { align-items: center; margin: 0 0 10px; font-size: .85rem; line-height: 1.4; }
.invoice-number-token { padding: 8px 10px; max-width: 100%; border: 1px solid var(--accent-border); border-radius: 8px; background: var(--surface); color: var(--green); font: inherit; cursor: pointer; }
.invoice-number-token code { overflow-wrap: anywhere; }
.invoice-number-token:hover { background: var(--mint); }
.invoice-number-token:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.invoice-number-format-input { border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); min-width: 0; }
.invoice-number-format-input input { border: 0; background: transparent; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.field .invoice-number-format-input input:focus { border: 0; outline: 0; box-shadow: none; }
.invoice-number-format-input:focus-within { border-color: var(--green); outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.invoice-number-adjustment { margin-top: 16px; }
.invoice-number-adjustment h4 { margin: 0 0 8px; font-size: 1rem; }
.invoice-number-adjustment > .field { margin-top: 10px; }
.invoice-number-adjustment p { margin: 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 600px) {
  .invoice-number-editor { padding: 18px; }
  .invoice-number-templates { grid-template-columns: minmax(0, 1fr); }
  .invoice-number-editor .form-popover__close { top: 18px; right: 18px; }
}

.imprint-lookup__results { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.imprint-lookup__results h4 { margin: 0 0 14px; font-size: 1rem; }
.imprint-lookup__data { display: grid; gap: 12px; margin: 0; }
.imprint-lookup__data > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px; }
.imprint-lookup__data dt { color: var(--muted); font-size: .85rem; }
.imprint-lookup__data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.imprint-lookup__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) {
  .imprint-lookup__data > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

.customer-update-choice { min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--mint); line-height: 1.5; }
.customer-update-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.customer-update-dialog .customer-update-choice { margin: 0 0 20px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.customer-update-dialog__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.customer-update-choice legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 650; }
.customer-update-choice > p { clear: both; margin: 0 0 8px; }
.customer-update-choice > ul { margin: 0 0 16px; padding-left: 24px; }
.customer-update-choice label { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; margin: 0; cursor: pointer; }
.customer-update-choice label + label { margin-top: 14px; }
.customer-update-choice input[type="radio"] { width: 16px; height: 16px; margin: 4px 0 0; accent-color: var(--green); }
.customer-update-choice span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.customer-update-choice small { color: var(--muted); font-size: .85rem; line-height: 1.5; }

.currency-conversion { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0; min-width: 0; }
.currency-conversion legend { padding: 0 6px; font-weight: 650; }

.exchange-rate-input { display: flex; align-items: center; gap: 10px; }
.exchange-rate-input > span { flex: 0 0 auto; white-space: nowrap; }
.exchange-rate-input > input { min-width: 0; }

.bookkeeping-totals > div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; }
.bookkeeping-totals dd { margin: 0; white-space: nowrap; }
.bookkeeping-table { overflow-x: auto; }
.bookkeeping-table table { width: 100%; border-collapse: collapse; }
.bookkeeping-table th, .bookkeeping-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }

.euer-depreciation-row { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.bookkeeping-table td:last-child form { margin-top: 8px; }
.bookkeeping-table td { overflow-wrap: anywhere; }
.euer-form-table table { min-width: 800px; }
.euer-form-table th:first-child, .euer-form-table td:first-child { width: 16%; }
.euer-form-table td:nth-child(3) { white-space: nowrap; }
@media (max-width: 760px) {
  .euer-form-table table, .euer-form-table tbody { display: block; min-width: 0; }
  .euer-form-table thead { display: none; }
  .euer-form-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .euer-form-table td { padding: 0; border: 0; }
  .euer-form-table td:first-child { grid-column: 1 / -1; width: auto; color: var(--muted); font-size: .85rem; }
  .euer-form-table td:nth-child(2) { grid-column: 1 / -1; }
  .euer-form-table td:nth-child(3) { white-space: normal; font-weight: 650; }
}

.bookkeeping-entries-table table { display: table; min-width: 760px; table-layout: auto; }
.bookkeeping-entries-table th:first-child, .bookkeeping-entries-table td:first-child { width: 1%; white-space: nowrap; }
.bookkeeping-entries-table th:nth-child(2), .bookkeeping-entries-table td:nth-child(2) { min-width: 180px; overflow-wrap: normal; }
.bookkeeping-entries-table th:nth-child(4), .bookkeeping-entries-table td:nth-child(4) { width: 1%; white-space: nowrap; text-align: right; }
.bookkeeping-entries-table th:last-child, .bookkeeping-entries-table td:last-child { width: 1%; white-space: nowrap; overflow-wrap: normal; }
.bookkeeping-entry-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.bookkeeping-entry-actions .button { width: auto; white-space: nowrap; }
.bookkeeping-table .bookkeeping-entry-actions form { margin: 0; }
.bookkeeping-totals dt { min-width: 0; }

.bookkeeping-amount-input { display: flex; align-items: center; gap: 10px; }
.bookkeeping-amount-input input { flex: 1; min-width: 0; }
.bookkeeping-amount-input span { color: var(--ink); }
.bookkeeping-import-group { margin: 12px 0; }
.bookkeeping-import-position { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 16px; padding: 10px 0; }
.bookkeeping-import-position label { margin: 0; display: grid; gap: 4px; }
.bookkeeping-import-position [data-bookkeeping-import-target="position"] { color: var(--muted); font-size: .85rem; font-weight: 400; }
@media screen and (max-width: 600px) {
  .bookkeeping-import-position { grid-template-columns: 1fr; gap: 6px; }
}

.inline-link { padding: 0; border: 0; background: none; color: var(--green); font: inherit; text-decoration: underline; cursor: pointer; }
.inline-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.workflow-options { margin-block: 1.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: .75rem; }
.workflow-options > .checkbox-label { margin-block: .35rem; }
.workflow-options .checkbox-field + .checkbox-field { margin-top: 1.25rem; }

.bookkeeping-navigation { display: flex; flex-wrap: wrap; gap: .75rem; margin-block: 1rem 1.5rem; }
.bookkeeping-navigation a { padding: .65rem 1rem; border: 1px solid currentColor; border-radius: .5rem; text-decoration: none; }
.bookkeeping-navigation a[aria-current="page"] { font-weight: 700; background: var(--surface, #eef5f0); color: #225a45; }

@media (max-width: 600px) {
  .bookkeeping-movements-table table, .bookkeeping-movements-table tbody, .bookkeeping-movements-table tr, .bookkeeping-movements-table td { display: block; width: 100%; }
  .bookkeeping-movements-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bookkeeping-movements-table tr { padding-block: .5rem; border-bottom: 1px solid var(--line); }
  .bookkeeping-movements-table td { padding: .4rem 0; border: 0; white-space: normal; }
  .bookkeeping-movements-table td::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--muted); }
}

.booking-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1.5rem 2rem; }
@media (max-width: 600px) { .booking-actions { grid-template-columns: minmax(0, 1fr); } }



.booking-type-group { border: 0; padding: 0; margin: 1.5rem 0; min-width: 0; }
.booking-type-group > legend { font-size: 1.15rem; font-weight: 700; padding: 0; }
.booking-type-option { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.booking-type-option input[type="radio"] { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green); }
.booking-type-option strong, .booking-type-option small { display: block; }
.booking-type-option small { margin-top: .5rem; color: var(--muted); line-height: 1.5; }
.booking-type-option:has(input:checked) { border-color: var(--green); background: var(--mint); }
.booking-type-option:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 3px; }
.booking-entry-fields { border: 0; padding: 0; margin: 1.5rem 0 0; min-width: 0; }

.booking-kind-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-block: 1rem; }
.booking-kind-summary > p { margin: 0; }

.booking-category-heading, .booking-type-option .booking-category-heading { display: inline-flex; align-items: flex-start; gap: .5rem; }
.booking-category-icon { width: 22px; height: 22px; flex: 0 0 22px; color: var(--green); }
.booking-kind-summary .booking-category-heading { flex-wrap: wrap; align-items: center; }

.booking-kind-description { flex-basis: 100%; color: var(--muted); line-height: 1.5; }

.booking-guidance { margin: 0 0 1.5rem; }
.booking-guidance summary { cursor: pointer; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.booking-guidance summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.booking-guidance > p { margin: .65rem 0; font-size: .9rem; line-height: 1.6; }
.booking-guidance > ul { margin: 0; padding-left: 1.25rem; font-size: .9rem; line-height: 1.6; }
.booking-guidance li + li { margin-top: .25rem; }
.booking-guidance strong { color: var(--ink); }


.expense-search { padding: 1rem; margin-block: .75rem 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.expense-search label { display: block; margin-bottom: .5rem; }
.expense-search-results { display: grid; gap: .5rem; }
.expense-search-result { display: grid; gap: .25rem; width: 100%; padding: .75rem; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; }
.expense-search-result:hover { border-color: var(--green); }
.expense-search-result span { font-size: .9rem; color: var(--muted); }
.expense-search-question { display: flex; flex-wrap: wrap; gap: .5rem; }
.expense-search-all { margin-bottom: 0; font-size: .9rem; color: var(--muted); }

.expense-search > summary { cursor: pointer; font-weight: 600; }

.expense-area-field { margin-bottom: 1rem; }
[data-euer-entry-target="expenseExample"] { display: block; margin-top: .5rem; }

.booking-type-option input[type="radio"]:focus, .field .booking-type-option input[type="radio"]:focus { outline: none; }

.booking-type-link { color: var(--ink); text-decoration: none; }
.booking-type-link:hover { border-color: var(--green); background: var(--mint); text-decoration: none; }
.booking-type-link:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.booking-group-description { color: var(--muted); margin-top: .5rem; max-width: 80ch; }
.booking-type-option small strong { display: inline; font-size: inherit; }
.booking-kind-description p { margin-block: .5rem; max-width: 85ch; }

.asset-private-use-row { padding-block: 1rem; margin-block: 1rem; border-top: 1px solid var(--line); }

.bookkeeping-import-totals { padding-top: 12px; margin-top: 16px; border-top: 1px solid var(--line); }

.payment-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.payment-dialog .invoice-actions { margin-bottom: 16px; }
.payment-dialog .button { max-width: 100%; white-space: normal; padding-block: 10px; }
.payment-dialog .booking-kind-summary { display: block; }
.payment-dialog .booking-kind-summary p + p { margin-top: 8px; }
