@font-face {
    font-family: 'Raleway';
    src: url('/font/raleway-400-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('/font/raleway-700-latin.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    --bg: #f3f1e8;
    --surface: #fffdfa;
    --surface-alt: #ebe7db;
    --ink: #1f2933;
    --muted: #5d6a72;
    --line: #d9d1bf;
    --accent: #0d7c66;
    --accent-dark: #0b5d4d;
    --accent-soft: #dceee8;
    --shadow: 0 18px 40px rgba(31, 41, 51, 0.08);
    --radius: 6px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
}

body.tools-body {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(13, 124, 102, 0.08), transparent 28%),
        linear-gradient(180deg, #f7f4ec 0%, #f3f1e8 40%, #efebe0 100%);
}

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

p {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.65;
}

h1,
h2,
h3 {
    margin: 0 0 1rem;
    line-height: 1.05;
    color: var(--ink);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.6rem);
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

h3 {
    font-size: 1.15rem;
}

strong {
    color: var(--ink);
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.eyebrow {
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent-dark);
}

.lead {
    font-size: 1.1rem;
    /*max-width: 58ch;*/
}

.section-block,
.faq-section,
/*.tool-intro,*/
.tool-shell,
.related-links,
.cta-banner {
    padding: 2rem 0 5rem;
}

.alt-surface {
    background: rgba(255, 253, 250, 0.45);
    border-top: 1px solid rgba(217, 209, 191, 0.55);
    border-bottom: 1px solid rgba(217, 209, 191, 0.55);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(247, 244, 236, 0.9);
    border-bottom: 1px solid rgba(217, 209, 191, 0.85);
}

.shell-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    color: var(--ink);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.8rem;
    background: var(--accent);
    color: #fff;
    box-shadow: inset 0 -6px 18px rgba(0, 0, 0, 0.15);
}

.main-nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.main-nav a {
    color: var(--muted);
    font-weight: 700;
}

.main-nav a.is-active,
.main-nav a:hover {
    color: var(--ink);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.9rem 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 24px rgba(13, 124, 102, 0.22);
}

.button-primary:hover {
    background: var(--accent-dark);
    color: #fff;
}

.button-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.button-tertiary {
    background: var(--surface-alt);
    color: var(--ink);
    border-color: transparent;
}

.button-full {
    width: 100%;
}

.seo-content-panel > :last-child {
    margin-bottom: 0;
}

.seo-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.seo-content-list {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.65;
}

.seo-content-list li {
    margin-bottom: 0.45rem;
}

.seo-content-list-ordered {
    padding-left: 1.35rem;
}

/* Guide UI Enhancements */
.guide-container {
    display: grid;
    gap: 3rem;
}

.guide-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.guide-intro h2 {
    margin-bottom: 1.5rem;
}

.guide-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.guide-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.guide-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(31, 41, 51, 0.08);
    border-color: var(--accent);
}

.guide-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-radius: 10px;
}

.guide-card-icon svg {
    width: 24px;
    height: 24px;
}

.guide-card h3 {
    margin: 0;
    font-size: 1.35rem;
}

.guide-card p {
    margin: 0;
    font-size: 0.95rem;
}

.guide-process {
    background: var(--surface-alt);
    border-radius: 16px;
    padding: 2.5rem;
}

.guide-process h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

.guide-step {
    position: relative;
    padding-top: 2.5rem;
    text-align: center;
}

.guide-step::before {
    content: attr(data-step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(13, 124, 102, 0.2);
}

.guide-step-label {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.95rem;
}

.guide-check-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.8rem;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.guide-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--muted);
    background: var(--surface);
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.guide-check-item::before {
    content: "";
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b5d4d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

.guide-footer-cta {
    background: var(--accent-dark);
    color: #fff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.guide-footer-cta h3 {
    color: #fff;
    margin: 0;
}

.guide-footer-cta p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.guide-footer-cta strong {
    color: #fff;
}

.hero {
    padding: 4.5rem 0 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 1.5rem;
    align-items: stretch;
}

.hero-panel,
.content-card,
.panel,
.faq-card,
.content-card-wide {
    background: rgba(255, 253, 250, 0.92);
    border: 1px solid rgba(217, 209, 191, 0.85);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 1.5rem;
}

.hero-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.hero-list li {
    display: grid;
    gap: 0.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.hero-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.hero-actions,
.button-row,
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: rgba(255, 253, 250, 0.72);
    border: 1px solid rgba(217, 209, 191, 0.85);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.stat-card strong {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.section-heading {
    margin-bottom: 1.4rem;
}

.card-grid {
    display: grid;
    gap: 1rem;
}

.card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card,
.content-card-wide {
    padding: 1.5rem;
}

.content-card a,
.content-card-wide a {
    font-weight: 700;
}

.tool-intro {
    padding-top: 3rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
    gap: 1.2rem;
    align-items: start;
}

.panel {
    padding: 1.5rem;
}

.panel-head {
    margin-bottom: 1.2rem;
}

.stack-lg {
    display: grid;
    gap: 1rem;
}

.stack-sm {
    display: grid;
    gap: 0.65rem;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.field-span-2 {
    grid-column: span 2;
}

label {
    display: grid;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 7rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(13, 124, 102, 0.18);
    border-color: var(--accent);
}

.inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.line-item-grid {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.9fr 0.8fr auto;
    gap: 0.65rem;
    align-items: center;
}

.preview-panel {
    position: sticky;
    top: 5.7rem;
}

.invoice-shell {
    padding-top: 1.35rem;
}

[hidden] {
    display: none !important;
}

.invoice-editor-column {
    display: grid;
    gap: 0.8rem;
    min-width: 0;
    width: 100%;
}

.invoice-form-panel {
    width: 100%;
    max-width: 100%;
    padding: 1.05rem;
}

.invoice-form-panel .panel-head {
    margin-bottom: 0.8rem;
}

.invoice-form-panel .panel-head h2 {
    margin: 0 0 0.15rem;
}

.invoice-form-panel .panel-head p {
    margin: 0;
    color: var(--muted);
}

.invoice-section {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(217, 209, 191, 0.65);
    border-radius: 6px;
    background: rgba(255, 252, 246, 0.6);
    backdrop-filter: blur(8px);
}

.stack-sm[data-repeater="invoice-items"] {
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: 0.1rem;
}

.invoice-section-head {
    display: grid;
    gap: 0.12rem;
}

.invoice-section-head h3 {
    margin: 0;
    font-size: 1.02rem;
}

.invoice-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 48ch;
}

.invoice-primary-grid,
.invoice-party-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.invoice-parties-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.invoice-party-panel {
    display: grid;
    align-content: start;
    align-self: start;
    gap: 0.6rem;
    padding: 0.65rem;
    border: 1px solid rgba(217, 209, 191, 0.55);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.55);
}

.invoice-party-panel-head h4 {
    margin: 0;
    font-size: 0.96rem;
}

.invoice-party-grid {
    align-content: start;
}

.invoice-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.invoice-subprofile-card {
    max-width: 28rem;
}

.invoice-profile-grid,
.invoice-settings-grid {
    display: grid;
    gap: 0.9rem;
}

.invoice-profile-card {
    align-items: center;
    padding: 0.65rem 0.8rem;
    background: rgba(255, 255, 255, 0.8);
}

.invoice-profile-note {
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    background: rgba(13, 124, 102, 0.08);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.92rem;
}

.invoice-items-header,
.invoice-item-card {
    display: grid;
    grid-template-columns: minmax(12rem, 2.2fr) minmax(4.4rem, 0.6fr) minmax(4.4rem, 0.6fr) minmax(5.7rem, 0.8fr) minmax(5.4rem, 0.75fr) minmax(4.4rem, 0.56fr) minmax(5.8rem, 0.8fr) minmax(5.8rem, 0.8fr) minmax(6rem, 0.85fr) auto;
    gap: 0.45rem;
    align-items: start;
    min-width: 100%;
}

.invoice-items-header {
    padding: 0 0.5rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: -0.25rem;
}

.invoice-item-card {
    padding: 0.5rem;
    border: 1px solid rgba(217, 209, 191, 0.65);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.85);
    transition: box-shadow 150ms ease, border-color 150ms ease;
}

.invoice-item-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(31, 41, 51, 0.05);
}

.invoice-item-head {
    display: none;
}

.invoice-item-head strong {
    display: block;
}

.invoice-item-description {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.invoice-item-cell {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.invoice-item-description textarea {
    min-height: 2.5rem;
    font-size: 0.84rem;
    padding: 0.45rem 0.6rem;
}

.invoice-item-cell span,
.invoice-item-description span,
.invoice-item-calculation-cell span {
    display: none;
}

.invoice-item-cell input,
.invoice-item-description textarea {
    width: 100%;
    min-width: 0;
}

.invoice-item-number input {
    text-align: right;
}

.invoice-item-calculation-cell {
    display: grid;
    gap: 0.15rem;
    min-height: 100%;
    min-width: 0;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    background: rgba(13, 124, 102, 0.05);
    align-content: center;
}

.invoice-item-calculation-cell span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
}

.invoice-item-calculation-cell strong {
    font-weight: 800;
    color: var(--ink);
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.invoice-item-total {
    background: rgba(13, 124, 102, 0.1);
}

.invoice-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 100%;
    align-self: stretch;
}

.invoice-items-actions-label {
    text-align: right;
}

.invoice-item-actions .button {
    padding: 0.55rem 0.8rem;
    font-size: 0.8rem;
}

.freight-leg-card {
    display: grid;
    gap: 0.8rem;
    padding: 0.85rem;
    border: 1px solid rgba(217, 209, 191, 0.65);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.88);
}

.freight-form .invoice-form-panel {
    padding: 0.9rem;
}

.freight-form .stack-lg {
    gap: 0.8rem;
}

.freight-form .invoice-section {
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
}

.freight-form .invoice-section-head h3 {
    font-size: 0.96rem;
}

.freight-form .invoice-section-head p {
    font-size: 0.84rem;
}

.freight-form .invoice-primary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
}

.freight-form .invoice-parties-layout {
    gap: 0.65rem;
}

.freight-form .invoice-party-panel {
    gap: 0.45rem;
    padding: 0.5rem;
}

.freight-form .invoice-party-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem 0.65rem;
}

.freight-form .field-span-2 {
    grid-column: span 2;
}

.freight-form .invoice-form-panel label > span:first-child {
    margin-bottom: 0.12rem;
    font-size: 0.76rem;
    line-height: 1.15;
}

.freight-form .invoice-form-panel input,
.freight-form .invoice-form-panel textarea,
.freight-form .invoice-form-panel select {
    padding: 0.42rem 0.56rem;
    font-size: 0.84rem;
    line-height: 1.2;
}

.freight-form .invoice-form-panel textarea {
    min-height: 2.6rem;
}

.freight-form .freight-leg-card {
    gap: 0.55rem;
    padding: 0.62rem;
    border-radius: 8px;
}

.freight-form .freight-leg-card-head {
    align-items: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(107, 119, 140, 0.22);
}

.freight-form .freight-leg-card-head strong {
    font-size: 0.92rem;
}

.freight-form .invoice-add-item {
    margin-top: 0.2rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
}

.freight-form .field-error {
    font-size: 0.78rem;
}

.travel-order-form .invoice-form-panel {
    padding: 0.95rem;
}

.travel-order-form .stack-lg {
    gap: 0.85rem;
}

.travel-order-form .invoice-section {
    gap: 0.6rem;
    padding: 0.6rem 0.65rem;
    border-radius: 8px;
}

.travel-order-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
}

.travel-order-document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.freight-leg-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.invoice-align-right {
    text-align: right;
}

.invoice-add-item,
.invoice-live-summary {
    width: 100%;
}

.invoice-add-item {
    width: auto;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    margin-top: 0.5rem;
}

.invoice-alert p {
    margin: 0.2rem 0 0;
}

.invoice-total-section {
    background: linear-gradient(180deg, rgba(13, 124, 102, 0.08) 0%, rgba(255, 252, 246, 0.92) 100%);
}

.invoice-live-summary dd {
    font-size: 1.15rem;
}

.invoice-live-summary div:last-child dd {
    font-size: 1.35rem;
    color: var(--accent-dark);
}

.choice-card {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(217, 209, 191, 0.65);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.85);
}

.choice-card input {
    width: auto;
    margin-top: 0.2rem;
}

.choice-card span {
    display: grid;
    gap: 0.15rem;
}

.choice-card small {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.86rem;
}

.invoice-checkbox-card {
    align-items: center;
    min-height: 3.5rem;
}

.invoice-checkbox-card input {
    margin-top: 0;
}

.invoice-checkbox-card span {
    gap: 0.22rem;
}

.invoice-checkbox-card-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-dark);
}

.invoice-form-panel label>span:first-child {
    display: inline-block;
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.invoice-form-panel input,
.invoice-form-panel textarea,
.invoice-form-panel select {
    padding: 0.5rem 0.62rem;
    font-size: 0.9rem;
    line-height: 1.25;
}

.invoice-form-panel input[type="date"] {
    min-height: 2.25rem;
}

.date-input-wrap,
.time-input-wrap {
    position: relative;
}

.date-input-wrap input,
.time-input-wrap input {
    padding-right: 2rem;
}

.date-picker-button,
.time-picker-button {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
}

.date-picker-button svg,
.time-picker-button svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.date-picker-button:hover,
.time-picker-button:hover {
    color: #0f766e;
}

.date-picker-button:focus-visible,
.time-picker-button:focus-visible {
    outline: 2px solid rgba(13, 124, 102, 0.25);
    border-radius: 4px;
}

.flatpickr-calendar {
    border: 1px solid #d6dde8;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #0f766e;
    border-color: #0f766e;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time input {
    font-size: 1rem;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: rgba(15, 118, 110, 0.08);
}

.invoice-form-panel textarea {
    min-height: 4rem;
}

.field-error {
    color: #a44928;
    font-size: 0.88rem;
    font-weight: 700;
}

.invoice-document {
    display: grid;
    gap: 1.1rem;
    background: #ffffff;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    padding: 1.35rem;
    box-shadow: none;
}

.freight-preview-sheet {
    display: grid;
    gap: 1rem;
}

.freight-document {
    display: grid;
    gap: 1rem;
}

.freight-document-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e3e7ee;
}

.freight-document-title {
    margin: 0.1rem 0;
    font-size: 1.45rem;
}

.freight-document-subtitle {
    margin: 0;
    color: var(--muted);
}

.freight-document-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
    gap: 0.6rem 1rem;
    margin: 0;
}

.freight-document-meta dt {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.freight-document-meta dd {
    margin: 0.15rem 0 0;
    font-weight: 700;
}

.freight-document-parties {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.freight-summary-list {
    margin-bottom: 0.8rem;
}

.freight-document-description {
    margin: 0;
    white-space: pre-line;
}

.freight-legs-list {
    display: grid;
    gap: 0.8rem;
}

.freight-leg-preview {
    display: grid;
    gap: 0.8rem;
}

.freight-leg-preview-head {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e3e7ee;
}

.freight-leg-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.invoice-document-top {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(15rem, 0.85fr);
    gap: 1.6rem;
    align-items: start;
    padding: 0 0 1.2rem;
    border-bottom: 1px solid #d8dde6;
}

.invoice-document-head-main {
    display: grid;
    justify-items: end;
    text-align: right;
    gap: 0.35rem;
}

.invoice-document-title {
    margin: 0.1rem 0 0;
    font-size: 2.35rem;
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.invoice-document-clause {
    margin: 0.15rem 0 0;
    color: var(--muted);
    max-width: 24ch;
    font-size: 0.86rem;
}

.invoice-document-issuer {
    display: grid;
    gap: 0.22rem;
    margin-top: 0.9rem;
}

.invoice-document-issuer-top {
    margin-top: 0;
    margin-bottom: 0;
}

.invoice-document-issuer-top strong {
    font-size: 1.02rem;
}

.invoice-document-issuer p {
    margin: 0;
}

.invoice-document-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
    margin: 0;
    width: min(100%, 17rem);
}

.invoice-document-meta div {
    display: grid;
    gap: 0.18rem;
}

.invoice-document-meta dt {
    margin: 0;
    color: #7a869a;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.invoice-document-meta dd {
    margin: 0;
    font-weight: 700;
}

.invoice-document-grand-total {
    font-size: 1.52rem;
    color: #0d7c66;
}

.invoice-document-parties {
    display: grid;
    grid-template-columns: minmax(0, 24rem);
    gap: 1rem;
    padding: 0;
}

.document-box {
    padding: 1.1rem 1.2rem;
    background: #ffffff;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 0.4rem;
}

.document-table th,
.document-table td {
    padding: 0.75rem 0.3rem;
    border-bottom: 1px solid #dde3eb;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.invoice-document-table {
    padding: 0;
}

.invoice-document-table .invoice-col-description {
    width: 24%;
}

.invoice-document-table .invoice-col-qty {
    width: 8%;
}

.invoice-document-table .invoice-col-unit {
    width: 8%;
}

.invoice-document-table .invoice-col-money {
    width: 11%;
}

.invoice-document-table .invoice-col-vat {
    width: 8%;
}

.invoice-document-table thead th {
    background: transparent;
    color: #1f2933;
    font-weight: 700;
    font-size: 0.82rem;
    border-bottom: 2px solid #cfd7e3;
}

.invoice-document-table .invoice-cell-number {
    text-align: right;
    white-space: nowrap;
}

.invoice-breakdown-table {
    margin-top: 0.5rem;
    table-layout: fixed;
    width: 100%;
    max-width: 22rem;
    font-size: 0.7rem;
}

.invoice-breakdown-table thead th {
    background: transparent;
    color: #7a869a;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.invoice-breakdown-table tbody tr:last-child td {
    border-bottom: 0;
}

.invoice-breakdown-col-rate {
    width: 16%;
}

.invoice-breakdown-col-money {
    width: 28%;
}

.invoice-breakdown-table th,
.invoice-breakdown-table td {
    padding: 0.24rem 0.16rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.invoice-breakdown-table .invoice-cell-number {
    text-align: right;
}

.invoice-document-totals {
    margin-left: auto;
    width: min(100%, 15rem);
    padding: 0.2rem 0 0;
}

.summary-list {
    display: grid;
    gap: 0.6rem;
}

.summary-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #dde3eb;
}

.summary-list-large dd {
    font-size: 1.3rem;
}

.summary-list dt {
    color: #6b778c;
}

.summary-list dd {
    margin: 0;
    font-weight: 700;
    color: var(--ink);
}

.invoice-document-summary-list div:last-child {
    padding-top: 0.55rem;
    border-top: 1px solid #cfd7e3;
    border-bottom: 0;
}

.invoice-document-summary-list div:last-child dd {
    font-size: 1.65rem;
    color: #0d7c66;
}

.note-text {
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid #dde3eb;
    font-size: 0.9rem;
    color: #8a96ab;
    font-style: italic;
}

.alert {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: #fff5e8;
    border: 1px solid #e5c58a;
    color: #8a5b16;
}

.message {
    width: min(1100px, calc(100% - 2rem));
    margin: 1rem auto 0;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.message.error {
    background: #fff1ef;
    border-color: #efb7af;
    color: #9f3127;
}

.cta-banner-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) auto;
    gap: 1rem;
    padding: 1.6rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #163f37 0%, #0d7c66 100%);
    color: #fff;
    box-shadow: var(--shadow);
}

.cta-banner h2,
.cta-banner p,
.cta-banner .eyebrow {
    color: #fff;
}

.cta-banner .button-secondary {
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
}

.faq-grid,
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.faq-card {
    padding: 1.4rem;
}

.site-footer {
    padding: 1.5rem 0 3rem;
    border-top: 1px solid rgba(217, 209, 191, 0.85);
}

.footer-grid a {
    display: block;
    margin-bottom: 0.7rem;
    font-weight: 700;
}

.footer-brand {
    margin-bottom: 0.8rem;
}

.muted {
    color: var(--muted);
}

@media (max-width: 960px) {
    .seo-content-grid,

    .hero-grid,
    .split-layout,
    .cta-banner-inner,
    .faq-grid,
    .footer-grid,
    .card-grid-3 {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
    }

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

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

    .line-item-grid .button {
        grid-column: span 2;
    }

    .invoice-parties-layout,
    .invoice-profile-grid,
    .invoice-settings-grid,
    .invoice-document-parties,
    .freight-document-parties,
    .freight-leg-preview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .invoice-items-header,
    .invoice-item-card {
        grid-template-columns: minmax(10rem, 1.8fr) repeat(5, minmax(4.2rem, 0.62fr)) repeat(3, minmax(5.2rem, 0.75fr)) auto;
    }

    .freight-form .invoice-primary-grid,
    .freight-form .invoice-party-grid,
    .travel-order-grid,
    .travel-order-document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .main-nav {
        display: none;
    }

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

    .shell-row {
        flex-wrap: wrap;
    }

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

    .invoice-parties-layout,
    .invoice-primary-grid,
    .invoice-party-grid,
    .invoice-profile-grid,
    .invoice-settings-grid,
    .invoice-document-meta,
    .invoice-document-parties,
    .freight-document-parties,
    .freight-leg-preview-grid,
    .freight-document-meta,
    .travel-order-document-grid {
        grid-template-columns: 1fr;
    }

    .freight-document-header,
    .freight-leg-card-head {
        display: grid;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .inline-header,
    .hero-actions,
    .button-row,
    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-items-header {
        display: none;
    }

    .invoice-item-card {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .invoice-item-head {
        display: block;
        grid-column: 1 / -1;
    }

    .invoice-item-head strong {
        font-size: 0.92rem;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .invoice-item-description,
    .invoice-item-actions {
        grid-column: 1 / -1;
    }

    .invoice-item-cell span,
    .invoice-item-description span {
        display: block;
    }

    .invoice-item-calculation-cell span {
        display: block;
    }

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

    .invoice-document-head-main {
        justify-items: start;
        text-align: left;
    }

    .invoice-document-meta {
        width: 100%;
    }
}
