:root {
    --ink: #1d2d2a;
    --muted: #65736f;
    --paper: #f6f5f0;
    --white: #ffffff;
    --line: #dce2dc;
    --green: #0d7768;
    --green-dark: #07574f;
    --green-soft: #dcefe8;
    --coral: #e66d5c;
    --gold: #edbd54;
    --shadow: 0 18px 48px rgba(29, 45, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button,
a,
select,
input {
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid rgba(220, 226, 220, 0.8);
    background: rgba(246, 245, 240, 0.92);
}

.header-inner,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.07rem;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--green);
    font-size: 1.05rem;
    line-height: 1;
}

.brand-dot {
    color: var(--coral);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 20px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

.main-nav a,
.text-link {
    transition: color 160ms ease;
}

.main-nav a:hover,
.text-link:hover {
    color: var(--green);
}

.intro-section {
    padding: 74px 0 56px;
}

.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 50px;
    align-items: end;
}

.eyebrow {
    margin: 0 0 13px;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

h1 {
    max-width: 780px;
    margin-bottom: 19px;
    font-size: 5.1rem;
    line-height: 0.98;
}

.intro-copy {
    max-width: 570px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.intro-note {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 17px 0 0 18px;
    border-left: 2px solid var(--gold);
    color: var(--muted);
    font-size: 0.82rem;
}

.note-number,
.unit-index {
    color: var(--coral);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.converter-section {
    padding-bottom: 94px;
}

.conversion-explainer {
    padding: 0 0 84px;
}

.conversion-explainer-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 90px;
    padding: 34px 0 0;
    border-top: 1px solid var(--line);
}

.conversion-explainer h2 {
    margin-bottom: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.35rem;
    font-weight: 500;
    line-height: 1.05;
}

.large-equation {
    margin-bottom: 12px;
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
}

.explainer-copy {
    max-width: 600px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.converter-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.converter-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 30px 34px 25px;
}

.converter-heading h2,
.section-heading h2,
.faq-layout h2 {
    margin-bottom: 0;
    font-size: 2.5rem;
    line-height: 1.05;
}

.status-dot {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 0.72rem;
    font-weight: 800;
}

.status-dot span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.category-switcher {
    display: flex;
    gap: 5px;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
}

.category-tab {
    position: relative;
    padding: 13px 16px 15px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.category-tab::after {
    position: absolute;
    right: 14px;
    bottom: -1px;
    left: 14px;
    height: 3px;
    background: transparent;
    content: "";
}

.category-tab:hover,
.category-tab.is-active {
    color: var(--ink);
}

.category-tab.is-active::after {
    background: var(--coral);
}

.converter-form {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(150px, 1.2fr) 44px minmax(150px, 1.2fr) minmax(150px, 1.35fr);
    gap: 14px;
    align-items: end;
    padding: 34px;
}

.form-field {
    min-width: 0;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.input-frame,
.form-field select,
.result-output {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
}

.input-frame:focus-within,
.form-field select:focus,
.swap-button:focus-visible,
.copy-button:focus-visible {
    outline: 3px solid rgba(230, 109, 92, 0.22);
    outline-offset: 2px;
    border-color: var(--coral);
}

.input-frame input {
    width: 100%;
    padding: 0 16px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 1.25rem;
    font-weight: 750;
}

.form-field select {
    padding: 0 12px;
    color: var(--ink);
    outline: 0;
    font-size: 0.88rem;
    font-weight: 650;
}

.result-output {
    overflow: hidden;
    padding: 0 15px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 1.04rem;
    font-weight: 800;
    white-space: nowrap;
}

.swap-button {
    display: grid;
    width: 44px;
    height: 44px;
    align-self: end;
    place-items: center;
    margin-bottom: 7px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--green);
    background: var(--white);
    cursor: pointer;
    font-size: 1.35rem;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.swap-button:hover {
    color: var(--white);
    background: var(--green);
    transform: rotate(180deg);
}

.converter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 34px;
    border-top: 1px solid var(--line);
    background: #fbfbf8;
}

.conversion-equation {
    margin: 0;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.04rem;
}

.copy-button {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border: 0;
    color: var(--green);
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
}

.copy-button:hover,
.copy-button.is-copied {
    color: var(--coral);
}

.popular-section,
.guide-section,
.faq-section {
    padding: 84px 0;
    border-top: 1px solid var(--line);
}

.table-catalog-section,
.conversion-table-section {
    padding: 0 0 84px;
}

.table-catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.table-catalog-card,
.table-link-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 23px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.table-catalog-card:hover,
.table-link-card:hover {
    border-color: var(--green);
    box-shadow: 0 9px 24px rgba(29, 45, 42, 0.07);
    transform: translateY(-3px);
}

.table-catalog-card strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.1;
}

.table-catalog-card > span:not(.card-category),
.table-link-card > span {
    color: var(--muted);
    font-size: 0.82rem;
}

.table-catalog-card .text-link {
    margin-top: auto;
}

.guide-copy {
    max-width: 720px;
}

.guide-copy h2 {
    margin-bottom: 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.4rem;
    font-weight: 500;
    line-height: 1.05;
}

.guide-copy > p:not(.eyebrow) {
    color: var(--muted);
    font-size: 0.96rem;
}

.button-link {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    margin-top: 8px;
    padding: 11px 15px;
    border: 1px solid var(--green);
    border-radius: 6px;
    color: var(--white);
    background: var(--green);
    font-size: 0.8rem;
    font-weight: 800;
    transition: background 160ms ease, border-color 160ms ease;
}

.button-link:hover {
    border-color: var(--green-dark);
    background: var(--green-dark);
}

.conversion-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
}

.conversion-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    text-align: left;
}

.conversion-table th,
.conversion-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
}

.conversion-table thead th {
    color: var(--muted);
    background: #fbfbf8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.conversion-table tbody tr:last-child th,
.conversion-table tbody tr:last-child td {
    border-bottom: 0;
}

.conversion-table tbody th {
    font-weight: 750;
}

.conversion-table code {
    color: var(--green-dark);
    font-family: inherit;
    font-weight: 800;
}

.table-action {
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.table-action:hover {
    color: var(--coral);
}

.table-links-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.table-link-card {
    gap: 8px;
    padding: 17px;
}

.table-link-card strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    font-weight: 500;
}

.table-link-card > span {
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 800;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.section-heading > p {
    max-width: 310px;
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 0.88rem;
}

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

.popular-card {
    display: flex;
    min-height: 171px;
    flex-direction: column;
    justify-content: space-between;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.popular-card:hover {
    border-color: var(--green);
    box-shadow: 0 9px 24px rgba(29, 45, 42, 0.07);
    transform: translateY(-3px);
}

.card-category {
    color: var(--coral);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.popular-card strong {
    display: block;
    margin: 15px 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.1;
}

.card-formula {
    color: var(--muted);
    font-size: 0.75rem;
}

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

.unit-column {
    padding: 25px;
    border-top: 3px solid var(--green);
    background: var(--white);
}

.unit-column:nth-child(2) {
    border-color: var(--coral);
}

.unit-column:nth-child(3) {
    border-color: var(--gold);
}

.unit-column-title {
    display: flex;
    gap: 15px;
    align-items: baseline;
}

.unit-column h3 {
    margin-bottom: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
    font-weight: 500;
}

.unit-column p {
    min-height: 51px;
    margin: 19px 0 18px;
    color: var(--muted);
    font-size: 0.86rem;
}

.unit-column ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.unit-column li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}

.unit-column code {
    color: var(--ink);
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 800;
}

.text-link {
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 800;
}

.faq-layout {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 90px;
}

.faq-list {
    border-top: 1px solid var(--line);
}

.faq-list details {
    border-bottom: 1px solid var(--line);
}

.faq-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 750;
    list-style: none;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    color: var(--coral);
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
}

.faq-list details[open] summary::after {
    content: "−";
}

.faq-list details p {
    max-width: 590px;
    margin: -4px 0 20px;
    color: var(--muted);
    font-size: 0.88rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.75rem;
}

.footer-inner {
    min-height: 70px;
}

@media (max-width: 960px) {
    h1 {
        font-size: 4rem;
    }

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

    .table-catalog-grid,
    .table-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .popular-card:last-child {
        grid-column: span 2;
    }

    .converter-form {
        grid-template-columns: 1fr 1fr 44px 1fr;
    }

    .value-field,
    .result-field {
        grid-column: span 2;
    }

    .result-field {
        grid-column: 4;
        grid-row: 1;
    }

    .value-field {
        grid-column: span 3;
        grid-row: 1;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        min-height: 68px;
        gap: 9px;
    }

    .main-nav {
        gap: 13px;
        font-size: 0.76rem;
    }

    .intro-section {
        padding: 53px 0 38px;
    }

    .intro-grid,
    .faq-layout,
    .conversion-explainer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    h1 {
        font-size: 2.8rem;
    }

    .converter-heading h2,
    .section-heading h2,
    .faq-layout h2 {
        font-size: 1.9rem;
    }

    .intro-note {
        max-width: 280px;
    }

    .converter-section {
        padding-bottom: 62px;
    }

    .converter-heading,
    .converter-form,
    .converter-footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .converter-heading {
        padding-top: 24px;
        padding-bottom: 20px;
    }

    .status-dot {
        padding: 6px 8px;
        font-size: 0.65rem;
    }

    .category-switcher {
        overflow-x: auto;
        padding: 0 18px;
        scrollbar-width: none;
    }

    .category-switcher::-webkit-scrollbar {
        display: none;
    }

    .converter-form {
        display: grid;
        grid-template-columns: 1fr 40px 1fr;
        gap: 12px;
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .value-field,
    .result-field {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .swap-button {
        width: 40px;
        height: 40px;
    }

    .converter-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
        padding-top: 17px;
        padding-bottom: 17px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .popular-section,
    .guide-section,
    .faq-section {
        padding: 61px 0;
    }

    .popular-grid,
    .unit-columns,
    .table-catalog-grid,
    .table-links-grid {
        grid-template-columns: 1fr;
    }

    .popular-card:last-child {
        grid-column: auto;
    }

    .unit-column p {
        min-height: 0;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }
}
