:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;

  --emerald: #059669;
  --emerald-dark: #047857;
  --emerald-soft: #d1fae5;
  --emerald-tint: #ecfdf5;

  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #ccfbf1;
  --teal-tint: #f0fdfa;

  --amber: #d97706;
  --amber-dark: #b45309;
  --amber-soft: #fef3c7;
  --amber-tint: #fffbeb;

  --crimson: #dc2626;
  --crimson-dark: #b91c1c;
  --crimson-soft: #fee2e2;
  --crimson-tint: #fef2f2;

  --sky: #0284c7;
  --sky-soft: #e0f2fe;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 8% 6%, rgba(5, 150, 105, 0.14), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(13, 148, 136, 0.14), transparent 36%),
    radial-gradient(circle at 52% 96%, rgba(217, 119, 6, 0.1), transparent 40%),
    var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.app-shell {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===========================
   HEADER
   =========================== */
.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-back-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-back-portal:hover {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald-dark);
}

.btn-back-portal svg {
  width: 16px;
  height: 16px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand h1 {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.meb-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
  border: 1px solid #a7f3d0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}

.stat-discover .progress-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.stat-score {
  background: var(--amber-tint);
  border-color: #fde68a;
  color: var(--amber-dark);
}

.stat-score .pill-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-ghost {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--emerald);
  color: var(--emerald-dark);
}

.btn-primary {
  background: var(--emerald);
  color: #ffffff;
  border-color: var(--emerald-dark);
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald-dark);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}

/* ===========================
   MODE NAVIGATION TABS
   =========================== */
.mode-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease, background 0.18s ease;
}

.mode-tab:hover {
  border-color: var(--emerald);
  transform: translateY(-1px);
}

.mode-tab.is-active {
  border-color: var(--emerald);
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.14);
}

.mode-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #ffffff;
}

.mode-badge--emerald { background: linear-gradient(135deg, #059669, #047857); }
.mode-badge--teal    { background: linear-gradient(135deg, #0d9488, #0f766e); }
.mode-badge--amber   { background: linear-gradient(135deg, #d97706, #b45309); }
.mode-badge--crimson { background: linear-gradient(135deg, #dc2626, #b91c1c); }

.mode-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mode-copy strong {
  font-size: 0.89rem;
  font-weight: 800;
  line-height: 1.25;
}

.mode-copy small {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   CARDS & PANELS
   =========================== */
.mode-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.section-desc {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 780px;
}

/* Segmented buttons */
.segmented-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 12px;
  flex-wrap: wrap;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.seg-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}

.seg-btn.is-active {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.seg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.seg-dot--emerald { background: var(--emerald); }
.seg-dot--teal    { background: var(--teal); }
.seg-dot--amber   { background: var(--amber); }

/* ===========================
   TAB 1: SHOWCASE CANVAS + INSPECTOR
   =========================== */
.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.canvas-stage,
.cons-canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.canvas-stage canvas,
.cons-canvas-wrap canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 920 / 430;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.canvas-chip {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--emerald-dark);
  background: var(--emerald-tint);
  border: 1px solid #a7f3d0;
  padding: 5px 11px;
  border-radius: 999px;
}

.canvas-tools-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-mini {
  padding: 5px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-mini:hover {
  background: var(--amber-tint);
  border-color: var(--amber);
  color: var(--amber-dark);
}

.btn-mini.is-on {
  background: var(--crimson);
  border-color: var(--crimson-dark);
  color: #ffffff;
}

.level-inspector {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inspector-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
}

.level-inspector h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.inspector-lead {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.kpi-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-box strong {
  font-size: 0.84rem;
  color: var(--text-main);
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--text-main);
}

.meb-note {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-tint);
  border: 1px solid #fde68a;
  font-size: 0.81rem;
  color: #78350f;
}

/* ===========================
   TAB 1: TÜRKİYE 6 ENDEMİK TÜR ATLASI
   =========================== */
.atlas-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.iucn-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.iucn--cr      { background: var(--crimson-soft); color: var(--crimson-dark); border: 1px solid #fecaca; }
.iucn--en      { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.iucn--vu      { background: var(--amber-soft); color: var(--amber-dark); border: 1px solid #fde68a; }
.iucn--endemic { background: var(--emerald-soft); color: var(--emerald-dark); border: 1px solid #a7f3d0; }
.iucn--teal    { background: var(--teal-soft); color: var(--teal-dark); border: 1px solid #99f6e4; }

.species-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.species-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
  transition: all 0.16s ease;
}

.species-card:hover {
  border-color: var(--emerald);
  background: #ffffff;
  transform: translateY(-2px);
}

.species-card.is-active {
  border-color: var(--emerald);
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.14);
}

.species-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.species-emoji {
  font-size: 1.45rem;
  line-height: 1;
}

.species-card h4 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
}

.species-card .sp-region {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.species-spotlight {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.spotlight-visual {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  min-height: 190px;
}

.spotlight-visual svg {
  width: 100%;
  max-width: 196px;
  height: auto;
  display: block;
}

.spotlight-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spotlight-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.spotlight-top h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.latin-name {
  margin: 2px 0 0;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--teal-dark);
  font-weight: 600;
}

.spotlight-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.spotlight-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
}

.meta-box--threat  { border-left: 4px solid var(--crimson); }
.meta-box--protect { border-left: 4px solid var(--emerald); }
.meta-box--habitat { border-left: 4px solid var(--teal); }
.meta-box--fact    { border-left: 4px solid var(--amber); }

.meta-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-soft);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.meta-box p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-main);
}

/* ===========================
   TAB 2: IN SITU VS EX SITU & KARAR SİMÜLATÖRÜ
   =========================== */
.cons-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.cons-card {
  border-radius: 14px;
  border: 1.5px solid var(--border);
  padding: 14px 16px;
  background: var(--bg-subtle);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.cons-card--emerald.is-highlight {
  border-color: var(--emerald);
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.12);
}

.cons-card--teal.is-highlight {
  border-color: var(--teal);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.12);
}

.cons-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.tag-pill--emerald { background: var(--emerald-soft); color: var(--emerald-dark); }
.tag-pill--teal    { background: var(--teal-soft); color: var(--teal-dark); }

.cons-card p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-cloud span {
  font-size: 0.77rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-main);
}

/* Decision simulator */
.decision-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.decision-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all 0.16s ease;
}

.decision-toggle:hover {
  border-color: var(--emerald);
  background: #ffffff;
}

.decision-toggle.is-checked {
  border-color: var(--emerald);
  background: var(--emerald-tint);
}

.decision-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background 0.18s ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.decision-toggle input:checked + .toggle-switch {
  background: var(--emerald);
}

.decision-toggle input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-content strong {
  font-size: 0.89rem;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.toggle-content small {
  font-size: 0.79rem;
  color: var(--text-muted);
}

.policy-tag {
  font-style: normal;
  font-size: 0.69rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.policy-tag--insitu { background: var(--emerald-soft); color: var(--emerald-dark); }
.policy-tag--exsitu { background: var(--teal-soft); color: var(--teal-dark); }
.policy-tag--law    { background: var(--amber-soft); color: var(--amber-dark); }

.telemetry-panel {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.iucn-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  color: #ffffff;
  transition: background 0.25s ease;
}

.iucn-banner--cr { background: linear-gradient(135deg, #dc2626, #991b1b); }
.iucn-banner--en { background: linear-gradient(135deg, #ea580c, #c2410c); }
.iucn-banner--vu { background: linear-gradient(135deg, #d97706, #b45309); }
.iucn-banner--nt { background: linear-gradient(135deg, #0d9488, #0f766e); }
.iucn-banner--lc { background: linear-gradient(135deg, #059669, #047857); }

.banner-eyebrow {
  display: block;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.iucn-status-banner h3 {
  margin: 2px 0 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.status-score-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.02rem;
  font-weight: 900;
  flex-shrink: 0;
}

.iucn-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.iucn-step {
  text-align: center;
  padding: 7px 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #ffffff;
  opacity: 0.55;
  transition: all 0.2s ease;
}

.iucn-step strong {
  display: block;
  font-size: 0.82rem;
}

.iucn-step small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.iucn-step.is-current {
  opacity: 1;
  border-color: var(--text-main);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.meter-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.meter-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.25s ease;
}

.meter-fill--crimson { background: linear-gradient(90deg, #dc2626, #ef4444); }
.meter-fill--amber   { background: linear-gradient(90deg, #d97706, #f59e0b); }
.meter-fill--emerald { background: linear-gradient(90deg, #059669, #10b981); }
.meter-fill--teal    { background: linear-gradient(90deg, #0d9488, #14b8a6); }

.decision-feedback {
  padding: 11px 13px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 0.83rem;
  color: var(--text-main);
}

/* ===========================
   TAB 3: BİYOKAÇAKÇILIK, ENDEMİZM, SÖZLEŞMELER
   =========================== */
.alert-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--crimson-soft);
  color: var(--crimson-dark);
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 800;
}

.emerald-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
  border: 1px solid #a7f3d0;
  font-size: 0.78rem;
  font-weight: 800;
}

.biopiracy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
}

.biopiracy-facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-tile {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.info-tile--crimson { border-left: 4px solid var(--crimson); }
.info-tile--amber   { border-left: 4px solid var(--amber); }
.info-tile--emerald { border-left: 4px solid var(--emerald); }

.info-tile h4 {
  margin: 0 0 4px;
  font-size: 0.91rem;
  font-weight: 800;
}

.info-tile p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.scenario-box {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #fffbeb 0%, #ffffff 65%);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.scenario-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.scenario-head small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.scenario-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip-btn:hover {
  border-color: var(--amber);
}

.chip-btn.is-active {
  background: var(--amber);
  border-color: var(--amber-dark);
  color: #ffffff;
}

.scenario-detail h5 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--text-main);
}

.scenario-detail p {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.scenario-measure {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--emerald-tint);
  border: 1px solid #a7f3d0;
  font-size: 0.82rem;
  color: var(--emerald-dark);
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reason-card {
  padding: 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.reason-card:hover {
  transform: translateY(-2px);
  border-color: var(--emerald);
  background: #ffffff;
}

.reason-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.reason-icon--emerald { background: var(--emerald-soft); }
.reason-icon--amber   { background: var(--amber-soft); }
.reason-icon--teal    { background: var(--teal-soft); }
.reason-icon--sky     { background: var(--sky-soft); }

.reason-card h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
}

.reason-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mini-list {
  margin: 2px 0 0;
  padding-left: 16px;
  font-size: 0.79rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.treaty-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.treaty-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
  transition: all 0.16s ease;
}

.treaty-card:hover {
  border-color: var(--teal);
  background: #ffffff;
  transform: translateY(-2px);
}

.treaty-card.is-active {
  border-color: var(--teal);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.14);
}

.treaty-year {
  font-size: 0.71rem;
  font-weight: 800;
  color: var(--teal-dark);
  background: var(--teal-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.treaty-card h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
}

.treaty-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.treaty-tag {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald-dark);
}

.treaty-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #99f6e4;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.treaty-spot-pill {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  margin-bottom: 6px;
}

.treaty-spot-left h3 {
  margin: 0 0 6px;
  font-size: 1.06rem;
}

.treaty-spot-left p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.treaty-spot-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.treaty-spot-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.treaty-spot-box strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 3px;
}

.treaty-spot-box p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===========================
   TAB 4: 8 VAKA KARTI & 12 MEB SORUSU
   =========================== */
.sorting-actions,
.quiz-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.progress-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.score-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.case-feedback {
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-main);
}

.case-feedback.is-ok {
  background: var(--emerald-tint);
  border-color: #6ee7b7;
  color: var(--emerald-dark);
}

.case-feedback.is-err {
  background: var(--crimson-tint);
  border-color: #fca5a5;
  color: var(--crimson-dark);
}

.case-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.case-card {
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: #ffffff;
  cursor: grab;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  user-select: none;
}

.case-card:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.case-card.is-selected {
  border-color: var(--amber);
  background: var(--amber-tint);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.22);
}

.case-card.is-dragging {
  opacity: 0.5;
}

.case-card-num {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--emerald-dark);
  background: var(--emerald-soft);
  padding: 1px 7px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.bins-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.drop-bin {
  border-radius: 14px;
  border: 2px dashed var(--border-strong);
  background: var(--bg-subtle);
  padding: 12px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.drop-bin--emerald { border-color: #6ee7b7; background: #f4fdf9; }
.drop-bin--teal    { border-color: #5eead4; background: #f2fdfa; }
.drop-bin--crimson { border-color: #fca5a5; background: #fef7f7; }
.drop-bin--amber   { border-color: #fcd34d; background: #fffcf2; }

.drop-bin.is-over {
  transform: scale(1.015);
  border-style: solid;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.bin-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bin-icon {
  font-size: 1.25rem;
  line-height: 1.1;
}

.bin-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
}

.bin-head small {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.bin-count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.bin-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.placed-pill {
  padding: 7px 9px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-main);
}

/* QUIZ */
.quiz-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 16px;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--teal));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.quiz-topic-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  margin-bottom: 8px;
}

.quiz-question {
  margin: 0 0 14px;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.45;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.16s ease;
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--emerald);
  background: #ffffff;
}

.quiz-opt .opt-key {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-opt.is-correct {
  border-color: var(--emerald);
  background: var(--emerald-tint);
  color: var(--emerald-dark);
}

.quiz-opt.is-correct .opt-key {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.quiz-opt.is-wrong {
  border-color: var(--crimson);
  background: var(--crimson-tint);
  color: var(--crimson-dark);
}

.quiz-opt.is-wrong .opt-key {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #ffffff;
}

.quiz-explanation {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--amber-tint);
  border: 1px solid #fde68a;
  font-size: 0.85rem;
  color: #78350f;
  margin-bottom: 14px;
}

.quiz-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.q-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
}

.q-dot.is-current {
  border-color: var(--text-main);
  color: var(--text-main);
  background: #ffffff;
}

.q-dot.is-right {
  background: var(--emerald);
  border-color: var(--emerald-dark);
  color: #ffffff;
}

.q-dot.is-wrong {
  background: var(--crimson);
  border-color: var(--crimson-dark);
  color: #ffffff;
}

.quiz-summary {
  text-align: center;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.summary-medal {
  font-size: 3rem;
  line-height: 1;
}

.quiz-summary h3 {
  margin: 0;
  font-size: 1.3rem;
}

.quiz-summary p {
  margin: 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 160px));
  gap: 10px;
  margin: 6px 0;
}

.sum-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sum-box span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sum-box strong {
  font-size: 1.15rem;
  color: var(--emerald-dark);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-soft);
  padding: 4px 6px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1120px) {
  .mode-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .showcase-grid,
  .decision-layout,
  .biopiracy-grid,
  .treaty-spotlight {
    grid-template-columns: 1fr;
  }
  .species-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .reasons-grid,
  .treaty-grid,
  .case-deck,
  .bins-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px 12px 28px;
  }
  .mode-nav,
  .cons-compare-grid,
  .species-spotlight,
  .spotlight-meta-grid,
  .reasons-grid,
  .treaty-grid,
  .case-deck,
  .bins-grid,
  .quiz-options {
    grid-template-columns: 1fr;
  }
  .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-stats {
    grid-template-columns: 1fr;
    width: 100%;
  }
}
