/* Нийтлэг дизайн токен ба жижиг бүрэлдэхүүн — админ ба дэлгүүрт */
:root {
  --accent: #1F5FE0;
  --accent-ink: #FFFFFF;
  --ink: #12161F;
  --ink-2: #2F3640;
  --muted: #5B6472;
  --subtle: #4A525E;
  --line: #E3E6EB;
  --line-2: #D5DAE1;
  --ground: #F4F5F7;
  --surface: #FFFFFF;
  --ok-bg: #E3F4EA;  --ok: #0F6B3A;
  --warn-bg: #FFF4D1; --warn: #6B4E00;
  --info-bg: #E6EEFC; --info: #1747AE;
  --danger: #B42318;
  --radius: 14px;
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--ground);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.btn-danger { color: var(--danger); border-color: #F2C4BF; }
.btn-block { width: 100%; min-height: 54px; font-size: 16px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-icon {
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--ink);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; }
.input {
  width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid var(--line-2); background: var(--surface); font-size: 16px;
}
textarea.input { padding: 10px 12px; min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); outline: none; }

.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--surface); font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }

.thumb {
  background: #E9ECF0; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #8A919C;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

#toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translate(-50%, -20px);
  box-shadow: 0 6px 20px rgba(18,22,31,.2);
  background: var(--ink); color: #FFFFFF; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 100; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind='err'] { background: var(--danger); }

.spinner {
  width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2);
  border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } #toast { transition: none; } }

.ask { position: fixed; inset: 0; z-index: 200; background: rgba(18,22,31,.5); display: flex; align-items: flex-end; justify-content: center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
@media (min-width: 600px) { .ask { align-items: center; } }
.ask-box { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 12px 40px rgba(18,22,31,.25); }
.ask-box p { margin: 0; font-size: 16px; line-height: 1.5; }
.ask-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-danger-fill { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.demo-banner { background: var(--warn-bg); color: var(--warn); font-size: 13px; padding: 8px 16px; text-align: center; }
.pmeta { font-size: 12px; color: var(--muted); }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 14px; min-height: 44px; padding: 0 4px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; text-decoration: none; position: relative; }
.linkbtn.muted { color: var(--subtle); }
