/* ==========================================================================
   Базовые стили: reset, типографика, каркас приложения, адаптив
   ========================================================================== */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h2); font-weight: 700; }
h2 { font-size: var(--fs-h3); font-weight: 600; }
h3 { font-size: var(--fs-h4); font-weight: 600; }
h4 { font-size: var(--fs-lg); font-weight: 600; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .5; cursor: not-allowed; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: inherit;
}

[hidden] { display: none !important; }

.obf7v, .obf4j, .obf8a, .obf7p td.num {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------- APP ---------------------------------- */
.obf2 {
  display: flex;
  min-height: 100vh;
}

.obf3 {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ------------------------------- SIDEBAR -------------------------------- */
.obf6z {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.obf70 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.obf71 { font-size: 26px; line-height: 1; }
.obf72 { display: flex; flex-direction: column; min-width: 0; }
.obf72 strong { font-size: var(--fs-lg); letter-spacing: -.01em; }
.obf72 small { color: var(--text-muted); font-size: 10px; line-height: 1.3; }

.obf73 {
  flex: 1 1 auto;
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.obf4v { display: flex; flex-direction: column; gap: 2px; }
.obf4w {
  padding: 0 var(--space-3) var(--space-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-subtle);
}

.obf4x {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font-size: var(--fs-sm);
  transition: background var(--transition), color var(--transition);
}
.obf4x:hover { background: var(--surface-hover); color: var(--text); }
.obf4x[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-left-color: var(--accent);
  font-weight: 600;
}
.obf4y { padding-left: 22px; font-size: var(--fs-caption); }
.obf4z { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; }
.obf50 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.obf74 {
  margin: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px var(--space-2);
  align-items: center;
}
.obf75 { font-size: var(--fs-caption); color: var(--text-muted); }
.obf74 strong { font-size: var(--fs-h4); color: var(--accent-ink); line-height: 1; }
.obf74 .obf5b { grid-column: 1 / -1; margin-top: var(--space-2); }

/* -------------------------------- TOPBAR -------------------------------- */
.obf85 {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
}

.obf87 { display: flex; align-items: center; gap: var(--space-2); min-width: 140px; }
.obf8d { font-size: var(--fs-lg); font-weight: 600; white-space: nowrap; }
.obf88 { display: none; }

.obf3k {
  position: relative;
  flex: 1 1 520px;
  max-width: 560px;
  margin: 0 auto;
}
.obf3m {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 16px; pointer-events: none; opacity: .7;
}
.obf3n {
  width: 100%; height: 40px;
  padding: 0 42px 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  outline: none;
}
.obf3n:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.obf3l {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0 6px; font-size: 11px; color: var(--text-subtle); font-family: var(--font-mono);
}

.obf62 {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  max-height: 70vh; overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: var(--space-2);
  z-index: 60;
}
.obf65 + .obf65 { margin-top: var(--space-2); }
.obf66 {
  display: flex; justify-content: space-between;
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-caption); font-weight: 600; color: var(--text-muted);
}
.obf67 {
  display: block; width: 100%; text-align: left;
  padding: var(--space-2); border: 0; border-radius: var(--r-sm); background: transparent;
  font-size: var(--fs-sm);
}
.obf67:hover, .obf67:focus-visible { background: var(--surface-hover); }
.obf67 small { display: block; color: var(--text-muted); font-size: var(--fs-caption); }
.obf64 { padding: var(--space-4); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
.obf63 { margin-top: var(--space-3); }

.obf89 { display: flex; align-items: center; gap: var(--space-2); min-width: 140px; justify-content: flex-end; }
.obf8a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600;
}
.obf8c { color: var(--streak); background: color-mix(in srgb, var(--warning-soft) 70%, transparent); }
.obf8b { color: var(--points); background: color-mix(in srgb, var(--warning-soft) 70%, transparent); }
.obf86 {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 18px; display: grid; place-items: center;
}

/* -------------------------------- CONTENT ------------------------------- */
.obf1x {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) var(--space-8);
}

.obf8i { animation: view-in var(--transition); }
@keyframes view-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.obf55 {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.obf59 { min-width: 0; }
.obf5a { font-size: var(--fs-h2); font-weight: 700; }
.obf58 { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 4px; }
.obf56 { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.obf57 {
  font-size: var(--fs-caption); color: var(--warning);
  background: var(--warning-soft); padding: 4px 8px; border-radius: var(--r-sm);
}

.obf68 { margin-bottom: var(--space-8); }
.obf69 {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-3);
}
.obf69 h3 { font-size: var(--fs-h4); }
.obf6a { color: var(--text-muted); font-size: var(--fs-caption); }

/* ----------------------------- BOTTOM NAV ------------------------------- */
.obfx {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(5, 1fr);
}
.obfy {
  border: 0; background: transparent; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: var(--fs-caption);
}
.obfy span:first-child { font-size: 20px; }
.obfy[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }

/* -------------------------------- SHEET --------------------------------- */
.obf6u { position: fixed; inset: 0; z-index: 70; }
.obf6y { position: absolute; inset: 0; background: var(--scrim); }
.obf6x {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-height: 80vh; overflow-y: auto;
  background: var(--bg-elevated);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: sheet-in var(--transition);
}
@keyframes sheet-in { from { transform: translateY(20px); opacity: .5; } to { transform: none; opacity: 1; } }
.obf6w {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4); border-bottom: 1px solid var(--border);
}
.obf6w h2 { font-size: var(--fs-h4); }
.obf6v { padding: var(--space-2); display: flex; flex-direction: column; }

/* ------------------------------ RESPONSIVE ------------------------------ */
@media (max-width: 1023px) {
  .obf6z { width: 72px; flex-basis: 72px; }
  .obf72, .obf4w, .obf50,
  .obf75 { display: none; }
  .obf70 { justify-content: center; padding: var(--space-3) 0; }
  .obf4x { justify-content: center; padding: 10px 0; }
  .obf4y { padding-left: 0; }
  .obf74 { justify-content: center; text-align: center; display: block; padding: var(--space-2); }
  .obf74 strong { font-size: var(--fs-base); }
  .obf1x { padding: var(--space-4); }
  .obf85 { padding: 0 var(--space-4); }
  .obf87, .obf89 { min-width: 0; }
}

@media (max-width: 767px) {
  .obf6z { display: none; }
  .obf85 { gap: var(--space-2); }
  .obf87 { min-width: 0; }
  .obf8d { display: none; }
  .obf88 { display: inline-grid; }
  .obf3k { flex: 1 1 auto; max-width: none; }
  .obf8a { display: none; }
  .obf89 { gap: var(--space-1); }
  .obf1x { padding: var(--space-4) var(--space-3) calc(84px + env(safe-area-inset-bottom, 0px)); }
  .obfx { display: grid; }
  .obf55 { flex-direction: column; align-items: stretch; }
  .obf56 { justify-content: flex-start; }
  .obf5a { font-size: var(--fs-h3); }
  body.is-focus .obfx { display: none; }
}
