:root {
  --teal: #007d78;
  --deep: #0c3378;
  --ink: #0b2344;
  --muted: #5e708a;
  --line: #dce6ef;
  --surface: #ffffff;
  --soft: #eef7f6;
  --success: #11865d;
  font-family: "Segoe UI", Arial, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

body {
  height: var(--pedestal-viewport-height, 100dvh);
  min-height: var(--pedestal-viewport-height, 100dvh);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 125, 120, .16), transparent 30%),
    linear-gradient(145deg, #f6fbfd 0%, #e7f1f6 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.pedestal-shell {
  width: 100%;
  height: var(--pedestal-viewport-height, 100dvh);
  min-height: var(--pedestal-viewport-height, 100dvh);
  max-height: var(--pedestal-viewport-height, 100dvh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.brand-panel {
  position: relative;
  padding: clamp(12px, 1.8vw, 26px) clamp(22px, 4vw, 64px) clamp(10px, 1.2vw, 14px);
  background: linear-gradient(90deg, var(--teal), #008f82);
  color: #fff;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.logo-mark {
  position: relative;
  font-size: clamp(30px, 3.2vw, 58px);
  line-height: .9;
  letter-spacing: 0;
}

.logo-mark span {
  color: #fff;
}

.logo-mark strong {
  color: #d7f7ff;
}

.logo-mark small {
  display: block;
  width: max-content;
  margin-left: clamp(104px, 11vw, 202px);
  margin-top: 4px;
  padding: 1px 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--teal);
  font-size: clamp(12px, 1vw, 18px);
  font-weight: 800;
  letter-spacing: 3px;
}

.time-box {
  text-align: right;
  font-size: clamp(14px, 1.2vw, 22px);
}

.time-box strong {
  display: block;
  font-size: clamp(22px, 2.8vw, 46px);
}

.fullscreen-action {
  position: absolute;
  right: clamp(22px, 4vw, 64px);
  bottom: 14px;
  width: 44px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}

.fullscreen-action svg {
  width: 20px;
  height: 20px;
}

.step-strip {
  width: min(100%, 1200px);
  margin-top: clamp(10px, 1.4vw, 20px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.step {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  color: transparent;
}

.step.is-active {
  background: #fff;
}

.screen-card {
  width: min(100%, 1280px);
  margin: 0 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: clamp(18px, 3.2vw, 54px) clamp(24px, 5vw, 84px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.is-hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
}

h1,
h2 {
  margin: 0;
  text-align: center;
  color: var(--ink);
  line-height: 1.12;
}

h1 {
  font-size: clamp(30px, 3.4vw, 58px);
}

h2 {
  font-size: clamp(32px, 4vw, 64px);
}

.hint {
  margin: clamp(10px, 1.4vw, 20px) 0 clamp(16px, 2.2vw, 34px);
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  font-size: clamp(17px, 1.5vw, 24px);
}

.document-input,
.name-input {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  border: 1px solid #b9c9d8;
  border-radius: 6px;
  background: #fff;
  margin-bottom: clamp(10px, 1.4vw, 18px);
}

.document-input svg,
.name-input svg {
  justify-self: center;
  color: var(--deep);
}

.document-input input,
.name-input input {
  min-width: 0;
  height: clamp(64px, 6vh, 82px);
  border: 0;
  outline: 0;
  font-size: clamp(24px, 2.2vw, 36px);
  color: var(--ink);
  letter-spacing: 0;
}

.keypad {
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.4vw, 18px);
}

.keypad button,
.service-tile,
.primary-action,
.secondary-action {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.keypad button {
  min-height: clamp(58px, 7.2vh, 86px);
  background: linear-gradient(180deg, #008b84, #006d70);
  color: #fff;
  font-size: clamp(24px, 2.8vw, 42px);
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(0, 125, 120, .18);
}

.keypad button:active,
.service-tile:active,
.primary-action:active,
.secondary-action:active {
  transform: translateY(1px);
}

.keypad .continue-button {
  background: linear-gradient(180deg, #0d4ea3, #08337a);
  font-size: clamp(15px, 1.4vw, 22px);
}

.icon-button {
  display: grid;
  place-items: center;
}

.keypad-action {
  background: linear-gradient(180deg, #007f88, #00636c);
}

.name-keyboard {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(5px, .7vw, 10px);
  margin: 0 auto clamp(12px, 1.4vw, 18px);
}

.name-keyboard button {
  min-height: clamp(44px, 5.5vh, 64px);
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #008b84, #006d70);
  color: #fff;
  font-size: clamp(17px, 1.7vw, 26px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0, 125, 120, .16);
}

.name-keyboard button:active {
  transform: translateY(1px);
}

.name-keyboard .name-space {
  grid-column: span 7;
}

.name-keyboard .name-delete {
  grid-column: span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #007f88, #00636c);
}

.services-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--services-per-row, 2), minmax(220px, 1fr));
  gap: clamp(16px, 2vw, 28px);
  max-width: min(1200px, var(--services-grid-max, 748px));
  margin: 0 auto;
}

.service-tile {
  min-height: clamp(130px, 16vh, 200px);
  padding: clamp(22px, 2.4vw, 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(11, 35, 68, .08);
  text-align: center;
  font-weight: 800;
  touch-action: manipulation;
  font-size: clamp(20px, 2vw, 30px);
}

.service-tile svg {
  width: clamp(42px, 4vw, 68px);
  height: clamp(42px, 4vw, 68px);
  color: var(--teal);
}

.service-tile small {
  color: #60718a;
  font-size: 12px;
  font-weight: 700;
}

.service-tile .service-closed {
  color: #b42318;
}

.service-tile:hover {
  border-color: var(--teal);
}

.priority-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(4, 22, 47, .42);
}

.priority-modal.is-hidden {
  display: none !important;
}

.priority-modal > div {
  width: min(430px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(7, 27, 57, .24);
  display: grid;
  gap: 14px;
}

.priority-modal h2 {
  margin: 0;
  color: var(--deep);
  font-size: 24px;
}

.turn-type-option {
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.turn-type-option svg {
  width: 28px;
  height: 28px;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--deep);
  font-weight: 800;
  cursor: pointer;
}

.ticket-card .turn-number {
  margin-top: 10px;
  font-size: clamp(76px, 11vw, 150px);
  line-height: 1;
  font-weight: 900;
  color: var(--teal);
}

.ticket-preview {
  width: min(360px, 90vw);
  margin-bottom: 24px;
  padding: 18px;
  text-align: center;
  background:
    linear-gradient(135deg, transparent 10px, #fff 0) top left,
    linear-gradient(225deg, transparent 10px, #fff 0) top right,
    linear-gradient(315deg, transparent 10px, #fff 0) bottom right,
    linear-gradient(45deg, transparent 10px, #fff 0) bottom left;
  background-size: 50% 50%;
  background-repeat: no-repeat;
  border: 1px dashed #b7c7d8;
  box-shadow: 0 10px 26px rgba(11, 35, 68, .12);
}

.mini-logo {
  color: var(--teal);
  font-size: 22px;
}

.ticket-preview p,
.ticket-preview span,
.ticket-preview small {
  display: block;
  margin: 10px 0 0;
  color: var(--muted);
}

.ticket-preview strong {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 42px;
}

.actions-row {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-action,
.secondary-action {
  min-height: clamp(58px, 7vh, 84px);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.primary-action {
  background: linear-gradient(180deg, #0d4ea3, #08337a);
  color: #fff;
}

.secondary-action {
  margin-top: 18px;
  background: var(--soft);
  color: var(--teal);
}

.ticket-card .secondary-action {
  margin-top: 0;
}

.message {
  min-height: 22px;
  margin: clamp(10px, 1.4vw, 18px) 0 0;
  color: var(--success);
  font-weight: 700;
  text-align: center;
}

.message.is-error {
  color: #b42318;
}

footer {
  min-height: clamp(42px, 5.4vh, 64px);
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, #006d70, #008b84);
  color: #fff;
  font-weight: 700;
  font-size: clamp(14px, 1.2vw, 22px);
}

html.is-compact-height .brand-panel {
  padding-block: 10px;
}

html.is-compact-height .logo-mark {
  font-size: clamp(26px, 3vw, 44px);
}

html.is-compact-height .time-box strong {
  font-size: clamp(20px, 2.3vw, 34px);
}

html.is-compact-height .screen-card {
  padding-block: clamp(12px, 2vw, 28px);
}

html.is-compact-height .hint {
  margin-block: 8px 14px;
}

html.is-compact-height .step-strip {
  margin-top: 8px;
}

@media (orientation: landscape) and (min-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(var(--services-per-row, 2), minmax(240px, 1fr));
  }
}

@media (orientation: portrait) {
  .services-grid {
    grid-template-columns: repeat(var(--services-per-row, 2), minmax(min(100%, 280px), 1fr));
    max-width: 850px;
  }
}

.pedestal-shell[data-display-mode="horizontal"] .services-grid {
  grid-template-columns: repeat(var(--services-per-row, 2), minmax(240px, 1fr));
}

.pedestal-shell[data-display-mode="vertical"] .services-grid {
  grid-template-columns: repeat(var(--services-per-row, 2), minmax(min(100%, 280px), 1fr));
  max-width: 850px;
}

@media (max-width: 620px) {
  .name-keyboard {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .name-keyboard .name-space {
    grid-column: span 4;
  }

  .name-keyboard .name-delete {
    grid-column: span 3;
  }

  .services-grid,
  .pedestal-shell[data-display-mode="horizontal"] .services-grid,
  .pedestal-shell[data-display-mode="vertical"] .services-grid {
    grid-template-columns: 1fr;
  }

  .screen-card {
    padding-inline: 20px;
  }

  .brand-panel {
    padding-inline: 20px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 27px;
  }

  .actions-row {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
  }

  .fullscreen-action {
    width: 38px;
    height: 32px;
  }
}
