/* =========================================================
   staff.css — staff sign-in page and admin dashboard
   Brand colours match base.css
   ========================================================= */
:root {
  --altai-forest: #1B5E3B;
  --steppe-green: #8CBF7A;
  --sand-gold: #D9A96C;
  --charcoal: #1F2323;
  --ivory: #F7F7F2;
  --line: #DEDFD8;
  --muted: #5F6563;
  --danger: #B3261E;
  --warn-bg: #FFF4E0;
  --radius: 8px;
  --font-brand: "Montserrat", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--ivory);
}

h1 { font-size: 1.5rem; color: var(--altai-forest); letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; color: var(--altai-forest); }
h3 { font-size: 1rem; }
code { font-size: 0.85em; background: #ECEDE6; padding: 1px 4px; border-radius: 4px; }

/* ---------- Buttons, forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--charcoal);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--altai-forest); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--altai-forest); border-color: var(--altai-forest); color: #fff; }
.btn-primary:hover { background: #154a2f; }
.btn-danger { color: var(--danger); border-color: #E8C4C1; }
.btn-small { min-height: 32px; padding: 4px 10px; font-size: 0.85rem; }
.btn-link { background: none; border: 0; color: var(--altai-forest); font: inherit; text-decoration: underline; cursor: pointer; padding: 4px 0; }

label { display: grid; gap: 4px; font-weight: 600; font-size: 0.875rem; }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 400; background: #fff; color: var(--charcoal);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--steppe-green); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: 18px; min-height: 18px; }

form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 12px 14px; border: 1px solid #dfe2da; border-radius: 10px; }
fieldset.checks legend { padding: 0 6px; font-weight: 600; }
fieldset.checks label.check { font-weight: 400; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.form-message { min-height: 1.5em; font-size: 0.875rem; }
.form-message[data-kind="error"] { color: var(--danger); }
.form-message[data-kind="info"] { color: var(--altai-forest); }

.notice { padding: 10px 12px; border-radius: var(--radius); font-size: 0.875rem; }
.notice-warn { background: var(--warn-bg); border: 1px solid #F0D2A0; }
.notice-info { background: #EAF3E6; border: 1px solid #CBE0C2; }

/* ---------- Sign-in page ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--altai-forest); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 12px; padding: 32px 28px; display: grid; gap: 18px; }
.login-logo { height: 56px; width: auto; justify-self: start; }
.join-intro { color: var(--muted); }
.join-intro strong { color: var(--altai-forest); }
.login-card input[readonly] { background: var(--ivory); color: var(--muted); }
.login-card { width: min(440px, 100%); }
.login-head { display: grid; gap: 2px; }
.login-page[data-portal="admin"] { background: #18251E; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--ivory); border: 1px solid var(--line); border-radius: 10px; }
.auth-tab { min-height: 38px; border: 0; border-radius: 7px; background: none; font: inherit; font-weight: 600; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.auth-tab.is-active { background: #fff; color: var(--altai-forest); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.role-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.role-pick legend { font-weight: 600; font-size: 0.875rem; margin-bottom: 8px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.role-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; cursor: pointer; font-weight: 600; font-size: 0.88rem; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card .ic { width: 26px; height: 26px; color: var(--altai-forest); }
.role-card small { font-weight: 400; font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.role-card:has(input:checked) { border-color: var(--altai-forest); background: #EEF5EA; box-shadow: inset 0 0 0 1px var(--altai-forest); }
.role-card:has(input:focus-visible) { outline: 2px solid var(--steppe-green); outline-offset: 1px; }
.phone-field { display: grid; gap: 4px; }
.field-label { font-weight: 600; font-size: 0.875rem; }
.phone-row { display: grid; grid-template-columns: minmax(118px, auto) minmax(0, 1fr); gap: 8px; }
.signup-form [aria-invalid="true"], #signup-form [aria-invalid="true"] { border-color: var(--danger); }
.pending-box { display: grid; gap: 10px; padding: 16px; border-radius: 10px; background: var(--warn-bg); border: 1px solid #F0D2A0; }
.pending-title { font-weight: 700; color: var(--charcoal); }

/* ---------- Workspace layout: sidebar + top bar ---------- */
.workspace-page { --side-w: 248px; background: #F6F7F3; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--side-w);
  display: flex; flex-direction: column; gap: 8px; padding: 22px 16px 16px;
  background: #fff; border-right: 1px solid var(--line); overflow-y: auto;
}
.side-brand { display: grid; gap: 6px; padding: 0 10px 14px; }
.side-brand img { height: 38px; width: auto; justify-self: start; }
.side-brand span { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.side-nav { display: grid; gap: 16px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { padding: 0 12px 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #8A8F8B; }
.side-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 8px 12px;
  border: 0; border-radius: 10px; background: none; color: var(--charcoal);
  font: inherit; font-size: 0.92rem; font-weight: 500; text-align: left; cursor: pointer;
}
.side-nav button .ic { color: #4A504D; }
.side-nav button:hover { background: #F1F3EE; }
.side-nav button.is-active { background: var(--altai-forest); color: #fff; font-weight: 600; }
.side-nav button.is-active .ic { color: #fff; }
.nav-count {
  margin-left: auto; min-width: 26px; padding: 1px 8px; border-radius: 999px;
  background: #F4D9A6; color: #6B4508; font-size: 0.75rem; font-weight: 700; text-align: center;
}
.side-nav button.is-active .nav-count { background: #fff; color: var(--altai-forest); }
/* Pages of the open sidebar section, as tabs above the page */
.hub-tabs { width: min(1320px, 100%); margin: 0 auto; padding: 10px 28px 0; border-bottom: 1px solid var(--line); }
.hub-tabs[hidden] { display: none; }
.hub-tabs button:not(.in-group) { display: none; }
.hub-tabs button .ic { width: 18px; height: 18px; }
.hub-tabs button .nav-count, .hub-tabs button.is-active .nav-count { margin-left: 0; background: #F4D9A6; color: #6B4508; font-weight: 700; }
.hub-tabs button b[hidden] { display: none; }
.side-foot { margin-top: auto; display: grid; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-link { display: flex; align-items: center; gap: 10px; padding: 4px 12px; color: var(--charcoal); font-size: 0.85rem; font-weight: 500; text-decoration: none; }
.side-link .ic { width: 18px; height: 18px; }
.side-link:hover { color: var(--altai-forest); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0 8px; }
.side-user-text { display: grid; min-width: 0; font-size: 0.85rem; line-height: 1.3; }
.side-user-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text span { color: var(--muted); font-size: 0.75rem; }
.side-user .icon-btn { margin-left: auto; }
.avatar {
  flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--altai-forest), #3E8A5C); color: #fff; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
}
.side-backdrop { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; padding: 0;
  border: 0; border-radius: 9px; background: none; color: #4A504D; cursor: pointer; list-style: none; text-decoration: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: #EEF0EA; color: var(--altai-forest); }

.workspace { margin-left: var(--side-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.crumbs .ic { width: 18px; height: 18px; }
.crumbs strong { color: var(--charcoal); font-weight: 600; }
.crumb-sep { color: #B5B9B3; }
.top-search {
  display: flex; align-items: center; gap: 10px; margin-left: auto; width: min(360px, 32vw); height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #F7F8F4; color: var(--muted); font-weight: 400;
}
.top-search input { border: 0; min-height: 0; padding: 0; background: none; outline: none; }
.top-search:focus-within { border-color: var(--steppe-green); background: #fff; }
.bell { position: relative; }
.bell i { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #E39A2D; border: 2px solid #fff; }
.top-user {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 0; border-left: 1px solid var(--line);
  background: none; font: inherit; text-align: left; cursor: pointer; padding-left: 16px;
}
.top-user .avatar { flex-basis: 36px; width: 36px; height: 36px; }
.top-user-text { display: grid; line-height: 1.25; font-size: 0.88rem; }
.top-user-text span { color: var(--muted); font-size: 0.75rem; }

main.panel { width: min(1320px, 100%); margin: 0 auto; padding: 28px 28px 64px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 2rem; color: var(--charcoal); line-height: 1.15; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-actions select, .page-actions input[type="search"] { width: auto; min-width: 200px; }
.page-head .btn { min-height: 44px; padding: 8px 18px; border-radius: 10px; }
.btn .ic { width: 18px; height: 18px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card h2 { font-size: 1.05rem; color: var(--charcoal); }
.card-head .btn-link { text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.table-card { padding: 0; overflow: hidden; }
.table-card > div:not(.table-toolbar):not(.card-head):not(.table-foot) { overflow-x: auto; }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.account-grid h2 { margin-bottom: 14px; }

/* Stat cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi {
  display: flex; align-items: center; gap: 16px; padding: 20px; min-height: 96px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; font: inherit; text-align: left; color: inherit;
}
button.kpi { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
button.kpi:hover { border-color: #B9CDB0; box-shadow: 0 6px 20px rgba(27, 94, 59, 0.08); }
.kpi-icon { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #EDF3EA; color: var(--altai-forest); }
.kpi-icon .ic { width: 24px; height: 24px; }
.kpi-icon.good { background: #E3F1DD; }
.kpi-icon.warn { background: #FCEFD8; color: #B26B0E; }
.kpi-text { display: grid; gap: 2px; }
.kpi-text span { font-size: 0.85rem; color: var(--muted); }
.kpi-text strong { font-size: 1.75rem; line-height: 1.1; }
.kpi-go { margin-left: auto; color: #8A8F8B; width: 18px; height: 18px; }

/* Toolbar above a table: tabs left, search/filters right */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 20px 0; border-bottom: 1px solid var(--line); }
.line-tabs { display: flex; gap: 6px; overflow-x: auto; }
.line-tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 12px 14px; border: 0; border-bottom: 3px solid transparent;
  background: none; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.line-tabs button b { padding: 0 8px; border-radius: 999px; background: #EEF0EA; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.line-tabs button.is-active { color: var(--charcoal); font-weight: 600; border-bottom-color: var(--altai-forest); }
.line-tabs button.is-active b { background: #E3F1DD; color: var(--altai-forest); }
.toolbar-right { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; flex-wrap: wrap; }
.toolbar-right select { width: auto; min-width: 150px; }
.field-search { display: flex; align-items: center; gap: 8px; width: 260px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 400; color: var(--muted); }
.field-search input { border: 0; min-height: 0; padding: 0; outline: none; }
.field-search:focus-within { outline: 2px solid var(--steppe-green); outline-offset: 1px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.view-toggle button { width: 42px; height: 40px; display: grid; place-items: center; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--altai-forest); color: #fff; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.table-foot:empty { display: none; }
.pager { display: flex; gap: 6px; }
.pager button { min-width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.pager button.is-active { background: var(--altai-forest); border-color: var(--altai-forest); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; color: var(--muted); }
.foot-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.foot-tools select { width: auto; min-height: 36px; padding: 0 30px 0 10px; font-size: 0.88rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #ECEDE8; vertical-align: middle; }
th { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #FAFAF7; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:hover { background: #FAFBF8; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
.th-right { display: block; text-align: right; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 0.82rem; }
.price { font-size: 1rem; color: var(--altai-forest); }
.date-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.date-cell .ic { width: 17px; height: 17px; color: var(--muted); }

.badge, .pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: #ECEDE6; color: #4A504D; white-space: nowrap;
}
.pill { padding: 5px 12px; font-size: 0.82rem; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.pill:has(.ic)::before { display: none; }
.pill .ic { width: 16px; height: 16px; }
.badge.good, .pill.good { background: #E3F1DD; color: #24572F; }
.badge.warn, .pill.warn { background: #FCEFD3; color: #8A5509; }
.badge.bad, .pill.bad { background: #F7E1DF; color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .pill::before { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: #E9F1E5; font-size: 0.8rem; font-weight: 600; }
.chip button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.chip button:hover { background: #D5E5CE; color: var(--danger); }

/* ---------- Dialogs ---------- */
dialog {
  width: min(720px, 100% - 24px); max-height: calc(100vh - 32px);
  margin: auto; border: 0; border-radius: 12px; padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
dialog::backdrop { background: rgba(31, 35, 35, 0.5); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dialog-head button { border: 0; background: none; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 4px 8px; }
.dialog-body { padding: 20px; display: grid; gap: 16px; }
.cover-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: var(--radius); }

.traveler { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 4px; font-size: 0.875rem; }
.traveler dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; }
.traveler dt { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--charcoal); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; z-index: 100;
}
.toast[data-kind="error"] { background: var(--danger); }

/* ---------- Tours list ---------- */
.tour-cell { display: flex; align-items: center; gap: 16px; min-width: 260px; }
.tour-cell strong { font-size: 0.98rem; }
.tour-thumb { flex: 0 0 96px; height: 56px; border-radius: 8px; overflow: hidden; background: #ECEDE6; }
.tour-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Toggle switch (checkbox) */
input.switch {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 42px; min-height: 0; height: 24px; padding: 0; border: 0; border-radius: 999px;
  background: #CFD3CA; position: relative; cursor: pointer; transition: background 0.2s;
}
input.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
input.switch:checked { background: var(--altai-forest); }
input.switch:checked::after { transform: translateX(18px); }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.switch-inline .on { color: var(--altai-forest); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row > span { display: grid; gap: 2px; }

/* ---------- Tour editor (full screen) ---------- */
dialog.editor {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; overflow: hidden; border-radius: 0; background: #F4F5F0; box-shadow: none;
  /* clip: the dialog itself can never be scrolled (a focused hidden input once pushed the page out of view) */
  overflow: clip;
}
.editor-shell {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh; height: 100dvh; gap: 0;
}
.hint { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.req { color: var(--danger); font-weight: 600; }

.editor-side {
  grid-row: 1 / 3; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto;
}
.editor-brand img { height: 40px; width: auto; margin: 0 8px 6px; }
.editor-steps { display: grid; gap: 4px; }
.editor-steps a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--charcoal); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.editor-steps a:hover { background: #F2F4EF; }
.editor-steps a.is-active { background: #E6F0E1; color: var(--altai-forest); }
.editor-steps svg { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.step-num {
  flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: #EEF0EA; color: var(--muted); font-size: 0.75rem; font-weight: 700;
}
.editor-steps a.is-active .step-num { background: #fff; color: var(--altai-forest); }
.editor-steps a.is-done .step-num { background: var(--altai-forest); color: #fff; }
.editor-progress { margin-top: auto; padding: 0 8px; display: grid; gap: 8px; font-size: 0.85rem; font-weight: 600; }
.progress-bar { height: 8px; border-radius: 999px; background: #E6E8E1; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--altai-forest); border-radius: inherit; transition: width 0.3s; }

.editor-main { overflow-y: auto; padding: 0 28px 40px; scroll-padding-top: 76px; }
.editor-top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  margin: 0 -28px; padding: 12px 28px; background: rgba(244, 245, 240, 0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--muted);
}
.editor-top .crumb, .post-top .crumb { border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; padding: 4px 0; }
.editor-top .crumb:hover, .post-top .crumb:hover { color: var(--altai-forest); }
.crumb-sep { color: #B5B9B1; }
#editor-crumb { color: var(--altai-forest); font-weight: 600; }
.status-pill { margin-left: auto; padding: 4px 12px; border-radius: 999px; background: #E9EAE4; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.status-pill::before { content: "● "; color: #9BA09A; }
.status-pill.is-live { background: #E3F1DD; color: #24572F; }
.status-pill.is-live::before { color: var(--steppe-green); }
.icon-btn { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 2px 8px; color: var(--charcoal); }

.editor-title { padding: 22px 0 18px; }
.editor-title h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); color: var(--charcoal); }
.editor-title p { color: var(--muted); font-weight: 600; margin-top: 2px; }

.editor-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.editor-content, .editor-aside { display: grid; gap: 16px; }
.editor-aside { position: sticky; top: 72px; }

.ed-card {
  background: #fff; border: 1px solid #E3E5DE; border-radius: 14px; padding: 20px;
  display: grid; gap: 16px; scroll-margin-top: 76px;
}
.ed-head { display: flex; gap: 12px; align-items: flex-start; }
.ed-head h2 { font-size: 1.08rem; }
.ed-head p { font-size: 0.85rem; color: var(--muted); }
.ed-icon {
  flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  background: #E6F0E1; color: var(--altai-forest); font-size: 0.78rem; font-weight: 700;
}
.ed-more summary { cursor: pointer; font-weight: 600; color: var(--altai-forest); padding: 8px 0; }
.ed-more[open] summary { margin-bottom: 10px; }
.count { justify-self: end; }
.editor-h3 { margin-top: 4px; }
.btn-add { justify-self: start; border-style: dashed; color: var(--altai-forest); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }

/* Category chips */
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-checks label {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; background: #fff;
}
.chip-checks label.is-on { background: #E6F0E1; border-color: #C3DBB7; color: var(--altai-forest); }
.chip-checks input { width: 16px; min-height: 16px; accent-color: var(--altai-forest); }

/* Photo fields */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.image-field { display: grid; gap: 6px; align-content: start; }
.image-label { font-weight: 600; font-size: 0.85rem; }
.image-box {
  display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden;
  border: 1px dashed #C9CCC2; border-radius: 10px; background: #F2F3EE; color: var(--muted); font-size: 0.8rem;
}
.image-box img { width: 100%; height: 100%; object-fit: cover; }
.image-field.is-loading .image-box, .video-box.is-loading { opacity: 0.5; }
.image-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.image-actions label.btn { display: inline-flex; }
.image-field input[data-field="image_alt"] { min-height: 34px; font-size: 0.85rem; }

.hero-media { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #FCFCFA; display: grid; gap: 12px; }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-media #hero-photo .image-field { max-width: 420px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #ECEEE7; }
.segmented label { position: relative; display: block; cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.segmented label { padding: 6px 16px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.segmented label:has(input:checked) { background: #fff; color: var(--altai-forest); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.hero-video { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.video-box {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 10px; background: #1F2323; color: #C9CCC2; font-size: 0.85rem;
}
.video-box video, .video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; pointer-events: none; }
.video-fields { display: grid; gap: 12px; }
.video-fields .image-box { aspect-ratio: 16 / 9; }

.repeat { display: grid; gap: 12px; }
.repeat:empty { display: none; }
.repeat-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #FCFCFA; display: grid; gap: 10px; }
.repeat-head { display: flex; align-items: center; gap: 8px; }
.repeat-head strong { margin-right: auto; color: var(--altai-forest); }
.repeat-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.repeat-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.item-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }


/* Day photos (up to 15): thumbnails in a grid, first one is the main photo */
.day-photos { display: grid; gap: 8px; }
.day-photos.is-loading { opacity: 0.6; }
.day-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.day-photo-grid:empty::before { content: "No photos yet"; color: #8a908b; font-size: 0.85rem; }
.day-photo { position: relative; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; background: #E6E8DF; }
.day-photo:first-child { outline: 2px solid var(--altai-forest); outline-offset: -2px; }
.day-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.day-photo-tools { position: absolute; inset: auto 4px 4px 4px; display: flex; gap: 4px; justify-content: flex-end; }
.day-photo-tools button {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.92); cursor: pointer; font-size: 0.8rem; line-height: 1;
}
.day-photo-tools button:hover { background: #fff; color: var(--altai-forest); }
.image-actions label.is-disabled, .image-actions button:disabled { opacity: 0.5; pointer-events: none; }
.day-photos input[data-field="image_alt"] { min-height: 34px; font-size: 0.85rem; }

/* Text toolbar: bold and bullet list */
.rich-field { display: grid; gap: 0; margin-top: 4px; font-weight: 400; }
.rich-tools {
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #F4F5F0;
}
.rich-btn {
  min-width: 30px; height: 28px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 6px; background: none;
  font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--charcoal, #1F2323);
}
.rich-btn:hover { background: #fff; border-color: var(--line); }
.rich-field textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.rich-field .hint { margin-top: 4px; }

/* Right column */
.card-preview { display: grid; gap: 6px; }
.card-preview-media {
  position: relative; aspect-ratio: 16 / 10; border-radius: 12px; background: #E6E8DF center / cover no-repeat; margin-bottom: 6px;
}
.cp-badge { position: absolute; top: 10px; left: 10px; padding: 3px 12px; border-radius: 999px; background: var(--altai-forest); color: #fff; font-size: 0.75rem; font-weight: 700; }
.card-preview h3 { font-size: 1.05rem; }
.cp-meta { font-size: 0.85rem; color: var(--muted); }
.cp-price { padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.cp-price strong { font-size: 1.4rem; color: var(--altai-forest); }
.cp-price:empty { display: none; }

.gallery-preview { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 70px 70px; gap: 3px; border-radius: 10px; overflow: hidden; }
.gp-tile { background: #E6E8DF center / cover no-repeat; position: relative; display: grid; place-items: center; }
.gp-main, .gp-tall { grid-row: span 2; }
.gp-tile.is-empty span { color: #A9AEA6; font-weight: 700; }
.gp-video { padding: 2px 8px; border-radius: 999px; background: rgba(31, 35, 35, 0.7); color: #fff; font-size: 0.7rem; font-weight: 700; }
.img-checklist { list-style: none; display: grid; gap: 10px; }
.img-checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; }
.img-checklist strong { display: block; }
.img-checklist small { color: var(--muted); }
.img-checklist .tick {
  flex: 0 0 22px; height: 22px; display: grid; place-items: center; border-radius: 6px;
  border: 1.5px solid #C9CCC2; color: #fff; font-weight: 700; font-size: 0.8rem;
}
.img-checklist li.is-ok .tick { background: var(--altai-forest); border-color: var(--altai-forest); }

.editor-bar {
  grid-column: 2; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 28px; background: #fff; border-top: 1px solid var(--line);
}
.editor-bar .form-message { margin-right: auto; min-height: 0; }
.dirty { color: #A8670E; font-size: 0.85rem; font-weight: 600; }

@media (max-width: 1180px) {
  .editor-cols { grid-template-columns: 1fr; }
  .editor-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
  .editor-shell { grid-template-columns: 1fr; }
  .editor-side { display: none; }
  .editor-bar { grid-column: 1; padding: 10px 16px; flex-wrap: wrap; }
  .editor-main { padding: 0 16px 32px; }
  .editor-top { margin: 0 -16px; padding: 10px 16px; }
  .hero-video { grid-template-columns: 1fr; }
}

.request-message { white-space: pre-wrap; margin-top: 8px; padding: 10px; background: #F4F5F0; border-radius: var(--radius); }

@media (max-width: 640px) {
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .item-grid, .repeat-row { grid-template-columns: 1fr; }
  .page-actions input[type="search"] { min-width: 0; width: 100%; }
}

/* ---------- Tours page ---------- */
.status-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.status-missing { flex-basis: 100%; font-size: 0.72rem; color: #9a6b1f; }
.tour-card-media .status-missing { display: none; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; }
.row-menu { position: relative; }
.row-menu summary { cursor: pointer; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; min-width: 190px; display: grid; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.menu-pop a, .menu-pop button {
  display: block; padding: 9px 12px; border: 0; border-radius: 7px; background: none; color: var(--charcoal);
  font: inherit; font-size: 0.88rem; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: #F1F3EE; }

.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 20px; }
.tour-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.tour-card-media { position: relative; aspect-ratio: 16 / 10; background: #ECEDE6; }
.tour-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-card-media .status-cell { position: absolute; left: 10px; top: 10px; padding: 4px 4px 4px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.94); }
.tour-card-body { display: grid; gap: 6px; padding: 14px 16px 12px; flex: 1; align-content: start; }
.tour-card-body h3 { font-size: 0.98rem; line-height: 1.3; }
.tour-card-meta { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 0.88rem; }
.tour-card-meta strong { color: var(--altai-forest); font-size: 1.05rem; }
.tour-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; margin-top: 4px; border-top: 1px solid #ECEDE8; font-size: 0.85rem; }

.next-dep { display: flex; align-items: center; gap: 24px; padding: 16px 20px; flex-wrap: wrap; }
.next-dep-media { flex: 0 0 170px; height: 64px; border-radius: 10px; overflow: hidden; background: #ECEDE6; }
.next-dep-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.next-dep-text { flex: 1 1 240px; display: grid; gap: 2px; }
.next-dep-text h3 { font-size: 1.1rem; color: var(--altai-forest); }
.eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.next-dep-crew { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 24px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.next-dep-go { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }

/* Small editor dialogs (rentals, blog) */
#rental-image .image-box { aspect-ratio: auto; height: 220px; }
.form-actions .spacer { flex: 1; }
.switch-row small { font-weight: 400; }

/* ---------- Workspace on tablets and phones ---------- */
@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr; }
  .top-user-text { display: none; }
  .next-dep-crew { border: 0; padding: 0; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); }
  .side-open .sidebar { transform: none; }
  .side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(31, 35, 35, 0.4); }
  .workspace { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .crumbs > .ic, .crumbs > span:first-of-type, .crumbs .crumb-sep { display: none; }
  .top-search { width: auto; flex: 1; min-width: 0; }
  .top-user { border: 0; padding-left: 0; }
  main.panel { padding: 20px 16px 48px; }
  .hub-tabs { padding: 4px 8px 0; gap: 2px; }
  .hub-tabs button { padding: 12px 8px 12px; font-size: 0.9rem; }
  .hub-tabs button .ic { display: none; }
  .page-head h1 { font-size: 1.6rem; }
  .table-toolbar { padding: 10px 16px 0; }
  .toolbar-right { width: 100%; }
  .field-search { flex: 1 1 100%; width: auto; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 0; }
  .kpi-icon { flex: 0 0 40px; width: 40px; height: 40px; }
  .kpi-go { display: none; }
  .kpi-text strong { font-size: 1.4rem; }
  .crumbs { display: none; }
  .page-actions { width: 100%; }
  .page-actions .btn, .page-actions select { flex: 1; }
  .next-dep-media { flex-basis: 100%; height: 120px; }
}
.nowrap { white-space: nowrap; }
.dash-cols .tour-cell { min-width: 0; gap: 12px; }
.dash-cols .tour-thumb { flex-basis: 64px; height: 44px; }
.dash-cols th, .dash-cols td { padding-left: 12px; padding-right: 12px; }

/* ---------- Blog post editor (full screen) ---------- */
dialog.post-editor {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; overflow: hidden; border-radius: 0; background: #F6F7F3; box-shadow: none;
  overflow: clip;
}
.post-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; gap: 0; }
.post-top { display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.post-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.post-top #post-view { margin-left: auto; }
.post-top .icon-btn { font-size: 1.5rem; }
.post-top #post-view[hidden] + .icon-btn { margin-left: auto; }
.post-cols {
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 340px; gap: 24px; align-items: start;
  width: min(1520px, 100%); margin: 0 auto; padding: 24px 28px 0; overflow-y: auto; height: 100%;
}
.post-main, .post-aside { padding-bottom: 40px; }
.post-main, .post-aside { display: grid; gap: 20px; }
.post-aside { position: sticky; top: 0; }
.post-card { display: grid; gap: 14px; }
.post-card h2 { font-size: 1rem; }
.post-title-input {
  border: 0; padding: 0; min-height: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
}
.post-sub-input { border: 0; padding: 0; min-height: 0; resize: none; font-size: 1.1rem; color: #4A504D; }
.post-title-input:focus, .post-sub-input:focus { outline: none; }
#post-image .image-box { aspect-ratio: 23 / 10; }
#post-image .image-actions { display: flex; gap: 8px; }

.blocks-head { display: flex; justify-content: space-between; gap: 12px; }
/* Компьютер дээр: зүүн талд, дээд талдаа наалттай (гүйлгэхэд хөдлөхгүй) */
.block-tools {
  position: sticky; top: 0; align-self: start; z-index: 3; display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(27, 94, 59, 0.06);
}
.block-tools-title { padding: 0 2px 4px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.block-tools button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--charcoal);
  font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
}
.block-tools button:hover { border-color: var(--altai-forest); color: var(--altai-forest); }
.block-tools .ic { width: 18px; height: 18px; }
.block-tools button { white-space: nowrap; }
@media (min-width: 1001px) {
  .block-tools button { gap: 12px; min-height: 48px; padding: 8px 16px; font-size: 1rem; border-radius: 8px; }
  .block-tools .ic, .block-tools .tool-h { width: 20px; height: 20px; }
}
.tool-h { font-size: 0.75rem; font-weight: 700; width: 18px; text-align: center; }
.block-tools .tool-link { background: #3E7B3A; border-color: #3E7B3A; color: #fff; }
.block-tools .tool-link:hover { background: var(--altai-forest); color: #fff; }

.blocks { display: grid; gap: 12px; }
.blocks-empty { padding: 28px; border: 1px dashed #C9CCC2; border-radius: 12px; text-align: center; color: var(--muted); }
.block { border: 1px solid #E3E5DE; border-left: 4px solid #CFD8C8; border-radius: 10px; background: #FCFCFA; }
.block:focus-within { border-color: #B9CDB0; border-left-color: var(--altai-forest); background: #fff; box-shadow: 0 4px 18px rgba(27, 94, 59, 0.07); }
.block-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 0 14px; }
.block-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.block-head .icon-btn { width: 30px; height: 30px; font-size: 1rem; }
.block-head .icon-btn.danger:hover { color: var(--danger); background: #F7E1DF; }
.block-body { display: grid; gap: 10px; padding: 6px 14px 14px; }
.block-body textarea { min-height: 72px; resize: vertical; line-height: 1.6; }
.block-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; }
.block-heading input[data-field="text"] { font-size: 1.2rem; font-weight: 700; color: var(--altai-forest); }
.block-heading:has(option[value="gold"]:checked) input[data-field="text"] { color: #B9843F; }
.block-quote { border-left-color: var(--altai-forest); }
.block-quote textarea { font-style: italic; background: #F6F7F2; }
.block-image .image-field { max-width: 400px; }
.block-image .image-box { aspect-ratio: 3 / 2; }
.yt-preview { width: min(420px, 100%); aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111; }
.yt-preview img { width: 100%; height: 100%; object-fit: cover; }

.related-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.related-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; font-weight: 500; font-size: 0.85rem; cursor: pointer; }
.related-item:hover { background: #F4F5F0; }
.related-item input { width: 16px; min-height: 16px; accent-color: var(--altai-forest); }
.related-item .tour-thumb { flex: 0 0 52px; height: 36px; }
.post-stats { grid-template-columns: repeat(3, 1fr); text-align: center; font-size: 0.8rem; color: var(--muted); }
.post-stats strong { display: block; font-size: 1.3rem; color: var(--charcoal); }
.post-bar .form-message { margin-right: auto; min-height: 0; }
.post-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 28px; background: #fff; border-top: 1px solid var(--line); }

@media (max-width: 1000px) {
  .post-cols { grid-template-columns: 1fr; padding: 16px 16px 0; }
  .post-main, .post-aside { padding-bottom: 0; }
  .post-aside { padding-bottom: 24px; }
  .post-aside { position: static; }
  .post-top, .post-bar { padding-left: 16px; padding-right: 16px; flex-wrap: wrap; }
  .block-tools {
    top: -16px; bottom: auto; align-self: start; flex-direction: row; flex-wrap: wrap; gap: 8px;
    margin: 0; padding: 10px 0; border: 0; border-bottom: 1px solid #ECEDE8; border-radius: 0; box-shadow: none;
  }
  .block-tools-title { display: none; }
}

/* ---------- Car editor (Rentals) ---------- */
.kpi-icon.bad { background: #F7E1DF; color: var(--danger); }
.yt-preview[hidden] { display: none; }
.repeat-list { display: grid; gap: 12px; }
.repeat-list:empty { display: none; }
.gal-grid, .ibox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.gal-grid:empty, .ibox-grid:empty { display: none; }
.gal-item, .ibox-item { padding: 10px; gap: 8px; align-content: start; }
.gal-item .image-label, .ibox-item .image-label { display: none; }
.gal-item .image-box, .ibox-item .image-box { aspect-ratio: 4 / 3; }
.gal-item .image-actions .btn, .ibox-item .image-actions .btn { padding: 4px 8px; font-size: 0.75rem; }
.gal-item .repeat-tools, .ibox-item .repeat-tools { margin-left: 0; justify-content: flex-end; }
.gal-item:first-child { border-color: var(--altai-forest); box-shadow: 0 0 0 2px #E3F1DD; }
.gal-item:first-child::before { content: "Shown first"; font-size: 0.7rem; font-weight: 700; color: var(--altai-forest); }
.ibox-item input[data-field="title"] { font-weight: 600; }
/* Чирж байрыг солино */
.gal-item, .ibox-item { cursor: grab; }
.gal-item :is(input, textarea, button, label), .ibox-item :is(input, textarea, button, label) { cursor: auto; }
.gal-item button, .ibox-item button, .gal-item label.btn, .ibox-item label.btn { cursor: pointer; }
.gal-item.is-dragging, .ibox-item.is-dragging { opacity: 0.35; border-style: dashed; cursor: grabbing; }
#rental-cover .image-field { max-width: 560px; }
#rental-cover .image-box { aspect-ratio: 21 / 9; }
#rental-image .image-box { aspect-ratio: 4 / 3; }
#rental-cover-video[hidden] { display: none; }
.faq-block { border: 1px solid var(--line); border-radius: 12px; background: #FCFCFA; overflow: hidden; }
.faq-list { display: grid; }
.faq-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; counter-increment: faq; }
.faq-list { counter-reset: faq; }
.faq-row::before { content: counter(faq) "."; font-weight: 700; color: var(--altai-forest); padding-top: 10px; min-width: 1.4em; }
.faq-row-fields { display: grid; gap: 6px; }
.faq-row input[data-field="q"] { font-weight: 600; }
.faq-row textarea { min-height: 0; resize: vertical; }
.faq-row .repeat-tools { margin: 4px 0 0; }
.faq-empty { margin: 0; padding: 18px; text-align: center; color: var(--muted); }
.faq-list:not(:empty) + .faq-empty { display: none; }
.faq-add { margin: 12px 14px; }
@media (max-width: 560px) { .faq-row { grid-template-columns: auto minmax(0, 1fr); } .faq-row .repeat-tools { grid-column: 2; justify-content: flex-end; } }
.section-text { padding: 12px; border-radius: 10px; background: #F6F7F3; }
.section-text textarea { min-height: 0; resize: vertical; }
/* Машины засварт "Add block" багана байхгүй: 2 багана (агуулга + хажуугийн самбар) */
@media (min-width: 1001px) {
  #rental-dialog .post-cols { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* ---------- Car bookings ---------- */
.bank-card { margin-top: 20px; display: grid; gap: 16px; }
.bank-card[hidden] { display: none; }
.bank-card input[name="account_number"], .bank-card input[name="iban"], .bank-card input[name="swift"] { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.03em; }
dialog.carbook-dialog { width: min(920px, calc(100vw - 24px)); }
.cb-head { display: flex; align-items: center; gap: 10px; }
.cb-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.cb-cols h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 8px; }
.cb-cols h3:first-child { margin-top: 0; }
.cb-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0; }
.cb-info div { background: #fff; padding: 8px 10px; box-shadow: 0 0 0 0.5px var(--line); }
.cb-info dt { font-size: 0.72rem; color: var(--muted); }
.cb-info dd { margin: 0; font-weight: 600; font-size: 0.875rem; overflow-wrap: anywhere; }
.cb-price { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 0.875rem; }
.cb-price div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.cb-price .cb-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 700; color: var(--altai-forest); font-size: 1rem; }
.cb-proof img { width: 100%; max-height: 360px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #F6F6F2; display: block; }
@media (max-width: 760px) {
  .cb-cols { grid-template-columns: 1fr; }
  .gal-grid, .ibox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Website settings ---------- */
.site-tabs { margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.hero-editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.hero-edit-main { display: grid; gap: 20px; min-width: 0; }
.hero-edit-aside { position: sticky; top: 84px; display: grid; gap: 12px; }
.hero-add { display: flex; gap: 6px; flex-wrap: wrap; }
.slide-item[data-type="photo"] .slide-video { display: none; }
.slide-item.is-loading { opacity: 0.6; pointer-events: none; }
.slide-item .repeat-head { flex-wrap: wrap; gap: 10px; }
.slide-item .image-box { aspect-ratio: 16 / 9; }
.hero-interval { max-width: 260px; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.color-grid[hidden] { display: none; }
.color-field, .range-field { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.color-field input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.color-field code { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; }
.range-field input { flex: 1; accent-color: var(--altai-forest); min-height: 0; padding: 0; border: 0; }
.range-field output { width: 40px; text-align: right; font-size: 0.8rem; color: var(--muted); }
.sub-h { font-size: 0.85rem; margin-top: 4px; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.hero-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1F2323; container-type: inline-size; }
.hp-media, .hp-overlay { position: absolute; inset: 0; }
.hp-media img, .hp-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa09a; font-size: 0.85rem; }
.hp-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqw; padding: 0 8cqw; text-align: center; }
.hp-icon { width: 9cqw; height: 5.4cqw; }
.hp-content strong { font-size: 5.6cqw; line-height: 1.12; letter-spacing: -0.02em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.hp-content strong.is-gradient { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; text-shadow: none; }
.hp-content span { font-size: 2.4cqw; max-width: 70cqw; opacity: 0.95; }
.hp-content b { margin-top: 1.5cqw; padding: 1.6cqw 3.2cqw; border-radius: 1cqw; background: var(--altai-forest); color: #F7F7F2; font-size: 2.2cqw; }
.hp-content b[hidden] { display: none; }
.hp-dots { position: absolute; bottom: 3cqw; left: 0; right: 0; display: flex; justify-content: center; gap: 1.4cqw; }
.hp-dots i { width: 1.6cqw; height: 1.6cqw; border-radius: 50%; border: 1.5px solid #fff; }
.hp-dots i.on { background: var(--sand-gold); border-color: var(--sand-gold); }
.hp-phone-wrap { display: grid; justify-items: center; gap: 6px; margin-top: 4px; }
.hp-phone { width: 46%; aspect-ratio: 9 / 16; border: 5px solid #1F2323; border-radius: 18px; }
.hp-phone .hp-content strong { font-size: 9cqw; }
.hp-phone .hp-content span { font-size: 4.6cqw; max-width: 90cqw; }
.hp-phone .hp-content b { font-size: 4.4cqw; padding: 3cqw 5cqw; }
.hp-phone .hp-icon { width: 16cqw; height: 10cqw; }
.hero-save { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 16px; }
.member-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: box-shadow 0.2s; }
.member-card:hover { box-shadow: 0 6px 18px rgba(31, 35, 35, 0.08); }
.member-card.is-hidden { opacity: 0.55; }
.member-photo { padding: 0; border: 0; background: #ECEEE7; cursor: pointer; border-radius: 50%; width: 88px; height: 88px; overflow: hidden; justify-self: center; display: grid; place-items: center; }
.member-photo.crew { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 10px; }
.member-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-photo span { font-weight: 700; font-size: 1.6rem; color: var(--altai-forest); }
.member-text { text-align: center; display: grid; gap: 2px; }
.member-text span { font-size: 0.82rem; color: var(--muted); }
.member-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.member-add { place-items: center; align-content: center; min-height: 200px; border-style: dashed; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; background: #FAFAF7; }
.member-add:hover { color: var(--altai-forest); border-color: var(--altai-forest); }
.member-form { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
#member-dialog { width: min(760px, calc(100vw - 24px)); }
@media (max-width: 1100px) {
  .hero-editor { grid-template-columns: 1fr; }
  .hero-edit-aside { position: static; order: -1; }
  .hp-phone-wrap { display: none; }
}
@media (max-width: 560px) {
  .member-form { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 10px; }
}

/* ---------- Blog: Tour block, link dialog, automatic related tours ---------- */
.block-tour { border-left-color: var(--sand-gold); }
.tour-search { position: relative; }
.tour-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.tour-search input { padding-left: 36px; }
.tour-results, .link-results { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; }
.tour-results[hidden] { display: none; }
.link-results:empty { display: none; }
.tour-results button, .link-results button { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; cursor: pointer; }
.tour-results button:hover, .link-results button:hover, .link-results button:focus-visible { background: #F1F5EE; }
.tour-results strong, .link-results strong { display: block; font-size: 0.875rem; }
.tour-results small, .link-results small { color: var(--muted); font-size: 0.75rem; }
.tour-results .tour-thumb, .link-results .tour-thumb { flex: 0 0 52px; height: 36px; }
.tour-pick { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(31, 35, 35, 0.05); }
.tour-pick-img { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #ECEEE7; }
.tour-pick-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-pick-text { display: grid; gap: 2px; }
.tour-pick-text small { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #B9843F; }
.tour-pick-text strong { font-size: 1.05rem; }
.tour-pick-text span { color: var(--muted); font-size: 0.85rem; }
.tour-pick-text .pill { justify-self: start; margin-top: 4px; font-style: normal; }
.tour-pick-empty { padding: 10px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
dialog.link-dialog { width: min(560px, calc(100vw - 24px)); }
.link-preview { font-size: 0.8rem; color: var(--muted); min-height: 1.2em; overflow-wrap: anywhere; }
.link-preview code { background: #F1F2EC; padding: 1px 6px; border-radius: 6px; }
.related-auto { display: grid; gap: 4px; }
.related-auto[hidden], #related-manual[hidden] { display: none; }
.related-item.is-static { cursor: default; }
.related-item.is-static:hover { background: none; }
@media (max-width: 560px) { .tour-pick { grid-template-columns: 96px minmax(0, 1fr); } }

/* ---------- Profile photo, blog author ---------- */
.avatar { background-size: cover; background-position: center; overflow: hidden; }
.avatar.has-photo { color: transparent; }
.avatar-lg { flex-basis: 72px; width: 72px; height: 72px; font-size: 1.3rem; }
.avatar-edit { display: flex; gap: 16px; align-items: center; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.avatar-edit .hint { margin: 2px 0 8px; }
.avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-actions label.btn { display: inline-flex; }
.author-field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 0.875rem; }
.author-options { display: grid; gap: 8px; }
.author-option { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.author-option:hover { border-color: var(--altai-forest); }
.author-option:has(input:checked) { border-color: var(--altai-forest); background: #F1F6F1; box-shadow: inset 0 0 0 1px var(--altai-forest); }
.author-option input { position: absolute; opacity: 0; pointer-events: none; }
.author-option .avatar { flex-basis: 34px; width: 34px; height: 34px; font-size: 0.75rem; }
.author-option.is-static { cursor: default; background: #F7F8F4; }
.author-option.is-static:hover { border-color: var(--line); }
.author-option small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.author-option .check-mark { margin-left: auto; color: var(--altai-forest); visibility: hidden; }
.author-option:has(input:checked) .check-mark { visibility: visible; }

/* ---------- Media library ---------- */
.media-tools { padding-bottom: 16px; justify-content: flex-start; }
.media-tools .field-search { flex: 1 1 280px; }
.media-progress { padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius); background: #F1F6F1; color: var(--altai-forest); font-weight: 600; font-size: 0.875rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
/* Picker: өндөр хязгаартай гүйлгэх хэсэгт мөрүүд шахагдаж зурвас болохгүйн тулд мөр бүр бүтэн өндөртэй */
.media-grid.is-picker { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); grid-auto-rows: max-content; align-content: start; max-height: 64vh; overflow: auto; padding: 2px 4px 2px 2px; }
.media-grid.is-picker > * { min-height: max-content; }
.media-grid.is-picker .media-thumb { flex-shrink: 0; }
.media-grid .empty { grid-column: 1 / -1; }
.media-card { display: grid; gap: 4px; align-content: start; padding: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: left; font: inherit; cursor: pointer; }
.media-card:hover, .media-card:focus-visible { border-color: var(--altai-forest); box-shadow: 0 4px 14px rgba(27, 94, 59, 0.12); }
.media-thumb { display: block; aspect-ratio: 4 / 3; background: #EEF0EA; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-code { padding: 4px 10px 0; font: 600 0.75rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--altai-forest); overflow-wrap: anywhere; }
.media-title { padding: 0 10px; font-size: 0.82rem; color: var(--charcoal); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-card .pill { justify-self: start; margin: 2px 10px 0; }
dialog.media-dialog { width: min(1040px, calc(100vw - 24px)); }
dialog.media-picker { width: min(1000px, calc(100vw - 24px)); }
.media-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; padding: 20px; }
.media-detail-img img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: var(--radius); background: #EEF0EA; }
.media-detail-img .hint { margin-top: 8px; }
.media-detail-fields { display: grid; gap: 12px; align-content: start; }
.media-detail-fields small { font-weight: 400; }
.media-detail-fields input[name="code"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.media-used { font-size: 0.875rem; display: grid; gap: 4px; }
.media-used ul { margin: 0; padding-left: 18px; }
.media-actions { flex-wrap: wrap; }
.media-actions #media-delete { margin-right: auto; }
dialog.dup-dialog { width: min(640px, calc(100vw - 24px)); }
.dup-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dup-compare figure { margin: 0; display: grid; gap: 6px; }
.dup-compare img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: #EEF0EA; }
.dup-compare figcaption { font-size: 0.8rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dup-dialog .form-actions { flex-wrap: wrap; }
@media (max-width: 760px) { .media-detail { grid-template-columns: 1fr; } .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
dialog.name-dialog { width: min(980px, calc(100vw - 24px)); }
.media-detail-fields input[readonly] { background: #F4F5F0; color: var(--muted); }

/* Payments inside the booking dialogs, guest portal messages */
.pay-admin { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pay-admin table { font-size: 0.85rem; }
.pay-admin .actions { white-space: nowrap; }
.pay-add { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.msg-text { display: block; max-width: 460px; white-space: pre-wrap; }
#messages-card .blocks-head { padding: 18px 20px 6px; }

/* ---------- Team & users: invites ---------- */
.invite-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.invite-card, .role-guide { padding: 20px; display: grid; gap: 12px; align-content: start; }
.invite-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
.invite-form label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.invite-form .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.invite-result { border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; font-size: 0.9rem; background: #EAF3E6; border: 1px solid #CBE0C2; }
.invite-result[data-kind="warn"] { background: var(--warn-bg); border-color: #F0D2A0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 0.82rem; }
.role-guide ul { list-style: none; display: grid; gap: 8px; font-size: 0.87rem; color: var(--muted); }
.role-guide strong { color: var(--charcoal); }
.chip-grand { background: var(--sand-gold); color: #3b2a12; padding-right: 10px; }
@media (max-width: 1100px) {
  .invite-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .invite-form { grid-template-columns: 1fr; }
}

/* ---------- Trip crew ---------- */
.crew-add { margin-top: 6px; max-width: 180px; font-size: 0.82rem; padding: 4px 6px; }
#crew-table td { vertical-align: top; }

/* ---------- My trips (team members) ---------- */
.trip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.trip-card { overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.trip-cover { height: 150px; background: linear-gradient(135deg, #1B5E3B, #8CBF7A) center / cover; position: relative; }
.trip-cover .badge { position: absolute; top: 12px; left: 12px; background: #fff; }
.trip-card-body { padding: 16px 18px 18px; display: grid; gap: 10px; align-content: start; }
.trip-card-body .btn { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.trip-dates { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.88rem; }
.trip-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trip-facts div { background: var(--ivory); border-radius: var(--radius); padding: 8px 10px; }
.trip-facts dt, .trip-summary .sub { font-size: 0.75rem; color: var(--muted); }
.trip-facts dd { font-weight: 700; }
#trip-dialog { width: min(760px, calc(100vw - 32px)); }
#trip-body { display: grid; gap: 14px; }
.trip-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.trip-summary div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; }
.trip-summary strong { font-size: 1.3rem; color: var(--altai-forest); }
.trip-info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 0.88rem; }
.trip-info dt { color: var(--muted); }
.trip-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; background: #FBFBF8; }
.trip-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.trip-group-head .btn { display: inline-flex; align-items: center; gap: 6px; }
.trip-group .traveler { background: #fff; }
.trip-group .traveler > .badge { justify-self: start; }
.trip-note { font-size: 0.87rem; background: var(--warn-bg); border-radius: var(--radius); padding: 8px 10px; }
.trip-days { list-style: none; display: grid; gap: 10px; }
.trip-days li { border-left: 3px solid var(--steppe-green); padding: 2px 0 2px 12px; display: grid; gap: 2px; font-size: 0.88rem; }

/* ---------- Guest chats ---------- */
.chat-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100vh - 210px); min-height: 460px; }
.chat-threads { overflow-y: auto; padding: 6px; }
.chat-threads ul { list-style: none; display: grid; gap: 2px; }
.chat-threads button { width: 100%; text-align: left; background: none; border: 0; border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 2px; cursor: pointer; font: inherit; }
.chat-threads button:hover { background: var(--ivory); }
.chat-threads button.is-active { background: #E9F1E5; }
.thread-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.thread-top .nav-count { position: static; }
.thread-last { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; }
.chat-pane > .empty { align-self: center; grid-row: 1 / -1; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head > div { display: grid; }
.chat-back { display: none; transform: rotate(180deg); }
.chat-log { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #FBFBF8; }
.msg { max-width: 75%; align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; display: grid; gap: 2px; }
.msg.is-me { align-self: flex-end; background: var(--altai-forest); color: #fff; border-color: var(--altai-forest); border-radius: 14px 14px 4px 14px; }
.msg.is-admin:not(.is-me) { background: #FFF8EC; border-color: #F0D2A0; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-who, .msg time { font-size: 0.72rem; opacity: 0.75; }
.msg time { justify-self: end; }
.chat-form { display: flex; gap: 10px; padding: 12px 14px 4px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; }
.chat-pane > .hint { padding: 0 14px 10px; }
@media (max-width: 899px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-pane { display: none; height: calc(100vh - 150px); }
  body.chat-open .chat-pane { display: grid; }
  body.chat-open .chat-threads { display: none; }
  .chat-back { display: inline-grid; }
}
.card.trip-card, .card.chat-pane { padding: 0; }
.card.chat-threads { padding: 6px; }

/* ---------- My documents (team members, for border permits) ---------- */
.docs-card { margin-bottom: 16px; display: grid; gap: 14px; border-color: #CBE0C2; }
.docs-head h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.01em; color: var(--altai-forest); }
.docs-head p { color: var(--muted); margin-top: 2px; }
.docs-warn { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); border: 1px solid #F0D2A0; border-radius: var(--radius); padding: 10px 12px; font-size: 0.88rem; font-weight: 600; color: #7a4f12; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.doc-slot { border: 1.5px dashed #C9CDC2; border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.doc-slot.is-done { border-style: solid; border-color: #CBE0C2; background: #F7FBF5; }
.doc-slot-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.doc-file { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.doc-file span { flex: 1; }
.btn-link.danger { color: var(--danger); }
.doc-upload { justify-self: start; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- Border line permit ---------- */
.trip-permit { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #EAF3E6; border: 1px solid #CBE0C2; border-radius: 10px; padding: 12px 14px; }
.trip-permit > div { display: grid; }
.trip-permit .btn { display: inline-flex; align-items: center; gap: 6px; }
dialog.permit-dialog { width: min(1240px, calc(100vw - 24px)); height: calc(100vh - 24px); max-height: none; padding: 0; display: none; }
dialog.permit-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.permit-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 0; }
.permit-side { overflow-y: auto; padding: 16px 20px; display: grid; gap: 16px; align-content: start; border-right: 1px solid var(--line); }
.permit-region { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.permit-region button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; font: inherit; font-weight: 700; cursor: pointer; display: grid; gap: 2px; text-align: left; }
.permit-region button small { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.permit-region button.is-active { border-color: var(--altai-forest); background: #E9F1E5; color: var(--altai-forest); }
.permit-form { gap: 10px; }
.permit-dates { border: 0; display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.permit-dates legend { font-weight: 600; font-size: 0.875rem; margin-bottom: 4px; }
.permit-dates label { width: 64px; }
.permit-dates span { padding-bottom: 10px; color: var(--muted); font-size: 0.85rem; }
.permit-docs { display: grid; gap: 8px; }
.permit-docs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.permit-doc-list { list-style: none; display: grid; gap: 6px; }
.permit-doc-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; font-size: 0.85rem; }
.permit-doc-list li.is-missing { background: #FFFBF4; }
.permit-doc-name { flex: 1 1 100%; font-weight: 600; }
.permit-doc-list label.check { font-weight: 500; margin-left: auto; }
.permit-preview { overflow-y: auto; background: #E9EAE4; padding: 20px; display: grid; gap: 20px; justify-items: center; align-content: start; }
.permit-page { width: 612px; max-width: 100%; aspect-ratio: 612 / 792; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); padding: 72px 72px; position: relative; font-family: Arial, "Liberation Sans", sans-serif; font-size: 11pt; line-height: 15pt; color: #1a1a1a; }
.permit-page p { margin: 0; }
.permit-stamp-img { width: 150px; margin: -18px 0 0 70px; display: block; }
.permit-stamp-missing { margin: 6px 0 0 70px; width: 150px; height: 120px; border: 1.5px dashed #C9CDC2; border-radius: 8px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 0.8rem; padding: 8px; }
.permit-page-docs { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; padding: 40px; }
.permit-page-docs figcaption { font-size: 8.5pt; line-height: 1.25; }
.permit-page-docs figure { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-height: 0; }
.permit-thumb { min-height: 0; display: grid; place-items: center; }
.permit-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.permit-pdf-chip { font-size: 0.85rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; }
.permit-stamp .notice { font-size: 0.85rem; }
.permit-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.permit-bar .form-message { flex: 1; margin: 0; }
.permit-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 960px) {
  .permit-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .permit-bar { flex-wrap: wrap; }
  .permit-bar .form-message { flex-basis: 100%; }
  .permit-side { border-right: 0; overflow: visible; }
  .permit-preview { overflow: visible; padding: 12px; }
  .permit-page { padding: 11%; font-size: 2.3vw; line-height: 1.4; }
}
.permit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.permit-letter { padding-top: 48px; }
.permit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #1B5E3B; box-shadow: 0 3px 0 -2px #1B5E3B; margin-bottom: 14px; }
.permit-head img { height: 46px; width: auto; }
.permit-head div { display: grid; text-align: right; font-size: 8.5pt; line-height: 11pt; color: #59605d; }
.permit-head strong { color: #1B5E3B; font-size: 11pt; line-height: 13pt; }
.permit-meta { font-size: 10pt; margin-bottom: 22px; }
.permit-page p.permit-title { font-weight: 700; }
td.actions .btn + .btn { margin-left: 6px; }
.permit-stamp-box { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FBFBF8; }
.permit-stamp-box img { width: 56px; height: 56px; object-fit: contain; }
.permit-stamp-box > div { display: grid; }

/* ---------- Contract with tourist camps ---------- */
@font-face { font-family: "Liberation Sans PDF"; src: url("../fonts/LiberationSans-Regular.ttf") format("truetype"); font-display: swap; }
.sub-inline { color: var(--muted); font-size: 0.85rem; font-weight: 500; margin-left: 6px; }
.contracts-list td { vertical-align: top; }
.contracts-list .mono { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88rem; }
.ct-prices { list-style: none; display: grid; gap: 2px; font-size: 0.85rem; min-width: 180px; }
.ct-prices li { display: flex; justify-content: space-between; gap: 10px; }
.ct-prices li span { color: var(--muted); }
.ct-upload { justify-content: center; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ct-block { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.ct-block h3 { font-size: 0.95rem; }
.ct-fields { display: grid; gap: 8px; }
.ct-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.ct-field label { font-size: 0.8rem; }
.ct-field.is-armed input { border-color: var(--altai-forest); }
.ct-field-stamp { grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #FBFBF8; }
.ct-field-stamp img { width: 48px; height: 48px; object-fit: contain; }
.ct-field-stamp > div { display: grid; font-size: 0.85rem; }
.ct-field-stamp:not(:has(img)) { grid-template-columns: 1fr auto; }
.ct-selected { display: grid; gap: 8px; border: 1.5px solid var(--altai-forest); background: #E9F1E5; border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; }
.ct-selected strong { overflow-wrap: anywhere; }
.ct-size { display: grid; grid-template-columns: auto 1fr 36px; align-items: center; gap: 8px; font-size: 0.8rem; }
.ct-size input { padding: 0; }
.ct-selected .btn { justify-self: start; }
.ct-found { display: grid; gap: 6px; background: #F6F8F3; border: 1px dashed #CBE0C2; border-radius: 10px; padding: 10px; }
.ct-found-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px; font-size: 0.8rem; align-items: start; }
.ct-found-row > span { color: var(--muted); padding-top: 4px; }
.ct-found-row > div { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-chip { border: 1px solid #CBE0C2; background: #fff; border-radius: 999px; padding: 3px 9px; font: inherit; font-size: 0.78rem; cursor: pointer; text-align: left; }
.ct-chip:hover { border-color: var(--altai-forest); }
.ct-chip.is-used { background: #E9F1E5; color: var(--altai-forest); }
.ct-prices-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.875rem; }
.ct-prices-edit { display: grid; gap: 6px; }
.ct-price-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 28px; gap: 6px; align-items: center; }
.ct-price-row .btn-icon { border: 0; background: none; font-size: 1.2rem; color: var(--muted); cursor: pointer; }
.ct-pages { user-select: none; grid-template-columns: minmax(0, 1fr); }
.ct-pages.is-placing .ct-page { cursor: crosshair; outline: 2px dashed var(--altai-forest); outline-offset: 2px; }
.ct-page { position: relative; width: 820px; max-width: 100%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.ct-item, .ct-pages.is-placing .ct-page { touch-action: none; }
.ct-page canvas { display: block; width: 100%; height: 100%; }
.ct-page-no { position: absolute; right: 8px; bottom: 6px; font-size: 0.72rem; color: var(--muted); background: rgba(255, 255, 255, 0.85); padding: 1px 6px; border-radius: 6px; }
.ct-item { position: absolute; white-space: pre; line-height: 1; font-family: "Liberation Sans PDF", Arial, sans-serif; color: #0d1a4d; cursor: move; outline: 1px dashed transparent; }
.ct-item:hover { outline-color: rgba(27, 94, 59, 0.5); }
.ct-item.is-selected { outline: 1.5px solid var(--altai-forest); background: rgba(233, 241, 229, 0.35); }
.ct-item-stamp img { display: block; width: 100%; pointer-events: none; }
.ct-drop { width: min(820px, 100%); border: 2px dashed #C9CDC2; border-radius: 12px; padding: 48px 24px; text-align: center; display: grid; gap: 6px; background: #fff; }
.contracts-list a { color: var(--altai-forest); font-weight: 600; text-decoration: none; }

/* ---------- Tools ---------- */
.tool-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tool-tabs button { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font: inherit; cursor: pointer; color: inherit; }
.tool-tabs button .ic { width: 22px; height: 22px; flex: none; color: var(--muted); }
.tool-tabs button span { display: grid; }
.tool-tabs button small { color: var(--muted); font-size: 0.78rem; }
.tool-tabs button:hover { border-color: #B9CFB0; }
.tool-tabs button.is-active { border-color: var(--altai-forest); background: #E9F1E5; }
.tool-tabs button.is-active .ic, .tool-tabs button.is-active b { color: var(--altai-forest); }
[data-tool-panel] .card-head .toolbar-right { padding-bottom: 0; }
.stamp-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 20px; align-items: start; }
.stamp-preview { border: 1px dashed var(--line); border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; background: #FBFBF8; color: var(--muted); font-size: 0.85rem; padding: 12px; }
.stamp-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.stamp-info { display: grid; gap: 10px; justify-items: start; }
.stamp-info .btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
@media (max-width: 640px) { .stamp-body { grid-template-columns: 1fr; } .tool-tabs { grid-template-columns: 1fr 1fr; } .tool-tabs button small { display: none; } }

/* ---------- Itinerary maker ---------- */
dialog.it-dialog { width: min(1000px, calc(100vw - 24px)); height: calc(100vh - 24px); max-height: none; padding: 0; display: none; }
dialog.it-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.it-form { overflow-y: auto; padding: 18px 22px 28px; display: grid; gap: 14px; align-content: start; background: #F6F7F3; }
.it-top { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.it-name input { font-size: 1.1rem; font-weight: 700; }
.it-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.it-section-head h3 { font-size: 1rem; }
.it-days { display: grid; gap: 12px; }
.it-day { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.it-day-head { display: grid; grid-template-columns: auto minmax(0, 1fr) 160px auto; gap: 8px; align-items: center; padding: 10px 12px; background: #FBFBF8; border-bottom: 1px solid var(--line); }
.it-day-no { font-weight: 700; color: var(--altai-forest); white-space: nowrap; min-width: 52px; }
.it-day-head input[data-k="title"] { font-weight: 600; }
.it-day-tools { display: flex; gap: 4px; }
.it-day-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; padding: 12px; }
.it-day-text { display: grid; gap: 10px; align-content: start; }
.it-day-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; }
.it-meals { display: flex; gap: 6px; flex-wrap: wrap; }
.it-meal { position: relative; cursor: pointer; }
.it-meal input { position: absolute; opacity: 0; pointer-events: none; }
.it-meal span { display: inline-block; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 0.85rem; font-weight: 600; color: var(--muted); background: #fff; }
.it-meal input:checked + span { border-color: var(--altai-forest); background: #E9F1E5; color: var(--altai-forest); }
.it-meal input:checked + span::before { content: "✓ "; }
.it-meal input:focus-visible + span { outline: 2px solid var(--altai-forest); outline-offset: 2px; }
.it-overnight { font-size: 0.8rem; flex: 1 1 220px; }
.it-day .image-field [data-field="image_alt"], .it-day .image-label { display: none; }
.it-day .image-field { margin: 0; }
.it-add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.it-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 6px; }
.it-prices { display: grid; gap: 8px; }
.it-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.it-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.it-step button { border: 0; background: #F1F2EC; width: 32px; height: 36px; font-size: 1.1rem; cursor: pointer; }
.it-step button:hover { background: #E2E8DC; }
.it-step input { width: 44px; text-align: center; border: 0; border-radius: 0; min-height: 36px; padding: 0; font-weight: 700; }
.it-to, .it-pax { color: var(--muted); font-size: 0.85rem; }
.it-price input[data-p="price"] { flex: 1 1 160px; width: auto; }
.it-price .btn-icon { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; padding: 0 6px; }
.it-share { margin-top: 8px; }
#it-open { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
@media (max-width: 760px) {
  .it-top, .it-two, .it-day-body { grid-template-columns: minmax(0, 1fr); }
  .it-day-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .it-day-head input[type="date"] { grid-column: 1 / -1; grid-row: 2; }
  .it-form { padding: 14px; }
}

/* ---------- Tabs inside a page (Bookings, Team & users) ---------- */
.sub-tabs { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.sub-tabs button { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.sub-tabs button .ic { width: 18px; height: 18px; }
.sub-tabs button b[hidden] { display: none; }
.sub-tabs button b:not([hidden]) { background: #FBE3DF; color: var(--danger); }
.sub-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sub-toolbar[hidden] { display: none; }
.sub-toolbar .hint { margin: 0; }
.sub-toolbar select, .sub-toolbar input[type="search"] { width: auto; min-width: 240px; }
[data-sub-panel]:not([hidden]) { display: grid; gap: 20px; align-content: start; }
.sub-toolbar { margin-bottom: 0; }
.sub-tabs { margin-bottom: 0; }
@media (max-width: 640px) { .sub-toolbar select, .sub-toolbar input[type="search"] { min-width: 0; width: 100%; } }

/* Choice chips: overnight (one) and transport (several) */
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px 14px; border: 1px solid #dfe2da; border-radius: 10px; }
.pick-chips legend { padding: 0 6px; font-weight: 600; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid #dfe2da; border-radius: 999px; background: #fff;
  font-weight: 500; font-size: 0.86rem; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.pick-chip:hover { border-color: var(--altai-forest); }
.pick-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick-chip:has(input:checked) { border-color: var(--altai-forest); background: #EAF2E6; color: var(--altai-forest); font-weight: 700; }
.pick-chip:has(input:focus-visible) { outline: 2px solid var(--altai-forest); outline-offset: 2px; }
.stay-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stay-ic .fill { fill: currentColor; stroke: none; }

/* Featured photo under the tour card preview (the card itself is the preview) */
.cover-slot .image-box { display: none; }
.editor-aside { max-height: calc(100vh - 88px); overflow-y: auto; }
@media (max-width: 1180px) { .editor-aside { max-height: none; overflow: visible; } }
.cover-slot .image-field.is-loading { opacity: 0.5; }
.pick-chips > .hint { flex-basis: 100%; margin-top: 2px; }

/* Price includes / not includes picker (tour editor 07) */
.incl-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.incl-picker { margin: 0; padding: 12px 14px; border: 1px solid #dfe2da; border-radius: 10px; min-width: 0; }
.incl-picker legend { padding: 0 6px; font-weight: 600; }
.incl-group { padding: 8px 0; border-bottom: 1px dashed #e6e8df; }
.incl-group:last-child { border-bottom: 0; }
.incl-items { margin: 8px 0 2px 14px; padding-left: 12px; border-left: 2px solid #EAF2E6; }
.incl-items[hidden] { display: none; }
.incl-picker.is-no .pick-chip:has(input:checked) { border-color: #9a5a4a; background: #f6ebe7; color: #8a4a3a; }
@media (max-width: 760px) { .incl-pickers { grid-template-columns: 1fr; } }
.menu-pop .danger { color: var(--danger); }
.btn-danger-outline { border: 1px solid var(--danger); color: var(--danger); background: #fff; }
.btn-danger-outline:hover { background: #F7E1DF; }

/* Camping views (Tours → Camping views) */
dialog.camping-dialog { width: min(820px, calc(100vw - 24px)); }
#camping-list table { width: 100%; }
#camping-form .form-actions { align-items: center; }
#camping-used:empty, #camping-message:empty { display: none; }
/* Tours → Tools menu */
.tools-menu summary { list-style: none; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-menu .menu-pop { min-width: 300px; }
.tools-menu .menu-pop button { display: grid; gap: 2px; }
.tools-menu .menu-pop small { color: #6b716d; font-size: 0.78rem; }
#packing-used:empty, #packing-message:empty { display: none; }

/* Route map: аяллын засварлагч дахь газрын зураг */
.editor-steps a.is-optional .step-num { font-size: 0.85rem; }
.map-editor { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #dbe7ea; }
.map-canvas { cursor: crosshair; touch-action: none; }
.map-canvas .rm-stop { cursor: grab; }
.map-canvas .rm-stop.is-selected circle { stroke: var(--sand-gold); }
.map-canvas .rm-stop.is-selected .rm-dot { fill: var(--sand-gold); }
.map-empty { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 0.85rem; font-weight: 600; color: var(--altai-forest); white-space: nowrap; pointer-events: none; }
.map-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.map-add select { flex: 1 1 260px; width: auto; }
.map-stops { display: grid; gap: 10px; }
.map-stops:empty { display: none; }
.map-stop { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #FCFCFA; display: grid; gap: 10px; }
.map-stop.is-selected { border-color: var(--sand-gold); box-shadow: 0 0 0 2px #F3E3CB; }
.map-stop-head { display: flex; align-items: center; gap: 10px; }
.map-stop-head input { flex: 1; font-weight: 600; }
.map-stop-head .repeat-tools { margin-left: 0; }
.map-stop-num { flex: 0 0 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--altai-forest); color: #fff; font-size: 0.75rem; font-weight: 700; }
.map-stop-ic { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--altai-forest); color: var(--altai-forest); background: #fff; }
.map-stop-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.map-stop-fields label { font-size: 0.8rem; }
.map-stop-fields label.check { align-self: end; min-height: 40px; }

/* Tour overview: "Write with AI" (functions/api/ai-overview.js) */
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ai-row input { flex: 1 1 220px; min-width: 0; }
.ai-row .btn { white-space: nowrap; }
.name-ai-row { justify-content: space-between; margin: 0 0 4px; min-height: 30px; }
.name-ai-row .hint { flex: 1 1 auto; }
.btn-ai { padding-inline: 10px; }

/* ---------- Website settings: Video stories ---------- */
.story-item.is-loading { opacity: 0.6; pointer-events: none; }
.story-item .image-box { aspect-ratio: 3 / 4; max-width: 210px; }
#story-add { margin-left: auto; }
.community-photos-edit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 6px 0 12px; }
.community-photos-edit .image-box { aspect-ratio: 1; border-radius: 50%; }
.community-photos-edit input[data-field="image_alt"] { display: none; }

.sp-preview {
  display: grid; gap: 8px; padding: 16px; border-radius: 12px; container-type: inline-size;
  background: radial-gradient(300px 140px at 10% 0%, rgba(217, 169, 108, 0.25), transparent 70%), linear-gradient(180deg, #FCF7F0, #F7F7F2);
}
.sp-preview mark { background: rgba(217, 169, 108, 0.45); color: inherit; padding: 0 2px; border-radius: 3px; }
.sp-off { justify-self: start; padding: 2px 10px; border-radius: 999px; background: #F6E7D2; color: #A8670E; font-size: 0.75rem; font-weight: 700; }
.sp-title { font-size: 1rem; line-height: 1.2; }
.sp-text { font-size: 0.78rem; color: var(--muted); }
.sp-text:empty { display: none; }
.sp-cards { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 4); gap: 8px; overflow-x: auto; }
.sp-card { display: grid; gap: 3px; align-content: start; min-width: 0; }
.sp-media { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #1F2323; }
.sp-media img, .sp-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-media i { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; translate: -50% -50%; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, 0.3); }
.sp-card b { font-size: 0.68rem; line-height: 1.2; margin-top: 3px; }
.sp-card small { font-size: 0.62rem; line-height: 1.3; color: var(--muted); }
.sp-card em { font-style: normal; font-size: 0.6rem; color: var(--altai-forest); font-weight: 700; }
.sp-community { display: grid; justify-items: center; gap: 4px; text-align: center; margin-top: 12px; }
.sp-photos { display: flex; }
.sp-photos img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.sp-photos img + img { margin-left: -10px; }
.sp-photos img:nth-child(2):nth-last-child(2) { width: 52px; height: 52px; position: relative; }
.sp-community b { font-size: 0.85rem; }
.sp-community small { font-size: 0.7rem; color: var(--muted); }
.sp-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; }
.sp-links span { padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 0.62rem; font-weight: 700; }
@media (max-width: 760px) {
  .community-photos-edit { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Departure schedules: one rule → every round of the season */
.sched-card .card-head { flex-wrap: wrap; justify-content: flex-start; }
.sched-card .card-head .sub { font-size: 0.85rem; }
#departures-table tr.month-row td {
  background: #F4F7F1; color: var(--altai-forest); font-weight: 700; font-size: 0.85rem;
  padding-top: 10px; padding-bottom: 10px; letter-spacing: 0.02em;
}
#departures-table tr.month-row span { margin-left: 10px; font-weight: 600; color: var(--muted); }
dialog.sched-dialog { width: min(980px, calc(100vw - 24px)); }
.sched-step { margin: 22px 0 10px; font-size: 0.95rem; }
.sched-step:first-child { margin-top: 0; }
.sched-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.sched-type {
  display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  position: relative; background: #fff; cursor: pointer; font-weight: 400;
}
.sched-type input { position: absolute; opacity: 0; pointer-events: none; }
.sched-type span { font-size: 0.82rem; color: var(--muted); }
.sched-type.is-on { border-color: var(--altai-forest); background: #F1F6EE; box-shadow: 0 0 0 1px var(--altai-forest) inset; }
.sched-type:focus-within { outline: 2px solid var(--altai-forest); outline-offset: 2px; }
.sched-days label { min-width: 72px; justify-content: center; }
#sched-end-hint { margin-top: 8px; }
.sched-preview { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #FAFBF8; }
.sched-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sched-preview-head .sched-step { margin: 0; }
.sched-preview-head strong { color: var(--altai-forest); }
#sched-months { display: grid; gap: 14px; margin-top: 12px; max-height: 42vh; overflow-y: auto; }
.sched-month h4 { display: flex; gap: 10px; align-items: baseline; margin: 0 0 6px; font-size: 0.88rem; }
.sched-month h4 span { font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.sched-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.sched-date {
  display: grid; gap: 1px; padding: 6px 10px; border: 1px solid #C3DBB7; border-radius: 10px;
  background: #fff; font: inherit; font-size: 0.8rem; text-align: left; cursor: pointer;
}
.sched-date span { color: var(--muted); font-size: 0.72rem; }
.sched-date:hover { border-color: var(--altai-forest); }
.sched-date.is-skipped { border-style: dashed; border-color: var(--line); background: transparent; opacity: 0.55; }
.sched-date.is-skipped strong { text-decoration: line-through; }
.sched-own-note { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: #F1F6EE; color: var(--altai-forest); font-size: 0.88rem; }
.repeat-head .btn-ai { margin-left: auto; }
.repeat-head .btn-ai + .repeat-tools { margin-left: 0; }

/* ---------- SEO & keywords ---------- */
.seo-card { display: grid; gap: 20px; }
.seo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.seo-form .wide { grid-column: 1 / -1; }
.seo-platforms { border: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.seo-platforms legend { font-weight: 600; font-size: 0.875rem; margin-bottom: 6px; }
.seo-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seo-result:empty { display: none; }
.seo-result { display: grid; gap: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.seo-result h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seo-result h4 { font-size: 0.85rem; margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; color: var(--altai-forest); }
.seo-result ul, .seo-result ol { padding-left: 20px; display: grid; gap: 6px; }
.seo-head { display: flex; gap: 18px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.seo-head > div:not(.seo-score):not(.seo-head-actions) { flex: 1 1 380px; display: grid; gap: 6px; }
.seo-head h2 { font-size: 1.4rem; color: var(--charcoal); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seo-head-actions { display: flex; gap: 8px; }
.seo-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.seo-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.seo-table table { min-width: 720px; }
.seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.seo-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #FBFBF8; min-width: 0; }
.seo-box > h3 { margin-bottom: 6px; }
.seo-ig { border-top: 4px solid #D6249F; }
.seo-tt { border-top: 4px solid #111; }
.seo-yt { border-top: 4px solid #E62117; }
.seo-fb { border-top: 4px solid #1877F2; }
.seo-dl { display: grid; gap: 4px; }
.seo-dl dt { font-weight: 600; font-size: 0.8rem; margin-top: 8px; display: flex; gap: 8px; }
.seo-dl dd { overflow-wrap: anywhere; }
.seo-over { color: var(--danger); font-weight: 700; }
.seo-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.seo-tags { color: #1F5FA8; overflow-wrap: anywhere; font-size: 0.9rem; }
.seo-copy { margin-left: 4px; padding: 2px 10px; min-height: 0; font-size: 0.75rem; vertical-align: middle; }
.seo-src { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #EEF0EA; color: var(--muted); }
.seo-src-google { background: #E6EEFB; color: #1F5FA8; }
.seo-src-youtube { background: #FBE6E5; color: #B3261E; }
.seo-src-gsc { background: #E3F1DD; color: #24572F; }
.seo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seo-chips span { padding: 3px 10px; border-radius: 999px; background: #EEF0EA; font-size: 0.82rem; }
.seo-signals { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; }
.seo-signals summary { cursor: pointer; font-weight: 600; }
.seo-summary { font-size: 1.02rem; background: #EDF3EA; border-radius: 10px; padding: 12px 16px; }
.seo-gsc-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seo-gsc-bar .hint { margin-right: auto; }
.seo-kpis { margin: 4px 0; }
.seo-setup { display: grid; gap: 12px; max-width: 820px; }
.seo-setup ol { padding-left: 22px; display: grid; gap: 8px; }
.seo-setup code, .seo-dl code { background: #EEF0EA; padding: 1px 6px; border-radius: 4px; font-size: 0.85em; }
.seo-score { --c: var(--altai-forest); flex: 0 0 96px; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #EEF0EA 0); }
.seo-score.warn { --c: #C98A1B; }
.seo-score.bad { --c: var(--danger); }
.seo-score strong { font-size: 1.8rem; line-height: 1; }
.seo-score span { font-size: 0.75rem; color: var(--muted); }
.seo-checks { list-style: none; padding: 0 !important; }
.seo-checks li { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.seo-checks li.ok b { color: #24572F; }
.seo-checks li.no b { color: var(--danger); }
.seo-checks li span { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 640px) {
  .seo-grid { grid-template-columns: 1fr; }
  .seo-head-actions { width: 100%; }
}

/* ---------- SEO panel (Yoast Premium style) — staff/js/seo-panel.js ---------- */
.ys { display: grid; gap: 16px; min-width: 0; }
.ys-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.ys-brand { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 300px; }
.ys-brand h2 { font-size: 1.08rem; }
.ys-brand p { font-size: 0.85rem; color: var(--muted); }
.ys-logo { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #A4286A; color: #fff; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; }
.ys-lights { display: flex; gap: 8px; flex-wrap: wrap; }
.ys-light { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #F4F5F0; font-size: 0.8rem; font-weight: 600; }
.ys-dot { display: inline-block; flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; background: #B4B7B0; }
.ys-dot.is-good, .is-good > .ys-dot { background: #7AD03A; }
.ys-dot.is-ok, .is-ok > .ys-dot { background: #EE7C1B; }
.ys-dot.is-bad, .is-bad > .ys-dot { background: #DC3232; }
.ys-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ys-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 600; font-size: 0.88rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ys-tabs button[aria-selected="true"] { color: #A4286A; border-bottom-color: #A4286A; }
.ys-pane { display: grid; gap: 14px; min-width: 0; }
.ys-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ys-field { min-width: 0; }
.ys-field small.hint { font-weight: 400; }
.ys-sub { font-size: 0.95rem; color: var(--charcoal); margin-top: 6px; }
.ys-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ys-actions select { width: auto; }
.ys-vars { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-weight: 400; }
.ys-vars small { color: var(--muted); margin-right: 2px; }
.ys-var { border: 1px solid var(--line); background: #F7F7F2; border-radius: 999px; padding: 1px 8px; font: inherit; font-size: 0.74rem; cursor: pointer; }
.ys-var:hover { border-color: #A4286A; color: #A4286A; }
.ys-bar { display: grid; gap: 3px; font-weight: 400; }
.ys-bar::before { content: ""; grid-area: 1 / 1; height: 6px; border-radius: 3px; background: #ECEDE6; }
.ys-bar i { grid-area: 1 / 1; height: 6px; border-radius: 3px; width: 0; background: #B4B7B0; transition: width 0.2s, background 0.2s; }
.ys-bar.is-good i { background: #7AD03A; }
.ys-bar.is-ok i { background: #EE7C1B; }
.ys-bar.is-bad i { background: #DC3232; }
.ys-bar small { font-size: 0.74rem; color: var(--muted); }
.ys-device { border: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.ys-device label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.ys-device input { width: auto; min-height: 0; }
.ys-switch { padding-top: 4px; }
.ys-empty { color: var(--muted); font-size: 0.88rem; }

/* Google result */
.ys-google { min-width: 0; }
.ys-g { background: #fff; border: 1px solid #E3E5DE; border-radius: 12px; padding: 14px 16px; font-family: Arial, sans-serif; max-width: 652px; overflow: hidden; }
.ys-g.is-mobile { max-width: 400px; box-shadow: 0 1px 6px rgba(32, 33, 36, 0.18); border: 0; }
.ys-g-site { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.ys-g-site img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #ECEDE6; padding: 2px; background: #fff; }
.ys-g-site div { display: grid; line-height: 1.25; min-width: 0; }
.ys-g-site span { font-size: 14px; color: #202124; }
.ys-g-site cite { font-style: normal; font-size: 12px; color: #4D5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ys-g-dots { margin-left: auto; color: #70757A; }
.ys-g-body { display: flex; gap: 12px; align-items: flex-start; }
.ys-g h3 { font-family: Arial, sans-serif; font-weight: 400; font-size: 20px; line-height: 1.3; color: #1A0DAB; margin: 0 0 4px; }
.ys-g.is-mobile h3 { font-size: 18px; color: #1558D6; }
.ys-g p { font-size: 14px; line-height: 1.58; color: #4D5156; overflow-wrap: anywhere; }
.ys-g p b { color: #202124; }
.ys-g p.is-fallback { color: #70757A; }
.ys-g-date { color: #70757A; }
.ys-g-thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }

/* Analysis */
.ys-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; background: #FCFCFA; }
.ys-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.ys-box > summary::-webkit-details-marker, .ys-group > summary::-webkit-details-marker { display: none; }
.ys-box > summary::after, .ys-group > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.2s; }
.ys-box:not([open]) > summary::after, .ys-group:not([open]) > summary::after { transform: rotate(-90deg); }
.ys-box h3 { font-size: 0.95rem; }
.ys-box h3 small { font-weight: 400; color: var(--muted); }
.ys-group { border-top: 1px solid var(--line); padding: 8px 0 0; margin-top: 4px; }
.ys-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.86rem; color: var(--charcoal); padding: 2px 0 6px; }
.ys-checks { list-style: none; display: grid; gap: 8px; padding: 2px 0 6px; }
.ys-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; line-height: 1.45; }
.ys-checks .ys-dot { margin-top: 4px; }
.ys-related-list { display: grid; gap: 8px; }
.ys-related-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.ys-related-group summary { font-weight: 600; }

/* Suggestions (AI, saved research) */
.ys-suggest { display: grid; gap: 8px; border: 1px dashed #D9A96C; background: #FFFBF3; border-radius: 12px; padding: 12px; }
.ys-suggest > strong small { font-weight: 400; color: var(--muted); }
.ys-suggest-col, .ys-suggest-set { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ys-suggest-col > small, .ys-suggest-set > small { flex-basis: 100%; color: var(--muted); font-weight: 600; }
.ys-chip { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 5px 10px; font: inherit; font-size: 0.82rem; text-align: left; cursor: pointer; max-width: 100%; }
.ys-chip b { color: #A4286A; font-size: 0.72rem; margin-right: 4px; }
.ys-chip:hover { border-color: #A4286A; }
.ys-why { flex-basis: 100%; color: var(--muted); font-size: 0.76rem; margin-top: -4px; }

/* Internal links */
.ys-link-list { list-style: none; display: grid; gap: 6px; }
.ys-link-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #EEEFEA; font-size: 0.88rem; }
.ys-link-title { flex: 1; min-width: 0; }
.ys-link-title b { color: #D9A96C; }
.ys-kind { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #F1F2EC; border-radius: 6px; padding: 2px 6px; }
.ys-linked { color: var(--altai-forest); font-size: 0.8rem; font-weight: 600; }

/* Social */
.ys-social { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.ys-social > div { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ys-fb { border: 1px solid #DADDE1; background: #F0F2F5; overflow: hidden; border-radius: 4px; }
.ys-fb img, .ys-x img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.ys-fb-text { display: grid; gap: 2px; padding: 10px 12px; font-family: Helvetica, Arial, sans-serif; }
.ys-fb-text small { color: #606770; font-size: 12px; }
.ys-fb-text strong { color: #1D2129; font-size: 16px; line-height: 1.25; }
.ys-fb-text span { color: #606770; font-size: 14px; line-height: 1.3; }
.ys-x { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid #CFD9DE; display: grid; }
.ys-x-title { position: absolute; left: 10px; bottom: 30px; max-width: calc(100% - 20px); background: rgba(0, 0, 0, 0.75); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ys-x small { padding: 6px 10px; color: #536471; font-size: 13px; }
.ys-noimg { aspect-ratio: 1.91 / 1; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; background: #ECEDE6; }

/* Insights */
.ys-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.ys-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; background: #fff; }
.ys-stats b { font-size: 1.25rem; color: var(--altai-forest); }
.ys-stats small { color: var(--muted); font-size: 0.78rem; }
.ys-insights { display: grid; gap: 10px; }
.ys-insights h4, .ys-pane > h4 { font-size: 0.9rem; margin-top: 4px; }
.ys-prominent { display: flex; flex-wrap: wrap; gap: 6px; }
.ys-prominent span { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 0.82rem; background: #fff; }
.ys-prominent span b { color: var(--muted); font-weight: 600; }
.ys-prominent span.is-kp { border-color: #7AD03A; background: #F1FAEA; }
.ys-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-top: 10px; }
.ys-table th, .ys-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #EEEFEA; }
.ys-table tr.is-focus td { background: #F1FAEA; }
.ys-gsc-result { overflow-x: auto; }
.ys-old-slugs ul { list-style: none; display: grid; gap: 6px; }
.ys-old-slugs li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; }
@media (max-width: 600px) {
  .ys-related-row { grid-template-columns: 1fr auto; }
  .ys-related-row label:nth-child(2) { grid-column: 1; }
}

/* ---------- Blog: Write with AI (staff/js/app.js → aiw-*, functions/api/ai-post.js) ---------- */
.ai-writer { border: 1px solid #D9CFF0; background: linear-gradient(180deg, #FBF9FF, #fff 120px); }
.ai-writer > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; cursor: pointer; list-style: none; }
.ai-writer > summary::-webkit-details-marker { display: none; }
.ai-writer > summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
.ai-writer[open] > summary::after { content: '▴'; }
.ai-writer-title { font-weight: 700; font-size: 1.05rem; color: #4B3A86; }
.ai-writer-body { display: grid; gap: 12px; margin-top: 12px; }
.ai-writer-body textarea { resize: vertical; line-height: 1.5; }
.aiw-sections-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.aiw-sections { display: grid; gap: 8px; }
.aiw-section { display: grid; grid-template-columns: 28px minmax(0, 1fr) 30px; gap: 8px; align-items: start; padding: 8px; border: 1px solid #ECE7F7; border-radius: 8px; background: #fff; }
.aiw-section > b { padding-top: 8px; text-align: center; color: #6B5BB0; }
.aiw-section > div { display: grid; gap: 6px; }
.aiw-section textarea { min-height: 52px; }
.aiw-options { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 10px 20px; align-items: start; }
.aiw-photos { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; }
.aiw-photos label, .check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.88rem; }
.aiw-photos input, .check-row input { width: 16px; min-height: 16px; accent-color: var(--altai-forest); }
.aiw-options .check-row { grid-column: 1 / -1; }
#aiw-status { flex: 1 1 200px; }
.block-head .btn-ai + .repeat-tools { margin-left: 0; }
.block-head .btn-ai { margin-left: auto; margin-right: 6px; min-height: 28px; padding: 2px 10px; font-size: 0.8rem; }
.block-ai { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border-radius: 8px; background: #F7F4FE; }
.block-ai input { flex: 1 1 240px; min-width: 0; }
.ai-need { margin: 0; padding: 8px 10px; border-radius: 8px; background: #FFF7E6; color: #7A5A12; font-size: 0.85rem; }
.block.is-ai-busy { opacity: 0.6; pointer-events: none; }
@media (max-width: 700px) {
  .aiw-options { grid-template-columns: 1fr; }
}

/* ---------- Tour bookings: stages and the booking page ---------- */
.booking-toolbar { align-items: flex-end; }
.stage-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--muted);
}
.stage-tab b { min-width: 22px; padding: 0 7px; border-radius: 999px; background: #EEF0EA; font-size: 0.75rem; text-align: center; }
.stage-tab b.is-alert { background: #FCEFD3; color: #8A5509; }
.stage-tab.is-active { border-color: var(--altai-forest); background: var(--altai-forest); color: #fff; }
.stage-tab.is-active b { background: rgba(255, 255, 255, 0.2); color: #fff; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #F6F8F3; }
.chip-sm { padding: 1px 8px; font-size: 0.75rem; margin: 1px 0; }

.booking-view { display: grid; gap: 16px; padding-bottom: 96px; }
.bv-head { display: flex; gap: 14px; align-items: flex-start; }
.bv-head .icon-btn { flex: none; border: 1px solid var(--line); background: #fff; }
.bv-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bv-title-row h1 { margin: 0; }
.bv-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; color: var(--muted); font-size: 0.9rem; }
.bv-meta span { display: inline-flex; align-items: center; gap: 6px; }
.bv-meta .ic { width: 16px; height: 16px; }
.bv-tabs { border-bottom: 1px solid var(--line); }
.bv-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.bv-col { display: grid; gap: 16px; }
.bv-card { display: grid; gap: 12px; }
.bv-card h2 { font-size: 1.05rem; margin: 0; }
.bv-card label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.bv-dl { display: grid; gap: 0; margin: 0; }
.bv-dl > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid #F0F1EC; font-size: 0.9rem; }
.bv-dl > div:last-child { border-bottom: 0; }
.bv-dl dt { color: var(--muted); }
.bv-dl dd { margin: 0; overflow-wrap: anywhere; }
.bv-quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--steppe-green); background: #F6F8F3; border-radius: 0 8px 8px 0; white-space: pre-line; font-size: 0.9rem; }
.bv-price .form-actions { margin-top: 0; }
.bv-progress { grid-template-columns: repeat(3, 1fr); }
.bv-progress div { display: grid; }
.bv-progress strong { font-size: 1.3rem; color: var(--altai-forest); }
.bv-travellers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.bv-traveller { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.bv-traveller header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bv-traveller header strong { font-size: 1rem; margin-right: auto; }
.bv-traveller .bv-dl > div { grid-template-columns: 130px minmax(0, 1fr); padding: 5px 0; font-size: 0.85rem; }
.bv-traveller.is-missing { border-style: dashed; background: #FBFBF8; }
.bv-traveller .btn { justify-self: start; }
.bv-doclist { list-style: none; display: grid; gap: 6px; }
.bv-doclist li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #F0F1EC; font-size: 0.9rem; }
.bv-crew { display: grid; gap: 12px; }
.bv-crew-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #F0F1EC; }
.bv-crew-role { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.bv-timeline { list-style: none; display: grid; gap: 0; }
.bv-timeline li { position: relative; display: grid; padding: 0 0 16px 28px; }
.bv-timeline li::before { content: ''; position: absolute; left: 6px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--altai-forest); }
.bv-timeline li::after { content: ''; position: absolute; left: 11px; top: 18px; bottom: 0; width: 2px; background: #DCE7D6; }
.bv-timeline li:last-child::after { display: none; }
.bv-life {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 12px 16px; border-radius: 14px; background: #F1F7EE; border: 1px solid #CFE3C6;
  box-shadow: 0 8px 24px rgba(27, 94, 59, 0.12);
}
.bv-next { display: flex; gap: 8px; align-items: center; margin: 0; flex: 1 1 260px; font-size: 0.9rem; }
.bv-next .ic { color: var(--altai-forest); flex: none; }
.bv-steps { display: flex; list-style: none; gap: 4px; align-items: center; flex-wrap: wrap; }
.bv-steps li { padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.bv-steps li + li::before { content: '→'; margin: 0 8px 0 -6px; color: #A9AFA9; }
.bv-steps li.is-done { color: var(--altai-forest); }
.bv-steps li.is-now { background: #FCEFD3; color: #8A5509; }
.bv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 960px) {
  .bv-grid { grid-template-columns: 1fr; }
  .bv-life { position: static; }
  .bv-progress { grid-template-columns: 1fr 1fr 1fr; }
  .bv-dl > div { grid-template-columns: 120px minmax(0, 1fr); }
  .bv-crew-row { grid-template-columns: 1fr; }
}
.trip-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.permit-insert { margin-left: auto; }
.permit-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.permit-add input[type="text"] { flex: 1 1 180px; min-height: 34px; }
.bv-body { display: grid; gap: 16px; }
.bv-travellers { align-items: start; }

/* ---------- Team sign-ups (Team & users) ---------- */
.signup-list { display: grid; gap: 8px; }
.signup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.signup-row .who { flex: 1 1 220px; display: grid; gap: 2px; }
.signup-row .who small { color: var(--muted); }
.signup-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.status-pill.pending { background: var(--warn-bg); color: #8A5A00; }
.status-pill.approved { background: #EAF3E6; color: var(--altai-forest); }
.status-pill.rejected { background: #F8E3E1; color: var(--danger); }
.signups-hint { padding: 0 20px 12px; }
#signups-table { padding: 0 16px 16px; }
#signups-table .empty { padding: 4px; }
