/*
 * nav-orb.css — the phone's corner menu button (`tally:nav-orb`, 2026-10-23).
 * In place of the bottom bar when Settings → תפריט בטלפון is "כפתור בפינה"
 * (the default with design M). app.js renderOrb_ / openOrbMenu_.
 * Phones only: `.halves` is hidden from 1024px, where the side panel is the menu.
 */

.halves.is-orb {
  inset-inline: auto;
  inset-inline-start: 18px;
  inline-size: 64px;
  block-size: 64px;
  max-inline-size: none;
  margin: 0;
}

.halves__orb {
  position: relative;
  inline-size: 64px;
  block-size: 64px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--surface-strong);
  backdrop-filter: var(--surface-blur);
  -webkit-backdrop-filter: var(--surface-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 1px var(--border), var(--shadow-lg);
  cursor: pointer;
}
.halves__orb svg { inline-size: 24px; block-size: 24px; }
/* The small dot: you are in this section. */
.halves__orb.is-in-section::after {
  content: "";
  position: absolute;
  inset-block-end: 10px;
  inline-size: 5px;
  block-size: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* `tally:orb-account` (2026-10-24, Almon): the corner menu holds settings and
   sign-out, so the account button at the top is not drawn in this mode. */
@media (max-width: 1023px) {
  html[data-nav="orb"] .account { display: none; }
}

/* With no bar, content needs less room at the bottom. */
@media (max-width: 1023px) {
  html[data-nav="orb"] #app { padding-block-end: 104px; }
}

.orb-menu { position: fixed; inset: 0; z-index: 70; }
.orb-menu__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: orb-fade 0.18s ease both;
}
.orb-menu__list {
  position: absolute;
  /* 2026-10-25: held from the top as well as the bottom — on Enbar's Samsung the
     column was taller than the screen and its head (account card) slid off the top.
     Items now start at the top, the ✕ stays down by the corner, and a column too
     tall for the screen scrolls (padding keeps the shadows from being clipped). */
  inset-inline-start: 12px;
  inset-inline-end: 0;
  inset-block-start: calc(6px + env(safe-area-inset-top));
  inset-block-end: calc(8px + env(safe-area-inset-bottom));
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.orb-menu__list::-webkit-scrollbar { display: none; }
.orb-menu__list > .orb-menu__close { margin-block-start: auto; flex-shrink: 0; }
.orb-menu__list > * { flex-shrink: 0; }
.orb-menu__list > * { animation: orb-pop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.2) both; }
.orb-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.orb-menu__icon {
  inline-size: 54px;
  block-size: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-strong);
  backdrop-filter: var(--surface-blur);
  -webkit-backdrop-filter: var(--surface-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 1px var(--border), var(--shadow-sm);
}
.orb-menu__icon svg { inline-size: 22px; block-size: 22px; }
.orb-menu__item.is-selected .orb-menu__icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
}
html[data-design="etched"] .orb-menu__item.is-selected .orb-menu__icon {
  background: transparent;
  color: var(--text);
  backdrop-filter: none;
  box-shadow: var(--clear-ring);
}
.orb-menu__actions { display: flex; flex-wrap: wrap; gap: 8px; max-inline-size: 320px; margin-block-start: 4px; }
.orb-menu__actions .btn { inline-size: auto; min-block-size: 42px; padding-inline: 16px; font-size: 0.9375rem; }
.orb-menu__close { color: var(--text); }

/* Head of the column: who is signed in, then settings / business / sign-out
   as small glass pills — the least used, so the furthest from the thumb. */
.orb-menu__me {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-inline-size: min(340px, calc(100vw - 36px));
  padding: 12px;
  margin-block-end: 6px;
  border-radius: 22px;
  background: var(--surface-strong);
  backdrop-filter: var(--surface-blur);
  -webkit-backdrop-filter: var(--surface-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 1px var(--border), var(--shadow-sm);
}
html[data-design="etched"] .orb-menu__me { outline: 1px solid var(--etch); outline-offset: -6px; }
.orb-menu__who { display: flex; align-items: center; gap: 10px; padding-inline: 2px; }
.orb-menu__who .sidebar__avatar { inline-size: 38px; block-size: 38px; flex: none; }
.orb-menu__who-text { display: flex; flex-direction: column; min-inline-size: 0; line-height: 1.25; }
.orb-menu__who-text strong { font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orb-menu__who-text span { color: var(--text-muted); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orb-menu__account { display: flex; flex-wrap: wrap; gap: 6px; }
.orb-menu__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 38px;
  padding-inline: 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.orb-menu__pill svg { inline-size: 17px; block-size: 17px; flex: none; }
.orb-menu__pill.is-selected { color: var(--accent); box-shadow: var(--clear-ring, inset 0 0 0 1.5px var(--accent)); background: transparent; }
.orb-menu__pill--out { color: var(--neg); }

@keyframes orb-pop { from { opacity: 0; transform: translateY(14px) scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes orb-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .orb-menu__list > *, .orb-menu__scrim { animation: none; }
}
