* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--bg-page);
  color: var(--text-primary);
}

.app {
  width: min(100vw, 430px);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
}

.topbar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.back { text-decoration: none; color: var(--text-primary); font-size: 18px; }

.content { padding: 12px 16px 88px; overflow-x: hidden; }
.card {

  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-title {
  padding: 13px 16px;
  border-bottom: 1px solid #f5f7fa;
  font-size: 14px;
  font-weight: 700;
}
.row {
  min-height: 48px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f7fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.row:last-child { border-bottom: none; }
.label { color: var(--text-secondary); font-size: 13px; }
.value { font-size: 14px; font-weight: 500; }

.btn {
  border: 0;
  border-radius: 12px;
  height: 48px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-light { background: #fff; border: 1px solid #e8e8e8; color: var(--text-primary); }

.bottom-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 430px);
  max-width: 100%;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: #fff;
  box-shadow: var(--shadow-pop);
  z-index: 20;
}


.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag-blue { background: #e6f4ff; color: var(--blue); }
.tag-green { background: #f6ffed; color: var(--green); }
.tag-orange { background: #fff7e6; color: var(--orange); }
.tag-red { background: #fff1f0; color: var(--red); }
.tag-gray { background: #f5f5f5; color: #8c8c8c; }

.portal-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e6f4ff, #f6ffed);
}
.portal {
  width: min(92vw, 700px);
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
}
.portal h1 { margin: 0 0 8px; font-size: 26px; }
.portal p { margin: 0 0 20px; color: var(--text-secondary); }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.portal-grid a {
  display: block;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  background: #f5f7fa;
  color: var(--text-primary);
  padding: 12px;
  font-weight: 500;
}
.portal-grid a:hover { background: #e6f4ff; color: var(--blue); }

.hide { display: none !important; }