/* Asos: tozalash, matn, sahifa tuzilishi. Ranglar faqat tokens.css dan. */

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--primary-text); outline-offset: 2px; }

.num { font-variant-numeric: tabular-nums; }

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 18px; height: 18px; }

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

/* ---------- Sahifa tuzilishi ---------- */

.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface);
}

.pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

/* Telefonda bir vaqtda bitta ustun ko'rinadi */
.shell[data-view="list"] > .pane-detail,
.shell[data-view="detail"] > .pane-list { display: none; }

/* Kompyuter va planshetda: ro'yxat doim chapda, tanlangan narsa o'ngda */
@media (min-width: 900px) {
  .shell { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
  .shell[data-view="list"] > .pane-detail,
  .shell[data-view="detail"] > .pane-list { display: flex; }
  .pane-list { border-right: 1px solid var(--border); }
  .only-narrow { display: none !important; }
}

.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.page { max-width: 760px; padding-bottom: var(--gap-5); }

/* ---------- Ilova ochilmasa ko'rinadigan oyna (boot-guard.js) ---------- */

.boot-fail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--gap-4);
  padding: var(--gap-5);
  background: var(--surface);
}
.boot-fail > * { max-width: 440px; width: 100%; margin-left: auto; margin-right: auto; }
.boot-fail-title { font-size: var(--fs-xl); font-weight: 600; }
.boot-fail-text { color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
