/* «Находка» — школьное бюро находок.
   Дизайн-язык: нативный раздел школьной экосистемы (референс school.mos.ru / МЭШ):
   светлый серо-лиловый фон, белые панели, компактная белая навигация,
   насыщенный синий акцент, умеренные радиусы, сдержанные тени, плотность информации. */

/* ============ Токены ============ */
:root {
  --bg: #f1f2f6;
  --surface: #ffffff;
  --surface-2: #f5f6fa;
  --ink: #21242d;
  --ink-2: #5f6572;
  --ink-3: #9298a5;
  --line: #e4e6ec;
  --line-strong: #d3d6df;

  --accent: #2d5cd7;
  --accent-hover: #2450bd;
  --accent-soft: #e9effc;
  --accent-ink: #1e46a8;
  --accent-contrast: #ffffff;

  --found: #2d5cd7;
  --found-soft: #e9effc;
  --lost: #b05e0c;
  --lost-soft: #fcefdc;
  --wait: #8a6d1a;
  --wait-soft: #faf3d8;
  --ok: #1f7a44;
  --ok-soft: #e5f3ea;
  --muted-chip: #5f6572;
  --muted-chip-soft: #eef0f4;
  --red: #c9382e;
  --red-soft: #fdecea;

  --radius-panel: 12px;
  --radius-ctl: 9px;
  --radius-badge: 6px;
  --shadow-s: 0 1px 2px rgba(20, 24, 40, .05);
  --shadow-m: 0 2px 10px rgba(20, 24, 40, .08);
  --shadow-l: 0 8px 28px rgba(20, 24, 40, .14);
  --font: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PT Sans", Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 56px;
  --ctl-h: 38px;
}

/* Табличные цифры для дат, времени и счётчиков */
.card-date, .claim-date, .notif-item .notif-meta, .stat b, .admin-card b, .props dd,
.me-side .count, .bell-count, .card-top .badge {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

html[data-theme="dark"] {
  --bg: #15171c;
  --surface: #1e2128;
  --surface-2: #262a32;
  --ink: #e7e9ee;
  --ink-2: #a6acba;
  --ink-3: #767d8c;
  --line: #2d313b;
  --line-strong: #3a3f4b;
  --accent: #6d94f0;
  --accent-hover: #82a4f3;
  --accent-soft: #253048;
  --accent-ink: #b1c8f7;
  --accent-contrast: #0d1420;
  --found: #8db0f5;
  --found-soft: #253048;
  --lost: #e0a35c;
  --lost-soft: #33291a;
  --wait: #d8bc74;
  --wait-soft: #302a18;
  --ok: #6cc492;
  --ok-soft: #1c2f24;
  --muted-chip: #a6acba;
  --muted-chip-soft: #2a2e37;
  --red: #e0837b;
  --red-soft: #35221f;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-m: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-l: 0 8px 28px rgba(0, 0, 0, .5);
}

/* ============ База ============ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3 { line-height: 1.3; margin: 0 0 .35em; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 .6em; }

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

.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  padding: 8px 14px;
  transition: top .15s ease;
  z-index: 100;
}
.skip-link:focus { top: 10px; }

/* ============ Шапка (как toolbar веб-приложения) ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px; height: 28px;
  object-fit: contain;
  flex: none;
}

.topbar-nav { display: flex; align-self: stretch; }
.topbar-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
.topbar-nav a:hover { color: var(--ink); text-decoration: none; }
.topbar-nav a.active { color: var(--accent); font-weight: 600; }
.topbar-nav a.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.topbar-search { flex: 1; max-width: 300px; margin-left: auto; }

.search { position: relative; display: flex; align-items: center; }

.search input {
  width: 100%;
  height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 32px 0 32px;
  font: inherit;
  font-size: 13.5px;
  transition: border-color .15s ease, background .15s ease;
}

.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--line-strong); }
.search input:focus { border-color: var(--accent); background: var(--surface); outline: none; }

.search svg {
  position: absolute;
  left: 10px;
  color: var(--ink-3);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 5px;
  width: 26px; height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 6px;
  cursor: pointer;
}
.search-clear.visible { display: inline-flex; }
.search-clear:hover { background: var(--surface-2); color: var(--ink); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  position: relative;
}

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-ctl);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.bell-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Меню пользователя в шапке */
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 4px 6px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
}
.user-btn:hover { background: var(--surface-2); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  flex: none;
}

.user-name { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-name b { font-size: 13.5px; font-weight: 600; }
.user-name span { font-size: 11.5px; color: var(--ink-3); }

.user-chevron { color: var(--ink-3); }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-l);
  padding: 6px;
  z-index: 60;
}
.menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.menu-head b { display: block; font-size: 13.5px; }
.menu-head span { font-size: 12px; color: var(--ink-3); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item svg { color: var(--ink-2); flex: none; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-label { font-size: 11.5px; color: var(--ink-3); padding: 6px 10px 2px; }
.menu-item select {
  height: 32px;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

/* Выпадающая панель уведомлений */
.notif-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-l);
  z-index: 60;
  overflow: hidden;
}
.notif-head {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item .notif-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 3px; }
.notif-item .notif-text { color: var(--ink-2); font-size: 12.5px; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ============ Макет страницы ============ */
.page {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 48px;
  outline: none;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-2); font-size: 13px; margin: 3px 0 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  margin-bottom: 10px;
}
.back:hover { color: var(--ink); text-decoration: none; }

/* ============ Кнопки ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--ctl-h);
  padding: 0 15px;
  border-radius: var(--radius-ctl);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 82%, var(--accent) 18%); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 88%, #000 12%); }

.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ============ Бейджи статусов (компактные chips) ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-found { background: var(--found-soft); color: var(--found); }
.badge-lost { background: var(--lost-soft); color: var(--lost); }
.badge-open { background: var(--muted-chip-soft); color: var(--muted-chip); }
.badge-pending { background: var(--wait-soft); color: var(--wait); }
.badge-returned { background: var(--ok-soft); color: var(--ok); }
.badge-rejected { background: var(--muted-chip-soft); color: var(--muted-chip); }
.badge-approved { background: var(--ok-soft); color: var(--ok); }

/* ============ Тулбар ленты ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}

.segment {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.segment button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 5px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.segment button:hover { color: var(--ink); }
.segment button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-s);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color .15s ease, background .15s ease;
}
.chip:hover { border-color: var(--ink-3); }
.chip select {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  max-width: 140px;
  height: auto;
  padding: 0;
  width: auto;
}
.chip select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.chip input {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 0;
  width: auto;
  height: auto;
}
.chip-on { border-color: var(--accent); background: var(--accent-soft); }

/* Поиск в теле страницы: скрыт на десктопе (есть в шапке), показывается при узких экранах */
.search-in-page { display: none; }

/* ============ Лента ============ */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-s);
  text-decoration: none;
}

.img-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  color: var(--ink-3);
  font-size: 12.5px;
}

.card-img {
  aspect-ratio: 16/10;
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-type {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
}

.card-body { padding: 11px 14px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-date { font-size: 12px; color: var(--ink-3); }
.card-title { font-size: 16px; font-weight: 600; margin: 0; }
.card-meta { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.card-desc {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.card-return { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: 12.5px; font-weight: 600; }

/* ============ Страница вещи ============ */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 14px;
  align-items: start;
}

.photo-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.detail-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title-row h1 { margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 18px 20px;
}

.panel-plain { max-width: 640px; margin: 0 auto; }

.props {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  margin: 0;
}
.props > div {
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.props > div:nth-child(-n+2) { border-top: 0; }
.props dt { font-size: 11.5px; color: var(--ink-3); }
.props dd { margin: 0; font-size: 13.5px; font-weight: 550; }

.aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aside-card h2 { margin: 0; font-size: 14.5px; }
.aside-note { font-size: 13px; color: var(--ink-2); margin: 0; }
.aside-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.aside-author { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

.returns-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
  border-radius: var(--radius-panel);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 12px;
}

.claims-block { margin-top: 24px; }
.claims-block h2 { margin-bottom: 10px; }

.claim-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 13px 16px;
  margin-bottom: 10px;
}
.claim-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.claim-name { font-weight: 600; font-size: 13.5px; }
.claim-date { font-size: 12.5px; color: var(--ink-3); }
.claim-msg { margin: 7px 0 11px; font-size: 13.5px; color: var(--ink-2); }
.claim-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.claim-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wait-soft);
  color: var(--wait);
  padding: 6px 10px;
  border-radius: var(--radius-badge);
  font-size: 12.5px;
  font-weight: 600;
}

/* ============ Формы ============ */

.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.type-card {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.type-card:hover { border-color: var(--ink-3); }
.type-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.type-card strong { display: block; font-size: 14px; margin-bottom: 1px; }
.type-card span { font-size: 12px; color: var(--ink-2); }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
.field .error { font-size: 12px; color: var(--red); margin: 4px 0 0; display: none; }
.field.invalid .error { display: block; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--red); }

input, select, textarea {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  font: inherit;
  font-size: 13.5px;
  transition: border-color .15s ease;
}
textarea { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type="date"], input[type="time"] { min-width: 0; }

.form-section { margin-bottom: 6px; }
/* Табы заменены сайдбар-навигацией «Мои вещи» */

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.file-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-ctl);
  padding: 12px;
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  display: block;
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input { display: none; height: auto; }
.file-preview { margin-top: 10px; display: none; align-items: center; gap: 10px; }
.file-preview.visible { display: flex; }
.file-preview img { width: 64px; height: 48px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.file-name { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }

.secret-field {
  border: 1px solid color-mix(in srgb, var(--wait) 35%, transparent);
  background: var(--wait-soft);
  border-radius: var(--radius-ctl);
  padding: 11px 13px;
  margin-bottom: 13px;
}
.secret-field .hint { color: var(--wait); }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ============ Аутентификация (страницы входа/регистрации) ============ */
.auth-panel { max-width: 420px; margin: 24px auto 0; }
.auth-alt { font-size: 13.5px; color: var(--ink-2); margin: 14px 0 0; text-align: center; }
.auth-error {
  background: var(--red-soft);
  color: var(--red);
  border-radius: var(--radius-ctl);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.auth-demo {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.auth-demo b { display: block; margin-bottom: 2px; font-size: 12.5px; }
.auth-demo code {
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
}
.auth-demo-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.auth-demo-list .chip { cursor: pointer; height: 30px; font-size: 12px; }
.auth-demo-list .chip:hover { border-color: var(--accent); color: var(--accent-ink); }

.hidden { display: none !important; }

/* ============ Мои вещи: сайдбар ============ */
.me-grid {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.me-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.me-side a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.me-side a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.me-side a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.me-side .count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 1px 7px;
}
.me-side a.active .count { background: var(--surface); color: var(--accent-ink); }
.me-side .count-hot { background: var(--red-soft); color: var(--red); }

.form-section > h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

/* Табы заменены сайдбар-навигацией «Мои вещи» */

/* ============ Профиль ============ */
.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}
.profile-card .avatar { width: 60px; height: 60px; font-size: 21px; margin-bottom: 6px; }
.profile-card h2 { margin: 0; }
.profile-card .role { color: var(--ink-2); font-size: 13px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 14px;
}
.stat {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 9px 6px;
}
.stat b { display: block; font-size: 17px; }
.stat span { font-size: 11.5px; color: var(--ink-2); }

/* ============ Админка ============ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 12px 15px;
}
.admin-card b { font-size: 20px; display: block; }
.admin-card span { font-size: 12.5px; color: var(--ink-2); }

.admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 9px 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.admin-item-img { width: 54px; height: 42px; border-radius: 7px; object-fit: cover; background: var(--surface-2); }
.admin-item-body { flex: 1; min-width: 160px; }
.admin-item-body b { font-size: 13.5px; }
.admin-item-body span { display: block; font-size: 12px; color: var(--ink-2); }
.admin-item-actions { display: flex; gap: 6px; margin-left: auto; }

/* ============ Пустые состояния (спокойные, панельные) ============ */
.empty {
  text-align: center;
  padding: 36px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  color: var(--ink-2);
}
.empty svg { color: var(--ink-3); margin: 0 auto 10px; display: block; }
.empty b { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 13px; margin: 0 auto; max-width: 420px; }
.empty .btn { margin-top: 14px; }

/* ============ Toasts ============ */
.toasts {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: var(--shadow-l);
  animation: toast-in .22s ease;
}
.toast-out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ============ Диалоги ============ */
.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 0;
  max-width: 420px;
  width: calc(100vw - 32px);
  box-shadow: var(--shadow-l);
  background: var(--surface);
  color: var(--ink);
}
.dialog::backdrop { background: rgba(24, 27, 36, .45); }
.dialog-body { padding: 18px 20px; }
.dialog-title { font-size: 16px; margin-bottom: 6px; }
.dialog-text { color: var(--ink-2); font-size: 13.5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }

.claim-form { text-align: left; }

/* ============ Футер ============ */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
}
.footer-links a { color: var(--ink-3); }

/* ============ Анимации ============ */
.view-enter { animation: view-in .16s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

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

/* ============ Адаптив ============ */
@media (max-width: 960px) {
  .detail { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .me-grid { grid-template-columns: 1fr; }

  /* Сайдбар превращается в компактный горизонтальный селектор */
  .me-side {
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    gap: 4px;
  }
  .me-side a {
    white-space: nowrap;
    padding: 7px 11px;
    border-radius: 7px;
  }
  .me-side a.active::before { content: none; }
}

@media (max-width: 860px) {
  .topbar-search { display: none; }
  .user-name { display: none; }
  .topbar-inner { gap: 10px; }
  /* Поиск переезжает в верх страницы ленты */
  .search-in-page { display: block; margin-bottom: 12px; }
}

@media (max-width: 720px) {
  .topbar-inner { padding: 0 12px; }
  .topbar-nav a { padding: 0 9px; font-size: 13.5px; }
  .page { padding: 14px 12px 40px; }

  .search-in-page { display: block; margin-bottom: 12px; }

  .feed { grid-template-columns: 1fr; }

  .type-choice { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1; }

  .props { grid-template-columns: 1fr; }
  .props > div:nth-child(-n+2) { border-top: 1px solid var(--line); }
  .props > div:first-child { border-top: 0; }

  .admin-item-actions { margin-left: 0; width: 100%; }
  .admin-item-actions .btn { flex: 1; }

  .page-head h1 { font-size: 21px; }
  .detail-title-row h1 { font-size: 21px; }
}

@media (max-width: 360px) {
  .topbar-inner { gap: 6px; }
  .segment button { padding: 5px 9px; }
  .topbar-nav a { padding: 0 7px; }
}


/* ============ Чат заявки ============ */
.chat-wrap { max-width: 760px; margin: 0 auto; }
.chat-list {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  min-height: 280px; max-height: 52vh; overflow-y: auto;
}
.chat-empty {
  margin: auto; text-align: center; color: var(--ink-2);
  font-size: 13.5px; padding: 24px 12px; line-height: 1.5;
}
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-author { font-size: 11.5px; color: var(--ink-3); margin: 0 3px 2px; }
.chat-bubble {
  padding: 8px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.mine .chat-bubble {
  background: var(--accent-soft); border-color: transparent; color: var(--accent-ink);
}
.chat-time {
  font-size: 10.5px; color: var(--ink-3);
  margin: 3px 3px 0; font-variant-numeric: tabular-nums;
}
.chat-input { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.chat-input textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 11px 14px; font-size: 14px; font-family: var(--font);
  border: 1px solid var(--line-strong); border-radius: var(--radius-ctl);
  background: var(--surface); color: var(--ink);
}
.chat-input textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.chat-input .btn { height: 44px; }

/* Стартовый экран использует общую палитру приложения в обеих темах. */
#themeToggle .ico-sun { display: none; }
#themeToggle .ico-moon { display: block; }
html[data-theme="dark"] #themeToggle .ico-sun { display: block; }
html[data-theme="dark"] #themeToggle .ico-moon { display: none; }
.landing { padding: 18px 0 0; }
.landing-hero { display: grid; grid-template-columns: 1.08fr 1fr; align-items: center; gap: 42px; padding: 30px 0 60px; }
.landing-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--accent-ink); font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.landing-eyebrow > span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.landing-copy h1 { font-size: clamp(40px, 5.1vw, 64px); line-height: 1.08; letter-spacing: -.055em; margin: 22px 0; font-weight: 700; }
.landing-copy h1 em { font-style: normal; color: var(--accent); }
.landing-lead { font-size: 17px; line-height: 1.7; color: var(--ink-2); max-width: 490px; margin: 0 0 28px; }
.landing-actions { display: flex; align-items: flex-start; flex-direction: column; gap: 16px; }
.landing .landing-primary { height: auto; min-height: 48px; padding: 13px 20px; font-size: 14px; gap: 18px; white-space: normal; text-align: center; }
.landing-primary > span { font-size: 20px; }
.landing-login { font-size: 13px; font-weight: 500; }
.landing-note { color: var(--ink-2); font-size: 11px; margin: 25px 0 0; }
.landing-art { position: relative; min-width: 0; height: 440px; border-radius: 32px; background: radial-gradient(ellipse at 60% 35%, var(--surface) 0%, var(--accent-soft) 70%); isolation: isolate; }
.landing-orbit { position: absolute; width: 320px; height: 320px; border: 1px dashed var(--accent); opacity: .25; border-radius: 50%; top: 48px; left: 50%; transform: translateX(-50%); z-index: -1; }
.landing-sticker { position: absolute; top: 25px; left: 26px; color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.landing-sticker > span { margin-right: 6px; }
.landing-object { position: absolute; padding: 9px 9px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-l); }
.landing-object img { width: 100%; object-fit: cover; border-radius: 9px; }
.landing-object span { display: block; padding: 10px 3px 0; font-size: 11px; font-weight: 500; }
.landing-object-backpack { width: 216px; top: 68px; left: 36px; transform: rotate(-9deg); }
.landing-object-backpack img { height: 170px; }
.landing-object-keys { width: 178px; right: 24px; top: 155px; transform: rotate(9deg); }
.landing-object-keys img { height: 118px; }
.landing-return { position: absolute; left: 30px; bottom: 55px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); padding: 13px 16px; border-radius: 14px; box-shadow: var(--shadow-m); }
.landing-return-icon { display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); width: 32px; height: 32px; border-radius: 50%; }
.landing-return b, .landing-return div > span { display: block; }
.landing-return b { font-size: 12px; }
.landing-return div > span { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.landing-art-caption { position: absolute; bottom: 22px; left: 0; width: 100%; text-align: center; font-size: 10px; color: var(--ink-2); }
.landing-guide { padding: 32px 0 0; border-top: 1px solid var(--line); }
.landing-section-head h2 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; margin: 12px 0 8px; }
.landing-section-head > p { margin: 0; color: var(--ink-2); font-size: 14px; }
.landing-steps { list-style: none; padding: 0; margin: 30px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.landing-steps li { padding: 25px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.landing-step-no { font-size: 13px; font-weight: 600; color: var(--accent-ink); display: grid; place-items: center; width: 38px; height: 38px; background: var(--accent-soft); border-radius: 12px; }
.landing-steps h3 { font-size: 17px; margin: 23px 0 10px; }
.landing-steps p { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 0; }
.landing-benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 12px 6px 40px; }
.landing-benefits article { display: flex; gap: 13px; align-items: flex-start; }
.landing-benefits article > span { color: var(--accent); padding-top: 3px; }
.landing-benefits h3 { font-size: 14px; margin: 0 0 6px; }
.landing-benefits p { color: var(--ink-2); font-size: 12px; line-height: 1.7; margin: 0; }
.landing-bottom { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 30px 34px; background: var(--accent-soft); border-radius: 20px; }
.landing-bottom h2 { font-size: 22px; letter-spacing: -.025em; margin: 0 0 7px; }
.landing-bottom p { color: var(--ink-2); margin: 0; font-size: 13px; }
.landing-bottom > a { flex-shrink: 0; }
@media (max-width: 960px) {
  .landing-hero { gap: 24px; }
  .landing-art { height: 400px; }
  .landing-object-backpack { width: 185px; left: 22px; }
  .landing-object-keys { width: 145px; right: 14px; top: 155px; }
  .landing-return { left: 18px; right: 18px; }
  .landing-orbit { width: 260px; height: 260px; }
  .landing-steps { gap: 14px; }
  .landing-steps li { padding: 22px 18px; }
}
@media (max-width: 700px) {
  .landing { padding-top: 0; }
  .landing-hero { grid-template-columns: 1fr; padding: 25px 5px 34px; gap: 30px; }
  .landing-copy h1 { font-size: clamp(40px, 9vw, 58px); }
  .landing-lead { font-size: 15px; max-width: 100%; }
  .landing-art { height: 365px; max-width: 470px; width: 100%; margin: auto; }
  .landing-object-backpack { top: 58px; left: 28px; width: 190px; }
  .landing-object-backpack img { height: 135px; }
  .landing-object-keys { top: 120px; right: 25px; width: 150px; }
  .landing-object-keys img { height: 95px; }
  .landing-return { bottom: 48px; left: 22px; right: auto; }
  .landing-steps, .landing-benefits { grid-template-columns: 1fr; }
  .landing-steps { gap: 12px; margin-top: 24px; }
  .landing-steps li { padding: 22px; }
  .landing-steps h3 { margin-top: 15px; }
  .landing-benefits { gap: 22px; padding-bottom: 30px; }
  .landing-bottom { flex-direction: column; align-items: flex-start; padding: 25px 22px; }
  .landing-bottom h2 { font-size: 21px; }
  .landing-bottom > a { width: 100%; }
}
@media (max-width: 360px) {
  .landing-object-backpack { width: 170px; left: 15px; }
  .landing-object-keys { width: 128px; right: 14px; }
  .landing-sticker { left: 16px; }
  .landing-return { left: 10px; right: 10px; padding: 12px; }
}
