@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&family=Inter:wght@500;600;700&display=swap');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.app-root {
  font-family: 'Noto Sans TC', 'Inter', sans-serif;
  background: #F5F6F8;
  min-height: 100vh;
  color: #16232E;
}
.page { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  background: #0B1F33; color: #fff;
  padding: 14px 16px; margin: 0 0 18px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { display: flex; align-items: center; font-weight: 600; font-size: 16px; }

.iconbtn {
  background: transparent; border: none; color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
}
.iconbtn:hover { background: rgba(255,255,255,0.12); }
.iconbtn.danger { color: #C0392B; }
.iconbtn.danger:hover { background: #FBEAE8; }
.iconbtn.dark { color: #0B1F33; }
.iconbtn.dark:hover { background: #EEF0F2; }

.hero { padding: 28px 4px 22px; text-align: center; }
.hero-eyebrow { font-size: 12px; letter-spacing: 0.08em; color: #5C7080; font-family: 'Inter', sans-serif; font-weight: 600; }
.hero-title { font-size: 26px; line-height: 1.4; margin: 10px 0 6px; color: #0B1F33; font-weight: 700; }
.hero-sub { color: #647588; font-size: 14px; }

.rolegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rolecard {
  background: #fff; border: 1px solid #E2E6EA; border-radius: 14px;
  padding: 20px 14px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .1s;
}
.rolecard:hover { border-color: #0B1F33; transform: translateY(-1px); }
.rolecard-label { font-weight: 700; font-size: 16px; }
.rolecard-desc { font-size: 12.5px; color: #647588; line-height: 1.4; }

.card { background: #fff; border: 1px solid #E2E6EA; border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.centercard { text-align: center; }
.cardtitle { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.subtext { color: #647588; font-size: 13px; line-height: 1.5; }

.textinput, .selectinput {
  width: 100%; padding: 10px 12px; border: 1px solid #D3D9DE; border-radius: 9px;
  font-size: 14px; margin-bottom: 10px; font-family: inherit; background: #fff;
}
.textinput:focus, .selectinput:focus { outline: 2px solid #0B1F33; border-color: #0B1F33; }
.fieldlabel { font-size: 12.5px; color: #4A5A68; font-weight: 600; display: block; margin-bottom: 5px; }
.errortext { color: #C0392B; font-size: 13px; margin-bottom: 8px; }

.primarybtn {
  background: #0B1F33; color: #fff; border: none; border-radius: 10px;
  padding: 12px 18px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%;
}
.primarybtn:hover { background: #142E4A; }
.secondarybtn {
  background: #fff; color: #0B1F33; border: 1px solid #0B1F33; border-radius: 10px;
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px; justify-content: center; width: 100%;
}
.ghostbtn {
  background: transparent; border: 1px dashed #B7C1CA; color: #4A5A68; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px; justify-content: center; width: 100%;
}

.sectionhead { margin-bottom: 14px; }

.slotcard { display: flex; gap: 12px; align-items: flex-start; }
.slotcard-num { font-family: 'Inter', sans-serif; font-weight: 700; color: #B7C1CA; font-size: 20px; padding-top: 2px; }
.slotcard-fields { flex: 1; }

.dashedbtn {
  width: 100%; border: 1.5px dashed #B7C1CA; background: transparent; border-radius: 12px;
  padding: 12px; color: #4A5A68; font-weight: 600; font-size: 13.5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 90px;
}
.dashedbtn:hover { border-color: #0B1F33; color: #0B1F33; }

.stickybar {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #E2E6EA;
  padding: 12px 16px; display: flex; gap: 10px; max-width: 640px; margin: 0 auto;
}
.savedtoast {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%);
  background: #16232E; color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px;
  z-index: 60;
}

.namegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.namebtn {
  border: 1px solid #D3D9DE; background: #fff; border-radius: 10px; padding: 14px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.namebtn:hover { border-color: #0B1F33; background: #F5F6F8; }

.greeting { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.statuspill { display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.statuspill-in { background: #E6F4EA; color: #1E7B34; }
.statuspill-out { background: #EEF0F2; color: #647588; }

.linegrid { display: flex; flex-wrap: wrap; gap: 8px; }
.linebtn { border: 1.5px solid; border-radius: 20px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; }

.checkinbtns { display: flex; gap: 10px; margin-top: 16px; }
.checkbtn {
  flex: 1; border: none; border-radius: 10px; padding: 13px; font-size: 14.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.checkbtn-in { background: #1E7B34; color: #fff; }
.checkbtn-out { background: #A6362F; color: #fff; }
.checkbtn:disabled { background: #DCE1E5; color: #9AA6AF; cursor: not-allowed; }

.metrotoolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.linerow { margin-bottom: 14px; }
.linerow-label { display: inline-block; color: #fff; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 6px 6px 0 0; }
.linerow-track {
  border: 1.5px solid; border-radius: 0 10px 10px 10px; background: #fff;
  padding: 10px; display: flex; gap: 4px; overflow-x: auto;
}
.stationchip { flex: 0 0 auto; min-width: 54px; text-align: center; position: relative; padding-top: 10px; }
.stationchip-dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 auto 4px; }
.stationchip-name { font-size: 10px; color: #4A5A68; writing-mode: vertical-rl; text-orientation: upright; height: 62px; margin: 0 auto; letter-spacing: 1px; }
.stationchip-people { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.personpin {
  width: 22px; height: 22px; border-radius: 50%; background: #C0392B; color: #fff; font-size: 11px;
  font-weight: 700; border: 2px solid #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.modalbackdrop { position: fixed; inset: 0; background: rgba(11,31,51,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modalcard { background: #fff; border-radius: 16px; padding: 22px; max-width: 380px; width: 100%; position: relative; }
.modaltitle { font-weight: 700; font-size: 17px; margin-bottom: 12px; }
.modalrow { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin-bottom: 6px; color: #26343F; }
.modaldivider { height: 1px; background: #E2E6EA; margin: 12px 0; }
.modalsubtitle { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.pendinglist { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }

.disclaimer { display: flex; gap: 6px; color: #9AA6AF; font-size: 11.5px; margin-top: 10px; line-height: 1.5; }
.loadingtext { text-align: center; color: #9AA6AF; padding: 40px 0; }
.errorbanner { background: #FBEAE8; color: #A6362F; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

@media (max-width: 420px) {
  .rolegrid { grid-template-columns: 1fr; }
  .namegrid { grid-template-columns: 1fr; }
}
