/* SoftTech shell layout v1
   Shared visual system for the home shell and every tool page.
   Loaded after style.min.css. Does not change behavior or markup hooks. */

:root {
    --shell-accent: #2563eb;
    --shell-accent-deep: #1d4ed8;
    --shell-cyan: #0ea5e9;
    --shell-line: rgba(226, 232, 240, 0.92);
    --shell-text: #0f172a;
    --shell-muted: #64748b;
    --shell-card: rgba(255, 255, 255, 0.94);
    --shell-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    --shell-nav-h: 4rem;
}

.dark {
    --shell-line: rgba(51, 65, 85, 0.88);
    --shell-text: #e2e8f0;
    --shell-muted: #94a3b8;
    --shell-card: rgba(15, 23, 42, 0.92);
    --shell-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

body {
    overflow-x: clip;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--shell-accent);
    outline-offset: 2px;
}

/* ---------- Home top bar ---------- */
body.home-page .home-topbar {
    border-bottom: 1px solid var(--shell-line);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.home-topbar-inner {
    min-height: var(--shell-nav-h);
}

.home-topbar-logo,
body:not(.home-page) > nav.site-tool-nav .softtech-brand-logo-mark {
    background: linear-gradient(145deg, var(--shell-cyan), var(--shell-accent) 58%, var(--shell-accent-deep));
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.home-topbar-link,
.home-sidebar-link {
    border-radius: 0.7rem;
}

.home-topbar-link.is-active,
.home-topbar-link[aria-current="true"],
.home-sidebar-link.active,
.home-sidebar-link[aria-current="page"] {
    color: var(--shell-accent);
    background: rgba(37, 99, 235, 0.1);
}

.dark .home-topbar-link.is-active,
.dark .home-sidebar-link.active {
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.18);
}

.home-topbar-action,
.home-topbar-auth-btn {
    min-width: 2.4rem;
    min-height: 2.4rem;
    border-radius: 0.75rem;
}

.home-topbar-action:hover,
.home-topbar-auth-btn:hover {
    background: rgba(37, 99, 235, 0.08);
}

.home-sidebar-panel {
    border: 1px solid var(--shell-line);
    border-radius: 1.1rem;
    box-shadow: var(--shell-shadow);
}

.home-sidebar-link {
    min-height: 2.6rem;
    padding: 0.45rem 0.65rem;
}

.home-bottom-nav {
    border-top: 1px solid var(--shell-line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
}

.dark .home-bottom-nav {
    background: rgba(2, 6, 23, 0.92);
}

.home-bottom-nav-item {
    min-height: 2.75rem;
    border-radius: 0.8rem;
}

.home-bottom-nav-item.active {
    color: var(--shell-accent);
    background: rgba(37, 99, 235, 0.1);
}

.home-dashboard-main,
.home-dashboard-content {
    min-width: 0;
}

/* ---------- Tool page navigation ---------- */
body:not(.home-page) > nav.site-tool-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--shell-line);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
    backdrop-filter: blur(18px) saturate(1.2);
}

.dark body:not(.home-page) > nav.site-tool-nav {
    background: rgba(2, 6, 23, 0.88);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

body:not(.home-page) > nav.site-tool-nav .max-w-7xl > .flex {
    min-height: var(--shell-nav-h);
    gap: 0.75rem;
}

body:not(.home-page) > nav.site-tool-nav a,
body:not(.home-page) > nav.site-tool-nav button {
    border-radius: 0.75rem;
}

body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex a:hover,
body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex button:hover {
    color: var(--shell-accent);
}

body:not(.home-page) #app {
    min-width: 0;
}

#toolView {
    min-width: 0;
}

#toolView > .max-w-7xl,
#toolView .max-w-7xl {
    width: 100%;
}

/* ---------- Tool page structure ---------- */
.tool-page-hero {
    border-color: var(--shell-line);
    box-shadow: var(--shell-shadow);
}

.tool-page-kicker {
    color: var(--shell-accent);
    letter-spacing: 0.04em;
}

.tool-page-hero-title {
    letter-spacing: -0.02em;
    color: var(--shell-text);
}

.tool-page-hero-desc,
.tool-section-title + p,
.tool-label {
    color: var(--shell-muted);
}

.tool-page-nav {
    gap: 0.6rem;
}

.tool-page-nav-btn {
    min-height: 2.5rem;
}

.tool-page-nav-btn:hover {
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--shell-accent-deep);
}

.tool-page-capability-panel,
.tool-card {
    border: 1px solid var(--shell-line);
    border-radius: 1rem;
    background: var(--shell-card);
    box-shadow: var(--shell-shadow);
}

.tool-card {
    min-width: 0;
    padding: 1rem;
}

.tool-section-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.75rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.tool-section-title::before {
    content: "";
    width: 0.28rem;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--shell-cyan), var(--shell-accent));
    flex: 0 0 auto;
}

.tool-textarea,
input.tool-input,
textarea.tool-input {
    width: 100%;
    max-width: 100%;
}

select.tool-input {
    width: 100%;
    max-width: 100%;
}

.flex select.tool-input,
label select.tool-input {
    width: auto;
    min-width: 4.75rem;
    flex: 0 1 auto;
}

.tool-input,
.tool-textarea {
    border-radius: 0.8rem;
    border: 1px solid var(--shell-line);
    background: rgba(255, 255, 255, 0.96);
    color: var(--shell-text);
}

.dark .tool-input,
.dark .tool-textarea {
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
}

.tool-input:focus,
.tool-textarea:focus,
.tool-card input:focus,
.tool-card select:focus,
.tool-card textarea:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.tool-btn,
.tool-card .btn,
.tool-mobile-action-stack > button,
.tool-mobile-action-stack > a {
    min-height: 2.5rem;
    border-radius: 0.8rem;
}

.tool-btn-primary {
    background: linear-gradient(180deg, #3b82f6, var(--shell-accent-deep));
}

.tool-mobile-scroll-row,
.tool-page-capability-grid,
.tool-mobile-table-wrap,
pre,
code {
    max-width: 100%;
}

.tool-mobile-table-wrap,
.tool-card pre,
.tool-card table {
    overflow-x: auto;
}

.softtech-auth-card {
    width: min(100%, 27rem);
    border: 1px solid var(--shell-line);
    border-radius: 1.15rem;
    box-shadow: var(--shell-shadow);
}

.softtech-auth-submit {
    width: 100%;
    min-height: 2.75rem;
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
    :root {
        --shell-nav-h: 3.5rem;
    }

    .home-topbar-inner {
        height: auto;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        gap: 0.4rem;
    }

    .home-topbar-subtitle,
    .home-layout-toggle-label,
    body.home-page #widthToggleLabel,
    .home-topbar-divider {
        display: none;
    }

    .home-topbar-actions {
        gap: 0.2rem;
    }

    .home-topbar-logo {
        width: 2.05rem;
        height: 2.05rem;
    }

    .home-dashboard-main {
        padding: 0.7rem 0.7rem calc(5.4rem + env(safe-area-inset-bottom));
    }

    .home-sidebar-panel {
        border-radius: 0.95rem;
    }

    body:not(.home-page) > nav.site-tool-nav .max-w-7xl {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    body:not(.home-page) > nav.site-tool-nav .max-w-7xl > .flex {
        height: auto;
        align-items: center;
    }

    body:not(.home-page) > nav.site-tool-nav .gap-6 {
        gap: 0.25rem;
    }

    body:not(.home-page) > nav.site-tool-nav .text-\[10px\],
    body:not(.home-page) > nav.site-tool-nav #widthToggleLabel,
    body:not(.home-page) > nav.site-tool-nav .h-6.w-px {
        display: none;
    }

    body:not(.home-page) > nav.site-tool-nav .softtech-brand-logo-mark {
        width: 2rem;
        height: 2rem;
        border-radius: 0.65rem;
    }

    body:not(.home-page) > nav.site-tool-nav .text-lg.font-black {
        font-size: 0.95rem;
    }

    body:not(.home-page) #app.pt-16,
    body:not(.home-page) #app {
        padding-top: 3.7rem;
    }

    #toolView > .max-w-7xl {
        padding-top: 0.85rem;
        padding-bottom: calc(1.4rem + env(safe-area-inset-bottom));
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .tool-page-hero {
        margin-bottom: 0.8rem;
        padding: 0.8rem;
        border-radius: 1rem;
    }

    .tool-page-hero-grid,
    .tool-page-capability-grid,
    .tool-page-hero-main {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.7rem;
        min-width: 0;
    }

    .tool-page-hero-title {
        font-size: 1.35rem;
        line-height: 1.25;
    }

    .tool-page-hero-desc {
        font-size: 0.86rem;
        line-height: 1.55;
    }

    .tool-page-nav-back,
    .tool-page-nav-actions {
        flex: 1 1 auto;
    }

    .tool-page-capability-chip {
        min-height: 2rem;
    }

    .tool-card {
        padding: 0.85rem;
        border-radius: 0.95rem;
    }

    .tool-mobile-action-stack {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .tool-mobile-action-stack > .tool-btn-primary:first-child,
    .tool-mobile-action-stack > :only-child {
        grid-column: 1 / -1;
    }

    .tool-mobile-action-stack > * {
        width: 100%;
        min-width: 0;
        min-height: 2.75rem;
        justify-content: center;
    }

    .tool-textarea {
        height: 14rem !important;
        min-height: 10rem;
    }

    select.tool-input {
        width: 100%;
    }

    .home-tools-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .home-section-head {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .site-footer-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    body:not(.home-page) .site-footer-shell {
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
    }

    .tool-mobile-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .tool-input,
    .tool-textarea,
    .tool-card input,
    .tool-card select,
    .tool-card textarea,
    .softtech-auth-input {
        font-size: 16px;
    }

    .tool-btn,
    .tool-btn-primary,
    .tool-btn-ghost,
    .softtech-auth-submit {
        min-height: 2.75rem;
    }
}

@media (max-width: 380px) {
    .home-topbar-title,
    body:not(.home-page) > nav.site-tool-nav .tracking-tight {
        max-width: 7.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tool-mobile-stat-grid {
        grid-template-columns: 1fr;
    }

    body:not(.home-page) > nav.site-tool-nav #widthToggle {
        display: none;
    }
}

/* ---------- Shared frontend navigation polish v1.9 ---------- */
body:not(.home-page) > nav.site-tool-nav {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.065) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
}

.dark body:not(.home-page) > nav.site-tool-nav {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.76)) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3) !important;
}

body:not(.home-page) > nav.site-tool-nav::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.24), rgba(37, 99, 235, 0.52), rgba(14, 165, 233, 0.16));
    pointer-events: none;
    opacity: 0.92;
}

body:not(.home-page) > nav.site-tool-nav .max-w-7xl > .flex,
body:not(.home-page) > nav.site-tool-nav .max-w-6xl > .flex {
    gap: 0.85rem;
}

body:not(.home-page) > nav.site-tool-nav .flex.items-center.gap-3.cursor-pointer {
    align-items: center;
    gap: 0.72rem;
    transition: transform 180ms ease;
}

body:not(.home-page) > nav.site-tool-nav .flex.items-center.gap-3.cursor-pointer:hover {
    transform: translateY(-1px);
}

body:not(.home-page) > nav.site-tool-nav .tracking-tight {
    color: var(--shell-text);
    letter-spacing: -0.02em;
}

body:not(.home-page) > nav.site-tool-nav .flex.items-center.gap-6 {
    gap: 0.45rem;
}

body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex {
    padding: 0.28rem;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dark body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex {
    border-color: rgba(51, 65, 85, 0.72);
    background: rgba(15, 23, 42, 0.62);
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.12);
}

body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex a,
body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.34rem 0.86rem;
    border-radius: 999px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dark body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex a,
.dark body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex button {
    color: #cbd5e1;
}

body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex a:hover,
body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex button:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--shell-accent-deep);
    transform: translateY(-1px);
}

.dark body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex a:hover,
.dark body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex button:hover {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

body:not(.home-page) > nav.site-tool-nav .h-6.w-px {
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.55), transparent) !important;
    opacity: 1 !important;
}

body:not(.home-page) > nav.site-tool-nav #langToggle {
    min-height: 2.35rem;
    padding: 0 0.62rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    font-size: 0.82rem;
}

.dark body:not(.home-page) > nav.site-tool-nav #langToggle {
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
}

body:not(.home-page) > nav.site-tool-nav #widthToggle,
body:not(.home-page) > nav.site-tool-nav #themeToggle,
body:not(.home-page) > nav.site-tool-nav #userAuthBtn {
    min-height: 2.45rem;
    min-width: 2.45rem;
    border-radius: 0.82rem;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

body:not(.home-page) > nav.site-tool-nav #widthToggle:hover,
body:not(.home-page) > nav.site-tool-nav #themeToggle:hover,
body:not(.home-page) > nav.site-tool-nav #userAuthBtn:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--shell-accent-deep);
    transform: translateY(-1px);
}

.dark body:not(.home-page) > nav.site-tool-nav #widthToggle:hover,
.dark body:not(.home-page) > nav.site-tool-nav #themeToggle:hover,
.dark body:not(.home-page) > nav.site-tool-nav #userAuthBtn:hover {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

@media (max-width: 760px) {
    body:not(.home-page) > nav.site-tool-nav .max-w-7xl > .flex,
    body:not(.home-page) > nav.site-tool-nav .max-w-6xl > .flex {
        gap: 0.45rem;
    }

    body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex {
        padding: 0.22rem;
    }

    body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex a,
    body:not(.home-page) > nav.site-tool-nav .hidden.md\:flex button {
        min-height: 2rem;
        padding: 0.26rem 0.72rem;
        font-size: 0.85rem;
    }

    body:not(.home-page) > nav.site-tool-nav #widthToggle,
    body:not(.home-page) > nav.site-tool-nav #themeToggle,
    body:not(.home-page) > nav.site-tool-nav #userAuthBtn {
        min-height: 2.35rem;
        min-width: 2.35rem;
    }
}

@media (max-width: 1100px) {
    .home-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .home-tools-grid {
        grid-template-columns: 1fr;
    }
}

.home-tool-card {
    min-width: 0;
    border-radius: 1rem;
    border: 1px solid var(--shell-line);
    box-shadow: var(--shell-shadow);
}

.shell-menu-btn,
.shell-sheet-close,
.shell-sheet-about {
    border: 1px solid var(--shell-line);
    background: var(--shell-card);
    color: var(--shell-text);
    border-radius: 0.75rem;
    min-height: 2.4rem;
    font-weight: 700;
}

.shell-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    font-size: 0.78rem;
}

.shell-sheet-search {
    width: 100%;
    min-height: 2.75rem;
    margin-top: 0.7rem;
    padding: 0 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid var(--shell-line);
    background: transparent;
    color: var(--shell-text);
    font: inherit;
}

.shell-sheet-results a,
.shell-continue a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-height: 2.7rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.8rem;
    color: var(--shell-text);
    text-decoration: none;
}

.shell-sheet-results small,
.shell-sheet-empty {
    color: var(--shell-muted);
    font-size: 0.75rem;
}

.shell-continue {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    padding: 0.45rem;
    border: 1px solid var(--shell-line);
    border-radius: 1rem;
    background: var(--shell-card);
}

.shell-continue > span {
    padding: 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--shell-accent);
}

.shell-continue a {
    min-height: 2.2rem;
    background: rgba(37, 99, 235, 0.08);
}

.shell-related {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 1.1rem;
}

.shell-related h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.shell-related a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--shell-line);
    border-radius: 0.85rem;
    background: var(--shell-card);
    color: var(--shell-text);
    text-decoration: none;
}

.shell-pin-btn[aria-pressed="true"] {
    color: var(--shell-accent-deep);
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.1);
}

.shell-related a:hover {
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--shell-accent-deep);
}

.shell-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.shell-sheet[hidden] {
    display: none;
}

.shell-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.46);
}

.shell-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78vh, 640px);
    overflow: auto;
    padding: 0.85rem 0.85rem calc(0.9rem + env(safe-area-inset-bottom));
    border-radius: 1.15rem 1.15rem 0 0;
    background: var(--shell-card);
    box-shadow: var(--shell-shadow);
}

.shell-sheet-head,
.shell-sheet-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.shell-sheet-group {
    display: grid;
    margin-top: 0.8rem;
}

.shell-sheet-group p {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--shell-muted);
}

.shell-sheet-group a,
.shell-sheet-about {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.8rem;
    text-decoration: none;
    color: var(--shell-text);
}

.shell-sheet-group a:hover,
.shell-sheet-about:hover {
    background: rgba(37, 99, 235, 0.08);
}

.shell-sheet-about {
    width: 100%;
    margin-top: 0.8rem;
    justify-content: center;
}

body.shell-sheet-open {
    overflow: hidden;
}

.shell-sticky-action {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 45;
}

.shell-sticky-action .tool-btn {
    width: 100%;
    min-height: 2.9rem;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

body.has-shell-sticky-action {
    padding-bottom: 4.6rem;
}

@media (max-width: 760px) {
    .shell-continue {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .shell-continue > span {
        grid-column: 1 / -1;
    }

    .shell-related {
        grid-template-columns: 1fr 1fr;
    }
}

.home-tool-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.home-section-title {
    letter-spacing: -0.03em;
}

.home-section-desc {
    color: var(--shell-muted);
    line-height: 1.55;
}

.site-footer-shell {
    border-top: 1px solid var(--shell-line);
}

.site-footer-brand-logo {
    background: linear-gradient(145deg, var(--shell-cyan), var(--shell-accent) 58%, var(--shell-accent-deep));
    color: #fff;
}

.md-workspace,
.tool-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.md-workspace > .grid,
.tool-workspace > .grid {
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .home-topbar,
    .home-sidebar-link,
    .tool-page-nav-btn,
    .tool-card,
    .tool-btn {
        transition: none;
    }
}

/* Brand mark: the uploaded icon already has its own shape. */
.home-topbar-logo.has-logo-image,
.site-footer-brand-logo.has-logo-image,
.tool-topbar-logo.has-logo-image {
    padding: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
}

/* ---------- Home navbar polish ---------- */
body.home-page:not(.tool-shell-page) .home-topbar {
    border-bottom: 1px solid rgba(203, 213, 225, 0.72) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
}

.dark body.home-page:not(.tool-shell-page) .home-topbar {
    border-bottom-color: rgba(51, 65, 85, 0.9) !important;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.74)) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

body.home-page:not(.tool-shell-page) .home-topbar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.28), rgba(37, 99, 235, 0.58), rgba(14, 165, 233, 0.18));
    pointer-events: none;
    opacity: 0.95;
}

body.home-page:not(.tool-shell-page) .home-topbar-inner {
    align-items: center;
    gap: 0.85rem;
}

body.home-page:not(.tool-shell-page) .home-topbar-brand {
    align-items: center;
    gap: 0.72rem;
    transition: transform 180ms ease;
}

body.home-page:not(.tool-shell-page) .home-topbar-brand:hover {
    transform: translateY(-1px);
}

body.home-page:not(.tool-shell-page) .home-topbar-title {
    color: var(--shell-text);
    letter-spacing: -0.02em;
}

body.home-page:not(.tool-shell-page) .home-topbar-subtitle {
    color: var(--shell-muted);
}

body.home-page:not(.tool-shell-page) .home-topbar-nav {
    padding: 0.28rem;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dark body.home-page:not(.tool-shell-page) .home-topbar-nav {
    border-color: rgba(51, 65, 85, 0.72);
    background: rgba(15, 23, 42, 0.62);
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.12);
}

body.home-page:not(.tool-shell-page) .home-topbar-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.34rem 0.86rem;
    border-radius: 999px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.home-page:not(.tool-shell-page) .home-topbar-link:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--shell-text);
    transform: translateY(-1px);
}

body.home-page:not(.tool-shell-page) .home-topbar-link.is-active,
body.home-page:not(.tool-shell-page) .home-topbar-link.active,
body.home-page:not(.tool-shell-page) .home-topbar-link[aria-current="true"] {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(14, 165, 233, 0.12));
    color: var(--shell-accent-deep);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.dark body.home-page:not(.tool-shell-page) .home-topbar-link {
    color: #cbd5e1;
}

.dark body.home-page:not(.tool-shell-page) .home-topbar-link:hover {
    color: #f8fafc;
    background: rgba(37, 99, 235, 0.18);
}

.dark body.home-page:not(.tool-shell-page) .home-topbar-link.is-active,
.dark body.home-page:not(.tool-shell-page) .home-topbar-link.active,
.dark body.home-page:not(.tool-shell-page) .home-topbar-link[aria-current="true"] {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(14, 165, 233, 0.18));
    color: #bfdbfe;
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.16);
}

body.home-page:not(.tool-shell-page) .home-topbar-link::after {
    content: none !important;
}

body.home-page:not(.tool-shell-page) .home-topbar-action,
body.home-page:not(.tool-shell-page) .home-topbar-auth-btn,
body.home-page:not(.tool-shell-page) .home-topbar-layout {
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

body.home-page:not(.tool-shell-page) .home-topbar-action:hover,
body.home-page:not(.tool-shell-page) .home-topbar-auth-btn:hover,
body.home-page:not(.tool-shell-page) .home-topbar-layout:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.26) !important;
    color: var(--shell-accent-deep) !important;
    transform: translateY(-1px);
}

body.home-page:not(.tool-shell-page) .home-topbar-action:active,
body.home-page:not(.tool-shell-page) .home-topbar-auth-btn:active,
body.home-page:not(.tool-shell-page) .home-topbar-layout:active {
    transform: translateY(0);
}

body.home-page:not(.tool-shell-page) .home-topbar-auth-btn {
    color: #1e3a8a !important;
}

.dark body.home-page:not(.tool-shell-page) .home-topbar-action:hover,
.dark body.home-page:not(.tool-shell-page) .home-topbar-auth-btn:hover,
.dark body.home-page:not(.tool-shell-page) .home-topbar-layout:hover {
    color: #bfdbfe !important;
}

.dark body.home-page:not(.tool-shell-page) .home-topbar-auth-btn {
    color: #dbeafe !important;
}

body.home-page:not(.tool-shell-page) .home-topbar-divider {
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.55), transparent) !important;
    opacity: 1 !important;
}

@media (max-width: 760px) {
    body.home-page:not(.tool-shell-page) .home-topbar-nav {
        padding: 0.22rem;
        border-color: rgba(203, 213, 225, 0.6);
        background: rgba(248, 250, 252, 0.66);
    }

    .dark body.home-page:not(.tool-shell-page) .home-topbar-nav {
        border-color: rgba(51, 65, 85, 0.66);
        background: rgba(15, 23, 42, 0.55);
    }

    body.home-page:not(.tool-shell-page) .home-topbar-link {
        min-height: 2rem;
        padding: 0.26rem 0.72rem;
        font-size: 0.85rem;
    }
}

.shell-sheet-head small {
    margin-right: auto;
    color: var(--shell-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.shell-sheet-results a.is-active,
.shell-sheet-static a.is-active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--shell-accent-deep);
}

.shell-continue-clear,
.shell-draft button {
    min-height: 2rem;
    padding: 0 0.7rem;
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    background: transparent;
    color: var(--shell-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.shell-draft {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 0.9rem;
    background: rgba(37, 99, 235, 0.08);
}

.shell-draft span {
    margin-right: auto;
    font-size: 0.82rem;
    font-weight: 800;
}

.shell-draft button[data-draft="restore"] {
    border-color: transparent;
    background: var(--shell-accent);
    color: #fff;
}
