/* Resolve the layout before exposing content, not just the public navigation.
   Otherwise main paints full-width and then jumps right when auth adds the sidebar. */
html.platform-pending body { visibility: hidden; }
html { background: #fafafa; }
/* Authenticated application chrome. Public pages retain their existing design. */
.platform-chrome { position: sticky; top: 0; z-index: 50; font: 14px/1.5 var(--body); }
body.platform-active { padding: 0 0 0 224px; background: #fafafa; }
.platform-active .skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; padding: 0; }
.platform-active #header-placeholder,.platform-active #footer-placeholder,.platform-active .workspace-nav { display: none; }
.platform-sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: #f2f3f5; border-right: 1px solid #e2e3e7; padding: 28px 16px 18px; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; z-index: 60; box-sizing: border-box; }
.platform-logo { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 27px; letter-spacing: -1.2px; text-decoration: none; color: #191a21; }
.platform-logo::before { content: ''; width: 27px; height: 27px; background: url('/images/uncover-mark.svg') center/contain no-repeat; }
.platform-identity { margin: 30px 12px 20px; color: #454545; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.platform-sidebar nav { display: grid; gap: 5px; }
.platform-sidebar nav a,.platform-sidebar-bottom a,.platform-sidebar-bottom button { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 7px; padding: 10px 12px; min-height: 42px; text-decoration: none; color: #555864; font: inherit; background: transparent; cursor: pointer; text-align: left; box-sizing: border-box; }
.platform-sidebar a:hover,.platform-sidebar-bottom button:hover { background: #ebebeb; color: #262626; }
.platform-sidebar [aria-current=page] { background: #e5e5e5; color: #262626; font-weight: 600; box-shadow: 0 1px 3px #1515290a; }
.platform-nav-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.platform-sidebar-bottom { display: grid; margin-top: auto; padding-top: 24px; }
.platform-topbar { height: 64px; padding: 0 36px; border-bottom: 1px solid #e6e7eb; display: none; align-items: center; justify-content: space-between; background: #ffffffed; position: sticky; top: 0; z-index: 35; }
.platform-topbar>a { font-size: 13px; text-decoration: none; color: #505264; }
/* Page headings and sidebar already identify the destination. Keep only the mobile menu.
   Retain these hidden targets for navigation controllers in already-open tabs. */
.platform-page-name,.platform-topbar>a { display: none; }
.platform-menu-toggle,.platform-nav-shade { display: none; }
body.platform-active main.shell,body.platform-active main.workspace-home,body.platform-active main.recovery-shell,body.platform-active .account-container,body.platform-active .database-container { max-width: 1500px; width: 100%; margin: 0 auto; padding: 36px 36px 64px; box-sizing: border-box; }
body.platform-active h1 { font-size: 30px; font-weight: 500; line-height: 1.25; letter-spacing: -.035em; margin-bottom: 10px; }
body.platform-active h2 { font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -.025em; }
body.platform-active h3 { font-size: 16px; font-weight: 500; }
body.platform-active .intro,body.platform-active .workspace-heading p { font-size: 14px; line-height: 1.65; }
body.platform-active .workspace-heading { margin-bottom: 24px; }
body.platform-active .eyebrow,body.platform-active .workspace-heading .workspace-eyebrow { display: none; }
body.platform-active button,body.platform-active input,body.platform-active select { font-size: 14px; }
body.platform-active button,body.platform-active .workspace-primary { border-radius: 7px; }
body.platform-active input,body.platform-active select { border-radius: 6px; }
body.platform-active .workspace-overview { margin: 24px 0; border-radius: 9px; }
body.platform-active .workspace-metric { padding: 24px; gap: 8px; }
body.platform-active .workspace-metric strong { font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; }
body.platform-active .workspace-action { border-radius: 9px; padding: 24px; border-left-width: 3px; }
body.platform-active .workspace-action .workspace-eyebrow { margin-bottom: 12px; font-size: 11px; }
body.platform-active .workspace-action p,body.platform-active .workspace-case p { font-size: 14px; }
body.platform-active .workspace-case { border-radius: 9px; padding: 22px; }
body.platform-active .workspace-search { border-radius: 9px; }
body.platform-active .workspace-help { font-size: 13px; }
body.platform-active #workspace-status { background: transparent; padding: 0; font-size: 13px; color: var(--muted); }
body.platform-active .search-panel { margin: 24px 0 16px; background: #fff; padding: 22px; border-radius: 9px; }
body.platform-active .search-fields { gap: 16px; }
body.platform-active .search-panel details { margin-top: 10px; }
body.platform-active .results-status { margin: 20px 0 14px; font-size: 13px; }
body.platform-active .notice[data-source-notice] { font-size: 12px; margin: 10px 0; }
body.platform-active.discover-active #search-results { display: none; }
.discover-surface { background: #fff; border: 1px solid #e1e3e9; border-radius: 9px; overflow: hidden; }
.discover-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 16px; }
.discover-toolbar h2 { margin: 0; }
.discover-toolbar label { display: flex; align-items: center; gap: 10px; color: #6d6e76; font-size: 12px; }
.discover-toolbar label { white-space: nowrap; }
.discover-toolbar select { padding: 8px; border: 1px solid #d6d8e0; }
.discover-table-scroll { overflow-x: auto; }
.discover-surface table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
.discover-surface caption { text-align: left; padding: 0 20px 16px; color: #737580; font-size: 12px; }
.discover-surface th { background: #f7f8fa; border-block: 1px solid #e6e7eb; color: #686b76; font-weight: 500; font-size: 11px; white-space: nowrap; padding: 12px 16px; }
.discover-surface td { border-bottom: 1px solid #eceef2; padding: 17px 16px; vertical-align: middle; max-width: 240px; overflow-wrap: anywhere; }
.discover-surface tr:last-child td { border-bottom: 0; }
.discover-surface tr:hover td { background: #fafaff; }
.discover-surface strong { display: block; font-weight: 500; min-width: 155px; }
.discover-surface small { display: block; color: #747783; margin-top: 5px; font-size: 11px; }
.discover-balance { font-variant-numeric: tabular-nums; white-space: nowrap; }
.discover-surface button,.discover-close { background: white; color: #333544; border: 1px solid #dfe1e8; padding: 8px 11px; border-radius: 6px; white-space: nowrap; cursor: pointer; }
.discover-surface button:hover { border-color: #2424ff; color: #2424ff; }
.discover-empty { padding: 40px 20px 56px; color: #747783; text-align: center; font-size: 14px; }
body .discover-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(520px,100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid #e0e1e7; border-radius: 0; padding: 24px; box-sizing: border-box; background: white; color: var(--ink); box-shadow: -12px 0 60px #10102514; }
.discover-drawer::backdrop { background: #11112530; }
.discover-close { display: block; margin-left: auto; margin-bottom: 24px; }
body .discover-drawer .result-card { border: 0; border-radius: 0; padding: 0; margin: 0; }
body .discover-drawer .result-top { display: block; }
body .discover-drawer .result-amount { display: block; font-size: 26px; margin: 14px 0 28px; }
body .discover-drawer dl { display: grid; grid-template-columns: 1fr; gap: 18px; }
.discover-drawer dd { margin: 4px 0 0; font-size: 14px; }
.discover-drawer>div>p { font-size: 12px; color: #6d6e76; margin-top: 20px; }
.discover-drawer>div>button { background: #2424ff; color: white; border: 0; border-radius: 7px; padding: 12px 16px; margin-top: 20px; cursor: pointer; }
.platform-active [hidden][hidden] { display: none!important; }
@media(min-width:1100px) {
  .platform-active .workspace-home:not(.requests-home) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 24px; }
  .platform-active .workspace-home:not(.requests-home)>* { grid-column: 1 / -1; }
  .platform-active #workspace-requests-section { grid-column: 1; }
  .platform-active #workspace-cases-section { grid-column: 2; }
}
@media(max-width:1000px) {
  body.platform-active { padding-left: 190px; }
  .platform-sidebar { width: 190px; padding-inline: 12px; }
  body.platform-active main.shell,body.platform-active main.workspace-home,body.platform-active main.recovery-shell { padding: 28px 24px 50px; }
}
@media(max-width:700px) {
  body.platform-active { padding-left: 0; }
  .platform-topbar { display: flex; padding: 0 18px; height: 60px; gap: 16px; }
  .platform-topbar>a { margin-left: auto; font-size: 12px; }
  .platform-menu-toggle { display: block; background: transparent; border: 1px solid #dfe1e8; padding: 7px 10px; color: #333544; }
  .platform-sidebar { display: none; width: 250px; top: 60px; }
  .navigation-open .platform-sidebar { display: flex; }
  .navigation-open .platform-nav-shade { display: block; position: fixed; inset: 60px 0 0; z-index: 55; border: 0; border-radius: 0; background: #11112545; width: 100%; }
  body.platform-active main.shell,body.platform-active main.workspace-home,body.platform-active main.recovery-shell { padding: 24px 18px 50px; }
  body.platform-active h1 { font-size: 27px; }
  body.platform-active .workspace-metric { padding: 18px 12px; }
  body.platform-active .workspace-metric strong { font-size: 25px; }
  .discover-toolbar { align-items: start; flex-direction: column; padding: 16px; }
  .discover-toolbar label { width: 100%; justify-content: space-between; }
  .discover-surface table { min-width: 850px; }
  body.platform-active .search-panel { padding: 18px; }
}

/* Calm hierarchy and lightweight feedback throughout the working surface. */
body.platform-active { background: #f8f9fc; }
.platform-sidebar { background: #f6f6f6; border-right-color: #e7e7e7; }
.platform-sidebar nav { gap: 6px; }
.platform-sidebar nav a { min-height: 44px; font-size: 13px; border-radius: 9px; }
.platform-sidebar [aria-current=page] { background: #e5e5e5; color: #262626; box-shadow: none; }
.platform-sidebar-bottom { border-top: 1px solid #e5e7ee; padding-top: 12px; }
.platform-sidebar-bottom a,.platform-sidebar-bottom button { font-size: 12px; }
.platform-topbar { background: #ffffffd9; backdrop-filter: blur(18px); border-color: #e8eaf1; }
.platform-topbar>a { background: #fff; border: 1px solid #e3e6ed; border-radius: 8px; padding: 7px 12px; }
body.platform-active .workspace-action,body.platform-active .workspace-overview,body.platform-active .workspace-case,body.platform-active .workspace-search,.discover-surface,body.platform-active .search-panel { border-radius: 12px; box-shadow: 0 2px 5px #20244403; }
body.platform-active .workspace-action { background: linear-gradient(110deg,#fafaff,#fff 70%); }
body.platform-active .workspace-metric span { font-size: 12px; }
body.platform-active .workspace-section-heading>span { font-size: 11px; }
body.platform-active .workspace-badge { font-size: 11px; padding: 4px 10px; }
body.platform-active .workspace-help { margin-top: 28px; padding-top: 24px; }
.discover-surface td { padding-block: 15px; }
.discover-surface tr:has(input:checked) td { background: #f0f0ff; }
.discover-surface button { font-size: 12px!important; min-height: 36px; }
body .discover-drawer { padding: 28px; }
.discover-drawer dl>div { padding-bottom: 14px; border-bottom: 1px solid #f0f1f5; }
@media(prefers-reduced-motion:no-preference) {
  .platform-sidebar a,.platform-sidebar button,.platform-topbar>a,.discover-surface td,.discover-surface button { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
  .discover-drawer[open] { animation: drawer-enter 180ms cubic-bezier(.2,.8,.2,1); }
  .discover-drawer[open]::backdrop { animation: backdrop-enter 180ms ease; }
  @keyframes drawer-enter { from { transform: translateX(24px); opacity: .5; } to { transform: translateX(0); opacity: 1; } }
  @keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
}
@media(max-width:700px) {
  .discover-surface table { min-width: 0; }
  .discover-surface thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .discover-surface tbody { display: block; }
  .discover-surface tr { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 8px 10px; padding: 18px 16px; border-top: 1px solid #e9ebf2; }
  .discover-surface td { display: block; padding: 0; border: 0; max-width: none; }
  .discover-surface td:first-child { grid-column: 1; grid-row: 1; padding-top: 2px; }
  .discover-surface td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .discover-surface td:nth-child(n+3) { grid-column: 2; }
  .discover-surface td:nth-child(3),.discover-surface td:nth-child(4) { font-size: 12px; color: #767b89; }
  .discover-surface td:nth-child(5) { font-size: 18px; font-weight: 500; margin-top: 5px; }
  .discover-surface td:nth-child(6) { margin-top: 6px; }
  .discover-surface tr:has(input:checked) { background: #f0f0ff; }
  .discover-surface tr:hover td,.discover-surface tr:has(input:checked) td { background: transparent; }
  .discover-surface strong { min-width: 0; }
  .discover-toolbar h2 { font-size: 17px!important; }
  body .discover-drawer { padding: 22px; }
}

body.platform-active main.account-home { display: block; }
body .account-home .workspace-heading { align-items: flex-start; }
.account-home #account-status:empty { display: none; }
.account-home dl { display: grid; gap: 6px; margin: 20px 0 28px; }
.account-home dt { color: var(--muted); font-size: 13px; }
.account-home dd { margin: 0 0 14px; overflow-wrap: anywhere; }
.account-home .workspace-help { display: block; }

.platform-page { flex: 1; min-width: 0; width: 100%; }
.platform-navigating .platform-topbar { box-shadow: inset 0 -2px #2424ff; }

/* The mobile menu owns navigation, including the signed-out workspace fallback. */
@media(max-width:760px) { body .workspace-nav { display: none; } }
