/* Snap2Data — tema compartido (docs + service-status) */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --link: #2563eb;
  --operational: #22c55e;
  --degraded: #eab308;
  --partial: #f97316;
  --major: #ef4444;
  --no_data: #d1d5db;
  --banner-ok: #ecfdf5;
  --banner-ok-text: #047857;
  --banner-warn: #fffbeb;
  --banner-warn-text: #b45309;
  --banner-bad: #fef2f2;
  --banner-bad-text: #b91c1c;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  --nav-height: 3.25rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--link); }
a:hover { text-decoration: underline; }

/* Layout */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.wrap-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Site navigation (docs) */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  gap: 1rem;
}

.site-nav-brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav-brand:hover { text-decoration: none; color: var(--text); }

.site-nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  display: block;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}

@media (max-width: 768px) {
  .site-nav-toggle { display: block; }
  .site-nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: 0.75rem;
  }
  .site-nav-links.is-open { display: flex; }
  .site-nav-inner { flex-wrap: wrap; }
}

/* Page header (docs hero) */
.page-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.page-header .subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-weight: 400;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.meta-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* Main content sections */
.docs-main {
  padding: 2rem 0 3rem;
}

.section-block {
  margin-bottom: 2rem;
}

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.section-card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.section-card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.section-card-body {
  padding: 1.25rem;
}

.section-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.section-card-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.lead {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.inset-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  height: 100%;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.plain-list li:last-child { border-bottom: none; }

.bullet-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.bullet-list li { margin-bottom: 0.35rem; }

.hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

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

/* Alerts */
.alert {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-warn { background: var(--banner-warn); border-color: #fde68a; color: var(--banner-warn-text); }
.alert-ok { background: var(--banner-ok); border-color: #a7f3d0; color: var(--banner-ok-text); }
.alert-light { background: var(--bg); color: var(--text); }

/* Accordion (details) */
.accord-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--card);
  overflow: hidden;
}

.accord-item summary {
  padding: 0.75rem 1.1rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.accord-item summary::-webkit-details-marker { display: none; }

.accord-item summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 400;
}

.accord-item[open] summary::after { content: '−'; }

.accord-item[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.accord-body { padding: 1.25rem; }

/* Tabs */
.tabs { margin-top: 0.5rem; }

.tab-list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  margin-bottom: -2px;
}

.tab-btn:hover { color: var(--text); background: var(--bg); }

.tab-btn.active {
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-bottom-color: var(--card);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Code */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
}

.code-block code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.875rem;
}

.method-get, .method-post, .method-put, .method-delete {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.method-get { background: #22c55e; color: #fff; }
.method-post { background: #2563eb; color: #fff; }
.method-put { background: #eab308; color: #1a1a1a; }
.method-delete { background: #ef4444; color: #fff; }

pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-x: auto;
  margin: 0.75rem 0;
}

pre.bg-light {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

pre code {
  background: none !important;
  padding: 0 !important;
  color: inherit;
  font-family: var(--font-mono);
}

code {
  background: var(--bg);
  color: #be185d;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: var(--font-mono);
}

.code-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.85;
}

.copy-btn:hover { opacity: 1; color: var(--text); }
.copy-btn.is-ok { border-color: #86efac; color: var(--banner-ok-text); background: var(--banner-ok); }
.copy-btn.is-err { border-color: #fecaca; color: var(--banner-bad-text); background: var(--banner-bad); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0.75rem 0; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

.data-table tbody tr:hover { background: #fafafa; }

/* Two-column code examples */
.code-examples-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
  align-items: start;
}

.code-examples-two-col > .code-col {
  min-width: 0;
}

.code-examples-two-col > .code-col + .code-col {
  border-left: 1px solid var(--border);
  padding-left: 1.25rem;
}

.code-examples-two-col .code-wrap {
  min-width: 0;
  max-width: 100%;
}

.code-examples-two-col pre {
  max-height: 560px;
  overflow: auto;
  font-size: 0.72rem;
  min-width: 0;
  max-width: 100%;
  white-space: pre;
  word-break: normal;
}

.code-examples-two-col h4 {
  margin-top: 0;
}

.tab-panels,
.tab-panel {
  width: 100%;
}

@media (max-width: 900px) {
  .code-examples-two-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .code-examples-two-col > .code-col + .code-col {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-top: 0.25rem;
  }
  .code-examples-two-col pre { max-height: none; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a { color: var(--link); }
.site-footer .copyright { font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-width: 320px;
}

/* ─── Service-status page ─── */

.status-page header { margin-bottom: 1.5rem; }
.status-page header h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 0.25rem; }
.status-page header p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.status-page header .period-range { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }

.banner {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.banner-operational { background: var(--banner-ok); color: var(--banner-ok-text); }
.banner-degraded { background: var(--banner-warn); color: var(--banner-warn-text); }
.banner-partial { background: var(--banner-warn); color: var(--banner-warn-text); }
.banner-major { background: var(--banner-bad); color: var(--banner-bad-text); }

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 1rem;
  font-weight: 600;
}

.component {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.component-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.component h2 { font-size: 1.05rem; margin: 0 0 0.2rem; font-weight: 600; }
.component-desc { margin: 0; font-size: 0.875rem; color: var(--muted); }

.coverage-note {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.provider-links {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.provider-links a { color: var(--link); text-decoration: none; }
.provider-links a:hover { text-decoration: underline; }
.provider-status { font-weight: 500; }

.fetch-warning {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--banner-warn-text);
  background: var(--banner-warn);
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
}

.uptime-badge { text-align: right; flex-shrink: 0; }
.uptime-value { display: block; font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.uptime-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.timeline {
  display: flex;
  gap: 2px;
  height: 34px;
  align-items: stretch;
}

.day-bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px;
  cursor: default;
}

.status-operational { background: var(--operational); }
.status-degraded { background: var(--degraded); }
.status-partial { background: var(--partial); }
.status-major { background: var(--major); }
.status-no_data { background: var(--no_data); }

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.note ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.note li { margin-bottom: 0.35rem; }

.support {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 2rem;
}

.support h2 { font-size: 1.05rem; margin: 0 0 1rem; font-weight: 600; }

.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
}

.support h3 { font-size: 0.9rem; margin: 0 0 0.5rem; font-weight: 600; }

.support ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.support li { margin-bottom: 0.25rem; }
.support-web { margin-top: 1rem; text-align: center; font-size: 0.875rem; }
.support a { color: var(--link); text-decoration: none; }
.support a:hover { text-decoration: underline; }

.subscribe {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 2rem;
}

.subscribe h2 { font-size: 1.05rem; margin: 0 0 0.5rem; font-weight: 600; }
.subscribe-desc { margin: 0 0 1rem; font-size: 0.875rem; color: var(--muted); }

.subscribe-alert {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.subscribe-alert-ok {
  background: var(--banner-ok);
  color: var(--banner-ok-text);
  border: 1px solid #a7f3d0;
}

.subscribe-form { margin: 0; }
.subscribe-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.35rem; }

.subscribe-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.subscribe-input {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.subscribe-btn {
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: #047857;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.subscribe-btn:hover { background: #065f46; }

.subscribe-legal {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.status-page footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.status-page footer a { color: var(--link); text-decoration: none; }
.status-page footer a:hover { text-decoration: underline; }
.status-page footer .copyright { font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }

@media (max-width: 480px) {
  .component-header { flex-direction: column; }
  .uptime-badge { text-align: left; }
  .support-grid { grid-template-columns: 1fr; }
  .subscribe-row { flex-direction: column; }
  .subscribe-btn { width: 100%; }
}

.req-yes, .req-no, .req-warn { font-size: 0.9rem; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* Print */
@media print {
  .site-nav, .page-header, .site-footer { display: none !important; }
  .accord-item { border: 1px solid var(--border); }
  .accord-item summary::after { display: none; }
  .tab-panel { display: block !important; }
}
