:root {
  --bg: #eef4f7;
  --panel: #ffffff;
  --ink: #132235;
  --muted: #657386;
  --line: #d6e0e8;
  --blue: #1769aa;
  --cyan: #0f8f9b;
  --green: #16885b;
  --red: #c24135;
  --amber: #b7791f;
  --soft-blue: #e9f3fb;
  --soft-green: #e8f5ef;
  --shadow: 0 18px 44px rgba(20, 36, 52, 0.12);
  --focus: 0 0 0 3px rgba(15, 143, 155, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbfd 0, var(--bg) 340px),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a.link-button {
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  min-height: 48px;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background-color 150ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.kiosk-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  align-items: center;
  background: #102338;
  border-bottom: 4px solid #20a5a2;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 96px;
  padding: 18px 34px;
}

.topbar h1 {
  font-size: 30px;
  letter-spacing: 0;
  margin: 0 0 6px;
}

.topbar p {
  color: #cdd6df;
  margin: 0;
}

.device-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.device-strip span {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #edf2f7;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

#ocrStatus {
  border-color: rgba(74, 222, 128, 0.46);
}

#faceStatus {
  border-color: rgba(34, 211, 238, 0.46);
}

#paymentStatus {
  border-color: rgba(251, 191, 36, 0.48);
}

#printerStatus {
  border-color: rgba(147, 197, 253, 0.5);
}

.workbench {
  display: grid;
  flex: 1;
  gap: 20px;
  grid-template-columns: 160px minmax(0, 1fr) 330px;
  padding: 24px;
}

.steps {
  display: grid;
  gap: 10px;
  align-content: start;
  position: relative;
}

.step {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  color: var(--muted);
  display: grid;
  gap: 8px;
  grid-template-columns: 34px 1fr;
  min-height: 66px;
  padding: 10px;
  text-align: left;
}

.step span {
  align-items: center;
  background: #edf5f8;
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.step.is-active {
  background: #fff;
  border-color: var(--line);
  border-left-color: var(--cyan);
  box-shadow: 0 10px 24px rgba(20, 36, 52, 0.08);
  color: var(--ink);
}

.step.is-active span {
  background: var(--cyan);
  color: #fff;
}

.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 640px;
  overflow: hidden;
}

.panel {
  display: none;
  padding: 36px;
}

.panel.is-active {
  display: block;
}

.panel-head {
  border-bottom: 1px solid #edf2f6;
  margin: -2px 0 28px;
  padding-bottom: 20px;
}

.panel-head h2,
.side-panel h2 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.panel-head p {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.panel-head.split {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.scanner-box {
  align-items: center;
  background: #f2f7fa;
  border: 1px dashed #9db2c3;
  border-radius: 8px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
  min-height: 190px;
  padding: 26px;
}

.id-card-preview {
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  height: 132px;
  padding: 26px;
  width: 236px;
}

.id-card-preview span {
  background: #cfd8e3;
  border-radius: 6px;
  display: block;
  height: 12px;
}

.id-card-preview span:nth-child(2) {
  width: 70%;
}

.id-card-preview span:nth-child(3) {
  width: 46%;
}

.face-box {
  align-items: center;
  background: #f2f7fa;
  border: 1px dashed #9db2c3;
  border-radius: 8px;
  display: flex;
  gap: 26px;
  justify-content: space-between;
  margin-bottom: 24px;
  min-height: 300px;
  padding: 28px;
}

.face-preview {
  align-items: center;
  background: #152536;
  border: 8px solid #fff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.18);
  display: flex;
  flex-direction: column;
  height: 230px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: 310px;
}

.face-preview::before,
.face-preview::after {
  border: 2px solid rgba(255, 255, 255, 0.78);
  content: "";
  height: 44px;
  position: absolute;
  width: 44px;
}

.face-preview::before {
  border-bottom: 0;
  border-right: 0;
  left: 24px;
  top: 24px;
}

.face-preview::after {
  border-left: 0;
  border-top: 0;
  bottom: 24px;
  right: 24px;
}

.face-preview.is-captured {
  background: #143b34;
}

.face-head {
  background: #d7e0ea;
  border-radius: 50%;
  display: block;
  height: 74px;
  width: 74px;
}

.face-shoulders {
  background: #d7e0ea;
  border-radius: 70px 70px 0 0;
  display: block;
  height: 72px;
  margin-top: 14px;
  width: 150px;
}

.face-actions {
  align-items: stretch;
  display: grid;
  gap: 12px;
  min-width: 230px;
}

.face-actions strong {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  min-height: 52px;
  padding: 0 16px;
}

.face-actions strong.is-good {
  color: var(--green);
}

.field-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 8px;
}

input {
  background: #fff;
  border: 1px solid #b3c2cf;
  border-radius: 8px;
  color: var(--ink);
  min-height: 56px;
  padding: 0 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: var(--focus);
  outline: 0;
}

.phone-display {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
}

.keypad {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
  max-width: 520px;
}

.keypad button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  min-height: 72px;
}

.keypad button:hover,
.vessel-item:hover,
.schedule-item:hover,
.icon-button:hover {
  border-color: var(--cyan);
  box-shadow: 0 10px 24px rgba(20, 36, 52, 0.08);
}

.vessel-list,
.schedule-list {
  display: grid;
  margin-bottom: 24px;
}

.vessel-list {
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.schedule-list {
  gap: 12px;
}

.schedule-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 120px 1fr auto;
  min-height: 82px;
  padding: 14px 16px;
  text-align: left;
}

.vessel-item {
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: 210px 1fr auto;
  min-height: 458px;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
}

.vessel-item.is-selected,
.schedule-item.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 136, 91, 0.16), 0 18px 34px rgba(20, 36, 52, 0.1);
}

.vessel-item.is-selected::after {
  align-items: center;
  background: var(--green);
  border-radius: 999px;
  color: #fff;
  content: "선택됨";
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  min-height: 30px;
  padding: 0 12px;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
}

.vessel-photo {
  background: #d9e7f2;
  display: block;
  min-height: 210px;
  overflow: hidden;
  position: relative;
}

.vessel-photo::after {
  background: linear-gradient(180deg, rgba(11, 26, 42, 0) 42%, rgba(11, 26, 42, 0.45) 100%);
  content: "";
  inset: 0;
  position: absolute;
}

.vessel-photo img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.vessel-photo.is-empty img {
  display: none;
}

.photo-fallback {
  align-items: center;
  color: #365267;
  display: flex;
  font-size: 24px;
  font-weight: 900;
  inset: 0;
  justify-content: center;
  opacity: 0;
  position: absolute;
}

.vessel-photo.is-empty .photo-fallback {
  opacity: 1;
}

.vessel-info {
  display: grid;
  gap: 13px;
  padding: 20px 20px 10px;
}

.vessel-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vessel-type {
  align-items: center;
  background: var(--soft-green);
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
}

.vessel-route {
  color: var(--muted);
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.vessel-route strong {
  color: var(--ink);
  font-size: 26px;
}

.vessel-sailings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vessel-sailings span {
  background: var(--soft-blue);
  border: 1px solid #dce7f0;
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: 122px;
  padding: 9px 10px;
}

.vessel-sailings strong {
  font-size: 16px;
  font-weight: 900;
}

.vessel-sailings small {
  color: var(--muted);
  font-weight: 800;
}

.vessel-time-row,
.vessel-stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vessel-time-row span,
.vessel-stat-grid span {
  background: #f5f8fb;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-height: 64px;
  padding: 10px;
}

.vessel-time-row small,
.vessel-stat-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.vessel-time-row strong,
.vessel-stat-grid strong {
  font-size: 21px;
  font-weight: 900;
}

.vessel-stat-grid {
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 15px 20px 20px;
}

.time {
  display: grid;
  gap: 3px;
}

.time strong {
  font-size: 30px;
  font-weight: 900;
}

.time small {
  color: var(--muted);
  font-weight: 900;
}

.ship {
  font-size: 20px;
  font-weight: 900;
}

.meta,
.fare {
  color: var(--muted);
}

.fare {
  font-weight: 800;
  text-align: right;
}

.summary {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 170px 1fr;
  margin: 0 0 28px;
  overflow: hidden;
}

.summary dt,
.summary dd {
  border-bottom: 1px solid var(--line);
  margin: 0;
  min-height: 52px;
  padding: 15px 12px;
}

.summary dt {
  background: #f3f7fa;
  color: var(--muted);
  font-weight: 800;
}

.summary dd {
  font-weight: 800;
}

.consent-check {
  align-items: flex-start;
  background: #f7fbfa;
  border: 1px solid #cae0da;
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 12px;
  line-height: 1.45;
  margin: -10px 0 26px;
  padding: 14px 16px;
}

.consent-check input {
  accent-color: #127a61;
  height: 22px;
  min-height: 22px;
  margin: 1px 0 0;
  width: 22px;
}

.consent-check span {
  font-size: 16px;
  font-weight: 850;
}

#excelLink {
  display: none;
}

.button-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}

.primary,
.secondary,
.link-button {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  padding: 0 22px;
}

.primary {
  background: #127a61;
  color: #fff;
}

.secondary,
.link-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.primary:hover {
  background: #0f6b56;
  transform: translateY(-1px);
}

.secondary:hover,
.link-button:hover {
  border-color: var(--cyan);
  color: #0c5961;
}

.action svg,
.icon-button svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}

.ticket-result {
  margin: 20px auto 0;
  max-width: 720px;
  text-align: center;
}

.success-mark {
  align-items: center;
  background: #127a61;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 74px;
  justify-content: center;
  margin-bottom: 18px;
  width: 74px;
}

.ticket-result h2 {
  font-size: 34px;
  margin: 0 0 8px;
}

#ticketNo {
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 26px;
}

.boarding-code-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  justify-items: center;
  margin: 0 auto 22px;
  max-width: 460px;
  padding: 16px;
}

.boarding-code-card img {
  display: block;
  max-width: 100%;
}

.boarding-code-card strong {
  font-size: 22px;
  letter-spacing: 0;
}

.boarding-code-card span {
  color: var(--muted);
  font-weight: 800;
}

.side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 640px;
  padding: 20px;
}

.side-head {
  align-items: center;
  border-bottom: 1px solid #edf2f6;
  display: flex;
  justify-content: space-between;
  margin: 0 -2px 14px;
  padding: 0 2px 14px;
}

.side-head h2 {
  font-size: 22px;
  margin: 0;
}

.icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  min-height: 44px;
  padding: 0;
  width: 44px;
}

.icon-button:hover {
  color: var(--cyan);
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fbfcfd;
}

.recent-item strong {
  font-size: 16px;
}

.recent-item span {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  padding: 22px 4px;
}

.toast {
  background: #17202a;
  border-radius: 8px;
  bottom: 20px;
  color: #fff;
  left: 50%;
  min-width: 260px;
  opacity: 0;
  padding: 14px 18px;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: var(--red);
}

@media (max-width: 1100px) {
  .workbench {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .side-panel {
    grid-column: 1 / -1;
    min-height: 240px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .panel-head.split,
  .scanner-box,
  .face-box,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .steps {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .step {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 72px;
    text-align: center;
  }

  .step strong {
    font-size: 13px;
  }

  .panel {
    padding: 22px;
  }

  .field-grid,
  .schedule-item {
    grid-template-columns: 1fr;
  }

  .vessel-list,
  .vessel-time-row,
  .vessel-stat-grid {
    grid-template-columns: 1fr;
  }

  .vessel-item {
    min-height: 0;
  }

  .face-preview {
    width: 100%;
  }

  .fare {
    text-align: left;
  }

  .summary {
    grid-template-columns: 120px 1fr;
  }
}
