.web-tools-hero {
    position: relative;
    min-height: min(520px, calc(100vh - var(--nav-height, 78px)));
    display: grid;
    align-items: center;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 14% 18%, rgba(15, 159, 145, .28), transparent 32%),
        radial-gradient(circle at 88% 78%, rgba(53, 120, 212, .26), transparent 30%),
        linear-gradient(145deg, #07111f, #0b1b31 56%, #0b3f4c);
}

.calculator-hero {
    background:
        radial-gradient(circle at 15% 18%, rgba(53, 120, 212, .32), transparent 33%),
        radial-gradient(circle at 88% 78%, rgba(114, 92, 196, .2), transparent 30%),
        linear-gradient(145deg, #07111f, #0b1b31 56%, #182852);
}

.web-tools-hero-compact {
    min-height: 420px;
}

.web-tools-hero-overlay {
    position: absolute;
    inset: 0;
    opacity: .38;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(129, 164, 205, .09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 164, 205, .09) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.web-tools-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100% - 36px));
    margin: 0 auto;
    padding: clamp(64px, 8vw, 96px) 0;
}

.web-tools-hero-inner > span,
.web-tools-section-head > span,
.web-tool-card-head > span {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 29px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.web-tools-hero-inner > span {
    border: 1px solid rgba(116, 224, 212, .36);
    color: #8be8de;
    background: rgba(116, 224, 212, .08);
}

.calculator-hero .web-tools-hero-inner > span {
    border-color: rgba(149, 174, 255, .34);
    color: #b7c8ff;
    background: rgba(127, 150, 231, .09);
}

.web-tools-hero-inner h1 {
    max-width: 840px;
    margin: 15px 0;
    color: #fff;
    font-size: clamp(2.45rem, 6vw, 4.85rem);
    line-height: 1;
    letter-spacing: -.055em;
}

.web-tools-hero-inner p {
    max-width: 700px;
    margin: 0 0 25px;
    color: rgba(226, 236, 248, .79);
    font-size: clamp(1rem, 1.55vw, 1.13rem);
    line-height: 1.75;
}

.web-tools-hero-inner a,
.web-tool-actions button,
.web-tool-actions a,
.exchange-swap,
.calculator-mode-row button,
.calculator-keypad button {
    min-height: 44px;
    border-radius: 10px;
    font: inherit;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.web-tools-hero-inner a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #07111f;
    background: linear-gradient(135deg, #fff, #dff8f5);
    box-shadow: 0 10px 25px rgba(0, 6, 18, .2);
}

.web-tools-library {
    padding: clamp(58px, 7vw, 92px) clamp(16px, 3vw, 34px) clamp(76px, 9vw, 116px);
    color: #132238;
    background:
        radial-gradient(circle at 100% 0, rgba(53, 120, 212, .07), transparent 30%),
        #f5f8fc;
}

.web-tools-section-head,
.web-tools-grid,
.web-tools-hub-grid {
    width: min(1160px, 100%);
    margin-inline: auto;
}

.web-tools-section-head {
    margin-bottom: 27px;
}

.web-tools-section-head > span,
.web-tool-card-head > span {
    color: #08766d;
    background: #def7f3;
}

.calculator-card .web-tool-card-head > span {
    color: #3158a7;
    background: #e7edff;
}

.web-tools-section-head h2 {
    margin: 13px 0 0;
    color: #0b1b31;
    font-size: clamp(1.8rem, 3.8vw, 2.65rem);
    line-height: 1.16;
    letter-spacing: -.035em;
}

.web-tools-grid,
.web-tools-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 2.5vw, 30px);
    align-items: start;
}

.web-tool-hub-card,
.web-tool-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 16px;
    border: 1px solid #d9e5f1;
    border-radius: 22px;
    color: #132238;
    background: #fff;
    box-shadow: 0 18px 46px rgba(15, 39, 71, .1);
}

.web-tool-hub-card {
    min-height: 350px;
    padding: clamp(23px, 3.2vw, 32px);
    text-decoration: none;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.web-tool-hub-card:hover {
    transform: translateY(-6px);
    border-color: #9ed5cf;
    box-shadow: 0 27px 62px rgba(15, 39, 71, .15);
}

.calculator-hub-card:hover {
    border-color: #afc2ee;
}

.web-tool-card-head {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
}

.web-tool-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #08766d;
    background: linear-gradient(145deg, #e8faf7, #d5f1ed);
    font-size: 1.15rem;
}

.calculator-card .web-tool-icon,
.calculator-hub-card .web-tool-icon {
    color: #3158a7;
    background: linear-gradient(145deg, #edf2ff, #dfe8ff);
}

.web-tool-view-count {
    width: fit-content;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #d9e5f1;
    border-radius: 999px;
    color: #60738a;
    background: #f7fafe;
    font-size: .82rem;
    font-weight: 800;
}

.web-tool-view-count i {
    color: #0f9f91;
}

.calculator-card .web-tool-view-count i,
.calculator-hub-card .web-tool-view-count i {
    color: #3578d4;
}

.web-tool-hub-card h3,
.web-tool-card h2,
.web-tool-card h3 {
    margin: 0;
    color: #0b1b31;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.web-tool-hub-card h3 {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.web-tool-card h2,
.web-tool-card h3 {
    font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.web-tool-hub-card p,
.web-tool-card p {
    margin: 0;
    color: #52657d;
    line-height: 1.72;
}

.web-tool-hub-card strong {
    width: fit-content;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 10px 15px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #08766d, #0f9f91);
    font-size: .9rem;
    box-shadow: 0 8px 21px rgba(15, 159, 145, .2);
}

.calculator-hub-card strong {
    background: linear-gradient(135deg, #3158a7, #3578d4);
    box-shadow: 0 8px 21px rgba(53, 120, 212, .2);
}

.tool-page {
    padding-top: clamp(42px, 6vw, 66px);
}

.tool-page-card {
    width: min(1000px, 100%);
    margin-inline: auto;
}

.web-tool-card {
    padding: clamp(20px, 3.5vw, 34px);
}

.exchange-status-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.exchange-status,
.exchange-timer {
    width: fit-content;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 9px;
    font-size: .84rem;
    font-weight: 800;
}

.exchange-status {
    color: #40566f;
    background: #edf3f9;
}

.exchange-timer {
    color: #3158a7;
    background: #e8effd;
}

.exchange-status.is-ready {
    color: #08766d;
    background: #def7f3;
}

.exchange-status.is-error {
    color: #a52d2d;
    background: #fde9e9;
}

.exchange-converter {
    display: grid;
    grid-template-columns: minmax(110px, 1.15fr) minmax(100px, 1fr) 46px minmax(100px, 1fr) minmax(110px, 1fr);
    gap: 11px;
    align-items: end;
}

.exchange-converter label {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.exchange-converter label span {
    color: #52657d;
    font-size: .8rem;
    font-weight: 850;
}

.exchange-converter input,
.exchange-converter select,
.calculator-screen input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border: 1px solid #c7d6e6;
    border-radius: 10px;
    color: #0b1b31;
    background: #fff;
    font: inherit;
    font-weight: 750;
}

.exchange-converter input,
.exchange-converter select {
    padding: 9px 11px;
}

.exchange-converter input:focus,
.exchange-converter select:focus,
.calculator-screen input:focus {
    outline: 3px solid rgba(53, 120, 212, .15);
    border-color: #3578d4;
}

.exchange-swap {
    width: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #174375, #2563a8);
}

.exchange-result,
.calculator-screen output {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #07111f, #0f2747);
    font-weight: 900;
    overflow-wrap: anywhere;
    text-align: right;
}

.exchange-result {
    min-height: 62px;
    padding: 12px 14px;
    font-size: clamp(1.15rem, 2.5vw, 1.55rem);
}

.exchange-rate-grid {
    display: grid;
    gap: 9px;
}

.exchange-rate-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(72px, .8fr) repeat(2, minmax(92px, 1fr));
    gap: 10px;
    align-items: center;
    padding: 12px 13px;
    border: 1px solid #e0e9f2;
    border-radius: 10px;
    background: #f7fafe;
}

.exchange-rate-row strong,
.exchange-rate-row span {
    min-width: 0;
}

.exchange-rate-row strong {
    color: #0b1b31;
}

.exchange-rate-row span {
    color: #52657d;
    font-size: .88rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.web-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.web-tool-actions button,
.web-tool-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
}

.web-tool-actions button {
    border: 1px solid #0f9f91;
    color: #fff;
    background: linear-gradient(135deg, #08766d, #0f9f91);
}

.web-tool-actions a {
    border: 1px solid #c7d6e6;
    color: #174375;
    background: #fff;
}

.web-tool-note {
    font-size: .87rem;
}

.scientific-calculator {
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: clamp(13px, 2vw, 18px);
    border: 1px solid #d7e3ef;
    border-radius: 16px;
    background: #f4f8fc;
}

.calculator-screen {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.calculator-screen input {
    padding: 10px 12px;
    text-align: right;
}

.calculator-screen output {
    min-height: 58px;
    padding: 11px 13px;
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    word-break: break-word;
}

.calculator-screen small {
    min-height: 20px;
    display: block;
    color: #60738a;
    font-size: .82rem;
    font-weight: 800;
    text-align: right;
}

.calculator-mode-row,
.calculator-keypad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.calculator-mode-row button,
.calculator-keypad button {
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid #d2deeb;
    color: #19304b;
    background: #e9f0f7;
    transition: transform .15s ease, background-color .15s ease;
}

.calculator-mode-row button:hover,
.calculator-keypad button:hover {
    transform: translateY(-1px);
    background: #dce8f4;
}

.calculator-keypad button[data-calculator-action="equals"],
.calculator-mode-row button[data-calculator-action="copy"] {
    border-color: #3578d4;
    color: #fff;
    background: linear-gradient(135deg, #3158a7, #3578d4);
}

.calculator-mode-row button[data-calculator-action="clear"] {
    border-color: #f1caca;
    color: #9c2e2e;
    background: #fdeaea;
}

@media (max-width: 980px) {
    .web-tools-grid,
    .web-tools-hub-grid {
        grid-template-columns: 1fr;
    }

    .exchange-converter {
        grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 46px minmax(120px, 1fr);
    }

    .exchange-converter label:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .web-tools-hero {
        min-height: auto;
    }

    .web-tools-hero-inner {
        width: min(100% - 28px, 1100px);
        padding: 48px 0 58px;
    }

    .web-tools-hero-inner a,
    .web-tool-hub-card strong,
    .web-tool-actions button,
    .web-tool-actions a {
        width: 100%;
    }

    .web-tools-library {
        padding-inline: 14px;
    }

    .web-tool-card,
    .web-tool-hub-card {
        padding: 20px;
        border-radius: 18px;
    }

    .web-tool-hub-card {
        min-height: 0;
    }

    .web-tool-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .exchange-status-line,
    .exchange-status,
    .exchange-timer {
        width: 100%;
    }

    .exchange-converter {
        grid-template-columns: 1fr;
    }

    .exchange-converter label:last-child {
        grid-column: auto;
    }

    .exchange-swap {
        width: 100%;
    }

    .exchange-rate-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

@media (max-width: 380px) {
    .calculator-mode-row,
    .calculator-keypad {
        gap: 6px;
    }

    .calculator-mode-row button,
    .calculator-keypad button {
        min-height: 40px;
        font-size: .82rem;
    }
}

@media (min-width: 1700px) {
    .web-tools-section-head,
    .web-tools-grid,
    .web-tools-hub-grid {
        width: min(1360px, 100%);
    }

    .tool-page-card {
        width: min(1100px, 100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .web-tool-hub-card,
    .calculator-mode-row button,
    .calculator-keypad button {
        transition: none !important;
    }
}
