/*
 * Каркас сайта (src/site/shell.ts): левая панель разделов, на узком экране — нижняя.
 * Общий для приложения и статических страниц; цвета — переменные страницы (--panel, --line, --accent…).
 */
body.has-rail { padding-left: 72px; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: 72px; z-index: 50;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  background: var(--panel); border-right: 1px solid var(--line); padding: 10px 0;
}
.rail a { color: var(--muted); text-decoration: none; }
.rail-logo { display: flex; justify-content: center; padding: 2px 0 10px; margin: 0 12px 6px; border-bottom: 1px solid var(--line); }
.rail-items { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  margin: 0 6px; padding: 8px 2px 7px; border-radius: 10px;
  font-size: 11px; line-height: 1.15; text-align: center;
}
.rail-item:hover { color: var(--ink); background: var(--field, var(--bg)); }
.rail-item.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rail-item:focus-visible, .rail-langs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rail-langs { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.rail-langs a { padding: 4px 8px; border-radius: 6px; }
.rail-langs a:hover { color: var(--ink); }
.rail-langs a.on { color: var(--accent); }

/* Телефон: разделы — нижней строкой, языки прячутся (переключатель — в шапке страницы). */
@media (max-width: 860px) {
  body.has-rail { padding-left: 0; padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .rail {
    inset: auto 0 0 0; width: auto; height: calc(58px + env(safe-area-inset-bottom));
    flex-direction: row; padding: 0 0 env(safe-area-inset-bottom); gap: 0;
    border-right: 0; border-top: 1px solid var(--line);
  }
  .rail-logo { display: none; }
  /* Языки — строкой в правом верхнем углу; в калькуляторе язык выбирается в шапке. */
  .rail-langs {
    position: fixed; top: 8px; right: 8px; flex-direction: row; gap: 0; z-index: 51;
    background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px;
  }
  .rail-langs a { padding: 4px 7px; }
  .app-page .rail-langs { display: none; }
  .rail-items { flex-direction: row; flex: 1; gap: 0; }
  .rail-item { flex: 1; margin: 4px 2px; padding: 6px 0 4px; font-size: 10.5px; min-width: 0; }
  .rail-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media print { .rail { display: none; } body.has-rail { padding: 0; } }
