/**
 * HexCopy Core Stylesheet
 * Scoped design tokens, typography, header, layout, and utilities
 *
 * @package HexCopy
 */

/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
  /* Brand Accents */
  --hc-primary: #6638f9;
  --hc-primary-hover: #5425e6;
  --hc-primary-light: #f3effe;
  --hc-teal: #08c0cb;
  --hc-teal-hover: #07abb5;
  --hc-blue: #1d4ed8;
  --hc-navy: #000c24;

  /* Semantic Feedback */
  --hc-success: #10b981;
  --hc-warning: #f59e0b;
  --hc-danger: #ef4444;

  /* Typography */
  --hc-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --hc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Sizing & Radii */
  --hc-radius-sm: 6px;
  --hc-radius-md: 10px;
  --hc-radius-lg: 16px;
  --hc-radius-full: 9999px;

  /* Light Theme Defaults */
  --hc-bg: #f8fafc;
  --hc-surface: #ffffff;
  --hc-surface-hover: #f1f5f9;
  --hc-border: #e2e8f0;
  --hc-border-light: #f1f5f9;
  --hc-text: #000c24;
  --hc-text-muted: #475569;
  --hc-text-subtle: #94a3b8;
  --hc-header-bg: rgba(255, 255, 255, 0.94);
  --hc-shadow-sm: 0 1px 3px rgba(0, 12, 36, 0.05);
  --hc-shadow-md: 0 4px 12px rgba(0, 12, 36, 0.08);
  --hc-shadow-lg: 0 10px 25px rgba(0, 12, 36, 0.12);
}

/* Dark Theme Overrides */
[data-theme="dark"],
body.hexcopy-dark {
  --hc-bg: #060b17;
  --hc-surface: #0e172a;
  --hc-surface-hover: #17233d;
  --hc-border: #1e293b;
  --hc-border-light: #162035;
  --hc-text: #f8fafc;
  --hc-text-muted: #94a3b8;
  --hc-text-subtle: #64748b;
  --hc-header-bg: rgba(14, 23, 42, 0.94);
  --hc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --hc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --hc-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Header Hygiene: Prevent Theme & Mobile Header Duplication
   ========================================================================== */
body.hexcopy-suppress-theme-header #site-header,
body.hexcopy-suppress-theme-header .site-header:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header header.site-header:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header #ast-mobile-header,
body.hexcopy-suppress-theme-header .ast-mobile-header-wrap,
body.hexcopy-suppress-theme-header #ast-desktop-header,
body.hexcopy-suppress-theme-header #mobile-header,
body.hexcopy-suppress-theme-header .mobile-header,
body.hexcopy-suppress-theme-header .mobile-site-header,
body.hexcopy-suppress-theme-header #ocean-mobile-header,
body.hexcopy-suppress-theme-header #oceanwp-mobile-menu-navbar,
body.hexcopy-suppress-theme-header .ocean-mobile-menu-icon,
body.hexcopy-suppress-theme-header #main-header,
body.hexcopy-suppress-theme-header #top-header,
body.hexcopy-suppress-theme-header #masthead:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header .masthead:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header header#masthead:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header .elementor-location-header:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header:not(.hexcopy-guide-single):not(.category-guides) header.entry-header,
body.hexcopy-suppress-theme-header .wp-site-blocks > header:not(#hexcopy-site-header),
body.hexcopy-suppress-theme-header header.wp-block-template-part,
body.hexcopy-suppress-theme-header .wp-block-template-part[aria-label*="header" i],
body.hexcopy-suppress-theme-header .wp-block-template-part[aria-label*="Header" i],
body.hexcopy-suppress-theme-header header .wp-block-navigation,
body.hexcopy-suppress-theme-header .wp-site-blocks > header .wp-block-navigation {
  display: none !important;
}

/* ==========================================================================
   Guides Single Post Hygiene & Reading Experience
   Scoped strictly to individual posts in the 'guides' category
   ========================================================================== */

/* 1. Restore native post title */
body.hexcopy-guide-single header.entry-header,
body.category-guides.single-post header.entry-header {
  display: block !important;
  margin-bottom: 24px;
}

body.hexcopy-guide-single .entry-title,
body.category-guides.single-post .entry-title {
  display: block !important;
  color: var(--hc-text) !important;
  font-family: var(--hc-font-sans);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

body.hexcopy-guide-single .entry-meta,
body.category-guides.single-post .entry-meta,
body.hexcopy-guide-single .entry-meta *,
body.category-guides.single-post .entry-meta * {
  color: var(--hc-text-subtle);
}

/* 2. Container background in Dark Mode */
[data-theme="dark"] body.hexcopy-guide-single,
[data-theme="dark"] body.category-guides.single-post,
[data-theme="dark"] body.hexcopy-guide-single #page,
[data-theme="dark"] body.category-guides.single-post #page,
[data-theme="dark"] body.hexcopy-guide-single .site,
[data-theme="dark"] body.category-guides.single-post .site,
[data-theme="dark"] body.hexcopy-guide-single #content,
[data-theme="dark"] body.category-guides.single-post #content,
[data-theme="dark"] body.hexcopy-guide-single .site-content,
[data-theme="dark"] body.category-guides.single-post .site-content,
[data-theme="dark"] body.hexcopy-guide-single #primary,
[data-theme="dark"] body.category-guides.single-post #primary,
[data-theme="dark"] body.hexcopy-guide-single #main,
[data-theme="dark"] body.category-guides.single-post #main {
  background-color: var(--hc-bg) !important;
}

[data-theme="dark"] body.hexcopy-guide-single article.post,
[data-theme="dark"] body.category-guides.single-post article.post,
[data-theme="dark"] body.hexcopy-guide-single .ast-article-single,
[data-theme="dark"] body.category-guides.single-post .ast-article-single,
[data-theme="dark"] body.hexcopy-guide-single .ast-article-post,
[data-theme="dark"] body.category-guides.single-post .ast-article-post {
  background-color: var(--hc-surface) !important;
  border-color: var(--hc-border) !important;
  box-shadow: var(--hc-shadow-md);
}

[data-theme="dark"] body.hexcopy-guide-single .entry-content,
[data-theme="dark"] body.category-guides.single-post .entry-content {
  background-color: transparent !important;
}

/* 2b. Comment Section Dark Mode & Form Accessibility */
[data-theme="dark"] body.hexcopy-guide-single .comments-area,
[data-theme="dark"] body.category-guides.single-post .comments-area,
[data-theme="dark"] body.hexcopy-guide-single #comments,
[data-theme="dark"] body.category-guides.single-post #comments,
[data-theme="dark"] body.hexcopy-guide-single .comment-respond,
[data-theme="dark"] body.category-guides.single-post .comment-respond,
[data-theme="dark"] body.hexcopy-guide-single #respond,
[data-theme="dark"] body.category-guides.single-post #respond,
[data-theme="dark"] body.hexcopy-guide-single .ast-comment-list li,
[data-theme="dark"] body.category-guides.single-post .ast-comment-list li,
[data-theme="dark"] body.hexcopy-guide-single .ast-comment-list .comment-body,
[data-theme="dark"] body.category-guides.single-post .ast-comment-list .comment-body {
  background-color: var(--hc-surface) !important;
  color: var(--hc-text) !important;
  border-color: var(--hc-border) !important;
}

/* Headings ("Leave a Comment", "Comments (X)") */
[data-theme="dark"] body.hexcopy-guide-single .comments-title,
[data-theme="dark"] body.category-guides.single-post .comments-title,
[data-theme="dark"] body.hexcopy-guide-single .comment-reply-title,
[data-theme="dark"] body.category-guides.single-post .comment-reply-title,
[data-theme="dark"] body.hexcopy-guide-single #reply-title,
[data-theme="dark"] body.category-guides.single-post #reply-title {
  color: var(--hc-text) !important;
  font-family: var(--hc-font-sans);
  font-weight: 700;
}

/* Labels and Cookie Consent Checkbox Label */
[data-theme="dark"] body.hexcopy-guide-single .comment-form label,
[data-theme="dark"] body.category-guides.single-post .comment-form label,
[data-theme="dark"] body.hexcopy-guide-single .comments-area label,
[data-theme="dark"] body.category-guides.single-post .comments-area label {
  color: var(--hc-text) !important;
  font-weight: 600;
}

[data-theme="dark"] body.hexcopy-guide-single .comment-form-cookies-consent,
[data-theme="dark"] body.category-guides.single-post .comment-form-cookies-consent,
[data-theme="dark"] body.hexcopy-guide-single .comment-form-cookies-consent label,
[data-theme="dark"] body.category-guides.single-post .comment-form-cookies-consent label,
[data-theme="dark"] body.hexcopy-guide-single label[for="wp-comment-cookies-consent"],
[data-theme="dark"] body.category-guides.single-post label[for="wp-comment-cookies-consent"] {
  color: var(--hc-text-muted) !important;
  font-weight: 400 !important;
  line-height: 1.5;
}

/* Notes, Consent Text & Required Field Indicator */
[data-theme="dark"] body.hexcopy-guide-single .comment-notes,
[data-theme="dark"] body.category-guides.single-post .comment-notes,
[data-theme="dark"] body.hexcopy-guide-single .logged-in-as,
[data-theme="dark"] body.category-guides.single-post .logged-in-as,
[data-theme="dark"] body.hexcopy-guide-single .must-log-in,
[data-theme="dark"] body.category-guides.single-post .must-log-in,
[data-theme="dark"] body.hexcopy-guide-single .required-field-message,
[data-theme="dark"] body.category-guides.single-post .required-field-message {
  color: var(--hc-text-subtle) !important;
}

[data-theme="dark"] body.hexcopy-guide-single .comment-form .required,
[data-theme="dark"] body.category-guides.single-post .comment-form .required {
  color: var(--hc-danger) !important;
}

/* Links in Comment Area */
[data-theme="dark"] body.hexcopy-guide-single .comments-area a,
[data-theme="dark"] body.category-guides.single-post .comments-area a,
[data-theme="dark"] body.hexcopy-guide-single .comment-reply-link,
[data-theme="dark"] body.category-guides.single-post .comment-reply-link,
[data-theme="dark"] body.hexcopy-guide-single #cancel-comment-reply-link,
[data-theme="dark"] body.category-guides.single-post #cancel-comment-reply-link {
  color: var(--hc-teal) !important;
}

/* Form Inputs & Textarea */
[data-theme="dark"] body.hexcopy-guide-single .comment-form textarea,
[data-theme="dark"] body.category-guides.single-post .comment-form textarea,
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="text"],
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="text"],
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="email"],
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="email"],
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="url"],
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="url"] {
  background-color: var(--hc-surface-hover) !important;
  color: var(--hc-text) !important;
  border: 1px solid var(--hc-border) !important;
  border-radius: var(--hc-radius-md);
  box-shadow: none !important;
}

[data-theme="dark"] body.hexcopy-guide-single .comment-form textarea::placeholder,
[data-theme="dark"] body.category-guides.single-post .comment-form textarea::placeholder,
[data-theme="dark"] body.hexcopy-guide-single .comment-form input::placeholder,
[data-theme="dark"] body.category-guides.single-post .comment-form input::placeholder {
  color: var(--hc-text-subtle) !important;
  opacity: 1;
}

/* Keyboard Focus Indicator (both light and dark modes) */
body.hexcopy-guide-single .comment-form textarea:focus,
body.category-guides.single-post .comment-form textarea:focus,
body.hexcopy-guide-single .comment-form input[type="text"]:focus,
body.category-guides.single-post .comment-form input[type="text"]:focus,
body.hexcopy-guide-single .comment-form input[type="email"]:focus,
body.category-guides.single-post .comment-form input[type="email"]:focus,
body.hexcopy-guide-single .comment-form input[type="url"]:focus,
body.category-guides.single-post .comment-form input[type="url"]:focus {
  outline: none !important;
  border-color: var(--hc-primary) !important;
  box-shadow: 0 0 0 3px rgba(102, 56, 249, 0.25) !important;
}

[data-theme="dark"] body.hexcopy-guide-single .comment-form textarea:focus,
[data-theme="dark"] body.category-guides.single-post .comment-form textarea:focus,
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="text"]:focus,
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="text"]:focus,
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="email"]:focus,
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="email"]:focus,
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="url"]:focus,
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="url"]:focus {
  outline: none !important;
  border-color: var(--hc-primary) !important;
  box-shadow: 0 0 0 3px rgba(102, 56, 249, 0.45) !important;
}

/* Checkbox Accent in Dark Mode */
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="checkbox"],
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="checkbox"] {
  accent-color: var(--hc-primary);
}

/* Submit Button in Dark Mode */
[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="submit"],
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="submit"],
[data-theme="dark"] body.hexcopy-guide-single .comment-form #submit,
[data-theme="dark"] body.category-guides.single-post .comment-form #submit {
  background-color: var(--hc-primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--hc-primary) !important;
  border-radius: var(--hc-radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="submit"]:hover,
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="submit"]:hover,
[data-theme="dark"] body.hexcopy-guide-single .comment-form #submit:hover,
[data-theme="dark"] body.category-guides.single-post .comment-form #submit:hover {
  background-color: var(--hc-primary-hover) !important;
  border-color: var(--hc-primary-hover) !important;
}

[data-theme="dark"] body.hexcopy-guide-single .comment-form input[type="submit"]:focus,
[data-theme="dark"] body.category-guides.single-post .comment-form input[type="submit"]:focus,
[data-theme="dark"] body.hexcopy-guide-single .comment-form #submit:focus,
[data-theme="dark"] body.category-guides.single-post .comment-form #submit:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(102, 56, 249, 0.4) !important;
}

/* Existing Comments List in Dark Mode */
[data-theme="dark"] body.hexcopy-guide-single .comments-area .comment-content,
[data-theme="dark"] body.category-guides.single-post .comments-area .comment-content,
[data-theme="dark"] body.hexcopy-guide-single .comments-area .comment-content p,
[data-theme="dark"] body.category-guides.single-post .comments-area .comment-content p {
  color: var(--hc-text) !important;
}

[data-theme="dark"] body.hexcopy-guide-single .comments-area .comment-author .fn,
[data-theme="dark"] body.category-guides.single-post .comments-area .comment-author .fn {
  color: var(--hc-text) !important;
}

[data-theme="dark"] body.hexcopy-guide-single .comments-area .comment-metadata,
[data-theme="dark"] body.category-guides.single-post .comments-area .comment-metadata,
[data-theme="dark"] body.hexcopy-guide-single .comments-area .comment-metadata a,
[data-theme="dark"] body.category-guides.single-post .comments-area .comment-metadata a {
  color: var(--hc-text-subtle) !important;
}

/* 3. Typography & Text Elements */
body.hexcopy-guide-single .entry-content,
body.category-guides.single-post .entry-content {
  color: var(--hc-text);
}

body.hexcopy-guide-single .entry-content p:not([style*="color"]),
body.category-guides.single-post .entry-content p:not([style*="color"]) {
  color: var(--hc-text);
}

body.hexcopy-guide-single .entry-content h1:not([style*="color"]),
body.category-guides.single-post .entry-content h1:not([style*="color"]),
body.hexcopy-guide-single .entry-content h2:not([style*="color"]),
body.category-guides.single-post .entry-content h2:not([style*="color"]),
body.hexcopy-guide-single .entry-content h3:not([style*="color"]),
body.category-guides.single-post .entry-content h3:not([style*="color"]),
body.hexcopy-guide-single .entry-content h4:not([style*="color"]),
body.category-guides.single-post .entry-content h4:not([style*="color"]),
body.hexcopy-guide-single .entry-content h5:not([style*="color"]),
body.category-guides.single-post .entry-content h5:not([style*="color"]),
body.hexcopy-guide-single .entry-content h6:not([style*="color"]),
body.category-guides.single-post .entry-content h6:not([style*="color"]) {
  color: var(--hc-text);
  font-weight: 700;
}

body.hexcopy-guide-single .entry-content ul:not([style*="color"]),
body.category-guides.single-post .entry-content ul:not([style*="color"]),
body.hexcopy-guide-single .entry-content ol:not([style*="color"]),
body.category-guides.single-post .entry-content ol:not([style*="color"]),
body.hexcopy-guide-single .entry-content li:not([style*="color"]),
body.category-guides.single-post .entry-content li:not([style*="color"]) {
  color: var(--hc-text);
}

body.hexcopy-guide-single .entry-content a:not([style*="color"]),
body.category-guides.single-post .entry-content a:not([style*="color"]) {
  color: var(--hc-primary);
  text-underline-offset: 3px;
}

[data-theme="dark"] body.hexcopy-guide-single .entry-content a:not([style*="color"]),
[data-theme="dark"] body.category-guides.single-post .entry-content a:not([style*="color"]) {
  color: var(--hc-teal);
}

/* 4. Tables */
body.hexcopy-guide-single .entry-content table,
body.category-guides.single-post .entry-content table,
body.hexcopy-guide-single .entry-content .wp-block-table table,
body.category-guides.single-post .entry-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--hc-border);
  margin: 28px 0;
}

body.hexcopy-guide-single .entry-content th,
body.category-guides.single-post .entry-content th {
  background-color: var(--hc-surface-hover);
  color: var(--hc-text);
  border: 1px solid var(--hc-border);
  padding: 12px 16px;
  font-weight: 700;
  text-align: left;
}

body.hexcopy-guide-single .entry-content td,
body.category-guides.single-post .entry-content td {
  border: 1px solid var(--hc-border);
  padding: 12px 16px;
}

body.hexcopy-guide-single .entry-content td:not([style*="color"]),
body.category-guides.single-post .entry-content td:not([style*="color"]) {
  color: var(--hc-text);
}

body.hexcopy-guide-single .entry-content td:not([style*="background"]):not([style*="background-color"]),
body.category-guides.single-post .entry-content td:not([style*="background"]):not([style*="background-color"]) {
  background-color: var(--hc-surface);
}

body.hexcopy-guide-single .entry-content tr:nth-child(even) td:not([style*="background"]):not([style*="background-color"]),
body.category-guides.single-post .entry-content tr:nth-child(even) td:not([style*="background"]):not([style*="background-color"]),
body.hexcopy-guide-single .entry-content .is-style-stripes tbody tr:nth-child(odd) td:not([style*="background"]):not([style*="background-color"]),
body.category-guides.single-post .entry-content .is-style-stripes tbody tr:nth-child(odd) td:not([style*="background"]):not([style*="background-color"]) {
  background-color: var(--hc-surface-hover);
}

/* 5. Blockquotes, Code, Pre & Dividers */
body.hexcopy-guide-single .entry-content blockquote,
body.category-guides.single-post .entry-content blockquote {
  border-left: 4px solid var(--hc-primary);
  background-color: var(--hc-surface-hover);
  color: var(--hc-text-muted);
  padding: 16px 24px;
  margin: 28px 0;
  border-radius: 0 var(--hc-radius-md) var(--hc-radius-md) 0;
}

body.hexcopy-guide-single .entry-content blockquote p,
body.category-guides.single-post .entry-content blockquote p {
  color: var(--hc-text-muted);
  margin-bottom: 0;
}

body.hexcopy-guide-single .entry-content code:not([style*="color"]):not(pre code),
body.category-guides.single-post .entry-content code:not([style*="color"]):not(pre code) {
  font-family: var(--hc-font-mono);
  background-color: var(--hc-surface-hover);
  color: var(--hc-primary);
  padding: 2px 6px;
  border-radius: var(--hc-radius-sm);
  font-size: 0.9em;
}

[data-theme="dark"] body.hexcopy-guide-single .entry-content code:not([style*="color"]):not(pre code),
[data-theme="dark"] body.category-guides.single-post .entry-content code:not([style*="color"]):not(pre code) {
  color: var(--hc-teal);
}

body.hexcopy-guide-single .entry-content pre,
body.category-guides.single-post .entry-content pre {
  font-family: var(--hc-font-mono);
  background-color: var(--hc-surface-hover);
  color: var(--hc-text);
  border: 1px solid var(--hc-border);
  padding: 16px 20px;
  border-radius: var(--hc-radius-md);
  overflow-x: auto;
  margin: 24px 0;
}

body.hexcopy-guide-single .entry-content pre code,
body.category-guides.single-post .entry-content pre code {
  background-color: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
}

body.hexcopy-guide-single .entry-content hr,
body.category-guides.single-post .entry-content hr {
  border: none;
  border-top: 1px solid var(--hc-border);
  margin: 32px 0;
}

/* ==========================================================================
   Base Layout & Reset within HexCopy
   ========================================================================== */
.hexcopy-app-page,
body.hexcopy-standard-page {
  background-color: var(--hc-bg);
  color: var(--hc-text);
  font-family: var(--hc-font-sans);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.hexcopy-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--hc-primary);
  color: #ffffff;
  padding: 10px 18px;
  z-index: 99999;
  border-radius: var(--hc-radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}
.hexcopy-skip-link:focus {
  top: 16px;
}

.hexcopy-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.hexcopy-wrap {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--hc-font-sans);
  color: var(--hc-text);
}

/* ==========================================================================
   Site Header Component
   ========================================================================== */
.hexcopy-site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
  background: var(--hc-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hc-border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  will-change: top;
}

/* WordPress Admin Bar Sticky Offsets (prevents desktop header clipping under #wpadminbar) */
body.admin-bar .hexcopy-site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .hexcopy-site-header {
    top: 46px;
  }
}
@media screen and (max-width: 600px) {
  body.admin-bar .hexcopy-site-header {
    top: 0;
  }
}

.hexcopy-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.hexcopy-header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hexcopy-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.hexcopy-logo-img {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Light / Dark Mode Logo Switching (Zero Flash, Mobile & Desktop Guaranteed) */
.hexcopy-logo-dark {
  display: none !important;
}
.hexcopy-logo-light {
  display: block !important;
}

[data-theme="dark"] .hexcopy-logo-dark,
html[data-theme="dark"] .hexcopy-logo-dark,
html.hexcopy-dark .hexcopy-logo-dark,
body.hexcopy-dark .hexcopy-logo-dark {
  display: block !important;
}
[data-theme="dark"] .hexcopy-logo-light,
html[data-theme="dark"] .hexcopy-logo-light,
html.hexcopy-dark .hexcopy-logo-light,
body.hexcopy-dark .hexcopy-logo-light {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hexcopy-logo-dark,
  html:not([data-theme="light"]) .hexcopy-logo-dark,
  body:not([data-theme="light"]) .hexcopy-logo-dark {
    display: block !important;
  }
  :root:not([data-theme="light"]) .hexcopy-logo-light,
  html:not([data-theme="light"]) .hexcopy-logo-light,
  body:not([data-theme="light"]) .hexcopy-logo-light {
    display: none !important;
  }
}

/* Desktop Navigation */
.hexcopy-desktop-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hexcopy-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.hexcopy-nav-item {
  position: relative;
  flex-shrink: 0;
}

.hexcopy-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--hc-text);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--hc-radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.hexcopy-nav-link:hover,
.hexcopy-nav-link:focus-visible,
.hexcopy-nav-link.is-active {
  color: var(--hc-primary);
  background-color: var(--hc-surface-hover);
  outline: none;
}

/* Dropdown Menu */
.hexcopy-has-dropdown {
  position: relative;
}

.hexcopy-dropdown-arrow {
  transition: transform 0.2s ease;
}

.hexcopy-has-dropdown.is-open .hexcopy-dropdown-arrow {
  transform: rotate(180deg);
}

.hexcopy-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius-md);
  box-shadow: var(--hc-shadow-lg);
  list-style: none;
  margin: 0;
  padding: 8px;
  display: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1010;
}

.hexcopy-has-dropdown.is-open .hexcopy-dropdown-menu,
.hexcopy-has-dropdown:focus-within .hexcopy-dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.hexcopy-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--hc-text);
  text-decoration: none;
  border-radius: var(--hc-radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.hexcopy-dropdown-link:hover,
.hexcopy-dropdown-link:focus-visible {
  background-color: var(--hc-surface-hover);
  color: var(--hc-primary);
  outline: none;
}

.hexcopy-menu-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--hc-radius-full);
  display: inline-block;
  flex-shrink: 0;
}

/* Right Header Actions */
.hexcopy-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Universal HexCopy SVG icon robustness against theme overrides */
#hexcopy-site-header svg,
.hexcopy-wrap svg,
.hexcopy-standard-page-main svg,
.hexcopy-404-main svg,
.hexcopy-action-btn svg,
.hexcopy-btn svg,
.hexcopy-btn-icon svg,
.hexcopy-lock-btn svg,
.hexcopy-col-edit-btn svg,
.hexcopy-filter-search-icon,
.hexcopy-input-icon,
.hexcopy-popover-done-btn svg {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor !important;
  stroke-width: 2px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none !important;
  flex-shrink: 0;
  box-sizing: content-box;
}

.hexcopy-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--hc-radius-full);
  border: 1px solid var(--hc-border);
  background: var(--hc-surface);
  color: var(--hc-text) !important;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: all 0.15s ease;
}

.hexcopy-action-btn:hover,
.hexcopy-action-btn:focus-visible {
  border-color: var(--hc-primary);
  color: var(--hc-primary) !important;
  background-color: var(--hc-surface-hover);
  outline: none;
}

.hexcopy-saved-btn svg {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
}

.hexcopy-saved-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--hc-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: var(--hc-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Sun/Moon Toggle Visibility & Robust Sizing */
.hexcopy-theme-toggle svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}
.hexcopy-theme-toggle .hexcopy-icon-sun {
  display: none !important;
}
.hexcopy-theme-toggle .hexcopy-icon-moon {
  display: block !important;
}
[data-theme="dark"] .hexcopy-theme-toggle .hexcopy-icon-sun,
body.hexcopy-dark .hexcopy-theme-toggle .hexcopy-icon-sun {
  display: block !important;
}
[data-theme="dark"] .hexcopy-theme-toggle .hexcopy-icon-moon,
body.hexcopy-dark .hexcopy-theme-toggle .hexcopy-icon-moon {
  display: none !important;
}

/* Mobile Toggle & Icon Sizing */
.hexcopy-mobile-toggle {
  display: none;
  color: var(--hc-text) !important;
}
.hexcopy-mobile-toggle svg {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0;
}
.hexcopy-mobile-toggle .hexcopy-hamburger-icon {
  display: block !important;
}
.hexcopy-mobile-toggle .hexcopy-close-icon {
  display: none !important;
}
.hexcopy-mobile-toggle[aria-expanded="true"] .hexcopy-hamburger-icon {
  display: none !important;
}
.hexcopy-mobile-toggle[aria-expanded="true"] .hexcopy-close-icon {
  display: block !important;
}

/* Mobile Menu Drawer */
.hexcopy-mobile-menu {
  display: none;
  background: var(--hc-surface);
  border-bottom: 1px solid var(--hc-border);
  padding: 16px 20px;
  box-shadow: var(--hc-shadow-md);
}
.hexcopy-mobile-menu.is-active {
  display: block;
}
.hexcopy-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hexcopy-mobile-link {
  display: block;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--hc-text);
  text-decoration: none;
  border-radius: var(--hc-radius-sm);
  transition: background-color 0.15s ease;
}
.hexcopy-mobile-link:hover {
  background-color: var(--hc-surface-hover);
  color: var(--hc-primary);
}
.hexcopy-mobile-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hc-text-subtle);
  padding: 12px 14px 4px;
}
.hexcopy-mobile-sublink {
  padding-left: 24px;
  font-size: 14px;
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.hexcopy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--hc-radius-md);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.hexcopy-btn-lg {
  padding: 14px 26px;
  font-size: 16px;
  border-radius: var(--hc-radius-md);
}

.hexcopy-btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--hc-radius-sm);
}

.hexcopy-btn-primary {
  background: var(--hc-primary);
  color: #ffffff;
  border-color: var(--hc-primary);
}
.hexcopy-btn-primary:hover,
.hexcopy-btn-primary:focus-visible {
  background: var(--hc-primary-hover);
  border-color: var(--hc-primary-hover);
  color: #ffffff;
  outline: none;
}

.hexcopy-btn-secondary {
  background: var(--hc-surface);
  color: var(--hc-text);
  border-color: var(--hc-border);
}
.hexcopy-btn-secondary:hover {
  background: var(--hc-surface-hover);
  border-color: var(--hc-primary);
  color: var(--hc-primary);
}

.hexcopy-btn-outline {
  background: transparent;
  color: var(--hc-text);
  border-color: var(--hc-border);
}
.hexcopy-btn-outline:hover {
  background: var(--hc-surface);
  border-color: var(--hc-primary);
  color: var(--hc-primary);
}

.hexcopy-btn-ghost {
  background: transparent;
  color: var(--hc-text-muted);
  border-color: transparent;
}
.hexcopy-btn-ghost:hover {
  color: var(--hc-text);
  background: var(--hc-surface-hover);
}

.hexcopy-btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.hexcopy-btn-danger:hover {
  background: #fecaca;
  color: #991b1b;
}

.hexcopy-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--hc-radius-sm);
  background: transparent;
  border: 1px solid var(--hc-border);
  color: var(--hc-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.hexcopy-btn-icon:hover {
  color: var(--hc-primary);
  border-color: var(--hc-primary);
  background: var(--hc-surface-hover);
}

.hexcopy-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--hc-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--hc-radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.hexcopy-btn-text:hover {
  color: var(--hc-primary);
  background-color: var(--hc-surface-hover);
}

/* Inputs */
.hexcopy-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--hc-font-sans);
  border: 1px solid var(--hc-border);
  background: var(--hc-surface);
  color: var(--hc-text);
  border-radius: var(--hc-radius-sm);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hexcopy-input:focus {
  outline: none;
  border-color: var(--hc-primary);
  box-shadow: 0 0 0 3px rgba(102, 56, 249, 0.15);
}

.hexcopy-select {
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  font-family: var(--hc-font-sans);
  border: 1px solid var(--hc-border);
  background-color: var(--hc-surface);
  color: var(--hc-text);
  border-radius: var(--hc-radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s ease;
}
.hexcopy-select:focus {
  outline: none;
  border-color: var(--hc-primary);
  box-shadow: 0 0 0 3px rgba(102, 56, 249, 0.15);
}

.hexcopy-code-area {
  width: 100%;
  font-family: var(--hc-font-mono);
  font-size: 13px;
  padding: 12px;
  background: var(--hc-surface);
  color: var(--hc-text);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius-sm);
  box-sizing: border-box;
  resize: vertical;
}

/* ==========================================================================
   Badges, Pills & Indicators
   ========================================================================== */
.hexcopy-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--hc-radius-full);
}
.hexcopy-badge-curated {
  background: var(--hc-primary-light);
  color: var(--hc-primary);
}
[data-theme="dark"] .hexcopy-badge-curated,
body.hexcopy-dark .hexcopy-badge-curated {
  background: rgba(102, 56, 249, 0.2);
  color: #a78bfa;
}
.hexcopy-badge-subtle {
  background: var(--hc-surface-hover);
  color: var(--hc-text-muted);
}
.hexcopy-pass-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--hc-radius-sm);
  font-size: 11px;
  font-weight: 800;
  background: #d1fae5;
  color: #065f46;
}
.hexcopy-pass-badge.is-fail {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   Toast Notification & Clipboard Feedback
   ========================================================================== */
.hexcopy-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: var(--hc-navy);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--hc-radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
}
.hexcopy-toast.is-show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   AdSense Placement Containers
   ========================================================================== */
.hexcopy-ad-slot {
  max-width: 1240px;
  margin: 20px auto;
  padding: 0 20px;
  box-sizing: border-box;
}
.hexcopy-ad-top {
  min-height: 90px;
}
.hexcopy-ad-bottom {
  min-height: 90px;
}
.hexcopy-ad-inner {
  background: var(--hc-surface);
  border: 1px dashed var(--hc-border);
  border-radius: var(--hc-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 90px;
  box-sizing: border-box;
}
.hexcopy-ad-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hc-text-subtle);
  margin-bottom: 4px;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.hexcopy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.hexcopy-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}
.hexcopy-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 12, 36, 0.6);
  backdrop-filter: blur(4px);
}
.hexcopy-modal-dialog {
  position: relative;
  width: 90%;
  max-width: 580px;
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius-lg);
  box-shadow: var(--hc-shadow-lg);
  box-sizing: border-box;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.hexcopy-modal-lg {
  max-width: 900px;
}
.hexcopy-modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--hc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hexcopy-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--hc-text);
}

[data-theme="dark"] .hexcopy-modal-title,
body.hexcopy-dark .hexcopy-modal-title {
  color: var(--hc-text) !important;
}
.hexcopy-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--hc-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--hc-radius-sm);
}
.hexcopy-modal-close:hover {
  color: var(--hc-text);
  background: var(--hc-surface-hover);
}
.hexcopy-modal-body {
  padding: 22px;
  overflow-y: auto;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1060px) {
  .hexcopy-desktop-nav {
    display: none;
  }
  .hexcopy-mobile-toggle {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .hexcopy-header-inner {
    height: 60px;
  }
  .hexcopy-logo-img {
    height: 36px;
  }
  .hexcopy-btn-lg {
    padding: 12px 20px;
    font-size: 15px;
  }
}

@media (max-width: 390px) {
  .hexcopy-container {
    padding: 0 14px;
  }
  .hexcopy-logo-img {
    height: 32px;
  }
}
