:root {
  --brand-blue: #22599e;
  --brand-blue-dark: #163d70;
  --ink: #1c2733;
  --ink-soft: #5b6b7c;
  --surface: #ffffff;
  --surface-alt: #f4f7fa;
  --border: #e3e9f0;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-alt);
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; display: block; }

[hidden] { display: none !important; }

.app-header {
  background: var(--brand-blue);
  color: #fff;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
}

.menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.screen {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 720px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.state-message {
  text-align: center;
  color: var(--ink-soft);
  padding: 32px 16px;
  font-size: 14px;
}

.state-message.error { color: #a33; }

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 16px;
}

.loading-logo {
  width: 88px;
  height: 88px;
  animation: atm-pulse 1.3s ease-in-out infinite;
}

@keyframes atm-pulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-logo { animation: none; opacity: .8; }
}

article.card > img:first-child {
  width: calc(100% + 28px);
  margin: -14px -14px 12px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

.list-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.list-item img {
  width: 192px;
  height: 192px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 4px;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: #fff;
  box-shadow: 2px 0 16px rgba(0,0,0,.15);
  z-index: 20;
  transform: translateX(-100%);
  transition: transform .2s ease;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  overflow-y: auto;
}

.drawer.open { transform: translateX(0); }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 15;
  display: none;
}

.drawer-overlay.open { display: block; }

.drawer a {
  display: block;
  padding: 12px 20px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.drawer a.active {
  color: var(--brand-blue);
  font-weight: 700;
}
