:root {
  --bg: var(--tg-theme-bg-color, #f4f7f8);
  --surface: var(--tg-theme-secondary-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #17212b);
  --muted: var(--tg-theme-hint-color, #71808e);
  --border: rgba(23, 33, 43, 0.1);
  --accent: var(--tg-theme-button-color, #0aa6a6);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: #c2413b;
  --ok: #1b9b5a;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
}

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

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 26px;
  font-weight: 750;
}

h2 {
  font-size: 17px;
  font-weight: 750;
}

.status {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

.metric,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric {
  min-height: 78px;
  padding: 12px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.panel {
  margin-bottom: 10px;
  padding: 12px;
}

.panel.compact {
  padding: 13px 12px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-radius: var(--radius);
  padding: 3px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mode-note {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.search,
.settings label,
.scenario-list {
  display: grid;
  gap: 7px;
}

.search span,
.settings span,
.scenario-list > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
}

input:focus {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.selected-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.hotel-list,
.request-list {
  display: grid;
  gap: 6px;
}

.hotel-row,
.request-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--bg);
}

.hotel-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hotel-name,
.request-title {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.hotel-meta,
.request-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.badge {
  border-radius: 999px;
  padding: 4px 7px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.settings {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 10px;
  margin-top: 11px;
}

.scenario-list {
  margin-top: 11px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 9px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
}

.bottom-action {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.primary {
  display: block;
  width: min(100%, 760px);
  min-height: 48px;
  margin: 0 auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 800;
}

.primary:disabled {
  cursor: default;
  opacity: 0.55;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  left: 14px;
  display: none;
  max-width: 732px;
  margin: 0 auto;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #17212b;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.toast.is-visible {
  display: block;
}

.is-hidden {
  display: none;
}

@media (max-width: 380px) {
  h1 {
    font-size: 23px;
  }

  .summary-grid,
  .settings {
    grid-template-columns: 1fr;
  }

  .hotel-row,
  .request-row {
    grid-template-columns: 24px 1fr;
  }

  .badge {
    grid-column: 2;
    justify-self: start;
  }
}
