html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
    /* We keep overflow hidden so the app uses a fixed viewport with internal scrollers.
       If body-level scrolling ever feels needed, change this to 'auto' temporarily. */
    overflow: hidden;
}

/* MAUI Blazor: status-bar-safe-area sits OUTSIDE #app — flex column prevents double-stacked 100% height. */
body {
    display: flex;
    flex-direction: column;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: var(--jl-accent-text) !important;
    background-color: var(--jl-accent-solid) !important;
    border-color: var(--jl-accent-solid) !important;
}

.btn-primary:hover {
    background-color: var(--jl-accent-hover) !important;
    border-color: var(--jl-accent-hover) !important;
    color: var(--jl-accent-text) !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    flex: 1 1 auto;
    min-height: 0;               /* Allows the flex child to shrink so overflow works */
    overflow-y: auto;            /* Main page content scrolling lives here */
    padding-top: 1.1rem;
}

/* ========== Shared main-page column (Settings / Backups / Premium / Pricing / Security / Help)
   Same max-width so scrolling between nav items feels like one program, not different sites. */
.jl-main-page,
.jl-settings-page,
.jl-backups-page,
.jl-premium-page,
.jl-pricing-page,
.jl-security-page,
.jl-help-page,
.jl-help-broken-chain,
.jl-help-blockchain-court,
.jl-help-security-keys,
.jl-help-ots,
.jl-help-why-not-bitcoin,
.jl-help-eu-china,
.jl-help-devices,
.jl-calendar-page,
.jl-continuity-page {
    max-width: 900px !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

@media (max-width: 960px) {
    .jl-main-page,
    .jl-settings-page,
    .jl-backups-page,
    .jl-premium-page,
    .jl-pricing-page,
    .jl-security-page,
    .jl-help-page,
    .jl-help-broken-chain,
    .jl-help-blockchain-court,
    .jl-help-security-keys,
    .jl-help-ots,
    .jl-help-why-not-bitcoin,
    .jl-help-eu-china,
    .jl-help-devices,
    .jl-calendar-page,
    .jl-continuity-page {
        max-width: 100% !important;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Ensure the Blazor root fills remaining viewport below the MAUI status-bar strip */
#app {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page {
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fefce8; /* pale yellow that works in both modes */
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Single MAUI status-bar strip (do NOT duplicate with jl-safe-area-top inside Blazor). */
:root {
    --jl-status-bar-height: env(safe-area-inset-top, 0px);
}

html.jl-maui-android {
    --jl-status-bar-height: max(env(safe-area-inset-top, 0px), 24px);
    font-size: 22px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.status-bar-safe-area {
    display: block;
    flex: 0 0 auto;
    flex-shrink: 0;
    height: var(--jl-status-bar-height);
    min-height: 0;
    max-height: var(--jl-status-bar-height);
    background-color: var(--jl-bg-charcoal, #0B1628);
    width: 100%;
    z-index: 1;
    pointer-events: none;
}

@supports (-webkit-touch-callout: none) {
    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left, 0px);
    }
}

/* === JournaLock Professional Legal Theme (Vault Authority palette) ===
   Derived from Cravath / Wachtell / Skadden / Latham / Kirkland / S&C analysis.
   Deep navy + charcoal + professional blue accents (gold completely removed).
   Vault LED green preserved for tech/secure branding.

   BRIGHT / LIGHT MODE IS NOW THE DEFAULT (as of user request).
   Dark mode is available via the dev toggle and is persisted when chosen.

   See Branding/Legal-Professional-Color-Palette.md for full rationale.
*/

/* Light theme is the default (no data-theme or data-theme="light").
   Dark theme variables are applied when html[data-theme="dark"] is present.
*/
:root {
  --jl-bg-deep: #0B1628;
  --jl-bg-charcoal: #1E2937;
  --jl-bg-elevated: #334155;
  --jl-text-primary: #F1F5F9;
  --jl-text-secondary: #94A3B8;
  --jl-text-muted: #64748B;
  /* Accent: --jl-accent is readable on dark surfaces (links, labels, borders).
     --jl-accent-solid is for filled buttons and strong highlights. */
  --jl-accent: #93C5FD;
  --jl-accent-solid: #2563EB;
  --jl-accent-hover: #1D4ED8;
  --jl-vault-green: #2db84a;
  --jl-vault-green-dark: #0f6319;
  --jl-border: #475569;
  --jl-danger: #DC2626;
  --jl-success-solid: #059669;
  --jl-success-hover: #047857;
  --jl-danger-solid: #B91C1C;
  --jl-danger-hover: #991B1B;

  /* High-contrast text for buttons that sit on --jl-accent background */
  --jl-accent-text: #F8FAFC;

  /* Top bar (sidebar header strip) */
  --jl-topbar-bg: rgba(0, 0, 0, 0.4);

  /* Sidebar width (adjustable) */
  --sidebar-width: 260px;

  /* Royal Blue LED theme for splash / branding (user preference) */
  --jl-led-blue: #4169E1;
  --jl-led-blue-bright: #6495ED;
  --jl-led-blue-dark: #27408B;

  /* Text editor toolbar tokens (theme-first — Creators/Journal/Patents) */
  --jl-te-toolbar-bg: var(--jl-bg-charcoal);
  --jl-te-toolbar-border: var(--jl-border);
  --jl-te-toolbar-fg: var(--jl-text-secondary);
  --jl-te-toolbar-btn: var(--jl-text-secondary);
  --jl-te-toolbar-btn-hover-bg: var(--jl-bg-elevated);
  --jl-te-toolbar-btn-hover-border: var(--jl-border);
  --jl-te-toolbar-btn-hover-fg: var(--jl-text-primary);
  --jl-te-toolbar-sep: var(--jl-border);
  --jl-te-toolbar-hint: var(--jl-text-muted);

  /* Ladder / integrity greens — neon OK on dark; light mode overrides below */
  --jl-ladder-ok: #86efac;
  --jl-ladder-ok-strong: #4ade80;
  --jl-ladder-ok-bar: #22c55e;
  --jl-ladder-pending: #fcd34d;
  --jl-ladder-broken: #fca5a5;

  /*
   * Readable “status” colors ON themed surfaces (cards/panels).
   * NEVER hardcode #7dd3fc / #bae6fd / #86efac / #4ade80 as body text — they vanish on light paper.
   * Use these tokens (or --jl-text-primary / --jl-accent) instead.
   */
  --jl-info-fg: #7dd3fc;           /* sky on dark charcoal */
  --jl-info-fg-strong: #38bdf8;
  --jl-info-border: rgba(56, 189, 248, 0.45);
  --jl-info-bg: rgba(56, 189, 248, 0.10);
  --jl-ok-fg: #86efac;             /* mint on dark */
  --jl-ok-fg-strong: #4ade80;
  --jl-ok-border: rgba(34, 197, 94, 0.45);
  --jl-ok-bg: rgba(34, 197, 94, 0.10);
  --jl-warn-fg: #fbbf24;
  --jl-warn-border: #f59e0b;
  --jl-warn-bg: rgba(245, 158, 11, 0.14);
}

/* ========== LIGHT MODE SEED (professional legal light palette) ========== */
/* Apply by setting <html data-theme="light"> or via JS toggle later.
   These values are chosen for:
   - High readability in bright environments (courtrooms, offices, outdoors)
   - Still convey authority and seriousness (not "consumer app" bright)
   - Good contrast for WCAG AA
*/
/* Light theme — soft legal paper (NOT pure white). Tuned down for eye comfort. */
html[data-theme="light"] {
  /* Washed slate-paper, not #F8FAFC / pure white */
  --jl-bg-deep: #E6EAF0;           /* Main canvas — muted blue-gray */
  --jl-bg-charcoal: #DCE2EA;       /* Panels / cards slightly darker than canvas */
  --jl-bg-elevated: #D0D7E2;       /* Raised controls, toolbars */
  --jl-text-primary: #1E293B;      /* Soft navy (not pure black) */
  --jl-text-secondary: #334155;    /* slate-700 — darker for soft-paper contrast */
  --jl-text-muted: #475569;        /* slate-600 — was #5B6778 (washed on muted canvas) */
  --jl-accent: #3B4F9C;            /* Slightly softer indigo than #4338CA */
  --jl-accent-solid: #3B4F9C;
  --jl-accent-hover: #2F3F82;
  --jl-vault-green: #0f6319;
  --jl-vault-green-dark: #0a4d14;
  --jl-border: #9AA6B8;            /* Visible but not harsh */
  --jl-danger: #B91C1C;
  --jl-success-solid: #0f6319;
  --jl-success-hover: #0a4d14;
  --jl-danger-solid: #991B1B;
  --jl-danger-hover: #7F1D1D;

  /* Keep high contrast on accent buttons even in light mode */
  --jl-accent-text: #F1F5F9;

  /* Top bar (sidebar header strip) - subtle in bright mode */
  --jl-topbar-bg: rgba(15, 23, 42, 0.08);

  /* Sidebar width (adjustable) */
  --sidebar-width: 260px;

  /* Royal Blue LED theme for splash / branding (user preference) */
  --jl-led-blue: #4169E1;
  --jl-led-blue-bright: #6495ED;
  --jl-led-blue-dark: #27408B;

  /* Toolbar — same soft paper family (no pure white / no black box) */
  --jl-te-toolbar-bg: #DCE2EA;
  --jl-te-toolbar-border: #9AA6B8;
  --jl-te-toolbar-fg: #3F4B5C;
  --jl-te-toolbar-btn: #1E293B;
  --jl-te-toolbar-btn-hover-bg: #D0D7E2;
  --jl-te-toolbar-btn-hover-border: #7B8799;
  --jl-te-toolbar-btn-hover-fg: #1E293B;
  --jl-te-toolbar-sep: #9AA6B8;
  --jl-te-toolbar-hint: #5B6778;

  /* Ladder links — deep green on light paper (neon bleeds / washes out) */
  --jl-ladder-ok: #0f6319;
  --jl-ladder-ok-strong: #0a4d14;
  --jl-ladder-ok-bar: #15803d;
  --jl-ladder-pending: #b45309;
  --jl-ladder-broken: #b91c1c;

  /* Pastels → ink: light paper needs deep hues (see AttorneyProofPrintBar, proof pills) */
  --jl-info-fg: #1e3a8a;           /* deep indigo — readable on #E6EAF0 */
  --jl-info-fg-strong: #1d4ed8;
  --jl-info-border: rgba(30, 58, 138, 0.40);
  --jl-info-bg: rgba(59, 79, 156, 0.10);
  --jl-ok-fg: #0f6319;             /* deep vault green */
  --jl-ok-fg-strong: #0a4d14;
  --jl-ok-border: rgba(15, 99, 25, 0.40);
  --jl-ok-bg: rgba(15, 99, 25, 0.08);
  /* Amber that still reads on light paper (Bootstrap warning yellow washes out) */
  --jl-warn-fg: #92400e;
  --jl-warn-border: #b45309;
  --jl-warn-bg: rgba(180, 83, 9, 0.14);
}

/* ---- Compact print / court strip (theme-safe; no pastel text) ---- */
.jl-print-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  padding: 0.35rem 0.5rem;
  margin: 0.35rem 0 0.5rem;
  border: 1px solid var(--jl-border);
  border-radius: 6px;
  background: var(--jl-bg-charcoal);
  color: var(--jl-text-primary);
}
.jl-print-strip__label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--jl-text-secondary);
  margin-right: 0.15rem;
  white-space: nowrap;
}
.jl-print-strip__hint {
  font-size: 0.62rem;
  color: var(--jl-text-muted);
  flex: 1 1 8rem;
  min-width: 6rem;
  line-height: 1.25;
}
.jl-print-strip__msg {
  font-size: 0.65rem;
  color: var(--jl-ok-fg);
  width: 100%;
  margin: 0;
}
.jl-print-strip .btn {
  padding: 0.12rem 0.45rem !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  border-radius: 4px !important;
}
.jl-print-strip .btn-info,
.jl-print-strip .btn-outline-info {
  background: var(--jl-info-bg) !important;
  border-color: var(--jl-info-border) !important;
  color: var(--jl-info-fg) !important;
}
.jl-print-strip .btn-info:hover,
.jl-print-strip .btn-outline-info:hover {
  background: var(--jl-info-border) !important;
  color: var(--jl-accent-text) !important;
}
html[data-theme="light"] .jl-print-strip .btn-info:hover,
html[data-theme="light"] .jl-print-strip .btn-outline-info:hover {
  color: #F8FAFC !important;
  background: var(--jl-info-fg-strong) !important;
  border-color: var(--jl-info-fg-strong) !important;
}
.jl-print-strip .btn-success {
  background: var(--jl-success-solid) !important;
  border-color: var(--jl-success-solid) !important;
  color: #F8FAFC !important;
}
.jl-print-strip .help-q {
  font-size: 0.65rem;
}

/* Count badges + toasts — theme tokens (L8) */
.jl-count-badge {
  background: var(--jl-bg-elevated) !important;
  color: var(--jl-text-primary) !important;
  border: 1px solid var(--jl-border);
  font-weight: 600;
}
.jl-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  pointer-events: none;
}
.jl-toast-container .jl-toast { pointer-events: auto; }
.jl-toast {
  padding: 12px 16px;
  padding-right: 26px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  border: 1px solid var(--jl-border);
  background: var(--jl-bg-elevated);
  color: var(--jl-text-primary);
}
.jl-toast__body { flex: 1; line-height: 1.35; }
.jl-toast__close { color: inherit; }
.jl-toast--ok {
  background: var(--jl-success-solid, var(--jl-vault-green));
  border-color: var(--jl-vault-green-dark, var(--jl-vault-green));
  color: var(--jl-accent-text, #f1f5f9);
}
.jl-toast--err {
  background: var(--jl-danger-solid, var(--jl-danger));
  border-color: var(--jl-danger-hover, var(--jl-danger));
  color: var(--jl-accent-text, #f1f5f9);
}
.jl-toast--info {
  background: var(--jl-accent-solid, var(--jl-accent));
  border-color: var(--jl-accent-hover, var(--jl-accent));
  color: var(--jl-accent-text, #f1f5f9);
}
.jl-phone-platform .jl-toast-container {
  left: 12px;
  right: 12px;
  bottom: calc(var(--jl-mobile-bottom-nav-height, 52px) + var(--jl-safe-bottom, 0px) + 12px);
  max-width: none;
}
/* Splash / unlock lives on dark canvas — pastels stay readable there */
:root {
  --jl-splash-fg: #e0f2fe;
  --jl-splash-fg-strong: #bae6fd;
}

/*
 * Light-mode safety net: Bootstrap / leftover pastels that read as "invisible ink"
 * on soft legal paper. Prefer tokens above; this catches stragglers.
 */
html[data-theme="light"] {
  /* Bootstrap info/success text on light paper */
}
html[data-theme="light"] .text-info,
html[data-theme="light"] .text-primary.text-info {
  color: var(--jl-info-fg) !important;
}
html[data-theme="light"] .text-success {
  color: var(--jl-ok-fg) !important;
}
html[data-theme="light"] .btn-outline-info {
  color: var(--jl-info-fg) !important;
  border-color: var(--jl-info-border) !important;
}
html[data-theme="light"] .btn-info {
  background-color: var(--jl-info-fg-strong) !important;
  border-color: var(--jl-info-fg-strong) !important;
  color: #F8FAFC !important;
}
html[data-theme="light"] .btn-outline-warning,
html[data-theme="light"] .btn-warning {
  color: var(--jl-warn-fg) !important;
  border-color: var(--jl-warn-border) !important;
  background-color: var(--jl-warn-bg) !important;
}
html[data-theme="light"] .btn-warning {
  color: #fff7ed !important;
  background-color: var(--jl-warn-border) !important;
}
html[data-theme="light"] .text-warning {
  color: var(--jl-warn-fg) !important;
}

/* Better placeholder contrast in dark mode inputs */
input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

/* Dark mode placeholder styling (active when data-theme="dark") */
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #cbd5e1 !important;
}

/* ========== Light Mode Polish for Journal page ========== */
html[data-theme="light"] .journal-header {
  border-bottom-width: 2px !important;
}

html[data-theme="light"] .journal-entry-card,
html[data-theme="light"] .entry-item {
  border: 1px solid var(--jl-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .journal-header .stats,
html[data-theme="light"] .journal-header span {
  font-weight: 500;
}

/* JournaLock Professional Dark Theme (default) */
.page {
    background-color: var(--jl-bg-deep);
    color: var(--jl-text-primary);
}

.sidebar {
    background-color: var(--jl-bg-charcoal);
    border-right: 1px solid var(--jl-border);
}

/* Desktop sidebar nav must always be visible (scoped NavMenu rules can miss in some builds) */
.page:not(.jl-phone-platform) .sidebar {
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

.page:not(.jl-phone-platform) .sidebar .nav-scrollable {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    height: 0; /* fill remaining sidebar; bottom items reachable via scroll */
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
    overscroll-behavior: contain;
    padding-bottom: 1.25rem;
}

.page:not(.jl-phone-platform) .sidebar .top-row {
    flex-shrink: 0;
}

/* Phone hamburger toggle — desktop only; never show in left sidebar */
.page:not(.jl-phone-platform) .sidebar .navbar-toggler {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.jl-onboarding-shell {
    min-height: 100vh;
    width: 100%;
    background: var(--jl-bg-deep);
    overflow-x: hidden;
}

html[data-theme="light"] .sidebar {
    background-color: var(--jl-bg-charcoal) !important;
    border-right: 1px solid var(--jl-border);
}

/* Phone More drawer — elevated sheet (soft-light tokens made charcoal ≈ canvas) */
html[data-theme="light"] .jl-phone-platform .sidebar.jl-mobile-drawer {
    background-color: #F4F6FA !important;
    border-right: 1px solid #9AA6B8 !important;
    box-shadow: 6px 0 28px rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .jl-phone-platform .jl-mobile-bottom-nav {
    background: #F0F3F8;
    border-top-color: #9AA6B8;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .jl-phone-platform .jl-mobile-nav-item {
    color: #1E293B;
}

html[data-theme="light"] .jl-phone-platform .jl-mobile-nav-item.active,
html[data-theme="light"] .jl-phone-platform .jl-mobile-nav-item.active .jl-mobile-nav-label {
    color: #3B4F9C;
    font-weight: 600;
}

/* =====================================================================
   Phone More drawer — numbers (Jim): width ~70% of prior wide drawer; dense rows
   Prior wide: min(94vw, 400px). −30% → min(66vw, 280px).
   ===================================================================== */
.jl-phone-platform .sidebar.jl-mobile-drawer {
    /* CRITICAL: base .sidebar max-width: min(260px, 40vw) must be overridden */
    width: min(66vw, 280px) !important;
    max-width: min(66vw, 280px) !important;
    min-width: min(58vw, 240px) !important;
    flex: none !important;
    flex-basis: auto !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-scrollable {
    padding: 0.2rem 0.4rem 0.85rem 0.4rem !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-item {
    font-size: 14px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-item.px-3 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-item.jl-nav-item--nested {
    padding-left: 0.55rem !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-item .nav-link,
.jl-phone-platform .sidebar.jl-mobile-drawer a.nav-link {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.35rem !important;
    min-height: 1.9rem !important;
    max-height: none !important;
    height: auto !important;
    padding: 0.22rem 0.45rem !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    hyphens: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-section-header,
.jl-phone-platform .sidebar.jl-mobile-drawer .nav-section-toggle {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.3rem !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    margin-top: 0.2rem !important;
    margin-bottom: 0 !important;
    padding: 0.28rem 0.45rem 0.12rem 0.45rem !important;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-section-arrow {
    flex: 0 0 auto;
    width: 0.85rem;
    text-align: center;
}

.jl-phone-platform .sidebar.jl-mobile-drawer .nav-scrollable > div[style*="height:1px"],
.jl-phone-platform .sidebar.jl-mobile-drawer .jl-nav-divider {
    margin: 0.2rem 0.45rem !important;
}

.page:not(.jl-phone-platform) .nav-item.jl-nav-item--nested {
    padding-left: 1.35rem !important;
}

/* === Light mode header bar + brand title fixes === */
html[data-theme="light"] .top-row {
    border-bottom: 1px solid var(--jl-border);
}

.brand-lock {
    color: var(--jl-text-primary);
}

html[data-theme="light"] .brand-lock {
    color: var(--jl-text-primary) !important; /* deep navy-slate for high contrast in bright mode */
}

.navbar-brand {
    color: var(--jl-accent) !important;
}

.nav-link {
    color: var(--jl-text-secondary);
}

.nav-link:hover, .nav-link.active {
    color: var(--jl-accent);
    background-color: color-mix(in srgb, var(--jl-accent-solid) 18%, transparent);
}

.content {
    background-color: var(--jl-bg-deep);
}

/* Bootstrap dark card harmonization (used in Settings/Premium/etc.) */
.card.bg-dark {
    background-color: var(--jl-bg-charcoal) !important;
    border-color: var(--jl-border) !important;
}
.card.bg-dark .card-title { color: var(--jl-text-primary); }
.text-muted { color: var(--jl-text-muted) !important; }

/* ========== Dark mode: Bootstrap card/form harmonization ==========
   Bootstrap defaults to light-theme body colors on cards and labels.
   Nested jl-bg-deep panels then inherit dark text on dark backgrounds. */
html[data-theme="dark"] .card {
    background-color: var(--jl-bg-charcoal) !important;
    color: var(--jl-text-primary) !important;
    border-color: var(--jl-border) !important;
}

html[data-theme="dark"] .card-header {
    background-color: var(--jl-bg-deep) !important;
    color: var(--jl-text-primary) !important;
    border-color: var(--jl-border) !important;
}

html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-text {
    color: inherit;
}

html[data-theme="dark"] .form-label {
    color: var(--jl-text-secondary) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
    background-color: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    border-color: var(--jl-border) !important;
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled {
    background-color: color-mix(in srgb, var(--jl-accent-solid) 14%, var(--jl-bg-elevated)) !important;
    color: var(--jl-text-secondary) !important;
    opacity: 1;
}

/* ========== Form fields — readable on all JL-themed surfaces (light + dark) ==========
   Parent cards/panels set color: var(--jl-text-primary). Without explicit input colors,
   typed text can inherit light-on-light or dark-on-dark and appear to vanish. */
.form-control,
.form-select,
textarea.form-control {
    background-color: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    border-color: var(--jl-border) !important;
    -webkit-text-fill-color: var(--jl-text-primary);
}

.form-control::placeholder,
.form-select::placeholder,
textarea.form-control::placeholder {
    color: var(--jl-text-muted) !important;
    opacity: 1;
    -webkit-text-fill-color: var(--jl-text-muted);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background-color: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    -webkit-text-fill-color: var(--jl-text-primary);
}

.form-control:disabled,
.form-select:disabled,
textarea.form-control:disabled {
    background-color: color-mix(in srgb, var(--jl-accent-solid) 14%, var(--jl-bg-elevated)) !important;
    color: var(--jl-text-secondary) !important;
    -webkit-text-fill-color: var(--jl-text-secondary);
    opacity: 1;
}

.patent-page .form-label,
.attorney-page .form-label {
    color: var(--jl-text-secondary) !important;
}

html[data-theme="dark"] .btn-outline-primary {
    color: var(--jl-accent) !important;
    border-color: var(--jl-accent) !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus {
    background-color: var(--jl-accent-solid) !important;
    border-color: var(--jl-accent-solid) !important;
    color: var(--jl-accent-text) !important;
}

html[data-theme="dark"] .text-primary {
    color: var(--jl-accent) !important;
}

/* Nested deep panels (Client Identity, correspondence boxes, etc.) */
html[data-theme="dark"] .ip-client-identity,
html[data-theme="dark"] .jl-surface-deep {
    background: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary);
    border-color: var(--jl-border) !important;
}

html[data-theme="dark"] .ip-client-identity .form-label,
html[data-theme="dark"] .jl-surface-deep .form-label {
    color: var(--jl-text-secondary) !important;
}

html[data-theme="dark"] .ip-client-identity strong,
html[data-theme="dark"] .jl-surface-deep strong {
    color: var(--jl-text-primary);
}

html[data-theme="dark"] .alert-info {
    background-color: color-mix(in srgb, var(--jl-accent-solid) 16%, var(--jl-bg-charcoal)) !important;
    border-color: color-mix(in srgb, var(--jl-accent) 45%, var(--jl-border)) !important;
    color: var(--jl-text-primary) !important;
}

html[data-theme="dark"] .alert-warning {
    background-color: color-mix(in srgb, #f59e0b 14%, var(--jl-bg-charcoal)) !important;
    border-color: color-mix(in srgb, #f59e0b 40%, var(--jl-border)) !important;
    color: var(--jl-text-primary) !important;
}

html[data-theme="dark"] .alert-success {
    background-color: color-mix(in srgb, var(--jl-vault-green) 14%, var(--jl-bg-charcoal)) !important;
    border-color: color-mix(in srgb, var(--jl-vault-green) 40%, var(--jl-border)) !important;
    color: var(--jl-text-primary) !important;
}

html[data-theme="dark"] .list-group-item {
    background-color: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    border-color: var(--jl-border) !important;
}

html[data-theme="dark"] .badge.bg-secondary {
    background-color: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    border: 1px solid var(--jl-border);
}

html[data-theme="dark"] a:not(.btn):not(.nav-link) {
    color: var(--jl-accent);
}

html[data-theme="dark"] a:not(.btn):not(.nav-link):hover {
    color: color-mix(in srgb, var(--jl-accent) 80%, white);
}

html[data-theme="dark"] .btn-link {
    color: var(--jl-accent) !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong {
    color: var(--jl-text-primary);
}

/* Light theme overrides for Bootstrap cards when data-theme=light */
html[data-theme="light"] .card.bg-dark {
    background-color: var(--jl-bg-elevated) !important;
    border-color: var(--jl-border) !important;
}
html[data-theme="light"] .card.bg-dark .card-title { color: var(--jl-text-primary); }

/* Neutralize Bootstrap dark-mode text utilities in light mode */
html[data-theme="light"] .text-light {
    color: var(--jl-text-primary) !important;
}

/* Immersion / Full Screen mode for Creative Canvas (Creators page)
   LOCKED UX (Jim): entire screen = writing. Only ghost Exit + right-edge edit rail.
   No top bar, no labels, no loud chrome. */
body.immersion-mode .sidebar {
    display: none !important;
    width: 0 !important;
}

body.immersion-mode .page {
    padding-left: 0 !important;
}

body.immersion-mode .content {
    padding: 0 !important;
    max-width: 100% !important;
}

body.immersion-mode article.content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide all non-writing chrome during immersion (CSS belt + MainLayout removes TopHeader) */
body.immersion-mode footer,
body.immersion-mode .jl-toast-container,
body.immersion-mode .jl-mobile-topbar,
body.immersion-mode .jl-safe-area-top,
body.immersion-mode .jl-mobile-bottom-nav,
body.immersion-mode .jl-top-header,
body.immersion-mode .top-header,
body.immersion-mode header,
body.immersion-mode .guided-mode-banner,
body.immersion-mode .sidebar,
.page.jl-creators-immersion-active .sidebar,
.page.jl-creators-immersion-active .jl-top-header,
.page.jl-creators-immersion-active .guided-mode-banner,
.page.jl-creators-immersion-active footer,
.page.jl-creators-immersion-active .jl-mobile-bottom-nav,
.page.jl-creators-immersion-active .jl-mobile-topbar {
    display: none !important;
}

.page.jl-creators-immersion-active,
.page.jl-creators-immersion-active .jl-main-column,
.page.jl-creators-immersion-active .jl-main-column--immersion,
.page.jl-creators-immersion-active main,
.page.jl-creators-immersion-active .content--immersion,
.page.jl-creators-immersion-active article.content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    min-height: 100vh !important;
    height: 100% !important;
    overflow: hidden !important;
    border: none !important;
}

body.immersion-mode,
body.immersion-mode html {
    overflow: hidden !important;
}

/* Full-viewport takeover — writing surface only + right rail controls (above any residual chrome) */
.creators-immersion {
    --immersion-rail-w: 48px;
    --immersion-ghost-fg: color-mix(in srgb, #e8edf4 42%, transparent);
    --immersion-ghost-fg-strong: color-mix(in srgb, #e8edf4 82%, transparent);
    --immersion-ghost-bg: color-mix(in srgb, #e8edf4 6%, transparent);
    --immersion-ghost-bg-hover: color-mix(in srgb, #e8edf4 14%, transparent);
    --immersion-ghost-border: color-mix(in srgb, #e8edf4 14%, transparent);
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: var(--jl-bg-deep);
    color: var(--jl-text-primary);
    display: block;
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

/* Light canvas styles: quiet dark ghosts on cream/pastel paper */
.creators-immersion--light {
    --immersion-ghost-fg: color-mix(in srgb, #1a2332 38%, transparent);
    --immersion-ghost-fg-strong: color-mix(in srgb, #1a2332 78%, transparent);
    --immersion-ghost-bg: color-mix(in srgb, #1a2332 5%, transparent);
    --immersion-ghost-bg-hover: color-mix(in srgb, #1a2332 12%, transparent);
    --immersion-ghost-border: color-mix(in srgb, #1a2332 12%, transparent);
}

.creators-immersion .immersion-topbar {
    display: none !important; /* no top chrome in immersion */
}

/* Exit must ALWAYS be visible on every style (with or without painting background).
   WebView stacking often paints the writing surface over faint "ghost" controls — so Exit is solid. */
.creators-immersion .immersion-exit {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    right: calc(env(safe-area-inset-right, 0px) + 10px) !important;
    left: auto !important;
    z-index: 2147483000 !important;
    width: auto !important;
    min-width: 64px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 8px !important;
    background: rgba(12, 18, 28, 0.82) !important;
    color: #f3f6fb !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
}

/* Light paper styles (calm / warm / impressionist — no dark painting) */
.creators-immersion--light .immersion-exit {
    border: 1px solid rgba(26, 35, 50, 0.35) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    color: #1a2332 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18) !important;
}

.creators-immersion .immersion-exit:hover,
.creators-immersion .immersion-exit:focus-visible {
    filter: brightness(1.08);
    outline: 2px solid rgba(96, 165, 250, 0.85);
    outline-offset: 2px;
}

/* Legacy ghost class (if any other controls use it) */
.creators-immersion .immersion-ghost:not(.immersion-exit) {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 6px);
    z-index: 1000003;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--immersion-ghost-border);
    border-radius: 6px;
    background: var(--immersion-ghost-bg);
    color: var(--immersion-ghost-fg);
    cursor: pointer;
}

.jl-creators-immersion-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.jl-creators-immersion-help {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 260px;
    max-width: min(340px, 90vw);
}

.creators-immersion .immersion-tools,
.creators-immersion .immersion-tool-btn,
.creators-immersion .immersion-tools-toggle {
    display: none !important; /* legacy toggles — edit tools live in right rail via JlTextEditor */
}

.jl-top-header__pill--link {
    text-decoration: none;
    cursor: pointer;
    color: var(--jl-accent) !important;
    border-color: var(--jl-accent) !important;
}

.jl-top-header__pill--link:hover {
    filter: brightness(1.1);
}

/* Writing surface fills screen but stays UNDER the Exit control (no full-bleed hit-steal). */
.creators-immersion .immersion-writing {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Top padding leaves a clear lane for the solid Exit pill */
    padding: calc(env(safe-area-inset-top, 0px) + 56px)
             calc(env(safe-area-inset-right, 0px) + var(--immersion-rail-w) + 10px)
             calc(env(safe-area-inset-bottom, 0px) + 16px)
             calc(env(safe-area-inset-left, 0px) + 28px);
    box-sizing: border-box;
    border: none !important;
    box-shadow: none !important;
    pointer-events: auto;
}

.jl-phone-platform .creators-immersion {
    --immersion-rail-w: 44px;
}

.jl-phone-platform .creators-immersion .immersion-writing {
    padding-left: calc(env(safe-area-inset-left, 0px) + 12px);
    padding-right: calc(env(safe-area-inset-right, 0px) + var(--immersion-rail-w) + 6px);
}

.jl-misspell {
    text-decoration: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'%3E%3Cpath d='M0 2.5 Q1.5 0.5 3 2.5 T6 2.5' fill='none' stroke='%23e74c3c' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: left bottom;
    background-size: 6px 3px;
    padding-bottom: 2px;
}

.jl-spell-menu {
    position: fixed;
    z-index: 10050;
    min-width: 180px;
    max-width: 280px;
    padding: 4px 0;
    border-radius: 8px;
    border: 1px solid var(--jl-border, #3d4f5f);
    background: var(--jl-bg-charcoal, #1a2332);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.jl-spell-menu__title {
    padding: 6px 12px 4px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--jl-text-muted, #64748b);
}

.jl-spell-menu__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 12px;
    border: none;
    background: transparent;
    color: var(--jl-text-primary, #e8edf4);
    font-size: 0.85rem;
    cursor: pointer;
}

.jl-spell-menu__item:hover:not(:disabled) {
    background: var(--jl-bg-elevated, #243044);
}

.jl-spell-menu__item--muted {
    color: var(--jl-text-muted, #64748b);
    font-style: italic;
    cursor: default;
}

.jl-spell-menu__item:disabled {
    opacity: 0.7;
    cursor: default;
}

.jl-spell-menu__sep {
    height: 1px;
    margin: 4px 8px;
    background: var(--jl-border, #3d4f5f);
}

.creators-immersion textarea,
.creators-immersion .jl-text-editor {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.creators-immersion .jl-text-editor__area,
.creators-immersion textarea {
    background: transparent !important;
    color: inherit;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 1.12rem;
    line-height: 1.72;
    resize: none;
    padding: 4px 8px;
    font-family: inherit;
    box-sizing: border-box;
}

.creators-immersion .jl-text-editor {
    border: none !important;
    background: transparent !important;
    overflow: visible;
}

.creators-immersion .jl-text-editor__area:focus {
    box-shadow: none !important;
}

/* Creators page — style + mode toolbar */
.jl-creators-toolbar {
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.jl-creators-style-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
}

.jl-creators-style-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    flex-shrink: 0;
}

.jl-creators-immersion-btn {
    background: transparent;
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.jl-creators-immersion-btn:hover {
    background: var(--jl-bg-elevated);
    border-color: var(--jl-accent);
}

.jl-creators-new-btn {
    flex-shrink: 0;
    align-self: center;
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.jl-creators-new-btn:hover {
    filter: brightness(1.05);
}

.jl-creators-style-label {
    font-size: 0.72rem;
    color: var(--jl-text-muted);
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    padding-top: 0.35rem;
}

.jl-creators-style-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
}

.jl-creators-style-pill {
    padding: 4px 10px;
    font-size: 0.72rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    background: var(--jl-bg-deep);
    color: var(--jl-text-secondary);
    border: 1px solid var(--jl-border);
    max-width: 100%;
}

.jl-creators-editor {
    position: relative;
}

.jl-creators-editor .jl-text-editor {
    border-color: transparent;
    background: transparent;
    overflow: visible;
}

.jl-creators-editor .jl-text-editor--canvas-embed {
    overflow: visible;
}

.jl-creators-editor .jl-text-editor__toolbar {
    margin-bottom: 6px;
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 4;
    flex-shrink: 0;
}

.jl-creators-editor--default {
    --jl-te-toolbar-bg: rgba(15, 20, 25, 0.96);
    --jl-te-toolbar-border: var(--jl-border);
    --jl-te-toolbar-fg: var(--jl-text-secondary);
    --jl-te-toolbar-btn: var(--jl-text-secondary);
    --jl-te-toolbar-btn-hover-bg: var(--jl-bg-elevated);
    --jl-te-toolbar-btn-hover-border: var(--jl-border);
    --jl-te-toolbar-btn-hover-fg: var(--jl-text-primary);
    --jl-te-toolbar-sep: var(--jl-border);
    --jl-te-toolbar-hint: var(--jl-text-muted);
}

.jl-creators-editor .jl-text-editor__area {
    background: transparent;
}

/* Permanent light-mode safety net for Edit tools toolbar (Creators/Journal/Patents).
   Wins over any leftover dark hex in scoped component CSS so the black box cannot return. */
html[data-theme="light"] .jl-text-editor__toolbar {
    background: var(--jl-te-toolbar-bg) !important;
    border-color: var(--jl-te-toolbar-border) !important;
    color: var(--jl-te-toolbar-fg) !important;
}
html[data-theme="light"] .jl-text-editor__btn {
    color: var(--jl-te-toolbar-btn) !important;
}
html[data-theme="light"] .jl-text-editor__btn:hover:not(:disabled) {
    background: var(--jl-te-toolbar-btn-hover-bg) !important;
    border-color: var(--jl-te-toolbar-btn-hover-border) !important;
    color: var(--jl-te-toolbar-btn-hover-fg) !important;
}
html[data-theme="light"] .jl-text-editor__sep {
    background: var(--jl-te-toolbar-sep) !important;
}
html[data-theme="light"] .jl-text-editor__hint {
    color: var(--jl-te-toolbar-hint) !important;
}
/* Paper canvases still get warm cream (more specific parent sets tokens) */
html[data-theme="light"] .jl-creators-editor--calm .jl-text-editor__toolbar,
html[data-theme="light"] .jl-creators-editor--warm .jl-text-editor__toolbar,
html[data-theme="light"] .jl-creators-editor--impressionist .jl-text-editor__toolbar {
    background: var(--jl-te-toolbar-bg) !important;
    border-color: var(--jl-te-toolbar-border) !important;
    color: var(--jl-te-toolbar-fg) !important;
}

/* Creators Minimal (class "default" from GetCanvasStyleClass) — theme tokens only */
.jl-creators-editor--default,
.jl-creators-editor--minimal {
    --jl-te-toolbar-bg: var(--jl-bg-charcoal);
    --jl-te-toolbar-border: var(--jl-border);
    --jl-te-toolbar-fg: var(--jl-text-secondary);
    --jl-te-toolbar-btn: var(--jl-text-primary);
    --jl-te-toolbar-btn-hover-bg: var(--jl-bg-elevated);
    --jl-te-toolbar-btn-hover-border: var(--jl-border);
    --jl-te-toolbar-btn-hover-fg: var(--jl-text-primary);
    --jl-te-toolbar-sep: var(--jl-border);
    --jl-te-toolbar-hint: var(--jl-text-muted);
}

/* Creators paper styles — warm ink on cream (overrides theme for that canvas only) */
.jl-creators-editor--calm,
.jl-creators-editor--warm,
.jl-creators-editor--impressionist {
    --jl-te-toolbar-bg: rgba(255, 252, 245, 0.96);
    --jl-te-toolbar-border: #d4c3a3;
    --jl-te-toolbar-fg: #5c4a32;
    --jl-te-toolbar-btn: #5c4a32;
    --jl-te-toolbar-btn-hover-bg: rgba(0, 0, 0, 0.06);
    --jl-te-toolbar-btn-hover-border: #c4b59a;
    --jl-te-toolbar-btn-hover-fg: #3f2e1e;
    --jl-te-toolbar-sep: #d4c3a3;
    --jl-te-toolbar-hint: #8b7355;
}

.jl-creators-editor--warm {
    --jl-te-toolbar-bg: rgba(253, 242, 248, 0.97);
    --jl-te-toolbar-border: #F9A8D4;
    --jl-te-toolbar-btn: #9F4A8C;
    --jl-te-toolbar-btn-hover-bg: rgba(159, 74, 140, 0.1);
    --jl-te-toolbar-btn-hover-border: #F9A8D4;
    --jl-te-toolbar-btn-hover-fg: #7c3569;
    --jl-te-toolbar-sep: #F9A8D4;
    --jl-te-toolbar-hint: #b07a9e;
}

.jl-creators-editor--impressionist {
    --jl-te-toolbar-bg: rgba(248, 245, 235, 0.97);
    --jl-te-toolbar-border: #d8d0b8;
    --jl-te-toolbar-btn: #0369A1;
    --jl-te-toolbar-btn-hover-bg: rgba(3, 105, 161, 0.1);
    --jl-te-toolbar-btn-hover-border: var(--jl-info-fg-strong, var(--jl-accent));
    --jl-te-toolbar-btn-hover-fg: #075985;
    --jl-te-toolbar-sep: #d8d0b8;
    --jl-te-toolbar-hint: #64748b;
}

.jl-creators-editor--caravaggio {
    --jl-te-toolbar-bg: rgba(0, 0, 0, 0.82);
    --jl-te-toolbar-border: #555;
    --jl-te-toolbar-btn: #d1d5db;
    --jl-te-toolbar-btn-hover-fg: #f3f4f6;
}

.jl-creators-style-pill--active {
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border-color: var(--jl-accent);
}

.jl-creators-mode-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    width: 100%;
}

.jl-creators-mode-btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--jl-border);
    background: transparent;
    color: var(--jl-text-primary);
    cursor: pointer;
    font-size: 0.75rem;
    white-space: nowrap;
}

.jl-creators-mode-btn:hover {
    background: var(--jl-bg-elevated);
}

.jl-creators-mode-btn--active {
    border-color: var(--jl-accent);
    background: var(--jl-bg-elevated);
    font-weight: 600;
}

.jl-creators-workspace {
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.jl-creators-workspace__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.jl-creators-workspace__title {
    font-weight: 600;
    color: var(--jl-accent);
    font-size: 0.95rem;
}

.jl-creators-sealed-badge {
    background: color-mix(in srgb, var(--jl-vault-green) 12%, var(--jl-bg-deep));
    color: var(--jl-vault-green);
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--jl-vault-green);
}

.jl-creators-title-input {
    width: 100%;
    background: var(--jl-bg-deep);
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 1.05rem;
    margin-bottom: 0.55rem;
    font-family: inherit;
}

.jl-creators-mic-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--jl-border);
}

.jl-creators-mic-hint {
    font-size: 0.8rem;
    color: var(--jl-text-muted);
}

.jl-creators-mode-panel {
    margin-top: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: var(--jl-bg-deep);
    border-radius: 6px;
    border: 1px solid var(--jl-border);
}

.creators-immersion .immersion-writing .jl-text-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.creators-immersion .immersion-writing .jl-text-editor__area {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.jl-creators-active-badge {
    font-size: 0.65rem;
    color: var(--jl-accent);
    background: var(--jl-bg-deep);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--jl-border);
}

.jl-phone-platform .jl-creators-style-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
}

.jl-phone-platform .jl-creators-style-actions {
    margin-left: 0;
    width: 100%;
}

.jl-phone-platform .jl-creators-new-btn,
.jl-phone-platform .jl-creators-immersion-btn {
    flex: 1 1 auto;
    width: auto;
}

.jl-phone-platform .jl-creators-style-label {
    padding-top: 0;
}

.jl-phone-platform .jl-creators-style-pill {
    font-size: 0.68rem;
    padding: 5px 9px;
}

.jl-phone-platform .jl-creators-mode-row button {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
    font-size: 0.88rem !important;
    padding: 8px 10px !important;
}

@media (max-width: 900px) {
    .jl-creators-style-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .jl-creators-style-label {
        padding-top: 0;
    }

    .jl-creators-style-pills {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
        gap: 0.35rem;
    }

    .jl-creators-style-pill {
        white-space: normal;
        text-align: center;
        line-height: 1.2;
        padding: 6px 8px;
        font-size: 0.68rem;
    }

    .jl-creators-mode-row button {
        flex: 1 1 calc(33.333% - 0.35rem);
        min-width: 5.5rem;
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
    }
}

@media (max-width: 520px) {
    .jl-creators-style-pills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jl-creators-mode-row button {
        flex: 1 1 calc(50% - 0.35rem);
    }
}

html[data-theme="light"] .bg-dark,
html[data-theme="light"] .bg-black {
    background-color: var(--jl-bg-charcoal) !important;
}

/* === Accessibility: Visible Focus Styles (WCAG 2.2) ===
   Critical for keyboard users. Especially important in a legal tool.
*/
:focus-visible {
    outline: 2px solid var(--jl-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* Better placeholder visibility in dark custom inputs */
input::placeholder,
textarea::placeholder {
    color: var(--jl-text-muted);
    opacity: 1;
}

/* === Immersive Layout Containers (Home splash + Journal writing view) ===
   These replace the previous hardcoded #0B1628 backgrounds so the
   professional palette applies consistently everywhere.
*/
.splash-page,
.journal-page {
    background-color: var(--jl-bg-deep);
    color: var(--jl-text-primary);
}

/* Optional: Journal top bar can also be targeted via class if we want
   to move more inline styles out in the future. For now the inline
   styles in Journal.razor already use the variables directly. */
.journal-topbar {
    background-color: var(--jl-bg-charcoal);
    border-bottom: 1px solid var(--jl-border);
}

/* ===== Light Mode Overrides for Immersive Pages (Splash + Journal) ===== */
html[data-theme="light"] .splash-page,
html[data-theme="light"] .journal-page {
    background-color: var(--jl-bg-deep);
    color: var(--jl-text-primary);
}

/* Splash light mode: keep the vault photo rich and detailed (not washed out).
   The permanent navy tint in the inline background already provides consistency.
   This overlay only adds a little extra top/bottom contrast for the header and login panel. */
html[data-theme="light"] .splash-dark-overlay {
    background: linear-gradient(to bottom, rgba(248,250,252,0.06) 0%, rgba(248,250,252,0.03) 32%, rgba(15,23,42,0.12) 65%, rgba(15,23,42,0.22) 100%) !important;
}

/* Splash login panel + feature pills adapt in light mode */
html[data-theme="light"] .splash-login-panel {
    background: rgba(255,255,255,0.92) !important;
    border-color: var(--jl-border) !important;
}

/* Light mode: Navy blue text for labels and status inside login panel */
html[data-theme="light"] .splash-login-panel {
    color: #1e3a8a;
}

html[data-theme="light"] .splash-login-panel span,
html[data-theme="light"] .splash-login-panel div:not(.splash-login-panel button) {
    color: var(--jl-accent) !important;
}

/* Keep the main Unlock button as accent blue */
html[data-theme="light"] .splash-login-panel button[style*="var(--jl-accent)"] {
    color: var(--jl-accent-text) !important;
}

/* Secondary buttons in light mode: dark text on light background */
html[data-theme="light"] .splash-login-panel button:not([style*="var(--jl-accent)"]) {
    background: #e0e7ff !important;
    color: var(--jl-accent) !important;
    border-color: var(--jl-accent) !important;
}

html[data-theme="light"] .splash-feature-pill {
    background: rgba(241,245,249,0.9) !important;
    border-color: var(--jl-accent) !important;
    color: var(--jl-text-secondary) !important;
}

/* Light mode: soften the dedicated top header scrim (still provides some contrast without hiding the image) */
html[data-theme="light"] .splash-top-scrim {
    background: linear-gradient(to bottom, rgba(15,23,42,0.16) 0%, rgba(15,23,42,0.0) 100%) !important;
}

/*
 * Home splash branding over NewVault.png (silver/gray metal; shifts with window size).
 * White type always (works on light + dark metal). No black plates.
 * Block width follows the wordmark row; subtitle/tagline span that same width.
 * Scales up on wide screens so branding is not a tiny island.
 */
.jl-splash-root .home-splash-branding,
.splash-page .home-splash-branding,
.home-splash-branding {
    /* Width hugs content so subtitle tracks icon+title, not a fixed 720px void */
    width: max-content;
    max-width: min(94vw, 52rem);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-top: 0.35rem;
    box-sizing: border-box;
}

/* Icon + JournaLock on one row; title as tall as icon */
.home-splash-branding__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    width: max-content;
    max-width: 100%;
}

.home-splash-icon {
    height: clamp(56px, 8.5vmin, 112px);
    width: clamp(56px, 8.5vmin, 112px);
    object-fit: contain;
    flex-shrink: 0;
    filter: none;
}

.home-brand-title {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: clamp(56px, 8.5vmin, 112px);
    font-size: clamp(2.35rem, 7.2vmin, 5.25rem);
    font-weight: 750;
    letter-spacing: 0.01em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
    white-space: nowrap;
    color: #ffffff !important;
    /* Hairline edge only — keeps white readable on bright silver without a plate */
    -webkit-text-stroke: 0.45px rgba(8, 15, 30, 0.22);
    paint-order: stroke fill;
}

/* Keep almost all-white; slight cool tint on J/L still reads as “white family” */
.home-brand-letter {
    color: #ffffff !important;
    font-weight: 850;
    text-shadow: none !important;
    -webkit-text-stroke: 0.45px rgba(8, 15, 30, 0.22);
    paint-order: stroke fill;
}

.home-brand-rest {
    color: #ffffff !important;
    font-weight: 750;
    text-shadow: none !important;
    opacity: 1;
    -webkit-text-stroke: 0.45px rgba(8, 15, 30, 0.22);
    paint-order: stroke fill;
}

.home-brand-mini {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: none !important;
    font-size: 0.55em;
    margin-left: 0.2em;
    opacity: 0.95;
}

/* Legacy class names (nav/other pages may still reference) */
.home-brand-journa {
    color: #ffffff;
    text-shadow: none;
}

.home-brand-lock {
    color: #ffffff;
    font-weight: 800;
    text-shadow: none;
}

/* Full width of icon+title — moderate tracking (not sparse on ultrawide) */
.home-brand-subtitle {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(0.78rem, 2.1vmin, 1.2rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    color: #ffffff !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border: none !important;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    line-height: 1.3;
    -webkit-text-stroke: 0.35px rgba(8, 15, 30, 0.24);
    paint-order: stroke fill;
}

/* Tagline under branding — same content width as branding */
.home-splash-tagline__stack {
    display: contents;
}
.home-splash-tagline__line {
    color: #ffffff !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(1.05rem, 2.6vmin, 1.75rem);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: 0.03em;
    text-shadow: none !important;
    text-align: center;
    margin: 0 0 0.65rem 0;
    padding: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-text-stroke: 0.35px rgba(8, 15, 30, 0.22);
    paint-order: stroke fill;
}
.home-splash-tagline__line--key {
    display: none !important;
}
.home-splash-tagline__pills {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}
/* Light chips — white family, no heavy black boxes */
.home-splash-tagline__pills .splash-feature-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #ffffff !important;
    font-size: clamp(0.65rem, 1.4vmin, 0.8rem);
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    text-shadow: none;
    box-shadow: none;
    backdrop-filter: blur(4px);
}

/* Wide / large screens: grow the whole mark so it is not a tiny island */
@media (min-width: 1100px) {
    .home-splash-branding {
        gap: 0.5rem;
        margin-top: 0.6rem;
    }
    .home-splash-branding__row {
        gap: 0.9rem;
    }
    .home-brand-subtitle {
        letter-spacing: 0.26em;
    }
}

@media (min-width: 1600px) {
    .home-splash-icon {
        height: clamp(88px, 7vmin, 120px);
        width: clamp(88px, 7vmin, 120px);
    }
    .home-brand-title {
        height: clamp(88px, 7vmin, 120px);
        font-size: clamp(3.75rem, 6.2vmin, 5.75rem);
    }
    .home-brand-subtitle {
        font-size: clamp(1rem, 1.8vmin, 1.28rem);
        letter-spacing: 0.28em;
    }
    .home-splash-tagline__line {
        font-size: clamp(1.35rem, 2.2vmin, 1.9rem);
    }
}

/* Force splash branding to ignore global light-theme dark text */
html[data-theme="light"] .jl-splash-root .home-brand-letter,
html[data-theme="light"] .splash-page .home-brand-letter,
html[data-theme="light"] .home-brand-letter,
html[data-theme="light"] .jl-splash-root .home-brand-rest,
html[data-theme="light"] .splash-page .home-brand-rest,
html[data-theme="light"] .home-brand-rest,
html[data-theme="light"] .jl-splash-root .home-brand-title,
html[data-theme="light"] .splash-page .home-brand-title,
html[data-theme="light"] .jl-splash-root .home-brand-subtitle,
html[data-theme="light"] .splash-page .home-brand-subtitle,
html[data-theme="light"] .home-brand-subtitle,
html[data-theme="light"] .jl-splash-root .home-splash-tagline__line,
html[data-theme="light"] .splash-page .home-splash-tagline__line,
html[data-theme="light"] .home-splash-tagline__line,
html[data-theme="light"] .home-brand-journa,
html[data-theme="light"] .home-brand-lock,
html[data-theme="light"] .home-brand-mini {
    color: #ffffff !important;
    text-shadow: none !important;
    background: none !important;
}

/* Verified / sealed badge — readable in dark and light (Starter/Lite included) */
.verified-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    background: color-mix(in srgb, var(--jl-vault-green) 22%, var(--jl-bg-charcoal));
    color: var(--jl-ok-fg);
    border: 1px solid color-mix(in srgb, var(--jl-vault-green) 55%, var(--jl-border));
}

html[data-theme="light"] .verified-badge {
    background: #D1FAE5 !important;
    color: #065F46 !important;
    border-color: #10B981 !important;
}

.jl-timestamp-badge {
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--jl-accent-hover);
}

/* Certified PDF hover action cluster */
.certified-pdf-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.certified-pdf-action .jl-certified-pdf-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.certified-pdf-action:hover .jl-certified-pdf-btn {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
}

.certified-pdf-help {
    font-size: 0.62rem !important;
    width: 16px !important;
    height: 16px !important;
}

/* Compact vault list (6+ items) */
.vault-compact-list {
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.vault-compact-hint {
    font-size: 0.75rem;
    color: var(--jl-text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed var(--jl-border);
}

/* Matter Automature / Closed — relegated cards at bottom of dockets */
.jl-matter-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  line-height: 1.2;
}
.jl-matter-badge--automature {
  background: #78350f;
  color: #fef3c7;
  border: 1px solid #f59e0b;
}
.jl-matter-badge--automature-expired {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #ef4444;
}
.jl-matter-badge--closed {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #64748b;
}
.jl-matter-row--automature,
.card.jl-matter-row--automature {
  opacity: 0.72;
  border-color: #f59e0b !important;
  background: rgba(120, 53, 15, 0.12) !important;
}
.jl-matter-row--automature td {
  background: rgba(120, 53, 15, 0.08);
}
.jl-matter-row--closed,
.card.jl-matter-row--closed {
  opacity: 0.85;
  border-style: dashed !important;
}

.vault-compact-row:hover td {
    background: color-mix(in srgb, var(--jl-accent) 8%, transparent);
}

/* Journal cards, panels, inputs etc. already use variables so they adapt.
   Extra polish for the writing view in light mode. */
html[data-theme="light"] .journal-page .new-entry-form,
html[data-theme="light"] .journal-page .entry-card {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* === Consistent tight help/info icons and bubbles (used by PriceInfo, Journal chain help, etc.) === */
.help-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    font-size: 0.62rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--jl-accent) calc(var(--help-fade, 0.65) * 100%), var(--jl-text-muted));
    background: var(--jl-bg-elevated);
    border: 1px solid color-mix(in srgb, var(--jl-accent) calc(var(--help-fade, 0.65) * 70%), var(--jl-border));
    border-radius: 999px;
    cursor: help;
    user-select: none;
    line-height: 1;
    margin-left: 2px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    opacity: calc(0.6 + var(--help-fade, 0.65) * 0.4);
}
.help-q:hover {
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border-color: var(--jl-accent);
    opacity: 1;
}

.help-q--pricing {
    width: 22px;
    height: 22px;
    font-size: 0.68rem;
    line-height: 1;
    margin-left: 0;
    flex-shrink: 0;
    align-self: center;
}

.jl-new-entry-form__title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    gap: 0.5rem;
}

.jl-new-entry-form__title-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.jl-new-entry-form__title {
    margin: 0;
    color: var(--jl-text-primary);
    font-size: 1.1rem;
    line-height: 1.2;
}

.jl-first-entry-overlay {
    position: fixed;
    inset: 0;
    z-index: 9600;
    background: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.jl-first-entry-overlay__card {
    background: var(--jl-bg-charcoal);
    border: 2px solid var(--jl-accent);
    border-radius: 14px;
    padding: 1.25rem 1.1rem;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.jl-first-entry-overlay__card--scroll {
    max-width: 420px;
    max-height: min(88dvh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
}

.jl-first-entry-overlay__card--scroll .jl-first-entry-overlay__lead,
.jl-first-entry-overlay__card--scroll .jl-first-entry-overlay__hint,
.jl-first-entry-overlay__card--scroll .jl-first-entry-overlay__dismiss {
    text-align: center;
}

.jl-first-entry-overlay__card--scroll .jl-first-entry-overlay__cta {
    display: block;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.jl-vault-intro__body {
    text-align: left;
    max-width: 520px;
    margin: 0 auto;
}

.jl-vault-intro__body p {
    margin: 0 0 0.65rem;
    color: var(--jl-text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.jl-vault-intro__footer {
    margin: 0 !important;
    color: var(--jl-text-muted) !important;
    font-size: 0.82rem !important;
}

.jl-vault-intro__footer a {
    color: var(--jl-accent);
}

.jl-empty-vault-about {
    margin-top: 1rem;
}

.jl-phone-platform .jl-vault-intro__body p {
    font-size: 1.05rem;
}

.jl-first-entry-overlay__lead {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    color: var(--jl-text-primary);
    line-height: 1.35;
}

.jl-first-entry-overlay__cta {
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 0.65rem;
}

.jl-first-entry-overlay__hint {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--jl-text-secondary);
    line-height: 1.4;
}

.jl-first-entry-overlay__dismiss {
    background: transparent;
    border: 1px solid var(--jl-border);
    color: var(--jl-text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.jl-empty-vault-card {
    background: var(--jl-bg-charcoal);
    border: 1px dashed var(--jl-border);
    padding: 1.25rem 1rem;
    text-align: center;
    border-radius: 12px;
}

.jl-empty-vault-card__lead {
    font-size: 1.05rem;
    color: var(--jl-text-secondary);
    margin-bottom: 0.35rem;
}

.jl-empty-vault-card__cta {
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border: none;
    padding: 8px 18px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.jl-journal-ladder-btn {
    background: transparent;
    color: var(--jl-text-muted);
    border: 1px solid var(--jl-border);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}

.jl-blockchain-ladder-section {
    max-width: 1100px;
    margin: 1rem auto 2rem;
    padding: 0 1rem;
}

.jl-phone-platform .jl-blockchain-ladder-section {
    margin-bottom: calc(var(--jl-journal-bottom-bar-height) + var(--jl-mobile-bottom-nav-height) + var(--jl-safe-bottom) + 12px);
}

html.guided-help-mode .help-q {
    opacity: 1;
    color: var(--jl-accent);
    border-color: var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 12%, var(--jl-bg-elevated));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--jl-accent) 35%, transparent);
}

.guided-mode-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    background: color-mix(in srgb, var(--jl-accent) 18%, var(--jl-bg-deep));
    border-bottom: 1px solid var(--jl-accent);
    color: var(--jl-text-primary);
    font-size: 0.78rem;
    padding: 6px 12px;
    font-weight: 600;
}

.guided-mode-banner__text {
    text-align: center;
}

.guided-mode-banner__off-btn {
    appearance: none;
    border: 1px solid var(--jl-accent);
    background: var(--jl-bg-charcoal);
    color: var(--jl-accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    min-height: 32px;
}

.guided-mode-banner__off-btn:hover {
    background: color-mix(in srgb, var(--jl-accent) 12%, var(--jl-bg-charcoal));
}

.guided-help-panel {
    background: color-mix(in srgb, var(--jl-accent) 10%, var(--jl-bg-charcoal));
    border: 1px solid var(--jl-accent);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--jl-text-primary);
}

/* Journal — local delete controls (light + dark) */
.journal-delete-confirm {
    --jl-del-bg: #2c1515;
    --jl-del-border: #ef4444;
    --jl-del-title: #fca5a5;
    --jl-del-body: #fed7d7;
    --jl-del-muted: #f5b7b7;
    --jl-del-btn-bg: #991b1b;
    --jl-del-btn-text: #fff;
    background: var(--jl-del-bg);
    border: 2px solid var(--jl-del-border);
    color: var(--jl-del-body);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
}

html[data-theme="light"] .journal-delete-confirm {
    --jl-del-bg: #fef2f2;
    --jl-del-border: #f87171;
    --jl-del-title: #b91c1c;
    --jl-del-body: #7f1d1d;
    --jl-del-muted: #9f1239;
    --jl-del-btn-bg: #dc2626;
    --jl-del-btn-text: #fff;
}

.journal-delete-confirm strong {
    color: var(--jl-del-title);
}

.journal-delete-confirm__meta {
    color: var(--jl-del-muted);
    font-size: 0.85rem;
}

.journal-delete-confirm__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.journal-delete-confirm__yes {
    background: var(--jl-del-btn-bg);
    color: var(--jl-del-btn-text);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.journal-delete-confirm__cancel {
    background: transparent;
    color: var(--jl-del-body);
    border: 1px solid var(--jl-del-border);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.journal-delete-btn {
    font-size: 0.8rem;
    background: color-mix(in srgb, #ef4444 14%, var(--jl-bg-elevated));
    color: #fca5a5;
    border: 1px solid color-mix(in srgb, #ef4444 45%, var(--jl-border));
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.2;
}

html[data-theme="light"] .journal-delete-btn {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.journal-delete-btn:hover {
    background: color-mix(in srgb, #ef4444 22%, var(--jl-bg-elevated));
    border-color: #ef4444;
}

html[data-theme="light"] .journal-delete-btn:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.journal-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.journal-delete-wrap {
    position: relative;
    display: inline-flex;
}

.journal-delete-wrap::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 280px;
    padding: 8px 10px;
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.journal-delete-wrap:hover::after,
.journal-delete-wrap:focus-within::after {
    opacity: 1;
    transform: translateY(0);
}

.journal-tamper-badge {
    background: color-mix(in srgb, #ef4444 18%, var(--jl-bg-elevated));
    color: #fca5a5;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #ef4444 50%, var(--jl-border));
}

html[data-theme="light"] .journal-tamper-badge {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.journal-tamper-alert {
    background: color-mix(in srgb, #ef4444 16%, var(--jl-bg-charcoal));
    border: 2px solid #ef4444;
    color: #fecaca;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

html[data-theme="light"] .journal-tamper-alert {
    background: #fef2f2;
    border-color: #f87171;
    color: #7f1d1d;
}

.journal-tamper-alert strong {
    color: #fca5a5;
}

html[data-theme="light"] .journal-tamper-alert strong {
    color: #b91c1c;
}

.journal-lock-btn--locked {
    background: color-mix(in srgb, var(--jl-vault-green) 18%, var(--jl-bg-charcoal)) !important;
    color: var(--jl-vault-green) !important;
    border-color: var(--jl-vault-green-dark) !important;
    cursor: default;
}

/* Journal open layout — full main (tools in secondary left nav, no right rail) */
.jl-journal-shell {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem 2rem;
    box-sizing: border-box;
}
.jl-journal-shell--phone { display: block; padding: 0.5rem; }
.jl-journal-main { width: 100%; min-width: 0; }
.jl-journal-statusline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    font-size: 0.78rem;
    color: var(--jl-text-secondary);
    margin: 0 0 0.75rem;
}
.jl-journal-statusline__sep { opacity: 0.45; }
.jl-journal-status-search {
    flex: 1 1 8rem;
    min-width: 6rem;
    max-width: 14rem;
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--jl-border);
    border-radius: 6px;
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
}

/* Retention table — theme-safe (readable in light + dark); long names ellipsis */
.jl-retention-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.8rem;
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
}
.jl-retention-table th,
.jl-retention-table td {
    overflow: hidden;
    border: 1px solid var(--jl-border);
    padding: 6px 8px;
    vertical-align: middle;
}
.jl-retention-thead {
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
}
.jl-retention-th {
    text-align: center;
    font-weight: 650;
    font-size: 0.75rem;
    color: var(--jl-text-primary);
    background: var(--jl-bg-elevated);
}
.jl-retention-th--left { text-align: left; }
.jl-retention-batch-row {
    background: color-mix(in srgb, var(--jl-accent) 12%, var(--jl-bg-elevated));
}
.jl-retention-batch-cell {
    padding: 5px 8px !important;
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
}
.jl-retention-batch-label {
    color: var(--jl-text-primary) !important;
    font-weight: 700;
}
.jl-retention-batch-hint {
    font-weight: 500;
    color: var(--jl-text-secondary);
}
.jl-retention-data-row {
    border-bottom: 1px solid var(--jl-border);
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
}
.jl-retention-td {
    color: var(--jl-text-primary);
}
.jl-retention-td--center { text-align: center; }
.jl-retention-td--batch {
    font-size: 0.65rem;
    font-family: ui-monospace, Consolas, monospace;
    max-width: 7rem;
    color: var(--jl-text-secondary);
}
.jl-retention-td--title {
    font-weight: 600;
    max-width: 14rem;
    color: var(--jl-text-primary);
}
.jl-retention-muted {
    color: var(--jl-text-muted);
}
.jl-retention-hold-badge {
    background: color-mix(in srgb, var(--jl-accent) 18%, var(--jl-bg-elevated));
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
}
.jl-retention-ellipsis {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    cursor: default;
    color: inherit;
}
/* Light mode: keep batch labels strong (no washed slate-on-slate) */
html[data-theme="light"] .jl-retention-batch-row {
    background: color-mix(in srgb, var(--jl-accent) 10%, #fff);
}
html[data-theme="light"] .jl-retention-batch-label,
html[data-theme="light"] .jl-retention-td--title .jl-retention-ellipsis {
    color: #0f172a !important;
}
html[data-theme="light"] .jl-retention-batch-hint,
html[data-theme="light"] .jl-retention-td--batch .jl-retention-ellipsis {
    color: #334155 !important;
}
html[data-theme="light"] .jl-retention-thead,
html[data-theme="light"] .jl-retention-th {
    background: #f1f5f9;
    color: #0f172a;
}

/* Transfer export — compact category chips that wrap on narrow widths */
.jl-export-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: stretch;
}
.jl-export-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--jl-border);
    border-radius: 999px;
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    max-width: 100%;
}
.jl-export-chip em {
    font-style: normal;
    font-weight: 500;
    opacity: 0.75;
    margin-left: 0.15rem;
}
.jl-export-chip.is-on {
    border-color: var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 14%, var(--jl-bg-elevated));
}
.jl-export-chip__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.jl-export-detail {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}
.jl-export-calculator {
    max-width: 36rem;
}

/* Account → Core tiers: clean comparison cards */
.jl-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 0.85rem;
    align-items: stretch;
}
.jl-tier-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 0.9rem;
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    background: var(--jl-bg-elevated);
    min-width: 0;
}
.jl-tier-card--featured {
    border-color: var(--jl-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--jl-accent) 35%, transparent);
}
.jl-tier-card__badge {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--jl-accent);
}
.jl-tier-card__head { margin-bottom: 0.65rem; }
.jl-tier-card__name {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--jl-text-primary);
}
.jl-tier-card__price {
    font-size: 1.35rem;
    font-weight: 750;
    color: var(--jl-text-primary);
    line-height: 1.15;
}
.jl-tier-card__price span {
    font-size: 0.78rem;
    font-weight: 550;
    color: var(--jl-text-muted);
}
.jl-tier-card__alt {
    font-size: 0.72rem;
    color: var(--jl-text-muted);
    margin-top: 0.15rem;
}
.jl-tier-card__list {
    margin: 0 0 0.85rem;
    padding-left: 1.05rem;
    font-size: 0.78rem;
    color: var(--jl-text-secondary);
    line-height: 1.45;
    flex: 1 1 auto;
}
.jl-tier-card__list li { margin-bottom: 0.25rem; }
.jl-tier-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}
.jl-tier-card__actions .btn { min-width: 5.5rem; }

/* Azure dual-nav open panels — no card squares; content is the page */
.jl-panel-page {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 1rem;
    color: var(--jl-text-primary);
}
.jl-panel-page__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    color: var(--jl-text-primary);
    line-height: 1.3;
}
.jl-panel-page__subtitle {
    font-size: 1rem;
    font-weight: 650;
    margin: 0 0 0.5rem;
    color: var(--jl-accent);
}
.jl-panel-mode .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.jl-panel-mode .card-body {
    padding: 0 !important;
}
.jl-panel-mode .card-title {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--jl-accent);
}
.jl-journal-write { margin-bottom: 1.5rem; }
.jl-journal-write__heading {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    color: var(--jl-text-primary);
}
.jl-journal-write__title {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: var(--jl-text-primary);
    border: none;
    border-bottom: 2px solid var(--jl-accent);
    border-radius: 0;
    padding: 0.55rem 0.15rem;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    outline: none;
}
.jl-journal-write__title:focus {
    border-bottom-color: var(--jl-info-fg-strong, var(--jl-accent));
}
.jl-journal-write__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}
.jl-journal-write__live {
    font-size: 0.85rem;
    color: var(--jl-vault-green);
    margin-bottom: 0.4rem;
}
.jl-journal-write__dict-status {
    font-size: 0.7rem;
    color: var(--jl-text-muted);
    margin-bottom: 0.35rem;
}
.jl-journal-write__media { margin-bottom: 0.65rem; font-size: 0.8rem; }
.jl-journal-write__media-list {
    margin: 0.25rem 0;
    color: var(--jl-text-muted);
    font-size: 0.75rem;
}
.jl-journal-attach {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin: 0.15rem 0 0.75rem;
}
.jl-journal-btn--attach {
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
}
.jl-journal-btn--attach:hover {
    border-color: var(--jl-accent);
    color: var(--jl-accent);
}
.jl-journal-attach__hint {
    font-size: 0.78rem;
    color: var(--jl-text-muted);
}
.jl-journal-attach__chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    width: 100%;
}
.jl-journal-attach__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.28rem 0.35rem 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    font-size: 0.78rem;
}
.jl-journal-attach__chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 16rem;
}
.jl-journal-attach__remove {
    border: none;
    background: transparent;
    color: var(--jl-text-muted);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0 0.25rem;
}
.jl-journal-attach__remove:hover { color: var(--jl-danger); }
.jl-journal-content--open {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.jl-journal-rail {
    flex: 0 0 9.5rem;
    width: 9.5rem;
    position: sticky;
    top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.35rem 0 0.35rem 0.35rem;
}
.jl-rail-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    cursor: pointer;
    line-height: 1.25;
}
.jl-rail-btn:hover { border-color: var(--jl-accent); }
.jl-rail-btn--primary {
    background: var(--jl-accent-solid, var(--jl-accent));
    color: var(--jl-accent-text, #fff);
    border-color: var(--jl-accent-solid, var(--jl-accent));
}
.jl-rail-btn--danger {
    background: #7F1D1D;
    color: #fff;
    border-color: #7F1D1D;
}
.jl-rail-search {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.72rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--jl-border);
    border-radius: 6px;
    background: var(--jl-bg-deep);
    color: var(--jl-text-primary);
}
.jl-rail-check {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: var(--jl-text-muted);
    cursor: pointer;
    margin: 0;
}
.jl-rail-divider {
    height: 1px;
    background: var(--jl-border);
    margin: 0.25rem 0;
}
.jl-rail-hint {
    font-size: 0.62rem;
    color: var(--jl-text-muted);
    line-height: 1.3;
}

/* Journal header — stats row + single wrapping toolbar (phone) */
.journal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--jl-bg-charcoal);
    border-bottom: 2px solid var(--jl-border);
    padding: 0.55rem 0.75rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.jl-journal-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
    font-size: 0.85rem;
    color: var(--jl-text-muted);
    min-width: 0;
    width: 100%;
}

.jl-journal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.jl-journal-toolbar > * {
    flex: 0 0 auto;
    max-width: 100%;
}

.jl-journal-search-input {
    flex: 1 1 12rem;
    min-width: min(100%, 10rem);
    max-width: 100%;
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-border);
    color: var(--jl-text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.jl-journal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 7px 12px;
    font-size: 0.85rem;
    line-height: 1.2;
    border: 1px solid var(--jl-border);
    background: transparent;
    color: var(--jl-text-secondary);
    box-sizing: border-box;
}

.jl-journal-btn--primary {
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border: none;
}

.jl-journal-btn--ghost {
    background: transparent;
    color: var(--jl-text-muted);
    font-weight: 500;
}

.jl-journal-btn--lock {
    background: transparent;
    color: var(--jl-text-secondary);
}

.jl-journal-stat {
    white-space: nowrap;
    flex: 0 0 auto;
    line-height: 1.3;
}

@media (min-width: 641px) {
    .journal-header {
        padding: 0.75rem 2rem;
    }

    .jl-journal-guided-help {
        margin: 0.75rem 2rem 0;
    }
}

/* Pricing — keep Monthly/Yearly subscribe buttons paired when list text wraps */
.jl-pricing-subscribe-btns {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    vertical-align: middle;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.jl-pricing-subscribe-btns .btn {
    flex-shrink: 0;
}

/* IP pages — production connection bar vs collapsed dev tools */
.jl-ip-connection-card .jl-ip-connection-actions .btn {
    min-width: 5.5rem;
}

.jl-ip-dev-tools.jl-expandable {
    border: 1px dashed var(--jl-border);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    background: color-mix(in srgb, var(--jl-bg-deep) 85%, var(--jl-bg-charcoal));
}

.jl-ip-dev-tools .jl-expandable__title {
    color: var(--jl-text-muted);
    font-size: 0.85rem;
}

.jl-ip-sync-row {
    padding-top: 0.35rem;
    border-top: 1px dashed var(--jl-border);
}

.jl-spec-history.jl-expandable {
    border: 1px solid var(--jl-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--jl-bg-charcoal) 90%, var(--jl-bg-deep));
}

.jl-spec-history .jl-expandable__title {
    font-size: 0.82rem;
    font-weight: 600;
}

.jl-spec-history .jl-expandable__hint {
    font-size: 0.72rem;
}

/* IP matter dashboard chrome (Mac-style breadcrumb + hero) */
.jl-ip-dashboard-chrome__crumbs {
    font-size: 0.8rem;
    color: var(--jl-text-muted);
    margin-bottom: 0.35rem;
}

.jl-ip-dashboard-chrome__crumbs a {
    color: var(--jl-text-secondary);
    text-decoration: none;
}

.jl-ip-dashboard-chrome__crumbs a:hover {
    color: var(--jl-accent);
}

.jl-ip-dashboard-chrome__sep {
    margin: 0 0.25rem;
    opacity: 0.65;
}

.jl-ip-dashboard-chrome__hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.jl-ip-dashboard-chrome__icon {
    font-size: 1.6rem;
    line-height: 1;
    flex: 0 0 auto;
}

.jl-ip-dashboard-chrome__titles {
    flex: 1 1 200px;
    min-width: 0;
}

.jl-ip-dashboard-chrome__title {
    font-weight: 600;
    color: var(--jl-text-primary);
}

.jl-ip-dashboard-chrome__subtitle {
    font-size: 0.82rem;
    color: var(--jl-text-muted);
    margin-top: 0.15rem;
}

.jl-ip-dashboard-chrome__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

.jl-ip-dashboard-chrome__inline-form {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--jl-bg-deep) 92%, var(--jl-bg-charcoal));
}

.jl-ip-matter-card__status {
    font-size: 0.78rem;
    color: var(--jl-text-muted);
}

.jl-ip-matter-card__status strong {
    color: var(--jl-text-primary);
    font-weight: 600;
}

/* IP matter list — phone vertical cards with chevron */
.jl-ip-matter-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.jl-ip-matter-list-card {
    display: flex;
    align-items: stretch;
    width: 100%;
    text-align: left;
    padding: 0.85rem 2.5rem 0.85rem 0.9rem;
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    cursor: pointer;
    position: relative;
    min-height: 64px;
    transition: border-color 0.15s, background 0.15s;
}

.jl-ip-matter-list-card:hover {
    border-color: color-mix(in srgb, var(--jl-accent) 40%, var(--jl-border));
    background: var(--jl-bg-elevated);
}

.jl-ip-matter-list-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.jl-ip-matter-list-card__title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 0.15rem;
}

.jl-ip-matter-list-card__status {
    font-size: 0.8rem;
    color: var(--jl-text-muted);
    margin-bottom: 0.1rem;
}

.jl-ip-matter-list-card__subtitle,
.jl-ip-matter-list-card__detail {
    font-size: 0.82rem;
    color: var(--jl-text-muted);
    line-height: 1.35;
}

.jl-ip-matter-list-card__footer {
    font-size: 0.75rem;
    color: var(--jl-text-muted);
    margin-top: 0.25rem;
}

.jl-ip-matter-list-card__chevron {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35rem;
    color: var(--jl-text-muted);
    line-height: 1;
}

.jl-ip-matter-list-card__delete {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1;
    appearance: none;
    border: 1px solid color-mix(in srgb, #ef4444 50%, var(--jl-border));
    background: transparent;
    color: #f87171;
    font-size: 0.75rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 28px;
    min-height: 28px;
}

.jl-ip-dashboard-chrome--phone .jl-ip-dashboard-chrome__hero {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.jl-ip-dashboard-chrome--phone .jl-ip-dashboard-chrome__actions {
    margin-left: 0;
    width: 100%;
}

.jl-ip-dashboard-chrome--phone .jl-ip-dashboard-chrome__actions .btn {
    width: 100%;
    min-height: 44px;
}

.jl-ip-inline-new--phone {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.jl-ip-intake-actions--phone {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.jl-ip-intake-actions--phone .btn {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
}

.jl-ip-files-actions--phone {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.jl-ip-files-actions--phone .btn {
    width: 100%;
    min-height: 44px;
}

.jl-phone-platform .jl-link-up-panel .jl-link-up-input,
.jl-phone-platform .jl-link-up-panel .jl-link-up-code-input {
    max-width: 100% !important;
    width: 100%;
}

.jl-phone-platform .jl-link-up-panel .btn {
    min-height: 44px;
}

.jl-phone-platform .jl-link-up-find-row {
    flex-direction: column;
    align-items: stretch !important;
}

.jl-phone-platform .jl-link-up-find-row .btn {
    width: 100%;
}

/* IP matter workspace shell (Mac tabbed workspace) */
.jl-ip-matter-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.jl-ip-matter-shell__header {
    margin-bottom: 0;
}

.jl-ip-matter-shell__header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.45rem;
}

.jl-ip-matter-shell__title-block {
    flex: 1 1 200px;
    min-width: 0;
}

.jl-ip-matter-shell__title {
    font-weight: 600;
    color: var(--jl-text-primary);
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jl-ip-matter-shell__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.jl-ip-matter-shell__type-badge,
.jl-ip-matter-shell__status-badge {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--jl-border);
}

.jl-ip-matter-shell__type-badge {
    background: color-mix(in srgb, var(--jl-accent) 12%, var(--jl-bg-deep));
    color: var(--jl-accent);
    border-color: color-mix(in srgb, var(--jl-accent) 35%, var(--jl-border));
}

.jl-ip-matter-shell__status-badge--draft {
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-muted);
}

.jl-ip-matter-shell__status-badge--active {
    background: color-mix(in srgb, var(--jl-vault-green) 14%, var(--jl-bg-deep));
    color: var(--jl-vault-green);
    border-color: color-mix(in srgb, var(--jl-vault-green) 35%, var(--jl-border));
}

.jl-ip-matter-shell__status-badge--linked {
    background: color-mix(in srgb, var(--jl-accent) 10%, var(--jl-bg-deep));
    color: var(--jl-text-secondary);
}

.jl-ip-matter-shell__header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

/* Section nav — below attorney/link code (Mac 4314–4317) */
.jl-ip-matter-shell__section-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--jl-border);
    margin-bottom: 0.65rem;
}

.jl-ip-matter-shell__section-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--jl-text-primary);
    flex: 0 0 auto;
}

.jl-ip-matter-shell__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
}

.jl-ip-matter-shell__tab {
    appearance: none;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.jl-ip-matter-shell__tab:hover:not(:disabled) {
    color: var(--jl-text-primary);
    background: var(--jl-bg-elevated);
    border-color: color-mix(in srgb, var(--jl-accent) 35%, var(--jl-border));
}

.jl-ip-matter-shell__tab--active {
    color: var(--jl-accent-text);
    background: var(--jl-accent);
    border-color: var(--jl-accent);
    font-weight: 600;
}

.jl-ip-matter-shell__tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.jl-ip-matter-shell__attorney {
    margin-top: -0.25rem;
}

/* Print / counsel / court bars — always above tabs/body (including phone hub) */
.jl-ip-matter-shell__top-chrome {
    margin: 0.35rem 0 0.65rem;
    position: sticky;
    top: 3.25rem;
    z-index: 40;
    background: var(--jl-bg-deep, #0f172a);
    padding-bottom: 0.15rem;
}

.jl-ip-matter-shell__body {
    min-height: 120px;
}

.jl-ip-matter-panel__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--jl-text-primary);
    margin-bottom: 0.65rem;
}

.jl-ip-matter-panel__subtitle {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--jl-text-primary);
    margin-bottom: 0.35rem;
}

.jl-ip-matter-shell__matter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.85rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--jl-border);
}

.jl-ip-filing-readiness {
    padding: 0.25rem 0;
}

.jl-ip-filing-readiness .form-check {
    margin-bottom: 0.35rem;
}

.jl-ip-readiness-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--jl-text-muted);
}

.jl-ip-readiness-item--done {
    color: var(--jl-text);
}

.jl-ip-readiness-item__mark {
    flex: 0 0 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--jl-text-muted);
}

.jl-ip-readiness-item--done .jl-ip-readiness-item__mark {
    color: var(--jl-vault-green);
}

.jl-ip-filing-readiness__progress {
    font-size: 0.8rem;
    color: var(--jl-text-muted);
    margin-top: 0.5rem;
}

.jl-ip-matter-shell__seal-line {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--jl-border);
    font-size: 0.75rem;
    color: var(--jl-text-muted);
    font-style: italic;
    text-align: center;
}

@media (max-width: 640px) {
    .page:not(.jl-phone-platform) .jl-ip-matter-shell__tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
    }

    .page:not(.jl-phone-platform) .jl-ip-matter-shell__tab {
        flex: 0 0 auto;
    }
}

/* Phone IP hub-and-spoke (Mac iPhone redesign parity) */
.jl-phone-platform .jl-ip-matter-shell--phone-hub .jl-ip-matter-shell__header-actions .btn {
    min-height: 44px;
    font-size: 0.9rem;
}

.jl-phone-platform .jl-ip-matter-shell__hub-back {
    appearance: none;
    border: none;
    background: none;
    color: var(--jl-accent);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0 0 0.25rem;
    cursor: pointer;
    min-height: 44px;
    text-align: left;
}

.jl-ip-matter-hub__progress {
    font-size: 0.85rem;
    color: var(--jl-text-muted);
    margin: 0 0 0.65rem;
}

.jl-ip-matter-hub__grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.jl-phone-platform .jl-ip-matter-hub__grid {
    gap: 0.65rem;
}

.jl-ip-matter-hub__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 2.25rem 0.85rem 0.9rem;
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    cursor: pointer;
    position: relative;
    min-height: 56px;
    transition: border-color 0.15s, background 0.15s;
}

.jl-phone-platform .jl-ip-matter-hub__card {
    min-height: 64px;
    font-size: 1rem;
}

.jl-ip-matter-hub__card:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--jl-accent) 40%, var(--jl-border));
    background: var(--jl-bg-elevated);
}

.jl-ip-matter-hub__card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.jl-ip-matter-hub__card-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
}

.jl-phone-platform .jl-ip-matter-hub__card-title {
    font-size: 1.02rem;
}

.jl-ip-matter-hub__card-hint {
    font-size: 0.8rem;
    color: var(--jl-text-muted);
    line-height: 1.35;
}

.jl-ip-matter-hub__card-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-top: 0.15rem;
}

.jl-ip-matter-hub__card-status--active {
    background: color-mix(in srgb, var(--jl-vault-green) 16%, var(--jl-bg-deep));
    color: var(--jl-vault-green);
}

.jl-ip-matter-hub__card-status--pending {
    background: color-mix(in srgb, #f59e0b 16%, var(--jl-bg-deep));
    color: #fbbf24;
}

.jl-ip-matter-hub__card-status--neutral {
    background: var(--jl-bg-elevated);
    color: var(--jl-text-muted);
}

.jl-ip-matter-hub__chevron {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35rem;
    color: var(--jl-text-muted);
    line-height: 1;
}

/* Phone box rule: headings + rules, not cards. Applies to every phone page. */
.jl-phone-platform .card,
.jl-phone-platform .card-header,
.jl-phone-platform .card-body,
.jl-phone-platform .card-footer,
.jl-phone-platform .jl-contact-link-hub,
.jl-phone-platform .jl-ip-connection-card,
.jl-phone-platform .jl-ip-matter-panel,
.jl-phone-platform .jl-ip-dashboard-chrome,
.jl-phone-platform .jl-ip-matter-list-card,
.jl-phone-platform .jl-ip-matter-hub__card,
.jl-phone-platform .jl-touch-row,
.jl-phone-platform .alert,
.jl-phone-platform .jl-ip-matter-shell__journal-area,
.jl-phone-platform .jl-ip-matter-panel__journal-area,
.jl-phone-platform .input-group,
.jl-phone-platform .input-group-text {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.jl-phone-platform .jl-hub-progress-bar,
.jl-phone-platform .jl-ip-matter-hub__progress,
.jl-phone-platform .jl-ip-matter-hub__card-hint,
.jl-phone-platform .jl-ip-matter-list-card__chevron,
.jl-phone-platform .jl-ip-matter-hub__chevron,
.jl-phone-platform .jl-hub-title {
    display: none !important;
}

.jl-phone-platform .jl-touch-row,
.jl-phone-platform .jl-ip-matter-hub__card,
.jl-phone-platform .jl-ip-matter-list-card {
    min-height: 3.25rem;
    padding: 0.9rem 0;
    margin: 0;
    border-bottom: 1px solid var(--jl-border) !important;
    justify-content: space-between;
}

.jl-phone-platform .jl-touch-row--selected {
    box-shadow: none !important;
    border-bottom-color: var(--jl-accent) !important;
}

.jl-phone-platform .jl-hub-toolbar {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem !important;
    padding: 0.4rem 0 1rem;
    border-bottom: 1px solid var(--jl-border);
}

.jl-phone-platform .jl-hub-chip,
.jl-phone-platform .jl-hub-toolbar .btn,
.jl-phone-platform .jl-hub-toolbar button {
    border: none !important;
    background: transparent !important;
    min-height: 2.85rem !important;
    width: auto !important;
    padding: 0.4rem 0.1rem !important;
    font-size: 1.02rem !important;
    font-weight: 650 !important;
    text-decoration: underline;
    text-underline-offset: 0.22em;
    border-radius: 0 !important;
}

.jl-phone-platform .jl-ip-matter-panel__title,
.jl-phone-platform .jl-atty-phone__h {
    font-size: 1.25rem;
    margin: 1.35rem 0 0.45rem;
}

.jl-phone-platform .jl-ip-matter-shell__header {
    background: transparent;
    border-bottom: 1px solid var(--jl-border);
    padding-bottom: 0.7rem;
}

.jl-phone-platform .jl-ip-matter-shell__type-badge,
.jl-phone-platform .jl-ip-matter-shell__status-badge {
    border: none;
    background: transparent;
    padding: 0;
    font-weight: 600;
}

/* People rows: no boxed input-group. Underline fields + text add. */
.jl-phone-platform .input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.jl-phone-platform .input-group .form-control,
.jl-phone-platform .form-control {
    border: none !important;
    border-bottom: 1px solid var(--jl-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0;
    padding-right: 0;
    min-height: 2.85rem;
}
.jl-phone-platform .btn-outline-primary,
.jl-phone-platform .btn-outline-secondary,
.jl-phone-platform .btn-outline-danger.py-0 {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    padding-left: 0 !important;
    min-height: 2.75rem;
}

.jl-phone-platform .jl-phone-send-row .btn-success {
    background: #166534 !important;
    color: #fff !important;
    border: none !important;
    text-decoration: none !important;
    min-height: 2.85rem;
    padding: 0.45rem 0.9rem !important;
    border-radius: 0.35rem !important;
    box-shadow: none !important;
}
.jl-phone-platform .jl-phone-send-row .btn-outline-primary {
    background: transparent !important;
    color: #1e3a8a !important;
    text-decoration: underline !important;
}

/* Not linked must stay readable in bright mode once the pill is gone. */
.jl-phone-platform .jl-link-status-corner.is-off,
.jl-phone-platform .jl-link-status-corner.is-off .jl-link-status-corner__label {
    color: #9b1c1c !important;
    background: transparent !important;
    border: none !important;
    font-weight: 750 !important;
}
.jl-phone-platform .jl-link-status-corner.is-live,
.jl-phone-platform .jl-link-status-corner.is-live .jl-link-status-corner__label {
    color: #166534 !important;
    background: transparent !important;
    border: none !important;
    font-weight: 750 !important;
}

.jl-phone-platform .content {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.jl-crumb-back {
    appearance: none;
    border: 0;
    background: none;
    color: var(--jl-accent);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 0.35rem 0 0;
    min-height: 2.4rem;
    cursor: pointer;
}

.jl-phone-platform .jl-dash-ai-plan {
    width: 100%;
    font-size: 1.2rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--jl-text-primary);
    margin: 0.15rem 0 0.75rem;
}

.jl-phone-platform .jl-header-help-link,
.jl-phone-platform a[href="/help"] {
    display: none !important;
}

.jl-group-trail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.4rem 0 0.7rem;
}
.jl-group-trail__back {
    appearance: none;
    border: 1px solid var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 12%, var(--jl-bg-elevated));
    color: var(--jl-accent);
    min-height: 2rem;
    padding: 0.2rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.jl-group-trail__path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--jl-text-primary);
}
.jl-group-trail__path a,
.jl-group-trail__group {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--jl-accent);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}
.jl-group-trail__sep {
    color: var(--jl-text-muted);
    font-weight: 500;
}
.jl-group-trail__here {
    color: var(--jl-text-primary);
}

/* Identity + attorney-update panels used inline styles — flatten those too. */
.jl-phone-platform .ip-client-identity,
.jl-phone-platform .jl-surface-deep,
.jl-phone-platform .jl-atty-update-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: inherit !important;
}
.jl-phone-platform .ip-client-identity > .d-flex:first-child {
    display: none;
}
.jl-phone-platform .form-select {
    border: none !important;
    border-bottom: 1px solid var(--jl-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0;
    min-height: 2.85rem;
}

/* Send / Get: never white text on a flattened light page. */
.jl-phone-platform .jl-hub-send-btn,
.jl-phone-platform .jl-hub-send-btn.btn-primary,
.jl-phone-platform .jl-hub-toolbar .jl-hub-send-btn,
.jl-phone-platform .jl-hub-toolbar .btn-primary {
    color: #1e3a8a !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.jl-phone-platform .jl-hub-send-btn--sent,
.jl-phone-platform .jl-hub-toolbar .jl-hub-send-btn--sent {
    color: #166534 !important;
}
.jl-phone-platform .jl-hub-get-btn,
.jl-phone-platform .jl-hub-get-btn--waiting,
.jl-phone-platform .jl-hub-toolbar .jl-hub-get-btn,
.jl-phone-platform .jl-hub-toolbar .jl-hub-get-btn--waiting {
    color: #92400e !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.jl-phone-platform .jl-hub-get-btn--got,
.jl-phone-platform .jl-hub-toolbar .jl-hub-get-btn--got {
    color: #166534 !important;
}

.jl-phone-platform .jl-ip-attorney-client-list--phone {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.jl-phone-platform .jl-ip-attorney-client-card--phone {
    width: 100%;
    min-width: 0 !important;
}

/* Big-finger rows: 48px min, not giant. Use on both phone apps from now on. */
.jl-phone-platform .jl-touch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.95rem;
    margin: 0 0 0.45rem;
    border: 1px solid var(--jl-border);
    border-radius: 12px;
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    text-align: left;
    font: inherit;
}
.jl-phone-platform .jl-touch-row--selected {
    border-color: var(--jl-accent);
    box-shadow: inset 0 0 0 1px var(--jl-accent);
}
.jl-phone-platform .jl-touch-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    text-align: left;
    font: inherit;
}
.jl-phone-platform .jl-touch-row__name {
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.25;
}
.jl-phone-platform .jl-touch-row__meta {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--jl-text-muted);
}
.jl-phone-platform .jl-touch-row__side {
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 0;
    background: transparent;
    color: var(--jl-text-muted);
    font-size: 1.35rem;
    line-height: 1;
}
.jl-phone-platform .jl-touch-input {
    min-height: 3rem;
    font-size: 1.05rem;
    margin-bottom: 0.55rem;
}
.jl-phone-platform .jl-touch-btn {
    min-height: 3rem;
    width: 100%;
    font-size: 1.05rem;
    font-weight: 650;
    margin-top: 0.15rem;
    background: var(--jl-accent);
    color: var(--jl-accent-text);
    border: 0;
    border-radius: 12px;
}
.jl-phone-platform .jl-atty-phone {
    padding-bottom: 0.5rem;
}
.jl-phone-platform .jl-atty-phone__h {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.35rem 0 0.5rem;
    color: var(--jl-text-primary);
}
.jl-phone-platform .jl-atty-phone__block:first-child .jl-atty-phone__h {
    margin-top: 0.35rem;
}
.jl-phone-platform .jl-atty-phone__types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.1rem;
    margin: 0.35rem 0 0.85rem;
}
.jl-phone-platform .jl-atty-phone__type {
    appearance: none;
    border: 0;
    background: none;
    padding: 0.35rem 0;
    min-height: 2.5rem;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--jl-text-muted);
    text-decoration: underline;
    text-underline-offset: 0.22em;
}
.jl-phone-platform .jl-atty-phone__type.is-on {
    color: var(--jl-text-primary);
    font-weight: 750;
}
.jl-phone-platform .jl-atty-phone__block + .jl-atty-phone__block {
    margin-top: 0.35rem;
}
.jl-phone-platform .jl-atty-phone__quiet {
    font-size: 0.95rem;
    color: var(--jl-text-muted);
    margin: 0.25rem 0 0.5rem;
}
.jl-phone-platform .jl-atty-phone__label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0.35rem 0 0.2rem;
    color: var(--jl-text-secondary);
}
.jl-phone-platform .jl-atty-phone__you {
    margin: 0.7rem 0 0;
    font-size: 0.88rem;
    color: var(--jl-text-muted);
}
.jl-phone-platform .jl-atty-phone__you-btn {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    padding: 0.35rem 0;
    text-align: left;
}

.jl-phone-platform .jl-phone-link {
    margin-top: 0.35rem;
}
.jl-phone-platform .jl-phone-link__code {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.85rem;
    padding: 0.85rem 0.9rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--jl-text-primary);
    background: var(--jl-bg-deep);
    border: 2px solid var(--jl-accent);
    border-radius: 12px;
}
.jl-phone-platform .jl-phone-link__name {
    margin-bottom: 0.85rem;
    min-height: 2.75rem;
    font-size: 1.05rem;
}
.jl-phone-platform .jl-phone-link .jl-touch-btn {
    width: 100%;
    margin-top: 0.15rem;
}
.jl-phone-platform .jl-touch-btn--ghost {
    background: transparent;
    color: var(--jl-text-secondary);
    border: 1px solid var(--jl-border);
}

/* Primary form actions can stretch; toolbars stay compact chips (see hub toolbar rules). */
.jl-phone-platform .attorney-page .card-body > .btn,
.jl-phone-platform .attorney-page .card-body > .d-grid .btn {
    width: 100%;
    min-height: 2.5rem;
    margin-top: 0.25rem;
}

.jl-phone-platform .attorney-page .jl-hub-toolbar .btn,
.jl-phone-platform .attorney-page .jl-hub-toolbar button,
.jl-phone-platform .attorney-page .card-header .btn,
.jl-phone-platform .attorney-page .card-header button {
    width: auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
}

.jl-phone-platform .jl-ip-matter-shell__body .form-control,
.jl-phone-platform .jl-ip-matter-shell__body .form-select,
.jl-phone-platform .jl-ip-matter-shell__body .btn {
    font-size: 1rem;
}

.jl-phone-platform .jl-ip-matter-shell__body .form-label {
    font-size: 0.92rem;
}

/* Settings — vault status one row at wide screens */
.jl-vault-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: center;
    font-size: 0.8rem;
    line-height: 1.35;
}

@media (min-width: 992px) {
    .jl-vault-status-row {
        flex-wrap: nowrap;
        white-space: nowrap;
    }
}

.jl-vault-status-sep {
    color: var(--jl-text-muted);
    opacity: 0.65;
}

/* Settings — 2FA setup (light + dark) */
.jl-2fa-intro {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.jl-2fa-intro__steps {
    flex: 1 1 280px;
    max-width: 520px;
    color: var(--jl-text-secondary);
}

.jl-2fa-setup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.jl-2fa-setup-panel {
    flex: 0 1 260px;
    background: color-mix(in srgb, var(--jl-accent) 8%, var(--jl-bg-deep));
    border: 1px solid var(--jl-accent);
    border-radius: 10px;
    padding: 1rem;
    color: var(--jl-text-primary);
}

html[data-theme="light"] .jl-2fa-setup-panel {
    background: color-mix(in srgb, var(--jl-accent) 6%, var(--jl-bg-deep));
}

.jl-2fa-setup-panel__title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--jl-text-primary);
}

.jl-2fa-setup-panel__qr {
    max-width: 180px;
    border: 6px solid var(--jl-bg-charcoal);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #fff;
}

html[data-theme="light"] .jl-2fa-setup-panel__qr {
    border-color: #e2e8f0;
}

.jl-2fa-setup-panel__secret {
    font-family: monospace;
    font-size: 0.72rem;
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    padding: 4px 8px;
    border-radius: 6px;
    word-break: break-all;
}

.jl-2fa-setup-panel__code-input {
    width: 140px;
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-align: center;
    background: var(--jl-bg-deep);
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    border-radius: 6px;
    padding: 4px 8px;
}

.jl-2fa-setup-guide {
    flex: 1 1 280px;
    max-width: 420px;
    background: var(--jl-bg-deep);
    border: 1px solid var(--jl-border);
    border-radius: 10px;
    padding: 1rem;
    color: var(--jl-text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

.jl-2fa-setup-guide strong {
    color: var(--jl-text-primary);
}

/* Settings — voice / Groq / Siri */
.jl-groq-rate-pill {
    background: color-mix(in srgb, var(--jl-vault-green) 18%, var(--jl-bg-elevated));
    color: var(--jl-vault-green);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.65rem;
    white-space: nowrap;
    border: 1px solid color-mix(in srgb, var(--jl-vault-green) 35%, var(--jl-border));
}

html[data-theme="light"] .jl-groq-rate-pill {
    background: #ecfdf5;
    color: #047857;
    border-color: #10B981;
}

.jl-siri-panel {
    margin-top: 0.5rem;
    padding: 0.75rem 0.85rem;
    background: var(--jl-bg-deep);
    border: 1px solid var(--jl-border);
    border-radius: 8px;
}

.jl-siri-panel__title {
    font-weight: 600;
    color: var(--jl-text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.jl-siri-code {
    background: var(--jl-bg-charcoal);
    color: var(--jl-accent);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.78rem;
    border: 1px solid var(--jl-border);
}

/* Blockchain Ladder promo — theme-aware (incl. light mode purple accent) */
.jl-ladder-promo {
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.78rem;
    color: var(--jl-text-secondary);
}

.jl-ladder-promo__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.jl-ladder-promo__title {
    font-weight: 700;
    color: var(--jl-text-primary);
}

.jl-ladder-promo__badge {
    font-size: 0.75rem;
    font-weight: 600;
    background: none;
    color: var(--jl-text-muted);
    padding: 0;
    border: none;
    border-radius: 0;
}

html[data-theme="light"] .jl-ladder-promo__badge {
    background: none;
    color: var(--jl-text-muted);
}

.jl-ladder-promo__note {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--jl-text-muted);
}

.jl-ladder-promo__body {
    line-height: 1.35;
    margin-bottom: 6px;
    color: var(--jl-text-secondary);
}

.jl-ladder-promo__body strong {
    color: var(--jl-text-primary);
}

html[data-theme="light"] .jl-ladder-promo {
    background: #faf8ff;
    color: #3f3f46;
}

html[data-theme="light"] .jl-ladder-promo__title,
html[data-theme="light"] .jl-ladder-promo__body strong {
    color: var(--jl-accent);
}

html[data-theme="light"] .jl-ladder-promo__body,
html[data-theme="light"] .jl-ladder-promo__context {
    color: #52525b;
}

html[data-theme="light"] .jl-ladder-promo__hint,
html[data-theme="light"] .jl-ladder-promo__empty {
    color: #71717a;
}

html[data-theme="light"] .jl-ladder-promo__connections {
    border-color: color-mix(in srgb, var(--jl-accent) 25%, #e4e4e7);
}

html[data-theme="light"] .jl-ladder-promo__btn.btn-outline-primary {
    color: var(--jl-accent);
    border-color: var(--jl-accent);
}

html[data-theme="light"] .jl-ladder-promo__btn.btn-outline-secondary {
    color: #52525b;
    border-color: #d4d4d8;
}

.jl-ladder-promo__connections {
    font-size: 0.65rem;
    margin-bottom: 4px;
    background: color-mix(in srgb, var(--jl-accent) 8%, var(--jl-bg-deep));
    border: 1px solid var(--jl-border);
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--jl-text-primary);
}

html[data-theme="light"] .jl-ladder-promo__connections {
    background: color-mix(in srgb, var(--jl-accent) 6%, #faf5ff);
}

.jl-ladder-promo__chip {
    background: color-mix(in srgb, var(--jl-accent-solid) 18%, var(--jl-bg-elevated));
    color: var(--jl-accent);
    padding: 0 5px;
    border-radius: 4px;
    margin-right: 4px;
    font-size: 0.62rem;
    border: 1px solid color-mix(in srgb, var(--jl-accent) 35%, var(--jl-border));
}

.jl-ladder-promo__hint,
.jl-ladder-promo__empty,
.jl-ladder-promo__context {
    font-size: 0.62rem;
    color: var(--jl-text-muted);
    margin-bottom: 4px;
    line-height: 1.35;
}

.jl-ladder-promo__context {
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.jl-ladder-promo__pricing {
    margin-top: 4px;
    font-size: 0.65rem;
    color: var(--jl-danger);
}

html[data-theme="light"] .jl-ladder-promo__pricing {
    color: #9f1239;
}

.jl-ladder-promo__btn {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.jl-ladder-promo__link {
    font-size: 0.7rem;
    align-self: center;
    color: var(--jl-accent) !important;
}

/* Control Center table */
.jl-cc-table-head th {
    background: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    border: 1px solid var(--jl-border) !important;
}

.jl-cc-table td,
.jl-cc-table th {
    border: 1px solid var(--jl-border) !important;
}

/* =====================================================================
   Emergency Backup Kit — standardized visual language (all app pages)
   ===================================================================== */
.jl-emergency-kit {
    --jl-ek-bg: #2c1515;
    --jl-ek-border: #ef4444;
    --jl-ek-title: #fca5a5;
    --jl-ek-lead: #fed7d7;
    --jl-ek-note: #fca5a5;
    --jl-ek-muted: #f5b7b7;
    background: var(--jl-ek-bg);
    border: 2px solid var(--jl-ek-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    color: var(--jl-ek-lead);
}

html[data-theme="light"] .jl-emergency-kit {
    --jl-ek-bg: #fef2f2;
    --jl-ek-title: #b91c1c;
    --jl-ek-lead: #7f1d1d;
    --jl-ek-note: #991b1b;
    --jl-ek-muted: #9f1239;
}

.jl-emergency-kit--sm {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border-width: 2px;
}

.jl-emergency-kit--md {
    border-width: 2px;
}

.jl-emergency-kit--lg {
    padding: 1rem 1.15rem;
    border-width: 3px;
}

.jl-emergency-kit__title {
    color: var(--jl-ek-title);
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.jl-emergency-kit--sm .jl-emergency-kit__title {
    font-size: 0.92rem;
}

.jl-emergency-kit--lg .jl-emergency-kit__title {
    font-size: 1.08rem;
}

.jl-emergency-kit__lead {
    color: var(--jl-ek-lead);
    font-size: 0.86rem;
    line-height: 1.45;
    margin: 0 0 0.5rem;
}

.jl-emergency-kit__note {
    color: var(--jl-ek-note);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.jl-emergency-kit__footer-note {
    color: var(--jl-ek-muted);
    font-size: 0.72rem;
    line-height: 1.35;
    margin: 0.5rem 0 0;
}

.jl-emergency-kit__highlight {
    border: 2px solid var(--jl-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--jl-accent) 28%, transparent);
    font-weight: 700;
}

.jl-emergency-kit__print-callout {
    margin: 0.75rem 0 0;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    border: 2px solid var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 12%, var(--jl-bg-deep));
    color: var(--jl-text-primary);
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 600;
}

.jl-emergency-kit__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.jl-emergency-kit__confirmed {
    background: var(--jl-ok-bg, #166534);
    color: var(--jl-ok-fg);
    border: 1px solid var(--jl-ok-border, #166534);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    margin-top: 0.5rem;
}
html[data-theme="dark"] .jl-emergency-kit__confirmed {
    background: #166534;
    color: #86efac; /* JL-L8-ALLOW dark kit strip */
    border-color: #166534;
}

.jl-emergency-kit__details summary {
    color: var(--jl-ek-note);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.84rem;
    margin-top: 0.35rem;
}

.jl-emergency-kit__details-body {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--jl-ek-lead);
    line-height: 1.45;
}

.jl-emergency-kit__details-body ul {
    margin: 0 0 0.4rem;
    padding-left: 1.1rem;
}

/* Live preview sub-panel */
.jl-emergency-kit-preview {
    background: #0a0a0a;
    border: 2px dashed #ef4444;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #e5e5e5;
}

html[data-theme="light"] .jl-emergency-kit-preview {
    background: #1e1e1e;
    color: #f1f5f9;
}

.jl-emergency-kit-preview__banner {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.jl-emergency-kit-preview__key-label {
    font-size: 0.72rem;
    color: #f1f5f9;
    margin-bottom: 0.2rem;
}

.jl-emergency-kit-preview__key {
    background: #000;
    color: #22c55e;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.84rem;
    padding: 6px 8px;
    border: 1px solid #334155;
    word-break: break-all;
    user-select: all;
    margin-bottom: 0.5rem;
    cursor: pointer;
    line-height: 1.25;
}

.jl-emergency-kit-preview__body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.jl-emergency-kit-preview__steps {
    flex: 1;
    min-width: 200px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #f8fafc;
}

.jl-emergency-kit-preview__qr {
    width: 140px;
    height: 140px;
    image-rendering: pixelated;
    border: 3px solid #fff;
    background: #fff;
}

.jl-emergency-kit-preview--compact .jl-emergency-kit-preview__qr {
    width: 112px;
    height: 112px;
}

.jl-emergency-kit-preview__toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.jl-emergency-kit-preview__confirm {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid #3f3f3f;
}

.jl-emergency-kit-preview__confirm-label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: #fca5a5;
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: pointer;
    margin: 0;
}

.jl-emergency-kit-preview__confirm-label input {
    margin-top: 3px;
    flex-shrink: 0;
}

.jl-emergency-kit-preview__confirm-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-left: 0.5rem;
}

/* Emergency kit buttons — consistent across pages */
.btn-emergency-primary {
    color: #fff;
    background: #ef4444;
    border: 2px solid #ef4444;
    font-weight: 600;
}

.btn-emergency-primary:hover,
.btn-emergency-primary:focus {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

.btn-emergency-secondary {
    color: #fecaca;
    background: transparent;
    border: 2px solid #f87171;
    font-weight: 600;
}

.btn-emergency-secondary:hover,
.btn-emergency-secondary:focus {
    color: #7f1d1d;
    background: #fecaca;
    border-color: #ef4444;
}

.btn-emergency-outline {
    color: var(--jl-accent);
    background: transparent;
    border: 1px solid var(--jl-accent);
    font-weight: 600;
}

html[data-theme="light"] .btn-emergency-secondary {
    color: #991b1b;
    background: #fff;
    border-color: #dc2626;
}

html[data-theme="light"] .btn-emergency-secondary:hover,
html[data-theme="light"] .btn-emergency-secondary:focus {
    color: #fff;
    background: #dc2626;
    border-color: #b91c1c;
}

/* Info bubble popup - tight, great looking, matches dark/light theme */
.info-bubble {
    position: absolute;
    top: 100%;
    left: -20px;
    margin-top: 5px;
    z-index: 300;
    background: #1e2937;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 5px 6px 5px 6px;
    font-size: 0.62rem;
    line-height: 1.25;
    width: 200px;
    max-width: 210px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.42);
}
html[data-theme="light"] .info-bubble {
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    border-color: var(--jl-border);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.info-bubble a {
    color: var(--jl-accent);
    text-decoration: underline;
    display: inline-block;
    margin-top: 2px;
}
.info-bubble .bubble-title {
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--jl-accent);
    font-size: 0.76rem;
}

/* Better target scrolling for Settings quick nav - accounts for sticky header */
#security, #local, #aws, #emergency-kit, #emergency-kit-standalone, #master-key-title {
    scroll-margin-top: 90px;
}

/* Dashboard Control Center — Vault Security left panel */
.vault-security-panel {
    flex: 0 0 210px;
    min-width: 190px;
    max-width: 260px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    background: color-mix(in srgb, #ef4444 14%, var(--jl-bg-charcoal));
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--jl-text-primary);
}

html[data-theme="light"] .vault-security-panel {
    background: color-mix(in srgb, #ef4444 10%, var(--jl-bg-charcoal));
}

.vault-security-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fca5a5;
}

html[data-theme="light"] .vault-security-title {
    color: #b91c1c;
}

.vault-security-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.vault-security-links a,
.vault-security-link-btn {
    color: var(--jl-accent);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.vault-security-links a:hover,
.vault-security-link-btn:hover {
    text-decoration: underline;
}

.vault-security-panel .jl-expandable--nested {
    margin-top: 0.15rem;
    margin-bottom: 0;
}

.vault-security-alert {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #fecaca;
}

html[data-theme="light"] .vault-security-alert {
    color: #991b1b;
}

.vault-security-alert a {
    color: var(--jl-accent);
    font-weight: 600;
}
.info-bubble .bubble-body {
    color: #e2e8f0;
}
html[data-theme="light"] .info-bubble .bubble-body {
    color: #334155;
}
.info-bubble .bubble-alert {
    color: #fda4af;
    margin-bottom: 3px;
}
html[data-theme="light"] .info-bubble .bubble-alert {
    color: #9f1239;
}
.info-bubble ul {
    margin: 0 0 5px 14px;
    padding: 0;
    font-size: 0.72rem;
}
.info-bubble li {
    margin-bottom: 1px;
}
.info-bubble .close-x,
.close-x {
    position: absolute;
    top: 2px;
    right: 4px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.95rem;
    cursor: pointer;
    line-height: 1;
    padding: 1px 5px;
    opacity: 0.8;
}
html[data-theme="light"] .info-bubble .close-x,
html[data-theme="light"] .close-x {
    color: #64748b;
}
.close-x:hover {
    opacity: 1;
    color: #f87171;
}
html[data-theme="light"] .close-x:hover {
    color: #b91c1c;
}

/* Hover-only bubble support (for PatentInventor "I want this to be permanent" on "This looks good" button) */
.btn-hover-wrapper .info-bubble {
    display: none;
    /* overrides for hover positioning above the button */
    top: auto;
    bottom: 100%;
    left: 0;
    margin-bottom: 5px;
    margin-top: 0;
    width: 190px;
    padding: 5px 8px;
    font-size: 0.65rem;
    line-height: 1.3;
    white-space: normal;
}
.btn-hover-wrapper:hover .info-bubble {
    display: block;
}

/* =====================================================================
   Emergency Kit (Master Key) print + preview polish
   - Makes the "Print This Preview" button produce a clean page that starts
     with the actual kit content at the top (with real margins) instead of
     the entire Settings page from the very top.
   - Also improves the live on-screen preview a little (bigger QR/key)
     and gives reasonable print behavior even if the user does Ctrl+P manually.
   ===================================================================== */

/* Live preview tweaks: make key and QR a bit more prominent on screen */
.jl-emergency-kit-preview__key {
    font-size: 0.9rem;
    line-height: 1.25;
}

.jl-emergency-kit-preview__qr {
    width: 152px;
    height: 152px;
}

@media print {
    .jl-emergency-kit-preview {
        page-break-before: always;
        background: #ffffff !important;
        color: #111111 !important;
        border: 3px solid #c00 !important;
    }
    .jl-emergency-kit-preview * {
        color: #111111 !important;
    }
    .jl-emergency-kit-preview__key {
        background: #f4f4f4 !important;
        color: #000000 !important;
        border-color: #333 !important;
    }
    .jl-emergency-kit-preview__toolbar,
    .jl-emergency-kit-preview__confirm {
        display: none !important;
    }
}

/* Site-wide footer — readable link and slogan sizes */
.footer {
    font-size: 0.95rem;
}

.jl-footer-theme-btn {
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--jl-bg-elevated);
    color: var(--jl-text-secondary);
    border: 1px solid var(--jl-border);
    cursor: pointer;
}

.jl-footer-slogan {
    font-size: 0.95rem !important;
    min-height: 2.2rem;
    line-height: 1.4;
}

.jl-footer-links {
    font-size: 0.9rem;
}

.jl-footer-links a {
    color: var(--jl-text-muted);
}

/* =====================================================================
   Android / Phone adaptation
   Bottom nav, slide-out drawer, safe areas, compact headers
   ===================================================================== */

:root {
    --jl-mobile-bottom-nav-height: 52px;
    --jl-journal-bottom-bar-height: 7.75rem;
    --jl-mobile-topbar-height: 72px;
    --jl-safe-top: var(--jl-status-bar-height, env(safe-area-inset-top, 0px));
    --jl-safe-bottom: env(safe-area-inset-bottom, 0px);
    --jl-safe-left: env(safe-area-inset-left, 0px);
    --jl-safe-right: env(safe-area-inset-right, 0px);
}

/* Legacy duplicate safe-area strip — removed from MainLayout; keep hidden if any stale markup remains. */
.jl-safe-area-top {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
}

.jl-mobile-back-btn {
    font-size: 1.15rem;
    line-height: 1;
}

.jl-phone-platform .jl-mobile-back-btn {
    appearance: none;
    border: 1px solid var(--jl-accent);
    background: var(--jl-accent);
    color: #fff;
    min-height: 2rem;
    border-radius: 999px;
    padding: 0.12rem 0.85rem 0.16rem;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
}

/* Mobile chrome hidden on desktop */
.jl-mobile-topbar,
.jl-mobile-bottom-nav,
.jl-nav-backdrop {
    display: none;
}

/* Platform-gated phone chrome (Android/iOS — not viewport width) */
.jl-phone-platform .jl-top-header {
    display: none !important;
}

.jl-mobile-topbar-center {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    padding: 0 4px;
}

.jl-mobile-topbar-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--jl-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.jl-mobile-topbar-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.jl-mobile-topbar-alerts {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 52%;
}

/* Matched trio: Chain OK / Account OK / Files OK — same height, width, type. */
.jl-header-status-pills {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.jl-header-status-pills > button,
.jl-header-status-pills .jl-vault-alert-btn,
.jl-header-status-pills .jl-top-header__chain-btn {
    box-sizing: border-box;
    width: 6.75rem;
    min-width: 6.75rem;
    max-width: 6.75rem;
    height: 1.7rem;
    min-height: 1.7rem;
    padding: 0 0.55rem;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.jl-vault-alert-btn {
    font-size: 0.72rem;
    padding: 0 0.55rem;
    min-height: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 650;
    white-space: nowrap;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.jl-vault-alert-btn--compact {
    font-size: 0.9rem;
    padding: 0.2rem 0.75rem;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}

.jl-vault-alert-btn--ok {
    background: var(--jl-vault-green-dark);
    color: #e8f5e9;
    border-color: var(--jl-vault-green);
}

.jl-vault-alert-btn--warn {
    background: #b45309;
    color: #fffbeb;
    border-color: #f59e0b;
}

.jl-vault-alert-btn--danger {
    background: #c62828;
    color: white;
    border-color: #c62828;
}

.jl-mobile-topbar-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.jl-mobile-theme-btn {
    appearance: none;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    width: 30px;
    height: 26px;
    border-radius: 5px;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.jl-mobile-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin: -0.25rem 0 0.75rem;
    padding: 0 0.15rem;
}

.jl-phone-platform .jl-mobile-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.65rem;
    margin: 0.35rem 0 1rem;
}
.jl-phone-platform .jl-mobile-page-actions .btn,
.jl-phone-platform .jl-mobile-page-actions a.btn {
    font-size: 1.02rem !important;
    font-weight: 650;
    min-height: 2.85rem;
    padding: 0.55rem 0.9rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
}

.jl-bring-up-to-speed-btn__short {
    display: none;
}

.jl-phone-platform .jl-bring-up-to-speed-btn__full {
    display: none;
}

.jl-phone-platform .jl-bring-up-to-speed-btn__short {
    display: inline;
}

.jl-phone-platform .jl-page-header__actions .btn,
.jl-phone-platform .jl-page-header__actions a.btn {
    font-size: 1.02rem !important;
    min-height: 2.85rem;
    padding: 0.55rem 0.9rem !important;
}

.jl-dashboard-phone-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.jl-dashboard-phone-status--center {
    justify-content: center;
    width: 100%;
}

.jl-phone-platform .jl-dashboard-page.container {
    padding-top: 0.35rem !important;
}

.jl-header-help-link {
    margin-left: 0.35rem;
    font-size: 0.75rem;
}

.jl-phone-platform .jl-mobile-topbar {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start;
    gap: 0;
    box-sizing: border-box;
    height: auto !important;
    min-height: var(--jl-mobile-topbar-height) !important;
    max-height: none !important;
    padding: 0.35rem calc(12px + var(--jl-safe-right)) 0.4rem calc(12px + var(--jl-safe-left));
    background: var(--jl-bg-charcoal);
    border-bottom: 1px solid var(--jl-border);
    position: sticky;
    top: 0;
    z-index: 240;
    flex-shrink: 0;
}
.jl-phone-platform .jl-mobile-topbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    min-height: 2.5rem;
}
.jl-phone-platform .jl-mobile-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}
.jl-phone-platform .jl-mobile-topbar__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    padding-top: 0.3rem;
}
.jl-phone-platform .jl-mobile-ai-btn {
    appearance: none;
    border: 1px solid var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 14%, var(--jl-bg-elevated));
    color: var(--jl-accent);
    min-height: 2rem;
    border-radius: 999px;
    padding: 0.12rem 0.7rem 0.16rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.08em;
    white-space: nowrap;
    line-height: 1;
    font-variant-ligatures: none;
}
.jl-phone-platform .jl-mobile-ai-btn__ai {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
}
.jl-phone-platform .jl-mobile-ai-btn__sist {
    font-size: 0.9rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    line-height: 1;
    position: relative;
    top: 0.03em;
}

/* Same pill shape as AIsist — status, SOS, proof chips, tool chips. */
.jl-phone-platform .jl-vault-alert-btn,
.jl-phone-platform .jl-proof-pill,
.jl-phone-platform .jl-tool-chip,
.jl-phone-platform .jl-ip-matter-hub__card-status,
.jl-phone-platform .jl-dashboard-phone-status .jl-vault-alert-btn {
    min-height: 2rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.jl-phone-platform .jl-mobile-topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.jl-phone-platform .jl-mobile-menu-btn {
    appearance: none;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    width: 30px;
    height: 26px;
    border-radius: 5px;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jl-phone-platform .jl-mobile-topbar-icon {
    height: 20px;
    width: auto;
    display: block;
}

.jl-phone-platform .jl-mobile-topbar-actions {
    height: 100%;
    align-items: center;
}

.jl-phone-platform .jl-mobile-theme-btn,
.jl-phone-platform .jl-mobile-menu-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: 999px;
    font-size: 0.95rem;
}

.jl-mobile-guided-btn {
    appearance: none;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-muted);
    width: 30px;
    height: 26px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.jl-mobile-guided-btn--on {
    border-color: var(--jl-accent);
    color: var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 14%, var(--jl-bg-elevated));
}

.jl-phone-platform .jl-mobile-guided-btn {
    width: auto;
    min-width: 2rem;
    min-height: 2rem;
    height: 2rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 650;
}

.jl-phone-platform .jl-mobile-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    min-height: var(--jl-mobile-bottom-nav-height);
    padding-bottom: var(--jl-safe-bottom);
    background: var(--jl-bg-charcoal);
    border-top: 1px solid var(--jl-border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.18);
}

.jl-phone-platform .jl-mobile-nav-item {
    font-size: 0.9rem;
    justify-content: center;
}

.jl-phone-platform .jl-mobile-nav-label {
    font-size: 0.88rem;
}

.jl-phone-platform .jl-mobile-nav-icon {
    font-size: 1.05rem;
}

.jl-phone-platform.jl-nav-open .jl-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 210;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    padding: 0;
}

.jl-mobile-topbar-spacer {
    width: 30px;
    height: 26px;
    flex-shrink: 0;
}

.jl-phone-overflow {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.7rem 1rem calc(var(--jl-mobile-bottom-nav-height, 52px) + var(--jl-safe-bottom) + 1.25rem);
    background: var(--jl-bg-charcoal);
    position: relative;
    z-index: 1;
}

html[data-theme="light"] .jl-phone-overflow {
    background: #F4F6FA;
    border-bottom-color: #9AA6B8;
}

.jl-phone-overflow__modes {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.jl-phone-overflow__mode {
    flex: 1;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    border-radius: 8px;
    padding: 0.45rem 0.35rem;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
}

.jl-phone-overflow__mode.is-on {
    border-color: var(--jl-accent);
    background: color-mix(in srgb, var(--jl-accent) 16%, var(--jl-bg-elevated));
}

.jl-phone-overflow__hint {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: var(--jl-text-muted);
}

.jl-phone-overflow__connect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--jl-accent) 18%, var(--jl-bg-elevated));
    border: 1px solid var(--jl-accent);
    color: var(--jl-text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.jl-phone-overflow__heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0.15rem 0 0;
    padding: 0.42rem 0.3rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--jl-text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.jl-phone-overflow__heading.is-open {
    background: color-mix(in srgb, var(--jl-accent) 10%, transparent);
}

.jl-phone-overflow__chevron {
    width: 1rem;
    flex: 0 0 auto;
    color: var(--jl-text-muted);
}

.jl-phone-overflow__link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.2rem;
    color: var(--jl-text-primary);
    text-decoration: none;
    font-size: 0.92rem;
    border-radius: 6px;
    appearance: none;
    border: 0;
    background: none;
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.jl-phone-overflow__link:hover,
.jl-phone-overflow__link:focus {
    background: color-mix(in srgb, var(--jl-accent) 12%, transparent);
}

.jl-phone-platform .jl-cc-panel {
    flex-direction: column !important;
}

.jl-phone-platform .jl-cc-panel .vault-security-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
    padding: 6px 8px;
    gap: 4px;
}

.jl-phone-platform .vault-security-title {
    font-size: 0.82rem;
    line-height: 1.2;
}

.jl-phone-platform .vault-security-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.78rem;
}

.jl-phone-platform .vault-security-panel .jl-expandable--nested {
    display: none;
}

.jl-phone-platform .jl-mobile-menu-btn--overflow {
    width: 36px;
    height: 30px;
    font-size: 1.15rem;
}

.jl-phone-platform .jl-transfer-columns .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
}

.jl-phone-platform .jl-transfer-upload-zone--phone {
    min-height: 0;
    border-style: solid;
    border-width: 1px;
    padding: 0.45rem 0.5rem !important;
    border-radius: 10px;
}

.jl-phone-platform .jl-transfer-upload-zone--phone .jl-transfer-upload-icon {
    display: none !important;
}

.jl-phone-platform .jl-transfer-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--jl-text-primary);
}

.jl-phone-platform .jl-transfer-upload-label {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.jl-phone-platform .jl-transfer-upload-actions {
    gap: 0.35rem !important;
    margin-top: 0.25rem !important;
}

.jl-phone-platform .jl-transfer-upload-actions .btn {
    min-height: 0;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 8px;
}

.jl-phone-platform .jl-transfer-certify {
    font-size: 0.78rem;
    margin-bottom: 0.35rem !important;
}

/* Export type picks: 2-col compact chips, not a tall checkbox list */
.jl-phone-platform .jl-transfer-page--phone .jl-export-type-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 0.4rem;
    margin-bottom: 0.4rem;
}
.jl-phone-platform .jl-transfer-page--phone .jl-export-type-grid > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    flex: unset !important;
    padding: 0 !important;
}
.jl-phone-platform .jl-transfer-page--phone .jl-export-type-grid .form-check {
    margin: 0;
    padding: 0.28rem 0.35rem 0.28rem 1.45rem;
    border: 1px solid var(--jl-border);
    border-radius: 8px;
    background: var(--jl-bg-deep);
    font-size: 0.7rem !important;
    min-height: 0;
}
.jl-phone-platform .jl-transfer-page--phone .jl-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.jl-phone-platform .jl-transfer-page--phone .jl-export-actions .btn {
    width: auto !important;
    min-height: 0 !important;
    flex: 1 1 calc(50% - 0.25rem);
    font-size: 0.7rem !important;
    padding: 0.28rem 0.45rem !important;
}
.jl-phone-platform .jl-transfer-page--phone .card-body {
    padding: 0.65rem 0.7rem !important;
}
.jl-phone-platform .jl-transfer-page--phone .p-4 {
    padding: 0.5rem !important;
}

/* Counsel packet chip inside hub toolbar — one clean cell (no ? below the button) */
.jl-phone-platform .jl-hub-toolbar .counsel-packet-action {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    min-height: 0 !important;
}
.jl-phone-platform .jl-hub-toolbar .counsel-packet-action .help-q {
    /* Tooltip stays on the Packet button title; floating ? broke the 3-col grid */
    display: none !important;
}
.jl-phone-platform .jl-hub-toolbar .jl-counsel-packet-btn {
    width: 100% !important;
    min-height: 0 !important;
    font-size: 0.68rem !important;
    padding: 0.28rem 0.25rem !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

.jl-phone-platform .jl-transfer-recent-list li:last-child {
    border-bottom: none !important;
}

.jl-phone-platform .jl-transfer-page--phone .col-lg-6.mb-4 {
    margin-bottom: 0.75rem !important;
}

/* Phone readability — bump base size for comfortable reading */
.jl-phone-platform,
.jl-android-platform {
    font-size: 22px;
}

.jl-phone-platform .content,
.jl-phone-platform main {
    font-size: 1rem;
    line-height: 1.45;
}

.jl-phone-platform .journal-header {
    padding: 0.35rem 0.5rem;
    border-bottom-width: 1px;
}

.jl-phone-platform .journal-header--phone .jl-journal-stats--phone {
    font-size: 0.88rem;
    gap: 0.3rem 0.5rem;
    line-height: 1.25;
}

.jl-phone-platform .journal-header--phone .jl-journal-stats--phone .help-q {
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
}

.jl-phone-platform .jl-journal-search-input {
    flex: 1 1 100%;
    font-size: 1rem;
    padding: 7px 11px;
}

.jl-phone-platform .jl-journal-toolbar .jl-journal-btn {
    font-size: 0.85rem;
    padding: 6px 10px;
}

.jl-phone-platform .jl-journal-toolbar--top {
    margin-bottom: 0.25rem;
}

.jl-phone-platform .jl-journal-bottom-bar {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.55rem 0.35rem 0.55rem;
    margin-top: 0;
    background: var(--jl-bg-charcoal);
    border-top: 1px solid var(--jl-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12);
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--jl-mobile-bottom-nav-height) + var(--jl-safe-bottom));
    z-index: 90;
}

.jl-phone-platform .jl-journal-bottom-bar .jl-journal-search-input {
    width: 100%;
    flex: 1 1 100%;
    font-size: 1rem;
    padding: 8px 11px;
}

.jl-phone-platform .jl-journal-bottom-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: stretch;
}

.jl-phone-platform .jl-journal-bottom-bar__actions .jl-journal-btn {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.88rem;
    padding: 8px 10px;
    justify-content: center;
}

.jl-phone-platform .jl-journal-content {
    padding: 0.75rem 0.35rem calc(var(--jl-journal-bottom-bar-height) + var(--jl-mobile-bottom-nav-height) + var(--jl-safe-bottom) + 12px) !important;
}

.jl-phone-platform .jl-new-entry-form {
    padding: 1rem !important;
}

.jl-phone-platform .jl-new-entry-form__title {
    font-size: 1.15rem;
}

.jl-phone-platform .jl-new-entry-form textarea {
    font-size: 1.1rem !important;
    min-height: 180px;
}

.jl-phone-platform .journal-entry-card {
    font-size: 1.05rem;
}

.jl-phone-platform .jl-journal-guided-help {
    margin: 0.5rem 0.75rem 0 !important;
}

/* Settings — sticky section nav (JournaLock navy-slate + accent palette) */
.jl-settings-nav {
    position: sticky;
    top: 0;
    z-index: 120;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px;
    margin: 0 0 1rem;
    border-radius: 10px;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-charcoal);
    box-shadow: 0 2px 8px rgba(11, 22, 40, 0.18);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.jl-settings-nav__btn {
    flex: 0 0 auto;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 999px;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-deep);
    color: var(--jl-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.jl-settings-nav__btn:hover {
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    border-color: var(--jl-accent-solid);
}

.jl-settings-nav__btn--accent {
    border-color: var(--jl-accent-solid);
    background: var(--jl-accent-solid);
    color: var(--jl-accent-text);
}

.jl-settings-nav__btn--accent:hover {
    background: var(--jl-accent-hover);
    border-color: var(--jl-accent-hover);
    color: var(--jl-accent-text);
}

.jl-settings-nav__btn--vault {
    border-color: var(--jl-success-hover);
    background: var(--jl-success-solid);
    color: var(--jl-accent-text);
}

.jl-settings-nav__btn--vault:hover {
    background: var(--jl-success-hover);
    border-color: var(--jl-success-hover);
    color: var(--jl-accent-text);
}

.jl-settings-nav__btn--danger {
    border-color: var(--jl-danger-hover);
    background: var(--jl-danger-solid);
    color: var(--jl-accent-text);
}

.jl-settings-nav__btn--danger:hover {
    background: var(--jl-danger-hover);
    border-color: var(--jl-danger-hover);
    color: var(--jl-accent-text);
}

/* Settings — bold success/danger (replace Bootstrap pastels) */
.jl-settings-page .btn-success {
    background-color: var(--jl-success-solid) !important;
    border-color: var(--jl-success-hover) !important;
    color: var(--jl-accent-text) !important;
    font-weight: 600;
}

.jl-settings-page .btn-success:hover,
.jl-settings-page .btn-success:focus {
    background-color: var(--jl-success-hover) !important;
    border-color: var(--jl-success-hover) !important;
    color: var(--jl-accent-text) !important;
}

.jl-settings-page .btn-danger {
    background-color: var(--jl-danger-solid) !important;
    border-color: var(--jl-danger-hover) !important;
    color: var(--jl-accent-text) !important;
    font-weight: 600;
}

.jl-settings-page .btn-danger:hover,
.jl-settings-page .btn-danger:focus {
    background-color: var(--jl-danger-hover) !important;
    border-color: var(--jl-danger-hover) !important;
    color: var(--jl-accent-text) !important;
}

.jl-settings-page .btn-outline-success {
    color: var(--jl-success-solid) !important;
    border-color: var(--jl-success-solid) !important;
    font-weight: 600;
}

.jl-settings-page .btn-outline-success:hover,
.jl-settings-page .btn-outline-success:focus {
    background-color: var(--jl-success-solid) !important;
    border-color: var(--jl-success-solid) !important;
    color: var(--jl-accent-text) !important;
}

.jl-settings-page [id] {
    scroll-margin-top: 88px;
}

/* Deep-link land (Security → Emergency Kit, settings chips) */
.jl-emergency-kit-section.jl-scroll-target-flash,
.jl-scroll-target-flash {
    outline: 3px solid var(--jl-accent, #38bdf8) !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.25);
    transition: outline 0.2s ease, box-shadow 0.2s ease;
}

/* Compact Settings — same content, less vertical sprawl */
.jl-settings-page {
    padding-top: 0.75rem !important;
    padding-bottom: 1rem !important;
}
.jl-settings-page .card.mb-4 {
    margin-bottom: 0.55rem !important;
}
.jl-settings-page .card-body {
    padding: 0.55rem 0.75rem !important;
}
.jl-settings-page .card-title {
    font-size: 0.98rem !important;
    margin-bottom: 0.35rem !important;
}
.jl-settings-page .card-body > p.small,
.jl-settings-page .card-body > .small {
    margin-bottom: 0.4rem !important;
    line-height: 1.3;
}
.jl-settings-page .mb-3 {
    margin-bottom: 0.45rem !important;
}
.jl-settings-page .mb-2 {
    margin-bottom: 0.35rem !important;
}
.jl-settings-page hr {
    margin: 0.5rem 0 !important;
}
.jl-settings-page .form-label {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
}
.jl-settings-page .form-control-sm,
.jl-settings-page .btn-sm {
    font-size: 0.78rem;
}
.jl-settings-nav {
    margin-bottom: 0.55rem !important;
    gap: 0.25rem !important;
}
.jl-settings-nav__btn {
    padding: 0.2rem 0.45rem !important;
    font-size: 0.68rem !important;
}

.jl-phone-platform .content .container,
.jl-phone-platform .content .container-fluid,
.jl-phone-platform .jl-settings-page,
.jl-phone-platform .jl-dashboard-page,
.jl-phone-platform .jl-retention-page,
.jl-phone-platform .jl-transfer-page,
.jl-phone-platform .jl-security-page,
.jl-phone-platform .jl-help-page,
.jl-phone-platform .jl-calendar-page,
.jl-phone-platform .jl-backups-page,
.jl-phone-platform .jl-creators-page {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

.jl-phone-platform .jl-journal-content {
    padding: 0.65rem 0.5rem !important;
}

.jl-phone-platform .jl-ip-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--jl-bg-deep);
    border-bottom: 1px solid var(--jl-border);
    margin: -0.75rem -0.5rem 0.75rem;
    padding: 0.35rem 0.5rem 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.jl-phone-platform .jl-ip-sticky-header .jl-mobile-page-actions {
    margin-bottom: 0.35rem;
}

.jl-phone-platform .jl-security-intro {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.jl-phone-platform .jl-retention-page > p {
    font-size: 0.82rem;
    line-height: 1.35;
}

.jl-phone-platform .jl-retention-table {
    min-width: 720px;
}

/* Collapsible section titles — tap to reveal explanations */
.jl-expandable {
    margin-bottom: 0.6rem;
}

.jl-expandable--collapsed-hit {
    cursor: pointer;
}

.jl-expandable--collapsed-hit .jl-expandable__toggle {
    min-height: 44px;
}

.jl-expandable__toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    text-align: left;
    background: var(--jl-bg-elevated);
    border: 1px solid var(--jl-border);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    color: var(--jl-text-primary);
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.25;
    cursor: pointer;
}

.jl-expandable__toggle:hover {
    border-color: var(--jl-accent);
}

.jl-expandable__chevron {
    flex-shrink: 0;
    width: 0.85rem;
    color: var(--jl-accent);
    font-size: 0.82rem;
}

.jl-expandable__title {
    flex: 1 1 auto;
    min-width: 0;
}

.jl-expandable__hint {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--jl-text-muted);
    max-width: 42%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jl-expandable__body {
    margin-top: 0.35rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--jl-border);
    border-radius: 6px;
    background: var(--jl-bg-charcoal);
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--jl-text-secondary);
}

.jl-expandable--nested {
    margin-bottom: 0.45rem;
}

.jl-expandable--nested .jl-expandable__toggle {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--jl-border);
    border-radius: 0;
}

.jl-expandable--nested .jl-expandable__body {
    border: none;
    background: transparent;
    padding: 0.35rem 0 0.15rem 1.1rem;
    margin-top: 0.15rem;
}

.jl-expandable--empty-vault .jl-expandable__body {
    padding: 0.5rem 0.25rem 0.15rem;
    text-align: center;
}

.jl-expandable--card .jl-expandable__toggle {
    background: var(--jl-bg-charcoal);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.jl-expandable--card.jl-expandable--open .jl-expandable__toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.jl-expandable--card .jl-expandable__body {
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.jl-phone-platform .jl-security-intro,
.jl-phone-platform .jl-retention-page > p,
.jl-phone-platform .jl-retention-page .alert-info {
    display: none;
}

.jl-phone-platform .jl-page-header {
    position: static;
    z-index: 1;
    padding: 0.35rem 0.5rem 0.4rem;
    margin: 0 0 0.55rem;
    top: auto;
}

.jl-phone-platform .jl-page-header__crumbs,
.jl-phone-platform .jl-page-header__toolbar-title {
    display: none;
}

.jl-phone-platform .jl-splash-root {
    background-size: cover !important;
    background-position: center top !important;
}

/* Splash content shell (desktop defaults in .home-splash-content) */
.home-splash-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem 3.25rem;
    align-items: center;
    box-sizing: border-box;
}

/* Shared hero: one column sized by the icon+JournaLock row */
.home-splash-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: min(94vw, 52rem);
    margin: 0 auto;
    box-sizing: border-box;
}

.home-splash-tagline {
    text-align: center;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 0.65rem;
    margin-bottom: 0.25rem;
    box-sizing: border-box;
}

.jl-splash-root .home-splash-branding,
.splash-page .home-splash-branding,
.home-splash-branding {
    width: 100%;
    max-width: none;
}

.home-splash-signup {
    width: 100%;
    max-width: 420px;
    margin-top: auto;
    text-align: center;
    background: rgba(15, 23, 42, 0.75);
    border: 2px solid var(--jl-accent);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
}

.home-splash-login {
    width: 100%;
    max-width: 380px;
    margin-top: auto;
    background: rgba(15, 23, 42, 0.68);
    border: 2px solid var(--jl-accent);
    border-radius: 12px;
    padding: 0.75rem 0.85rem 0.65rem;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
}

/* Phone splash: no footer (layout host + legacy ~ selector) */
html.jl-maui-android .splash-page ~ .footer,
html.jl-maui-mobile .splash-page ~ .footer,
html.jl-maui-android .splash-layout-footer-host,
html.jl-maui-mobile .splash-layout-footer-host,
.jl-phone-platform .splash-layout-footer-host {
    display: none !important;
}

/* Fit one phone screen — no runaway vertical growth */
html.jl-maui-android .splash-layout-shell,
html.jl-maui-mobile .splash-layout-shell,
html.jl-maui-android .splash-page,
html.jl-maui-mobile .splash-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

html.jl-maui-android .jl-splash-root,
html.jl-maui-mobile .jl-splash-root {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-size: cover !important;
    background-position: center center !important;
}

/* Phone splash: compact scale + bottom-pin panel */
html.jl-maui-android .home-splash-content--phone,
html.jl-maui-mobile .home-splash-content--phone,
.home-splash-content--phone {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100%;
    max-height: 100%;
    padding: 0.65rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    align-items: center !important;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow: hidden;
}

html.jl-maui-android .home-splash-branding--phone,
html.jl-maui-mobile .home-splash-branding--phone,
.home-splash-branding--phone {
    width: max-content;
    max-width: min(96vw, 360px);
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    margin-top: 0.15rem;
    text-align: center;
    flex-shrink: 0;
}

html.jl-maui-android .home-splash-branding--phone .home-splash-icon,
html.jl-maui-mobile .home-splash-branding--phone .home-splash-icon,
.home-splash-branding--phone .home-splash-icon {
    height: 48px;
    width: 48px;
}

html.jl-maui-android .home-splash-branding--phone .home-brand-title,
html.jl-maui-mobile .home-splash-branding--phone .home-brand-title,
.home-splash-branding--phone .home-brand-title {
    font-size: 1.85rem !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
    height: 48px !important;
    white-space: nowrap;
    max-width: none;
    overflow: visible;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
html.jl-maui-android .home-splash-branding--phone .home-brand-rest,
html.jl-maui-mobile .home-splash-branding--phone .home-brand-rest,
.home-splash-branding--phone .home-brand-rest {
    color: #f1f5f9 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

html.jl-maui-android .home-splash-branding--phone .home-brand-mini,
html.jl-maui-mobile .home-splash-branding--phone .home-brand-mini,
.home-splash-branding--phone .home-brand-mini {
    font-size: 0.55em;
}

html.jl-maui-android .home-splash-branding--phone .home-brand-subtitle,
html.jl-maui-mobile .home-splash-branding--phone .home-brand-subtitle,
.home-splash-branding--phone .home-brand-subtitle {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    margin-top: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Mini JL unlock: no subtitle under wordmark */
html.jl-maui-android .home-splash-branding--phone .home-brand-subtitle:empty,
html.jl-maui-mobile .home-splash-branding--phone .home-brand-subtitle:empty {
    display: none;
}

html.jl-maui-android .home-splash-tagline--phone,
html.jl-maui-mobile .home-splash-tagline--phone {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    max-width: 100%;
    flex-shrink: 0;
}

html.jl-maui-android .home-splash-tagline--phone .home-splash-tagline__stack,
html.jl-maui-mobile .home-splash-tagline--phone .home-splash-tagline__stack {
    padding: 0;
    gap: 0;
    max-width: none;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

html.jl-maui-android .home-splash-tagline--phone .home-splash-tagline__line,
html.jl-maui-mobile .home-splash-tagline--phone .home-splash-tagline__line {
    font-size: 1.05rem !important;
    text-shadow: none !important;
}

html.jl-maui-android .home-splash-tagline--phone .home-splash-tagline__line--key,
html.jl-maui-mobile .home-splash-tagline--phone .home-splash-tagline__line--key {
    display: none !important;
}

html.jl-maui-android .home-splash-signup--phone,
html.jl-maui-mobile .home-splash-signup--phone,
.home-splash-signup--phone {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    width: 100%;
    max-width: 400px;
    padding: 0.85rem 0.9rem !important;
    border-radius: 14px;
    flex-shrink: 0;
}

html.jl-maui-android .home-splash-signup--phone .home-splash-signup__title,
html.jl-maui-mobile .home-splash-signup--phone .home-splash-signup__title {
    font-size: 1.15rem !important;
    margin-bottom: 0.3rem !important;
}

html.jl-maui-android .home-splash-signup--phone .home-splash-signup__lead,
html.jl-maui-mobile .home-splash-signup--phone .home-splash-signup__lead {
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.45rem !important;
}

html.jl-maui-android .home-splash-signup--phone .home-splash-signup__pricing,
html.jl-maui-mobile .home-splash-signup--phone .home-splash-signup__pricing {
    font-size: 0.68rem !important;
    margin-bottom: 0.55rem !important;
}

html.jl-maui-android .home-splash-signup--phone .home-splash-signup__primary,
html.jl-maui-mobile .home-splash-signup--phone .home-splash-signup__primary {
    padding: 11px !important;
    font-size: 0.95rem !important;
    margin-bottom: 0.45rem !important;
}

html.jl-maui-android .home-splash-signup--phone .home-splash-signup__secondary,
html.jl-maui-mobile .home-splash-signup--phone .home-splash-signup__secondary {
    padding: 9px !important;
    font-size: 0.82rem !important;
}

html.jl-maui-android .home-splash-signup--phone .home-splash-signup__footnote,
html.jl-maui-mobile .home-splash-signup--phone .home-splash-signup__footnote {
    margin-top: 0.55rem !important;
    font-size: 0.62rem !important;
    line-height: 1.25 !important;
}

html.jl-maui-android .home-splash-login--phone,
html.jl-maui-mobile .home-splash-login--phone,
.home-splash-login--phone {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    width: 100%;
    max-width: 360px;
    flex-shrink: 0;
    padding: 0.65rem 0.75rem 0.55rem !important;
}

/* Phone: shorter top scrim so branding + panel fit */
html.jl-maui-android .splash-top-scrim,
html.jl-maui-mobile .splash-top-scrim {
    height: 96px !important;
}

.jl-phone-platform .home-splash-branding {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: 0 0.75rem;
    gap: 6px;
    box-sizing: border-box;
}

.jl-phone-platform .home-brand-title--stacked {
    font-size: 1.05rem !important;
    letter-spacing: 1px !important;
}

.jl-phone-platform .home-splash-icon {
    height: 48px;
}

/* Phone shell: bottom nav clearance (never use bare viewport @media for this) */
.jl-phone-platform.jl-mobile-shell main,
.jl-phone-platform.jl-mobile-shell .content,
.jl-phone-platform.jl-mobile-shell .jl-journal-content main {
    padding-bottom: calc(var(--jl-mobile-bottom-nav-height) + var(--jl-safe-bottom) + 4.5rem);
}

.jl-phone-platform.jl-mobile-shell .footer {
    display: none !important;
}

.jl-phone-platform.jl-mobile-shell .content {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
}

/* Phone: stack multi-column Bootstrap rows app-wide */
.jl-phone-platform .content .row > [class*="col-md-"],
.jl-phone-platform .content .row > [class*="col-lg-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.jl-phone-platform .jl-settings-page .card {
    margin-bottom: 0.75rem;
}

.jl-phone-platform .jl-settings-page .card-body {
    padding: 0.85rem;
}

.jl-phone-platform .jl-settings-page .d-flex.flex-wrap.gap-2 .btn,
.jl-phone-platform .jl-settings-page .d-flex.flex-wrap.gap-3 .btn {
    flex: 1 1 auto;
    min-height: 38px;
}

.jl-phone-platform .jl-modal-backdrop {
    padding: 0;
    align-items: stretch;
    /* Sit under status bar / notches safely */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}

.jl-phone-platform .jl-bulk-browser-modal {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.jl-phone-platform .jl-bulk-browser-body {
    flex-direction: column;
}

.jl-phone-platform .jl-bulk-browser-master {
    border-right: none;
    border-bottom: 1px solid var(--jl-border);
    max-height: none;
    flex: 1 1 auto;
}

.jl-phone-platform .jl-bulk-browser-detail {
    width: 100%;
    min-width: 0;
    max-height: 32vh;
}

/* Header clears Android status bar / cutout */
.jl-bulk-browser-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--jl-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 0.5rem;
    background: var(--jl-bg-charcoal);
}

.jl-bulk-browser-header__titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.jl-bulk-browser-header__meta {
    font-size: 0.72rem;
}

.jl-bulk-browser-toolbar {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--jl-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    flex-shrink: 0;
    background: var(--jl-bg-deep);
}

.jl-bulk-browser-facets {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: none;
}

.jl-bulk-browser-facets::-webkit-scrollbar {
    display: none;
}

.jl-bulk-browser-facets .btn {
    flex: 0 0 auto;
    font-size: 0.72rem !important;
    padding: 0.28rem 0.55rem !important;
}

.jl-bulk-browser-search {
    max-width: 260px;
    font-size: 0.8rem;
    height: 2rem;
}

.jl-phone-platform .jl-bulk-browser-header {
    /* Extra top padding so title never collides with status bar / clock */
    padding-top: calc(0.55rem + env(safe-area-inset-top, 12px)) !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-bottom: 0.5rem !important;
    align-items: flex-start;
}

.jl-phone-platform .jl-bulk-browser-header strong {
    font-size: 1rem !important;
    line-height: 1.2;
}

.jl-phone-platform .jl-bulk-browser-close {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.jl-phone-platform .jl-bulk-browser-toolbar {
    padding: 0.45rem 0.65rem 0.55rem;
}

.jl-phone-platform .jl-bulk-browser-search {
    max-width: 100%;
    width: 100%;
    height: 2.15rem;
}

.jl-phone-platform .jl-bulk-page-size {
    display: none !important;
}

.jl-phone-platform .jl-bulk-browser-modal > div:last-child {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    flex-wrap: wrap;
}

.jl-bulk-browser-modal thead th {
    color: var(--jl-text-primary) !important;
    background-color: var(--jl-bg-charcoal) !important;
    border-color: var(--jl-border) !important;
}

.jl-bulk-browser-modal .table {
    --bs-table-color: var(--jl-text-primary);
    --bs-table-bg: transparent;
    --bs-table-hover-color: var(--jl-text-primary);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
    color: var(--jl-text-primary);
}

.jl-bulk-browser-modal .table td,
.jl-bulk-browser-modal .table th {
    color: var(--jl-text-primary);
}

/* Browser P0 — integrity locks + proof badges */
.jl-integrity-legend {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.68rem !important;
    letter-spacing: 0.01em;
}

.jl-integrity-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.jl-integrity-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.jl-integrity-Intact { color: #22c55e !important; }
.jl-integrity-Broken { color: #ef4444 !important; }
.jl-integrity-Pending { color: #f59e0b !important; }
.jl-integrity-Stored { color: var(--jl-info-fg-strong, var(--jl-accent)) !important; }
.jl-integrity-Unknown { color: #94a3b8 !important; }

.jl-proof-badges-cell {
    white-space: nowrap;
}

.jl-proof-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.12rem 0.32rem;
    border-radius: 0.25rem;
    color: #f8fafc;
    margin-right: 0.12rem;
    vertical-align: middle;
    line-height: 1.2;
}

.jl-proof-badge--link { background: #1d4ed8; }
.jl-proof-badge--ladder { background: #6d28d9; }
.jl-proof-badge--chainmail { background: #0f766e; }

/* Browser P1 — Connections drawer */
.jl-connections-drawer {
    overflow-y: auto;
}

.jl-drawer-section {
    border: 1px solid var(--jl-border);
    border-radius: 0.4rem;
    padding: 0.5rem 0.55rem;
    margin-bottom: 0.55rem;
    background: rgba(15, 23, 42, 0.45);
}

.jl-drawer-section__title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--jl-accent);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.jl-proof-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.28rem;
    font-size: 0.72rem;
}

.jl-proof-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem 0.85rem;
    padding: 0.55rem 0.75rem 0.7rem;
    border-bottom: 1px solid var(--jl-border, #334155);
    background: color-mix(in srgb, var(--jl-bg-elevated, #1e293b) 88%, transparent);
}
.jl-proof-picker__label {
    flex: 1 1 100%;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--jl-text-primary, #0f172a);
}
.jl-proof-picker__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.jl-proof-chip {
    border: 1px solid var(--jl-border, #64748b);
    background: var(--jl-bg-elevated, #fff);
    color: var(--jl-text-primary, #0f172a);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 650;
}
.jl-proof-chip.is-on {
    background: #0f766e;
    border-color: #0f766e;
    color: #f8fafc;
}
.jl-proof-picker__matter {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--jl-text-primary, #0f172a);
    min-width: 12rem;
}
.jl-proof-picker__matter select { margin-top: 0.15rem; }

.jl-hash-trunc {
    font-size: 0.65rem;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jl-copy-btn {
    font-size: 0.65rem !important;
    color: var(--jl-accent) !important;
}

.jl-proof-pill {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

.jl-proof-pill--ok {
    background: var(--jl-ok-bg);
    color: var(--jl-ok-fg);
    border: 1px solid var(--jl-ok-border);
}

.jl-proof-pill--info {
    background: var(--jl-info-bg);
    color: var(--jl-info-fg);
    border: 1px solid var(--jl-info-border);
}

.jl-link-card {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.35rem;
    margin-bottom: 0.25rem;
    border-radius: 0.3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.jl-ladder-mini {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.jl-ladder-mini__col {
    flex: 1;
    min-width: 0;
    padding: 0.35rem;
    border-radius: 0.3rem;
    background: rgba(30, 58, 95, 0.35);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.jl-ladder-mini__rung {
    display: flex;
    align-items: center;
    color: #a78bfa;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Browser P2 — Ladder dual-pane */
.jl-browser-view-toggle {
    flex-shrink: 0;
}

.jl-browser-view-toggle .btn {
    font-size: 0.72rem !important;
    padding: 0.28rem 0.65rem !important;
}

.jl-bulk-browser-body--ladder .jl-bulk-browser-master {
    overflow: auto;
}

.jl-ladder-view {
    padding: 0.55rem 0.65rem 0.75rem;
    min-height: 0;
}

.jl-ladder-view__hint {
    line-height: 1.35;
}

.jl-ladder-dual__head,
.jl-ladder-dual__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
    gap: 0.4rem;
    align-items: stretch;
}

.jl-ladder-dual__head {
    margin-bottom: 0.4rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--jl-bg-charcoal);
    padding-bottom: 0.25rem;
}

.jl-ladder-dual__col-h,
.jl-ladder-dual__rung-h {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--jl-accent);
    padding: 0.2rem 0.3rem;
}

.jl-ladder-dual__rung-h {
    text-align: center;
    color: #a78bfa;
}

.jl-ladder-dual__body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.jl-ladder-date-gap {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #d97706;
    padding: 0.45rem 0 0.2rem;
}

html[data-theme="dark"] .jl-ladder-date-gap {
    color: #fbbf24;
}

.jl-ladder-dual__row {
    padding: 0.15rem 0;
}

.jl-ladder-dual__row--sel .jl-ladder-node--you {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.55);
}

.jl-ladder-node {
    border-radius: 0.4rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    text-align: left;
    color: inherit;
    min-width: 0;
}

button.jl-ladder-node {
    cursor: pointer;
    width: 100%;
}

button.jl-ladder-node:hover {
    border-color: rgba(129, 140, 248, 0.55);
    background: rgba(30, 41, 59, 0.75);
}

.jl-ladder-node--them {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}

.jl-ladder-node--parity {
    border-style: dashed;
    border-color: rgba(251, 191, 36, 0.65);
    background: rgba(120, 53, 15, 0.28);
}

html[data-theme="light"] .jl-ladder-node--parity {
    background: #FFFBEB;
    border-color: #D97706;
    color: #78350F;
}
html[data-theme="light"] .jl-ladder-node--parity .small,
html[data-theme="light"] .jl-ladder-node--parity .text-muted,
html[data-theme="light"] .jl-ladder-node--parity .jl-ladder-node__lvl {
    color: #92400E !important;
}

.jl-integrity-border-Intact { border-left: 3px solid #22c55e !important; }
.jl-integrity-border-Broken { border-left: 3px solid #ef4444 !important; }
.jl-integrity-border-Pending { border-left: 3px solid #f59e0b !important; }
.jl-integrity-border-Unknown { border-left: 3px solid #64748b !important; }

.jl-ladder-node__lvl {
    font-size: 0.6rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.jl-ladder-node__title {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0.1rem 0;
}

.jl-ladder-node__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.jl-ladder-rung {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 100%;
}

.jl-ladder-rung__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7c3aed, transparent);
    opacity: 0.85;
}

.jl-ladder-rung--none .jl-ladder-rung__bar {
    background: linear-gradient(90deg, transparent, #475569, transparent);
    opacity: 0.45;
}

.jl-ladder-rung--broken .jl-ladder-rung__bar {
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
}

.jl-ladder-rung--ok .jl-ladder-rung__bar {
    background: linear-gradient(90deg, transparent, var(--jl-ladder-ok-bar), transparent);
}

.jl-ladder-rung--pending .jl-ladder-rung__bar {
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
}

.jl-ladder-rung__label {
    font-size: 0.58rem;
    font-weight: 700;
    text-align: center;
    color: #c4b5fd;
    line-height: 1.15;
    max-width: 5.5rem;
}

.jl-ladder-rung--broken .jl-ladder-rung__label { color: var(--jl-ladder-broken); }
.jl-ladder-rung--ok .jl-ladder-rung__label { color: var(--jl-ladder-ok); }
.jl-ladder-rung--pending .jl-ladder-rung__label { color: var(--jl-ladder-pending); }
.jl-ladder-rung--none .jl-ladder-rung__label { color: #94a3b8; }

.jl-ladder-rung-status {
    font-size: 0.65rem;
    font-weight: 700;
}

.jl-ladder-rung-status--ok { color: var(--jl-ladder-ok-strong); }
.jl-ladder-rung-status--broken { color: #f87171; }
.jl-ladder-rung-status--pending { color: #fbbf24; }
.jl-ladder-rung-status--none { color: #94a3b8; }

/* Light mode: kill neon glow / bleed on ladder links */
html[data-theme="light"] .jl-ladder-rung--ok .jl-ladder-rung__bar {
    opacity: 1;
    filter: none;
}
html[data-theme="light"] .jl-ladder-rung__label,
html[data-theme="light"] .jl-ladder-rung-status {
    text-shadow: none;
    filter: none;
}

/* ========== Light mode: Browser Ladder contrast (soft paper bg washes #94a3b8) ========== */
/* Soft-light canvas made slate greys unreadable — use deep navy greys on ladder cards. */
html[data-theme="light"] .jl-ladder-view,
html[data-theme="light"] .jl-ladder-view .text-muted,
html[data-theme="light"] .jl-ladder-view__hint,
html[data-theme="light"] .jl-ladder-view__footer {
    color: #334155 !important; /* slate-700 — readable on soft paper */
}
html[data-theme="light"] .jl-ladder-view .small.text-muted,
html[data-theme="light"] .jl-ladder-view span.text-muted,
html[data-theme="light"] .jl-ladder-view .text-muted {
    color: #3F4B5C !important; /* secondary navy-slate, not washed #94a3b8 */
}
html[data-theme="light"] .jl-ladder-node {
    background: #F1F5F9; /* light card on soft paper */
    border-color: #94A3B8;
    color: #1E293B;
}
html[data-theme="light"] button.jl-ladder-node:hover {
    background: #E2E8F0;
    border-color: #64748B;
}
html[data-theme="light"] .jl-ladder-node--them {
    color: #1E293B;
}
html[data-theme="light"] .jl-ladder-node__lvl {
    color: #475569 !important; /* was #94a3b8 — too light on paper */
}
html[data-theme="light"] .jl-ladder-node__title {
    color: #0F172A !important;
}
html[data-theme="light"] .jl-ladder-node .small,
html[data-theme="light"] .jl-ladder-node--them .small,
html[data-theme="light"] .jl-ladder-node--them .text-muted {
    color: #3F4B5C !important;
}
html[data-theme="light"] .jl-ladder-dual__col-h {
    color: #1E3A5F !important;
}
html[data-theme="light"] .jl-ladder-dual__rung-h {
    color: #5B21B6 !important; /* deep violet, readable */
}
html[data-theme="light"] .jl-ladder-dual__head {
    background: #DCE2EA;
    border-bottom: 1px solid #9AA6B8;
}
html[data-theme="light"] .jl-ladder-rung__label {
    color: #4C1D95 !important;
}
html[data-theme="light"] .jl-ladder-rung--none .jl-ladder-rung__label,
html[data-theme="light"] .jl-ladder-rung-status--none {
    color: #475569 !important;
}
html[data-theme="light"] .jl-ladder-rung-status--pending {
    color: #92400E !important; /* amber-800 */
}
html[data-theme="light"] .jl-ladder-rung-status--broken {
    color: #991B1B !important;
}
html[data-theme="light"] .jl-hash-trunc,
html[data-theme="light"] .jl-ladder-node code,
html[data-theme="light"] .jl-ladder-rung code {
    color: #1E3A5F !important;
    background: rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .jl-ladder-stack-card {
    background: #F1F5F9;
    color: #1E293B;
}
html[data-theme="light"] .jl-ladder-stack-card .text-muted,
html[data-theme="light"] .jl-ladder-stack-card .small {
    color: #3F4B5C !important;
}
/* Full File Browser list on Transfer — same wash-out on dates / meta */
html[data-theme="light"] .jl-bulk-browser-master .text-muted,
html[data-theme="light"] .jl-bulk-browser-body .text-muted,
html[data-theme="light"] .jl-transfer-export-item .text-muted {
    color: #3F4B5C !important;
}
html[data-theme="light"] .jl-bulk-browser-master td,
html[data-theme="light"] .jl-bulk-browser-master th {
    color: #1E293B;
}
html[data-theme="light"] .jl-bulk-browser-master .table {
    --bs-table-color: #1E293B;
    --bs-table-striped-color: #1E293B;
}

.jl-ladder-partner-chip {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.2rem 0.3rem;
    border-radius: 0.25rem;
    background: rgba(109, 40, 217, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.25);
    margin-bottom: 0.2rem;
}

.jl-ladder-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.jl-ladder-stack-card {
    border: 1px solid var(--jl-border);
    border-radius: 0.45rem;
    padding: 0.55rem 0.6rem;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.jl-ladder-stack-card--sel {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.jl-ladder-stack-card__rung {
    flex-shrink: 0;
    min-width: 4.5rem;
}

.jl-ladder-view__footer a {
    color: var(--jl-accent);
}

html[data-theme="light"] .jl-bulk-browser-modal thead th {
    background-color: var(--jl-bg-charcoal) !important;
    color: var(--jl-text-primary) !important;
}

.jl-phone-platform .jl-dashboard-control-title {
    font-size: 0.95rem !important;
}

.jl-phone-platform .jl-creators-toolbar--phone {
    gap: 0.35rem;
}

.jl-phone-platform .jl-creators-toolbar--phone .jl-creators-new-btn {
    width: 100%;
    font-size: 0.92rem;
    padding: 8px 12px;
}

.jl-phone-platform .jl-creators-editor--calm,
.jl-phone-platform .jl-creators-editor--warm,
.jl-phone-platform .jl-creators-editor--impressionist,
.jl-phone-platform .jl-creators-editor--caravaggio {
    /* On phone, decorative canvas styles add clutter without readable benefit */
    background: var(--jl-bg-deep) !important;
    border: 1px solid var(--jl-border) !important;
    box-shadow: none !important;
}

.jl-phone-platform .jl-creators-page .jl-ip-dashboard-chrome {
    display: none;
}

.jl-phone-platform .jl-creators-page.container {
    padding-top: 0.5rem !important;
}

.jl-phone-platform .patent-page .table,
.jl-phone-platform .attorney-page .table {
    font-size: 0.72rem;
}

.jl-phone-platform .patent-page .container-fluid,
.jl-phone-platform .attorney-page .container,
.jl-phone-platform .container,
.jl-phone-platform .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

.jl-phone-platform .jl-dashboard-page .jl-page-header > div {
    flex-wrap: wrap;
    gap: 4px;
}

/* ---- Calendar: chip filters + month nav (phone-first, fine on desktop) ---- */
.jl-calendar-filters {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.jl-chip-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.1rem 0 0.25rem;
    scrollbar-width: none;
}

.jl-chip-row::-webkit-scrollbar {
    display: none;
}

.jl-chip {
    flex: 0 0 auto;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-secondary);
    border-radius: 999px;
    padding: 0.38rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.jl-chip:hover {
    border-color: var(--jl-accent);
    color: var(--jl-text-primary);
}

.jl-chip--active {
    background: var(--jl-accent);
    border-color: var(--jl-accent);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--jl-accent) 40%, transparent);
}

.jl-chip--active-type {
    background: color-mix(in srgb, var(--jl-led-blue) 22%, var(--jl-bg-elevated));
    border-color: var(--jl-led-blue);
    color: var(--jl-led-blue-bright, var(--jl-splash-fg, #e0f2fe)); /* JL-L8-ALLOW splash LED */
}

.jl-calendar-search {
    max-width: 280px;
}

.jl-phone-platform .jl-calendar-search {
    max-width: 100%;
    width: 100%;
}

.jl-calendar-month-nav {
    background: var(--jl-bg-elevated) !important;
    border-bottom: 1px solid var(--jl-border);
}

.jl-calendar-nav-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.jl-calendar-nav-btn:hover {
    border-color: var(--jl-accent);
    color: var(--jl-accent);
}

.jl-calendar-month-label {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.jl-phone-platform .jl-calendar-page {
    padding-top: 0.75rem !important;
    padding-bottom: 1rem !important;
}

.jl-phone-platform .jl-chip {
    font-size: 0.72rem;
    padding: 0.42rem 0.78rem;
}

/* ---- Transfer: zip tip as expandable + phone tools (iPhone-like continuity) ---- */
.jl-transfer-tip .jl-expandable {
    background: color-mix(in srgb, var(--jl-vault-green) 10%, var(--jl-bg-charcoal));
    border: 1px solid var(--jl-vault-green);
    border-radius: 12px;
    overflow: hidden;
}

.jl-transfer-tip .jl-expandable__toggle {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: transparent;
    border: none;
    color: var(--jl-text-primary);
    text-align: left;
}

.jl-transfer-tip .jl-expandable__title {
    color: var(--jl-vault-green);
    font-weight: 700;
    font-size: 0.9rem;
}

.jl-transfer-tip .jl-expandable__hint {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--jl-text-muted);
}

.jl-transfer-tip__body {
    padding: 0 0.85rem 0.85rem;
    font-size: 0.82rem;
    color: var(--jl-text-secondary);
    line-height: 1.4;
}

.jl-transfer-phone-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
}

.jl-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

.jl-tool-chip:hover {
    border-color: var(--jl-accent);
    color: var(--jl-accent);
    text-decoration: none;
}

.jl-tool-chip--accent {
    border-color: color-mix(in srgb, var(--jl-vault-green) 55%, var(--jl-border));
    color: var(--jl-vault-green);
}

.jl-phone-platform .jl-transfer-page--phone {
    padding-top: 0.65rem !important;
    padding-bottom: 0.85rem !important;
}

.jl-phone-platform .jl-transfer-page--phone .card {
    border-radius: 14px;
    overflow: hidden;
}

.jl-phone-platform .jl-transfer-page--phone .card-body {
    padding: 0.85rem;
}

.jl-phone-platform .jl-transfer-page--phone .jl-expandable__title {
    font-size: 0.95rem;
}

.jl-phone-platform .jl-mobile-page-actions {
    margin-bottom: 0.55rem;
}

/* Transfer page — shared upload zone styling */
.jl-transfer-upload-zone {
    border: 3px dashed var(--jl-border);
    border-radius: 16px;
    background: var(--jl-bg-elevated);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.jl-transfer-upload-icon {
    font-size: 2.5rem;
    opacity: 0.6;
    line-height: 1;
}

/* Desktop / laptop: keep upload + export side by side (never apply to phone builds) */
@media (min-width: 768px) {
    .page:not(.jl-phone-platform) .jl-transfer-columns > .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.page:not(.jl-phone-platform) .jl-transfer-export-item[draggable="true"] {
    cursor: grab;
}

/* =====================================================================
   Platform separation (one Blazor UI, many MAUI targets)
   - MainLayout adds .jl-phone-platform only on iOS/Android/Phone idiom.
   - Mobile layout CSS MUST stay under .jl-phone-platform (never bare @media alone).
   - Desktop/laptop layout uses .page:not(.jl-phone-platform) or default Bootstrap.
   - Razor/C#: PlatformUiService.IsPhoneExperience for features (drag-drop, copy, etc.)
   ===================================================================== */

/* =====================================================================
   Global phone utilities (all pages)
   ===================================================================== */

.jl-phone-only {
    display: none !important;
}

.jl-desktop-only {
    display: block;
}

.jl-ip-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--jl-bg-deep);
    border-bottom: 1px solid var(--jl-border);
    margin: -1rem -0.75rem 1rem;
    padding: 0.45rem 0.75rem 0.35rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.jl-page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--jl-bg-deep);
    border-bottom: 2px solid var(--jl-border);
    margin: -1rem -0.75rem 1rem;
    padding: 0.55rem 0.75rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.jl-page-header__crumbs {
    font-size: 0.8rem;
    color: var(--jl-text-muted);
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jl-page-header__crumbs a {
    color: var(--jl-text-secondary);
    text-decoration: none;
}

.jl-page-header__crumbs span {
    color: var(--jl-text-primary);
}

.jl-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.jl-page-header__actions > * {
    flex: 0 1 auto;
    max-width: 100%;
}

.jl-page-header__actions .btn,
.jl-page-header__actions a.btn {
    white-space: nowrap;
}

.jl-page-header__actions .ms-1,
.jl-page-header__actions .ms-2,
.jl-page-header__actions .ms-3 {
    margin-left: 0 !important;
}

.jl-page-header__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    width: 100%;
}

.jl-page-header__toolbar-title {
    font-weight: 600;
    color: var(--jl-text-primary);
    font-size: 0.95rem;
    flex: 1 1 140px;
    min-width: 0;
}

.jl-page-header__toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.5rem;
    flex: 1 1 240px;
    min-width: 0;
    max-width: 100%;
}

.jl-regional-header-selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.72rem;
    flex: 0 1 auto;
    min-width: 0;
}

@media (max-width: 899.98px) {
    .page:not(.jl-phone-platform) .jl-page-header__toolbar-actions > span {
        flex: 1 1 100%;
        text-align: left !important;
        white-space: normal;
    }
}

.jl-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.jl-cc-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    flex: 1;
    width: 100%;
}

.jl-cc-card {
    background: var(--jl-bg-deep);
    border: 1px solid var(--jl-border);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.72rem;
}

.jl-cc-card-label {
    color: var(--jl-text-muted);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.jl-cc-card strong {
    color: var(--jl-text-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.jl-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Your Files — open in main content (not a floating modal) */
.jl-bulk-browser-inline {
    background: transparent;
    color: var(--jl-text-primary);
    border: none;
    border-radius: 0;
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 10rem);
    max-height: none;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}
.jl-bulk-browser-inline .jl-bulk-browser-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--jl-bg-deep);
}
.jl-bulk-browser-inline .jl-bulk-browser-body {
    min-height: 28rem;
    max-height: none;
    flex: 1 1 auto;
}

.jl-bulk-browser-modal {
    background: var(--jl-bg-charcoal);
    color: var(--jl-text-primary);
    border: 1px solid var(--jl-border);
    border-radius: 12px;
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.jl-nav-brand-sub {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--jl-text-muted);
    line-height: 1.1;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jl-bulk-browser-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.jl-bulk-browser-master {
    flex: 1 1 auto;
    min-width: 0;
    overflow: auto;
    border-right: 1px solid var(--jl-border);
}

.jl-bulk-browser-detail {
    width: 300px;
    min-width: 260px;
    flex-shrink: 0;
    padding: 0.75rem;
    overflow: auto;
    background: var(--jl-bg-deep);
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
}

.jl-phone-platform .jl-phone-only {
    display: block !important;
}

.jl-phone-platform .jl-phone-only.jl-cc-cards {
    display: grid !important;
}

.jl-phone-platform .jl-desktop-only {
    display: none !important;
}

/* Long filenames and unbreakable strings stay inside cards, lists, and flex rows */
.jl-contained-text,
.jl-file-list .jl-file-list__name,
.card .jl-file-list__name {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.jl-file-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.jl-file-list > li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--jl-border);
}

.jl-file-list > li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.jl-file-list__name {
    flex: 1 1 auto;
    min-width: 0;
}

.jl-file-list__actions {
    flex: 0 0 auto;
    white-space: nowrap;
}

.card,
.card-body,
.list-group-item {
    min-width: 0;
}

/* Android / phone — lift small Bootstrap text and controls (was hard to read on device) */
.jl-phone-platform .small,
.jl-phone-platform .text-muted,
.jl-android-platform .small,
.jl-android-platform .text-muted {
    font-size: 0.92rem !important;
    line-height: 1.45;
}

.jl-phone-platform .btn,
.jl-phone-platform .btn-sm,
.jl-android-platform .btn,
.jl-android-platform .btn-sm {
    font-size: 0.95rem;
}

.jl-phone-platform .form-control,
.jl-phone-platform .form-control-sm,
.jl-phone-platform .form-select,
.jl-android-platform .form-control,
.jl-android-platform .form-select {
    font-size: 1rem;
}

.jl-phone-platform .card-title,
.jl-android-platform .card-title {
    font-size: 1.2rem;
}

.jl-phone-platform h5,
.jl-android-platform h5 {
    font-size: 1.15rem;
}

.jl-phone-platform .jl-emergency-kit-preview,
.jl-android-platform .jl-emergency-kit-preview {
    font-size: 1rem;
}

.jl-phone-platform .jl-emergency-kit-preview__key,
.jl-android-platform .jl-emergency-kit-preview__key {
    font-size: 1.05rem;
    line-height: 1.35;
}

.jl-phone-platform .jl-emergency-kit-preview__qr,
.jl-android-platform .jl-emergency-kit-preview__qr {
    width: 168px;
    height: 168px;
}

:global(.jl-phone-platform) .nav-section-header,
:global(.jl-android-platform) .nav-section-header {
    font-size: 0.82rem;
}

@media print {
    body {
        font-size: 12pt !important;
    }

    .jl-emergency-kit-preview {
        font-size: 11pt !important;
    }

    .jl-emergency-kit-preview__key {
        font-size: 10pt !important;
        line-height: 1.35 !important;
    }
}

/* Narrow desktop window only — slim page headers beside sidebar (not phone builds) */
@media (max-width: 1099.98px) {
    .page:not(.jl-phone-platform) .jl-ip-sticky-header {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .page:not(.jl-phone-platform) .jl-page-header {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* === Contact & Link consolidation (2026-07-27) === */
.jl-link-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}
.jl-link-dot--live { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }
.jl-link-dot--pending { background: #eab308; }
.jl-link-dot--off { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2); }

.jl-link-status-corner {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--jl-border);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.jl-link-status-corner__label.is-live { color: var(--jl-ok-fg-strong, var(--jl-vault-green)); }
.jl-link-status-corner__label.is-pending { color: #facc15; }
.jl-link-status-corner__label.is-off { color: #f87171; }

.jl-contact-link-hub__matter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}
.jl-contact-link-hub__field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.jl-contact-link-hub__field--matter { flex: 1 1 10rem; max-width: 28rem; }
.jl-contact-link-hub__field--fit { flex: 0 1 auto; }
.jl-contact-link-hub__field--client { flex: 1 1 8rem; }
.jl-contact-link-hub__proof-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}
.jl-contact-link-hub__proof-links .btn {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
}
.jl-matter-number-input {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.jl-incoming-link-request--minimal {
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.35rem;
    border-radius: 0.35rem;
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-accent);
}
.jl-incoming-link-request__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
}
.jl-incoming-link-request__body { flex: 1 1 12rem; min-width: 0; }
.jl-incoming-link-request__title {
    font-weight: 600;
    color: var(--jl-accent);
    font-size: 0.9rem;
    line-height: 1.25;
}
.jl-incoming-link-request__from { font-size: 0.78rem; margin-top: 0.1rem; }
.jl-incoming-link-request__meta {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-top: 0.2rem;
    font-size: 0.75rem;
}
.jl-incoming-link-request__code {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}
.jl-incoming-link-request__backup {
    margin-top: 0.15rem;
    font-size: 0.68rem;
    color: var(--jl-text-muted);
    opacity: 0.85;
}
.jl-incoming-link-request__backup code { font-size: 0.68rem; }
.jl-incoming-link-request__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    flex-shrink: 0;
}

.jl-link-connection-readout--compact {
    padding: 0.35rem 0.5rem;
    margin-top: 0.35rem;
    border-radius: 0.35rem;
    background: var(--jl-bg-charcoal);
    border: 1px solid var(--jl-border);
    font-size: 0.78rem;
}
.jl-link-connection-readout--compact.is-live {
    border-color: rgba(34, 197, 94, 0.4);
}
.jl-link-connection-readout__line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}
.jl-link-connection-readout__status { font-weight: 700; }
.jl-link-connection-readout__status--live { color: var(--jl-ok-fg-strong, var(--jl-vault-green)); }
.jl-link-connection-readout__status--pending { color: #facc15; }
.jl-link-connection-readout__status--off { color: #94a3b8; }

.jl-link-field {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 0;
}
.jl-link-field--fit { flex: 0 1 auto; }
.jl-link-field--backup { opacity: 0.8; }
.jl-link-field__value {
    font-size: 0.8rem;
    white-space: nowrap;
}
.jl-link-field__value--matter {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--jl-accent);
    letter-spacing: 0.03em;
}
.jl-link-field__value--code {
    font-weight: 600;
    letter-spacing: 0.1em;
}
.jl-link-field__value--id {
    font-size: 0.72rem;
    opacity: 0.9;
    max-width: min(28rem, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
}
.jl-link-field__value--backup { font-size: 0.72rem; }

.jl-link-actions-panel .jl-link-connection-readout--compact {
    margin-top: 0;
    background: transparent;
    border: none;
    padding: 0;
}

@media (max-width: 767.98px) {
    .jl-contact-link-hub__proof-links { margin-left: 0; width: 100%; }
    .jl-incoming-link-request__actions { width: 100%; justify-content: flex-end; }
}

/* === Contact hub v2 (screenshot feedback 2026-07-27) === */
.jl-hub-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--jl-text-primary);
    line-height: 1.2;
}
.jl-hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem 0.4rem;
}
.jl-hub-toolbar .btn,
.jl-hub-toolbar .vcl-launch-btn,
.jl-hub-toolbar button,
.jl-hub-toolbar .jl-hub-chip {
    font-size: 0.72rem !important;
    padding: 0.18rem 0.5rem !important;
    line-height: 1.25;
    border-radius: 8px;
}
/* Counsel packet inside toolbar should match chip size */
.jl-hub-toolbar .jl-counsel-packet-btn,
.jl-hub-toolbar .btn.jl-counsel-packet,
.jl-hub-toolbar a.btn {
    font-size: 0.72rem !important;
    padding: 0.18rem 0.5rem !important;
}
button.jl-link-status-corner {
    border: 1px solid var(--jl-border);
    background: rgba(0, 0, 0, 0.12);
    cursor: pointer;
}
button.jl-link-status-corner:hover {
    filter: brightness(1.05);
}

/* Light mode: Linked pill matches header outline/accent buttons (not neon green) */
html[data-theme="light"] button.jl-link-status-corner.is-live,
html[data-theme="light"] .jl-link-status-corner.is-live {
    background: color-mix(in srgb, var(--jl-accent-solid) 12%, #fff);
    border-color: var(--jl-accent-solid);
}
html[data-theme="light"] button.jl-link-status-corner.is-live .jl-link-status-corner__label,
html[data-theme="light"] .jl-link-status-corner.is-live .jl-link-status-corner__label {
    color: var(--jl-accent-solid);
}
html[data-theme="light"] .jl-link-dot--live {
    background: var(--jl-accent-solid);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--jl-accent-solid) 25%, transparent);
}
html[data-theme="light"] .jl-link-connection-readout__status--live {
    color: var(--jl-accent-solid);
}

/* Overall progress chip � red ? yellow ? green via progress % */
.jl-progress-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--jl-border);
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    --jl-progress-color: color-mix(
        in srgb,
        #ef4444 calc(100% - var(--jl-progress-pct)),
        color-mix(in srgb, #eab308 50%, #22c55e) var(--jl-progress-pct)
    );
}
.jl-progress-chip__label { color: var(--jl-text-muted); font-weight: 500; }
.jl-progress-chip__track {
    display: inline-block;
    width: 3.2rem;
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.25);
    overflow: hidden;
}
.jl-progress-chip__fill {
    display: block;
    height: 100%;
    width: var(--jl-progress-pct, 0%);
    background: hsl(calc(0 + (var(--jl-progress-pct) * 1.2)), 75%, 42%);
    border-radius: inherit;
    transition: width 0.25s ease, background 0.25s ease;
}
.jl-progress-chip__pct {
    min-width: 2rem;
    color: hsl(calc(0 + (var(--jl-progress-pct) * 1.2)), 70%, 38%);
    font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .jl-progress-chip__pct {
    color: hsl(calc(0 + (var(--jl-progress-pct) * 1.2)), 70%, 62%);
}

/* Matter # | Link ID | Client � same label baseline, flow on resize */
.jl-matter-align-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.4fr) minmax(10rem, 1fr) minmax(8rem, 1fr);
    gap: 0.75rem 1.25rem;
    align-items: start;
}
.jl-matter-align-row__col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.jl-matter-align-row__label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--jl-text-muted);
    line-height: 1.2;
    min-height: 1.1rem;
}
.jl-matter-align-row .jl-matter-number-input {
    width: auto;
    min-width: 8ch;
    max-width: 100%;
    font-weight: 600;
}
@media (max-width: 900px) {
    .jl-matter-align-row {
        grid-template-columns: repeat(2, minmax(10rem, 1fr));
    }
}
@media (max-width: 560px) {
    .jl-matter-align-row {
        grid-template-columns: 1fr;
    }
}

.jl-link-details-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.jl-link-details-modal {
    width: min(32rem, 100%);
    max-height: 85vh;
    overflow: auto;
    background: var(--jl-bg-elevated);
    border: 1px solid var(--jl-border);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    color: var(--jl-text-primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.jl-link-up-panel--compact {
    padding: 0.45rem 0.55rem !important;
    display: inline-block;
    max-width: 100%;
}
.jl-link-up-panel--compact .jl-link-up-find-row {
    flex-wrap: wrap;
}
.jl-link-up-panel--compact .jl-link-up-code-input {
    width: 9rem !important;
    max-width: 40vw !important;
    flex: 0 0 auto !important;
}

/* Client card � � hidden until hover (non-store only) */
.jl-client-card-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 0 4px !important;
    font-size: 0.6rem !important;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.jl-ip-attorney-client-card:hover .jl-client-card-delete,
.jl-ip-attorney-client-card:focus-within .jl-client-card-delete {
    opacity: 1;
}

/* Ladder control window + compact matter # only */
.jl-matter-number-only {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 28rem;
}
.jl-matter-number-only .jl-matter-number-input {
    width: auto;
    min-width: 10ch;
    max-width: 100%;
}
.jl-ladder-window-overlay {
    position: fixed;
    inset: 0;
    z-index: 1250;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.jl-ladder-window {
    position: relative;
    width: min(40rem, 100%);
    max-height: 88vh;
    overflow: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--jl-text-primary);
}
.jl-ladder-window .jl-ladder-promo {
    margin: 0;
}
.jl-ladder-window__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 2.4rem 0.75rem 1rem;
    border-bottom: 1px solid var(--jl-border);
    position: relative;
    background: var(--jl-bg-elevated);
    z-index: 1;
}
.jl-ladder-window__close {
    position: absolute;
    top: 0.45rem;
    right: 0.65rem;
    left: auto;
    appearance: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--jl-text-muted);
    cursor: pointer;
    padding: 0 0.2rem;
}
.jl-ladder-window button.btn {
    width: auto !important;
    max-width: none;
    text-align: center !important;
    white-space: nowrap;
}
.jl-ladder-window__body {
    padding: 0.85rem 1rem 1rem;
}
.jl-ladder-promo__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.65rem;
}
.jl-ladder-promo--in-window {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

/* === Hub v4: full-width progress + matter/code/backup row + header-green Linked === */
.jl-contact-link-hub {
    overflow: hidden;
}
.jl-hub-progress-bar {
    position: relative;
    width: 100%;
    height: 1.35rem;
    background: rgba(128, 128, 128, 0.18);
    border-bottom: 1px solid var(--jl-border);
    --jl-progress-hue: calc(0 + (var(--jl-progress-pct, 0) * 1.2));
}
.jl-hub-progress-bar__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--jl-progress-pct, 0%);
    max-width: 100%;
    background: linear-gradient(
        90deg,
        hsl(0, 72%, 46%),
        hsl(var(--jl-progress-hue), 72%, 42%)
    );
    transition: width 0.3s ease, background 0.3s ease;
}
.jl-hub-progress-bar__label {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 0.65rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    font-variant-numeric: tabular-nums;
}
html[data-theme="light"] .jl-hub-progress-bar__label {
    color: #0f172a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* When fill is short, keep label readable */
.jl-hub-progress-bar__label span:last-child {
    opacity: 0.95;
}

/* Matter # + Code + Backup on one flowing row */
.jl-hub-matter-code-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
}
.jl-hub-matter-code-row__item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.jl-hub-matter-code-row__item--code {
    flex: 0 1 auto;
}
.jl-hub-matter-code-row__item--backup {
    flex: 1 1 10rem;
    max-width: 16rem;
}
.jl-hub-matter-code-row .jl-matter-number-input {
    width: auto;
    min-width: 10ch;
    max-width: 100%;
}
.jl-link-up-panel--bare {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block;
}
.jl-link-up-panel--bare .jl-link-up-find-row {
    margin: 0;
}
.jl-link-up-panel--bare .jl-link-up-code-label {
    display: none; /* parent row already has Code label */
}

/* Linked = same green as header "Blockchain Intact"; Not linked = same red as "Blockchain Broken" */
button.jl-link-status-corner.is-live {
    background: var(--jl-vault-green-dark);
    color: #e8f5e9;
    border: 1px solid var(--jl-vault-green);
    box-shadow: none;
}
button.jl-link-status-corner.is-live .jl-link-status-corner__label {
    color: #e8f5e9;
}
button.jl-link-status-corner.is-off {
    background: #c62828;
    color: #fff;
    border: 1px solid #c62828;
}
button.jl-link-status-corner.is-off .jl-link-status-corner__label {
    color: #fff;
}
button.jl-link-status-corner .jl-link-dot {
    display: none; /* solid pill matches header chain buttons */
}
html[data-theme="light"] button.jl-link-status-corner.is-live {
    background: var(--jl-vault-green-dark);
    color: #e8f5e9;
    border-color: var(--jl-vault-green);
}
html[data-theme="light"] button.jl-link-status-corner.is-live .jl-link-status-corner__label {
    color: #e8f5e9;
}
html[data-theme="light"] button.jl-link-status-corner.is-off {
    background: #c62828;
    color: #fff;
    border-color: #c62828;
}
html[data-theme="light"] button.jl-link-status-corner.is-off .jl-link-status-corner__label {
    color: #fff;
}

@media (max-width: 700px) {
    .jl-hub-matter-code-row__item--backup {
        flex: 1 1 auto;
        max-width: none;
    }
}

/* Phone: Matter # + Backup tight stack (no huge empty gap) */
.jl-phone-platform .jl-hub-matter-code-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    margin: 0 !important;
}
.jl-phone-platform .jl-hub-matter-code-row__item,
.jl-phone-platform .jl-hub-matter-code-row__item--matter,
.jl-phone-platform .jl-hub-matter-code-row__item--backup {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    gap: 0.15rem !important;
}
.jl-phone-platform .jl-hub-matter-code-row .d-flex {
    gap: 0.3rem !important;
    align-items: center !important;
}
.jl-phone-platform .jl-hub-matter-code-row .form-control,
.jl-phone-platform .jl-hub-matter-code-row .jl-matter-number-input {
    min-height: 2rem;
    font-size: 0.85rem !important;
}
.jl-phone-platform .jl-contact-link-hub .card-body {
    padding: 0.5rem 0.6rem !important;
}
.jl-phone-platform .jl-hub-code-banner {
    margin-top: 0.35rem !important;
}

/* Counsel packet + ? stay on one baseline in hub chips */
.counsel-packet-action {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    vertical-align: middle;
    line-height: 1;
}
/* Packet is a chip beside Details/Ladder — not a full-width bar */
.jl-hub-toolbar .counsel-packet-action {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
    width: auto !important;
    max-width: none;
    flex: 0 0 auto !important;
    min-height: 0;
}
.jl-hub-toolbar .counsel-packet-action .jl-counsel-packet-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
}
.jl-hub-toolbar .counsel-packet-action .help-q {
    flex: 0 0 auto;
    align-self: center;
    width: 1.05rem;
    height: 1.05rem;
    font-size: 0.58rem;
    line-height: 1.05rem;
    margin: 0;
    position: static;
    transform: none;
}
.jl-phone-platform .jl-hub-toolbar .counsel-packet-action {
    flex-direction: row;
    flex-wrap: nowrap;
}
.jl-phone-platform .jl-hub-toolbar .counsel-packet-action .help-q {
    /* Keep help next to Packet without shoving the chip up */
    position: relative;
    top: 0;
}

/* Get button: yellow while linked/waiting; green GOT after confirmed pull (session only) */
.jl-hub-get-btn {
    font-weight: 600;
    border-width: 1px;
}
.jl-hub-get-btn--waiting {
    background: #ca8a04 !important;
    border-color: #a16207 !important;
    color: #fff !important;
}
.jl-hub-get-btn--waiting:hover {
    background: #a16207 !important;
    border-color: #854d0e !important;
    color: #fff !important;
}
.jl-hub-get-btn--got {
    background: var(--jl-vault-green-dark) !important;
    border-color: var(--jl-vault-green) !important;
    color: #e8f5e9 !important;
}
.jl-hub-get-btn--got:hover {
    filter: brightness(1.08);
    color: #e8f5e9 !important;
}
html[data-theme="light"] .jl-hub-get-btn--waiting {
    background: #ca8a04 !important;
    border-color: #a16207 !important;
    color: #fff !important;
}
html[data-theme="light"] .jl-hub-get-btn--got {
    background: var(--jl-vault-green-dark) !important;
    border-color: var(--jl-vault-green) !important;
    color: #e8f5e9 !important;
}

/* Ladder / ChainMail active (in use) � filled vault green like Linked */
.jl-hub-feature-btn--active {
    background: var(--jl-vault-green-dark) !important;
    border: 1px solid var(--jl-vault-green) !important;
    color: #e8f5e9 !important;
    font-weight: 600;
}
.jl-hub-feature-btn--active:hover {
    filter: brightness(1.08);
    color: #e8f5e9 !important;
}

/* Send: blue default, green SENT after successful upload (session only) */
.jl-hub-send-btn--sent {
    background: var(--jl-vault-green-dark) !important;
    border: 1px solid var(--jl-vault-green) !important;
    color: #e8f5e9 !important;
    font-weight: 600;
}
.jl-hub-send-btn--sent:hover {
    filter: brightness(1.08);
    color: #e8f5e9 !important;
}

/* Progress fill uses inline background-color; keep track clean */
.jl-hub-progress-bar__fill {
    background-image: none;
}

/* Client hub clean matter row + code banner */
.jl-hub-matter-code-row__item--matter {
    flex: 1 1 16rem;
    min-width: 12rem;
}
.jl-hub-code-banner {
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px dashed var(--jl-accent);
    background: color-mix(in srgb, var(--jl-bg-deep) 70%, transparent);
    max-width: 28rem;
}
.jl-hub-code-banner__code {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-family: ui-monospace, monospace;
    color: var(--jl-text-primary);
    line-height: 1.3;
}

/* Dashboard mini control panel */
.jl-mini-controls__group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.jl-mini-controls__label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--jl-text-muted);
    margin-bottom: 0.1rem;
}
a.jl-mini-controls__btn,
button.jl-mini-controls__btn {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--jl-border);
    background: var(--jl-bg-elevated);
    color: var(--jl-text-primary);
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.jl-mini-controls__btn:hover,
button.jl-mini-controls__btn:hover {
    border-color: var(--jl-accent);
    color: var(--jl-accent);
}
.jl-mini-controls__btn--accent {
    border-color: var(--jl-warn-border) !important;
    color: var(--jl-warn-fg) !important;
    background: var(--jl-warn-bg) !important;
}
.jl-mini-controls__mesh-note {
    font-size: 0.62rem;
    color: var(--jl-text-muted);
    margin-bottom: 0.15rem;
}
.jl-mini-controls__group--mesh .jl-ladder-window-trigger,
.jl-mini-controls__btn--block {
    width: auto !important;
    text-align: center !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 0.28rem 0.55rem !important;
    border-radius: 6px !important;
}
.jl-easy-connect {
    text-align: center;
    padding: 0.75rem 0.5rem 0.25rem;
}
.jl-easy-connect__lead {
    font-size: 0.88rem;
    color: var(--jl-text-primary);
    margin: 0 0 0.65rem;
}
.jl-easy-connect__qr {
    display: block;
    margin: 0 auto 0.65rem;
    width: 220px;
    height: 220px;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}
.jl-easy-connect__code {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    font-family: ui-monospace, Consolas, monospace;
    color: var(--jl-text-primary);
}
.jl-easy-connect__hint {
    font-size: 0.78rem;
    color: var(--jl-text-muted);
    margin: 0.35rem 0 0;
}

.jl-mini-controls__pair {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: stretch;
}
.jl-mini-controls__pair .jl-mini-controls__btn,
.jl-mini-controls__pair .jl-ladder-window-trigger,
.jl-mini-controls__pair button,
.jl-mini-controls__pair a {
    display: inline-block !important;
    width: auto !important;
    min-width: 6.4rem;
    text-align: center !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 0.28rem 0.4rem !important;
    line-height: 1.2 !important;
    min-height: 1.9rem;
    border-radius: 6px !important;
    border: 1px solid var(--jl-border) !important;
    background: var(--jl-bg-elevated) !important;
    color: var(--jl-text-primary) !important;
    box-shadow: none !important;
}
.jl-mini-controls__group--mesh .jl-chainmail-launch,
.jl-mini-controls__group--mesh > button[type="button"] {
    width: auto;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.55rem;
    border-radius: 6px;
    margin-top: 0.15rem;
}

/* ── Phone: Status dashboard chips (not full-width slabs) ── */
.jl-phone-platform .jl-mini-controls {
    padding: 0.45rem 0.5rem !important;
    border-radius: 12px !important;
}
.jl-phone-platform .jl-mini-controls__grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
    grid-template-columns: unset !important;
}
.jl-phone-platform .jl-mini-controls__group {
    display: contents; /* flatten labels+buttons into one chip flow */
}
.jl-phone-platform .jl-mini-controls__label {
    flex: 1 0 100%;
    margin: 0.35rem 0 0.05rem;
    font-size: 0.58rem;
    opacity: 0.9;
}
.jl-phone-platform .jl-mini-controls__label:first-child {
    margin-top: 0;
}
.jl-phone-platform .jl-mini-controls__mesh-note {
    flex: 1 0 100%;
    margin: 0 0 0.15rem;
    font-size: 0.58rem;
}
.jl-phone-platform a.jl-mini-controls__btn,
.jl-phone-platform button.jl-mini-controls__btn,
.jl-phone-platform .jl-mini-controls__group--mesh .jl-ladder-window-trigger,
.jl-phone-platform .jl-mini-controls__btn--block,
.jl-phone-platform .jl-mini-controls__group--mesh .jl-chainmail-launch,
.jl-phone-platform .jl-mini-controls__group--mesh button[type="button"] {
    display: inline-flex !important;
    width: auto !important;
    max-width: 100%;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    text-align: center !important;
    font-size: 0.9rem !important;
    font-weight: 650 !important;
    padding: 0.2rem 0.75rem !important;
    min-height: 2rem;
    border-radius: 999px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* ── Phone: Contact & Link hub — organized action strip ── */
.jl-phone-platform .jl-contact-link-hub .card-header,
.jl-phone-platform .jl-contact-link-hub > .card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    padding: 0.45rem 0.55rem !important;
}
.jl-phone-platform .jl-hub-toolbar {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.65rem 1rem !important;
    width: 100%;
    justify-content: flex-start !important;
}
.jl-phone-platform .jl-hub-toolbar .btn,
.jl-phone-platform .jl-hub-toolbar .vcl-launch-btn,
.jl-phone-platform .jl-hub-toolbar button,
.jl-phone-platform .jl-hub-toolbar .jl-link-status-corner {
    width: auto !important;
    min-height: 2.75rem !important;
    margin: 0 !important;
    justify-content: flex-start;
    text-align: left;
    font-size: 1.02rem !important;
    font-weight: 650 !important;
    padding: 0.35rem 0.1rem !important;
    line-height: 1.2 !important;
    border-radius: 0 !important;
    white-space: nowrap;
}
.jl-phone-platform .jl-hub-toolbar .jl-link-status-corner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.jl-phone-platform .jl-contact-link-hub .card-header > .d-flex:first-child {
    gap: 0.35rem !important;
    flex-wrap: wrap !important;
}
.jl-phone-platform .jl-contact-link-hub .card-header > .d-flex:first-child .btn {
    width: auto !important;
    min-height: 0 !important;
    font-size: 0.65rem !important;
    padding: 0.15rem 0.4rem !important;
}
.jl-phone-platform .jl-hub-matter-code-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.jl-phone-platform .jl-hub-matter-code-row .btn {
    width: auto !important;
    min-height: 0 !important;
    font-size: 0.72rem !important;
    padding: 0.28rem 0.55rem !important;
}
.jl-phone-platform .jl-hub-matter-code-row .d-flex {
    flex-wrap: wrap;
    gap: 0.35rem;
}
.jl-phone-platform .jl-hub-progress-bar {
    min-height: 1.35rem;
}
.jl-phone-platform .jl-hub-progress-bar__label {
    font-size: 0.65rem !important;
}

/* AI command bar */
.jl-ai-command {
    margin-top: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px dashed var(--jl-info-border, var(--jl-border));
    background: var(--jl-info-bg, rgba(56, 189, 248, 0.06));
}
.jl-ai-command__title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--jl-info-fg, var(--jl-accent));
    margin-bottom: 0.2rem;
}
.jl-ai-command__hint {
    font-size: 0.7rem;
    color: var(--jl-text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.3;
}
.jl-ai-command__input {
    background: var(--jl-bg-deep) !important;
    color: var(--jl-text-primary) !important;
    border: 1px solid var(--jl-border) !important;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem !important;
    margin-bottom: 0.35rem;
}
.jl-ai-command__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.jl-ai-command__status {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    white-space: pre-wrap;
    line-height: 1.35;
}
.jl-ai-command__status--ok { color: var(--jl-ok-fg-strong, var(--jl-vault-green)); }
.jl-ai-command__status--err { color: #f87171; }
.jl-ai-command__picked {
    margin-top: 0.25rem;
    font-size: 0.68rem;
    word-break: break-all;
}
.jl-ai-command--compact .jl-ai-command__hint { display: none; }

/* ========== Noah intake hero (readable in light + dark) ==========
   Soft-paper light mode washed muted secondary into the title card.
   Always use a dark branded hero so title/tagline/body stay high-contrast. */
.jl-noah-hero {
  background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 45%, #0b1628 100%) !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.25);
}
.jl-noah-hero .card-body {
  color: #f1f5f9 !important;
}
.jl-noah-hero__title {
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.jl-noah-hero__tagline {
  color: #bfdbfe !important; /* JL-L8-ALLOW dark branded hero */
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
}
.jl-noah-hero__body {
  color: #e2e8f0 !important;
  line-height: 1.45;
  opacity: 1 !important;
}
html[data-theme="light"] .jl-noah-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #274060 40%, #152238 100%) !important;
  border-color: #475569 !important;
}
html[data-theme="light"] .jl-noah-hero__title {
  color: #ffffff !important;
}
html[data-theme="light"] .jl-noah-hero__tagline {
  color: #dbeafe !important; /* JL-L8-ALLOW still on dark hero card */
  font-weight: 700;
}
html[data-theme="light"] .jl-noah-hero__body {
  color: #f1f5f9 !important;
}

/* ========== Grok-Guide (Phase A) ========== */
.jl-gg-fab {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 1040;
  border: 1px solid var(--jl-accent, #3b82f6);
  background: var(--jl-bg-elevated, #1e293b);
  color: var(--jl-text-primary, #f8fafc);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  cursor: pointer;
}
.jl-gg-fab:hover { filter: brightness(1.08); }
.jl-gg-fab--pulse {
  animation: jl-gg-pulse 1.8s ease-in-out infinite;
}
.jl-gg-fab--open { opacity: 0.55; }
@keyframes jl-gg-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.28); }
  50% { box-shadow: 0 8px 28px rgba(59,130,246,0.55); }
}

.jl-gg-nudge {
  position: fixed;
  right: 1rem;
  bottom: 4.2rem;
  z-index: 1041;
  max-width: min(22rem, calc(100vw - 2rem));
}
.jl-gg-nudge__card {
  background: var(--jl-bg-charcoal, #0f172a);
  border: 2px solid var(--jl-accent, #3b82f6);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--jl-text-primary);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.jl-gg-nudge__title { font-weight: 800; font-size: 0.95rem; margin-bottom: 0.25rem; }
.jl-gg-nudge__body { font-size: 0.78rem; line-height: 1.4; color: var(--jl-text-secondary); margin: 0 0 0.65rem; }
.jl-gg-nudge__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.jl-gg-backdrop {
  position: fixed; inset: 0; z-index: 1045;
  background: rgba(0,0,0,0.45);
}
.jl-gg-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(24rem, 100vw);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem 1rem;
  background: var(--jl-bg-charcoal, #0f172a);
  border-left: 1px solid var(--jl-border);
  color: var(--jl-text-primary);
  box-shadow: -12px 0 40px rgba(0,0,0,0.35);
  overflow: auto;
}
.jl-gg-panel__handle { display: none; }
.jl-gg-panel__head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; width: 100%; }
.jl-gg-panel__brand { font-weight: 800; font-size: 1.05rem; }
.jl-gg-panel__sub { font-size: 0.72rem; color: var(--jl-text-secondary); line-height: 1.35; max-width: 18rem; }
.jl-gg-panel__close {
  background: none; border: none; font-size: 1.5rem; line-height: 1;
  color: var(--jl-text-muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.2rem;
  flex-shrink: 0;
}
.jl-gg-panel__close-lbl { display: none; }
.jl-gg-panel__here {
  font-size: 0.78rem;
  background: var(--jl-bg-deep);
  border: 1px solid var(--jl-border);
  border-left: 3px solid var(--jl-accent, #3b82f6);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.jl-gg-panel__hover { margin-top: 0.35rem; color: var(--jl-text-secondary); font-size: 0.72rem; }
.jl-gg-panel__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.jl-gg-chip {
  border: 1px solid var(--jl-border);
  background: var(--jl-bg-elevated);
  color: var(--jl-text-primary);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.7rem;
  cursor: pointer;
}
.jl-gg-chip:hover { border-color: var(--jl-accent); }
.jl-gg-panel__ask { display: flex; flex-direction: column; gap: 0.4rem; }
.jl-gg-panel__input {
  background: var(--jl-bg-deep) !important;
  color: var(--jl-text-primary) !important;
  border: 1px solid var(--jl-border) !important;
}
.jl-gg-panel__answer {
  font-size: 0.8rem;
  line-height: 1.45;
  background: var(--jl-bg-deep);
  border: 1px solid var(--jl-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  max-height: 40vh;
  overflow: auto;
}
.jl-gg-panel__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.72rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--jl-border);
}
.jl-gg-panel__ai--ok { color: #22c55e; font-weight: 700; }
.jl-gg-panel__ai--issue { color: #fbbf24; font-weight: 700; }
.jl-gg-panel__ai--off { color: #ef4444; font-weight: 700; }
.jl-gg-panel__link { color: var(--jl-accent); text-decoration: none; }
.jl-gg-panel__link:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .jl-gg-fab { bottom: 4.5rem; font-size: 0.72rem; padding: 0.45rem 0.75rem; }
  .jl-gg-nudge { bottom: 7.2rem; }
}

/* Phone: bottom sheet — never park the × under the status bar / ☰ */
.jl-phone-platform .jl-gg-backdrop {
  z-index: 250;
}
.jl-phone-platform .jl-gg-panel {
  top: auto;
  left: 0;
  right: 0;
  bottom: calc(var(--jl-mobile-bottom-nav-height, 52px) + var(--jl-safe-bottom, 0px));
  width: 100%;
  max-height: min(72dvh, calc(100dvh - var(--jl-safe-top, 0px) - var(--jl-mobile-topbar-height, 38px) - var(--jl-mobile-bottom-nav-height, 52px) - 10px));
  z-index: 260;
  border-left: none;
  border-top: 1px solid var(--jl-border);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.35);
  padding: 0.35rem 0.9rem calc(0.85rem + var(--jl-safe-bottom, 0px));
}
.jl-phone-platform .jl-gg-panel__handle {
  display: block;
  width: 2.4rem;
  height: 4px;
  border-radius: 999px;
  background: var(--jl-border);
  margin: 0.15rem auto 0.45rem;
}
.jl-phone-platform .jl-gg-panel__close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.55rem;
  border: 1px solid var(--jl-border);
  border-radius: 8px;
  background: var(--jl-bg-elevated);
  color: var(--jl-text-primary);
  font-size: 1.05rem;
}
.jl-phone-platform .jl-gg-panel__close-lbl {
  display: inline;
  font-size: 0.78rem;
  font-weight: 700;
}
.jl-phone-platform .jl-gg-panel__close-x {
  font-size: 1.35rem;
  line-height: 1;
}
.jl-phone-platform .jl-gg-fab {
  z-index: 230;
  bottom: calc(var(--jl-mobile-bottom-nav-height, 52px) + 0.65rem);
}
.jl-phone-platform .jl-gg-fab--open {
  display: none;
}
.jl-phone-platform .jl-gg-nudge {
  bottom: calc(var(--jl-mobile-bottom-nav-height, 52px) + 3.6rem);
  z-index: 235;
}

/* Videos catalog (Dashboard Videos panel + /videos) */
.jl-videos-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.jl-videos-catalog__card {
  background: var(--jl-bg-charcoal);
  border: 1px solid var(--jl-border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jl-videos-catalog__title {
  font-weight: 600;
  color: var(--jl-text-primary);
  font-size: 0.92rem;
}
.jl-videos-catalog__desc {
  font-size: 0.8rem;
  color: var(--jl-text-secondary);
  line-height: 1.35;
  flex: 1;
}
.jl-videos-catalog__meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--jl-text-muted);
}

.jl-help-article__title {
    margin: 0 0 0.85rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--jl-text-primary);
}

.jl-mailbox-ready {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--jl-border);
    border-radius: 8px;
    background: var(--jl-bg-deep);
}
.jl-mailbox-ready__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--jl-text-primary);
    margin-bottom: 0.28rem;
}
.jl-mailbox-ready__who {
    color: var(--jl-text-secondary);
    min-width: 6.5rem;
}
.jl-mailbox-ready__state {
    font-weight: 700;
}
.jl-mailbox-ready__note {
    color: var(--jl-text-muted);
    font-size: 0.75rem;
}
.jl-mailbox-ready__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    background: var(--jl-text-muted);
}
.jl-mailbox-ready__dot--ok {
    background: var(--jl-vault-green);
}
.jl-mailbox-ready__dot--fail {
    background: #c0392b;
}
.jl-mailbox-ready__dot--idle {
    background: var(--jl-text-muted);
}
.jl-mailbox-ready__check {
    margin-top: 0.4rem;
}
.jl-mailbox-ready__hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--jl-text-muted);
    line-height: 1.35;
}
