/* ==========================================================================
   Novo Chatbot Sync — components
   Tone classes (.tone-*) set --tone / --tone-soft and are consumed by badges,
   callouts, toasts, tiles, state boxes and KPI values.
   ========================================================================== */

.tone-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.tone-err { --tone: var(--err); --tone-soft: var(--err-soft); }
.tone-run { --tone: var(--run); --tone-soft: var(--run-soft); }
.tone-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.tone-muted { --tone: var(--muted); --tone-soft: var(--muted-soft); }
.tone-accent { --tone: var(--accent-strong); --tone-soft: var(--accent-soft); }

/* ---------- Icons & spinner ---------- */

.icon {
  display: inline-flex;
  flex: none;
  line-height: 0;
}

.spinner {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--surface);
  --btn-bg-hover: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 500 13px/1 var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  --btn-bg: var(--accent);
  --btn-bg-hover: var(--accent-hover);
  --btn-fg: var(--accent-text);
  --btn-border: transparent;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  box-shadow: none;
}

.btn--danger {
  --btn-fg: var(--err);
}

.btn--sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn--sm {
  width: 28px;
  height: 28px;
}

.icon-btn--bordered {
  border-color: var(--border-strong);
  background: var(--surface);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Signed-in user in the top bar */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 0 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.user-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .user-chip { max-width: 96px; padding: 0 4px; }
}

@media (max-width: 480px) {
  .user-chip { display: none; }
}

.notice:not(:empty) {
  margin-bottom: 16px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tone, var(--muted)) 28%, transparent);
  background: var(--tone-soft, var(--muted-soft));
  color: var(--tone, var(--muted));
  font: 600 12px/1 var(--font-sans);
  white-space: nowrap;
}

.badge::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--plain::before {
  display: none;
}

.badge.tone-run::before {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.3; }
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

code.inline {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- Cards & KPIs ---------- */

.card {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

@media (max-width: 420px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.kpi {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.kpi__value {
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--tone, var(--text));
  overflow-wrap: anywhere;
}

.kpi__sub {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .kpi { padding: 12px; }
  .kpi__value { font-size: 21px; }
}

/* ---------- Definition lists ---------- */

.meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.meta dt {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta dd {
  margin-top: 3px;
  font-size: 13.5px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.meta .span-2 {
  grid-column: 1 / -1;
}

/* ---------- Callouts ---------- */

.callout {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--tone, var(--muted)) 30%, transparent);
  background: var(--tone-soft, var(--muted-soft));
  color: var(--text);
  font-size: 13px;
}

.callout > .icon {
  margin-top: 2px;
  color: var(--tone, var(--muted));
}

.callout__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.callout__title {
  font-weight: 650;
}

.error-excerpt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > label,
.label,
legend {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.input,
.select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 13.5px var(--font-sans);
}

.input::placeholder {
  color: var(--text-3);
}

.input:focus,
.select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}

.input[aria-invalid="true"] {
  border-color: var(--err);
}

.input--mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.field-hint {
  color: var(--text-3);
  font-size: 12px;
}

.field-error {
  color: var(--err);
  font-size: 12.5px;
  font-weight: 500;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: 6px;
}

.input-group {
  display: flex;
  gap: 6px;
}

.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.search > .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search .input {
  padding-left: 32px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filters .field {
  flex: 1 1 130px;
  max-width: 210px;
}

.filters__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

@media (max-width: 560px) {
  .filters .field { max-width: none; }
  .filters__actions { margin-left: 0; }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}

.toolbar__end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
}

.inline-field .select {
  width: auto;
  height: 32px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 12.5px var(--font-sans);
  cursor: pointer;
}

.chip:hover:not(:disabled) {
  background: var(--surface-2);
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chip:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Dropdown menu (details/summary) ---------- */

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: 380px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.menu__actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.check:hover {
  background: var(--surface-2);
}

.check input {
  accent-color: var(--accent);
  margin: 0;
}

/* ---------- Tables ---------- */

.table-wrap {
  position: relative;
  max-width: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overscroll-behavior-x: contain;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table th,
.table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table--loading tbody {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.err-cell {
  min-width: 240px;
  max-width: 460px;
  white-space: normal !important;
}

.err-cell__text {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--err);
  overflow-wrap: anywhere;
}

.err-cell__full {
  margin: 0 0 4px;
  padding: 8px 10px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--err-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
}

.run-id {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Data grid */
.data-grid {
  max-height: min(68vh, 720px);
}

.table--data td {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table--data th {
  font-family: var(--font-mono);
  font-weight: 600;
}

.table--data .col-actions {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 44px;
  padding: 4px 6px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.table--data thead .col-actions {
  z-index: 3;
  background: var(--surface-2);
}

.cell-null {
  color: var(--text-3);
  font-style: italic;
}

.cell-bool {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- Pager ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pager__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Code blocks ---------- */

.code {
  margin: 0;
  padding: 12px 14px;
  max-height: 440px;
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 12.5px/1.6 var(--font-mono);
  white-space: pre;
  tab-size: 2;
}

.code--wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- State boxes (empty / error / auth) ---------- */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.state--compact {
  padding: 24px 16px;
}

.state__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tone-soft, var(--muted-soft));
  color: var(--tone, var(--muted));
}

.state__title {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.state__msg {
  max-width: 56ch;
  overflow-wrap: anywhere;
}

.state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

/* ---------- Skeletons ---------- */

.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.sk-line { height: 12px; margin: 9px 0; }
.sk-title { height: 18px; width: 45%; margin-bottom: 14px; }
.sk-value { height: 26px; width: 55%; margin: 8px 0 6px; }
.sk-block { height: 72px; margin-top: 14px; }
.sk-cell { height: 12px; min-width: 48px; }
.w-25 { width: 25%; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }
.w-75 { width: 75%; }
.w-90 { width: 90%; }

/* ---------- Auto-refresh control ---------- */

.refresher {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
}

.refresher__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.refresher[data-state="loading"] .live-dot {
  background: var(--run);
  box-shadow: 0 0 0 3px var(--run-soft);
  animation: pulse 1s ease-in-out infinite;
}

.refresher[data-state="paused"] .live-dot {
  background: var(--muted);
  box-shadow: 0 0 0 3px var(--muted-soft);
}

.refresher[data-state="error"] .live-dot {
  background: var(--err);
  box-shadow: 0 0 0 3px var(--err-soft);
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 10px 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone, var(--run));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast > .icon {
  margin-top: 1px;
  color: var(--tone, var(--run));
}

.toast__body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast__title {
  font-weight: 650;
}

.toast__meta {
  margin-top: 2px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.toast.is-leaving {
  animation: toast-out 0.16s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ==========================================================================
   Page-specific
   ========================================================================== */

/* Dashboard */
.job-group + .job-group {
  margin-top: 30px;
}

.job-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.job-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 650;
}

.job-group__title .icon {
  color: var(--accent-strong);
}

.job-group__desc {
  color: var(--text-3);
  font-size: 13px;
}

.job-group__head > .btn {
  margin-left: auto;
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.job-card.is-failed {
  border-color: color-mix(in srgb, var(--err) 45%, var(--border));
}

.job-card.is-stale:not(.is-failed) {
  border-color: color-mix(in srgb, var(--warn) 50%, var(--border));
}

.job-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.job-card__title {
  font-size: 16px;
  font-weight: 650;
}

.job-card__table {
  margin-top: 2px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.job-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.job-card__foot .btn {
  margin-left: auto;
}

.schedule-raw {
  margin-left: 4px;
}

/* Data */
.data-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.table-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.table-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.table-item:hover {
  border-color: var(--border-strong);
}

.table-item[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.table-item__name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.table-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
}

.table-item__rows {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-weight: 600;
}

.data-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.data-head__title {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.data-head__meta {
  color: var(--text-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 880px) {
  .data-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .table-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .table-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 190px;
    scroll-snap-align: start;
  }
}

/* Webhook */
.webhook-layout {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.webhook-layout .span-full {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .webhook-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.subhead {
  margin: 18px 0 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.response-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.cinema-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cinema {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cinema:first-child {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.cinema__rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.cinema:first-child .cinema__rank {
  background: var(--accent);
  color: var(--accent-text);
}

.cinema__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}

.cinema__name {
  font-size: 14.5px;
  font-weight: 650;
}

.cinema__distance {
  color: var(--accent-strong);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cinema__addr {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13px;
}

.ar {
  color: var(--text-2);
  font-size: 13px;
}

.cinema__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-size: 12.5px;
}

.cinema__links a,
.cinema__links span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow-wrap: anywhere;
}

/* Health */
.health-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--tone-soft, var(--muted-soft));
  border: 1px solid color-mix(in srgb, var(--tone, var(--muted)) 35%, transparent);
  border-radius: var(--radius-lg);
}

.health-banner__icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tone, var(--muted));
  color: var(--surface);
}

.health-banner__title {
  font-size: 16px;
  font-weight: 650;
}

.health-banner__sub {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tone, var(--muted));
}

.tile__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tile__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
}

.tile__name .icon {
  color: var(--text-3);
}

.tile__desc {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
}

.tile__latency {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tile__latency small {
  margin-left: 3px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.tile__detail {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.login-theme {
  position: fixed;
  top: 12px;
  right: 12px;
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.login-brand .brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.login-title {
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.login-sub {
  color: var(--text-2);
  font-size: 13px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form .btn {
  width: 100%;
  height: 40px;
  font-size: 14px;
}

.login-foot {
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
