.de-hero,
.de-tool-card,
.de-guide {
    --ink: #17233d;
    --muted: #637087;
    --navy: #143d59;
    --blue: #176b87;
    --aqua: #00a6a6;
    --amber: #f2a900;
    --paper: #fbfaf6;
    color: var(--ink);
}

.de-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 28px 24px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(20,61,89,.98), rgba(23,107,135,.94)),
        repeating-linear-gradient(90deg, transparent 0 29px, rgba(255,255,255,.08) 30px);
    border-bottom: 5px solid var(--amber);
}

.de-hero:after {
    position: absolute;
    right: -34px;
    bottom: -42px;
    width: 180px;
    height: 180px;
    content: "";
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    box-shadow: 0 0 0 24px rgba(255,255,255,.05), 0 0 0 48px rgba(255,255,255,.04);
}

.de-hero h1 {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 7px 0 12px;
    padding: 0;
    color: #fff;
    font: 700 30px/1.15 Georgia, "Times New Roman", serif;
    background: transparent;
    border: 0;
}

.de-hero p {
    position: relative;
    z-index: 1;
    max-width: 690px;
    font-size: 16px;
    line-height: 1.6;
}

.de-kicker,
.de-step {
    display: inline-block;
    color: var(--aqua);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.de-hero .de-kicker { color: #9ff3ed; }

.de-hero-links {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.de-hero-links a {
    padding: 6px 10px;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 3px;
}

.de-tool-card,
.de-guide {
    padding: 24px;
    border-top: 3px solid #dce7ec;
    box-shadow: 0 7px 25px rgba(28,48,71,.07);
}

.de-tool-primary { border-top-color: var(--aqua); }

.de-tool-card h2,
.de-guide h2 {
    margin: 4px 0 12px;
    color: var(--navy);
    font: 700 21px/1.25 Georgia, "Times New Roman", serif;
    box-shadow: none;
}

.de-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.de-hint {
    flex: none;
    padding: 5px 9px;
    color: #176b64;
    font-size: 11px;
    font-weight: bold;
    background: #e3f7f3;
    border-radius: 20px;
}

.de-field-grid {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

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

.de-field > span:first-child,
.de-mini-field {
    display: block;
    margin-bottom: 6px;
    color: #46546a;
    font-size: 12px;
    font-weight: 700;
}

.de-field .form-control {
    height: 42px;
    border-color: #b9c9d2;
    border-radius: 3px;
    box-shadow: none;
}

.de-field .form-control:focus {
    border-color: var(--aqua);
    box-shadow: 0 0 0 3px rgba(0,166,166,.12);
}

.de-combined-input,
.de-scale-input {
    display: flex;
    align-items: center;
}

.de-combined-input input { min-width: 0; border-radius: 3px 0 0 3px !important; }
.de-combined-input select { width: 95px; border-left: 0; border-radius: 0 3px 3px 0 !important; }
.de-scale-input b {
    height: 42px;
    padding: 10px 12px;
    color: #fff;
    background: var(--navy);
    border-radius: 3px 0 0 3px;
}
.de-scale-input input { border-radius: 0 3px 3px 0 !important; }

.de-preset-wrap {
    padding: 12px 14px 4px;
    margin-bottom: 16px;
    background: #f4f8fa;
    border: 1px solid #e2eaee;
}

.de-preset-wrap > div { margin-bottom: 8px; }
.de-preset-wrap strong { display: inline-block; min-width: 78px; color: #4b5b70; font-size: 11px; }
.de-preset {
    padding: 3px 7px;
    margin: 0 3px 4px 0;
    color: var(--blue);
    font-size: 11px;
    background: #fff;
    border: 1px solid #b8ccd5;
    border-radius: 2px;
}
.de-preset:hover, .de-preset:focus { color: #fff; background: var(--blue); border-color: var(--blue); }

.de-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.de-btn-primary {
    color: #fff;
    font-weight: 700;
    background: var(--blue);
    border: 1px solid var(--blue);
}
.de-btn-primary:hover, .de-btn-primary:focus { color: #fff; background: #0f5269; }
.de-btn-quiet { color: #435069; background: #f2f5f6; border: 1px solid #cad5da; }

.de-error { min-height: 20px; margin-top: 10px; color: #a1372b; font-weight: 700; }
.de-result {
    margin-top: 12px;
    padding: 17px;
    background: #eff9f7;
    border-left: 4px solid var(--aqua);
}
.de-result > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.de-result span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.de-result strong { color: var(--navy); font: 700 24px/1.2 Georgia, serif; }
.de-result p { padding-top: 12px; margin: 12px 0 0; border-top: 1px solid #cde6e1; }
.de-copy {
    float: right;
    padding: 3px 8px;
    color: var(--blue);
    font-size: 11px;
    background: #fff;
    border: 1px solid #bad2d2;
}
.de-unit-results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.de-unit-results span { padding: 4px 7px; color: #35455a; text-transform: none; background: #fff; border: 1px solid #d5e4e3; }
.de-inline-result { min-height: 24px; padding: 12px 0 0; color: var(--navy); font-weight: 700; }

.de-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.de-two-column .de-tool-card { height: calc(100% - 10px); }

.de-mini-field { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.de-mini-field input { width: 90px; height: 34px; }
.de-scale-table thead { color: #fff; background: var(--navy); }
.de-scale-table td, .de-scale-table th { vertical-align: middle !important; }
.de-scale-table tbody tr:nth-child(even) { background: #f5f8f9; }

.de-ruler-stage {
    overflow: hidden;
    padding: 25px 8px 12px;
    margin-top: 16px;
    background: #eef3f5;
    border: 1px solid #d5e0e4;
}
#de-ruler-bar {
    position: relative;
    max-width: 100%;
    height: 25px;
    color: var(--navy);
    font-size: 10px;
    border-top: 3px solid var(--navy);
    border-right: 2px solid var(--navy);
    border-left: 2px solid var(--navy);
    background: repeating-linear-gradient(90deg, transparent 0 9px, var(--navy) 10px 11px);
}
#de-ruler-bar span { position: absolute; top: 7px; }
#de-ruler-bar span:first-child { left: 0; }
#de-ruler-label { right: 0; padding-left: 4px; background: #eef3f5; }

.de-exercise { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.de-exercise > div:first-child { flex: 1; }

.de-content-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.de-content-nav a { padding: 5px 9px; color: var(--blue); text-decoration: none; background: #edf5f7; }
.de-formula-grid, .de-use-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 15px 0; }
.de-formula-grid > div, .de-use-grid > section {
    padding: 14px;
    background: var(--paper);
    border: 1px solid #e7e3d9;
}
.de-formula-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.de-formula-grid strong { color: var(--navy); }
.de-use-grid h3 { margin: 0 0 6px; color: var(--navy); font-size: 14px; }
.de-faq details { padding: 12px 0; border-bottom: 1px solid #e3e8ea; }
.de-faq summary { color: var(--navy); font-weight: 700; cursor: pointer; }
.de-faq p { margin: 8px 0 0; }

.de-scale-page-hero { border-left: 6px solid var(--amber); }
.de-scale-fact { font-size: 18px; }
.de-related-scales { display: flex; flex-wrap: wrap; gap: 7px; }
.de-related-scales a { padding: 6px 9px; background: #edf5f7; border-radius: 2px; }

.de-special-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.de-special-grid a {
    position: relative;
    display: flex;
    min-height: 88px;
    padding: 16px 42px 16px 16px;
    flex-direction: column;
    justify-content: center;
    color: var(--navy);
    text-decoration: none;
    background: #f4f8fa;
    border: 1px solid #dbe6ea;
    border-left: 4px solid var(--aqua);
    transition: transform .18s ease, box-shadow .18s ease;
}
.de-special-grid a:after {
    position: absolute;
    right: 16px;
    content: "→";
    color: var(--aqua);
    font-size: 22px;
}
.de-special-grid a:hover,
.de-special-grid a:focus {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(28,48,71,.12);
}
.de-special-grid span { margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 767px) {
    .de-hero { padding: 22px 18px; }
    .de-hero h1 { font-size: 26px; }
    .de-tool-card, .de-guide { padding: 18px 15px; }
    .de-field-grid-3, .de-field-grid-2, .de-two-column, .de-formula-grid, .de-use-grid, .de-special-grid { grid-template-columns: 1fr; }
    .de-section-heading, .de-exercise { align-items: stretch; flex-direction: column; }
    .de-field-grid-2 > span:empty { display: none; }
    .de-result > div:first-child { align-items: flex-start; flex-direction: column; }
}

@media print {
    .navbar, footer, .de-hero-links, .de-actions, .de-preset-wrap, .cookie-consent { display: none !important; }
    body { background: #fff; }
    .de-tool-card, .de-guide { box-shadow: none; break-inside: avoid; }
}

.it-graphic-preview {
    max-width: 760px;
    margin: 26px auto 8px;
    padding: 24px 18px 18px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    background: #fff;
    overflow-x: auto;
    text-align: center;
}
.it-graphic-labels,
.it-graphic-bar { display: flex; min-width: 420px; }
.it-graphic-labels {
    justify-content: space-between;
    margin-bottom: 5px;
    color: #26384a;
    font-size: 13px;
}
.it-graphic-bar { height: 42px; border: 2px solid #17324d; }
.it-graphic-bar span { flex: 1; }
.it-graphic-bar .is-dark { background: #17324d; }
.it-graphic-bar .is-light { background: #fff; }
.it-graphic-preview > strong {
    display: block;
    margin-top: 10px;
    color: #17324d;
    letter-spacing: .04em;
}
.it-result-error {
    color: #9f281e !important;
    border-color: #e7b9b5 !important;
    background: #fff4f3 !important;
}
.it-plan-sheet {
    position: relative;
    max-width: 760px;
    min-height: 190px;
    margin: 24px auto 0;
    padding: 24px;
    border: 2px solid #ccd7df;
    background: linear-gradient(#fff 23px, #eef2f4 24px);
    background-size: 100% 24px;
    box-shadow: 0 8px 20px rgba(28,48,71,.08);
}
.it-plan-sheet span {
    display: block;
    width: 10%;
    height: 12px;
    margin-top: 48px;
    border-left: 2px solid #17324d;
    border-right: 2px solid #17324d;
    background: #f0a522;
    transition: width .25s ease;
}
.it-plan-sheet strong {
    display: block;
    margin-top: 10px;
    color: #17324d;
}

@media print {
    #it-graphic-preview,
    #it-graphic-preview * { visibility: visible; }
    #it-graphic-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: 0;
    }
}
