:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --ink: #0f172a;
  --muted: #5c6b80;
  --line: #d8e1ea;
  --navy: #102033;
  --teal: #008f8c;
  --green: #24825a;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c24141;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef3f8 0%, #f8fafc 36%, #eef4f7 100%);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand,
.topnav a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #00a5a0;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #bdd2e8;
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #dbeafe;
  font-size: 13px;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.overview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 24px;
  padding: 42px 28px 24px;
}

.overview-copy {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 14px;
  font-size: 42px;
  line-height: 1.14;
  letter-spacing: 0;
}

h2 {
  font-size: 25px;
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  font-size: 17px;
  line-height: 1.24;
  letter-spacing: 0;
}

.overview-copy p:not(.eyebrow) {
  max-width: 820px;
  color: var(--muted);
  font-size: 17px;
}

.safety-board {
  align-self: center;
  display: grid;
  gap: 10px;
}

.safety-board div,
.area-card,
.panel,
.state-rail,
.handoff-grid article,
.guard-grid,
.metric-card,
.list-card,
.flow-card,
.mini-table,
.feedback-form,
.receipt-preview,
.kiosk-camera {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.safety-board div {
  padding: 16px;
}

.safety-board span,
.state-card span,
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.safety-board strong,
.state-card strong,
.metric-card strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.safety-board small,
.metric-card small {
  color: var(--muted);
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 28px 28px;
}

.area-card {
  padding: 18px;
  min-height: 178px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.area-card:hover,
.area-card.active {
  border-color: rgba(0, 143, 140, 0.55);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.area-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  font-weight: 800;
  font-size: 12px;
}

.area-card h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.area-card p {
  color: var(--muted);
  font-size: 14px;
}

.area-card b {
  display: inline-block;
  color: var(--teal);
  font-size: 13px;
}

.workbench,
.handoff-grid,
.guard-grid {
  margin: 0 28px 28px;
}

.workbench {
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 6px;
}

.section-head p:last-child {
  max-width: 520px;
  color: var(--muted);
}

.section-head.compact {
  grid-column: 1 / -1;
  display: block;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 700;
}

.tab.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.panel {
  display: none;
  min-height: 650px;
  overflow: hidden;
}

.panel.active {
  display: block;
}

.phone-shell,
.kiosk-shell,
.admin-shell,
.feedback-shell {
  background: #f8fbfd;
}

.device-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: #fff;
  background: var(--navy);
}

.device-top span,
.device-top b {
  overflow-wrap: anywhere;
}

.device-top b {
  color: #b7f4eb;
  font-size: 12px;
}

.panel-body {
  padding: 16px;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(340px, 1.26fr);
  gap: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  padding: 14px;
}

.metric-card strong {
  font-size: 24px;
}

.metric-card.good strong {
  color: var(--green);
}

.metric-card.warn strong {
  color: var(--amber);
}

.metric-card.danger strong {
  color: var(--red);
}

.flow-stack,
.list-stack {
  display: grid;
  gap: 12px;
}

.flow-card,
.list-card,
.feedback-form,
.receipt-preview {
  padding: 15px;
}

.flow-card h3,
.list-card h3 {
  margin-bottom: 9px;
}

.status-pill,
.tag,
.risk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #10403c;
  background: #d9f4ef;
  font-size: 12px;
  font-weight: 700;
}

.risk-pill {
  color: #7a4b00;
  background: #fff2cc;
}

.tag.dark {
  color: #fff;
  background: var(--navy);
}

.tag.warn {
  color: #7a4b00;
  background: #fff2cc;
}

.tag.danger {
  color: #8b1e1e;
  background: #ffe4e4;
}

.class-card,
.roster-row,
.device-row,
.feedback-row,
.admin-row,
.receipt-line {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.class-card + .class-card,
.roster-row + .roster-row,
.device-row + .device-row,
.feedback-row + .feedback-row,
.admin-row + .admin-row,
.receipt-line + .receipt-line {
  margin-top: 8px;
}

.class-card header,
.roster-row header,
.device-row header,
.feedback-row header,
.admin-row header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.class-card h4,
.roster-row h4,
.device-row h4,
.feedback-row h4,
.admin-row h4 {
  margin: 0;
  font-size: 15px;
}

.class-card p,
.roster-row p,
.device-row p,
.feedback-row p,
.admin-row p,
.flow-card p,
.list-card p,
.receipt-preview p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.btn.primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.btn.dark {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.btn.warn {
  color: #7a4b00;
  background: #fff2cc;
  border-color: #f0d28a;
}

.btn.danger {
  color: #8b1e1e;
  background: #ffe4e4;
  border-color: #f3bbbb;
}

.btn:focus-visible,
.tab:focus-visible,
.area-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.mini-table {
  width: 100%;
  overflow: hidden;
}

.mini-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-table th,
.mini-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.mini-table th {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 800;
}

.kiosk-stage {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}

.kiosk-camera {
  min-height: 300px;
  padding: 18px;
  background: #101827;
  color: #fff;
}

.face-box {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 143, 140, 0.28), rgba(37, 99, 235, 0.14));
}

.face-box::before,
.face-box::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  border-color: #78f3e9;
  border-style: solid;
}

.face-box::before {
  top: 18px;
  left: 18px;
  border-width: 2px 0 0 2px;
}

.face-box::after {
  right: 18px;
  bottom: 18px;
  border-width: 0 2px 2px 0;
}

.face-box strong {
  font-size: 20px;
}

.kiosk-camera p {
  color: #c7d2fe;
}

.device-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.device-status-grid div {
  padding: 10px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.device-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.device-status-grid b {
  display: block;
  margin-top: 2px;
}

.state-rail {
  position: sticky;
  top: 86px;
  padding: 16px;
}

.state-rail h3 {
  margin-bottom: 12px;
}

.state-cards {
  display: grid;
  gap: 9px;
}

.state-card {
  padding: 12px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.state-card strong {
  font-size: 15px;
}

.rail-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: 7px;
  color: #12302d;
  background: #e0f5f2;
}

.rail-note p {
  margin: 6px 0 0;
  font-size: 13px;
}

.admin-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-subnav .btn.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.feedback-form textarea {
  min-height: 86px;
  resize: vertical;
}

.handoff-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.handoff-grid article {
  padding: 18px;
}

.handoff-grid article p {
  color: var(--muted);
}

.guard-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  padding: 24px;
}

.guard-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guard-grid li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.guard-grid span {
  color: var(--muted);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 34px;
  color: #dbeafe;
  background: var(--navy);
}

footer span {
  color: #b8c7dc;
  text-align: right;
}

.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;
}

@media (max-width: 1180px) {
  .experience-grid,
  .handoff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }

  .state-rail {
    position: static;
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .overview-shell,
  .app-grid,
  .kiosk-stage,
  .guard-grid {
    grid-template-columns: 1fr;
  }

  .overview-shell {
    padding: 30px 18px 16px;
  }

  .experience-grid,
  .workbench,
  .handoff-grid,
  .guard-grid {
    margin-left: 18px;
    margin-right: 18px;
  }

  .experience-grid,
  .handoff-grid,
  .tabbar {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .panel {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand {
    min-width: 0;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 22px;
  }

  .workbench {
    padding: 16px;
  }

  .panel-body {
    padding: 12px;
  }

  .admin-grid,
  .device-status-grid {
    grid-template-columns: 1fr;
  }

  .class-card header,
  .roster-row header,
  .device-row header,
  .feedback-row header,
  .admin-row header {
    display: grid;
  }

  .guard-grid li {
    grid-template-columns: 1fr;
  }

  .mini-table {
    overflow-x: auto;
  }
}
