:root {
  color-scheme: light;
  --page-top: #255f9f;
  --page-bottom: #43c3d5;
  --card-top: #337ed9;
  --card-bottom: #47dce5;
  --surface: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.17);
  --text: #0b0f14;
  --muted: #34495e;
  --shadow: 0 18px 48px rgba(0, 38, 88, 0.25);
  --button-bg: rgba(8, 68, 139, 0.68);
  --button-border: rgba(255, 255, 255, 0.35);
  --radius-xl: 26px;
  --radius-lg: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-top: #071b32;
  --page-bottom: #0c5363;
  --card-top: #0d3e77;
  --card-bottom: #126f7f;
  --surface: #142436;
  --surface-muted: rgba(255, 255, 255, 0.09);
  --text: #f5f8fc;
  --muted: #c4d2df;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  --button-bg: rgba(0, 0, 0, 0.28);
  --button-border: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--page-top), var(--page-bottom));
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 10px 16px 0;
}

.app-card {
  position: relative;
  width: min(580px, 100%);
  min-height: calc(100vh - 10px);
  padding: 30px 28px 24px;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 86% 8%, rgba(255,255,255,.16), transparent 20%),
    radial-gradient(circle at 10% 94%, rgba(255,255,255,.12), transparent 24%);
}

.top-actions,
.identity,
.menu-list,
.app-footer {
  position: relative;
  z-index: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--button-border);
  border-radius: 15px;
  color: #fff;
  background: var(--button-bg);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  background: rgba(5, 56, 117, 0.82);
}

.icon-button:active {
  transform: scale(.96);
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 28px auto 31px;
}

.agency-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.15));
}

.identity h1 {
  margin: 13px 0 4px;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -.035em;
  color: #07111d;
}

.identity p {
  margin: 0;
  max-width: 420px;
  font-size: .98rem;
  font-weight: 600;
  color: #07111d;
}

:root[data-theme="dark"] .identity h1,
:root[data-theme="dark"] .identity p {
  color: #fff;
}

.menu-list {
  display: grid;
  gap: 13px;
}

.menu-card {
  min-height: 64px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 7px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(0, 52, 102, .08);
  transition: transform .16s ease, box-shadow .16s ease;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 52, 102, .15);
}

.menu-card:active {
  transform: scale(.99);
}

.menu-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #e8f6ff, #f8fbff);
  overflow: hidden;
}

:root[data-theme="dark"] .menu-icon {
  background: rgba(255,255,255,.88);
}

.menu-icon svg {
  width: 39px;
  height: 39px;
}

.menu-title {
  min-width: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.01em;
}

.menu-more {
  width: 34px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.menu-more:hover {
  background: rgba(127, 152, 179, .14);
}

.menu-more svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.app-footer {
  margin-top: 26px;
  color: rgba(2, 20, 37, .8);
  text-align: center;
}

:root[data-theme="dark"] .app-footer {
  color: rgba(255, 255, 255, .78);
}

.app-footer p {
  margin: 0 0 3px;
  font-size: .8rem;
  font-weight: 650;
}

.app-footer small {
  font-size: .72rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 50;
  max-width: min(90vw, 420px);
  padding: 12px 17px;
  border-radius: 999px;
  background: rgba(5, 17, 31, .92);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: .88rem;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 13, 28, .48);
  backdrop-filter: blur(2px);
}

.action-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 61;
  width: min(580px, 100%);
  padding: 11px 22px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -15px 35px rgba(0, 0, 0, .22);
  transform: translateX(-50%);
}

.sheet-handle {
  width: 48px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #a8b7c6;
}

.action-sheet h2 {
  margin: 0 0 7px;
  font-size: 1.25rem;
}

.action-sheet p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.sheet-actions {
  display: grid;
  gap: 10px;
}

.sheet-actions button {
  min-height: 46px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.primary-action {
  border: 0;
  background: #1976d2;
  color: #fff;
}

.secondary-action {
  border: 1px solid #1976d2;
  background: transparent;
  color: #1976d2;
}

.ghost-action {
  border: 0;
  background: rgba(127, 152, 179, .13);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .app-shell {
    padding-inline: 0;
    padding-top: 0;
  }

  .app-card {
    min-height: 100vh;
    border-radius: 0;
    padding: 24px 17px 22px;
  }

  .identity {
    margin-top: 25px;
    margin-bottom: 28px;
  }

  .agency-logo {
    width: 96px;
    height: 96px;
  }

  .identity h1 {
    font-size: 1.34rem;
  }

  .identity p {
    font-size: .88rem;
  }

  .menu-card {
    grid-template-columns: 54px minmax(0, 1fr) 34px;
    min-height: 62px;
  }

  .menu-icon {
    width: 47px;
    height: 47px;
  }

  .menu-title {
    font-size: .94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.menu-icon img { width: 44px; height: 44px; object-fit: contain; }
.public-alert { position: relative; z-index: 2; margin: -12px 0 14px; padding: 10px 13px; border-radius: 10px; background: #fff0f0; color: #9b1c1c; font-size: .88rem; text-align: center; }
.empty-state { position: relative; z-index: 2; padding: 22px; border-radius: 12px; background: rgba(255,255,255,.88); text-align: center; }
