/* App navigation uses a regular glass material. Reading surfaces stay opaque. */
body.app-authed {
  --sidebar-width: 280px;
  --bg: #111214;
  --panel: #18191c;
  --card: #18191d;
  --border: #303137;
  --muted: #a2a3ad;
  --faint: #81838e;
  padding-left: calc(var(--sidebar-width) + 10px);
  background: radial-gradient(ellipse at 0 5%, #28252f 0, transparent 40%), var(--bg);
}
body.app-authed > .topbar { display: none; }
body.app-authed .screen { max-width: 1136px; padding: 24px 40px 56px; }
body.app-authed #screen-builder.active { display: block; }
.practice-main { min-width: 0; }
.app-sidebar {
  position: fixed; z-index: 70; inset: 10px auto 10px 10px;
  display: flex; flex-direction: column; width: var(--sidebar-width);
  padding: 14px 10px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 24px;
  background: linear-gradient(155deg, rgba(74,69,77,.48), rgba(28,29,34,.78) 50%, rgba(44,39,40,.65));
  backdrop-filter: blur(36px) saturate(145%); -webkit-backdrop-filter: blur(36px) saturate(145%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), inset 1px 0 0 rgba(255,255,255,.04), 0 12px 36px rgba(0,0,0,.18);
  transition: width .22s ease, transform .22s ease;
}
.app-sidebar svg, .app-toolbar svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 5px; margin-bottom: 18px; }
.sidebar-brand { background: transparent; border: 0; padding: 8px; border-radius: 10px; }
.sidebar-brand img { display: block; width: 90px; height: auto; }
.sidebar-icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; padding: 7px; border: 1px solid transparent; border-radius: 10px; color: #bdbdc6; background: transparent; }
.sidebar-icon-button:hover { color: #fff; background: rgba(255,255,255,.09); }
.nav-authed { display: grid; gap: 3px; }
.app-nav-item { display: flex; align-items: center; gap: 12px; min-height: 41px; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #c4c3cc; font: 500 13px var(--font-body); text-align: left; }
.app-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-nav-item.active { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.06); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.sidebar-search { display: flex; align-items: center; gap: 9px; margin: 18px 4px 6px; padding: 0 9px; min-height: 36px; border: 1px solid rgba(255,255,255,.075); border-radius: 10px; color: #aaa9b5; background: rgba(0,0,0,.1); }
.sidebar-search input { min-width: 0; width: 100%; padding: 8px 0; border: 0; border-radius: 0; background: none; font: 12px var(--font-body); box-shadow: none; }
.sidebar-search input::placeholder { color: #aaa9b5; }
.sidebar-search:focus-within { outline: 2px solid #bba3ed; outline-offset: 2px; }
.sidebar-search input:focus { outline: none; }
.sidebar-search svg { width: 15px; }
.sidebar-search-key { font-size: 10px; white-space: nowrap; opacity: .65; }
.sidebar-search:focus-within .sidebar-search-key { display: none; }
.compact-search { display: none; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 5px 2px 20px; scrollbar-width: thin; }
.library-section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.product-library-label { margin: 23px 12px 10px; font: 500 11px var(--font-body); color: #a8a5b1; letter-spacing: .02em; }
.library-section-heading .product-library-label { margin-block: 0; }
.library-section-heading .sidebar-icon-button { margin-right: 3px; width: 28px; height: 28px; }
.product-library-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.library-product { min-width: 0; }
.library-product-heading { min-width: 0; display: flex; align-items: center; border-radius: 10px; }
.library-product-heading:hover { background: rgba(255,255,255,.04); }
.library-product-button { display: flex; align-items: center; gap: 9px; min-height: 38px; min-width: 0; flex: 1; padding: 8px 10px; border: 0; border-radius: 10px; color: #dddae3; background: transparent; text-align: left; }
.library-product-button strong { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 12.5px var(--font-body); }
.library-product-button svg { width: 17px; height: 17px; }
.library-product-button .group-chevron { width: 12px; height: 12px; color: #93929c; transform: rotate(-90deg); transition: transform .18s ease; }
.library-product.open .group-chevron { transform: none; }
.library-product-actions { flex-shrink: 0; display: flex; gap: 0; opacity: 0; }
.library-product-actions .sidebar-icon-button { width: 25px; height: 29px; padding: 5px; }
.library-product-actions svg { width: 14px; height: 14px; }
.library-product-heading:hover .library-product-actions, .library-product-heading:focus-within .library-product-actions { opacity: 1; }
.library-buyers { display: none; padding: 1px 0 8px 18px; }
.library-product.open .library-buyers { display: grid; gap: 2px; }
.library-persona { display: flex; align-items: center; min-width: 0; border: 1px solid transparent; border-radius: 10px; }
.library-persona:hover { background: rgba(255,255,255,.05); }
.library-persona.selected { background: rgba(206,189,231,.12); border-color: rgba(220,207,246,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.library-buyer-button { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 36px; padding: 8px 10px; color: #bdb9c6; font: 12px/1.5 var(--font-body); border: 0; background: transparent; border-radius: 10px; text-align: left; }
.library-buyer-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-persona.selected .library-buyer-button { color: #fff; }
.library-pin { width: 28px; height: 30px; margin-right: 3px; padding: 7px; opacity: 0; }
.library-pin svg { width: 14px; height: 14px; }
.library-persona:hover .library-pin, .library-persona:focus-within .library-pin, .library-pin[aria-pressed="true"] { opacity: 1; }
.library-pin[aria-pressed="true"] { color: #d1bbee; }
.product-library-empty { padding: 8px 12px; color: #aaa5b4; font-size: 12px; line-height: 1.6; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 9px; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px; list-style: none; border-radius: 12px; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: rgba(255,255,255,.06); }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: linear-gradient(140deg,#8c728c,#524f66); color: #fff; font-size: 11px; font-weight: 600; }
.account-summary-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
#user-chip-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; color: #eeebf2; }
#workspace-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: #aaa5b4; }
.account-menu summary > svg { width: 13px; height: 13px; color: #aaa5b4; }
.account-menu-body { position: absolute; z-index: 1; bottom: calc(100% + 12px); left: 0; width: 258px; max-width: calc(100vw - 42px); padding: 14px; border: 1px solid #505058; border-radius: 18px; background: #29282e; box-shadow: 0 12px 50px #0008, inset 0 1px 0 #ffffff12; }
.workspace-controls { display: grid; gap: 8px; }
.workspace-controls label { font-size: 11px; color: #b5afc0; margin: 0; }
.workspace-controls select { max-width: none; width: 100%; min-height: 38px; font-size: 12px; }
.minutes-button, .logout-button { display: block; width: 100%; padding: 10px 12px; margin-top: 7px; border: 0; border-radius: 10px; color: #d0c4e3; background: rgba(255,255,255,.05); text-align: left; font-size: 12px; }
.logout-button { color: #bdb8c7; background: none; }
.minutes-button:hover, .logout-button:hover { background: rgba(255,255,255,.1); }
a.logout-button { box-sizing: border-box; text-decoration: none; overflow-wrap: anywhere; }
.app-toolbar { position: sticky; z-index: 39; top: 0; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 14px 40px; background: linear-gradient(var(--bg) 65%, transparent); }
.app-context { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: #a2a0aa; }
.app-context strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; color: #e7e4eb; }
.app-context span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-context .context-separator { flex-shrink: 0; color: #6e6c77; }
.app-toolbar-note { margin-left: auto; flex-shrink: 0; color: #888691; font-size: 11px; }
#btn-library-mobile { display: none; }
.sidebar-backdrop { display: none; }
body[data-screen="call"] { padding-left: 0; }
body[data-screen="call"] .app-sidebar, body[data-screen="call"] .app-toolbar { display: none; }
@media (min-width: 821px) {
  body.library-collapsed { --sidebar-width: 64px; }
  body.library-collapsed .sidebar-head { padding: 0; justify-content: center; }
  body.library-collapsed .sidebar-brand, body.library-collapsed .sidebar-search, body.library-collapsed .sidebar-scroll, body.library-collapsed .app-nav-item span, body.library-collapsed .account-summary-copy, body.library-collapsed .account-menu summary > svg { display: none; }
  body.library-collapsed .app-nav-item { justify-content: center; padding: 10px; }
  body.library-collapsed .compact-search { display: flex; margin: 8px auto; }
  body.library-collapsed .sidebar-footer { margin-top: auto; }
  body.library-collapsed .account-menu summary { padding: 6px; }
  body.library-collapsed .account-menu-body { left: 58px; bottom: 0; }
}
@media (hover: none) {
  .library-product-actions, .library-pin { opacity: 1; }
}
@media (max-width: 1100px) {
  body.app-authed .screen { padding-inline: 28px; }
  .app-toolbar { padding-inline: 28px; }
  .app-toolbar-note { display: none; }
}
@media (max-width: 820px) {
  body.app-authed { padding-left: 0; }
  body.app-authed .screen { padding: 18px 20px 36px; }
  .app-sidebar { --sidebar-width: min(300px, calc(100vw - 52px)); inset: 8px auto 8px 8px; transform: translateX(calc(-100% - 16px)); visibility: hidden; border-radius: 22px; }
  body.library-mobile-open { overflow: hidden; }
  body.library-mobile-open .app-sidebar { transform: none; visibility: visible; }
  .sidebar-backdrop:not(.hidden) { display: block; position: fixed; z-index: 65; inset: 0; border: 0; border-radius: 0; padding: 0; background: rgba(0,0,0,.5); cursor: default; }
  .app-toolbar { min-height: 64px; padding: 12px 18px; }
  #btn-library-mobile { display: flex; }
  .glass-control { background: #ffffff0b; border-color: #ffffff14; box-shadow: inset 0 1px 0 #ffffff0b; }
  .library-buyer-button { min-height: 42px; }
  .library-product-button { min-height: 42px; }
  .library-pin { width: 32px; height: 36px; }
  .app-context { flex: 1; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .app-sidebar { background: #26252b; backdrop-filter: none; -webkit-backdrop-filter: none; border-color: #77737f; }
  .library-persona.selected, .app-nav-item.active { background: #47404f; border-color: #aaa0b7; }
  .app-toolbar-note, .product-library-label, .product-library-empty, .library-buyer-button { color: #e1dbe8; }
}
@supports not (backdrop-filter: blur(1px)) {
  .app-sidebar { background: #29282e; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app-sidebar, .group-chevron { transition: none; }
}

.navigation-dialog { margin: auto; width: min(420px, calc(100vw - 32px)); padding: 28px; color: var(--text); background: #24232a; border: 1px solid #55515f; border-radius: 24px; box-shadow: 0 30px 90px #0009, inset 0 1px 0 #ffffff15; }
.navigation-dialog::backdrop { background: #0009; backdrop-filter: blur(5px); }
.navigation-dialog h2 { margin-bottom: 24px; font: 600 22px var(--font-display); }
.navigation-dialog label { margin-bottom: 8px; font-size: 12px; }
.navigation-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.navigation-dialog > form > p.muted { margin: -12px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
#goal-form select, #goal-form input { display: block; width: 100%; margin-bottom: 16px; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .navigation-dialog::backdrop { backdrop-filter: none; }
}
