/* Приложение «Хочуха»: цвета, шрифт, скругления — из brand/brand.css (брендбук). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: var(--text-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.icon-btn { display: grid; place-items: center; color: var(--text); }
.icon-btn .ic { width: 22px; height: 22px; }
.btn .ic { width: 18px; height: 18px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.meta > span { display: inline-flex; align-items: center; gap: 5px; }
.station { --line: var(--accent); width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--line); color: #fff; box-shadow: inset 0 0 0 3px var(--line), inset 0 0 0 5px #fff; }
.station .ic { width: 20px; height: 20px; stroke-width: 2.2; vertical-align: 0; }
.station.sm { width: 30px; height: 30px; box-shadow: inset 0 0 0 2px var(--line), inset 0 0 0 4px #fff; }
.station.sm .ic { width: 15px; height: 15px; }
.station.lg { width: 56px; height: 56px; box-shadow: inset 0 0 0 4px var(--line), inset 0 0 0 7px #fff; }
.station.lg .ic { width: 26px; height: 26px; }
.badge .ic { width: 13px; height: 13px; vertical-align: -2px; }
::selection { background: var(--accent-soft); color: var(--text); }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { font: var(--text-h3); margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-logo { width: 30px; height: 30px; }
.bell { position: relative; display: grid; place-items: center; text-decoration: none; }
.bell span { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: var(--danger-text); font: 700 11px/18px var(--font); text-align: center; }
.card.unread { border-color: var(--accent); }
.icon-btn { border: 0; background: var(--surface-2); width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 18px; flex: none; }
main { flex: 1; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; text-decoration: none; color: var(--muted); font: var(--text-caption); }
.tabs a.active { color: var(--accent-strong); }
.tabs a .ic { width: 24px; height: 24px; }
.tabs a.active .ic { stroke-width: 2.4; }

h2 { font: var(--text-h2); margin: 4px 0 12px; }
h3 { font: var(--text-h3); margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font: var(--text-small); }
.section { margin: 22px 0 10px; font: var(--text-caption); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-card); margin-bottom: 12px; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.accent { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font: var(--text-button); padding: 14px 20px;
  border-radius: var(--radius-pill); text-decoration: none; box-shadow: var(--shadow-button); }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: none; border: 1px solid var(--border); }
.btn.small { padding: 9px 14px; font-size: 14px; min-height: 44px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 14px; font-weight: 700; cursor: pointer; text-align: left; }
.tile { min-height: 64px; color: var(--text); text-decoration: none; }
.badge { display: inline-block; font: var(--text-caption); padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.badge.warn { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); padding: 8px 14px; min-height: 44px;
  cursor: pointer; font-size: 14px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font: var(--text-small); color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-md);
  padding: 12px 14px; font-size: 16px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.error { color: var(--danger); font: var(--text-small); margin-top: 4px; }
.code-input { font-size: 28px; letter-spacing: .3em; text-align: center; font-weight: 800; }

.stars { display: flex; gap: 6px; }
.stars button { flex: 1; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-md);
  padding: 10px 0; font-size: 20px; cursor: pointer; }
.stars button.on { background: var(--accent-soft); border-color: var(--accent); }

.rich b { color: var(--text); }
.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: var(--radius-pill); background: var(--surface-2); }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0;
  border-radius: var(--radius-pill); background: transparent; color: var(--muted); font: var(--text-small); font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.group-title { margin: 18px 0 8px; font: var(--text-h3); color: var(--text); }
.group-title:first-of-type { margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .big { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); }
.empty .big .ic { width: 30px; height: 30px; }
.hero { text-align: center; padding: 20px 0 8px; }
.hero img { width: 88px; height: 88px; }
.hero h2 { font: var(--text-h1); margin: 14px 0 8px; }

#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); width: 520px; background: var(--text); color: var(--bg); padding: 12px 16px;
  border-radius: var(--radius-md); z-index: 20; font: var(--text-small); box-shadow: 0 8px 30px rgba(0,0,0,.2); }
dialog#sheet { border: 0; padding: 0; width: min(560px, 100%); max-width: 100%; margin: auto auto 0; border-radius: 24px 24px 0 0;
  background: var(--bg); color: var(--text); max-height: 88vh; }
dialog#sheet::backdrop { background: rgba(20, 12, 6, .45); }
#sheet-body { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); overflow: auto; max-height: 88vh; }
