.attendance-pad {
  --pad-blue: #3654f5;
  --pad-ink: #18243b;
  --pad-muted: #64748b;
  --pad-line: #e2e7f0;
  --pad-bg: #f5f7fb;
  min-height: 100dvh;
  color: var(--pad-ink);
  background: var(--pad-bg);
  padding: 0 max(20px, env(safe-area-inset-right)) 16px;
  font-size: 16px;
}
.attendance-pad [hidden] {
  display: none !important;
}
.attendance-pad button {
  touch-action: manipulation;
  transition:
    background 0.15s,
    transform 0.15s;
  cursor: pointer;
}
.attendance-pad button:active:not(:disabled) {
  transform: scale(0.97);
}
.attendance-pad button:focus-visible,
.attendance-pad input:focus-visible {
  outline: 3px solid #8a9eff;
  outline-offset: 3px;
}
.attendance-pad button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.attendance-pad svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pad-header {
  max-width: 1320px;
  margin: auto;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--pad-line);
}
.pad-header > img {
  width: 168px;
  height: auto;
}
.pad-tools {
  display: flex;
  gap: 10px;
}
.pad-tools button {
  background: #fff;
  border: 1px solid var(--pad-line);
  border-radius: 14px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.pad-tools button[aria-pressed="true"] {
  color: var(--pad-blue);
  background: #eef1ff;
}
.pad-layout {
  max-width: 1120px;
  margin: auto;
  min-height: calc(100dvh - 132px);
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 64px;
  align-items: center;
  padding: 26px 0;
}
.pad-welcome {
  min-width: 0;
  padding: 12px 0;
}
.pad-caption {
  color: var(--pad-muted);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
}
.pad-welcome h1 {
  margin: 0;
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.3;
  letter-spacing: -0.045em;
  color: var(--pad-blue);
  word-break: keep-all;
}
.pad-welcome h1 span {
  color: var(--pad-ink);
}
.pad-welcome-help {
  margin: 18px 0 0;
  line-height: 1.7;
  color: var(--pad-muted);
}
.pad-mascot {
  display: block;
  width: min(100%, 380px);
  height: auto;
  margin: -4px auto -16px;
  mix-blend-mode: multiply;
  mask-image:
    linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent);
  mask-composite: intersect;
}
.pad-campus-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--pad-muted);
  font-size: 13px;
  margin: 0;
}
.pad-campus-note svg {
  width: 17px;
  height: 17px;
}
.pad-panel {
  background: #fff;
  border: 1px solid var(--pad-line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 12px 48px #24345808;
  min-width: 0;
}
.pad-panel-heading h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.04em;
  line-height: 1.4;
}
.pad-panel-heading p {
  margin: 6px 0 20px;
  color: var(--pad-muted);
  font-size: 14px;
}
.pad-segments,
.pad-directions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.pad-segments {
  background: var(--pad-bg);
  border-radius: 13px;
  padding: 4px;
  margin-bottom: 12px;
}
.pad-segments button,
.pad-directions button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--pad-muted);
  font-size: 16px;
  font-weight: 650;
  border-radius: 10px;
  padding: 8px;
}
.pad-segments button[aria-pressed="true"] {
  background: #fff;
  color: var(--pad-ink);
  box-shadow: 0 2px 7px #1e30400e;
}
.pad-directions {
  gap: 10px;
  margin-bottom: 20px;
}
.pad-directions button {
  border: 1px solid var(--pad-line);
  color: var(--pad-muted);
  min-height: 48px;
}
.pad-directions button[aria-pressed="true"] {
  color: var(--pad-blue);
  border-color: #b9c6ff;
  background: #f0f3ff;
}
.pad-directions button svg:last-child:not(:first-child) {
  width: 17px;
}
#kiosk-form label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 650;
}
#kiosk-form label span {
  color: var(--pad-muted);
  font-weight: 400;
  font-size: 12px;
}
.attendance-pad #pin {
  width: 100%;
  min-width: 0;
  height: 58px;
  border: 1px solid #cbd4e3;
  background: #fff;
  border-radius: 13px;
  text-align: center;
  font-size: 27px;
  letter-spacing: 10px;
  padding: 10px;
}
.attendance-pad #pin::placeholder {
  font-size: 14px;
  letter-spacing: -0.02em;
  color: #718097;
}
.pad-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.pad-keypad button {
  min-height: 58px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--pad-bg);
  color: var(--pad-ink);
  font-size: 25px;
  font-weight: 550;
  display: flex;
  justify-content: center;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.pad-keypad button:hover {
  background: #eaf0ff;
}
.pad-keypad button.pad-key-tool {
  font-size: 13px;
  color: var(--pad-muted);
  background: #fafbfe;
}
.attendance-pad .pad-confirm {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--pad-blue);
  color: #fff;
  border: 0;
  border-radius: 13px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 5px 12px #3654f51a;
}
#kiosk-error {
  color: #b4233c;
  background: #fff2f4;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  margin: 14px 0 0;
  word-break: keep-all;
}
#kiosk-error:empty {
  display: none;
}
.pad-footer {
  color: var(--pad-muted);
  font-size: 12px;
  text-align: center;
}
.pad-result {
  min-height: 388px;
  display: flex;
  flex-direction: column;
}
.pad-result-title {
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0;
  letter-spacing: -0.035em;
}
.pad-result-hint {
  font-size: 13px;
  color: var(--pad-muted);
  margin: 0 0 20px;
}
.pad-people {
  display: grid;
  gap: 10px;
  max-height: 265px;
  overflow-y: auto;
  padding: 4px;
  margin: -4px;
}
.pad-people button {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--pad-line);
  border-radius: 16px;
  background: #fff;
  min-height: 80px;
  padding: 14px;
  text-align: left;
}
.pad-people button:hover {
  background: #f0f3ff;
  border-color: #b9c6ff;
}
.pad-people button > svg {
  margin-left: auto;
  color: var(--pad-muted);
}
.pad-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #edf1ff;
  color: var(--pad-blue);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.pad-people strong,
.pad-people small {
  display: block;
}
.pad-people strong {
  font-size: 20px;
}
.pad-people small {
  margin-top: 4px;
  color: var(--pad-muted);
  font-size: 13px;
}
#pad-back {
  margin-top: auto;
  padding: 12px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--pad-bg);
  border-radius: 12px;
  color: var(--pad-muted);
}
.pad-success {
  margin: auto;
  padding: 20px 0 28px;
  text-align: center;
}
.pad-success-icon {
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #eaf7f1;
  color: #17845d;
  animation: pad-arrive 0.22s ease-out;
}
.pad-success-icon svg {
  width: 36px;
  height: 36px;
}
.pad-success h3 {
  font-size: 25px;
  margin: 0 0 12px;
  letter-spacing: -0.035em;
}
.pad-success p {
  line-height: 1.6;
  word-break: keep-all;
}
.pad-success small {
  color: var(--pad-muted);
  font-size: 13px;
}
@keyframes pad-arrive {
  from {
    transform: scale(0.8);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@media (min-width: 801px) and (max-height: 820px) {
  .pad-header {
    height: 68px;
  }
  .pad-layout {
    min-height: calc(100dvh - 104px);
    padding: 14px 0;
  }
  .pad-panel {
    padding: 20px 26px;
  }
  .pad-panel-heading p {
    margin-bottom: 12px;
  }
  .pad-directions {
    margin-bottom: 12px;
  }
  .pad-keypad button {
    min-height: 49px;
  }
  .pad-mascot {
    max-width: 290px;
  }
}
@media (max-width: 1100px) and (min-width: 801px) {
  .pad-layout {
    grid-template-columns: 1fr 430px;
    gap: 28px;
  }
}
@media (max-width: 800px) {
  .attendance-pad {
    padding: 0 20px 16px;
  }
  .pad-header {
    height: 76px;
  }
  .pad-header > img {
    width: 140px;
  }
  .pad-tools {
    gap: 6px;
  }
  .pad-tools button {
    padding: 8px 10px;
    font-size: 13px;
  }
  #kiosk-voice span {
    display: none;
  }
  .pad-layout {
    display: block;
    max-width: 520px;
    min-height: auto;
    padding: 16px 0;
  }
  .pad-welcome {
    position: relative;
    min-height: 105px;
    padding: 4px 112px 16px 4px;
  }
  .pad-caption {
    font-size: 12px;
    margin-bottom: 8px;
  }
  .pad-welcome h1 {
    font-size: 27px;
  }
  .pad-welcome h1 br {
    display: none;
  }
  .pad-welcome h1 span {
    display: none;
  }
  .pad-welcome-help {
    font-size: 13px;
    margin-top: 8px;
  }
  .pad-welcome-help br {
    display: none;
  }
  .pad-mascot {
    position: absolute;
    width: 115px;
    right: 0;
    top: -10px;
    margin: 0;
  }
  .pad-campus-note {
    display: none;
  }
  .pad-panel {
    padding: 24px;
    border-radius: 24px;
  }
}
@media (max-width: 480px) {
  .attendance-pad {
    padding: 0 14px 12px;
  }
  .pad-header {
    height: 64px;
    gap: 8px;
  }
  .pad-header > img {
    width: 115px;
  }
  .pad-tools button {
    border-radius: 12px;
    padding: 8px;
    gap: 5px;
    font-size: 12px;
  }
  .pad-tools button svg {
    width: 18px;
  }
  #campus-change > svg:first-child {
    display: none;
  }
  .pad-layout {
    padding: 12px 0;
  }
  .pad-welcome {
    min-height: 90px;
    padding-bottom: 12px;
    padding-right: 84px;
  }
  .pad-welcome h1 {
    font-size: 24px;
  }
  .pad-welcome-help {
    font-size: 12px;
  }
  .pad-mascot {
    width: 92px;
    top: -4px;
  }
  .pad-caption {
    display: none;
  }
  .pad-panel {
    padding: 18px;
    border-radius: 22px;
  }
  .pad-panel-heading h2 {
    font-size: 23px;
  }
  .pad-panel-heading p {
    margin: 4px 0 12px;
    font-size: 12px;
  }
  .pad-segments {
    margin-bottom: 8px;
  }
  .pad-directions {
    margin-bottom: 14px;
    gap: 8px;
  }
  .pad-directions button {
    min-height: 44px;
  }
  .pad-keypad {
    gap: 7px;
    margin: 10px 0;
  }
  .pad-keypad button {
    min-height: 48px;
    font-size: 24px;
    border-radius: 10px;
  }
  .attendance-pad #pin {
    height: 52px;
  }
  .attendance-pad .pad-confirm {
    min-height: 50px;
  }
  .pad-result {
    min-height: 335px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .attendance-pad *,
  .attendance-pad *::before {
    animation: none !important;
    transition: none !important;
  }
}

/* Keep the input caption compact despite the shared operations form layout. */
.attendance-pad #kiosk-form label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.pad-welcome-help {
  word-break: keep-all;
}
@media (max-width: 350px) {
  .pad-welcome-help {
    max-width: 150px;
  }
  .pad-panel {
    padding: 14px;
  }
  .pad-keypad button {
    min-height: 44px;
  }
  .pad-panel-heading p {
    margin-bottom: 8px;
  }
  .pad-segments {
    margin-bottom: 6px;
  }
  .pad-directions {
    margin-bottom: 10px;
  }
}

.pad-directions button img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  mix-blend-mode: multiply;
  flex-shrink: 0;
}
.pad-directions button[data-direction="out"][aria-pressed="true"] {
  background: #fff5eb;
  border-color: #edc69f;
  color: #965316;
}
.pad-directions button {
  padding: 4px 8px;
}
.pad-audio-status {
  max-width: 600px;
  margin: 0 auto 8px;
  color: #805119;
  font-size: 12px;
  text-align: center;
}
.pad-audio-status:empty {
  display: none;
}
.pad-dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid #e2e7f0;
  border-radius: 22px;
  padding: 24px;
  color: #18243b;
  box-shadow: 0 20px 80px #18243b30;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.pad-dialog::backdrop {
  background: #18243b66;
}
.pad-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}
.pad-dialog h2 {
  font-size: 22px;
  margin: 0;
}
.pad-dialog button {
  min-height: 44px;
  padding: 10px;
  border: 1px solid #e2e7f0;
  border-radius: 12px;
  background: #f5f7fb;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.pad-dialog header button {
  min-width: 44px;
}
.pad-dialog svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.pad-dialog label {
  display: block;
  font-weight: 600;
  margin: 14px 0 8px;
}
.pad-dialog select {
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border: 1px solid #bac6d8;
  border-radius: 12px;
  background: #fff;
}
.pad-dialog .pad-sound-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.pad-sound-toggle input {
  width: 24px;
  height: 24px;
  accent-color: #3654f5;
}
.pad-settings-hint,
.pad-dialog p,
.pad-dialog li {
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
  word-break: keep-all;
}
.pad-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}
.pad-preview-actions button {
  font-size: 13px;
}
@media (display-mode: standalone), (display-mode: fullscreen) {
  .attendance-pad {
    padding-top: env(safe-area-inset-top);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .pad-footer,
  #pad-fullscreen {
    display: none;
  }
}
@media (max-width: 480px) {
  .pad-directions button img {
    width: 36px;
    height: 36px;
  }
  .pad-directions button {
    min-height: 48px;
  }
  .pad-header > img {
    width: 100px;
  }
  .pad-tools {
    gap: 4px;
  }
  .pad-tools button {
    min-width: 38px;
  }
}
