/* Shahi SSO: Apple-style liquid glass on the Shahi mint lattice.
   Glass is reserved for the control layer (navigation, toolbars, sign-in sheet, buttons, menus);
   content sits on solid sheets so text stays readable. */

:root {
  color-scheme: light dark;
  --teal: #137373;
  --slate: #514281;
  --purple: #6f2b88;
  --brand: linear-gradient(90deg, var(--teal), var(--slate) 48%, var(--purple));

  --ground: #ffffff;
  --lattice: url("lattice-light.svg");
  --ink: #0f1b24;
  --ink-2: #4a5866;
  --ink-3: #6b7885;
  --line: rgb(15 27 36 / 0.09);
  --line-strong: rgb(15 27 36 / 0.16);
  --accent: var(--teal);
  --accent-ink: #ffffff;
  --accent-soft: rgb(18 117 111 / 0.1);
  --select: var(--purple);
  --danger: #b42318;
  --danger-soft: rgb(180 35 24 / 0.08);
  --ok: #0f6b45;

  --sheet: rgb(255 255 255 / 0.9);
  --glass: rgb(255 255 255 / 0.58);
  --glass-strong: rgb(255 255 255 / 0.74);
  --glass-edge: rgb(255 255 255 / 0.85);
  --glass-rim: rgb(15 27 36 / 0.08);
  --specular: linear-gradient(180deg, rgb(255 255 255 / 0.75), rgb(255 255 255 / 0) 42%);
  --shadow: 0 1px 2px rgb(15 27 36 / 0.06), 0 0.625rem 1.875rem -12px rgb(26 52 72 / 0.28);
  --shadow-lift: 0 2px 0.25rem rgb(15 27 36 / 0.06), 0 1.125rem 2.75rem -16px rgb(26 52 72 / 0.36);

  --r-sm: 0.625rem;
  --r-md: 0.875rem;
  --r-lg: 1.375rem;
  --r-xl: 1.75rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b1416;
    --lattice: url("lattice-dark.svg");
    --ink: #eef3f5;
    --ink-2: #aab7c0;
    --ink-3: #8795a0;
    --line: rgb(255 255 255 / 0.08);
    --line-strong: rgb(255 255 255 / 0.16);
    --accent: #2f9e94;
    --accent-ink: #04201d;
    --accent-soft: rgb(79 193 182 / 0.14);
    --select: #c79be0;
    --danger: #ff8a7a;
    --danger-soft: rgb(255 138 122 / 0.1);
    --ok: #6fd3a5;
    --sheet: rgb(20 30 34 / 0.92);
    --glass: rgb(28 40 46 / 0.55);
    --glass-strong: rgb(32 46 52 / 0.78);
    --glass-edge: rgb(255 255 255 / 0.14);
    --glass-rim: rgb(0 0 0 / 0.4);
    --specular: linear-gradient(180deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0) 40%);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 0.75rem 2rem -12px rgb(0 0 0 / 0.7);
    --shadow-lift: 0 2px 0.25rem rgb(0 0 0 / 0.4), 0 1.25rem 3rem -16px rgb(0 0 0 / 0.8);
    --brand: linear-gradient(90deg, #4fc1b6, #8e9bd6 50%, #c79be0);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Laptops: everything is sized in rem, so the root size scales the whole page. It eases down on
   smaller laptop screens (1280x720 to 1536x864, typical of 14-inch screens, get 14px to 14.5px) and stays at 16px
   on phones and large monitors. */
@media (min-width: 900px) {
  html { font-size: clamp(14px, calc(0.3vw + 0.8vh + 3px), 16px); }
}
body {
  margin: 0;
  min-height: 100vh;
  font: 400 0.9375rem/1.5 var(--sans);
  color: var(--ink);
  background-color: var(--ground);
  /* The lattice drifts in from the right, as on the Shahi brand plate. */
  background-image: linear-gradient(100deg, var(--ground) 18%, transparent 72%), var(--lattice);
  background-size: auto, 15rem 15rem;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: rgb(107 45 139 / 0.22); }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 0.1562rem solid var(--select); outline-offset: 2px; border-radius: 0.5rem; }
h1, h2, p { margin: 0; }
h1 { font: 700 1.875rem/1.15 var(--display); letter-spacing: -0.022em; }
h2 { font: 600 1.0625rem/1.3 var(--display); letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.5rem; }
.muted { color: var(--ink-2); }
.small { font-size: 0.8125rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; }
[hidden] { display: none !important; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-xs { width: 0.875rem; height: 0.875rem; stroke-width: 2.25; }
.icon-lg { width: 1.75rem; height: 1.75rem; stroke-width: 1.6; }
.icon-google { width: 1.125rem; height: 1.125rem; }

/* ---- Wordmark: the official logo shape (mask) painted with the brand gradient ------------ */
.wordmark {
  display: inline-block;
  height: 1em;
  aspect-ratio: 1450 / 436;
  background: var(--brand);
  -webkit-mask: url("shahi-logo-mask.png") center / contain no-repeat;
  mask: url("shahi-logo-mask.png") center / contain no-repeat;
  flex: none;
}
.wm-sm { font-size: 1.5625rem; }
.wm-md { font-size: 2.5rem; }
.wm-lg { font-size: 4.75rem; }

/* ---- Liquid glass ------------------------------------------------------------------------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(1.375rem) saturate(180%);
  backdrop-filter: blur(1.375rem) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 0 0 0.5px var(--glass-rim);
  isolation: isolate;
}
.glass::before { /* specular highlight along the top edge */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--specular);
  pointer-events: none;
  z-index: -1;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgb(15 27 36 / 0.04);
}
.sheet.glass { background: var(--glass); border-color: var(--glass-edge); box-shadow: var(--shadow-lift), inset 0 0 0 0.5px var(--glass-rim); }

/* ---- Layout ------------------------------------------------------------------------------- */
.page { width: min(67.5rem, 100% - 2rem); margin: 0 auto; padding: 1.75rem 0 4.5rem; display: grid; gap: 1.75rem; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.bar-wrap + .center { min-height: calc(100vh - 5.625rem); }
.page-head { display: grid; gap: 0.375rem; max-width: 64ch; }
.page-head-row { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1.25rem; }
.block { display: grid; gap: 0.75rem; }
.stack { display: grid; gap: 0.875rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }
.count {
  font: 600 0.75rem/1 var(--sans);
  color: var(--ink-2);
  background: var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
}

/* ---- Floating capsule bar ----------------------------------------------------------------- */
.bar-wrap { position: sticky; top: 0; z-index: 10; padding: 0.875rem 1rem 0; }
.bar {
  width: min(67.5rem, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.375rem 0.375rem 1.125rem;
  border-radius: 999px;
}
.bar-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; margin-right: auto; }
.bar-product { font: 600 0.75rem/1 var(--sans); letter-spacing: 0.04em; color: var(--ink-2); }
.bar-tabs { display: flex; gap: 2px; margin: 0 auto; padding: 0.1875rem; border-radius: 999px; background: rgb(15 27 36 / 0.05); }
@media (prefers-color-scheme: dark) { .bar-tabs { background: rgb(255 255 255 / 0.06); } }
.tab {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); background: var(--glass-strong); box-shadow: 0 1px 0.1875rem rgb(15 27 36 / 0.12), inset 0 0 0 0.5px var(--glass-edge); }
.badge { min-width: 1.125rem; padding: 2px 0.375rem; border-radius: 999px; background: var(--select); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 0.875rem; text-align: center; }
@media (prefers-color-scheme: dark) { .badge { color: #1d0b27; } }

.account, .more { position: relative; }
.account > summary, .more > summary { list-style: none; cursor: pointer; }
.account > summary::-webkit-details-marker, .more > summary::-webkit-details-marker { display: none; }
.avatar {
  width: 2.375rem; height: 2.375rem; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  font: 600 0.8125rem/1 var(--sans);
  color: #fff;
  background: var(--brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35);
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.menu {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 20;
  min-width: 14.375rem;
  padding: 0.5rem;
  border-radius: var(--r-md);
  background: var(--glass-strong);
  display: grid; gap: 2px;
  transform-origin: top right;
  animation: pop 200ms var(--ease);
}
.menu-name { font-weight: 600; padding: 0.375rem 0.625rem 0; }
.menu-email { color: var(--ink-2); font-size: 0.8125rem; padding: 0 0.625rem 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.25rem; overflow-wrap: anywhere; }
@keyframes pop { from { opacity: 0; transform: scale(0.96); filter: blur(0.1875rem); } }

/* ---- Buttons and inputs --------------------------------------------------------------------- */
.btn {
  --h: 2.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--h);
  padding: 0 1.125rem;
  border: 0;
  border-radius: 999px;
  font: 600 0.9375rem/1 var(--sans);
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease), filter 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 1.125rem; height: 1.125rem; stroke-width: 2; }
.btn-block { width: 100%; }
.btn-sm { --h: 2rem; padding: 0 0.875rem; font-size: 0.8125rem; }
.btn-icon { width: 2.25rem; --h: 2.25rem; padding: 0; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(18 117 111 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.2); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-glass {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(1rem) saturate(180%);
  backdrop-filter: blur(1rem) saturate(180%);
  box-shadow: 0 1px 2px rgb(15 27 36 / 0.08), inset 0 0 0 1px var(--line-strong), inset 0 1px 0 var(--glass-edge);
}
.btn-glass:hover { background: var(--glass-edge); }
.btn-plain:hover { background: var(--line); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-google {
  --h: 3rem;
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(15 27 36 / 0.1), inset 0 0 0 1px rgb(15 27 36 / 0.14);
}
.btn-google:hover { box-shadow: 0 0.25rem 0.875rem -4px rgb(15 27 36 / 0.25), inset 0 0 0 1px rgb(15 27 36 / 0.2); }
.link { background: none; border: 0; padding: 0.375rem; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; justify-self: center; }

.input, textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5625rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
textarea { resize: vertical; min-height: 5.25rem; }
.input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 0.25rem var(--accent-soft); }
.input:disabled { color: var(--ink-2); background: transparent; }
::placeholder { color: var(--ink-3); }
.field { display: grid; gap: 0.375rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); padding: 0; }
.hint { font-size: 0.75rem; color: var(--ink-2); }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.375rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.toolbar { display: flex; gap: 0.375rem; padding: 0.375rem; border-radius: 999px; min-width: min(26.25rem, 100%); }
.toolbar .input { flex: 1 1 auto; min-width: 0; border-radius: 999px; border-color: transparent; background: transparent; box-shadow: none; }
.toolbar .btn { flex: none; }
.toolbar .input:focus { background: var(--sheet); box-shadow: 0 0 0 0.1875rem var(--accent-soft); }

/* ---- Messages ------------------------------------------------------------------------------- */
.notice {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5625rem 1rem 0.5625rem 0.75rem;
  border-radius: 999px;
  color: var(--ok);
  background: var(--sheet);
  border: 1px solid var(--line);
  font-weight: 500;
  animation: pop 240ms var(--ease);
}
.notice .icon { width: 1.125rem; height: 1.125rem; stroke-width: 2.25; }
.notice-inline { justify-self: stretch; border-radius: var(--r-md); align-items: flex-start; text-align: left; }
.alert { padding: 0.75rem 0.875rem; border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-weight: 500; text-align: left; }
.fineprint { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.7812rem; color: var(--ink-2); text-align: left; }
.fineprint .icon { margin-top: 2px; }
.quote { margin-top: 0.375rem; color: var(--ink-2); font-style: italic; }

/* ---- Sign-in, no-access, request ------------------------------------------------------------ */
.signin {
  width: min(26.25rem, 100%);
  padding: 2.5rem 2rem 1.75rem;
  border-radius: var(--r-xl);
  display: grid; gap: 0.875rem;
  text-align: center;
  justify-items: center;
}
.signin .btn-block, .signin .stack, .signin .alert, .signin .notice-inline { width: 100%; }
.tagline { font: 600 0.9375rem/1.2 var(--sans); color: var(--ink); margin-top: 0.25rem; }
.signin-title { font: 650 1.375rem/1.25 var(--display); letter-spacing: -0.015em; margin-top: 0.875rem; text-wrap: balance; }
.signin .muted { max-width: 34ch; text-wrap: pretty; }
.signin .fineprint { margin-top: 0.5rem; padding-top: 0.875rem; border-top: 1px solid var(--line); }
/* ---- Portal --------------------------------------------------------------------------------- */
.apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr)); gap: 0.875rem; }
.app {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.125rem;
  border-radius: var(--r-lg);
  background: var(--sheet);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.app:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.app:active { transform: scale(0.985); }
.app[aria-disabled="true"] { pointer-events: none; opacity: 0.6; }
.app-icon { /* a squircle tile of glass, tinted by the brand */
  width: 3rem; height: 3rem; flex: none;
  display: grid; place-items: center;
  border-radius: 0.875rem;
  color: #fff;
  background: var(--brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 -10px 1.125rem rgb(0 0 0 / 0.08), 0 0.375rem 0.875rem -8px rgb(62 79 124 / 0.6);
}
.app-icon .icon { width: 1.5rem; height: 1.5rem; }
.app-icon-lg { width: 4rem; height: 4rem; border-radius: 1.1875rem; }
.app-icon-lg .icon { width: 1.875rem; height: 1.875rem; }
.app-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.app-name { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.app-desc { color: var(--ink-2); font-size: 0.8438rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-go { color: var(--ink-3); transition: transform 200ms var(--ease), color 200ms var(--ease); }
.app:hover .icon-go { transform: translateX(0.1875rem); color: var(--accent); }
.empty { padding: 2.5rem 1.5rem; display: grid; gap: 0.625rem; justify-items: center; text-align: center; }
.empty .muted { max-width: 46ch; }
.empty-inline { padding: 1.125rem 1.25rem; }

/* ---- Admin: requests and people ------------------------------------------------------------- */
.requests, .people, .sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.request { padding: 0.875rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-color: rgb(107 45 139 / 0.25); }
.who { display: flex; gap: 0.75rem; align-items: flex-start; min-width: 0; }
.who .avatar { margin-top: 1px; }
.who-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.who-name .muted { font-weight: 400; }
.who .small { overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 0.5rem; flex: none; justify-content: flex-end; }
.person { padding: 0.875rem 1rem; display: grid; grid-template-columns: minmax(13.75rem, 18.75rem) minmax(0, 1fr) auto; align-items: center; gap: 0.875rem 1.25rem; }
.person.is-off { opacity: 0.72; }
.all-apps { display: inline-flex; gap: 0.375rem; align-items: center; }
.access { display: flex; gap: 0.625rem; align-items: center; min-width: 0; }
.access fieldset { border: 0; margin: 0; padding: 0; min-width: 0; flex: 1; }
.tag { font: 600 0.6875rem/1 var(--sans); letter-spacing: 0.02em; padding: 0.25rem 0.4375rem; border-radius: 999px; color: var(--ink-2); background: var(--line); }
.tag-brand { color: var(--select); background: rgb(107 45 139 / 0.1); }
@media (prefers-color-scheme: dark) { .tag-brand { background: rgb(199 155 224 / 0.14); } }
.tag-off { color: var(--danger); background: var(--danger-soft); }

/* Access pills: the signature. Off = clear glass capsule; on = filled with the Shahi gradient. */
.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pill { position: relative; display: inline-flex; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.pill label {
  display: inline-flex; align-items: center; gap: 0.375rem;
  min-height: 2rem;
  padding: 0 0.8125rem 0 0.6875rem;
  border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--ink-2);
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer;
  user-select: none;
  transition: background 220ms var(--ease), color 220ms var(--ease), box-shadow 220ms var(--ease), transform 160ms var(--ease);
}
.pill-tick { opacity: 0.35; transition: opacity 200ms var(--ease), transform 220ms var(--ease); transform: scale(0.8); }
.pill input:hover + label { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.pill input:active + label { transform: scale(0.96); }
.pill input:focus-visible + label { outline: 0.1562rem solid var(--select); outline-offset: 2px; }
.pill input:checked + label {
  color: #fff;
  background: var(--brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 -6px 0.75rem rgb(0 0 0 / 0.1), 0 0.25rem 0.75rem -6px rgb(62 79 124 / 0.7);
}
@media (prefers-color-scheme: dark) {
  .pill input:checked + label, .avatar, .app-icon, .icon-opt input:checked + label { color: #0b1416; }
}
.pill input:checked + label .pill-tick { opacity: 1; transform: scale(1); }
.pill input:disabled + label { cursor: default; opacity: 0.75; }
.pill-muted label { border-style: dashed; opacity: 0.7; }

/* ---- Admin: sites ------------------------------------------------------------------------- */
.site > details > summary { list-style: none; cursor: pointer; }
.site > details > summary::-webkit-details-marker { display: none; }
.site-sum { display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem 1rem; border-radius: var(--r-lg); }
.site-sum:hover .btn-plain { background: var(--line); }
.site.is-off .app-icon { filter: grayscale(1); opacity: 0.6; }
.site-body { padding: 0.25rem 1rem 1.125rem; display: grid; gap: 0.5rem; border-top: 1px solid var(--line); margin: 0 1rem; padding-left: 0; padding-right: 0; padding-top: 1rem; }
.site-form { margin-bottom: 0.5rem; }
.block.sheet { padding: 1.25rem; }
.icon-choice { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.icon-opt { position: relative; }
.icon-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.icon-opt label { width: 2.625rem; height: 2.625rem; display: grid; place-items: center; border-radius: 0.75rem; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; transition: all 180ms var(--ease); }
.icon-opt input:checked + label { color: #fff; background: var(--brand); box-shadow: none; }
.icon-opt input:focus-visible + label { outline: 0.1562rem solid var(--select); outline-offset: 2px; }
.snippet { display: block; padding: 0.625rem 0.75rem; border-radius: var(--r-sm); background: var(--line); font: 0.7812rem/1.4 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; user-select: all; }

/* ---- Admin: activity tables -------------------------------------------------------------------- */
.table-wrap { position: relative; overflow-x: auto; padding: 0.25rem 0; }
.panel .table-wrap td { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); padding: 0.625rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 0.625rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgb(18 117 111 / 0.04); }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ua { white-space: nowrap; }

/* ---- Press feedback: interactive liquid glass ------------------------------------------------ */
:root { --spring: cubic-bezier(0.34, 1.56, 0.64, 1); }
.btn, .tab, .pill label, .app, .icon-opt label, .avatar { position: relative; overflow: hidden; isolation: isolate; }
/* Pressing squeezes the control quickly; releasing springs it back with a little overshoot. */
.btn, .tab, .app, .avatar, .icon-opt label {
  transition: transform 420ms var(--spring), background-color 180ms var(--ease), box-shadow 200ms var(--ease),
    color 180ms var(--ease), filter 180ms var(--ease);
}
.btn:active, .tab:active, .avatar:active, .icon-opt label:active { transform: scale(0.95); transition-duration: 90ms; }
.app:active { transform: scale(0.98); transition-duration: 90ms; }
.app:active .app-icon { transform: scale(0.92); }
.app-icon { transition: transform 420ms var(--spring); }
/* A soft light follows the pointer across the glass (position set by shahi.js; centred without it). */
.btn::after, .tab::after, .pill label::after, .app::after, .icon-opt label::after, .avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(10rem circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / 0.5), transparent 65%);
  opacity: 0;
  transition: opacity 240ms var(--ease);
  pointer-events: none;
  z-index: -1;
}
.app::after { background: radial-gradient(16.25rem circle at var(--x, 50%) var(--y, 50%), rgb(18 115 115 / 0.08), transparent 70%); }
.btn:hover::after, .tab:hover::after, .pill input:hover + label::after, .app:hover::after,
.icon-opt input:hover + label::after, .avatar:hover::after { opacity: 0.45; }
.btn:active::after, .tab:active::after, .pill input:active + label::after, .icon-opt input:active + label::after { opacity: 0.9; }
/* On solid teal the light stays subtle so the label keeps its contrast. */
.btn-primary::after, .access.dirty .btn::after {
  background: radial-gradient(8.75rem circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / 0.2), transparent 65%);
}
@media (prefers-color-scheme: dark) {
  .btn::after, .tab::after, .pill label::after, .icon-opt label::after, .avatar::after {
    background: radial-gradient(10rem circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / 0.18), transparent 65%);
  }
  .app::after { background: radial-gradient(16.25rem circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / 0.05), transparent 70%); }
}
/* The ripple of light from the press point. */
.ripple {
  position: absolute;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.32), rgb(255 255 255 / 0) 60%);
  transform: scale(0);
  pointer-events: none;
  z-index: -1;
  animation: ripple 620ms var(--ease) forwards;
}
.btn-glass .ripple, .btn-plain .ripple, .btn-google .ripple, .tab .ripple, .pill label .ripple, .app .ripple, .icon-opt label .ripple {
  background: radial-gradient(circle, rgb(18 115 115 / 0.2), rgb(18 115 115 / 0) 60%);
}
@keyframes ripple { 60% { opacity: 1; } to { transform: scale(1); opacity: 0; } }

/* Access pills: a springy pop when switched, and the tick draws itself in. */
.pill label > :not(.ripple) { position: relative; z-index: 3; }
.pill-tick { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 320ms var(--ease) 60ms, opacity 200ms var(--ease); opacity: 1; transform: none; }
.pill input:checked + label .pill-tick { stroke-dashoffset: 0; }
.pill input:not(:checked) + label .pill-tick { stroke-dashoffset: 24; }
.pill label.pop { animation: pill-pop 460ms var(--spring); }
@keyframes pill-pop { 0% { transform: scale(0.9); } 55% { transform: scale(1.07); } 100% { transform: scale(1); } }
/* An unchecked pill still shows a faint tick outline so it reads as a toggle. */
.pill input:not(:checked) + label::before {
  content: "";
  position: absolute;
  left: 0.6875rem; top: 50%;
  width: 0.875rem; height: 0.875rem;
  margin-top: -0.4375rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

/* Save wakes up once the row has changes. */
.access .btn { transition: transform 420ms var(--spring), background-color 220ms var(--ease), color 220ms var(--ease), box-shadow 220ms var(--ease); }
.access.dirty .btn { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(18 115 115 / 0.3), 0 0 0 0.25rem var(--accent-soft); animation: nudge 520ms var(--spring); }
@keyframes nudge { 40% { transform: scale(1.08); } }

/* Moving between pages: the selected-tab capsule glides to its new place (cross-document view transitions;
   browsers without support simply load the page). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.bar { view-transition-name: shahi-bar; }
.tab[aria-current="page"] { view-transition-name: shahi-tab; }
::view-transition-group(shahi-tab) { animation-duration: 380ms; animation-timing-function: var(--spring); }
::view-transition-old(root) { animation: 160ms var(--ease) both fade-out; }
::view-transition-new(root) { animation: 260ms var(--ease) both rise-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(0.375rem); } }

/* ---- Server dashboard ---------------------------------------------------------------------- */
:root {
  --c-cpu: #0a8f87;       /* chart series, validated (dataviz six checks) against the light surface */
  --c-mem: #a04fc4;
  --warn: #a35a00;        /* warning text/icon; fills use --warn-fill */
  --warn-fill: #d98b0f;
  --crit-fill: #d23b2a;
}
@media (prefers-color-scheme: dark) {
  :root { --c-cpu: #1fa396; --c-mem: #a86fdb; --warn: #f2b45a; --warn-fill: #e3a03a; --crit-fill: #ff7a68; }
}
.live { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: live 2.4s var(--ease) infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 0.4375rem transparent; } }
body.stale .live-dot { background: var(--ink-3); animation: none; }
body.stale .tiles, body.stale .chart-card { opacity: 0.6; transition: opacity 300ms var(--ease); }

.status { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.1875rem 0.5625rem 0.1875rem 0.4375rem; border-radius: 999px; font: 600 0.75rem/1.2 var(--sans); white-space: nowrap; }
.status[data-level="ok"] { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, transparent); }
.status[data-level="warning"] { color: var(--warn); background: color-mix(in srgb, var(--warn-fill) 16%, transparent); }
.status[data-level="critical"] { color: var(--danger); background: var(--danger-soft); }

.health { padding: 0.875rem 1.125rem; }
.health ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.health li, .health-ok { display: flex; align-items: center; gap: 0.75rem; }
.health:has([data-level="critical"]) { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.875rem; }
.tile { padding: 1rem 1.125rem 1.125rem; display: grid; gap: 0.5rem; align-content: start; }
.tile-label { font: 600 0.8125rem/1.2 var(--sans); color: var(--ink-2); display: flex; align-items: center; gap: 0.375rem; letter-spacing: 0; }
.tile-value { font: 650 2.125rem/1.05 var(--display); letter-spacing: -0.02em; font-variant-numeric: proportional-nums; }
.tile-sub { font-size: 0.8438rem; color: var(--ink); }
.tile-foot { font-size: 0.7812rem; color: var(--ink-2); overflow-wrap: anywhere; }
.disk + .disk { margin-top: 0.375rem; }
.meter { -webkit-appearance: none; appearance: none; width: 100%; height: 0.5rem; border: 0; border-radius: 999px; overflow: hidden;
  --fill: var(--c-cpu); background: color-mix(in srgb, var(--fill) 16%, transparent); color: var(--fill); }
.meter[data-level="warning"] { --fill: var(--warn-fill); }
.meter[data-level="critical"] { --fill: var(--crit-fill); }
.meter::-webkit-progress-bar { background: transparent; }
.meter::-webkit-progress-value { background: var(--fill); border-radius: 999px; transition: width 500ms var(--ease); }
.meter::-moz-progress-bar { background: var(--fill); border-radius: 999px; }
.cores { width: 100%; height: 1.5rem; }
.cores rect { fill: color-mix(in srgb, var(--c-cpu) 70%, transparent); transition: y 500ms var(--ease), height 500ms var(--ease); }

.chart-card { padding: 1rem 1.125rem 0.75rem; display: grid; gap: 0.5rem; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 1rem; font-size: 0.8125rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 0.375rem; }
.key { display: inline-block; width: 0.875rem; height: 2px; border-radius: 2px; vertical-align: middle; }
.key-cpu { background: var(--c-cpu); }
.key-mem { background: var(--c-mem); }
.chart { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-rows: 12.5rem auto; column-gap: 0.5rem; row-gap: 0.375rem; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; margin: -0.4375rem 0; font-size: 0.7188rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 0.7188rem; color: var(--ink-2); }
.chart-plot { position: relative; min-width: 0; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.chart-plot svg:focus-visible { outline-offset: 0.25rem; }
.grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.series-cpu { stroke: var(--c-cpu); }
.series-mem { stroke: var(--c-mem); }
.crosshair { stroke: var(--ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dot { position: absolute; width: 0.625rem; height: 0.625rem; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--sheet); pointer-events: none; }
.dot-cpu { background: var(--c-cpu); }
.dot-mem { background: var(--c-mem); }
.hit { fill: transparent; cursor: crosshair; }
.tooltip { position: absolute; top: 0.25rem; min-width: 8.25rem; padding: 0.5rem 0.75rem; border-radius: var(--r-sm); background: var(--glass-strong); pointer-events: none; font-size: 0.8125rem; display: grid; gap: 2px; z-index: 5; }
.tooltip p { display: flex; align-items: center; gap: 0.375rem; }
.tooltip strong { font-variant-numeric: tabular-nums; }
.tt-time { color: var(--ink-2); font-size: 0.75rem; }
.chart-empty { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; font-size: 0.8125rem; }
.table-view summary { cursor: pointer; font-size: 0.8125rem; color: var(--accent); width: fit-content; padding: 0.625rem 0; }
.table-view table { margin-top: 0.5rem; max-width: 22.5rem; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem; }
.panel { padding: 1rem 1.125rem; display: grid; gap: 0.625rem; align-content: start; min-width: 0; }
.panel table td, .panel table th { padding-left: 0.5rem; padding-right: 0.5rem; }
.panel table td:first-child, .panel table th:first-child { padding-left: 0; }
.panel table td:last-child, .panel table th:last-child { padding-right: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.r { text-align: right; }
.warn-text { color: var(--warn); font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.checks li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.625rem; align-items: center; }
.log-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.log pre { margin: 0; padding: 1rem 1.125rem; max-height: 70vh; overflow: auto; font: 0.7812rem/1.55 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
select.input { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 1.0625rem) 50%, calc(100% - 0.75rem) 50%; background-size: 0.3125rem 0.3125rem; background-repeat: no-repeat; max-width: 20rem; }
.toolbar select.input { background-color: transparent; }

@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; }
  .tile-value { font-size: 1.875rem; }
}

/* ---- Small screens ---------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .person { grid-template-columns: 1fr auto; }
  .person .access, .person .all-apps { grid-column: 1 / -1; grid-row: 2; }
  .person .more { grid-column: 2; grid-row: 1; }
  .page-head-row { grid-template-columns: 1fr; }
  .toolbar { min-width: 0; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.625rem; }
  .page { padding-top: 1.25rem; gap: 1.375rem; }
  .bar { flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.375rem; border-radius: 1.5rem; }
  .bar-brand { padding-left: 0.625rem; }
  .bar-product { display: none; }
  .bar-tabs { order: 3; flex: 1 0 100%; margin: 0; justify-content: space-between; }
  .tab { flex: 1; justify-content: center; padding: 0.4375rem 0.5rem; font-size: 0.875rem; }
  .wm-lg { font-size: 4rem; }
  .signin { padding: 2rem 1.375rem 1.375rem; }
  .request { flex-direction: column; align-items: stretch; }
  .grid-2 { grid-template-columns: 1fr; }
  .access { flex-direction: column; align-items: stretch; }
  .access .btn { align-self: flex-start; }
}
@media (max-width: 420px) { /* small phones: five tabs and a badge still fit on one row */
  .bar-tabs { gap: 0; }
  .tab { flex: 1 1 auto; padding: 0.4375rem 0.3125rem; font-size: 0.8125rem; gap: 0.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
