/* ==========================================================================================================================
 * Glass layer, 4 Dec 2026 (step 1 of the rebuild). The agreed look from the clickable draft (Main.dc.html):
 * a plain light-grey ground (no gradients), what you read on solid white cards with 22px corners and a soft shadow,
 * a frosted-glass side menu, pill buttons with one solid blue, chips whose pressed one is solid ink, inputs with a
 * blue glow. Colours come from tokens.css (light and dark). Loaded last, so it wins where it disagrees with the files
 * before it. The chat (#/chat, body.on-chat) keeps its own frame from chat.css: it is no longer in the menu.
 * ========================================================================================================================== */

h1 { letter-spacing: -0.025em; }

/* ---------- the frame ---------- */
.topbar { background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-bottom: 1px solid var(--glass-line); }
.rail { background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }

@media (min-width: 900px) {
  /* A computer: the menu is joined to the left edge, full height, and stays put while the page scrolls. */
  body:not(.on-chat) { padding-left: var(--rail); }
  body:not(.on-chat) .topbar { display: none; }
  body:not(.on-chat) .rail { display: flex; position: fixed; inset: 0 auto 0 0; width: var(--rail); height: auto; max-height: none; padding: 20px 12px 24px; border: 0; border-right: 1px solid var(--glass-line); border-radius: 0; box-shadow: none; z-index: 30; overflow-y: auto; }
  body:not(.on-chat) .rail > .brand { display: flex; }
  body:not(.on-chat) .page { padding-top: 2.5rem; padding-inline: 2.25rem; }
}
@media (max-width: 899.98px) {
  /* A phone: the same menu opens from the menu button as a panel at the left, under the top bar. */
  body:not(.on-chat) .rail { position: fixed; inset: 56px auto 0 0; width: min(300px, 86vw); height: auto; max-height: none; padding: var(--s-3) 12px var(--s-5); border: 0; border-right: 1px solid var(--glass-line); border-radius: 0; box-shadow: 0 24px 60px -12px rgb(15 20 25 / 0.28); z-index: 50; overflow-y: auto; }
  body:not(.on-chat).menu-open { overflow: hidden; }
}

/* ---------- the menu ---------- */
.side-brand { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--glass-line); }
.side-brand b { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.side-brand span { font-size: 0.9375rem; font-weight: 400; color: var(--grey); }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.side-grp { padding: 16px 12px 6px; font-size: 0.9375rem; font-weight: 500; color: var(--grey); }
.side-gap { height: 14px; }
.side-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px 0 12px; border-radius: 14px; color: color-mix(in srgb, var(--ink) 86%, var(--grey)); font-size: 1rem; font-weight: 500; text-decoration: none; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.side-item .ic { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--grey); transition: color var(--dur) var(--ease); }
.side-item .ic .knob { fill: var(--glass-solid); }
.side-item .lb { flex: 1 1 auto; min-width: 0; }
.side-item[aria-current="page"] { background: var(--cur); color: var(--ink); font-weight: 600; box-shadow: var(--cur-lift); }
.side-item[aria-current="page"] .ic { color: var(--blue); }
.side-item[aria-current="page"] .ic .knob { fill: var(--cur); }
.side-item:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (hover: hover) {
  .side-item:hover { background: var(--glass-hover); color: var(--ink); text-decoration: none; }
  .side-item[aria-current="page"]:hover { background: var(--cur); }
  .side-item:hover .ic { color: var(--ink); }
  .side-item[aria-current="page"]:hover .ic { color: var(--blue); }
}
/* A number on a menu item: red for clients that need you now, blue for things waiting. Words for screen readers sit inside. */
.bd { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.bd-stop { background: var(--bd-stop-bg); color: var(--bd-stop); }
.bd-new { background: var(--bd-new-bg); color: var(--bd-new); }

/* The person, then language, colour and log out: quiet words, no solid button. */
.rail .bot { margin-top: 0; padding-top: 0; display: grid; gap: 0; }
.side-me { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 12px 0; border-top: 1px solid var(--glass-line); font-size: var(--t-md); }
.side-me .av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: var(--av-bg); color: var(--av-ink); font-size: 0.9375rem; font-weight: 600; }
.side-me-t { display: flex; flex-direction: column; min-width: 0; }
.side-me .me { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.side-me .role { font-size: var(--t-sm); color: var(--grey); }
.side-sw { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-4); padding: var(--s-2) 12px 0 calc(12px + 0.25rem); }
.side-sw .seg button { min-height: 36px; }
.side-out { padding: 0 12px; }
.side-out button { min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--grey); font-size: var(--t-sm); cursor: pointer; }
@media (hover: hover) { .side-out button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; } }
@media (max-width: 899.98px) { .side-item { min-height: 48px; } .side-sw .seg button, .side-out button { min-height: 44px; } }

/* ---------- what you read: solid cards on the grey ---------- */
.card-q { background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--lift); }
.settings > .sheet { padding: var(--s-4) var(--s-5); background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--lift); }
.alist, .adrop, .aq, .acount { box-shadow: var(--lift); }
.thread .tile { border-radius: 18px; }

/* ---------- controls ---------- */
.btn { padding: 0 20px; border-color: var(--btn-line); border-radius: 999px; background: var(--btn-bg); box-shadow: var(--btn-lift); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 100ms var(--ease); }
.btn:active:not(:disabled) { transform: scale(0.97); opacity: 1; }
.btn-primary { background: var(--btn); border-color: transparent; color: var(--on-btn); box-shadow: var(--pri-lift); }
.btn-quiet, .btn.btn-quiet { padding: 0 var(--s-2); border-color: transparent; background: transparent; box-shadow: none; }
.btn-sm { padding: 0 var(--s-3); }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--bg); border-color: var(--btn-line-hover); box-shadow: var(--btn-hover-lift); }
  .btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--btn) 88%, #000); border-color: transparent; box-shadow: var(--pri-lift); }
  .btn-quiet:hover:not(:disabled), .btn.btn-quiet:hover:not(:disabled) { background: transparent; border-color: transparent; box-shadow: none; }
}
/* Filter chips: the pressed one is solid ink. */
.chips button { border-color: var(--btn-line); background: var(--btn-bg); color: color-mix(in srgb, var(--ink) 80%, var(--grey)); transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 100ms var(--ease); }
.chips button:active { transform: scale(0.97); }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); font-weight: 500; }
@media (hover: hover) { .chips button:not([aria-pressed="true"]):hover { background: var(--bg); border-color: var(--btn-line-hover); color: var(--ink); } }
.reply { border-color: var(--btn-line); background: var(--btn-bg); box-shadow: var(--btn-lift); }

/* Inputs: 12px corners, a blue glow when the cursor is in them. */
.field, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"], select, textarea { border-color: var(--in-line); border-radius: 12px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.field:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--blue); box-shadow: var(--glow); outline: 2px solid transparent; outline-offset: 0; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { box-shadow: none; outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- comfort settings ---------- */
@media (prefers-reduced-transparency: reduce) {
  .rail, .topbar { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled), .chips button:active { transform: none; }
  .side-item, .side-item .ic { transition: none; }
}

/* The phone's top bar has no tabs any more, so the name fits beside the mark again. */
.topbar .brand > span { display: inline; }
