/* ═══════════════════════════════════════════════
   SENTENCE & PUNISHMENT LOOKUP — styles
   Colorful, high-energy palette
   ═══════════════════════════════════════════════ */
:root {
  --bg:          #f5f3ff;
  --surface:     #ffffff;
  --primary:     #7c3aed;
  --primary-l:   #9333ea;
  --pink:        #ec4899;
  --orange:      #f97316;
  --teal:        #06b6d4;
  --gold:        #f59e0b;
  --gold-soft:   #fff7ed;
  --ink:         #201a33;
  --ink-soft:    #4b5563;
  --ink-faint:   #6b7280;
  --border:      #ddd6fe;
  --line:        #ede9fe;
  --red:         #e11d48;
  --red-soft:    #ffe4e9;
  --green:       #16a34a;
  --green-soft:  #dcfce7;
  --radius:      14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0; padding: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(124,58,237,0.08), transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(236,72,153,0.08), transparent 45%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

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

/* ── SKIP NAV / NOSCRIPT (shared with index.html) ─────────── */
.skip-nav {
  position: absolute; top: -100%; left: 16px; z-index: 9999;
  padding: 8px 18px; background: var(--soil); color: var(--wheat);
  font-weight: 600; border-radius: 0 0 8px 8px;
  transition: top .2s;
}
.skip-nav:focus { top: 0; text-decoration: none; }
.noscript-banner {
  padding: 12px 20px; background: var(--wheat);
  border-bottom: 2px solid var(--clay-dark); text-align: center; color: var(--soil);
}

/* ── HEADER (shared site-wide header, same as index.html) ──── */
.site-header { background: var(--soil); position: relative; }
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--clay) 0 14px, var(--wheat) 14px 16px);
}
.header-top { padding: 16px 0 14px; }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.logo-link {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none;
}
.logo-icon-wrap {
  width: 40px; height: 40px;
  background: var(--clay); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25);
}
.logo-icon-wrap svg { stroke: var(--paper) !important; }
.logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--paper); letter-spacing: -.01em;
}
.header-nav-bar {
  background: var(--soil-deep);
  border-top: 1px solid rgba(255,255,255,.08);
}
.header-nav-bar nav { display: flex; gap: 4px; padding: 0; flex-wrap: wrap; }
.header-nav-bar nav a {
  display: inline-block;
  padding: 11px 16px;
  color: rgba(247,241,229,.78);
  font-size: var(--fs-label);
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.header-nav-bar nav a:hover { background: rgba(181,86,46,.25); color: var(--wheat); }
.header-nav-bar nav a[aria-current="page"] {
  background: var(--clay);
  color: var(--paper);
}

/* ── PAGE TITLE BLOCK (this page's own H1 — the header above is shared site-wide) ── */
.page-title-block {
  max-width: 900px;
  margin: 22px auto 0;
  padding: 0 16px;
  text-align: center;
}
.page-title-block h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.page-subtitle {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ── DISCLAIMER BANNER ───────────────────────── */
.disclaimer-banner {
  max-width: 900px;
  margin: 0 auto 16px;
  padding: 11px 16px;
  background: var(--gold-soft);
  border: 1.5px solid #fbbf24;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: #92400e;
  text-align: center;
  line-height: 1.5;
}
.disclaimer-banner strong { color: #7c2d12; }

/* ── MAIN LAYOUT ─────────────────────────────── */
.page-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

/* ── HERO IMAGE ──────────────────────────────── */
.hero-image-wrap {
  max-width: 900px;
  margin: 22px auto;
  padding: 0 4px;
  text-align: center;
}
.hero-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
@media (min-width: 720px) {
  .hero-image {
    max-width: 70%;
  }
}

/* ── TOOL CARD ───────────────────────────────── */
.tool-lead-in {
  max-width: 900px;
  margin: 18px auto 0;
  padding: 0 4px;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--primary-l);
  text-align: center;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 18px;
  box-shadow: 0 8px 24px rgba(124,58,237,0.1);
}

.tool-card h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  color: var(--primary);
  border-bottom: 2px solid var(--line);
  padding-bottom: 10px;
}

/* ── FORM CONTROLS ───────────────────────────── */
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 14px;
}
.form-group { flex: 1 1 220px; min-width: 0; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.field {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
}
select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c3aed' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Search input inside section picker */
.search-wrap { position: relative; margin-bottom: 10px; }
.search-wrap input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-wrap input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(6,182,212,0.15);
}
.search-wrap::before {
  content: "\1F50D";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Section list (scrollable checkbox list) */
.section-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: linear-gradient(180deg, #faf9ff, #f3f0ff);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}
.section-list::-webkit-scrollbar { width: 8px; }
.section-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 8px; }
.section-list::-webkit-scrollbar-thumb:hover { background: var(--pink); }

.section-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.section-item:last-child { margin-bottom: 0; }
.section-item:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 14px rgba(6,182,212,0.18);
  transform: translateY(-2px);
}
.section-item:active { transform: translateY(0); }

/* Custom checkbox — colorful, replaces the plain browser default */
.section-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  flex-shrink: 0;
  border: 2.5px solid var(--border);
  border-radius: 7px;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.section-item input[type="checkbox"]:hover {
  border-color: var(--pink);
}
.section-item input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  border-color: var(--pink);
  transform: scale(1.08);
}
.section-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.section-item input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Checked row gets a vivid, "picked" look */
.section-item:has(input[type="checkbox"]:checked) {
  background: linear-gradient(120deg, #fdf2ff, #fff7ed);
  border-color: var(--pink);
  box-shadow: 0 4px 14px rgba(236,72,153,0.2);
}

.section-item .s-code {
  display: inline-block;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--teal));
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
}
.section-item:has(input[type="checkbox"]:checked) .s-code {
  background: linear-gradient(120deg, var(--pink), var(--orange));
}
.section-item .s-title { color: var(--ink-soft); }

.section-count {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 8px;
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  min-height: 46px;
  text-decoration: none;
  user-select: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary {
  background: linear-gradient(120deg, var(--primary), var(--pink));
  color: #fff;
  box-shadow: 0 6px 18px rgba(124,58,237,0.32);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--line); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── RESULTS ─────────────────────────────────── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 18px;
  box-shadow: 0 8px 24px rgba(124,58,237,0.1);
}
.result-card[hidden] { display: none; }
.result-card h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Selected sections list */
.selected-list { margin: 0; padding: 0; list-style: none; }
.selected-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.selected-item:last-child { border-bottom: none; }
.sel-info { flex: 1; min-width: 0; }
.sel-code { font-weight: 700; color: var(--primary); }
.sel-title { color: var(--ink-soft); margin: 0; font-size: 0.88rem; }
.sel-punishment {
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 5px 12px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sev-none   { background: #f1f5f9; color: var(--ink-faint); }
.sev-low    { background: var(--green-soft); color: var(--green); }
.sev-medium { background: #fef3c7; color: #b45309; }
.sev-high   { background: #ffe4e6; color: var(--red); }
.sev-life   { background: linear-gradient(120deg, #fbcfe8, #fecaca); color: #9d174d; }

.sel-remove {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.sel-remove:hover { background: var(--red-soft); color: var(--red); }

/* Maximum summary */
.max-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #ede9fe, #fce7f3, #ffedd5);
  border: 2px solid var(--primary);
}
.max-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary-l);
  margin: 0 0 4px;
}
.max-value {
  font-size: 1.7rem;
  font-weight: 900;
  background: linear-gradient(120deg, var(--primary), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}
.max-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--ink-faint);
  font-size: 0.95rem;
}
.empty-state .icon { font-size: 2rem; margin-bottom: 6px; }

/* ── SEO CONTENT ─────────────────────────────── */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 22px;
  box-shadow: 0 8px 24px rgba(124,58,237,0.1);
}
.content-section h2 {
  font-size: 1.15rem;
  color: var(--primary);
  margin: 26px 0 10px;
}
.content-section h2:first-child { margin-top: 0; }
.content-section h3 {
  font-size: 1rem;
  color: var(--pink);
  margin: 18px 0 8px;
}
.content-section p {
  margin: 8px 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ── FOOTER ──────────────────────────────────── */
.site-footer {
  background: linear-gradient(120deg, #201a33, #3b0764);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 22px 16px;
  margin-top: 32px;
  font-size: 0.82rem;
  line-height: 1.6;
  border-top: 3px solid var(--pink);
}
.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.footer-links a { color: #fbcfe8; font-weight: 600; }
.footer-links a:hover { color: #fff; }

/* ── AUTHOR ──────────────────────────────────── */
.author-line {
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
  margin: 18px 0 4px;
}
.author-label { text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.72rem; font-weight: 800; color: var(--primary); }
.author-link { color: var(--pink); text-decoration: none; }
.author-link:hover { text-decoration: underline; }

/* ── RELATED TOOLS ───────────────────────────── */
.related-tools-line {
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
  margin: 24px 0 4px;
}
.related-tools-line a { color: var(--pink); text-decoration: none; }
.related-tools-line a:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 640px) {
  .site-header h1 { font-size: 1.3rem; }
  .form-row { flex-direction: column; }
  .form-group { flex: 1 1 100%; }
  .tool-card, .result-card, .content-section { padding: 16px; }
  .max-value { font-size: 1.4rem; }
  .selected-item { flex-direction: column; gap: 4px; }
  .sel-punishment { align-self: flex-start; }
}

@media (max-width: 380px) {
  body { font-size: 14px; }
  .site-header h1 { font-size: 1.15rem; }
  .page-wrap { padding: 10px; }
}

/* ── PRINT ───────────────────────────────────── */
@media print {
  .site-header, .site-footer, .tool-card, .disclaimer-banner { display: none !important; }
  .result-card { border: 1px solid #ccc; box-shadow: none; }
}
