:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --ink: #20242a;
  --muted: #66717c;
  --line: #dbe2dc;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #e6f2ed;
  --warm-soft: #fff7ed;
  --warm: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 40px rgba(32, 36, 42, 0.08);
  --shadow-soft: 0 10px 26px rgba(32, 36, 42, 0.06);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfcf8 0, var(--bg) 260px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.loading-state,
.empty-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.loading-mark {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.guest-layout {
  min-height: 100vh;
}

.guest-top {
  background:
    linear-gradient(135deg, #ffffff 0%, #fbfbf4 56%, #f2f8f4 100%);
  border-bottom: 1px solid var(--line);
}

.guest-top-inner,
.guest-main,
.admin-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.guest-top-inner {
  display: grid;
  gap: 20px;
  padding: 24px 0 22px;
}

.portal-title,
.portal-actions,
.stay-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.portal-actions {
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(32, 36, 42, 0.06);
}

.language-switch button {
  min-width: 44px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.active {
  background: var(--accent);
  color: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0;
}

.subtitle {
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.45;
  max-width: 760px;
}

.stay-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stay-strip div {
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.stay-strip div:last-child {
  border-right: 0;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 4px;
}

.value {
  display: block;
  font-weight: 750;
}

.guest-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 22px 0 40px;
}

.section-band,
.chat-panel,
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.section-band {
  padding: 18px;
  margin-bottom: 16px;
}

.status-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  align-items: center;
  gap: 16px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0) 46%),
    var(--surface);
}

.status-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.access-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px dashed #bd9b70;
  border-radius: var(--radius);
  background: #fff7ed;
  padding: 12px;
}

.access-code span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.access-code strong {
  font-size: 2rem;
  line-height: 1;
}

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

.timeline {
  counter-reset: timeline-step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.timeline-item,
.guide-tile,
.recommendation,
.stay-row,
.feedback-row,
.property-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.timeline-item {
  position: relative;
  counter-increment: timeline-step;
  padding: 12px;
  min-height: 148px;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.timeline-item::before {
  content: counter(timeline-step);
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 850;
}

.timeline-item:hover {
  border-color: #b7d6c8;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}

.timeline-time {
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 10px;
  padding-right: 34px;
}

.timeline-item p,
.guide-tile p,
.recommendation p,
.chat-message p {
  margin: 8px 0 0;
  line-height: 1.45;
  color: var(--muted);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-tile {
  padding: 14px;
}

.guide-tile pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.45;
  font-family: var(--font);
}

.recommendations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recommendation {
  padding: 12px;
}

.chat-panel {
  height: clamp(560px, 68vh, 760px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  margin-bottom: 18px;
}

.chat-panel.is-locked {
  height: auto;
  min-height: 330px;
  grid-template-rows: auto 1fr auto;
}

.chat-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}

.quick-questions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.quick-questions button,
.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.quick-questions button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--accent);
}

.guide-button {
  gap: 8px;
  border-color: rgba(15, 118, 110, 0.28);
  background: #f4fbf8;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 9px 12px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.guide-button:hover {
  border-color: var(--accent);
  background: #e8f7f1;
  color: var(--accent);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.2);
  transform: translateY(-1px);
}

.guide-button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 3px;
}

.guide-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0;
  line-height: 1;
}

.guide-button:hover .guide-button-icon {
  background: var(--accent-dark);
}

.quick-questions button:disabled,
.chat-form input:disabled,
.chat-form button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.chat-form input:disabled {
  background: #f5f6f4;
}

.chat-form button:disabled,
.chat-form button:disabled:hover {
  background: #d8ddd8;
  color: var(--muted);
}

.access-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.guest-roster {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.04), rgba(255, 255, 255, 0) 62%),
    var(--surface);
}

.compact-head {
  margin-bottom: 14px;
}

.guest-roster-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.guest-roster-item {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.guest-roster-item strong,
.guest-roster-item span {
  display: block;
}

.guest-roster-item strong {
  font-size: 0.96rem;
}

.guest-roster-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.guest-roster-item.is-verified {
  border-color: rgba(15, 118, 110, 0.24);
  background: #f4fbf8;
}

.guest-roster-item.is-empty {
  border-style: dashed;
  background: #fafaf8;
}

.guest-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.guest-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #f1f5f3;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.guest-tag.is-verified {
  background: #dff3eb;
  color: var(--accent-strong);
}

.guest-tag.is-pending {
  background: #fff7ed;
  color: #9a5a10;
}

.lock-panel {
  margin: 12px 16px 0;
  padding: 14px;
  border: 1px solid #ead2a8;
  border-radius: var(--radius);
  background: var(--warm-soft);
}

.chat-panel.is-locked .lock-panel {
  align-self: start;
  margin: 18px;
}

.lock-panel strong {
  display: block;
}

.lock-panel p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.form-progress {
  margin: 10px 0 0;
  color: var(--warm);
  font-size: 0.86rem;
  font-weight: 800;
}

.chat-log {
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}

.chat-message.guest {
  align-self: flex-end;
  background: var(--surface-2);
  border-color: #b7d6c8;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message .sender {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-body {
  margin-top: 6px;
  color: var(--ink);
  line-height: 1.5;
}

.chat-body p {
  margin: 0;
}

.chat-body p + p,
.chat-body p + ul,
.chat-body ul + p {
  margin-top: 8px;
}

.chat-body ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.chat-body li {
  margin: 5px 0;
}

.chat-message.assistant .chat-body p:first-child {
  font-weight: 800;
}

.chat-body a {
  color: var(--accent-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.feedback-panel {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
  align-items: start;
  background:
    linear-gradient(120deg, rgba(238, 245, 241, 0.72), rgba(255, 255, 255, 0) 52%),
    var(--surface);
}

.feedback-panel.is-locked {
  align-items: center;
}

.feedback-intro {
  max-width: 520px;
}

.feedback-lock {
  margin: 0;
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.feedback-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feedback-options label {
  position: relative;
  min-width: 0;
}

.feedback-options input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.feedback-options span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.feedback-options input:checked + span {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--accent-strong);
}

.feedback-options input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feedback-textarea {
  display: grid;
  gap: 6px;
}

.feedback-textarea span,
.feedback-follow {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.feedback-textarea textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px;
}

.feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-follow {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.feedback-follow input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.feedback-status {
  min-height: 20px;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 750;
  line-height: 1.45;
}

.chat-form input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.primary-button,
.chat-form button {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  min-height: 42px;
  padding: 9px 14px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.primary-button:hover,
.chat-form button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled,
.chat-form button:disabled {
  cursor: not-allowed;
  background: #d8ddd8;
  color: var(--muted);
}

.danger {
  color: var(--danger);
}

.admin-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.admin-main {
  padding: 22px 0 44px;
  display: grid;
  gap: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.row-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.stay-row,
.feedback-row,
.property-row {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.feedback-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.token-box {
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.notice {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.local-notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff7ed;
  padding: 10px 12px;
}

.task-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.task-list input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-strip div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.metric-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.7rem;
  line-height: 1;
}

.dense-list {
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-strong);
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.muted-pill {
  background: #f5f6f4;
  color: var(--muted);
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    height: min(680px, 82vh);
  }

  .timeline,
  .recommendations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-panel,
  .feedback-panel,
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .guest-top-inner,
  .guest-main,
  .admin-main,
  .admin-header-inner {
    width: min(100% - 22px, 1180px);
  }

  .stay-strip,
  .timeline,
  .guide-grid,
  .recommendations,
  .guest-roster-list,
  .feedback-panel,
  .feedback-options,
  .form-grid,
  .status-panel,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .portal-title,
  .admin-header-inner,
  .stay-row-main {
    display: grid;
  }

  .stay-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stay-strip div:last-child {
    border-bottom: 0;
  }

  .section-band,
  .admin-panel {
    padding: 14px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}
