:root {
  --ink: #18332d;
  --ink-soft: #5a706a;
  --cream: #f7f0e4;
  --paper: #fffdf8;
  --terracotta: #e36c4b;
  --terracotta-dark: #bd5034;
  --mint: #badbcb;
  --mint-light: #e4f1eb;
  --lime: #d9e975;
  --line: rgba(24, 51, 45, 0.13);
  --shadow: 0 30px 80px rgba(49, 53, 42, 0.18);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(227, 108, 75, 0.18), transparent 20rem),
    radial-gradient(circle at 88% 28%, rgba(186, 219, 203, 0.55), transparent 24rem),
    var(--cream);
  font-family: "DM Sans", sans-serif;
}

button { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1280px;
  margin: auto;
  padding: 1.25rem 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50% 50% 50% 15%;
  color: var(--paper);
  background: var(--terracotta);
  font-family: "Space Grotesk", sans-serif;
}

.demo-switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
}

.switch-btn, .reset-btn {
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.switch-btn { padding: 0.6rem 1rem; }
.switch-btn.active { color: var(--paper); background: var(--ink); }
.reset-btn { padding: 0.65rem 1rem; border: 1px solid var(--line); }

main {
  max-width: 1280px;
  margin: auto;
  padding: 4.8rem 2rem 4rem;
}

.intro { max-width: 670px; }
.eyebrow, .note-label, .mini-label {
  margin: 0;
  color: var(--terracotta-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0.45rem 0 0.9rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(3.4rem, 7vw, 6.8rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.88;
}

h1 em { color: var(--terracotta); font-weight: 600; }
.intro > p:last-child { max-width: 560px; color: var(--ink-soft); line-height: 1.7; }

.demo-stage {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(175px, 1fr);
  align-items: center;
  gap: 3rem;
  margin-top: 4rem;
}

.stage-notes, .table-summary {
  align-self: center;
  max-width: 230px;
}

.stage-notes ol {
  margin: 0.9rem 0 1.8rem;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.85;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.live-pill span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #5aa978;
  box-shadow: 0 0 0 5px rgba(90, 169, 120, 0.13);
}

.phone-shell {
  position: relative;
  width: 360px;
  height: 730px;
  padding: 10px;
  border-radius: 45px;
  background: #18332d;
  box-shadow: var(--shadow);
}

.phone-camera {
  position: absolute;
  z-index: 4;
  top: 17px;
  left: 50%;
  width: 90px;
  height: 23px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: var(--ink);
}

.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: var(--paper);
}

.app-view { display: none; height: 100%; overflow-y: auto; }
.app-view.active { display: block; animation: reveal 0.25s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }

.app-header { padding: 2.9rem 1.25rem 1rem; color: var(--paper); background: var(--ink); }
.app-header.waiter { background: var(--terracotta-dark); }
.app-header-top { display: flex; align-items: center; justify-content: space-between; }
.app-header h2 { margin: 0.55rem 0 0.2rem; font-family: "Space Grotesk"; font-size: 2rem; letter-spacing: -0.05em; }
.app-header p { margin: 0; opacity: 0.76; font-size: 0.78rem; }
.status-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--lime); }

.person-strip {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.person-chip {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.person-chip.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.person-chip.paid { color: var(--ink); border-color: var(--mint); background: var(--mint-light); }

.content { padding: 1rem 1rem 6.5rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0.4rem 0 0.65rem; }
.section-title h3 { margin: 0; font-family: "Space Grotesk"; font-size: 1.25rem; letter-spacing: -0.04em; }
.section-title span { color: var(--ink-soft); font-size: 0.68rem; }

.item-group { margin-top: 0.68rem; }
.group-heading { display: flex; align-items: center; gap: 0.32rem; margin: 0 0 0.32rem 0.1rem; color: var(--ink-soft); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.group-heading i { display: grid; width: 1rem; height: 1rem; place-items: center; border-radius: 50%; background: var(--mint-light); font-size: 0.53rem; font-style: normal; }
.item-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.36rem; }
.item-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 0.12rem 0.3rem;
  min-height: 74px;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
  cursor: pointer;
  transition: 0.18s ease;
}

.item-card:hover { border-color: var(--mint); transform: translateY(-1px); }
.item-card.claimed { border-color: var(--mint); background: var(--mint-light); }
.item-card.paid { opacity: 0.62; cursor: default; }
.item-check { display: grid; width: 1.2rem; height: 1.2rem; grid-column: 2; grid-row: 1; place-items: center; border-radius: 50%; color: var(--paper); background: var(--terracotta); font-size: 0.76rem; font-weight: 700; }
.item-card.claimed .item-check { color: var(--ink); background: var(--lime); }
.item-name { grid-column: 1; grid-row: 1; align-self: center; padding-right: 0.1rem; font-size: 0.68rem; font-weight: 700; line-height: 1.12; }
.item-price { grid-column: 1 / 3; font-size: 0.66rem; font-weight: 700; }
.item-owner { display: none; }
.item-action { grid-column: 1 / 3; color: var(--terracotta-dark); font-size: 0.53rem; font-weight: 700; }

.bottom-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(12px);
}

.pay-total { display: flex; justify-content: space-between; margin-bottom: 0.6rem; font-size: 0.75rem; }
.pay-total strong { font-size: 1rem; }
.primary-btn, .secondary-btn {
  width: 100%;
  padding: 0.85rem;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}
.primary-btn { color: white; background: var(--terracotta); }
.primary-btn:disabled { opacity: 0.4; cursor: default; }
.secondary-btn { color: var(--ink); border: 1px solid var(--line); background: var(--paper); }

.waiter-total {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
}
.total-card { padding: 0.85rem; border-radius: 14px; background: var(--mint-light); }
.total-card.highlight { background: #f8dfd2; }
.total-card span { display: block; color: var(--ink-soft); font-size: 0.64rem; }
.total-card strong { display: block; margin-top: 0.3rem; font-size: 1.05rem; }
.guest-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.avatar { display: grid; width: 2.1rem; height: 2.1rem; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--mint-light); font-size: 0.72rem; font-weight: 700; }
.guest-meta { flex: 1; }
.guest-meta strong, .guest-meta span { display: block; font-size: 0.75rem; }
.guest-meta span { margin-top: 0.15rem; color: var(--ink-soft); font-size: 0.63rem; }
.guest-amount { text-align: right; font-size: 0.73rem; font-weight: 700; }
.state { color: var(--terracotta-dark); font-size: 0.62rem; font-weight: 700; }
.state.paid { color: #43855f; }

.tap-panel { padding: 1rem; border-radius: 16px; color: white; background: var(--ink); text-align: center; }
.tap-icon { display: grid; width: 3.3rem; height: 3.3rem; margin: 0.2rem auto 0.65rem; place-items: center; border: 1px solid rgba(255,255,255,0.4); border-radius: 50%; font-size: 1.45rem; }
.tap-panel h3 { margin: 0; font-family: "Space Grotesk"; font-size: 1.3rem; letter-spacing: -0.04em; }
.tap-panel p { margin: 0.35rem 0 0.9rem; color: rgba(255,255,255,0.7); font-size: 0.68rem; }
.tap-panel .primary-btn { background: var(--lime); color: var(--ink); }
.intake-card { margin-bottom: 1rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 16px; background: #fffefa; }
.intake-card h3 { margin: 0.35rem 0 0.25rem; font-family: "Space Grotesk"; font-size: 1.3rem; letter-spacing: -0.04em; }
.intake-card p { margin: 0 0 0.75rem; color: var(--ink-soft); font-size: 0.7rem; line-height: 1.45; }
.table-field { display: grid; gap: 0.25rem; margin-bottom: 0.55rem; color: var(--ink-soft); font-size: 0.62rem; font-weight: 700; }
.table-field input { width: 100%; padding: 0.65rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper); font: inherit; }
.upload-btn { display: block; margin-bottom: 0.45rem; padding: 0.72rem; border: 1px dashed var(--terracotta); border-radius: 11px; color: var(--terracotta-dark); cursor: pointer; text-align: center; font-size: 0.7rem; font-weight: 700; }
.upload-btn input { display: none; }
.receipt-preview { display: grid; gap: 0.28rem; max-height: 190px; margin: 0.7rem 0; overflow-y: auto; }
.receipt-preview div { display: flex; justify-content: space-between; gap: 0.5rem; padding-bottom: 0.26rem; border-bottom: 1px solid var(--line); font-size: 0.67rem; }
.review-card .secondary-btn { margin-top: 0.4rem; }
.checkout-locked { display: none; }
.staff-dashboard { margin-bottom: 1rem; }
.dashboard-heading { display: flex; align-items: start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.65rem; }
.dashboard-heading h3 { margin: 0.28rem 0 0; font-family: "Space Grotesk"; font-size: 1.28rem; letter-spacing: -0.05em; }
.connector-pill { display: flex; align-items: center; gap: 0.28rem; color: #43855f; font-size: 0.56rem; font-weight: 700; white-space: nowrap; }
.connector-pill i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: #5aa978; }
.table-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.42rem; }
.table-card { display: grid; min-height: 110px; padding: 0.6rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fffefa; cursor: pointer; text-align: left; }
.table-card:hover { border-color: var(--terracotta); transform: translateY(-1px); }
.table-card span, .table-card small { color: var(--ink-soft); font-size: 0.55rem; }
.table-card strong { font-family: "Space Grotesk"; font-size: 1.75rem; line-height: 1; letter-spacing: -0.06em; }
.table-card i { align-self: end; color: var(--terracotta-dark); font-size: 0.67rem; font-style: normal; font-weight: 700; }
.table-card small { margin-top: 0.14rem; line-height: 1.1; }
.text-btn { width: 100%; margin: 0.7rem 0 0; border: 0; color: var(--terracotta-dark); background: transparent; cursor: pointer; font-size: 0.64rem; font-weight: 700; }
.empty-panel { padding: 2rem 1rem; color: var(--ink-soft); text-align: center; font-size: 0.78rem; line-height: 1.6; }
.demo-ready-btn { margin-top: 0.9rem; }

.summary-ring {
  display: grid;
  width: 180px;
  height: 180px;
  margin: 1rem 0 1.2rem;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--terracotta) var(--progress, 0%), rgba(255,255,255,0.5) 0);
}
.summary-ring > div { display: grid; width: 138px; height: 138px; place-items: center; align-content: center; border-radius: 50%; background: var(--cream); text-align: center; }
.summary-ring strong { display: block; font-family: "Space Grotesk"; font-size: 1.35rem; letter-spacing: -0.05em; }
.summary-ring span { color: var(--ink-soft); font-size: 0.68rem; }
.summary-line { display: flex; justify-content: space-between; margin: 0.65rem 0; color: var(--ink-soft); font-size: 0.75rem; }
.summary-line strong { color: var(--ink); }
.toast { position: fixed; right: 1.5rem; bottom: 1.5rem; padding: 0.8rem 1rem; border-radius: 12px; color: white; background: var(--ink); opacity: 0; transform: translateY(12px); transition: 0.22s; font-size: 0.78rem; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 800px) {
  .topbar { padding: 1rem; }
  .brand span:last-child, .reset-btn { display: none; }
  main { padding: 2.8rem 1rem 2rem; }
  h1 { font-size: 4.3rem; }
  .intro > p:last-child { font-size: 0.86rem; }
  .demo-stage { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 2.4rem; }
  .stage-notes, .table-summary { display: none; }
  .phone-shell { width: min(100%, 360px); }
}
