/* Каркас: шапка, боковая панель, нижняя панель телефона, уведомления. */
/* Шапка */
.top { display: flex; align-items: center; gap: 14px; height: var(--top-h); padding: 0 20px; background: var(--night); color: #fff; position: sticky; top: 0; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; background: #fff; border-radius: 10px; }
.brand span { font: 800 18px var(--display); }
.brand:hover { color: #fff; }
.ask { flex: 1 1 auto; min-width: 0; max-width: 680px; position: relative; }
.ask label { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--night-2); color: #B9BFDA; }
.ask input { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font-size: 16px; outline: none; }
.ask input::placeholder { color: #A9B0CF; }
.ask kbd { font: 500 12px var(--mono); padding: 3px 7px; border-radius: 6px; background: var(--night-3); color: #DDE1F0; }
.suggest { position: absolute; left: 0; right: 0; top: 50px; background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 16px 40px rgba(30,42,85,.22); overflow: hidden; }
.suggest[hidden] { display: none; }
.suggest a { display: flex; gap: 12px; align-items: center; padding: 11px 14px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line-2); }
.suggest a:first-child { border-top: 0; }
.suggest a:hover, .suggest a.on { background: var(--ground); }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--night-2); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.zorka-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 8px; border-radius: 14px; background: var(--night-2); color: #fff; text-decoration: none; font-weight: 600; flex-shrink: 0; }
.zorka-btn:hover { color: #fff; background: var(--night-3); }
.menu-btn { display: none; }

/* Каркас: боковая панель и содержимое */
.shell { display: flex; min-height: calc(100vh - var(--top-h)); }
.side { width: 256px; flex-shrink: 0; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; }
.side > * { flex-shrink: 0; }
.farmbox { padding: 2px 6px 4px; display: flex; flex-direction: column; gap: 2px; }
.farmname { font: 700 15px var(--display); }
.sitesel select { width: 100%; height: 40px; margin-top: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); }
.add-event { justify-content: center; height: 46px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 500; }
.nav a svg { flex-shrink: 0; color: var(--muted); }
.nav a:hover { background: var(--ground); color: var(--ink); }
.nav a.on { background: var(--night); color: #fff; font-weight: 600; }
.nav a.on svg { color: #fff; }
.nav a.later span { color: #6E7491; }
.nav .badge { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12px; font-weight: 700; }
.nav-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.nav-bottom a { min-height: 38px; font-size: 15px; }
.userbox { position: relative; border-top: 1px solid var(--line); padding-top: 10px; }
.user { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.user:hover { background: var(--ground); }
.ava { width: 38px; height: 38px; border-radius: 50%; background: var(--night); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user .who b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user .who small { color: var(--muted); font-size: 13px; }
.usermenu { position: absolute; left: 0; right: 0; bottom: 60px; background: #fff; border-radius: 16px; box-shadow: 0 16px 40px rgba(30,42,85,.22); padding: 6px; display: flex; flex-direction: column; }
.usermenu[hidden] { display: none; }
.usermenu a, .usermenu button { display: block; text-align: left; padding: 11px 12px; border-radius: 10px; border: 0; background: none; color: var(--ink); text-decoration: none; font-size: 15px; cursor: pointer; }
.usermenu a:hover, .usermenu button:hover { background: var(--ground); }
.usermenu button { color: var(--bad-ink); }
.main { flex: 1; min-width: 0; padding: 26px 32px 64px; display: flex; flex-direction: column; gap: 22px; }
/* Содержимое растягивается на всю ширину экрана */
.main > * { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 10px 10px 18px; min-height: 48px; border-radius: 14px; font-weight: 500; z-index: 90; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 14px; box-shadow: 0 14px 34px rgba(30,42,85,.3); }
.toast-act { border: 0; border-radius: 10px; background: var(--night-3); color: #fff; font-weight: 700; min-height: 36px; padding: 0 14px; cursor: pointer; }
.queue-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); font-weight: 700; cursor: pointer; flex-shrink: 0; margin-left: auto; }
.queue-btn.bad { background: var(--bad-soft); color: var(--bad-ink); }
.queue-btn[hidden] { display: none; }
.queue-btn:not([hidden]) + .zorka-btn { margin-left: 0; }
.toast[hidden] { display: none; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* Нижняя панель телефона */
.tabbar { display: none; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .side { position: fixed; left: 0; top: var(--top-h); bottom: 0; height: auto; z-index: 30; transform: translateX(-102%); transition: transform .2s; box-shadow: 10px 0 30px rgba(30,42,85,.15); }
  .side.open { transform: none; }
  .main { padding: 18px 16px 64px; }
  .brand span, .zorka-btn span { display: none; }
  .zorka-btn { padding: 0 8px; }
}

@media (max-width: 700px) {
  .top { gap: 10px; padding: 0 12px; }
  .brand img { width: 32px; height: 32px; }
  .menu-btn, .zorka-btn, .ask kbd { display: none !important; }
  .ask label { height: 42px; }
  .main { padding: 14px 12px 112px; gap: 14px; }
  .side { top: var(--top-h); bottom: 74px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--line); padding: 4px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border: 0; background: none; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .tabbar .on { color: var(--night); }
  .tabbar .find { width: 62px; height: 62px; margin: -24px auto 0; border-radius: 22px; background: var(--dawn); color: #fff; box-shadow: 0 8px 20px rgba(242,107,58,.38); font-size: 11px; gap: 0; }
  .tabbar .find.on { color: #fff; box-shadow: 0 0 0 3px var(--night), 0 8px 20px rgba(242,107,58,.38); }
  .toast { bottom: 92px; }
  .queue-btn span { display: none; }
  .queue-btn { padding: 0 10px; }
}
