/* Shared tools theme; page styles only define tool-specific layout. */
.tool-navigation,
.tool-shell-page,
.tool-2fa-page,
.uid-tool-page,
section.profile-part:has(.tool-navigation) {
    --tool-heading: var(--content-title, #243a5e);
    --tool-muted: var(--soft-muted, #64748b);
    --tool-surface: var(--soft-surface, #e7ecf3);
    --tool-field: var(--tool-surface);
    --tool-border: color-mix(in srgb, var(--tool-heading) 18%, transparent);
    --tool-accent-soft: color-mix(in srgb, var(--primary) 7%, var(--tool-surface));
    --tool-accent-border: color-mix(in srgb, var(--primary) 35%, var(--tool-border));
    --tool-success: var(--content-price, #0f766e);
    --tool-radius: 12px;
    --tool-gap: 10px;
    --tool-padding: 18px;
    /* Do not inherit raised/neumorphic effects inside tools. */
    --soft-shadow: none;
    --soft-shadow-sm: none;
    --soft-inset: none;
}

:is(.tool-shell-page, .tool-2fa-page, .uid-tool-page, section.profile-part:has(.tool-navigation)) {
    padding-top: 0 !important;
    padding-bottom: 24px !important;
}

:is(.tool-shell-page, .tool-2fa-page, .uid-tool-page, section.profile-part:has(.tool-navigation)) > .container {
    max-width: 1320px;
}

:is(.tool-shell-page, .tool-2fa-page, .uid-tool-page, section.profile-part:has(.tool-navigation)) :is(button, a, input, textarea, select):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.tool-navigation {
    --tool-nav-background: var(--primary, #1677ff);
    --tool-nav-text: #fff;
    width: 100%;
    padding: 0;
}
/* Direct row children need the same gutters as adjacent Bootstrap columns. */
.row > .tool-navigation {
    padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}
.tool-navigation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--tool-gap);
    margin-bottom: var(--tool-gap);
}
.tool-navigation-card {
    display: flex;
    min-width: 0;
    min-height: 50px;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border: 1px solid var(--tool-nav-background);
    border-radius: var(--tool-radius);
    color: var(--tool-nav-text);
    background: var(--tool-nav-background);
    box-shadow: none;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}
.tool-navigation-card:hover,
.tool-navigation-card:focus-visible,
.tool-navigation-card.is-active {
    border-color: color-mix(in srgb, var(--tool-nav-text) 70%, var(--tool-nav-background));
    color: var(--tool-nav-text);
    background: var(--tool-nav-background);
}
.tool-navigation-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.tool-navigation-icon {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 8px;
    color: var(--tool-nav-background);
    background: var(--tool-nav-text);
}
.tool-navigation-icon img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.tool-navigation-icon i { font-size: 22px; }
.tool-navigation-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}
.tool-navigation-copy strong,
.tool-navigation-copy small {
    display: block;
    margin: 0;
    line-height: 1.35;
}
.tool-navigation-copy strong {
    color: var(--tool-nav-text);
    font-size: 13px;
    font-weight: 700;
}
.tool-navigation-copy small { color: var(--tool-nav-text); font-size: 11px; }

/* One compact title bar; legacy Outlook selectors are scoped to tools only. */
.tool-shell-hero,
.twofa-hero,
.uid-tool-hero,
section.profile-part:has(.tool-navigation) .posterd.home {
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 12px;
    margin: 0 0 var(--tool-gap) !important;
    padding: 10px 16px;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    background: var(--tool-surface) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none;
}
:is(.tool-shell-hero, .twofa-hero, .uid-tool-hero)::before,
:is(.tool-shell-hero, .twofa-hero, .uid-tool-hero)::after,
section.profile-part:has(.tool-navigation) .posterd.home::before,
section.profile-part:has(.tool-navigation) .posterd.home::after {
    display: none;
    content: none;
}
.tool-shell-hero-icon,
.twofa-hero-icon,
.uid-tool-hero-icon,
section.profile-part:has(.tool-navigation) .posterd.home .box-intro {
    display: inline-grid;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    margin: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 10px;
    color: var(--primary);
    background: var(--tool-accent-soft);
    box-shadow: none !important;
    font-size: 21px;
}
section.profile-part:has(.tool-navigation) .posterd.home .welcomto {
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}
section.profile-part:has(.tool-navigation) .posterd.home .box-intro img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
section.profile-part:has(.tool-navigation) .posterd.home .box-intro i {
    color: var(--primary) !important;
    font-size: 21px !important;
}
.tool-shell-eyebrow,
.twofa-kicker,
.uid-tool-kicker {
    display: block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.09em;
}
.tool-shell-hero .tool-shell-eyebrow,
.twofa-eyebrow,
.uid-tool-eyebrow,
section.profile-part:has(.tool-navigation) .posterd.home .welcomto > div:last-child > div {
    display: none;
}
.tool-shell-copy,
.twofa-hero-copy,
.uid-tool-hero-copy,
section.profile-part:has(.tool-navigation) .posterd.home .welcomto > div:last-child {
    min-width: 0;
}
:is(.tool-shell-copy, .twofa-hero-copy, .uid-tool-hero-copy) h1,
section.profile-part:has(.tool-navigation) .posterd.home h1 {
    margin: 0 !important;
    color: var(--tool-heading) !important;
    font-family: inherit !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.25;
    text-shadow: none !important;
}
:is(.tool-shell-copy, .twofa-hero-copy, .uid-tool-hero-copy) p {
    margin: 3px 0 0;
    color: var(--tool-muted);
    font-size: 13px;
    line-height: 1.4;
}
.tool-shell-badge,
.twofa-local-badge,
.uid-tool-local-badge,
.twofa-status-pill,
.uid-run-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-left: auto;
    padding: 5px 9px;
    border: 1px solid var(--tool-accent-border);
    border-radius: 999px;
    color: var(--primary);
    background: var(--tool-accent-soft);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.tool-shell-content,
.twofa-guide,
.twofa-workspace,
.uid-checker,
section.profile-part:has(.tool-navigation) .outlook-tool-card {
    min-width: 0;
    padding: var(--tool-padding);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    background: var(--tool-surface);
    box-shadow: none;
}
.tool-shell-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.tool-shell-content-head h2,
.twofa-guide h2,
.twofa-workspace h2,
.uid-checker-head h2 {
    margin: 2px 0 3px;
    color: var(--tool-heading);
    font-size: 18px;
    line-height: 1.3;
}
.tool-shell-content-head p {
    margin: 4px 0 0;
    color: var(--tool-muted);
    font-size: 13px;
    line-height: 1.5;
}
.twofa-input-wrap,
.uid-textarea-wrap {
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    background: var(--tool-field);
    box-shadow: none;
    transition: border-color 0.18s ease;
}
.twofa-input-wrap:focus-within,
.uid-textarea-wrap:focus-within {
    border-color: var(--primary);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
:is(.tool-shell-page, .tool-2fa-page, .uid-tool-page, section.profile-part:has(.tool-navigation)) :is(.twofa-input-wrap input, .uid-textarea-wrap textarea):focus-visible {
    outline: none;
}
/* Beat the global dark form rules without changing forms outside tools. */
section.profile-part:has(.tool-navigation) :is(.twofa-input-wrap input, .uid-textarea-wrap textarea, .uid-result-panel textarea) {
    color: var(--tool-heading) !important;
    background: transparent !important;
    box-shadow: none !important;
}
.twofa-generate,
.uid-start-button,
section.profile-part:has(.tool-navigation) .outlook-start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--tool-radius);
    color: #fff;
    background: linear-gradient(100deg, var(--primary), var(--primary1));
    box-shadow: none;
    font-size: 14px;
    font-weight: 700;
}
.twofa-generate:hover,
.uid-start-button:hover,
section.profile-part:has(.tool-navigation) .outlook-start-button:hover {
    color: #fff;
    border-color: var(--tool-heading);
}
.twofa-generate:disabled,
.uid-start-button:disabled,
section.profile-part:has(.tool-navigation) .outlook-start-button:disabled {
    cursor: wait;
    opacity: 0.7;
}
.twofa-status-pill > span,
.uid-run-status > span:first-child {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tool-success);
}
.twofa-privacy-note,
.uid-privacy-note,
section.profile-part:has(.tool-navigation) .outlook-privacy-note {
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    background: var(--tool-surface);
}
.twofa-privacy-note > i,
.uid-privacy-note > i,
.twofa-copy-hint.is-success {
    color: var(--tool-success);
}

/* Compatibility with the separately installed Outlook module. */
section.profile-part:has(.outlook-tool-card) > .container > .row > .mb-4:empty {
    display: none;
}
section.profile-part:has(.tool-navigation) .outlook-input {
    height: 180px !important;
    min-height: 140px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    color: var(--tool-heading);
    background: var(--tool-field) !important;
    box-shadow: none !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 13px;
    line-height: 1.65;
}
section.profile-part:has(.tool-navigation) :is(.outlook-privacy-note, .outlook-start-button) {
    margin-top: 12px !important;
}
section.profile-part:has(.tool-navigation) .outlook-privacy-note {
    padding: 10px 12px;
    color: var(--tool-muted);
    font-size: 13px;
}
section.profile-part:has(.tool-navigation) .outlook-toolbar .badge {
    border: 1px solid var(--tool-accent-border);
    color: var(--primary) !important;
    background: var(--tool-accent-soft) !important;
}
section.profile-part:has(.tool-navigation) :is(.outlook-account, .outlook-message, .outlook-message-body) {
    border-color: var(--tool-border);
    border-radius: var(--tool-radius);
    color: var(--tool-heading);
    background: var(--tool-surface);
    box-shadow: none;
}
section.profile-part:has(.tool-navigation) .outlook-message-meta,
section.profile-part:has(.tool-navigation) .form-text {
    color: var(--tool-muted);
    opacity: 1;
}
.tool-icon-frame {
    overflow: hidden;
    min-height: 620px;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    background: var(--tool-field);
}
.tool-icon-frame iframe {
    display: block;
    width: 100%;
    min-height: 620px;
    border: 0 !important;
}

@media (max-width: 991px) {
    .tool-navigation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-shell-badge,
    .twofa-local-badge,
    .uid-tool-local-badge { display: none; }
}
@media (max-width: 767px) {
    .tool-shell-page,
    .tool-2fa-page,
    .uid-tool-page,
    section.profile-part:has(.tool-navigation) {
        --tool-padding: 14px;
        padding-top: 0 !important;
    }
    .tool-navigation-grid {
        grid-template-columns: none;
        grid-auto-columns: minmax(220px, 72vw);
        grid-auto-flow: column;
        gap: 8px;
        padding: 2px 2px 6px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }
    .tool-navigation-card { scroll-snap-align: start; }
    .tool-shell-hero,
    .twofa-hero,
    .uid-tool-hero,
    section.profile-part:has(.tool-navigation) .posterd.home {
        min-height: 62px;
        gap: 10px;
        padding: 10px 12px;
    }
    :is(.tool-shell-copy, .twofa-hero-copy, .uid-tool-hero-copy) h1,
    section.profile-part:has(.tool-navigation) .posterd.home h1 {
        font-size: 18px !important;
    }
    .twofa-status-pill,
    .uid-run-status { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .tool-navigation *,
    :is(.tool-shell-page, .tool-2fa-page, .uid-tool-page, section.profile-part:has(.tool-navigation)) * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
