/* Interactive till demo on the Preview page. Every selector sits under .rtj-demo. */
.rtj-demo {
  --demo-red: #e10600;
  --demo-ink: #17202a;
  --demo-focus: #ffad66;
  margin: 36px 0 48px;
  padding: 0; /* the site gives every <section> large padding */
}

.rtj-demo *,
.rtj-demo *::before,
.rtj-demo *::after { box-sizing: border-box; }

.rtj-demo [hidden] { display: none !important; }

.rtj-demo h2 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.2; }
.rtj-demo h3,
.rtj-demo h4,
.rtj-demo p,
.rtj-demo ul,
.rtj-demo dl,
.rtj-demo dd { margin: 0; padding: 0; }
.rtj-demo ul { list-style: none; }

.rtj-demo .rtj-demo__note { color: var(--text-soft); margin: 0 0 20px; max-width: 720px; }

.rtj-demo button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.rtj-demo button:disabled { cursor: not-allowed; opacity: 0.45; }
.rtj-demo button:focus-visible,
.rtj-demo [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--demo-focus);
  outline-offset: 3px;
}
.rtj-demo [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.rtj-demo .rtj-demo__sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- toolbar ---------- */
.rtj-demo .rtj-demo__toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.rtj-demo .rtj-demo__tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.rtj-demo .rtj-demo__tab,
.rtj-demo .rtj-demo__reset {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid #8291a3; border-radius: 8px; padding: 8px 14px;
}
.rtj-demo .rtj-demo__tab[aria-pressed="true"] { background: #fff; color: #152031; }
.rtj-demo .rtj-demo__badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: inline-grid; place-items: center;
  background: var(--demo-red); color: #fff; font-size: 0.8rem; font-weight: 800; line-height: 1;
}
.rtj-demo .rtj-demo__reset { border-color: var(--border); color: var(--text-soft); }
.rtj-demo .rtj-demo__reset:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.rtj-demo .rtj-demo__panel { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }

/* ---------- till ---------- */
.rtj-demo .rtj-demo__panel--till {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(300px, 340px);
  min-height: 600px;
  background:
    radial-gradient(circle at 100% 0%, rgba(225, 6, 0, 0.2) 0, transparent 40%),
    #0b0b0d;
  color: #fff;
}

.rtj-demo .rtj-till__rail {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 8px;
  border-right: 1px solid #1f1f25; background: #08080a;
}
.rtj-demo .rtj-till__cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; background: transparent; border: 0; border-radius: 14px;
  color: #c8c8cf; font-size: 0.75rem; font-weight: 700; line-height: 1.2; text-align: center;
}
.rtj-demo .rtj-till__cat-pic {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 13px; background: #18181c; font-size: 1.45rem; line-height: 1;
}
.rtj-demo .rtj-till__cat[aria-pressed="true"] { color: #fff; }
.rtj-demo .rtj-till__cat[aria-pressed="true"] .rtj-till__cat-pic {
  background: linear-gradient(140deg, #ff3b30, var(--demo-red));
  box-shadow: 0 6px 18px rgba(225, 6, 0, 0.45);
}

.rtj-demo .rtj-till__menu { padding: 16px; min-width: 0; }
.rtj-demo .rtj-till__venue { color: #9a9aa3; font-size: 0.85rem; font-weight: 600; }
.rtj-demo .rtj-till__title { font-size: 1.6rem; line-height: 1.2; margin-bottom: 14px; }
.rtj-demo .rtj-till__grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}
.rtj-demo .rtj-till__product {
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  padding: 9px 9px 11px; border: 1px solid #24242b; border-radius: 16px; background: #151518;
  transition: border-color 0.15s, background 0.15s;
}
.rtj-demo .rtj-till__product:hover { border-color: #3a3a44; background: #1b1b20; }
.rtj-demo .rtj-till__pic,
.rtj-demo .rtj-till__mini {
  display: grid; place-items: center; line-height: 1;
  background: var(--tint);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 85%, #fff), color-mix(in srgb, var(--tint) 50%, #0b0b0d));
}
.rtj-demo .rtj-till__pic { height: 70px; border-radius: 12px; font-size: 2.1rem; margin-bottom: 8px; }
.rtj-demo .rtj-till__name { font-weight: 700; font-size: 0.95rem; line-height: 1.25; }
.rtj-demo .rtj-till__price { color: #ff5a52; font-weight: 700; font-size: 0.88rem; }

/* order panel */
.rtj-demo .rtj-till__order {
  display: flex; flex-direction: column; gap: 14px;
  margin: 14px 14px 14px 0; padding: 16px;
  border: 1px solid #222228; border-radius: 18px; background: #131316;
}
.rtj-demo .rtj-till__order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rtj-demo .rtj-till__order-head h3 { font-size: 1.25rem; }
.rtj-demo .rtj-till__count { color: #9a9aa3; font-size: 0.9rem; }

.rtj-demo .rtj-till__cart { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 120px; }
.rtj-demo .rtj-till__empty {
  padding: 18px 12px; border: 1px dashed #2f2f37; border-radius: 12px;
  color: #9a9aa3; text-align: center; font-size: 0.92rem;
}
.rtj-demo .rtj-till__line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px; background: #1a1a1f;
}
.rtj-demo .rtj-till__mini { width: 40px; height: 40px; flex: none; border-radius: 10px; font-size: 1.25rem; }
.rtj-demo .rtj-till__line-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rtj-demo .rtj-till__line-text strong { font-size: 0.95rem; overflow-wrap: anywhere; }
.rtj-demo .rtj-till__line-text span { color: #9a9aa3; font-size: 0.82rem; }
.rtj-demo .rtj-till__qty { display: flex; align-items: center; gap: 4px; flex: none; }
.rtj-demo .rtj-till__step {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  background: #26262d; font-size: 1.2rem; font-weight: 800;
}
.rtj-demo .rtj-till__step:hover { background: #33333c; }
.rtj-demo .rtj-till__amount { min-width: 22px; text-align: center; font-weight: 800; }

.rtj-demo .rtj-till__service { display: grid; gap: 8px; }
.rtj-demo .rtj-till__seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: #0d0d10; }
.rtj-demo .rtj-till__seg-btn { border: 0; border-radius: 9px; background: transparent; color: #c8c8cf; font-weight: 700; }
.rtj-demo .rtj-till__seg-btn[aria-pressed="true"] { background: #2a2a31; color: #fff; }
.rtj-demo .rtj-till__tables-label { color: #9a9aa3; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.rtj-demo .rtj-till__tables { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.rtj-demo .rtj-till__table {
  min-width: 0; padding: 0; border: 1px solid #2a2a31; border-radius: 9px; background: #18181c; font-weight: 700;
}
.rtj-demo .rtj-till__table[aria-pressed="true"] { border-color: var(--demo-red); background: var(--demo-red); }

.rtj-demo .rtj-till__totals { border-top: 1px dashed #2f2f37; padding-top: 12px; display: grid; gap: 4px; }
.rtj-demo .rtj-till__row { display: flex; justify-content: space-between; gap: 8px; color: #b9b9c2; }
.rtj-demo .rtj-till__row dd { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.rtj-demo .rtj-till__row--total { color: #fff; font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
.rtj-demo .rtj-till__row--total dd { font-weight: 800; }

.rtj-demo .rtj-till__pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rtj-demo .rtj-till__btn { border: 0; border-radius: 12px; font-weight: 800; color: #fff; }
.rtj-demo .rtj-till__btn--cash,
.rtj-demo .rtj-till__btn--card { min-height: 56px; font-size: 1.1rem; }
.rtj-demo .rtj-till__btn--cash { background: linear-gradient(160deg, #22c55e, #15803d); }
.rtj-demo .rtj-till__btn--card { background: var(--demo-red); }
.rtj-demo .rtj-till__btn--card:hover:not(:disabled) { background: linear-gradient(160deg, #ff3b30, #a80400); }
.rtj-demo .rtj-till__btn--clear { grid-column: 1 / -1; background: #1f1f24; border: 1px solid #2a2a31; }
.rtj-demo .rtj-till__status { color: #5ee0c0; font-weight: 700; font-size: 0.95rem; min-height: 1.5em; }

/* ---------- kitchen and bar monitors (light, like the real screens) ---------- */
.rtj-demo .rtj-demo__panel--kitchen,
.rtj-demo .rtj-demo__panel--bar {
  --station: #0f766e;
  --station-soft: #d9f3ee;
  min-height: 600px;
  color: var(--demo-ink);
  background:
    linear-gradient(rgba(23, 32, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.035) 1px, transparent 1px),
    #eef1f3;
  background-size: 24px 24px;
}
.rtj-demo .rtj-demo__panel--kitchen { --station: #b42318; --station-soft: #fee4e2; }

.rtj-demo .rtj-mon__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: var(--demo-ink); color: #fff; border-bottom: 5px solid var(--station);
}
.rtj-demo .rtj-mon__brand { display: flex; align-items: center; gap: 12px; }
.rtj-demo .rtj-mon__mark {
  width: 48px; height: 48px; display: grid; place-items: center; flex: none;
  border: 2px solid #fff; font-weight: 800; font-size: 0.95rem;
}
.rtj-demo .rtj-mon__eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #c9d1d9; }
.rtj-demo .rtj-mon__title { font-size: 1.4rem; line-height: 1.15; }
.rtj-demo .rtj-mon__clock { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.4rem; font-weight: 600; }

.rtj-demo .rtj-mon__summary {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 16px; padding: 12px 16px;
  background: #fff; border: 1px solid #d7dde2;
}
.rtj-demo .rtj-mon__summary div { display: flex; align-items: baseline; gap: 6px; }
.rtj-demo .rtj-mon__summary strong { font-size: 1.4rem; }
.rtj-demo .rtj-mon__summary span { color: #66717d; font-size: 0.88rem; }

.rtj-demo .rtj-mon__board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 16px 16px; }
.rtj-demo .rtj-mon__lane { --lane: #d97706; border-top: 4px solid var(--lane); padding-top: 10px; min-width: 0; }
.rtj-demo .rtj-mon__lane--preparing { --lane: #2563eb; }
.rtj-demo .rtj-mon__lane--ready { --lane: #15803d; }
.rtj-demo .rtj-mon__lane-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rtj-demo .rtj-mon__marker { width: 11px; height: 11px; background: var(--lane); flex: none; }
.rtj-demo .rtj-mon__lane-head h4 { flex: 1; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; }
.rtj-demo .rtj-mon__lane-count {
  min-width: 26px; padding: 2px 6px; text-align: center; border-radius: 4px;
  background: #dfe4e8; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem;
}
.rtj-demo .rtj-mon__list { display: flex; flex-direction: column; gap: 12px; }
.rtj-demo .rtj-mon__none {
  padding: 14px; text-align: center; color: #66717d; font-size: 0.9rem; border: 1px dashed #b8c1c9;
}
.rtj-demo .rtj-mon__ticket {
  background: #fff; border: 1px solid #d7dde2; border-radius: 4px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(23, 32, 42, 0.08);
}
.rtj-demo .rtj-mon__ticket-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; background: #f6f8f9; border-bottom: 1px solid #d7dde2;
}
.rtj-demo .rtj-mon__order-label { color: #66717d; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.rtj-demo .rtj-mon__order-number { font-size: 1.3rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.rtj-demo .rtj-mon__time { color: #66717d; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }
.rtj-demo .rtj-mon__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 4px; }
.rtj-demo .rtj-mon__service {
  padding: 2px 6px; border-radius: 3px; background: var(--station-soft); color: var(--station);
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
}
.rtj-demo .rtj-mon__items { padding: 0 12px 10px; }
.rtj-demo .rtj-mon__items li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #e3e7ea; font-weight: 600; }
.rtj-demo .rtj-mon__items li:last-child { border-bottom: 0; }
.rtj-demo .rtj-mon__qty { color: var(--station); min-width: 26px; }
.rtj-demo .rtj-mon__action {
  display: block; width: 100%; border: 0; border-radius: 0; padding: 10px;
  background: var(--demo-ink); color: #fff; font-weight: 800;
}
.rtj-demo .rtj-mon__action:hover { background: #2a3744; }
.rtj-demo .rtj-mon__action:focus-visible { outline-offset: -4px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .rtj-demo .rtj-demo__panel--till { grid-template-columns: 80px minmax(0, 1fr); }
  .rtj-demo .rtj-till__order { grid-column: 1 / -1; margin: 0 14px 14px; }
  .rtj-demo .rtj-till__cart { min-height: 0; }
}

@media (max-width: 640px) {
  .rtj-demo .rtj-demo__panel--till { display: flex; flex-direction: column; min-height: 0; }
  .rtj-demo .rtj-till__rail {
    flex-direction: row; justify-content: space-between; gap: 4px; padding: 10px 6px;
    border-right: 0; border-bottom: 1px solid #1f1f25;
  }
  .rtj-demo .rtj-till__cat { flex: 1 1 0; min-width: 0; font-size: 0.68rem; }
  .rtj-demo .rtj-till__cat-pic { width: 40px; height: 40px; font-size: 1.25rem; }
  .rtj-demo .rtj-till__menu { padding: 12px; }
  .rtj-demo .rtj-till__title { font-size: 1.3rem; margin-bottom: 10px; }
  .rtj-demo .rtj-till__grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .rtj-demo .rtj-till__pic { height: 54px; font-size: 1.7rem; }
  .rtj-demo .rtj-till__name { font-size: 0.85rem; }
  .rtj-demo .rtj-till__order { margin: 0 10px 10px; padding: 12px; }
  .rtj-demo .rtj-till__tables { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rtj-demo .rtj-mon__board { grid-template-columns: minmax(0, 1fr); }
  .rtj-demo .rtj-demo__panel--kitchen,
  .rtj-demo .rtj-demo__panel--bar { min-height: 0; }
  .rtj-demo .rtj-mon__header { padding: 12px 14px; }
  .rtj-demo .rtj-mon__summary { margin: 12px; gap: 6px 18px; }
  .rtj-demo .rtj-mon__board { padding: 0 12px 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .rtj-demo .rtj-till__product:active { transform: scale(0.97); }
  .rtj-demo .rtj-mon__ticket.is-new { animation: rtj-demo-in 0.25s ease both; }
  @keyframes rtj-demo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
