:root {
  --pm-ink: #183642;
  --pm-ink-soft: #42606b;
  --pm-sand: #f6f1e8;
  --pm-sand-strong: #eadfcb;
  --pm-sea: #1e6f73;
  --pm-mint: #d8efe7;
  --pm-coral: #d46f4d;
  --pm-card: rgba(255, 255, 255, 0.86);
  --pm-border: rgba(24, 54, 66, 0.12);
  --pm-shadow: 0 20px 45px rgba(24, 54, 66, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(212, 111, 77, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(30, 111, 115, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf8f2 0%, #f3efe8 45%, #edf4f2 100%);
  color: var(--pm-ink);
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
}

h1,
h2,
h3,
h4,
.navbar-brand,
.display-5,
.display-6 {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  letter-spacing: -0.02em;
}

a {
  color: var(--pm-sea);
}

a:hover {
  color: #124f58;
}

.navbar {
  background: rgba(16, 39, 51, 0.92) !important;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(16, 39, 51, 0.2);
}

.navbar .nav-link,
.navbar .navbar-brand {
  color: rgba(255, 255, 255, 0.9) !important;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
  color: #fff !important;
}

.site-main {
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.hero-card,
.soft-card,
.metric-card,
.tool-card,
.data-card {
  background: var(--pm-card);
  border: 1px solid var(--pm-border);
  border-radius: 1.5rem;
  box-shadow: var(--pm-shadow);
}

.hero-card {
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -5rem -5rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(30, 111, 115, 0.18), rgba(212, 111, 77, 0.12));
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  background: rgba(30, 111, 115, 0.1);
  color: var(--pm-sea);
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions .btn {
  min-width: 12rem;
}

.section-label {
  color: var(--pm-coral);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.soft-card {
  padding: 1.5rem;
  height: 100%;
}

.metric-card {
  padding: 1.2rem 1.25rem;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  color: var(--pm-ink-soft);
  font-size: 0.95rem;
}

.tool-card,
.data-card {
  padding: 1.5rem;
}

.section-surface {
  padding: 1.75rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header p {
  max-width: 52rem;
  color: var(--pm-ink-soft);
}

.form-panel {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--pm-border);
  border-radius: 1.25rem;
  padding: 1.25rem;
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pm-ink-soft);
}

.table-responsive {
  border-radius: 1rem;
}

.canvas-shell {
  background: linear-gradient(180deg, rgba(30, 111, 115, 0.05), rgba(30, 111, 115, 0.01));
  border: 1px dashed rgba(30, 111, 115, 0.28);
  border-radius: 1.25rem;
  padding: 1rem;
}

canvas {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-radius: 1rem;
}

.footer-note {
  color: var(--pm-ink-soft);
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: rgba(216, 239, 231, 0.85);
  color: #175457;
  font-weight: 700;
}

.lang-toggle {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.lang-toggle .btn {
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  min-width: 3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-toggle .btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.archive-box {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Courier New", monospace;
  background: #102733;
  color: #f0f7f8;
  border-radius: 1rem;
  padding: 1rem;
  min-height: 15rem;
}

.archive-box.compact {
  min-height: 0;
  max-height: 24rem;
  overflow: auto;
}

.map-preview {
  border-radius: 1.25rem;
  border: 1px solid var(--pm-border);
  box-shadow: var(--pm-shadow);
}

.study-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.study-map-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(216, 239, 231, 0.45));
  border: 1px solid var(--pm-border);
  border-radius: 1.5rem;
  padding: 1rem;
}

.study-map-canvas {
  position: relative;
}

.study-map-canvas img {
  width: 100%;
  display: block;
  border-radius: 1rem;
  background: #fff;
}

.study-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(24, 54, 66, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.65rem 0.35rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(16, 39, 51, 0.2);
}

.study-marker::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--pm-coral);
  transform: translateY(-50%);
}

.study-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid var(--pm-border);
  box-shadow: var(--pm-shadow);
}

.study-credit {
  color: var(--pm-ink-soft);
  font-size: 0.86rem;
}

.study-note {
  border-left: 4px solid rgba(212, 111, 77, 0.35);
  padding-left: 1rem;
  color: var(--pm-ink-soft);
}

.study-source-list li {
  margin-bottom: 0.75rem;
}

.step-badge {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(212, 111, 77, 0.12);
  color: var(--pm-coral);
  font-weight: 700;
}

.tap-target {
  min-height: 10rem;
  font-size: 2rem;
  font-weight: 800;
}

.pdm-instruction {
  color: var(--pm-ink-soft);
  font-size: 0.95rem;
}

.pdm-table thead th {
  white-space: nowrap;
}

.pdm-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pdm-pill-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--pm-border);
  background: rgba(255, 255, 255, 0.72);
}

.pdm-soft-note {
  border-left: 4px solid rgba(30, 111, 115, 0.35);
  padding-left: 1rem;
  color: var(--pm-ink-soft);
}

.pdm-alert {
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(212, 111, 77, 0.2);
  background: rgba(212, 111, 77, 0.08);
}

.pdm-keypad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.pdm-key {
  min-height: 7rem;
  font-size: 2.2rem;
  font-weight: 800;
  border-radius: 1.25rem;
}

.pdm-key.active {
  border-color: rgba(30, 111, 115, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(30, 111, 115, 0.14);
}

.pdm-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  background: rgba(24, 54, 66, 0.08);
  color: var(--pm-ink);
  font-weight: 700;
}

.pdm-stats-table td,
.pdm-stats-table th {
  vertical-align: middle;
}

.pdm-preview-meta {
  color: var(--pm-ink-soft);
  font-size: 0.92rem;
}

.list-clean {
  padding-left: 1.1rem;
}

.list-clean li {
  margin-bottom: 0.5rem;
}

.fade-in {
  animation: fadeInUp 0.6s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767.98px) {
  .site-main {
    padding-top: 5.2rem;
  }

  .study-stat-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section-surface,
  .soft-card,
  .tool-card,
  .data-card {
    padding: 1.1rem;
  }
}
