@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg: #f8fafc;
  --bg-accent: #eef3ff;
  --surface: #ffffff;
  --surface-muted: #eef2ff;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --brand-strong: #2f5f97;
  --header-bg: rgba(255, 255, 255, 0.97);
  --header-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  --overlay-bg: rgba(248, 250, 252, 0.98);
}

html {
  color-scheme: light;
  max-width: 100%;
  overflow-x: hidden;
}

html.dark {
  color-scheme: dark;
  --bg: #090c14;
  --bg-accent: #11172a;
  --surface: #111827;
  --surface-muted: #1a2340;
  --text: #e2e8f0;
  --muted: #9aa9c2;
  --border: rgba(148, 163, 184, 0.3);
  --brand-strong: #8fb8ff;
  --header-bg: rgba(9, 12, 20, 0.94);
  --header-shadow: 0 1px 0 rgba(148, 163, 184, 0.2);
  --overlay-bg: rgba(9, 12, 20, 0.98);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 240px);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

.page-main a {
  color: var(--brand-strong);
  text-decoration: none;
}

.page-main a:hover {
  text-decoration: underline;
}

.site-footer a {
  color: var(--brand-strong);
}

.container {
  width: 100%;
  max-width: 1280px;
  padding-left: 24px;
  padding-right: 24px;
  margin: 0 auto;
}

.page-main {
  padding: 126px 0 56px;
  overflow-x: clip;
}

.page-hero {
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: 8px;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
}

.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 24px;
}

.search-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-row input[type="search"] {
  flex: 1;
  min-width: 180px;
}

input[type="search"],
input[type="text"],
input[type="date"],
select,
textarea,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

textarea {
  resize: vertical;
}

.page-main button,
.page-main .search-row .clear-link {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 16px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.page-main button {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.page-main button:hover {
  opacity: 0.92;
}

.search-row .clear-link {
  text-decoration: none;
}

.search-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 250px;
}

.post-meta {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-card h2 {
  margin: 0;
  font-size: 1.26rem;
  line-height: 1.25;
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--surface-muted);
  color: var(--text);
  border-radius: 999px;
  font-size: 0.76rem;
  padding: 4px 10px;
  font-weight: 600;
}

.read-more {
  margin-top: auto;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 28px;
  background: var(--surface);
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.breadcrumb {
  margin-bottom: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.93rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.article-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.article-aside {
  position: sticky;
  top: 118px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 14px;
}

.article-aside h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.article-aside dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.article-aside dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.article-aside dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
}

.article-content {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: clamp(16px, 2.8vw, 30px);
  min-width: 0;
  overflow-x: hidden;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 42px;
  padding: 20px 0 30px;
  color: var(--muted);
}

.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.simple-message {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  background: var(--surface);
}

.simple-message h1 {
  margin: 0 0 10px;
}

.simple-message p {
  margin: 0;
  color: var(--muted);
}

.alert {
  border-radius: 12px;
  padding: 11px 12px;
  margin: 10px 0;
  border: 1px solid transparent;
}

.alert.success {
  border-color: rgba(22, 163, 74, 0.3);
  background: rgba(22, 163, 74, 0.1);
}

.alert.error {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.08);
}

.alert.warning {
  border-color: rgba(202, 138, 4, 0.35);
  background: rgba(202, 138, 4, 0.1);
}

.panel-header code {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 2px 6px;
}

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

.panel-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px;
}

.panel-card h2 {
  margin: 0 0 12px;
}

.panel-list-toolbar {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 12px;
  margin-bottom: 12px;
}

.panel-list-toolbar label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.panel-list-row {
  flex-wrap: wrap;
  align-items: flex-end;
}

.panel-list-row select {
  width: auto;
  min-width: 190px;
}

.panel-list-row button {
  white-space: nowrap;
}

.table-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-form {
  display: grid;
  gap: 12px;
}

.panel-form button,
.panel-list-toolbar button {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  border-color: rgba(37, 99, 235, 0.36);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.panel-form button:hover,
.panel-list-toolbar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.27);
}

.panel-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.inline-check input[type="checkbox"] {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.posts-table th,
.posts-table td {
  border-top: 1px solid var(--border);
  padding: 10px 8px;
  vertical-align: top;
  text-align: left;
}

.posts-table th {
  font-size: 0.86rem;
  color: var(--muted);
}

.posts-table td strong {
  display: block;
  line-height: 1.35;
}

.posts-table td small {
  color: var(--muted);
}

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

.row-actions form {
  margin: 0;
}

.row-actions a,
.danger-link {
  border: 1px solid rgba(37, 99, 235, 0.36);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.84rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.danger-link {
  border-color: rgba(220, 38, 38, 0.42);
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24);
}

.page-main button.danger-link {
  border-color: rgba(220, 38, 38, 0.42);
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24);
}

.row-actions a:hover,
.danger-link:hover {
  text-decoration: none;
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.danger-link:hover {
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

.page-main button.danger-link:hover {
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

/* Canonical article style for uploaded snippets. */
.seo-pillar-gtm-ga4 {
  font-family: inherit;
  color: var(--text);
  line-height: 1.68;
  max-width: 980px;
  margin: 0 auto;
}

.seo-pillar-gtm-ga4 h1,
.seo-pillar-gtm-ga4 h2,
.seo-pillar-gtm-ga4 h3 {
  line-height: 1.24;
  margin: 22px 0 10px;
  letter-spacing: -0.01em;
}

.seo-pillar-gtm-ga4 h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.2rem);
}

.seo-pillar-gtm-ga4 h2 {
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  border-left: 4px solid rgba(15, 23, 42, 0.22);
  padding-left: 12px;
}

html.dark .seo-pillar-gtm-ga4 h2 {
  border-left-color: rgba(148, 163, 184, 0.45);
}

.seo-pillar-gtm-ga4 h3 {
  font-size: 1.15rem;
}

.seo-pillar-gtm-ga4 p {
  margin: 10px 0;
}

.seo-pillar-gtm-ga4 ul,
.seo-pillar-gtm-ga4 ol {
  margin: 10px 0 10px 22px;
}

.seo-pillar-gtm-ga4 .meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 6px 0 16px;
}

.seo-pillar-gtm-ga4 .box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0;
}

.seo-pillar-gtm-ga4 .box strong {
  display: block;
  margin-bottom: 4px;
}

.seo-pillar-gtm-ga4 .callout {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0;
}

.seo-pillar-gtm-ga4 .warn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0;
}

.seo-pillar-gtm-ga4 .toc {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

html.dark .seo-pillar-gtm-ga4 .toc {
  background: rgba(15, 23, 42, 0.36);
}

.seo-pillar-gtm-ga4 .toc a {
  color: var(--text);
}

.seo-pillar-gtm-ga4 .faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  margin: 10px 0;
  background: var(--surface);
}

.seo-pillar-gtm-ga4 .faq summary {
  cursor: pointer;
  font-weight: 700;
}

.seo-pillar-gtm-ga4 .small {
  font-size: 0.92rem;
  color: var(--muted);
}

.seo-pillar-gtm-ga4 code {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 7px;
  padding: 2px 5px;
}

html.dark .seo-pillar-gtm-ga4 code {
  background: rgba(148, 163, 184, 0.18);
}

@media (max-width: 980px) {
  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-main {
    padding-top: 114px;
  }
}

@media (max-width: 680px) {
  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-list-row select {
    width: 100%;
    min-width: 0;
  }

  .search-row .clear-link {
    text-align: center;
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
