@font-face {
  font-family: system-fallback;
  src: local("Arial");
}
* {
  box-sizing: border-box;
}
html {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #173734;
  background: #f5f6f1;
  font-size: 17px;
  line-height: 1.5;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  min-height: 52px;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: #075c4e;
  color: white;
}
.primary:hover:not(:disabled) {
  background: #03473c;
}
.secondary {
  color: #164c42;
  background: white;
  border-color: #a8bab2;
}
.danger {
  background: #a52a20;
  color: white;
}
.text-button {
  color: #164c42;
  background: transparent;
  border-color: transparent;
}
.text-button:hover {
  background: #e5eee7;
}
a {
  color: #075c4e;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 4px solid #c88200;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: -0.045em;
  line-height: 1.16;
  margin-bottom: 0.7rem;
}
h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
}
.site-header {
  padding: 1rem 3.5vw;
  border-bottom: 1px solid #dfe5dc;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
}
.brand strong,
.brand span:not(.brand-mark) {
  display: block;
}
.brand span:not(.brand-mark) {
  font-size: 0.8rem;
  color: #596b63;
}
.brand-mark {
  width: 46px;
  height: 46px;
  background: #e4edd0;
  color: #174a3e;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 1.7rem;
  font-weight: 900;
}
.language {
  display: flex;
  gap: 0.4rem;
}
.language a {
  padding: 0.4rem 0.5rem;
  text-decoration: none;
  border-radius: 5px;
}
.language a[aria-current="true"] {
  background: #e4edd0;
  font-weight: 800;
}
.main {
  max-width: 1400px;
  margin: auto;
  padding: 2.2rem 3.5vw 3rem;
  min-height: calc(100vh - 160px);
}
.site-footer {
  padding: 1rem 3.5vw;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #596b63;
  font-size: 0.7rem;
}
.card {
  background: #fff;
  border: 1px solid #dfe5dc;
  border-radius: 16px;
  padding: 1.7rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 800;
  color: #5e7667;
  margin-bottom: 0.6rem;
}
.page-heading,
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-heading h1,
.page-heading h2,
.status-row h2 {
  margin-bottom: 0;
}
.muted {
  color: #5b6e65;
  font-size: 0.88rem;
}
.badge {
  background: #e8efe8;
  border: 1px solid #cad9cc;
  border-radius: 100px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.badge.closed {
  background: #fbeadc;
  border-color: #e9c5a2;
}
.queue-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}
.current-card {
  text-align: center;
}
.current-card .status-row {
  text-align: left;
}
.turn-code {
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  font-weight: 850;
  overflow-wrap: anywhere;
  margin: 0.5rem 0 1rem;
}
.call-controls {
  display: grid;
  grid-template-rows: 1.3fr 1fr;
  gap: 1rem;
}
.call-controls button {
  font-size: 1.65rem;
}
.call-controls button span {
  font-size: 2rem;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.metrics h2 {
  font-size: 0.9rem;
}
.metrics article p:last-child {
  font-size: 0.75rem;
  color: #64746a;
  margin-bottom: 0;
}
.metric-value {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.35rem;
}
.metric-value.compact {
  font-size: 1.6rem;
  min-height: 4.2rem;
  display: flex;
  align-items: center;
}
.day-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.day-control h2 {
  margin-bottom: 0.35rem;
}
.day-control p {
  font-size: 0.85rem;
  margin-bottom: 0;
  color: #64746a;
}
label {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #aabbb1;
  background: white;
  color: #173734;
  border-radius: 8px;
  padding: 0.7rem;
  margin-top: 0.35rem;
  min-height: 48px;
}
select[multiple] {
  min-height: 145px;
}
input[type="checkbox"] {
  width: auto;
  min-height: initial;
  margin-right: 0.5rem;
}
form {
  display: grid;
  gap: 1rem;
}
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.2rem;
}
.form-grid .full {
  grid-column: 1/-1;
}
.shop-selector {
  min-width: 230px;
}
.settings summary {
  cursor: pointer;
  font-weight: 750;
}
.login-card {
  max-width: 460px;
  margin: 3rem auto;
}
.login-card form {
  margin: 1.5rem 0;
}
.login-card form label + input {
  margin-top: -0.7rem;
}
.full {
  width: 100%;
}
.notice,
#feedback:not(:empty) {
  padding: 1rem;
  background: #edf2e5;
  border: 1px solid #cbd9be;
  border-radius: 9px;
}
.error,
#feedback.error {
  background: #fff0ed;
  border-color: #e8aaa2;
  color: #8a2118;
}
.connection {
  font-size: 0.9rem;
  color: #5a6f65;
  text-align: center;
  margin-top: 1rem;
}
.offline {
  color: #8a3418 !important;
  background: #fff1df;
  padding: 0.5rem;
  border-radius: 5px;
}
.skip-link {
  position: absolute;
  top: -100px;
  background: white;
  padding: 1rem;
  z-index: 100;
}
.skip-link:focus {
  top: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.pairing {
  max-width: 670px;
  margin: 3rem auto;
  text-align: center;
}
.pair-code {
  font-size: 3.5rem;
  letter-spacing: 0.12em;
  font-weight: 900;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.shop-button {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  background: #fff;
  color: #164c42;
  border: 1px solid #b7cbbd;
  font-size: 1.6rem;
}
.shop-button:hover:not(:disabled) {
  background: #e4edd0;
}
.shop-button.selected {
  border: 3px solid #075c4e;
}
.shop-button small {
  font-size: 0.85rem;
  font-weight: 500;
}
.shop-button.principal {
  grid-column: 1/-1;
  min-height: 240px;
  font-size: 2rem;
  background: #075c4e;
  color: white;
}
.terminal {
  max-width: 1000px;
  margin: auto;
}
.terminal #other-shops {
  margin: 1.5rem auto;
  display: flex;
  min-width: 45%;
}
.ticket-result {
  max-width: 850px;
  margin: 2rem auto;
  text-align: center;
}
.ticket-result .turn-code {
  font-size: clamp(4rem, 13vw, 10rem);
}
.mobile-intro {
  max-width: 650px;
  margin: 1rem 0 2rem;
}
.page-mobile .main,
.page-link .main {
  max-width: 850px;
}
.page-mobile .shop-button {
  font-size: 1.3rem;
  min-height: 115px;
}
#whatsapp-step {
  margin-top: 1.5rem;
}
.admin-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.admin-nav [aria-current="true"] {
  background: #075c4e;
  color: white;
}
.admin-content {
  min-height: 300px;
}
.table-scroll {
  overflow-x: auto;
  margin-top: 1.5rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.86rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.8rem;
  border-bottom: 1px solid #e0e8df;
}
th {
  color: #556d5e;
  font-weight: 750;
  background: #f5f7f1;
}
td .text-button {
  min-height: 35px;
  padding: 0.3rem 0.6rem;
}
dialog {
  border: 1px solid #d1dacd;
  border-radius: 16px;
  max-width: 550px;
  width: calc(100% - 2rem);
  padding: 2rem;
  color: #173734;
}
dialog::backdrop {
  background: #132d27a3;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}
.page-display {
  background: #153b32;
  overflow: hidden;
}
.page-display .main {
  max-width: none;
  padding: 0;
  margin: 0;
  height: 100vh;
  min-height: 100vh;
}
.display-layout {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 70% 30%;
}
.media-zone {
  background: #153b32;
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
}
.media-zone iframe,
#youtube-player {
  width: 100%;
  height: 100%;
  border: 0;
}
.media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #153b32;
  color: #f2f5e9;
  text-align: center;
  padding: 3rem;
}
.media-fallback .brand-mark {
  width: 90px;
  height: 90px;
  font-size: 3rem;
}
.media-fallback h1 {
  font-size: 3.5vw;
  max-width: 650px;
}
.media-fallback small {
  position: absolute;
  bottom: 2rem;
  opacity: 0.75;
}
.turn-zone {
  background: #f4f5eb;
  border-left: 7px solid #afc474;
  padding: 4vh 2vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.turn-zone h2 {
  font-size: 2.3vw;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.turn-zone .eyebrow {
  font-size: 1vw;
}
.display-current > p:first-child {
  font-size: 1.7vw;
  margin-bottom: 0.5rem;
}
.turn-zone .turn-code {
  font-size: 5.5vw;
  margin: 0;
  line-height: 1.12;
}
.display-current {
  border-block: 1px solid #ccd8c8;
  padding: 3vh 0;
}
.display-current #display-state {
  font-size: 1vw;
  margin-top: 0.75rem;
}
.previous h3 {
  font-size: 1.1vw;
}
.previous ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7vh;
}
.previous li {
  font-size: 2.6vw;
  font-weight: 750;
  overflow-wrap: anywhere;
  color: #4b6758;
}
.display-connection {
  font-size: 0.85vw;
  margin: 0;
  line-height: 1.3;
}
.page-display .pairing {
  color: #153b32;
}
.stat-table {
  font-variant-numeric: tabular-nums;
}
.admin-form-actions {
  display: flex;
  gap: 1rem;
}
.secret-field {
  font-family: monospace;
}
.help-text {
  font-size: 0.8rem;
  color: #5b6e65;
}
.query-results {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.83rem;
}
@media (max-width: 700px) {
  html {
    font-size: 16px;
  }
  .site-header {
    padding: 0.8rem 1rem;
    gap: 0.7rem;
  }
  .brand strong {
    font-size: 0.85rem;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .main {
    padding: 1.5rem 1rem;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .shop-selector {
    width: 100%;
  }
  .queue-layout {
    grid-template-columns: 1fr;
  }
  .call-controls {
    grid-template-columns: 1.3fr 1fr;
    grid-template-rows: 100px;
  }
  .call-controls button {
    font-size: 1.1rem;
    padding: 0.7rem;
  }
  .metrics {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  .metrics article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 1rem;
  }
  .metrics article h2 {
    align-self: center;
    margin: 0;
  }
  .metrics article p:last-child {
    grid-column: 1/-1;
  }
  .metric-value,
  .metric-value.compact {
    text-align: right;
    display: block;
    min-height: 0;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }
  .day-control {
    align-items: flex-start;
    flex-direction: column;
  }
  .day-control button {
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .shop-grid {
    grid-template-columns: 1fr 1fr;
  }
  .shop-button {
    font-size: 1.2rem;
    min-height: 140px;
    padding: 0.7rem;
  }
  .site-footer {
    flex-direction: column;
    gap: 0.25rem;
  }
  .login-card {
    margin: 1rem auto;
  }
  .dialog-actions {
    flex-direction: column-reverse;
  }
  .display-layout {
    grid-template-columns: 70% 30%;
  }
  .card {
    padding: 1.2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
