/* Account + "Write to the author" sheets (render inside .sheet, outside #screen), and admin.html. Prefixes: .ac- .fb- */

/* .glass (glass.css, later in the cascade) sets position:relative and beats .sheet's position:fixed. */
.ac-sheet.sheet { position: fixed; }

.ac, .fb { padding: 2px 0 20px; }

.ac-soon { padding: 6px 0 14px; font-size: 15px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.ac-lead { margin-bottom: 18px; font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 46ch; overflow-wrap: anywhere; hyphens: manual; }
.ac-muted { font-size: var(--t-small, 13px); line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.ac-wait { padding: 8px 0 18px; }
.ac-note { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r-s); background: rgb(var(--fg-rgb) / 0.06); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ac-error { margin: 0; font-size: 14px; line-height: 1.4; color: var(--red); overflow-wrap: anywhere; }
.ac-error[hidden], .ac-note[hidden], .fb-contact[hidden] { display: none; }

.ac-tabs { display: flex; width: 100%; }
.ac-tabs button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; }

.ac-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.ac-wide { width: 100%; min-height: 50px; }
.ac-form .ac-wide { margin-top: 4px; }
.ac-forgot { align-self: center; padding: 6px 4px; min-height: 32px; }
.ac-btn-busy, .ac-wide[aria-busy="true"] { opacity: 0.55; }

/* ---------- signed in ---------- */
.ac-me { display: flex; align-items: flex-start; gap: 18px; padding: 4px 0 14px; }
.ac-me__text { flex: 1 1 auto; min-width: 0; }
.ac-avatar-wrap { position: relative; flex: none; }
.ac-avatar {
  position: relative; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%;
  overflow: hidden; background: none; color: var(--fg); cursor: pointer;
  transition: transform var(--dur-fast, 120ms) var(--ease-out, ease-out), opacity var(--dur, 200ms);
  -webkit-tap-highlight-color: transparent;
}
.ac-avatar:active { transform: scale(0.96); }
.ac-avatar.is-busy { opacity: 0.45; }
.ac-avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.ac-face-slot { display: contents; }
.ac-avatar .av-face { width: 84px; height: 84px; font-size: 34px; }
.ac-avatar .av-face svg { width: 34px; height: 34px; }
.ac-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ac-remove { min-height: 32px; padding: 4px 6px; font-size: 13px; }
.ac-remove[hidden] { display: none; }
.ac-hint { margin-top: 8px; }
.ac-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ac-nick { display: flex; gap: 8px; align-items: center; }
.ac-nick .input { flex: 1 1 auto; min-width: 0; }
.ac-save { flex: none; min-height: 48px; }
.ac-email { margin-top: 8px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.ac-sync { margin: 12px 0 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ac-sync__title { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; overflow-wrap: anywhere; hyphens: manual; }
.ac-sync__when { margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.ac-ask { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.ac-ask .ac-lead { margin-bottom: 4px; }
.ac-ask .ac-muted { margin-bottom: 8px; }

/* ---------- account part of the sheet ---------- */
.ac-acct { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.ac-acct__title { margin-bottom: 10px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; }
.ac-acct .ac-lead { margin-bottom: 14px; }
.ac-providers { display: flex; flex-direction: column; gap: 10px; }
.ac-provider { gap: 10px; }
.ac-provider__mark { display: inline-grid; place-items: center; width: 22px; height: 22px; font: 700 16px/1 var(--f-sans); }
.ac-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.ac-or::before, .ac-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ac-acct .ac-form { margin-top: 12px; }
.ac-acct .ac-error { margin-top: 10px; }
.ac-code { font-size: 22px; letter-spacing: 0.25em; font-variant-numeric: tabular-nums; text-align: center; }
.ac-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 12px; }
.ac-links .link { min-height: 36px; padding: 6px 2px; font-size: 14px; }
.ac-links .link:disabled { opacity: 0.5; cursor: default; }
.ac-out-note { margin-top: 10px; text-align: center; }
.ac-acct .ac-email { margin: 0 0 4px; font-size: 15px; color: var(--fg); }

/* ---------- the face: photo, first letter on the app colour, or a person icon (js/ui/avatar.js) ---------- */
.av-face {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  font: 650 15px/1 var(--f-sans); letter-spacing: -0.02em; user-select: none; -webkit-user-select: none;
}
.av-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-face--letter { background: rgb(var(--cta-rgb)); color: #fff; }
.av-face--none { background: rgb(var(--fg-rgb) / 0.1); color: var(--muted); }
.av-face--none svg { width: 18px; height: 18px; }
/* the corner button without a photo or nickname: just the person icon, no grey disc (owner, 2026-11-22) */
.av-btn .av-face--none { background: none; color: var(--fg); }
.av-btn .av-face--none svg { width: 20px; height: 20px; }

/* the corner button (replaces the gear): face, plus the nickname where there is room */
#app-corner .av-btn, .av-btn {
  height: var(--corner-h, 42px); min-height: var(--corner-h, 42px); padding: 0 5px; gap: 8px; color: var(--fg);
  max-width: 200px;
}
/* #app-corner outranks a plain .av-btn.has-nick, so the id is repeated: with a nickname the right side keeps a little air after the last letter */
#app-corner .av-btn.has-nick, .av-btn.has-nick { padding: 0 16px 0 5px; }
.av-btn .av-face { width: calc(var(--corner-h, 42px) - 10px); height: calc(var(--corner-h, 42px) - 10px); }
.av-btn__nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1 var(--f-sans); letter-spacing: -0.01em; }
.av-btn__nick[hidden] { display: none; }
.av-btn[aria-expanded="true"], .av-btn[aria-current] { box-shadow: 0 0 0 2px rgb(var(--cta-rgb) / 0.55); }
@media (max-width: 479px) {
  .av-btn__nick { display: none; }
  #app-corner .av-btn, .av-btn, .av-btn.has-nick { width: var(--corner-h, 42px); padding: 0; justify-content: center; }
}

.av-menu {
  position: fixed; z-index: 60; min-width: 196px; max-width: calc(100vw - 16px); padding: 6px; border-radius: var(--r-m, 18px);
  display: flex; flex-direction: column; gap: 2px; animation: av-menu-in var(--dur-fast, 140ms) var(--ease-out, ease-out);
}
/* the glass look comes from .glass (like the corner pills); only a soft lift is added, and position stays fixed */
.av-menu.glass { position: fixed; }
@keyframes av-menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.av-menu__item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px 0 12px; border: 0; border-radius: var(--r-s, 12px);
  background: none; color: var(--fg); font: 600 15px/1.2 var(--f-sans); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.av-menu__item:focus-visible { outline: 2px solid rgb(var(--cta-rgb)); outline-offset: -2px; }
@media (hover: hover) { .av-menu__item:hover { background: var(--hover); } }
.av-menu__item:active { background: var(--press); }
.av-menu__icon { display: inline-grid; place-items: center; width: 20px; color: var(--muted); }
.av-menu__icon svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .av-menu { animation: none; } }

/* Settings › Account rows */
/* Settings' icon slot is 20px wide; the face is 32px, so the slot is widened too (else the face runs into the name) */
.ac-sec .st-row__icon { width: 32px; }   /* both rows of the block share the 32px slot, so their names start on one line */
.st-row__icon.ac-sec__face, .ac-sec__face { width: 32px; height: 32px; }
.ac-sec .av-face { width: 32px; height: 32px; }

/* ---------- feedback ---------- */
.fb-kind { display: flex; width: 100%; }
.fb-kind button { flex: 1 1 0; min-width: 0; }
.fb .ac-form { margin-top: 4px; }
.fb-text { min-height: 140px; font: 500 15px/1.45 var(--f-sans); }
.fb-done { display: flex; flex-direction: column; gap: 18px; padding: 8px 0 6px; }
.fb-done__title { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; overflow-wrap: anywhere; }

/* ---------- admin.html ---------- */
.fb-admin { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 28px) 16px 64px; }
.fb-admin__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.fb-admin__title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.fb-admin__who { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.fb-admin__panel { padding: 22px; border-radius: var(--r-l); background: rgb(var(--fg-rgb) / 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.fb-admin__panel .ac-form { margin-top: 0; max-width: 420px; }
.fb-admin__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.fb-admin__count { font-size: 13px; color: var(--muted); }
.fb-filter { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.fb-filter button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: rgb(var(--fg-rgb) / 0.07);
  color: var(--muted); font: 600 13px/1 var(--f-sans); cursor: pointer;
}
.fb-filter button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.fb-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fb-item__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.fb-item__kind { padding: 3px 9px; border-radius: var(--r-pill); background: rgb(var(--fg-rgb) / 0.08); color: var(--fg); font-size: 12px; font-weight: 600; }
.fb-item__kind--bug { background: color-mix(in srgb, var(--red) 22%, transparent); }
.fb-item__kind--idea { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.fb-item__status { margin-left: auto; font-size: 12px; }
.fb-item__msg { margin: 10px 0 8px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item__from { font-size: 13px; overflow-wrap: anywhere; }
.fb-item__meta { margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--faint); overflow-wrap: anywhere; }
.fb-item__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fb-empty { padding: 28px 0; color: var(--muted); font-size: 14px; }
/* v6 (owner): "Write to the author" — a bigger icon in the app colour */
.st-row__icon.st-row__icon--fb, .st-row__icon.st-row__icon--fb svg { color: var(--accent) !important; }
.st-row__icon.st-row__icon--fb { width: 32px; height: 32px; }
.st-row__icon.st-row__icon--fb svg { width: 28px; height: 28px; }
.ac-program { text-decoration: none; color: inherit; }
/* v7: the level under the face */
.ac-level { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-weight: 600; font-size: 15px; }
.ac-level:empty { display: none; }
.ac-level__n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgb(var(--accent-rgb) / 0.16); color: var(--accent); font-weight: 800; font-size: 14px; }

/* the profile menu (owner 2026-11-19): still clear glass, but what lies behind must not get in the way of reading.
   Under the menu only: a strong frost first, then a little darker (lighter in the light theme) and richer, then the
   same refracting rim as every glass piece. A faint tint on top keeps the words on a calm field. */
.av-menu.glass {
  --av-frost: blur(16px) saturate(1.5) brightness(0.62);
  background: rgb(18 18 22 / 0.28);
  -webkit-backdrop-filter: var(--av-frost);
  backdrop-filter: var(--av-frost);
}
:root[data-theme="light"] .av-menu.glass { --av-frost: blur(16px) saturate(1.6) brightness(1.12); background: rgb(255 255 255 / 0.42); }
html.glass-refract .av-menu.glass[data-glass-ready] {
  -webkit-backdrop-filter: var(--av-frost) var(--glass-filter);
  backdrop-filter: var(--av-frost) var(--glass-filter);
}
