:root {
  --red: #B8161E;
  --red-2: #c91d26;
  --red-3: #7e1016;
  --ruby: #5f090e;
  --ruby-2: #8a1118;
  --black: #050505;
  --ink: #0a0a0a;
  --panel: rgba(31, 7, 9, .78);
  --panel-2: rgba(0, 0, 0, .62);
  --line: rgba(255, 255, 255, .16);
  --white: #fff7f2;
  --muted: rgba(255, 247, 242, .72);
  --ok: #52d273;
  --danger: #ffb0b0;
  --radius: 28px;
  --shadow: 0 28px 76px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, .12), transparent 30%),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, .035), transparent 28%),
    linear-gradient(180deg, #c91d26 0%, #bd121c 46%, #a70c14 100%);
  background-attachment: fixed;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

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

.page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0 16px 34px;
}

.brand-hero {
  display: block;
  text-align: center;
  color: var(--ink);
  padding: 0 0 10px;
  overflow: visible;
}

.brand-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 20px;
}

.tab-btn {
  min-height: 68px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(130, 17, 24, .72), rgba(70, 5, 9, .86));
  color: var(--white);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: .2em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 34px rgba(0,0,0,.18);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--ruby-2), var(--red-3));
  border-color: rgba(255,255,255,.32);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 18px 36px rgba(0,0,0,.24);
}

.line-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,.42);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #777;
}
.line-status.connected .dot { background: var(--ok); }
.line-status.connected strong { color: var(--ok); }

.panel {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 34px;
  padding: 14px 14px 22px;
  background: rgba(255,255,255,.055);
  box-shadow: var(--shadow);
}

.form {
  display: grid;
  gap: 18px;
}

.field-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), transparent),
    rgba(35, 4, 7, .66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 16px 28px rgba(0,0,0,.18);
  padding: 26px 28px;
  overflow: hidden;
}

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.label .icon {
  width: 26px;
  text-align: center;
  letter-spacing: 0;
}

input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 62px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: rgba(4, 1, 2, .76);
  color: var(--white);
  padding: 0 22px;
  outline: none;
  color-scheme: dark;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  font-size: 17px;
}

input[type="date"] {
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  height: 62px;
  line-height: 62px;
  padding: 0 16px;
  overflow: hidden;
}

input[type="date"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  line-height: 1;
}

input[type="date"]::-webkit-datetime-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0;
  line-height: 1;
}

select {
  height: 62px;
  min-height: 62px;
  font-size: 20px;
  line-height: 1.25;
}

input::placeholder, textarea::placeholder { color: rgba(255,255,255,.42); }
input.soft-autofill {
  color: rgba(255, 247, 242, .58);
}
input.soft-autofill:focus {
  color: var(--white);
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(255, 185, 192, .72);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .08);
}

textarea {
  min-height: 150px;
  padding: 18px 22px;
  resize: vertical;
  line-height: 1.5;
}

.guest-grid {
  display: grid;
  gap: 12px;
}

.guest-custom {
  display: none;
}
.guest-custom.show { display: block; }

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

.note-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  align-items: start;
}

.note-no {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ruby-2), var(--red-3));
  font-weight: 950;
}

.note-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.36;
}

.note-item span {
  color: rgba(255,247,242,.86);
  line-height: 1.55;
}

.agree {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  background: rgba(4,1,2,.52);
  cursor: pointer;
}

.agree input {
  width: 46px;
  height: 46px;
  min-height: 46px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.agree input:checked {
  border-color: #2fd66f;
  background: #2fd66f;
}

.agree input:checked::after {
  content: "";
  width: 16px;
  height: 9px;
  border-left: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.agree strong {
  display: block;
  font-size: 16px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.agree-thai {
  display: block;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.35;
}

.submit-btn {
  width: 100%;
  min-height: 74px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ruby-2), var(--red-3));
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .18em;
  text-transform: uppercase;
  box-shadow: 0 22px 48px rgba(0,0,0,.28);
}

.submit-btn:disabled {
  opacity: .58;
  cursor: wait;
}

.submit-btn.ready {
  background: linear-gradient(135deg, #31d875, #0b9f4f);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255,255,255,.14) inset;
}

.status {
  min-height: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}
.status.ok { color: var(--ok); }
.status.error { color: var(--danger); }

.success {
  display: none;
  margin-top: 0;
}
.success.show { display: block; }

.success-status {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0 0 20px;
  text-align: center;
}

.success-check {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #31d875, #0b9f4f);
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(0,0,0,.28), 0 0 0 8px rgba(49,216,117,.16);
}

.success-check.is-hidden {
  display: none;
}

.success h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.success-card {
  display: grid;
  border-radius: 30px;
  background: rgba(0,0,0,.58);
  padding: 22px;
  border: 1px solid rgba(255,255,255,.12);
}

.success-card .summary { order: 1; }
.success-card .email-note { order: 2; }
.success-card .manage-booking-btn { order: 3; }
.success.is-cancelled .success-card .manage-booking-btn { order: 2; }
.success.is-cancelled .success-card .email-note {
  order: 3;
  justify-content: center;
  text-align: center;
}

.email-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  color: rgba(255,247,242,.86);
  line-height: 1.45;
  font-size: 14px;
}

.email-note .icon {
  font-size: 22px;
  flex: 0 0 auto;
}

.email-note .icon.is-hidden {
  display: none;
}

.manage-booking-btn {
  margin-top: 18px;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.summary {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: var(--muted);
}
.summary strong { color: var(--white); text-align: right; }

.manage-panel {
  display: none;
  border-radius: 34px;
  padding: 28px;
  background: rgba(35, 4, 7, .66);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
}
.manage-panel.show { display: block; }
.manage-panel h2 { margin: 0 0 12px; }
.manage-panel p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }

.manage-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.booking-result {
  display: none;
  margin-top: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: rgba(0,0,0,.44);
  padding: 18px;
}
.booking-result.show { display: block; }

.booking-list {
  display: grid;
  gap: 12px;
}

.booking-card {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: rgba(35, 4, 7, .78);
  color: var(--white);
  padding: 16px;
  text-align: left;
  display: grid;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.booking-card strong {
  font-size: 17px;
  letter-spacing: .04em;
}

.booking-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.summary .editable-row {
  align-items: center;
}

.summary-control {
  width: min(360px, 62%);
  min-height: 44px;
  height: 44px;
  border-radius: 16px;
  padding: 0 14px;
  font-size: 15px;
  text-align: right;
}

.edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.danger-btn {
  background: linear-gradient(135deg, #7a1117, #3b0508);
}

.exit-btn {
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(0,0,0,.38));
}

.notice-dialog {
  width: min(420px, calc(100% - 34px));
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 28px;
  background: #120305;
  color: var(--white);
  padding: 0;
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
}

.notice-dialog::backdrop {
  background: rgba(0,0,0,.72);
}

.notice-body {
  padding: 26px;
  text-align: center;
}

.notice-title {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.42;
  font-weight: 950;
}

.notice-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 750;
}

.notice-close {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ruby-2), var(--red-3));
  color: #fff;
  padding: 0 28px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 18px;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,.14);
}

.contact a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(38, 3, 6, .36);
  color: rgba(255,247,242,.72);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.ig-icon, .map-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: 0 0 auto;
  opacity: .8;
}

.footer {
  text-align: center;
  color: rgba(255,247,242,.48);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .05em;
  line-height: 1.7;
}

.footer strong { font-weight: 500; }

@media (max-width: 520px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .brand-hero { padding: 0 0 8px; }
  .brand-logo { width: 100%; }
  .tabs { gap: 10px; }
  .tab-btn { min-height: 60px; font-size: 14px; }
  .field-card { padding: 22px 20px; border-radius: 26px; }
  .label { font-size: 15px; letter-spacing: .16em; }
  input, select { height: 58px; min-height: 58px; border-radius: 20px; font-size: 16px; line-height: normal; }
  input[type="date"] { height: 58px; min-height: 58px; font-size: 16px; line-height: 58px; padding: 0 14px; }
  input[type="number"] { height: 58px; min-height: 58px; padding: 0 18px; }
  select { height: 58px; min-height: 58px; padding: 0 18px; }
  .note-item { grid-template-columns: 42px 1fr; gap: 14px; }
  .note-no { width: 42px; height: 42px; }
  .contact { gap: 10px; }
  .contact a { min-height: 44px; font-size: 12px; padding: 0 10px; }
  .ig-icon, .map-icon { width: 20px; height: 20px; }
  .panel { padding-bottom: 24px; }
  .submit-btn { margin-top: 0; }
  .status:empty { display: none; }
  .agree { grid-template-columns: 46px 1fr; gap: 14px; }
  .agree strong { font-size: 14px; letter-spacing: .08em; }
  .agree-thai { font-size: 12px; line-height: 1.25; }
  .email-note { font-size: 13px; align-items: flex-start; }
  .edit-actions { grid-template-columns: 1fr; }
  .summary-control { width: 64%; font-size: 14px; }
}
  
