/* Input buttons keep Android's numeric keyboard while giving users a minus key. */
.number-field { position: relative; min-width: 0; }
.number-field .form-control { padding-right: 49px; }
.sign-toggle {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
    display: grid; place-items: center; width: 38px; height: 37px;
    padding: 0; border: 1px solid transparent; border-radius: 8px;
    background: #eceefa; color: #4f46e5; font-family: inherit; font-size: 21px; font-weight: 700; line-height: 1;
    cursor: pointer; touch-action: manipulation;
}
.sign-toggle:hover { background: #e0e2fa; }
.sign-toggle:focus-visible { outline: 3px solid rgba(79,70,229,.35); outline-offset: 1px; }
.input-error { color: #b91c1c; font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
.input-error:empty { display: none; }
.print-report-btn {
    display: inline-flex; justify-content: center; align-items: center; gap: 9px;
    width: 100%; min-height: 46px; margin-top: 20px;
    border: 1px solid #d9def0; border-radius: 10px;
    background: transparent; color: var(--ink); font: inherit;
    font-size: 14px; font-weight: 700; cursor: pointer;
}
.print-report-btn:hover { border-color: var(--accent); color: var(--accent); }
.print-report-btn:focus-visible { outline: 3px solid rgba(79,70,229,.25); }
.print-report-btn[hidden] { display: none !important; }
.print-report { display: none; }
.app-toolbar { flex-wrap: wrap; justify-content: flex-start; gap: 9px; }
.app-toolbar .eyebrow { flex: 1; }
.language-control {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    height: 38px; padding: 0 7px 0 10px;
    border: 1px solid #dce3ed; border-radius: 10px;
    background: var(--surface); color: var(--ink);
}
.language-control select {
    border: none; background: transparent; color: inherit; font: inherit;
    font-size: 12px; font-weight: 650; outline: none; cursor: pointer;
}
.language-control select option { color: var(--ink); background: var(--surface); }
.language-control:focus-within { outline: 3px solid rgba(79,70,229,.2); outline-offset: 2px; }
html[data-theme="dark"] .language-control { border-color: #35445b; }
html[data-theme="dark"] .sign-toggle { color: #c9c2ff; background: #303956; }
html[data-theme="dark"] .sign-toggle:hover { background: #424967; }
html[data-theme="dark"] .input-error { color: #fca5a5; }
html[data-theme="dark"] .print-report-btn { border-color: #35445b; }
@media (max-width: 700px) {
    .app-toolbar .eyebrow { flex-basis: 100%; }
    .app-toolbar { justify-content: flex-end; }
    .language-control { min-width: 112px; }
    .app-header h1 { margin-top: 16px; }
}
@media (max-width: 420px) {
    .number-field .form-control { padding-left: 10px; padding-right: 43px; }
    .sign-toggle { right: 3px; width: 35px; height: 35px; }
}

/* Keep the guide header stable on narrow phones and with longer translations. */
.guide-header .app-toolbar {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    justify-content: initial;
    gap: 9px;
}
.guide-header .breadcrumb-link { min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.guide-header .language-control, .guide-header .theme-control { min-width: 0; }
.guide-header .theme-control select { max-width: 116px; }
@media (max-width: 720px) {
    .guide-header .app-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
    .guide-header .breadcrumb-link { grid-column: 1 / -1; justify-self: start; padding-bottom: 3px; }
    .guide-header .language-control { grid-column: 1; justify-self: end; }
    .guide-header .theme-control { grid-column: 2; justify-self: end; }
}
@media (max-width: 420px) {
    .guide-header .language-control { height: 36px; }
    .guide-header .theme-control { height: 36px; }
}
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.result-actions .print-report-btn, .result-actions .share-view-btn { margin: 0; flex: 1 1 180px; }
.share-view-btn {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px;
    min-height: 46px; padding: 10px 13px; text-align: center;
    border: 1px solid #b6b0f0; border-radius: 10px;
    background: #f1f0ff; color: #4036bd; font-size: 14px; font-weight: 700;
    text-decoration: none;
}
.share-view-btn:hover { background: #eae8ff; color: #3327b9; }
.share-view-btn[hidden] { display: none !important; }
html[data-theme="dark"] .share-view-btn { background: #29274f; border-color: #5a53a4; color: #d4d0ff; }
html[data-theme="dark"] .share-view-btn:hover { background: #373265; }
