/* HC Bookings — панель отеля.
   «Стойка портье»: бумага, латунь, тёмная хвоя.
   Одна смелая вещь — тёмная доска состояния; всё остальное тихо. */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-text-cyr.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-text-lat.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-text-ruble.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+20BD;
}
@font-face {
  font-family: "Prata";
  src: url("fonts/prata-cyr.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Prata";
  src: url("fonts/prata-lat.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  /* Бумага и чернила */
  --paper: #f1f0e7;
  --paper-deep: #e7e6da;
  --card: #fcfbf5;
  --card-2: #f4f3e9;
  --ink: #1b241e;
  --ink-soft: #39443c;
  --muted: #566158;
  --muted-2: #657065;
  --line: #d9d8ca;
  --line-strong: #c2c2b1;

  /* Хвоя — основной цвет; латунь — только акцент */
  --pine: #17402f;
  --pine-deep: #0e2a20;
  --pine-3: #21553f;
  --pine-soft: #e2ebe1;
  --pine-line: #c8d6c8;
  --brass: #b38d50;
  --brass-bright: #cfa662;
  --brass-ink: #76551f;
  --brass-soft: #f2e7d0;
  --brass-line: #ddc9a2;

  /* Служебные состояния */
  --oxblood: #8b3b31;
  --oxblood-soft: #f5e3de;
  --oxblood-line: #e4c7c0;
  --amber: #7c5a1c;
  --amber-soft: #f4ead4;
  --red: #8b3b31;
  --red-soft: #f5e3de;
  --tea: #2c5b57;
  --tea-soft: #e3edeb;
  --blue: #2c5b57;
  --blue-soft: #e3edeb;
  --violet: #4a4e73;
  --violet-soft: #e8e8f0;

  /* Совместимость со старыми именами */
  --bg: var(--paper);
  --bg-deep: var(--paper-deep);
  --surface: var(--card);
  --surface-soft: var(--card-2);
  --surface-sink: var(--paper-deep);
  --accent: var(--pine);
  --accent-strong: var(--pine-3);
  --accent-ink: #103124;
  --accent-soft: var(--pine-soft);
  --accent-softer: #f7f6ee;

  --r-xl: 16px;
  --r-lg: 12px;
  --r-md: 9px;
  --r-sm: 6px;
  --r-pill: 999px;

  --shadow-card: none;
  --shadow-pop: 0 24px 60px -28px rgba(18, 33, 25, .55),
    0 2px 8px rgba(18, 33, 25, .08);
  --ring: 0 0 0 3px rgba(179, 141, 80, .28);

  --font: "Golos Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Prata", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo,
    monospace;

  --rail: 266px;
  --page: 1200px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; accent-color: var(--pine); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.58;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.18;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--brass-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass-ink);
  outline-offset: 2px;
  box-shadow: none;
}
.rail :focus-visible, .hero :focus-visible, .gate :focus-visible,
.boot :focus-visible, .toast :focus-visible {
  outline-color: #e6cf9f;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -160%);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--pine-deep);
  color: #f3efe1;
  font-size: 14px;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.nowrap { white-space: nowrap; }
.strong { font-weight: 620; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 9px; }
.stack-gap { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap, .wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.icon { display: inline-flex; flex: none; align-items: center; justify-content: center; }
.icon svg { width: 1em; height: 1em; }

/* ------------------------------------------------------------------- shell */

.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail > .rail-close { display: none; }

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 18px 20px;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--pine-deep);
  color: #e9e4d4;
  border-right: 1px solid #081c15;
}
.rail::-webkit-scrollbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--r-md);
}
.rail .brand { color: #f4efdf; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 5px;
  background: #f4efe0;
  border: 1px solid var(--brass);
  color: var(--pine-deep);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 3px #f4efe0, inset 0 0 0 4px rgba(179, 141, 80, .38);
}
.brand-mark svg { width: 46%; height: 46%; }
.brand-mark-lg {
  width: 60px;
  height: 60px;
  border-radius: 7px;
  font-size: 30px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.28; }
.brand-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-text span { font-size: 11.5px; color: #9fb2a2; letter-spacing: .01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label-top {
  padding: 0 12px 8px;
  color: #8fa294;
  font-size: 11.5px;
  font-weight: 500;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 0 13px;
  border-radius: 6px;
  color: #c6d0c3;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 450;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-link .icon { font-size: 19px; color: #94a897; transition: color .16s var(--ease); }
.nav-link:hover { background: rgba(244, 239, 224, .07); color: #f4efdf; }
.nav-link:hover .icon { color: #d9c79c; }
.nav-link[aria-current="page"] {
  background: #f4efe0;
  color: var(--pine-deep);
  font-weight: 600;
  box-shadow: inset 1px 0 0 var(--brass), inset 0 0 0 1px rgba(179, 141, 80, .35);
}
.nav-link[aria-current="page"] .icon { color: var(--pine); }
.nav-badge {
  margin-left: auto;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--brass);
  color: #1a2b21;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nav-badge.warn { background: #e0c58d; color: #40300f; }
.nav-badge.bad { background: #d9a79c; color: #4b1c16; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.support-card {
  padding: 16px;
  border-radius: var(--r-md);
  background: rgba(244, 239, 224, .06);
  border: 1px solid rgba(244, 239, 224, .12);
}
.support-card .icon { color: var(--brass-bright); font-size: 20px; margin-bottom: 9px; }
.support-card strong { display: block; font-size: 13px; margin-bottom: 3px; color: #f1ecdc; }
.support-card p { color: #a4b4a6; font-size: 12.5px; line-height: 1.5; }
.support-card a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--brass-bright);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 4px;
  border-top: 1px solid rgba(244, 239, 224, .13);
}
.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brass-bright);
  flex: none;
  box-shadow: 0 0 0 3px rgba(207, 166, 98, .16);
}
.account-dot.off { background: #7f8d7f; box-shadow: none; }
.account-text { min-width: 0; flex: 1; }
.account-text strong { display: block; font-size: 12.5px; font-weight: 600; color: #e9e4d4; }
.account-text span {
  display: block;
  font-size: 11.5px;
  color: #9aab9c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account button {
  border: 0;
  background: transparent;
  color: #a4b4a6;
  padding: 7px;
  border-radius: 6px;
}
.account button:hover { background: rgba(244, 239, 224, .08); color: #f4efdf; }
.account .icon-btn { width: auto; height: auto; border: 0; background: transparent; }

.main { min-width: 0; padding: 0 clamp(24px, 4.2vw, 64px) 72px; }
.page { width: 100%; max-width: var(--page); margin: 0 auto; padding-top: 40px; outline: none; }

.mobile-bar, .bottom-nav, .rail-backdrop { display: none; }

/* ---------------------------------------------------------------- headings */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head-text { min-width: 0; }
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(29px, 3.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-sub {
  margin-top: 8px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.page-actions { display: flex; align-items: center; gap: 10px; flex: none; padding-bottom: 2px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-head:first-child { margin-top: 0; }
.section-title { font-size: 18px; font-weight: 600; letter-spacing: -0.018em; }
.section-sub { margin-top: 3px; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  min-width: 0;
}
.card-flat { border-color: transparent; background: transparent; padding: 0; }
.card-tint { background: #f7f5ea; border-color: var(--brass-line); }
.card-sink { background: var(--card-2); }
.card-pad-lg { padding: 32px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-head > * { min-width: 0; }
.card-sink .card-head, .card-tint .card-head { border-bottom-color: rgba(179, 141, 80, .22); }
.card-title { font-size: 16.5px; font-weight: 600; letter-spacing: -0.015em; }
.card-sub { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr); align-items: start; }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.52fr); align-items: start; }
.span-2 { grid-column: span 2; }

/* ---------------------------------------------------------------- controls */

.btn {
  --btn-bg: var(--card);
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.006em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease),
    color .16s var(--ease);
}
.btn .icon { font-size: 17px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primary {
  --btn-bg: var(--pine);
  --btn-ink: #f7f3e6;
  --btn-line: var(--pine);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
}
.btn-primary:hover { --btn-bg: var(--pine-3); --btn-line: var(--pine-3); }
.btn-secondary { --btn-bg: var(--card); border-color: var(--line-strong); }
.btn-secondary:hover { --btn-bg: var(--card-2); border-color: var(--muted-2); }
.btn-soft { --btn-bg: var(--pine-soft); --btn-ink: #14382a; --btn-line: var(--pine-line); }
.btn-soft:hover { --btn-bg: #d5e2d4; }
.btn-ghost { --btn-bg: transparent; --btn-ink: var(--ink-soft); --btn-line: transparent; padding: 0 12px; }
.btn-ghost:hover { --btn-bg: rgba(27, 36, 30, .055); }
.btn-danger { --btn-bg: var(--oxblood-soft); --btn-ink: var(--oxblood); --btn-line: var(--oxblood-line); }
.btn-danger:hover { --btn-bg: #eed4ce; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pine-3);
  font-size: 13.5px;
  font-weight: 550;
  text-align: left;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brass); }
.link-btn.muted { color: var(--muted); }
.link-btn.danger { color: var(--oxblood); }
.link-btn .icon { font-size: 15px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 19px;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn:hover { background: var(--card-2); border-color: var(--line-strong); }

a.text-link { color: var(--pine-3); font-weight: 550; text-decoration: none; }
a.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .005em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.badge.no-dot::before { display: none; }
.badge-ok { background: var(--pine-soft); border-color: var(--pine-line); color: #1c4a35; }
.badge-warn { background: var(--brass-soft); border-color: var(--brass-line); color: var(--brass-ink); }
.badge-bad { background: var(--oxblood-soft); border-color: var(--oxblood-line); color: var(--oxblood); }
.badge-info { background: var(--tea-soft); border-color: #c9ddd8; color: var(--tea); }
.badge-accent { background: var(--pine); border-color: var(--pine); color: #f6f2e4; }
.badge-soft { background: var(--card-2); border-color: var(--line); color: var(--muted); }

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(280px, .82fr);
  align-items: stretch;
  border-radius: var(--r-xl);
  background: var(--pine-deep);
  color: #f2eee0;
  border: 1px solid #082019;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brass);
  transform-origin: left center;
  animation: brass-rule .8s var(--ease) both;
}
.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 34px 36px 32px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 4px 9px 4px 8px;
  border: 1px solid rgba(207, 166, 98, .42);
  border-radius: 4px;
  color: #dcc38f;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: .012em;
}
.hero-kicker .icon { font-size: 13px; }
.hero h2 {
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(27px, 3vw, 37px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  color: #f7f2e2;
  text-wrap: balance;
}
.hero p {
  max-width: 54ch;
  margin-top: 13px;
  color: #bac8ba;
  font-size: 14.5px;
  line-height: 1.6;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.hero .btn-primary {
  --btn-bg: var(--brass-bright);
  --btn-ink: #182a20;
  --btn-line: #d8b072;
  box-shadow: none;
}
.hero .btn-primary:hover { --btn-bg: #dcb877; --btn-line: #e3c087; }
.hero .btn-secondary {
  --btn-bg: transparent;
  --btn-ink: #ede8d8;
  --btn-line: rgba(237, 232, 216, .32);
}
.hero .btn-secondary:hover { --btn-bg: rgba(244, 239, 224, .08); --btn-line: rgba(237, 232, 216, .5); }
.hero .link-btn { color: #d9c79c; }

.hero-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 30px;
  border-left: 1px solid rgba(233, 225, 201, .2);
  background: rgba(9, 31, 23, .32);
}
.hero-date span { display: block; color: #bdae88; font-size: 12px; letter-spacing: .01em; }
.hero-date strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  color: #f6f1e1;
}
.hero-weekday { display: block; margin-top: 3px; color: #a6b4a6; font-size: 12.5px; }

.hero-facts { display: flex; flex-direction: column; margin-top: 2px; }
.hero-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid rgba(233, 225, 201, .15);
}
.hero-fact:first-child { border-top: 0; padding-top: 0; }
.hero-fact dt { color: #a9b8aa; font-size: 12.5px; }
.hero-fact dd {
  margin: 0;
  color: #f4efe0;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hero-meter { height: 4px; margin-top: 2px; background: rgba(244, 239, 224, .2); overflow: hidden; }
.hero-meter span { display: block; height: 100%; background: var(--brass-bright); transition: width .6s var(--ease); }
.hero-meter-label { display: flex; justify-content: space-between; margin-top: 6px; color: #a9b8aa; font-size: 11.5px; }

@keyframes brass-rule {
  from { transform: scaleX(0); opacity: .4; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ------------------------------------------------------------------ journey */

.journey { display: flex; flex-direction: column; }
.journey-item { position: relative; display: flex; gap: 15px; padding-bottom: 22px; }
.journey-item:last-child { padding-bottom: 0; }
.journey-item::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.journey-item:last-child::before { display: none; }
.journey-item.on::before { background: var(--brass-line); }
.journey-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: none;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 17px;
}
.journey-item.on .journey-node { background: var(--pine); border-color: var(--pine); color: #f2eedf; }
.journey-item.off .journey-node { background: var(--card-2); border-color: var(--line); color: var(--muted-2); }
.journey-body { min-width: 0; flex: 1; padding-top: 2px; }
.journey-top { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.journey-top strong { font-size: 14.5px; font-weight: 600; }
.journey-when {
  margin-left: auto;
  color: var(--brass-ink);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.journey-body p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.journey-body .sample {
  position: relative;
  margin-top: 9px;
  padding: 8px 12px 8px 14px;
  border-left: 2px solid var(--brass-line);
  border-radius: 0 4px 4px 0;
  background: var(--card-2);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ----------------------------------------------------------------- checklist */

.checklist { display: flex; flex-direction: column; }
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 8px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  transition: background .16s var(--ease);
}
.check-item:first-child { border-top: 0; }
.checklist > .check-item:first-child { padding-top: 2px; }
.check-item:hover { background: var(--card-2); }
.check-item:hover .check-chevron { color: var(--pine); transform: translateX(2px); }
.check-status {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 15px;
}
.check-item.done .check-status { background: var(--pine-soft); border-color: var(--pine-line); color: var(--pine); }
.check-item.blocked .check-status { background: var(--oxblood-soft); border-color: var(--oxblood-line); color: var(--oxblood); }
.check-item.outdated .check-status { background: var(--brass-soft); border-color: var(--brass-line); color: var(--brass-ink); }
.check-item.optional .check-status { background: var(--card-2); border-color: var(--line); color: var(--muted); }
.check-copy { min-width: 0; flex: 1; }
.check-copy strong { display: block; font-size: 13.5px; font-weight: 600; }
.check-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.check-chevron { color: var(--muted-2); font-size: 16px; flex: none; transition: transform .16s var(--ease), color .16s var(--ease); }

/* ------------------------------------------------------------------ arrivals */

.arrival-list { display: flex; flex-direction: column; }
.arrival {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.arrival:first-child { border-top: 0; padding-top: 0; }
.arrival:last-child { padding-bottom: 0; }
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--pine);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}
.arrival-main { min-width: 0; flex: 1; }
.arrival-main strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arrival-main > span:not(.badge) { display: block; margin-top: 1px; color: var(--muted); font-size: 12.5px; }
.arrival-main .badge { display: inline-flex; }
.arrival-main .badge { margin-top: 6px; }
.arrival-main .form-actions { margin-bottom: 0; }
.arrival-meta { text-align: right; flex: none; padding-top: 2px; }
.arrival-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.arrival-meta span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------- connections */

.connect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.connect-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.connect-card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 2px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.connect-card:hover { border-color: var(--line-strong); background: #fdfcf7; }
.connect-card:hover::before { transform: scaleX(1); }
.connect-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.connect-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 6px;
  border: 1px solid var(--pine-line);
  background: var(--pine-soft);
  color: var(--pine);
  font-size: 21px;
}
.connect-icon.blue { border-color: var(--pine-line); background: var(--pine-soft); color: var(--pine); }
.connect-icon.amber { border-color: var(--brass-line); background: var(--brass-soft); color: var(--brass-ink); }
.connect-icon.violet { border-color: var(--line); background: var(--card-2); color: var(--violet); }
.connect-icon.muted { border-color: var(--line); background: var(--card-2); color: var(--muted); }
.connect-text strong { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; }
.connect-text p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.connect-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.connect-arrow { color: var(--muted-2); font-size: 17px; transition: transform .18s var(--ease), color .18s var(--ease); }
.connect-card:hover .connect-arrow { transform: translateX(3px); color: var(--pine); }

.connect-wide {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.connect-wide:hover { border-color: var(--line-strong); background: #fdfcf7; }
.connect-wide .connect-text strong { font-size: 14.5px; }
.connect-wide .connect-text p { margin-top: 3px; }
.connect-wide .connect-arrow { margin-left: 2px; }

/* ------------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.field .error { color: var(--oxblood); font-size: 12px; }

input[type="text"], input[type="password"], input[type="tel"], input[type="url"],
input[type="number"], input[type="time"], input[type="email"], input[type="search"],
select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px;
  transition: background .16s var(--ease), border-color .16s var(--ease),
    box-shadow .16s var(--ease);
  appearance: none;
}
input[type="date"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
input[type="date"]:hover { border-color: var(--line-strong); }
input[type="date"]:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: var(--ring);
}
textarea { min-height: 132px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: var(--card);
  border-color: var(--brass);
  box-shadow: var(--ring);
}
input:disabled, select:disabled, textarea:disabled { opacity: .6; background: var(--card-2); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237a5a22' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px;
}
input[type="time"] { padding-right: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.form-error {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-left: 3px solid var(--oxblood);
  border-radius: 0 4px 4px 0;
  background: var(--oxblood-soft);
  color: var(--oxblood);
  font-size: 13px;
}

.input-with-action { position: relative; }
.input-with-action input { padding-right: 50px; }
.input-with-action .icon-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}
.switch-row:first-child { padding-top: 0; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-copy { min-width: 0; }
.switch-copy strong { display: block; font-size: 13.5px; font-weight: 600; }
.switch-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--paper-deep);
  padding: 0;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(20, 32, 24, .25);
  transition: transform .2s var(--ease);
}
.switch[aria-checked="true"] { background: var(--pine); border-color: var(--pine); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: #f6f2e4; }

/* ----------------------------------------------------------------- choices */

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice {
  position: relative;
  display: flex;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  text-align: left;
  color: var(--ink);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.choice:hover { border-color: var(--line-strong); background: #fdfcf7; }
.choice.selected { border-color: var(--pine); background: var(--pine-soft); box-shadow: inset 0 0 0 1px var(--pine); }
.choice-radio {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
}
.choice.selected .choice-radio { border-color: var(--pine); background: var(--pine); }
.choice-radio::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f6f2e4; opacity: 0; }
.choice.selected .choice-radio::after { opacity: 1; }
.choice-body { min-width: 0; }
.choice-body strong { display: block; font-size: 13.5px; font-weight: 600; }
.choice-body p { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.choice .badge { margin-top: 8px; }
.choice.disabled { opacity: .55; pointer-events: none; }

/* -------------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brass); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12.5px;
}
.chip:hover { border-color: var(--pine); color: var(--pine); }
.chip-static { background: var(--card-2); border-color: transparent; color: var(--muted); }

.segmented { display: inline-flex; padding: 3px; border-radius: var(--r-sm); background: var(--paper-deep); gap: 2px; }
.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
}
.segmented button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 32, 24, .12); }

/* ----------------------------------------------------------------- stepper */

.stepper { display: flex; flex-direction: column; gap: 12px; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
}
.step[data-open="true"] { border-color: var(--brass-line); }
.step-head {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 17px 19px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
}
.step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step.done .step-num { background: var(--pine-soft); border-color: var(--pine-line); color: var(--pine); }
.step.current .step-num { background: var(--pine); border-color: var(--pine); color: #f6f2e4; }
.step-copy { flex: 1; min-width: 0; }
.step-copy strong { display: block; font-size: 14px; font-weight: 600; }
.step-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.step-toggle { color: var(--muted-2); font-size: 17px; transition: transform .2s var(--ease); }
.step[data-open="true"] .step-toggle { transform: rotate(180deg); }
.step-body { padding: 0 19px 22px 60px; }
.step-body > :first-child { margin-top: 2px; }

/* -------------------------------------------------------------- code + qr */

.code-panel { text-align: center; padding: 6px 0 2px; }
.code-title { color: var(--muted); font-size: 12.5px; }
.code-cells { display: flex; justify-content: center; gap: 6px; margin: 15px 0 6px; flex-wrap: wrap; }
.code-cell {
  display: grid;
  place-items: center;
  width: clamp(38px, 6vw, 50px);
  height: clamp(48px, 8vw, 60px);
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--brass-line);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.code-actions { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; margin-top: 15px; }
.code-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.code-note .icon { font-size: 14px; }
.code-timer { color: var(--brass-ink); font-variant-numeric: tabular-nums; }

.steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.steps-list li {
  position: relative;
  counter-increment: s;
  padding-left: 36px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.steps-list li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--brass-line);
  background: var(--brass-soft);
  color: var(--brass-ink);
  font-size: 11.5px;
  font-weight: 700;
}
.steps-list li strong { font-weight: 600; }

.qr-frame {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line);
  width: fit-content;
  margin: 0 auto;
}
.qr-frame img { width: 220px; height: 220px; border-radius: 4px; background: #fff; object-fit: contain; }
.qr-frame .qr-empty {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* ----------------------------------------------------------------- notices */

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted-2);
  border-radius: 0 6px 6px 0;
  background: var(--card-2);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}
.notice .icon { font-size: 18px; color: var(--muted); flex: none; margin-top: 1px; }
.notice strong { display: block; margin-bottom: 2px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.notice p { color: inherit; }
.notice-info { border-left-color: var(--tea); background: var(--tea-soft); border-color: #d4e3df; }
.notice-info .icon { color: var(--tea); }
.notice-success { border-left-color: var(--pine); background: var(--pine-soft); border-color: var(--pine-line); }
.notice-success .icon { color: var(--pine); }
.notice-warn { border-left-color: var(--brass); background: var(--brass-soft); border-color: var(--brass-line); }
.notice-warn .icon { color: var(--brass-ink); }
.notice-danger { border-left-color: var(--oxblood); background: var(--oxblood-soft); border-color: var(--oxblood-line); }
.notice-danger .icon { color: var(--oxblood); }
.notice .link-btn { margin-top: 6px; }

/* ------------------------------------------------------------------ details */

details.accordion { border-top: 1px solid var(--line); padding: 12px 0; }
details.accordion:last-child { border-bottom: 1px solid var(--line); }
details.accordion > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 550;
}
details.accordion > summary::-webkit-details-marker { display: none; }
details.accordion > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s var(--ease);
}
details.accordion[open] > summary::after { transform: rotate(225deg); }
details.accordion > summary .icon { font-size: 17px; color: var(--muted); }
details.accordion .acc-body { padding: 12px 0 2px 26px; color: var(--muted); font-size: 13px; line-height: 1.55; }
details.accordion .acc-body p + p { margin-top: 8px; }
details.accordion .acc-body strong { color: var(--ink-soft); }

.details { border-top: 1px solid var(--line); margin-top: 12px; }
.details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
}
.details > summary::-webkit-details-marker { display: none; }
.details > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
.details[open] > summary::after { transform: rotate(225deg); }
.details .details-body { padding: 2px 0 6px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.details .details-body .kv { margin-top: 4px; }

/* --------------------------------------------------------------- messages */

.message-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
}
.message-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  transition: background .16s var(--ease);
}
.message-card:first-child { border-top: 0; }
.message-card:hover { background: var(--card-2); }
.message-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 17px;
}
.message-card.custom .message-icon { border-color: var(--brass-line); background: var(--brass-soft); color: var(--brass-ink); }
.message-copy { min-width: 0; flex: 1; }
.message-copy strong { display: block; font-size: 13.5px; font-weight: 600; }
.message-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.message-side { display: flex; align-items: center; gap: 7px; flex: none; }
.message-side .icon { color: var(--muted-2); font-size: 16px; }

.message-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass-line);
  border-radius: 0 6px 6px 0;
  background: var(--card-2);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.placeholder-list { display: flex; flex-wrap: wrap; gap: 5px; }
.placeholder {
  min-height: 26px;
  padding: 2px 9px;
  border: 1px dashed var(--brass-line);
  border-radius: 4px;
  background: var(--brass-soft);
  color: var(--brass-ink);
  font-size: 11.5px;
  font-weight: 600;
}
.placeholder:hover { border-style: solid; }

/* -------------------------------------------------------------------- chat */

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-bottom: 0;
}
.chat-head .avatar { background: var(--card); border-color: var(--line); }
.chat-head strong { display: block; font-size: 13.5px; font-weight: 600; }
.chat-head span { display: block; color: var(--muted); font-size: 11.5px; }
.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: #f8f7ef;
}
.chat-day { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 11.5px; font-weight: 550; }
.chat-day::before, .chat-day::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.chat-row { display: flex; gap: 9px; max-width: 86%; }
.chat-row.admin { align-self: flex-end; flex-direction: row-reverse; }
.chat-row.system { align-self: center; max-width: 100%; }
.chat-avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 14px;
}
.chat-row.admin .chat-avatar { background: var(--pine); border-color: var(--pine); color: #f4efe0; }
.chat-body { min-width: 0; }
.bubble {
  padding: 10px 13px;
  border-radius: 4px 10px 10px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-row.admin .bubble { border-radius: 10px 4px 10px 10px; background: var(--pine); border-color: var(--pine); color: #f3efe1; }
.chat-when { margin-top: 4px; color: var(--muted-2); font-size: 10.5px; }
.chat-row.admin .chat-when { text-align: right; }
.chat-system {
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}
.chat-empty { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.chat-photo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 4px 9px;
  border-radius: 4px;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ results */

.result-list { display: flex; flex-direction: column; }
.result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.result:first-child { border-top: 0; padding-top: 0; }
.result:last-child { padding-bottom: 0; }
.result-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  margin-top: 1px;
  border-radius: 4px;
  border: 1px solid var(--pine-line);
  background: var(--pine-soft);
  color: var(--pine);
  font-size: 14px;
}
.result.bad .result-icon { border-color: var(--oxblood-line); background: var(--oxblood-soft); color: var(--oxblood); }
.result.warn .result-icon { border-color: var(--brass-line); background: var(--brass-soft); color: var(--brass-ink); }
.result.muted .result-icon { border-color: var(--line); background: var(--card-2); color: var(--muted); }
.result-copy { min-width: 0; flex: 1; }
.result-copy strong { display: block; font-size: 13.5px; font-weight: 600; }
.result-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.result .badge { margin-left: auto; flex: none; }

.verdict { display: flex; align-items: center; gap: 16px; }
.verdict-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 6px;
  border: 1px solid var(--pine-line);
  background: var(--pine-soft);
  color: var(--pine);
  font-size: 26px;
}
.verdict.warn .verdict-icon { border-color: var(--brass-line); background: var(--brass-soft); color: var(--brass-ink); }
.verdict.bad .verdict-icon { border-color: var(--oxblood-line); background: var(--oxblood-soft); color: var(--oxblood); }
.verdict h3 { font-size: 19px; letter-spacing: -0.02em; }
.verdict p { margin-top: 3px; color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------------- kv */

.kv { display: flex; flex-direction: column; gap: 0; }
.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.kv-row:first-child { border-top: 0; padding-top: 2px; }
.kv-key { color: var(--muted); font-size: 12.5px; flex: none; }
.kv-val { text-align: right; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.kv-val.mono { font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.stat strong {
  display: block;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }

/* ------------------------------------------------------------------- empty */

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 20px; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted-2);
  font-size: 23px;
}
.empty strong { font-size: 14px; font-weight: 600; }
.empty p { max-width: 38ch; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty .btn { margin-top: 14px; }

/* ------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(11, 28, 21, .55);
  backdrop-filter: blur(3px);
  animation: fade .18s var(--ease);
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  animation: rise .22s var(--ease);
}
.modal.modal-wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-title { min-width: 0; flex: 1; }
.modal-title h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.008em;
}
.modal-title p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.modal-close { flex: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.995); } }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(244, 239, 224, .15);
  background: var(--pine-deep);
  color: #f4efe0;
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  animation: toast-in .24s var(--ease);
}
.toast.bad { background: var(--oxblood); border-color: #6f2b23; }
.toast.ok { background: var(--pine-3); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* -------------------------------------------------------------------- gate */

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--pine-deep);
  overflow-y: auto;
}
.gate::before {
  content: "";
  position: fixed;
  inset: 16px;
  border: 1px solid rgba(207, 166, 98, .22);
  pointer-events: none;
}
.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 424px;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .7);
}
.gate-head { text-align: center; margin-bottom: 24px; }
.gate-head .brand-mark { margin: 0 auto 16px; background: var(--card); border-color: var(--brass); box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px rgba(179, 141, 80, .38); }
.gate-kicker { color: var(--brass-ink); font-size: 12px; font-weight: 500; letter-spacing: .015em; }
.gate-head h1 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.01em;
}
.gate-sub { margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.gate-card .field + .field { margin-top: 12px; }
.gate-card .btn { margin-top: 18px; }
.gate-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11.5px; text-align: center; }
.gate-card .link-btn { display: block; margin: 13px auto 0; }
.gate-setup { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.gate-setup .gate-sub { margin-bottom: 12px; }
.gate-setup .btn { margin-top: 13px; }

/* -------------------------------------------------------------------- boot */

.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--pine-deep);
  color: #a9b8aa;
}
.boot .brand-mark { background: #f4efe0; }
.boot-text { font-size: 13px; letter-spacing: .01em; }
.boot-bar { width: 128px; height: 3px; background: rgba(244, 239, 224, .14); overflow: hidden; }
.boot-bar span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--brass-bright);
  animation: boot 1.1s ease-in-out infinite;
}
@keyframes boot { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }

.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--card-2) 25%, #f8f7ef 40%, var(--card-2) 55%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skeleton-hero { height: 220px; margin-bottom: 18px; }
.skeleton-row { height: 76px; margin-bottom: 9px; }

.danger-card { border-color: var(--oxblood-line); background: #fdf7f4; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1120px) {
  :root { --rail: 238px; }
  .page { padding-top: 32px; }
  .hero { grid-template-columns: minmax(0, 1.5fr) minmax(248px, .85fr); }
  .hero-copy { padding: 30px 28px 28px; }
  .hero-side { padding: 24px 24px; }
  .hero-date strong { font-size: 27px; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(300px, 86vw);
    height: 100%;
    padding: 24px 16px;
    border-right: 1px solid #071b13;
    transform: translateX(-104%);
    transition: transform .26s var(--ease);
    box-shadow: 0 0 60px rgba(0, 0, 0, .45);
  }
  body.rail-open .rail { transform: translateX(0); }
  .rail > .rail-close {
    display: grid;
    position: absolute;
    top: 24px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-color: transparent;
    background: rgba(244, 239, 224, .08);
    color: #e9e4d4;
  }
  .rail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgba(9, 26, 19, .5);
    backdrop-filter: blur(2px);
    animation: fade .2s var(--ease);
  }
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 calc(-1 * clamp(24px, 4.2vw, 64px));
    padding: 10px clamp(24px, 4.2vw, 64px);
    background: rgba(241, 240, 231, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .brand-mobile { padding: 0; gap: 9px; }
  .brand-mobile .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    font-size: 17px;
    background: var(--pine);
    border-color: var(--pine);
    color: #f4efe0;
    box-shadow: none;
  }
  .brand-mobile strong { font-size: 14px; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .page { padding-top: 24px; }
  .bottom-nav {
    position: fixed;
    z-index: 45;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px;
    border-radius: 9px;
    background: rgba(252, 251, 245, .95);
    border: 1px solid var(--line);
    box-shadow: 0 6px 24px -12px rgba(18, 33, 25, .45);
    backdrop-filter: blur(16px);
  }
  .bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
    padding: 6px 8px;
    border-radius: 5px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 550;
  }
  .bottom-link .icon { font-size: 19px; }
  .bottom-link[aria-current="page"] { background: var(--pine-soft); color: var(--pine); }
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}

@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .page-actions { width: 100%; }
  .page-actions .btn-primary { flex: 1; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding: 26px 22px 22px; }
  .hero-side {
    border-left: 0;
    border-top: 1px solid rgba(233, 225, 201, .2);
    padding: 20px 22px 22px;
  }
  .hero h2 { font-size: 28px; }
  .hero-date strong { font-size: 26px; }
  .hero-facts { flex-direction: row; flex-wrap: wrap; gap: 0 22px; }
  .hero-fact { flex: 1 1 128px; border-top: 1px solid rgba(233, 225, 201, .15); }
  .hero-fact:first-child { border-top: 1px solid rgba(233, 225, 201, .15); padding-top: 9px; }
  .grid-2, .grid-3, .connect-grid, .choice-grid, .form-grid, .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .card { padding: 20px; border-radius: var(--r-md); }
  .card-pad-lg { padding: 22px; }
  .step-body { padding: 0 17px 19px 17px; }
  .step-head { padding: 15px 16px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot .btn { flex: 1; }
  .code-cells { gap: 5px; }
  .code-cell { width: 38px; height: 48px; font-size: 19px; }
  .chat-row { max-width: 94%; }
  .message-card { align-items: flex-start; gap: 10px; padding: 12px 13px; }
  .message-copy p { -webkit-line-clamp: 2; }
  .message-side { flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 96px; }
  .message-side .badge { min-height: 22px; padding: 1px 7px; font-size: 10.5px; }
  .message-side > .icon { display: none; }
  .qr-frame img, .qr-frame .qr-empty { width: 184px; height: 184px; }
  .arrival-main .form-actions .btn { width: 100%; }
}

@media (max-width: 980px) {
  body.rail-open { overflow: hidden; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .main { padding-left: 16px; padding-right: 16px; }
  .mobile-bar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .page-title { font-size: 27px; }
  .hero h2 { font-size: 25px; }
  .hero-copy { padding: 22px 18px 20px; }
  .hero-side { padding: 18px; }
  .card { padding: 17px; }
  .bottom-link { min-width: 54px; padding: 6px 5px; }
  .bottom-link span { font-size: 9.5px; }
  .btn { padding: 0 14px; }
  .kv-row { gap: 10px; }
  .arrival-meta strong { font-size: 12.5px; }
  .journey-when { margin-left: 0; width: 100%; text-align: left; }
}

@media (max-width: 600px) {
  .verdict { flex-wrap: wrap; align-items: flex-start; }
  .verdict .grow { flex: 1 1 190px; }
  .verdict > .badge { margin-left: 0; }
  .verdict-icon { width: 46px; height: 46px; font-size: 23px; }
  .code-note { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 560px) {
  .connect-wide { flex-wrap: wrap; gap: 11px; padding: 16px; }
  .connect-wide .connect-arrow { display: none; }
}

/* ------------------------------------------------------- motion / spinner */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-busy { opacity: .85; pointer-events: none; }

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

/* ------------------------------------------------------------- bookings page */

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-row input[type="search"] { flex: 1; min-width: 0; }
.booking-detail {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.booking-detail .kv-row { padding: 6px 0; }
.booking-detail .kv-key { font-size: 12px; }
.booking-detail .kv-val { font-size: 12.5px; }

@media (max-width: 720px) {
  .form-row { flex-wrap: wrap; }
  .form-row .btn { width: 100%; }
}

/* --------------------------------------------------------------- rooms page */

.room-list { display: flex; flex-direction: column; }
.room-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.room-item:first-child { border-top: 0; padding-top: 4px; }
.room-main { flex: 1; min-width: 0; }
.room-main strong { display: block; font-size: 15px; font-weight: 600; }
.room-main > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.room-video {
  width: 260px;
  max-width: 42vw;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #000;
}
.room-video-empty {
  width: 200px;
  min-height: 92px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
  padding: 10px;
}
.room-video-empty .icon { font-size: 22px; }

.room-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.room-photo {
  position: relative;
  width: 76px;
  height: 76px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--paper-2, #f6f3ec);
}
.room-photo a { display: block; width: 100%; height: 100%; }
.room-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 26, 22, 0.72);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.room-photo-remove .icon { font-size: 12px; }
.room-photo-remove svg { width: 12px; height: 12px; }
.room-photos-empty {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--muted-2);
  font-size: 12px;
}

.room-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.room-media-item {
  position: relative;
  width: 124px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--paper-2, #f6f3ec);
}
.room-media-thumb {
  display: block;
  width: 100%;
  height: 82px;
  object-fit: cover;
  background: #000;
}
.room-media-kind {
  display: block;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.room-media-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 26, 22, 0.72);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.room-media-remove .icon { font-size: 12px; }
.room-media-remove svg { width: 12px; height: 12px; }
.room-media-empty {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--muted-2);
  font-size: 12px;
}

@media (max-width: 720px) {
  .room-item { flex-direction: column; }
  .room-video, .room-video-empty { width: 100%; max-width: 100%; }
  .room-photo { width: 68px; height: 68px; }
}

@media (max-width: 520px) {
  .bottom-nav { width: calc(100% - 20px); justify-content: space-between; }
  .bottom-link { min-width: 0; flex: 1; padding-left: 2px; padding-right: 2px; }
}
