/* dashboard + admin surfaces */

.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
.dash--split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (width <= 78rem) { .dash--split { grid-template-columns: minmax(0, 1fr); } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack--lg { gap: 1.75rem; }
.row { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (width <= 60rem) { .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } }

.panel { border: 1px solid var(--border); background: var(--bg-weak); padding: 1rem 1.125rem; }
.panel--flush { padding: 0; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--border); margin-bottom: .875rem;
  flex-wrap: wrap;
}
.panel__head h2 { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-title); color: var(--text-strong); }
.panel__hint { font-size: var(--fs-micro); color: var(--text-faint); }

/* stat tile */
.stat { border: 1px solid var(--border); background: var(--bg-weak); padding: .875rem 1rem; display: flex; flex-direction: column-reverse; gap: .5rem; }
.stat__v { font-family: var(--font-mono); font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.03em; line-height: 1.1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat__l { font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }

/* key rows, provider rows */
.krow { display: grid; grid-template-columns: minmax(0, 1fr) 15rem auto; gap: .875rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.krow:last-child { border-bottom: 0; }
@media (width <= 60rem) { .krow { grid-template-columns: minmax(0, 1fr); } }

.qbar { display: flex; flex-direction: column; gap: .3125rem; }
.qbar__top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-weak); }
.qbar__pct { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.qbar[data-crit] .qbar__pct { color: var(--danger); }
.qbar[data-low] .qbar__pct { color: var(--warn); }
.meter--provider > i { background: #087bea; }
.meter--provider[data-low] > i { background: var(--warn); }
.meter--provider[data-crit] > i { background: var(--danger); }
.qbar[data-level="critical"] .qbar__pct { color: #ef4444; }
.qbar[data-level="low"] .qbar__pct { color: #f97316; }
.qbar[data-level="medium"] .qbar__pct { color: #eab308; }
.qbar[data-level="high"] .qbar__pct { color: #22c55e; }
.meter--provider[data-level="critical"] > i { background: #ef4444; }
.meter--provider[data-level="low"] > i { background: #f97316; }
.meter--provider[data-level="medium"] > i { background: #eab308; }
.meter--provider[data-level="high"] > i { background: #22c55e; }
.quota-legend { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .625rem; color: var(--text-faint); font-size: var(--fs-micro); }
.quota-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.quota-legend i { width: .55rem; height: .55rem; border-radius: 50%; background: #22c55e; }
.quota-legend i[data-level="critical"] { background: #ef4444; }
.quota-legend i[data-level="low"] { background: #f97316; }
.quota-legend i[data-level="medium"] { background: #eab308; }
.quota-legend i[data-level="high"] { background: #22c55e; }

/* key secret box */
.secret {
  font-family: var(--font-mono); font-size: var(--fs-meta);
  background: var(--fixed-dark); color: var(--fixed-dark-text);
  border: 1px solid var(--fixed-dark-line); padding: .625rem .75rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  word-break: break-all;
}

/* chat */
.chat { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; min-height: 60vh; }
@media (width <= 78rem) { .chat { grid-template-columns: minmax(0, 1fr); } }
.chat__list { display: flex; flex-direction: column; gap: .125rem; font-family: var(--font-mono); font-size: var(--fs-meta); }
.chat__list a { padding: .4375rem .5rem; color: var(--text); border: 1px solid transparent; display: flex; gap: .5rem; align-items: baseline; }
.chat__list a:hover { background: var(--bg-weak); color: var(--text-strong); }
.chat__list a[aria-current="true"] { background: var(--bg-weak); border-color: var(--border); color: var(--text-strong); }
.chat__list time { margin-inline-start: auto; font-size: var(--fs-micro); color: var(--text-faint); }
.chat__stream { display: flex; flex-direction: column; gap: 1rem; padding-block: .25rem; }
.msg { display: flex; flex-direction: column; gap: .375rem; max-width: 52rem; }
.msg__role { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.msg__body {
  font-family: var(--font-mono); font-size: var(--fs-meta); line-height: 1.6; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.msg[data-role="user"] .msg__body { color: var(--text-strong); }
.msg__body pre { border: 1px solid var(--fixed-dark-line); background: var(--fixed-dark); color: var(--fixed-dark-text); padding: .75rem; overflow-x: auto; margin: .5rem 0 0; font-size: var(--fs-meta); }
.msg__status { display: inline-flex; align-items: center; gap: .32rem; width: fit-content; color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-small); }
.msg__status i { width: .24rem; height: .24rem; border-radius: 50%; background: var(--link); opacity: .35; animation: chatThinking 1s ease-in-out infinite; }
.msg__status i:nth-of-type(2) { animation-delay: .16s; }
.msg__status i:nth-of-type(3) { animation-delay: .32s; }
.msg__status--error { color: #ff7777; }
.msg__body--stream { min-height: 1.6em; }
.msg--streaming .msg__body--stream:not(:empty)::after { content: ""; display: inline-block; width: .45rem; height: 1em; margin-inline-start: .2rem; vertical-align: -.15em; background: var(--link); opacity: .8; animation: chatCaret .8s steps(2, jump-none) infinite; }
.stream-chunk { animation: chatTextIn .18s ease-out both; }
.brand-logo { display: block; flex: 0 0 auto; width: var(--logo-height); height: var(--logo-height); object-fit: contain; mix-blend-mode: multiply; }
.brand-logo--compact { width: 1.8rem; height: 1.8rem; }
.topbar__brand .brand-logo { width: 1.8rem; height: 1.8rem; }
.msg__identity { min-height: 2rem; display: flex; align-items: center; gap: .6rem; }
.msg__avatar { display: block; flex: 0 0 auto; width: 2rem; height: 2rem; padding: .05rem; object-fit: contain; border: 1px solid var(--border); border-radius: .45rem; mix-blend-mode: multiply; }
html[data-theme="dark"] .brand-logo, html[data-theme="dark"] .msg__avatar { filter: invert(1); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .brand-logo, html[data-theme="system"] .msg__avatar { filter: invert(1); mix-blend-mode: screen; }
}
@keyframes chatThinking { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-.18rem); } }
@keyframes chatCaret { 50% { opacity: 0; } }
@keyframes chatTextIn { from { opacity: .15; filter: blur(1px); transform: translateY(.12em); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .msg__status i, .stream-chunk, .msg--streaming .msg__body--stream:not(:empty)::after { animation: none; }
}
.composer { border: 1px solid var(--border-strong); background: var(--bg-weak); padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.composer textarea { border: 0; background: transparent; outline: none; resize: vertical; min-height: 4rem; width: 100%; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: 1.55; color: var(--text-strong); }

/* Full-screen conversational composer for a new chat. */
.content:has(.chat-screen--new), .content:has(.chat-screen--task) { padding-block: 1rem 0; }
.chat-screen--new, .chat-screen--task { min-height: calc(100svh - 7rem); display: flex; flex-direction: column; padding-bottom: 10rem; }
.chat-screen__top { width: min(100%, 56rem); margin: 0 auto 1rem; display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; }
.model-picker { position: relative; display: inline-flex; align-items: center; gap: .55rem; min-width: 0; z-index: 30; }
.model-picker__trigger { max-width: min(55vw, 20rem); min-height: 2.6rem; display: inline-flex; align-items: center; gap: .65rem; padding: .45rem .85rem; border: 1px solid transparent; border-radius: 999px; color: var(--text-strong); background: var(--bg-weak); font-family: var(--font-sans); font-size: var(--fs-ui); font-weight: 550; cursor: pointer; }
.model-picker__trigger:hover, .model-picker__trigger[aria-expanded="true"] { background: var(--bg-weaker); border-color: var(--border); }
.model-picker__trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker__trigger svg, .model-menu__thinking-trigger svg { width: 1rem; height: 1rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; transition: transform .18s ease; }
.model-picker__trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.model-picker select option { color: var(--text-strong); background-color: var(--popover-bg); }
.model-picker__dot { width: .42rem; height: .42rem; flex: 0 0 auto; border-radius: 50%; background: var(--link); box-shadow: 0 0 .8rem color-mix(in srgb, var(--link) 55%, transparent); }
.model-menu, .thinking-menu { position: absolute; z-index: 50; color: var(--text); background: var(--popover-bg); border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--popover-shadow); }
.model-menu[hidden], .thinking-menu[hidden] { display: none; }
.model-menu { top: calc(100% + .5rem); left: 0; width: min(22rem, calc(100vw - 2rem)); overflow: visible; transform-origin: top left; animation: modelMenuIn .18s var(--ease-out) both; }
.model-menu__models { max-height: min(22rem, calc(100dvh - 13rem)); overflow: auto; padding: .45rem; overscroll-behavior: contain; }
.model-menu__option { width: 100%; display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); align-items: center; gap: .45rem; padding: .65rem .55rem; border-radius: .7rem; text-align: left; color: var(--text); }
.model-menu__option:hover, .model-menu__option[aria-selected="true"] { color: var(--text-strong); background: var(--bg-weaker); }
.model-menu__check, .thinking-menu__check { color: var(--text-strong); text-align: center; font-size: 1rem; font-weight: 650; }
.model-menu__option-copy, .thinking-menu__option > span:last-child, .model-menu__thinking-trigger > span { display: grid; gap: .18rem; min-width: 0; }
.model-menu__option-copy b { overflow: hidden; color: var(--text-strong); font-family: var(--font-mono); font-size: var(--fs-meta); font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.model-menu__option-copy small, .thinking-menu__option small, .model-menu__thinking-trigger small { color: var(--text-faint); font-size: var(--fs-small); line-height: 1.35; }
.model-menu__footer { padding: .4rem; border-top: 1px solid var(--border); }
.model-menu__thinking-trigger { width: 100%; min-height: 3.35rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: .75rem; color: var(--text); text-align: left; }
.model-menu__thinking-trigger:hover, .model-menu__thinking-trigger[aria-expanded="true"] { color: var(--text-strong); background: var(--bg-weaker); }
.model-menu__thinking-trigger b, .thinking-menu__option b { color: var(--text-strong); font-size: var(--fs-small); font-weight: 550; }
.thinking-menu { left: calc(100% - .45rem); bottom: .35rem; width: min(17rem, calc(100vw - 2rem)); padding: .4rem; transform-origin: bottom left; animation: thinkingMenuIn .16s var(--ease-out) both; }
.thinking-menu__option { width: 100%; display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); gap: .45rem; align-items: center; padding: .65rem .55rem; border-radius: .7rem; text-align: left; }
.thinking-menu__option:hover, .thinking-menu__option[aria-checked="true"] { background: var(--bg-weaker); }
@keyframes modelMenuIn { from { opacity: 0; transform: translateY(-.45rem) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes thinkingMenuIn { from { opacity: 0; transform: translateX(-.35rem) scale(.98); } to { opacity: 1; transform: translateX(0) scale(1); } }
@media (width <= 40rem) { .thinking-menu { left: 0; bottom: auto; top: calc(100% + .45rem); } }
@media (prefers-reduced-motion: reduce) { .model-menu, .thinking-menu, .model-picker__trigger svg { animation: none; transition: none; } }
.chat-new-button { width: 2.4rem; height: 2.4rem; margin-inline-start: auto; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--text); }
.chat-new-button:hover { color: var(--text-strong); background: var(--bg-weak); }
.chat-points { color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-micro); }
.chat-screen__messages { width: min(100%, 52rem); margin: 0 auto; flex: 1 0 auto; display: flex; flex-direction: column; gap: 1.4rem; padding: 1rem 0 12rem; }
.chat-welcome { margin: auto 0; padding: 3rem 0 5rem; text-align: center; animation: chatWelcomeIn .45s ease-out both; }
.chat-welcome__spark { display: inline-grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 1.25rem; color: var(--link); font-size: 2.6rem; line-height: 1; text-shadow: 0 0 1.5rem color-mix(in srgb, var(--link) 60%, transparent); }
.chat-welcome__hello { color: var(--text-weak); font-size: clamp(1.25rem, 3vw, 1.75rem); }
.chat-welcome h1 { margin-top: .35rem; color: var(--text-strong); font-size: clamp(1.65rem, 4vw, 2.25rem); font-weight: 500; letter-spacing: -.035em; }
.chat-welcome__hint { margin-top: .65rem; color: var(--text-faint); font-size: var(--fs-small); }
@keyframes chatWelcomeIn { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: translateY(0); } }
.chat-screen__messages .msg { width: fit-content; max-width: 88%; animation: chatWelcomeIn .2s ease-out both; }
.chat-screen__messages .msg[data-role="user"] { align-self: flex-end; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 1.2rem 1.2rem .3rem 1.2rem; background: var(--bg-weak); }
.chat-screen__messages .msg[data-role="assistant"] { align-self: flex-start; width: 100%; max-width: 100%; }
.chat-screen__messages .msg__role { letter-spacing: .025em; text-transform: none; }
.chat-screen__messages .msg__body { font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.75; }
.chat-screen__messages .msg__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-screen__messages .msg__actions { margin-top: .55rem; gap: .35rem; opacity: .78; }
.chat-screen__messages .msg[data-role="user"] .msg__actions { justify-content: flex-end; }
.chat-compose__tools { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.chat-tool { min-height: 2.25rem; padding: .35rem .6rem; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-weak); font-size: var(--fs-small); white-space: nowrap; }
.chat-tool:hover, .chat-tool--active { color: var(--text-strong); background: var(--bg-weaker); }
.chat-tool svg { width: 1rem; height: 1rem; }
.chat-tool[data-live-voice] { border-color: color-mix(in srgb, var(--link) 45%, var(--border)); }
.chat-file-preview { display: flex; flex-wrap: wrap; gap: .4rem; padding: .2rem 0 .35rem; }
.chat-file-preview[hidden] { display: none; }
.chat-file-chip, .chat-attachment { max-width: 100%; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .55rem; border: 1px solid var(--border); border-radius: .65rem; color: var(--text-weak); font-size: var(--fs-micro); overflow-wrap: anywhere; }
.chat-file-chip button { margin-inline-start: .15rem; color: var(--text-faint); font-size: 1.1rem; line-height: 1; }
.chat-attachment { margin: .35rem .25rem 0 0; }
.chat-attachment-image { width: fit-content; max-width: min(100%, 20rem); display: block; margin-top: .55rem; }
.chat-attachment-image img { display: block; max-height: 18rem; max-width: 100%; border: 1px solid var(--border); border-radius: .8rem; object-fit: contain; }
.msg__edit-box { display: grid; gap: .5rem; min-width: min(26rem, 75vw); }
.msg__edit-box textarea { width: 100%; min-height: 6rem; padding: .7rem; border: 1px solid var(--border-strong); border-radius: .7rem; background: var(--bg); color: var(--text-strong); font: inherit; line-height: 1.6; }
.msg__edit-box .row { gap: .4rem; }
.chat-compose-dock { position: fixed; z-index: 18; inset-inline-start: calc(var(--page-offset) + var(--sidebar-width)); inset-inline-end: var(--page-offset); bottom: 0; display: grid; justify-items: center; gap: .5rem; padding: 2.25rem var(--edge) 1rem; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 92%, transparent) 28%, var(--bg) 65%); }
.chat-compose { width: min(100%, 52rem); display: flex; flex-direction: column; gap: .5rem; padding: .85rem .9rem .65rem 1rem; border: 1px solid var(--border-strong); border-radius: 1.5rem; background: var(--bg-weak); box-shadow: 0 .5rem 2.5rem #0002; }
.chat-compose textarea { width: 100%; max-height: 11rem; min-height: 2.5rem; resize: none; border: 0; outline: 0; background: transparent; color: var(--text-strong); font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.5; }
.chat-compose textarea::placeholder { color: var(--text-faint); }
.chat-compose__actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.chat-compose__hint { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-micro); }
.chat-compose__hint svg { width: 1rem; height: 1rem; }
.chat-send { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--link); color: var(--bg); font-size: 1.5rem; font-weight: 600; transition: scale .16s, opacity .16s; }
.chat-send:hover { scale: 1.05; }
.chat-send[disabled] { opacity: .45; }
.chat-compose__footnote { color: var(--text-faint); font-size: var(--fs-micro); text-align: center; }
@media (width <= 60rem) {
  .content:has(.chat-screen--new), .content:has(.chat-screen--task) { padding: .45rem 0 0; }
  .chat-screen--new, .chat-screen--task { min-height: calc(100svh - var(--topbar-height) - .5rem); padding-bottom: 1rem; }
  .chat-screen__top { padding-inline: var(--edge); margin-bottom: .25rem; }
  .chat-screen__messages { padding: .5rem var(--edge) 12rem; }
  .chat-compose-dock { inset-inline: 0; padding: 1.5rem max(var(--edge), 1rem) calc(.65rem + env(safe-area-inset-bottom, 0px)); }
  .chat-compose__hint span { display: none; }
  .chat-tool { width: 2.25rem; justify-content: center; padding-inline: .45rem; }
  .chat-tool span { display: none; }
  .chat-tool[data-live-voice] { width: auto; min-width: 3.6rem; padding-inline: .55rem; font-size: var(--fs-micro); }
  .chat-screen__messages .msg { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) { .chat-welcome, .chat-screen__messages .msg { animation: none; } }

/* heatmap */
.hm { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 2px; }
.hm span { width: 10px; height: 10px; background: var(--bg-weaker); }
.hm span[data-l="1"] { background: light-dark(#cfe0ff, #1e3a68); }
.hm span[data-l="2"] { background: light-dark(#9dbcff, #2b5aa6); }
.hm span[data-l="3"] { background: light-dark(#5f8ffb, #4478e0); }
.hm span[data-l="4"] { background: light-dark(#2f61f0, #6f9bff); }

/* admin nav pill */
.admin-pill {
  display: inline-flex; align-items: center; gap: .375rem;
  font-family: var(--font-mono); font-size: var(--fs-micro);
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid color-mix(in srgb, var(--link) 45%, var(--border));
  color: var(--link); padding: .3125rem .5rem;
}
.admin-pill:hover { background: color-mix(in srgb, var(--link) 9%, transparent); }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-main { display: grid; place-items: center; padding: 2rem var(--edge) 4rem; position: relative; }
.auth-card { width: min(26rem, 100%); display: flex; flex-direction: column; gap: 1rem; position: relative; z-index: 1; }
.auth-card h1 { font-family: var(--font-mono); font-weight: 400; font-size: 1.75rem; letter-spacing: -.03em; color: var(--text-strong); }
.auth-foot { text-align: center; font-size: var(--fs-small); color: var(--text-weak); }
.divider { display: flex; align-items: center; gap: .75rem; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: light-dark(#00000059, #000000a6); }
.modal__panel {
  position: relative; width: min(34rem, 100%); max-height: calc(100vh - 2rem); overflow-y: auto;
  background: var(--popover-bg); box-shadow: var(--popover-shadow); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.modal__panel h2 { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-title); color: var(--text-strong); }
.modal__panel--keypool { width: min(70rem, 100%); max-height: calc(100dvh - 2rem); }
.community-modal { z-index: 100; }
.community-modal__panel { width: min(48rem, 100%); max-height: calc(100dvh - 2rem); padding: 0; gap: 0; overflow: hidden; border: 1px solid var(--border-strong); }
.community-modal__image { display: block; width: 100%; max-height: min(52vh, 28rem); object-fit: cover; background: var(--bg-weak); }
.community-modal__brand { min-height: 14rem; display: grid; place-content: center; justify-items: center; gap: .75rem; color: var(--text-strong); font: 1.25rem var(--font-mono); background: radial-gradient(ellipse at center, color-mix(in srgb, var(--link) 18%, var(--bg-weak)), var(--bg-weak) 70%); }
.community-modal__brand img { width: 5rem; height: 5rem; object-fit: contain; border-radius: 50%; }
.community-modal__content { display: grid; justify-items: center; gap: .75rem; padding: clamp(1.25rem, 4vw, 2rem); text-align: center; }
.community-modal__content h2 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
.community-modal__content .muted { max-width: 34rem; }
.community-modal__join { width: min(28rem, 100%); min-height: 3.25rem; }
.community-modal__join:disabled { opacity: .5; cursor: not-allowed; }
.community-modal__later { min-height: 2.75rem; }
.community-modal__close { position: absolute; z-index: 1; inset-block-start: .75rem; inset-inline-end: .75rem; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--border); border-radius: 50%; color: var(--text-strong); background: var(--popover-bg); font-size: 1.5rem; cursor: pointer; }
.key-modal-grid { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(22rem, 1.35fr); gap: 1.25rem; min-height: 28rem; }
.key-modal-side { padding-inline-end: 1.25rem; border-inline-end: 1px solid var(--border); }
.key-modal-models { min-width: 0; }
.key-model-tools { margin-bottom: .25rem; }
.key-model-list { border: 1px solid var(--border); max-height: 29rem; overflow: auto; }
.key-model-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; padding: .75rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.key-model-row[hidden] { display: none; }
.key-model-row:last-child { border-bottom: 0; }
.key-model-row:hover { background: var(--bg-weaker); }
.key-model-row input { margin-top: .2rem; accent-color: var(--accent); }
.key-model-row span { display: grid; gap: .2rem; min-width: 0; }
.key-model-row b { color: var(--text-strong); font-size: var(--fs-meta); overflow-wrap: anywhere; }
.key-model-row small { color: var(--text-faint); font-family: var(--font-mono); }
@media (width <= 52rem) {
  .modal__panel--keypool { height: calc(100dvh - 1rem); max-height: none; }
  .key-modal-grid { grid-template-columns: 1fr; }
  .key-modal-side { padding-inline-end: 0; padding-bottom: 1rem; border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .key-model-list { max-height: 20rem; }
}

/* misc */
.kv { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: .25rem .75rem; font-size: var(--fs-small); }
@media (width <= 40rem) { .kv { grid-template-columns: minmax(0, 1fr); } }
.kv dt { color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .06em; padding-top: .1875rem; }
.kv dd { color: var(--text-strong); font-family: var(--font-mono); font-size: var(--fs-meta); word-break: break-word; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-meta); }
.copy-btn { color: var(--text-weak); }
.copy-btn:hover { color: var(--text-strong); }
.spin { display: inline-block; width: .75rem; height: .75rem; border: 1.5px solid var(--border-strong); border-top-color: var(--text-strong); border-radius: 50%; animation: sp .6s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Grouped workspace navigation and compact admin account controls. */
.nav__section {
  margin: .75rem 0 .25rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font: 10px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nav__section:first-child { margin-top: .15rem; padding-top: 0; border-top: 0; }
.admin-user-actions { display: grid; justify-items: end; gap: .45rem; min-width: 16rem; }
.admin-user-actions form { margin: 0; }
.admin-user-suspend { display: grid; grid-template-columns: 8.5rem minmax(9rem, 1fr) auto; gap: .35rem; width: 100%; }
.admin-user-suspend .input, .admin-user-suspend .select { min-width: 0; min-height: 2rem; padding: .25rem .375rem; font-size: var(--fs-micro); }
.points-positive { color: var(--status-ok); }
.points-negative { color: var(--danger); }
.status-key-row { padding-top: .4rem; border-top: 1px solid var(--border); }
.status-error { color: var(--danger); overflow-wrap: anywhere; }
.backup-actions { gap: .35rem; flex-wrap: wrap; }
.backup-actions form { display: flex; align-items: center; gap: .35rem; margin: 0; }
.backup-confirm { width: 8.5rem; min-height: 2rem; padding: .25rem .4rem; font: var(--fs-micro) var(--font-mono); }
@media (width <= 52rem) {
  .admin-user-actions { justify-items: stretch; min-width: 14rem; }
  .admin-user-actions > form:first-child { justify-content: start; }
  .admin-user-suspend { grid-template-columns: minmax(7rem, .8fr) minmax(7rem, 1fr); }
  .admin-user-suspend button { grid-column: 1 / -1; }
}
.announcement {
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--link);
  background: var(--bg-weak);
  padding: 1rem 1.125rem;
  margin-block: .75rem;
}
.announcement h2 { font-size: var(--fs-body); margin: .25rem 0; }
.announcement p { color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement__meta { color: var(--text-faint); font-size: var(--fs-micro); font-family: var(--font-mono); }
.announcement--warning { border-inline-start-color: var(--warn); }
.announcement--maintenance { border-inline-start-color: var(--status-outage); }
.node-status-alert { margin-block: .75rem; }
.session-card__details { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--text-muted); font-size: var(--fs-small); }
.announcement-form { max-width: 48rem; }
@media (max-width: 640px) {
  .session-card__details { flex-direction: column; gap: .375rem; }
}

/* Mobile install control and platform-specific install instructions. */
.topbar__actions { display: flex; align-items: center; gap: .5rem; }
.topbar__actions .topbar__toggle { flex: 0 0 auto; }
.pwa-install {
  min-height: 2.35rem; padding: .45rem .7rem; border: 1px solid var(--border-strong, var(--border));
  background: var(--bg-weak); color: var(--text-strong); font: 500 var(--fs-micro) var(--font-mono);
  white-space: nowrap; cursor: pointer;
}
.pwa-install:hover { border-color: var(--accent); color: var(--accent); }
.pwa-install[hidden] { display: none; }
.pwa-dialog { width: min(28rem, calc(100vw - 2rem)); max-width: none; padding: 0; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.pwa-dialog::backdrop { background: rgb(0 0 0 / 72%); backdrop-filter: blur(3px); }
.pwa-dialog__card { position: relative; display: grid; gap: .85rem; padding: 1.4rem; }
.pwa-dialog__card h2 { margin: 0; color: var(--text-strong); font-size: var(--fs-title); }
.pwa-dialog__card p { margin: 0; line-height: 1.7; }
.pwa-dialog__card b { color: var(--accent); }
.pwa-dialog__close { position: absolute; top: .5rem; right: .6rem; border: 0; background: transparent; color: var(--text-faint); font-size: 1.5rem; cursor: pointer; }
@media (width <= 40rem) {
  .topbar__actions { gap: .25rem; }
  .topbar__actions .topbar__toggle { margin-inline-end: -.5rem; }
  .pwa-install { padding-inline: .55rem; }
}
