/* 2026-05-28: only the fleet-wide AUTO-INJECTOR (shared-topnav.js) was retired —
   THIS STYLESHEET IS STILL LIVE and load-bearing. It is the canonical company-navbar
   look, now consumed by tools that EMBED the navbar themselves (opt-in, static markup;
   e.g. Mail's #ttnav). Do not delete. Standard: techtools-4/.claude/rules/company-navbar.md
   The :root{--tt-topnav-h:0px} below is a SAFE DEFAULT for pages that load this CSS but
   render no navbar (so var(--tt-topnav-h,…) collapses to a top:0/100vh layout). A tool that
   does embed the navbar overrides it (seed in its own :root loaded after this file, then
   publish the measured px on <html> at runtime). */
:root { --tt-topnav-h: 0px; }

/* ============================================================================
   TechTools Shared Top Navbar — drop-in, sticky, theme-independent.
   ----------------------------------------------------------------------------
   One sticky navbar (brand · Contact · tool search · account dropdown) shared
   by EVERY tool and by Mail, so the chrome is identical everywhere. Paired with
   /shared-topnav.js, which injects the markup and wires the behaviour.

   Isolation: every rule is scoped under `.tt-scope` (the class the JS puts on
   the injected <nav> and the overlays host), and the TechTools brand palette is
   re-declared on `.tt-scope` so the navbar looks the same regardless of the host
   tool's own theme/variables. The ONLY rule that touches the page outside the
   component is `body.tt-modal-open { overflow:hidden }`.
   ============================================================================ */

.tt-scope {
    /* Brand palette — pinned so a tool's own --vars never bleed into the navbar */
    --primary-bg: #0a0a0f;
    --secondary-bg: #1a1a24;
    --card-bg: #232338;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #06b6d4;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
}
.tt-scope, .tt-scope *, .tt-scope *::before, .tt-scope *::after { box-sizing: border-box; }
.tt-scope .hidden { display: none !important; }

/* ---------------------------------------------------------------------------
   1. TOP NAVBAR
   --------------------------------------------------------------------------- */
.tt-scope.topnav {
    position: sticky;          /* sticks across the page scroll, no body padding hack */
    top: 0;
    z-index: 900;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.tt-scope .topnav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
}

.tt-scope .topnav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    min-height: 44px;
    padding: 6px 10px 6px 6px;
    border-radius: 10px;
    transition: background var(--transition-base);
    flex-shrink: 0;
}
.tt-scope .topnav-brand:hover { background: rgba(255, 255, 255, 0.05); }
.tt-scope .topnav-brand-img { display: block; height: 32px; width: auto; }
.tt-scope .topnav-brand-name {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-primary);
}

.tt-scope .topnav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.tt-scope .topnav-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    max-width: 460px;
    margin: 0 8px;
}
.tt-scope .topnav-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color var(--transition-base);
}
.tt-scope .topnav-search-input {
    width: 100%;
    min-height: 44px;
    padding: 8px 40px 8px 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}
.tt-scope .topnav-search-input::placeholder { color: var(--text-secondary); opacity: 0.7; }
.tt-scope .topnav-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.tt-scope .topnav-search:focus-within .topnav-search-icon { color: var(--accent-primary); }
.tt-scope .topnav-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color var(--transition-base), background var(--transition-base);
}
.tt-scope .topnav-search-clear:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }

.tt-scope .topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 10px;
    transition: background var(--transition-base), color var(--transition-base);
    white-space: nowrap;
}
.tt-scope .topnav-link i { font-size: 0.95rem; }
.tt-scope .topnav-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }

.tt-scope .topnav-account { margin-left: auto; position: relative; flex-shrink: 0; }

.tt-scope .topnav-signin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: 0;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.tt-scope .topnav-signin:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.tt-scope .topnav-signin:active { transform: translateY(0); }

.tt-scope .topnav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px 6px 6px;
    min-height: 44px;
    border-radius: 999px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
}
.tt-scope .topnav-user-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--accent-primary); }

.tt-scope .topnav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.tt-scope .topnav-user-name {
    font-size: 0.9rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tt-scope .topnav-user-caret { font-size: 0.7rem; color: var(--text-secondary); transition: transform var(--transition-base); }
.tt-scope .topnav-user-btn[aria-expanded="true"] .topnav-user-caret { transform: rotate(180deg); }

.tt-scope .topnav-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
    z-index: 200;
}
.tt-scope .topnav-user-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }

.tt-scope .topnav-user-info { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.tt-scope .topnav-user-info-name {
    color: var(--text-primary); font-weight: 600; font-size: 0.95rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tt-scope .topnav-user-info-email {
    color: var(--text-secondary); font-size: 0.8rem; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Optional section label (used by Mail's mailbox switcher slot) */
.tt-scope .topnav-menu-section-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 12px 4px;
}

.tt-scope .topnav-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-base);
}
.tt-scope .topnav-menu-item i { width: 18px; text-align: center; color: var(--text-secondary); }
.tt-scope .topnav-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.tt-scope .topnav-menu-item:hover i { color: var(--accent-primary); }
.tt-scope .topnav-menu-item-danger { color: var(--danger); }
.tt-scope .topnav-menu-item-danger i { color: var(--danger); }
.tt-scope .topnav-menu-item-danger:hover { background: rgba(239, 68, 68, 0.1); }
.tt-scope .topnav-menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* Mobile navbar: collapse labels to icons so the search keeps a usable width.
   Verified at 360 / 375 / 390 px viewports. */
@media (max-width: 600px) {
    .tt-scope .topnav-inner { padding: 8px 10px; gap: 4px; }
    .tt-scope .topnav-brand span { display: none; }
    .tt-scope .topnav-brand { padding: 4px 8px; min-width: 44px; justify-content: center; }
    .tt-scope .topnav-link span { display: none; }
    .tt-scope .topnav-link { padding: 8px 10px; min-width: 44px; justify-content: center; }
    .tt-scope .topnav-user-name { max-width: 90px; }
    .tt-scope .topnav-search { margin: 0; }
    .tt-scope .topnav-search-input { padding-left: 32px; padding-right: 36px; font-size: 0.85rem; }
    .tt-scope .topnav-search-icon { left: 10px; }
}
@media (max-width: 420px) {
    .tt-scope .topnav-signin span { display: none; }
    .tt-scope .topnav-signin { padding: 10px 12px; min-width: 44px; justify-content: center; }
}
@media (max-width: 380px) {
    .tt-scope .topnav-user-name { display: none; }
    .tt-scope .topnav-search-input::placeholder { font-size: 0.8rem; }
}

/* ---------------------------------------------------------------------------
   2. MODALS (Auth + Account)
   --------------------------------------------------------------------------- */
body.tt-modal-open { overflow: hidden; }

.tt-scope .tt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 14, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.tt-scope .tt-modal {
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ttModalSlideUp 0.25s ease;
}
@keyframes ttModalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.tt-scope .tt-modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.tt-scope .tt-modal-header h2 {
    font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 10px; margin: 0;
}
.tt-scope .tt-modal-header h2 i { color: var(--accent-primary); }
.tt-scope .tt-modal-close {
    background: transparent; border: 0; color: var(--text-secondary);
    font-size: 1.1rem; width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--transition-base);
}
.tt-scope .tt-modal-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.tt-scope .tt-modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.tt-scope .tt-modal-footer {
    padding: 14px 18px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
}

.tt-scope .tt-auth-tabs {
    display: flex; flex-wrap: wrap; gap: 6px;
    background: rgba(255, 255, 255, 0.04); padding: 4px; border-radius: 10px; margin-bottom: 18px;
}
.tt-scope .tt-auth-tab {
    flex: 1; background: transparent; border: 0; color: var(--text-secondary);
    padding: 10px 8px; min-height: 44px; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
    cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background var(--transition-base), color var(--transition-base);
}
.tt-scope .tt-auth-tab i { font-size: 0.85rem; }
.tt-scope .tt-auth-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.tt-scope .tt-auth-pane { display: none; }
.tt-scope .tt-auth-pane.active { display: block; }
@media (max-width: 480px) { .tt-scope .tt-auth-tab { flex: 1 1 calc(50% - 3px); } }

.tt-scope .tt-addr-group { display: flex; align-items: stretch; }
.tt-scope .tt-addr-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.tt-scope .tt-addr-suffix {
    display: flex; align-items: center; padding: 0 12px; white-space: nowrap;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-left: 0;
    border-top-right-radius: 8px; border-bottom-right-radius: 8px;
    color: var(--text-secondary); font-size: 0.85rem;
}
.tt-scope .tt-hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.tt-scope .tt-auth-blurb { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; }

.tt-scope .tt-form-group { margin-bottom: 12px; }
.tt-scope .tt-form-group label {
    display: block; color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 6px; font-weight: 500;
}
.tt-scope .tt-form-group input {
    width: 100%; background: var(--card-bg); border: 1px solid var(--border); color: var(--text-primary);
    padding: 11px 12px; min-height: 44px; border-radius: 8px; font-size: 0.95rem; font-family: inherit;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.tt-scope .tt-form-group input:focus {
    outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.tt-scope .tt-muted { color: var(--text-secondary); font-weight: 400; font-size: 0.78rem; }

.tt-scope .tt-form-divider {
    text-align: center; margin: 18px 0 12px; position: relative;
    color: var(--text-secondary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.tt-scope .tt-form-divider::before, .tt-scope .tt-form-divider::after {
    content: ""; position: absolute; top: 50%; width: calc(50% - 60px); height: 1px; background: var(--border);
}
.tt-scope .tt-form-divider::before { left: 0; }
.tt-scope .tt-form-divider::after { right: 0; }

.tt-scope .tt-auth-error { color: var(--danger); font-size: 0.85rem; margin-top: 10px; min-height: 18px; line-height: 1.4; }

.tt-scope .tt-account-meta {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.tt-scope .tt-account-meta-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 0.85rem; }
.tt-scope .tt-account-meta-label { color: var(--text-secondary); }
.tt-scope .tt-account-meta-value { color: var(--text-primary); font-weight: 500; }

.tt-scope .tt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0;
    padding: 11px 18px; min-height: 44px; border-radius: 10px; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}
.tt-scope .tt-btn-primary { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); color: #fff; }
.tt-scope .tt-btn-primary:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.tt-scope .tt-btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.tt-scope .tt-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.tt-scope .tt-btn-block { width: 100%; }

@media (min-width: 600px) {
    .tt-scope .tt-modal-overlay { align-items: center; padding: 16px; }
    .tt-scope .tt-modal { border-radius: 16px; max-height: 90vh; }
}

/* ---------------------------------------------------------------------------
   3. TOASTS
   --------------------------------------------------------------------------- */
.tt-scope.tt-toast-container,
.tt-scope .tt-toast-container {
    position: fixed; bottom: 16px; right: 16px; z-index: 1100;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    pointer-events: none; max-width: calc(100vw - 32px);
}
.tt-scope .tt-toast {
    pointer-events: auto; background: var(--secondary-bg); border: 1px solid var(--border); color: var(--text-primary);
    padding: 12px 14px; border-radius: 10px; display: flex; align-items: center; gap: 10px; font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transform: translateX(20px); opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease; max-width: 360px;
}
.tt-scope .tt-toast.show { transform: translateX(0); opacity: 1; }
.tt-scope .tt-toast i { font-size: 1rem; }
.tt-scope .tt-toast-success { border-left: 3px solid var(--success); }
.tt-scope .tt-toast-success i { color: var(--success); }
.tt-scope .tt-toast-error { border-left: 3px solid var(--danger); }
.tt-scope .tt-toast-error i { color: var(--danger); }
.tt-scope .tt-toast-info { border-left: 3px solid var(--accent-tertiary); }
.tt-scope .tt-toast-info i { color: var(--accent-tertiary); }
.tt-scope .tt-toast-credentials {
    flex-direction: column; align-items: stretch; padding: 16px 18px 14px;
    border: 1px solid var(--warning); border-left: 4px solid var(--warning); background: #15151f;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 158, 11, 0.15);
    position: relative; max-width: 360px; gap: 6px;
}
.tt-scope .tt-toast-cred-title { font-weight: 600; color: var(--warning); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 0.95rem; }
.tt-scope .tt-toast-cred-title i { color: var(--warning); }
.tt-scope .tt-toast-cred-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.85rem; }
.tt-scope .tt-toast-cred-row span { color: var(--text-secondary); }
.tt-scope .tt-toast-cred-row code {
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px;
    color: var(--text-primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; user-select: all;
}
.tt-scope .tt-toast-cred-hint { color: var(--text-secondary); font-size: 0.75rem; margin-top: 4px; }
.tt-scope .tt-toast-close {
    position: absolute; top: 6px; right: 8px; background: transparent; border: 0; color: var(--text-secondary);
    font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.tt-scope .tt-toast-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
    .tt-scope .tt-modal { animation: none; }
    .tt-scope .tt-toast { transition: opacity 0.2s ease; transform: none; }
}
