.tools-page {
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.10), transparent 32rem),
        #05070b;
    color: #f8fafc;
}

.tools-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.tools-breadcrumbs {
    margin-bottom: 32px;
}

.tools-header {
    max-width: 760px;
    margin-bottom: 40px;
}

.tools-header-compact {
    margin-bottom: 32px;
}

.tools-kicker {
    margin: 0 0 12px;
    color: #5eead4;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tools-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.15rem, 5vw, 4.35rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.tools-lead {
    max-width: 680px;
    margin: 18px 0 0;
    color: #b6c3d1;
    font-size: 1.08rem;
    line-height: 1.65;
}

.tools-section {
    margin-top: 32px;
}

.tools-section-head,
.tool-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tools-section-head h2,
.tool-panel-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.15rem;
    line-height: 1.25;
    letter-spacing: 0;
}

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

.tools-category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tools-card {
    display: flex;
    min-height: 176px;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tools-card:hover,
.tools-card:focus-visible {
    border-color: rgba(94, 234, 212, 0.62);
    background: rgba(15, 23, 42, 0.88);
    transform: translateY(-2px);
}

.tools-card-count,
.tools-card-meta {
    align-self: flex-start;
    color: #5eead4;
    font-size: 0.78rem;
    font-weight: 700;
}

.tools-card-title {
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.32;
}

.tools-card-copy {
    color: #b6c3d1;
    font-size: 0.92rem;
    line-height: 1.55;
}

.tools-tool-card {
    min-height: 188px;
}

.tools-text-link {
    color: #5eead4;
    font-weight: 700;
    text-decoration: none;
}

.tools-text-link:hover,
.tools-text-link:focus-visible {
    text-decoration: underline;
}

.tools-empty-state,
.tool-panel {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    padding: 24px;
}

.tools-empty-state h2,
.tools-empty-state p {
    margin: 0;
}

.tools-empty-state p {
    margin-top: 8px;
    color: #b6c3d1;
}

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

.tool-main,
.tool-side {
    display: grid;
    gap: 18px;
}

.tool-panel-state {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
}

.tool-formula {
    margin: 0;
    padding: 18px;
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.56);
    color: #dbeafe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.92rem;
    line-height: 1.6;
}

.tool-widget-placeholder {
    display: grid;
    gap: 20px;
}

.tool-placeholder-copy {
    display: grid;
    gap: 6px;
}

.tool-placeholder-copy strong {
    color: #ffffff;
}

.tool-placeholder-copy span {
    color: #94a3b8;
}

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

.tool-input-shell {
    display: grid;
    gap: 7px;
}

.tool-input-shell label {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
}

.tool-input-shell input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.48);
    color: #e2e8f0;
}

.tool-chart-placeholder {
    display: grid;
    min-height: 220px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    padding: 24px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(2, 6, 23, 0.68));
}

.tool-chart-placeholder span {
    display: block;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #5eead4, #2563eb);
}

.tool-chart-placeholder span:nth-child(1) { height: 42%; }
.tool-chart-placeholder span:nth-child(2) { height: 68%; }
.tool-chart-placeholder span:nth-child(3) { height: 54%; }
.tool-chart-placeholder span:nth-child(4) { height: 82%; }
.tool-chart-placeholder span:nth-child(5) { height: 60%; }

.tool-input-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-input-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

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

.tool-input-list strong {
    color: #ffffff;
}

@media (max-width: 980px) {
    .tools-card-grid,
    .tools-category-grid,
    .tool-detail-layout {
        grid-template-columns: 1fr 1fr;
    }

    .tool-side {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .tools-shell {
        width: min(100% - 24px, 1120px);
        padding: 32px 0 56px;
    }

    .tools-card-grid,
    .tools-category-grid,
    .tool-detail-layout,
    .tool-input-grid {
        grid-template-columns: 1fr;
    }

    .tools-section-head,
    .tool-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.calculator-widget {
    display: grid;
}

.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
}

.calc-inputs h3,
.calc-results h3 {
    margin: 0 0 14px;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
}

.input-group {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
}

.input-group label {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
}

.input-group input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.48);
    color: #e2e8f0;
}

.input-group input:focus {
    outline: none;
    border-color: rgba(94, 234, 212, 0.62);
}

.metric-card {
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.metric-card.highlight {
    border-color: rgba(94, 234, 212, 0.4);
    background: rgba(15, 23, 42, 0.85);
}

.metric-label {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-value {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
}

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

.metric-sub-grid .metric-card {
    margin-bottom: 0;
}

.metric-sub-grid .metric-value {
    font-size: 1.05rem;
}

.tool-chart-wrapper {
    min-height: 220px;
    padding: 24px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(2, 6, 23, 0.68));
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-svg-chart {
    width: 100%;
    max-width: 420px;
    height: auto;
}

@media (max-width: 640px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

.calculator-widget {
    display: grid;
}

.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
}

.calc-inputs h3,
.calc-results h3 {
    margin: 0 0 14px;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
}

.input-group {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
}

.input-group label {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
}

.input-group input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.48);
    color: #e2e8f0;
}

.input-group input:focus {
    outline: none;
    border-color: rgba(94, 234, 212, 0.62);
}

.metric-card {
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.metric-card.highlight {
    border-color: rgba(94, 234, 212, 0.4);
    background: rgba(15, 23, 42, 0.85);
}

.metric-label {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-value {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
}

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

.metric-sub-grid .metric-card {
    margin-bottom: 0;
}

.metric-sub-grid .metric-value {
    font-size: 1.05rem;
}

.tool-chart-wrapper {
    min-height: 220px;
    padding: 24px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(2, 6, 23, 0.68));
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-svg-chart {
    width: 100%;
    max-width: 420px;
    height: auto;
}

@media (max-width: 640px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

.tool-copy-text {
    margin: 0 0 16px;
    color: #cbd5e1;
    font-size: 0.96rem;
    line-height: 1.65;
}

.tool-copy-text:last-child {
    margin-bottom: 0;
}

.tool-copy-subhead {
    margin: 24px 0 12px;
    color: #f8fafc;
    font-size: 1.02rem;
    font-weight: 700;
}

.tool-faq-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.tool-faq-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.tool-faq-item h3 {
    margin: 0 0 8px;
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 700;
}

.tool-faq-item p {
    margin: 0;
    color: #b6c3d1;
    font-size: 0.92rem;
    line-height: 1.6;
}

.tool-cta-panel {
    text-align: center;
    background: rgba(94, 234, 212, 0.06);
    border-color: rgba(94, 234, 212, 0.3);
}

.tool-cta-panel h3 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 1.05rem;
}

.tool-cta-panel .tool-copy-text {
    margin-bottom: 16px;
}
