.tools-hero {
    position: relative;
    overflow: hidden;
    padding: 92px 0 88px;
    color: var(--white);
    background:
        radial-gradient(circle at 84% 22%, rgba(185, 143, 74, .28), transparent 28%),
        radial-gradient(circle at 12% 88%, rgba(47, 111, 94, .36), transparent 30%),
        linear-gradient(135deg, #101713, #18372f 62%, #1d2d28);
}

.tools-hero::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: .32;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to right, transparent, #000 30%, #000);
}

.tools-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
}

.tools-hero .eyebrow { color: #dbc38f; }

.tools-hero h1 {
    max-width: 880px;
    margin: 18px 0;
    font-size: clamp(42px, 6vw, 74px);
    line-height: .99;
    letter-spacing: -.045em;
}

.tools-hero .lead {
    max-width: 760px;
    margin: 0;
    color: #d9e2dc;
    font-size: clamp(18px, 2.2vw, 23px);
    line-height: 1.55;
}

.tools-breadcrumb {
    margin-bottom: 30px;
    color: rgba(255, 255, 255, .72);
}

.tools-breadcrumb a { color: #fff; }

.tools-back-link {
    display: inline-flex;
    margin-top: 28px;
    color: #e4cd98;
    font-weight: 700;
}

.tools-back-link:hover { color: #fff; }

.tools-section-heading {
    max-width: 760px;
    margin-bottom: 38px;
}

.tools-section-heading h2 {
    margin: 8px 0 14px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.06;
    letter-spacing: -.035em;
}

.tools-section-heading p,
.tools-copy-card p,
.tools-step-list p,
.tools-notice p,
.tool-panel-heading p,
.tool-result p {
    color: var(--muted);
    line-height: 1.72;
}

.tools-section-heading-wide {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(280px, .65fr);
    align-items: end;
    gap: 50px;
    max-width: none;
}

.tools-section-heading-wide p { margin: 0 0 10px; }

.tools-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.tool-card {
    display: flex;
    min-height: 330px;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 16px 42px rgba(17, 20, 18, .07);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: rgba(47, 111, 94, .5);
    box-shadow: 0 24px 58px rgba(17, 20, 18, .12);
}

.tool-card-icon,
.tool-panel-icon,
.tools-notice-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 10px;
    background: rgba(47, 111, 94, .11);
    color: var(--green);
}

.tool-card-icon svg,
.tool-panel-icon svg,
.tools-notice-icon svg { width: 23px; height: 23px; }

.tool-card h3 {
    margin: 28px 0 12px;
    font-size: 23px;
    line-height: 1.16;
    letter-spacing: -.025em;
}

.tool-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.tool-card-link {
    margin-top: auto;
    padding-top: 28px;
    color: var(--green);
    font-weight: 800;
}

.tools-card-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tools-card-grid-compact .tool-card { min-height: 280px; }

.tools-muted-section,
.tools-related,
.tools-faq { background: #efede6; }

.tools-copy-layout {
    display: grid;
    grid-template-columns: minmax(260px, .65fr) minmax(0, 1fr);
    gap: 80px;
    align-items: start;
}

.tools-step-list {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--line);
}

.tools-step-list li {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 20px;
    padding: 26px;
    background: var(--white);
}

.tools-step-list li > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--white);
    font-weight: 800;
}

.tools-step-list h3 { margin: 2px 0 7px; font-size: 20px; }
.tools-step-list p { margin: 0; }

.tools-notice {
    display: flex;
    gap: 22px;
    padding: 30px;
    border: 1px solid rgba(185, 143, 74, .28);
    border-left: 5px solid var(--gold);
    border-radius: 10px;
    background: #fffaf0;
}

.tools-notice h2,
.tools-notice h3 { margin: 1px 0 8px; }
.tools-notice h2 { font-size: 26px; }
.tools-notice p { margin: 6px 0; color: #5d5a51; }
.tools-notice-info { border-color: rgba(47, 111, 94, .24); border-left-color: var(--green); background: #f4faf7; }
.tools-notice-info p { color: #4f615a; }

.tools-legal-intro { padding-bottom: 0; }

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

.tools-faq-list details {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
}

.tools-faq-list summary {
    position: relative;
    cursor: pointer;
    padding: 22px 58px 22px 24px;
    font-size: 18px;
    font-weight: 750;
    list-style: none;
}

.tools-faq-list summary::-webkit-details-marker { display: none; }
.tools-faq-list summary::after { position: absolute; top: 20px; right: 24px; content: "+"; color: var(--green); font-size: 25px; }
.tools-faq-list details[open] summary::after { content: "−"; }
.tools-faq-list details p { margin: 0; padding: 0 24px 22px; color: var(--muted); line-height: 1.7; }

.tools-cta {
    padding: 80px 0;
    color: var(--white);
    background: linear-gradient(120deg, var(--ink), #1e3f36);
}

.tools-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.tools-cta h2 { margin: 8px 0; font-size: clamp(30px, 4vw, 48px); }
.tools-cta p { max-width: 720px; margin: 0; color: #d4ded8; line-height: 1.65; }

.tool-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .72fr);
    gap: 24px;
    align-items: start;
}

.tool-workspace-wide-result { grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr); }

.tool-form,
.tool-result {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 18px 50px rgba(17, 20, 18, .07);
}

.tool-form { padding: 32px; }
.tool-result { position: sticky; top: 98px; padding: 30px; }

.tool-panel-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

.tool-panel-heading h2 { margin: 4px 0 3px; font-size: 25px; letter-spacing: -.02em; }
.tool-panel-heading p { margin: 5px 0 0; }

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

.tool-field-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-field-wide { grid-column: 1 / -1; }

.tool-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.tool-field label,
.tool-form-section legend,
.tool-choice-group legend {
    color: #252b27;
    font-size: 14px;
    font-weight: 800;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(17, 20, 18, .2);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 11px 13px;
}

.tool-field textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.tool-field input:focus,
.tool-field select:focus,
.tool-field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 111, 94, .12); outline: none; }
.tool-field small { color: var(--muted); font-size: 12px; line-height: 1.5; }

.tool-input-unit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid rgba(17, 20, 18, .2);
    border-radius: 8px;
    overflow: hidden;
    background: #f3f1eb;
}

.tool-input-unit:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 111, 94, .12); }
.tool-input-unit input { min-width: 0; border: 0; border-radius: 0; box-shadow: none !important; }
.tool-input-unit span { padding: 0 13px; color: var(--muted); font-size: 13px; font-weight: 800; }

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.tool-actions .btn[disabled] { cursor: not-allowed; opacity: .48; transform: none; }

.tool-result-empty { margin: 0; }
.tool-result-body[hidden],
.tool-result-empty[hidden] { display: none; }

.tool-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}

.tool-metric-grid div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #faf9f5;
}

.tool-metric-grid dt { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.tool-metric-grid dd { margin: 0; font-size: 22px; font-weight: 850; }
.tool-metric-grid .tool-metric-emphasis { border-color: rgba(47, 111, 94, .35); background: #edf6f2; }

.tool-result-list { margin: 16px 0; padding-left: 20px; }
.tool-result-list li { margin: 8px 0; line-height: 1.5; }
.tool-result-warning { padding-top: 15px; border-top: 1px solid var(--line); font-size: 13px; }

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

.tools-copy-card {
    min-height: 260px;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}

.tools-copy-card h2 { margin: 10px 0 15px; font-size: 27px; }
.tools-copy-card p { margin: 0; }
.tools-copy-grid-balanced .tools-copy-card { min-height: 360px; }
.tools-copy-card-source { border-top: 4px solid var(--green); }
.tool-formula { padding: 14px 16px; border-radius: 8px; background: var(--ink); color: var(--white) !important; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }

.tools-source-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--green);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.tools-check-list { margin: 18px 0 0; padding: 0; list-style: none; }
.tools-check-list li { position: relative; margin: 14px 0; padding-left: 27px; color: var(--muted); line-height: 1.6; }
.tools-check-list li::before { position: absolute; top: .15em; left: 0; content: "✓"; color: var(--green); font-weight: 900; }
.tools-check-list-panel { margin: 0; padding: 26px 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }

.tool-table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    background: var(--white);
    box-shadow: 0 18px 50px rgba(17, 20, 18, .06);
}

.tool-comparison-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.tool-comparison-table th,
.tool-comparison-table td { padding: 22px 20px; border-bottom: 1px solid var(--line); text-align: left; }
.tool-comparison-table thead th { background: var(--ink); color: var(--white); font-size: 13px; }
.tool-comparison-table tbody th { font-size: 20px; }
.tool-comparison-table tbody tr:last-child > * { border-bottom: 0; }
.tool-comparison-table tbody tr { transition: background .2s ease; }
.tool-comparison-table tbody tr.is-match { background: #eaf5f0; }
.tool-comparison-table tbody tr.is-match th::after { margin-left: 9px; content: "✓"; color: var(--green); }

.tool-choice-group,
.tool-form-section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.tool-choice-group + .tool-choice-group,
.tool-form-section + .tool-form-section { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.tool-choice-group legend,
.tool-form-section legend { width: 100%; margin-bottom: 14px; font-size: 17px; }

.tool-choice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 9px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #faf9f5;
    cursor: pointer;
    line-height: 1.5;
}

.tool-choice:has(input:checked) { border-color: rgba(47, 111, 94, .55); background: #edf6f2; }
.tool-choice input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; accent-color: var(--green); }

.incoterms-result-code {
    display: inline-grid;
    min-width: 98px;
    min-height: 70px;
    place-items: center;
    border-radius: 10px;
    background: var(--ink);
    color: var(--white);
    font-size: 34px;
    letter-spacing: .08em;
}

.incoterms-result-summary { color: #333b36 !important; font-size: 17px; }
.tool-result-incoterms h3 { margin: 24px 0 8px; font-size: 16px; }
.incoterms-group-title { margin: 40px 0 18px; font-size: 20px; }
.incoterms-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.incoterms-grid-sea { margin-bottom: 38px; }

.incoterms-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
}

.incoterms-card strong { display: inline-block; padding: 7px 10px; border-radius: 6px; background: var(--ink); color: var(--white); letter-spacing: .06em; }
.incoterms-card p { margin: 15px 0 0; color: var(--muted); font-size: 14px; line-height: 1.62; }

.quote-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 24px;
    align-items: start;
}

.quote-generator-form { grid-row: span 2; }
.quote-side .tool-result { position: static; }
.quote-output { position: static; grid-column: 1 / -1; }

.tool-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tool-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #faf9f5;
    cursor: pointer;
    line-height: 1.45;
}

.tool-check:has(input:checked) { border-color: rgba(47, 111, 94, .5); background: #edf6f2; }
.tool-check input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; accent-color: var(--green); }

.quote-checklist progress {
    width: 100%;
    height: 12px;
    margin-top: 12px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #dedbd1;
}

.quote-checklist progress::-webkit-progress-bar { background: #dedbd1; }
.quote-checklist progress::-webkit-progress-value { background: var(--green); }
.quote-checklist progress::-moz-progress-bar { background: var(--green); }
.quote-progress-label { margin: 8px 0 17px !important; font-size: 13px; font-weight: 700; }
.quote-check-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quote-check-list li { position: relative; padding-left: 27px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.quote-check-list li::before { position: absolute; left: 0; content: "○"; color: #9a9f9a; }
.quote-check-list li.is-complete { color: var(--ink); }
.quote-check-list li.is-complete::before { content: "✓"; color: var(--green); font-weight: 900; }

.quote-output pre {
    max-height: 560px;
    margin: 0;
    padding: 24px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f7f6f1;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #26302b;
    font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.quote-output-actions { margin-top: 18px; }
.tool-action-status { min-height: 1.5em; margin: 10px 0 0 !important; color: var(--green) !important; font-size: 13px; font-weight: 700; }

@media (max-width: 1040px) {
    .tools-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tools-card-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tool-workspace,
    .tool-workspace-wide-result { grid-template-columns: minmax(0, 1fr) 330px; }
    .tool-field-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .incoterms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .tools-hero { padding: 72px 0; }
    .tools-section-heading-wide,
    .tools-copy-layout,
    .tool-workspace,
    .tool-workspace-wide-result,
    .quote-workspace { grid-template-columns: 1fr; gap: 30px; }
    .tool-result { position: static; }
    .quote-generator-form { grid-row: auto; }
    .quote-output { grid-column: auto; }
    .tools-copy-grid { grid-template-columns: 1fr; }
    .tools-copy-grid-balanced .tools-copy-card { min-height: 0; }
    .tools-card-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .incoterms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tools-cta-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
    .tools-hero h1 { font-size: 40px; }
    .tools-card-grid,
    .tools-card-grid-compact,
    .tool-field-grid,
    .tool-field-grid-three,
    .tool-metric-grid,
    .incoterms-grid,
    .tool-checkbox-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: 270px; padding: 25px; }
    .tool-form,
    .tool-result,
    .tools-copy-card { padding: 24px; }
    .tools-notice { padding: 24px; flex-direction: column; }
    .tools-step-list li { grid-template-columns: 44px 1fr; padding: 20px; }
    .tools-section-heading h2 { font-size: 34px; }
    .tool-actions { align-items: stretch; flex-direction: column; }
    .tool-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tool-comparison-table tbody tr { transition: none; }
}

@media print {
    .site-header,
    .footer,
    .tools-related,
    .tools-cta,
    .tools-faq,
    .tool-actions { display: none !important; }
    .tools-hero { padding: 30px 0; background: none; color: #000; }
    .tools-hero .lead,
    .tools-breadcrumb { color: #333; }
    .tool-form,
    .tool-result { box-shadow: none; }
}
