/* Palette mirrored from app/src/main/java/online/explorecity/questapp/ui/theme/ */
:root {
  --primary: #1A6B7A;
  --primary-dark: #0E4F5C;
  --on-primary: #FFFFFF;
  --primary-container: #D0EEF4;
  --on-primary-container: #0E4F5C;

  --secondary: #8B6914;
  --on-secondary: #FFFFFF;
  --secondary-container: #FFF0C7;
  --on-secondary-container: #3D2E00;

  --tertiary: #3E6B3E;
  --tertiary-container: #D0F0D0;
  --on-tertiary-container: #1B3A1B;

  --background: #F8FAFB;
  --surface: #FFFFFF;
  --surface-variant: #EEF3F4;
  --on-surface: #1A1C1D;
  --on-surface-variant: #55605F;
  --outline: #C4CAD0;
  --error: #B3261E;
  --on-error: #FFFFFF;

  --shadow: 0 2px 8px rgba(20, 40, 50, 0.08);
  --shadow-lg: 0 4px 16px rgba(20, 40, 50, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body, #root {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}

input, textarea {
  font: inherit;
}

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

a { color: var(--primary); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  background: var(--primary);
  color: var(--on-primary);
  transition: opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active { opacity: .85; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-block { width: 100%; }

.text-input {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.text-input:focus { border-color: var(--primary); }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-variant);
  color: var(--on-surface);
  font-size: 14px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.selected {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary);
}

.app-shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100%;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  background: var(--background);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px;
  background: var(--background);
  border-bottom: 1px solid var(--outline);
}
.topbar h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iconbtn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--on-surface);
}
.iconbtn:active { background: var(--surface-variant); }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--outline);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0;
  color: var(--on-surface-variant);
  font-size: 12px;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .bn-icon { font-size: 22px; line-height: 1; }

.stack > * + * { margin-top: var(--stack, 12px); }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: var(--on-surface-variant);
}

.error {
  padding: 24px;
  color: var(--error);
  text-align: center;
}

.offline-banner {
  margin: 12px 16px;
  padding: 12px 14px;
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
