#ttbdn-calculator,
.ttbdn-page {
    --ttbdn-blue: #185ca9;
    --ttbdn-blue-dark: #124a8a;
    --ttbdn-text: #26344c;
    --ttbdn-muted: #5b6980;
    --ttbdn-border: #dbe4ef;
    --ttbdn-soft: #f5f8fc;
    color: var(--ttbdn-text);
}

.ttbdn-page,
.ttbdn-page * { box-sizing: border-box; }

.ttbdn-page {
    max-width: 1040px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.7;
}

.ttbdn-intro {
    max-width: 900px;
    margin: 0 0 18px;
    color: #40506a;
}

.ttbdn-calculator {
    overflow: hidden;
    border: 1px solid #cad9ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(31, 65, 107, .08);
}

.ttbdn-tool-heading {
    padding: 20px 22px 17px;
    border-bottom: 1px solid var(--ttbdn-border);
    background: linear-gradient(135deg, #f1f7ff, #f9fbfe);
}

.ttbdn-tool-heading h2,
.ttbdn-results h3 {
    margin: 0 0 5px;
    color: #1f3151;
}

.ttbdn-tool-heading h2 { font-size: 22px; }
.ttbdn-tool-heading p { margin: 0; color: var(--ttbdn-muted); }
.ttbdn-form { padding: 20px 22px; }

.ttbdn-mode {
    min-width: 0;
    margin: 0 0 17px;
    padding: 0;
    border: 0;
}

.ttbdn-mode legend {
    margin-bottom: 8px;
    color: #34445e;
    font-size: 14px;
    font-weight: 700;
}

.ttbdn-mode-options {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.ttbdn-mode-options label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.ttbdn-mode-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.ttbdn-mode-options span {
    display: block;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--ttbdn-border);
    border-radius: 9px;
    background: #fff;
    color: #40506a;
    font-weight: 700;
}

.ttbdn-mode-options input:checked + span {
    border-color: var(--ttbdn-blue);
    background: #edf5ff;
    color: var(--ttbdn-blue-dark);
}

.ttbdn-mode-options input:focus-visible + span,
.ttbdn-form input:focus-visible,
.ttbdn-form textarea:focus-visible,
.ttbdn-actions button:focus-visible,
.ttbdn-related a:focus-visible,
.ttbdn-questions summary:focus-visible {
    outline: 3px solid rgba(24, 92, 169, .25);
    outline-offset: 2px;
}

.ttbdn-help {
    margin: 0 0 12px;
    color: var(--ttbdn-muted);
    font-size: 13.5px;
}

.ttbdn-month-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px 13px;
}

.ttbdn-month-grid label {
    min-width: 0;
    margin: 0;
    color: #3a4962;
    font-size: 13px;
    font-weight: 700;
}

.ttbdn-input-unit {
    display: flex;
    align-items: center;
    margin-top: 5px;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    background: #fff;
}

.ttbdn-input-unit:focus-within {
    border-color: var(--ttbdn-blue);
    box-shadow: 0 0 0 3px rgba(24, 92, 169, .12);
}

.ttbdn-input-unit input {
    width: 100%;
    min-width: 0;
    padding: 9px 4px 9px 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172943;
    font-size: 16px;
}

.ttbdn-input-unit > span {
    padding: 0 9px 0 4px;
    color: #6a7890;
    font-size: 14px;
    font-weight: 400;
}

.ttbdn-form [aria-invalid="true"] {
    box-shadow: 0 0 0 2px #c0392b;
}

#ttbdn-daily-panel > label {
    display: block;
    margin-bottom: 3px;
    color: #34445e;
}

#ttbdn-daily-values {
    display: block;
    width: 100%;
    min-height: 185px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid #cfd9e6;
    border-radius: 9px;
    background: #fff;
    color: #172943;
    font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ttbdn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.ttbdn-actions button {
    min-height: 44px;
    padding: 9px 15px;
    border: 1px solid #cbd7e5;
    border-radius: 8px;
    background: #fff;
    color: #334763;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.ttbdn-actions button:hover { background: #f4f7fb; }
.ttbdn-actions .ttbdn-primary { border-color: var(--ttbdn-blue); background: var(--ttbdn-blue); color: #fff; }
.ttbdn-actions .ttbdn-primary:hover { background: var(--ttbdn-blue-dark); }

.ttbdn-error,
.ttbdn-noscript {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-left: 4px solid #b52d2d;
    border-radius: 7px;
    background: #fff1f0;
    color: #862020;
}

.ttbdn-noscript { margin: 16px 22px 0; }
.ttbdn-results { padding: 18px 22px 20px; border-top: 1px solid var(--ttbdn-border); background: #f7faff; }
.ttbdn-results h3 { font-size: 18px; }

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

.ttbdn-result-grid > div {
    padding: 13px 14px;
    border: 1px solid #dce7f3;
    border-radius: 10px;
    background: #fff;
}

.ttbdn-result-grid span { display: block; color: var(--ttbdn-muted); font-size: 13px; }
.ttbdn-result-grid strong { display: block; margin-top: 2px; color: #173f73; font-size: 19px; line-height: 1.45; }
.ttbdn-result-note { margin: 11px 0 0; color: #4f6079; font-size: 13px; }

.ttbdn-explain,
.ttbdn-examples,
.ttbdn-questions {
    margin-top: 28px;
}

.ttbdn-explain > h2,
.ttbdn-examples > h2,
.ttbdn-questions > h2 {
    margin: 0 0 11px;
    color: #1f3151;
    font-size: 21px;
}

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

.ttbdn-formulas-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ttbdn-formulas > div,
.ttbdn-example-grid article {
    padding: 15px 16px;
    border: 1px solid #e0e8f1;
    border-radius: 11px;
    background: #fbfcfe;
}

.ttbdn-formulas h3,
.ttbdn-example-grid h3 {
    margin: 0 0 7px;
    color: #263d60;
    font-size: 16px;
}

.ttbdn-formulas p,
.ttbdn-example-grid p { margin: 0; }
.ttbdn-formulas p + p { margin-top: 8px; }
.ttbdn-equation { color: #174f91; font-size: 15px; font-weight: 700; }
.ttbdn-example-grid ul { margin: 9px 0 0; padding-left: 19px; }
.ttbdn-example-grid li { margin: 4px 0; }

.ttbdn-caution {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-left: 4px solid #d29217;
    border-radius: 7px;
    background: #fff9e9;
    color: #634c1c;
}

.ttbdn-questions details {
    margin: 8px 0;
    border: 1px solid #e0e8f1;
    border-radius: 9px;
    background: #fff;
}

.ttbdn-questions summary {
    padding: 11px 13px;
    color: #2a405f;
    cursor: pointer;
    font-weight: 700;
}

.ttbdn-questions details p { margin: 0; padding: 0 13px 13px; color: #4a5970; }

.ttbdn-related {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 25px;
    padding: 13px 14px;
    border: 1px solid #dfe7f2;
    border-radius: 10px;
    background: #f8faff;
}

.ttbdn-related strong { margin-right: 2px; color: #34445e; }
.ttbdn-related a { padding: 5px 10px; border: 1px solid #cfe0f6; border-radius: 999px; background: #fff; color: #174f91; font-weight: 700; text-decoration: none; }
.ttbdn-related a:hover { border-color: #8db4ea; background: #eef5ff; text-decoration: underline; }
.ttbdn-page [hidden] { display: none !important; }

@media (max-width: 820px) {
    .ttbdn-month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ttbdn-formulas-three { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .ttbdn-tool-heading,
    .ttbdn-form,
    .ttbdn-results { padding-left: 14px; padding-right: 14px; }
    .ttbdn-noscript { margin-left: 14px; margin-right: 14px; }
    .ttbdn-tool-heading h2 { font-size: 19px; }
    .ttbdn-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ttbdn-result-grid,
    .ttbdn-formulas,
    .ttbdn-example-grid { grid-template-columns: 1fr; }
    .ttbdn-mode-options { display: grid; grid-template-columns: 1fr; }
    .ttbdn-mode-options label { width: 100%; }
    .ttbdn-actions { display: grid; grid-template-columns: 1fr; }
    .ttbdn-actions button { width: 100%; }
    .ttbdn-explain > h2,
    .ttbdn-examples > h2,
    .ttbdn-questions > h2 { font-size: 19px; }
}
