*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #efefef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #202020;
}

#view-loading {
  position: fixed; inset: 0; z-index: 300;
  background: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup img { width: 44px; height: 44px; }
.brand-lockup .brand-name {
  font-size: 24px; font-weight: 800;
  color: #003781; letter-spacing: .5px;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid #e0e0e0; border-top-color: #003781;
  border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-msg { font-size: 14px; color: #666666; min-height: 20px; }

#view-error {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: #fff;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px; text-align: center;
}
.err-circle {
  width: 64px; height: 64px; background: #fce8e8; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
#view-error h2 { font-size: 20px; font-weight: 700; color: #dc1e1e; }
#view-error p  { font-size: 14px; color: #666666; max-width: 420px; line-height: 1.6; }
.btn-retry {
  background: #003781; color: #fff; border: none;
  padding: 11px 28px; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.btn-retry:hover { background: #002a61; }

#view-routing { display: none; flex-direction: column; min-height: 100vh; }

.header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  height: 60px;
  display: flex; align-items: center;
  padding: 0 32px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
}
.header-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.header-brand img { width: 32px; height: 32px; }
.header-brand .brand-text {
  font-size: 17px; font-weight: 800;
  color: #003781; letter-spacing: .3px;
}
.header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
}
.header-greeting { font-size: 13px; color: #666666; font-weight: 400; }

.main-content {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 52px 24px 64px;
}

.hero { text-align: center; margin-bottom: 40px; }
.hero h1 {
  font-size: 28px; font-weight: 800; color: #202020;
  line-height: 1.2;
}
.hero h1 .accent { color: #003781; }
.hero p { margin-top: 10px; font-size: 15px; color: #666666; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 960px;
}

.app-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: background .15s;
}
.app-card.can-access { cursor: pointer; }
.app-card.can-access:hover { background: #f7f7f7; }

.card-icon {
  flex-shrink: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; }

.card-body { flex: 1; min-width: 0; }
.card-name {
  font-size: 16px; font-weight: 700; color: #202020;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc { font-size: 12px; color: #666666; margin-top: 3px; line-height: 1.4; }

footer {
  background: #fff; border-top: 1px solid #e0e0e0;
  padding: 14px 32px;
  display: flex; justify-content: space-between;
  font-size: 12px; color: #666666;
  flex-shrink: 0;
}

.a2hs-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 16px;
  font-size: 13px;
  color: #202020;
}
.a2hs-icon { width: 28px; height: 28px; flex-shrink: 0; }
.a2hs-banner span { flex: 1; }
.a2hs-add-btn {
  background: #003781; color: #fff; border: none;
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.a2hs-add-btn:hover { background: #002a61; }
.a2hs-close-btn {
  background: transparent; border: none;
  color: #666666; font-size: 16px; cursor: pointer;
  padding: 4px 6px; flex-shrink: 0;
}

.ios-modal {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.ios-modal-box {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 32px 24px 40px;
  width: 100%; max-width: 480px;
  position: relative;
}
.ios-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: #efefef; border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 14px;
  cursor: pointer; color: #666666;
  display: flex; align-items: center; justify-content: center;
}
.ios-modal-icon { width: 48px; height: 48px; display: block; margin: 0 auto 12px; }
.ios-modal-box h3 {
  text-align: center; font-size: 17px; font-weight: 700;
  color: #202020; margin-bottom: 20px;
}
.ios-modal-box ol {
  padding-left: 20px; display: flex; flex-direction: column; gap: 12px;
}
.ios-modal-box li { font-size: 14px; color: #202020; line-height: 1.5; }
.ios-share-icon { font-size: 16px; }

@media (max-width: 680px) {
  .apps-grid { gap: 12px; }
  .app-card  { padding: 16px; gap: 12px; }
  .card-icon { width: 52px; height: 52px; }
  .card-name { font-size: 14px; }
}

@media (max-width: 480px) {
  .apps-grid { grid-template-columns: 1fr; max-width: 400px; }
  .header { padding: 0 16px; }
  .header-greeting { display: none; }
  .main-content { padding: 36px 16px 48px; }
  .hero h1 { font-size: 22px; }
  footer { padding: 12px 16px; }
}
