:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6f6b64;
  --line: #e2ded6;
  --accent: #8a5a34;
  --error: #a92d20;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #211f1d;
    --text: #f0ede8;
    --muted: #a29c93;
    --line: #35322e;
    --accent: #d29a6b;
    --error: #f08a7e;
  }
}

* {
  box-sizing: border-box;
}

/* display у .topbar перебивает атрибут hidden — возвращаем ему силу */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar__title {
  margin: 0;
  font-size: 19px;
}

.topbar__subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

h2 {
  font-size: 22px;
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

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

.login {
  max-width: 380px;
  margin: 8vh auto 0;
}

.field {
  display: block;
  margin: 18px 0 12px;
}

.field span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type='password'] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 17px; /* < 16px заставляет iOS зумить при фокусе */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

input[type='password']:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button {
  min-height: 48px;
  width: 100%;
  padding: 0 18px;
  font-size: 17px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.button--quiet {
  width: auto;
  min-height: 40px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 15px;
}

.error {
  color: var(--error);
  font-size: 15px;
  margin: 12px 0 0;
}

.topbar__actions {
  display: flex;
  gap: 8px;
}

/* Разделы: на телефоне лента прокручивается вбок, на широком экране помещается целиком */
.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}

.tab--active {
  color: var(--text);
  background: var(--bg);
  font-weight: 600;
}

.subheading {
  font-size: 15px;
  color: var(--muted);
  margin: 20px 0 8px;
  font-weight: 600;
}

.counts {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.count {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
}

.count + .count {
  border-top: 1px solid var(--line);
}

.count__label {
  color: var(--muted);
}

.count__value {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}

.small {
  font-size: 13px;
}

.rooms {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.room {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.room__title {
  margin: 0 0 10px;
  font-size: 18px;
}

.room__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}

.chip__label {
  color: var(--muted);
  font-size: 12px;
}

.room__text {
  margin: 10px 0 0;
  font-size: 15px;
}

.room__text dt {
  color: var(--muted);
  font-size: 12px;
}

.room__text dd {
  margin: 2px 0 8px;
}

.room__link {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--accent);
}
