:root {
  --accent: #087f8c;
  --accent-dark: #066774;
  --bs-primary: var(--accent);
  --bs-primary-rgb: 8, 127, 140;
  --bs-link-color: var(--accent-dark);
  --bs-link-hover-color: #04505b;
}
body {
  min-height: 100vh;
  background: #eef4f8;
  color: #18333d;
}
.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .25rem #087f8c26;
}
.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.card {
  border-color: #dce6e9;
  border-radius: 20px;
}
.page-title, .pickup-page .package-list-header h2 { font-size: 1.625rem; font-weight: 700; line-height: 1.25; }
.pickup-code {
  max-width: 14rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.35em;
}
.pickup-password {
  max-width: 11rem;
}
.drop-zone {
  border: 2px dashed #8ab7be;
  background: #f1fafb;
}
.drop-zone:hover, .drop-zone:focus-within { background: #e4f4f5; }
.upload-icon {
  width: 50px;
  height: 50px;
  background: #087f8c;
  font-size: 32px;
  line-height: 1;
}
.progress {
  height: 10px;
}
.share-link {
  overflow-wrap: anywhere;
}
input[type="file"] {
  max-width: 100%;
}
main {
  min-height: 70vh;
}
.brand-logo {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
}
.home-page { background: #eef4f8; color: #182637; }
.login-page { background: #e3eef0; }
.signed-in header {
  background: #000 !important;
  border: 0 !important;
  color: #fff;
  box-shadow: 0 2px 4px #00000018;
}
.signed-in header > .container > a {
  color: #fff !important;
  font-size: 1.25rem !important;
}
.signed-in > header #navigation a.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
.signed-in > header #navigation .dropdown-toggle.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
.home-page:not(.signed-in) header { background: transparent !important; border: 0 !important; }
.home-page header > .container { justify-content: space-between !important; }
.home-page #main { padding-top: 58px !important; }
.home-page #view { max-width: 340px; margin-inline: auto; padding: 38px; border: 1px solid #dce6e9; border-radius: 20px; background: #fff; }
.home-page h1 { margin-bottom: 27px !important; }
.home-page .form-label { font-size: 12px; color: #58687b; margin-bottom: 7px !important; }
.home-page .form-control { border-color: #d7dfe7; border-radius: 6px; }
.home-page .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #087f8c26; }
.home-page .pickup-code { max-width: 220px; height: 44px; letter-spacing: .17em; }
.home-page .pickup-code::placeholder { font-size: 12px; letter-spacing: 0; color: #9aa6b5; }
.home-page .pickup-password { height: 32px; font-size: 13px; }
.login-page .form-control { max-width: 220px; height: 38px; font-size: 14px; }
.pickup-page #view { max-width: 1080px; padding: 0; border: 0; background: transparent; }
.home-page form > .mb-3 { margin-bottom: 24px !important; }
.home-page button[type="submit"] { width: 100%; max-width: 220px; padding: 9px 25px; font-size: 13px; border-radius: 6px; }
@media (max-width: 575.98px) {
  .home-page #main { padding-top: 27px !important; }
  .home-page #view { padding: 30px; }
}
.pickup-page { background: #eef4f8; }
.pickup-page:not(.signed-in) header {
  max-width: 780px; margin: 32px auto 0; padding: 8px 16px;
  background: #fff !important; border-radius: 20px 20px 0 0;
}
.pickup-page #main {
  max-width: 780px; background: #fff; padding: 24px 28px 48px !important;
  min-height: 0; border-radius: 0 0 20px 20px; margin-bottom: 24px;
}
.pickup-page #view { padding: 0; }
.pickup-page .pickup-form { max-width: 100%; }
.pickup-page .pickup-code { max-width: none; height: 52px; font-size: 24px !important; }
.pickup-page .pickup-code::placeholder { font-size: 16px; }
.pickup-page .form-label { font-size: 16px; }
.pickup-page h1 { margin-bottom: 16px !important; }
.pickup-page h2 { font-size: 22px; }
.pickup-page [aria-label="軟體包清單"] .btn { font-size: 14px; line-height: 1.5; font-weight: 400; color: #212529; padding: 6px 12px; border-radius: 6px; }
.pickup-page:not(.signed-in) header > .container > a:first-child { font-size: 22px !important; }
.pickup-page .brand-logo { width: 46px; height: 46px; }
.pickup-page .pickup-redeem { display: flex; align-items: flex-end; gap: 10px; }
.pickup-page .pickup-redeem > .mb-3 { flex: 0 1 200px; min-width: 0; margin-bottom: 0 !important; }
.pickup-page .pickup-redeem button[type="submit"] { width: auto; flex-shrink: 0; height: 52px; padding: 10px 16px; font-size: 18px; }
@media (max-width: 819.98px) {
  .pickup-page:not(.signed-in) header, .pickup-page #main { width: calc(100% - 24px); }
  .pickup-page:not(.signed-in) header { margin-top: 16px; }
}
.login-page header { display: none; }
.login-page #main { padding-top: 30px !important; }
.login-page #view { max-width: 34rem; padding: 50px; border: 0; border-radius: 28px; }
.login-page h1 { margin-bottom: 20px !important; }
.login-page form { width: 100%; max-width: 304px; margin-inline: auto; }
.login-page .form-label, .login-page .form-control, .login-page button[type="submit"], .login-page .login-return { font-size: 16px; }
.login-page .form-control { max-width: none; height: 40px; }
.login-page form > .mb-3 { margin-bottom: 20px !important; }
.login-page button[type="submit"] { display: block; width: auto; margin-inline: auto; padding: 8px 26px; background: var(--accent); border-color: var(--accent); color: #fff; }
.login-page button[type="submit"]:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.login-page .login-return { align-self: flex-start; margin-top: 26px; color: var(--accent-dark); }
@media (max-width: 575.98px) {
  .login-page #view { padding: 30px 24px; }
  .page-title, .pickup-page .package-list-header h2 { font-size: 1.375rem; }
}

/* Shared signed-in navigation: one desktop row, two mobile rows. */
.system-topbar { background: #000 !important; color: #fff; box-shadow: 0 2px 4px #00000018; }
.system-topbar > .container { flex-wrap: nowrap !important; }
.system-topbar .system-brand { display: inline-flex; align-items: center; gap: .5rem; color: #fff !important; font-size: 1.35rem !important; font-weight: 800 !important; white-space: nowrap; flex-shrink: 0; }
.system-brand span { color: #fff; }
.system-topbar .brand-logo { width: 40px; height: 40px; }
.system-topbar #navigation { flex-wrap: nowrap !important; min-width: 0; }
.system-topbar .nav-link { display: inline-flex; align-items: center; color: #fff; border: 1px solid #ffffff99; border-radius: .375rem; padding: .375rem .75rem; white-space: nowrap; }
.system-topbar .nav-link:hover, .system-topbar .nav-link:focus-visible { color: #fff; background: #ffffff26; }
.system-topbar .nav-link.active { color: #fff; background: #0d6efd; border-color: #0d6efd; }
.topbar-user { display: inline-flex; align-items: center; gap: .5rem; margin-left: .25rem; padding-left: .75rem; border-left: 1px solid #ffffff88; color: #fff; font-weight: 600; white-space: nowrap; min-width: 0; }
.topbar-display-name { min-width: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.topbar-logout { gap: .4rem; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; width: auto; height: 38px; flex: 0 0 auto; padding: 0 .4rem; border: 0; background: transparent; color: #fff; }
.topbar-logout:hover, .topbar-logout:focus-visible { background: #ffffff26; }
.topbar-logout svg { width: 21px; height: 21px; }
@media (min-width: 576px) and (max-width: 991px) {
  .system-topbar > .container { max-width: 100%; gap: .5rem !important; }
  .system-topbar .system-brand { font-size: 1rem !important; }
  .system-topbar .brand-logo { width: 30px; height: 30px; }
  .system-topbar .nav-link { font-size: .75rem; padding: .35rem .35rem; }
  .system-topbar #navigation { gap: .25rem !important; }
  .system-topbar .topbar-user { font-size: .75rem; gap: .25rem; padding-left: .4rem; }
  .system-topbar .topbar-display-name { max-width: 70px; }
}
@media (max-width: 575px) {
  .system-topbar > .container { position: relative; flex-wrap: wrap !important; gap: .5rem !important; padding-top: .5rem !important; padding-bottom: .5rem !important; }
  .system-topbar .system-brand { max-width: 54%; font-size: 1.1rem !important; }
  .system-topbar .brand-logo { width: 34px; height: 34px; }
  .system-topbar #navigation { width: 100%; margin-left: 0 !important; flex-wrap: wrap !important; justify-content: flex-start !important; gap: .375rem !important; overflow: visible; }
  .system-topbar .nav-link { min-height: 40px; padding: .35rem .55rem; font-size: .875rem; }
  .system-topbar .topbar-user { position: absolute; top: .5rem; right: .75rem; max-width: 42%; min-height: 34px; margin-left: 0; padding-left: .5rem; font-size: .875rem; }
  .system-topbar .topbar-display-name { max-width: none; }
  .system-topbar .topbar-logout { gap: .4rem; white-space: nowrap; width: auto; height: 34px; flex: 0 0 auto; }
}

/* Keep the public illustration link beside the brand on narrow phones. */
.pickup-page:not(.signed-in) header > .container { flex-wrap: nowrap !important; }
@media (max-width: 575px) {
  .pickup-page:not(.signed-in) header > .container { gap: .5rem !important; padding-left: 0; padding-right: 0; }
  .pickup-page:not(.signed-in) header > .container > a:first-child { font-size: 18px !important; white-space: nowrap; }
  .pickup-page:not(.signed-in) header .brand-logo { width: 34px; height: 34px; }
}

#subsystem-login:hover,#subsystem-login:focus-visible{background-color:#198754!important;border-color:#198754!important;color:#fff!important;}

.home-return { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; color: var(--bs-link-color); text-decoration: none; }
.home-return:hover, .home-return:focus-visible { color: var(--bs-link-hover-color); }
.home-return svg { width: 24px; height: 24px; fill: currentColor; }
/* Authenticated tab layout; public pickup and local login keep their original shell. */
#drop-tabbed-card { width: calc(100% - 24px); max-width: none; margin-inline: auto; border: 0; border-radius: 0; }
#drop-tabbed-card > .card-header { padding-inline: 0; background: #eef4f8; }
#drop-tabbed-card .nav-link { padding-inline: 10px; flex: 0 0 auto; }
.drop-settings-group { display:flex; flex:0 0 auto; }
.drop-settings-menu {
  position:fixed; z-index:1080; margin:0; padding:.5rem 0; overflow-y:auto;
  background:#fff; color:#212529; border:1px solid #dee2e6; border-radius:.375rem;
}
.drop-settings-menu[hidden] { display:none!important; }
.drop-settings-menu .dropdown-item { display:flex; align-items:center; min-height:44px; padding:.5rem 1rem; color:#212529; background:#fff; }
.drop-settings-menu .dropdown-item:hover { color:#212529; background:#fff; }
.drop-settings-menu .dropdown-item.active,
.drop-settings-menu .dropdown-item.active:hover { color:#fff; background:#495057; }
.drop-settings-menu .dropdown-item:focus-visible { outline:2px solid #495057; outline-offset:-2px; }
#drop-tabbed-card #main { width: 100%; max-width: none; padding: 1rem !important; margin-bottom: 0; min-height: 0; border-radius: 0; background: #fff; }
#drop-tabbed-card #view { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.drop-tabbed-view .system-topbar { border: 0 !important; }
.drop-tabbed-view .system-topbar > .container { max-width: none; padding: 8px 12px !important; }
.drop-tabbed-view .system-topbar .topbar-user { margin-left: auto; }
@media (min-width: 992px) {
  #drop-tabbed-card { width: calc(100% - 100px); }
  #drop-tabbed-card .nav-link { padding-inline: 20px; }
}
@media (max-width: 991.98px) {
  .drop-tabbed-view .system-topbar > .container { padding-block: 4px !important; }
  .drop-tabbed-view .system-topbar .system-brand { max-width: none; font-size: 1.1rem !important; }
  .drop-tabbed-view .system-topbar .brand-logo { width: 34px; height: 34px; }
}
@media (max-width: 575px) {
  .drop-tabbed-view .system-topbar > .container { flex-wrap: nowrap !important; }
  .drop-tabbed-view .system-topbar .topbar-user { position: static; max-width: 42%; }
}
@media (max-width: 575px) {
  .home-return { width: 34px; height: 34px; flex-basis: 34px; }
}

/* Keep pickup headings matched without changing other page titles. */
.pickup-page .pickup-form > h1,
.pickup-page .package-list-header h2 { font-size: 1.5rem; }
@media (max-width: 575.98px) {
  .pickup-page .pickup-form > h1,
  .pickup-page .package-list-header h2 { font-size: 1.25rem; }
}

/* Account state uses the existing Bootstrap switch. */
.form-switch .account-enabled-switch:checked { background-color: #198754; border-color: #198754; }
.form-switch .account-enabled-switch { cursor: pointer; }
.form-switch .account-enabled-switch:disabled { cursor: default; }
