/**
 * Plan 31 Phase 9 — Public supporting docs (ALWAYS LIGHT)
 * Desktop + handheld. No [data-appearance=dark] rules.
 */

:root {
  color-scheme: light;
  --pd-header: #0f3460;
  --pd-header-border: #0a2540;
  --pd-bg: #f8fafc;
  --pd-card: #ffffff;
  --pd-text: #0f172a;
  --pd-muted: #475569;
  --pd-border: #e2e8f0;
  --pd-emerald: #059669;
  --pd-emerald-soft: #ecfdf5;
  --pd-sky: #0ea5e9;
  --pd-radius: 1.25rem;
  --pd-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 8px 24px rgb(15 23 42 / 0.06);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--pd-bg);
  color: var(--pd-text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.pd-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--pd-emerald);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 0.75rem 0;
  text-decoration: none;
}
.pd-skip:focus {
  left: 0;
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

.pd-header {
  background: var(--pd-header);
  border-bottom: 1px solid var(--pd-header-border);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.pd-header-inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.pd-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
  min-height: 44px;
  font-weight: 700;
  font-size: 1.05rem;
}
.pd-brand img {
  width: 40px;
  height: 40px;
  border-radius: 0.65rem;
  display: block;
}
.pd-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.95rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pd-btn:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}
.pd-btn-ghost {
  color: #fff;
  border-color: rgb(255 255 255 / 0.3);
  background: transparent;
}
.pd-btn-ghost:hover {
  background: rgb(255 255 255 / 0.1);
}
.pd-btn-primary {
  background: #fff;
  color: #0c4a6e;
}
.pd-btn-primary:hover {
  background: #f0f9ff;
}
.pd-btn-emerald {
  background: var(--pd-emerald);
  color: #fff;
}
.pd-btn-emerald:hover {
  background: #047857;
}

.pd-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.pd-crumb {
  font-size: 0.8125rem;
  color: var(--pd-muted);
  margin: 0 0 1rem;
}
.pd-crumb a {
  color: var(--pd-emerald);
  text-decoration: none;
  font-weight: 600;
}
.pd-crumb a:hover,
.pd-crumb a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.pd-card {
  background: var(--pd-card);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  box-shadow: var(--pd-shadow);
  padding: 1.5rem 1.25rem;
}
@media (min-width: 640px) {
  .pd-card {
    padding: 2rem 2rem;
  }
}

.pd-h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--pd-text);
}
.pd-meta {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: #64748b;
}
.pd-lede {
  margin: 0 0 1.25rem;
  color: var(--pd-muted);
  font-size: 1rem;
}

.pd-section {
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}
.pd-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.pd-h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  color: #0f3460;
}
.pd-section p {
  margin: 0 0 0.65rem;
  color: var(--pd-muted);
}
.pd-section p:last-child {
  margin-bottom: 0;
}
.pd-section ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  color: var(--pd-muted);
}
.pd-section li {
  margin-bottom: 0.35rem;
}

.pd-entry {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem;
  border: 1px solid var(--pd-border);
  border-radius: 1rem;
  background: #f8fafc;
}
.pd-entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.pd-entry-ver {
  font-weight: 700;
  color: var(--pd-text);
}
.pd-entry-date {
  font-size: 0.8125rem;
  color: #64748b;
}
.pd-entry ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--pd-muted);
}

.pd-contact-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.pd-contact-item {
  border: 1px solid var(--pd-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: var(--pd-emerald-soft);
}
.pd-contact-item strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--pd-text);
}
.pd-contact-item a {
  color: var(--pd-emerald);
  font-weight: 600;
  word-break: break-all;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.pd-footer {
  border-top: 1px solid var(--pd-border);
  background: #fff;
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
}
.pd-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.75rem;
}
.pd-footer-nav a {
  color: #475569;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.pd-footer-nav a:hover,
.pd-footer-nav a:focus-visible {
  color: var(--pd-emerald);
  outline: none;
}
.pd-footer-copy {
  margin: 0;
  color: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Phase 10 — a11y / responsive / perf for public docs */
html,
body {
  overflow-x: clip;
  max-width: 100%;
}
.pd-section {
  scroll-margin-top: calc(4.5rem + env(safe-area-inset-top, 0px));
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}
.pd-h1 {
  scroll-margin-top: calc(4.5rem + env(safe-area-inset-top, 0px));
}
/* Comfortable reading measure on desktop */
@media (min-width: 1280px) {
  .pd-main {
    max-width: 48rem;
  }
  .pd-card {
    padding: 2.25rem 2.5rem;
  }
}
/* Phone 390 */
@media (max-width: 390px) {
  .pd-main {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .pd-card {
    padding: 1.15rem 1rem;
    border-radius: 1rem;
  }
  .pd-header-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .pd-btn {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
    font-size: 0.8125rem;
  }
}
/* Tablet */
@media (min-width: 641px) and (max-width: 1023px) {
  .pd-main {
    max-width: 40rem;
    padding-top: 1.75rem;
  }
}
.pd-skip:focus-visible {
  left: 0;
  outline: 2px solid #34d399;
  outline-offset: 2px;
}
@media print {
  .pd-header,
  .pd-skip {
    display: none !important;
  }
  .pd-card {
    box-shadow: none;
    border: 0;
  }
}
