/* UP Police PYQ hub — navy / khaki / gold */
:root {
  --upp-navy: #1b2a6b;
  --upp-red: #e31c23;
  --upp-gold: #e8c547;
  --upp-khaki: #c4b48a;
  --upp-ink: #0f172a;
  --upp-muted: #475569;
  --upp-line: #e2e8f0;
  --upp-bg: #f4efe6;
  --upp-paper: #fffdf8;
}
.upp-page {
  background: var(--upp-bg);
  color: var(--upp-ink);
  min-height: 100vh;
  font-family: var(--gks-font, Inter, "Noto Sans Devanagari", "Nirmala UI", sans-serif);
  font-size: var(--gks-fs-body, 1.0625rem);
  line-height: 1.65;
  overflow-x: clip;
}
.upp-shell {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px calc(48px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.upp-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--gks-fs-small, 0.9rem);
  margin-bottom: 12px;
  color: var(--upp-muted);
}
.upp-crumb a { color: #9a3412; font-weight: 700; text-decoration: none; }

.upp-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(180deg, #e31c23 0%, #c41820 42%, #1b2a6b 42%, #121a44 100%);
  color: #fff;
  border-radius: 18px;
  padding: clamp(20px, 4vw, 28px) clamp(16px, 4vw, 28px) clamp(16px, 4vw, 28px);
  margin-bottom: 16px;
  box-shadow: 0 16px 36px rgba(11, 31, 58, 0.28);
  border: 2px solid #e8c547;
  overflow: hidden;
}
.upp-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: #e31c23;
}
.upp-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  border: 2px solid #e8c547;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.upp-hero h1 {
  margin: 8px 0 8px;
  font-size: var(--gks-fs-h1, clamp(1.3rem, 4vw, 2rem));
  color: #fff;
  line-height: 1.25;
}
.upp-hero p { margin: 0; color: rgba(255,255,255,.92); max-width: 62ch; }
.upp-kicker {
  display: inline-flex;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(201,162,39,.18);
  border: 1px solid rgba(232,197,71,.55);
  color: #fde68a;
  border-radius: 999px;
  padding: 4px 10px;
}
.upp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.upp-hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--gks-fs-small, .85rem);
}
.upp-hero-actions a.is-on,
.upp-hero-actions a.upp-cta {
  background: #e8c547;
  color: #0b1f3a !important;
  border-color: #e8c547;
}

.upp-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin: 0 0 14px;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.upp-tabs a,
.upp-chip,
.upp-filter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--upp-line);
  background: #fff;
  color: var(--upp-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--gks-fs-small, .85rem);
  cursor: pointer;
  font-family: inherit;
}
.upp-tabs a.is-on,
.upp-chip.is-on,
.upp-filter.is-on {
  background: var(--upp-navy);
  color: #fff;
  border-color: var(--upp-navy);
}
.upp-filter span { opacity: .8; font-weight: 600; margin-left: 4px; }

.upp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.upp-card {
  display: block;
  background: var(--upp-paper);
  border: 1px solid #e8dcc8;
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 14px rgba(11, 31, 58, .06);
}
.upp-card strong { display: block; color: #0b1f3a; font-size: var(--gks-fs-sub, 1.05rem); }
.upp-card p { margin: 6px 0 0; color: var(--upp-muted); font-size: var(--gks-fs-small, .9rem); }
.upp-stat { margin-top: 10px; font-weight: 800; color: #9a3412; font-size: var(--gks-fs-small, .85rem); }

.upp-score {
  position: sticky;
  top: var(--gks-sticky-top, 64px);
  z-index: 900;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.upp-q {
  background: #fff;
  border: 1px solid var(--upp-line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 14px;
}
.upp-q-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.upp-q-meta .upp-chip {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  min-height: 28px;
  background: #fef3c7;
  color: #854d0e;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid #f59e0b;
  flex: 0 0 auto;
}
.upp-q-meta .upp-chip-topic { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.upp-years { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; font-size: 0.75rem; font-weight: 700; }
.upp-years-k { color: #9a3412; }
.upp-year {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: 999px;
  padding: 2px 8px;
}
.upp-q h3 { margin: 0 0 6px; font-size: var(--gks-fs-sub, 1.12rem); line-height: 1.5; }
.upp-q-en { margin: 0 0 10px; color: var(--upp-muted); font-size: var(--gks-fs-small, .92rem); }
.upp-opts { list-style: none; margin: 0; padding: 0; }
.upp-opts li { margin: 0 0 8px; }
.upp-opt {
  display: flex;
  width: 100%;
  text-align: left;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  align-items: flex-start;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.upp-opt strong { flex-shrink: 0; }
.upp-opt.is-correct { background: #dcfce7 !important; border-color: #22c55e !important; color: #15803d; font-weight: 700; }
.upp-opt.is-wrong { background: #fee2e2 !important; border-color: #ef4444 !important; color: #b91c1c; }
.upp-ans { margin-top: 10px; border-top: 1px dashed var(--upp-line); padding-top: 8px; }
.upp-ans summary { cursor: pointer; font-weight: 800; color: #9a3412; min-height: 40px; display: flex; align-items: center; }
.upp-key { color: #15803d; font-weight: 800; }

.upp-note, .upp-links {
  background: #fff;
  border: 1px solid #e8dcc8;
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.upp-note h2, .upp-links h2 { margin: 0 0 8px; font-size: var(--gks-fs-h3, 1.25rem); color: #0b1f3a; }
.upp-links a { color: #9a3412; font-weight: 700; }

.upp-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.upp-year-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  background: #fff;
  border: 1px solid #e8dcc8;
  border-radius: 10px;
  text-decoration: none;
  color: #0b1f3a;
  font-weight: 800;
  font-size: 0.9rem;
}
.upp-year-grid a span { font-size: 0.68rem; color: #9a3412; font-weight: 700; }
.upp-year-grid a.is-on { background: #1b2a6b; color: #fff; border-color: #e8c547; }
.upp-year-grid a.is-on span { color: #fde68a; }

.exm-fold {
  margin: 0 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.exm-fold-btn {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0b1f3a;
  user-select: none;
}
.exm-fold-btn::-webkit-details-marker { display: none; }
.exm-fold-btn::marker { content: ''; }
.exm-fold-title { flex: 1 1 auto; min-width: 0; }
.exm-fold-hint {
  font-weight: 600;
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
}
.exm-fold-btn::after {
  content: '▾';
  flex-shrink: 0;
  font-size: 1.05rem;
  color: #64748b;
}
.exm-fold[open] .exm-fold-btn::after { content: '▴'; }
.exm-fold-body { padding: 0 10px 12px; }
.exm-fold-body .upp-tabs,
.exm-fold-body .upp-year-grid { margin-bottom: 0; }
.exm-fold .exm-fold { margin-top: 8px; }

@media (min-width: 768px) {
  details.exm-fold {
    border: 0;
    background: transparent;
    margin-bottom: 0;
  }
  details.exm-fold > summary.exm-fold-btn { display: none; }
  details.exm-fold > .exm-fold-body {
    display: block !important;
    padding: 0;
  }
}

html.dark-theme .exm-fold,
body.dark-theme .exm-fold {
  background: #1e293b;
  border-color: #334155;
}
html.dark-theme .exm-fold-btn,
body.dark-theme .exm-fold-btn { color: #f1f5f9; }
html.dark-theme .exm-fold-hint,
html.dark-theme .exm-fold-btn::after,
body.dark-theme .exm-fold-hint,
body.dark-theme .exm-fold-btn::after { color: #94a3b8; }
@media (min-width: 768px) {
  html.dark-theme details.exm-fold,
  body.dark-theme details.exm-fold {
    background: transparent;
    border: 0;
  }
}

.exm-motivate {
  margin: 0 0 14px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  border: 1px solid #fde68a;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 70%);
}
.exm-motivate h2 {
  margin: 0 0 8px;
  font-size: var(--gks-fs-h3, 1.2rem);
  color: #92400e;
}
.exm-motivate-line {
  margin: 0 0 10px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.55;
}
.exm-motivate-title {
  display: none;
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #9a3412;
}
.exm-motivate-fold { margin-bottom: 10px; }
.exm-motivate-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #134e4a;
  font-size: 0.95rem;
  line-height: 1.55;
}
.exm-motivate-note strong { color: #0f766e; }
@media (min-width: 768px) {
  .exm-motivate-title { display: block; }
}
html.dark-theme .exm-motivate,
body.dark-theme .exm-motivate {
  background: linear-gradient(180deg, #422006 0%, #1e293b 65%);
  border-color: #854d0e;
}
html.dark-theme .exm-motivate h2,
body.dark-theme .exm-motivate h2 { color: #fde68a; }
html.dark-theme .exm-motivate-line,
body.dark-theme .exm-motivate-line { color: #f1f5f9; }
html.dark-theme .exm-motivate-title,
body.dark-theme .exm-motivate-title { color: #fbbf24; }
html.dark-theme .exm-motivate-note,
body.dark-theme .exm-motivate-note {
  background: #134e4a;
  border-color: #0f766e;
  color: #ccfbf1;
}
html.dark-theme .exm-motivate-note strong,
body.dark-theme .exm-motivate-note strong { color: #99f6e4; }

@media (max-width: 767px) {
  .upp-shell { padding: 10px 12px calc(36px + env(safe-area-inset-bottom, 0px)); }
  .upp-hero { grid-template-columns: 1fr; text-align: center; padding: 14px 12px 16px; }
  .upp-logo { width: 72px; height: 72px; margin: 0 auto; }
  .upp-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .upp-hero-actions a { width: 100%; box-sizing: border-box; font-size: 0.78rem; }
  .upp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .upp-card { padding: 12px 10px; min-width: 0; }
  .upp-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .upp-year-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .upp-score { top: var(--gks-sticky-top, 58px); font-size: 0.82rem; }
  .upp-q { padding: 12px; }
  .upp-q h3 { font-size: 1rem; overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  .upp-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .upp-hero-actions { gap: 6px; }
}
