* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #1a1a1a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #6db3f2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ── */
.site-nav {
  background: #2d2d2d;
  border-bottom: 1px solid #444;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .logo {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.site-nav .nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.site-nav .nav-links a {
  color: #bbb;
  font-size: 13px;
}

.site-nav .nav-links a:hover {
  color: #fff;
  text-decoration: none;
}

/* ── Page content ── */
.page-content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
  line-height: 1.7;
}

.page-content h1 {
  font-size: 28px;
  color: #fff;
  margin-bottom: 16px;
}

.page-content h2 {
  font-size: 20px;
  color: #fff;
  margin-top: 32px;
  margin-bottom: 12px;
}

.page-content h3 {
  font-size: 16px;
  color: #ddd;
  margin-top: 24px;
  margin-bottom: 8px;
}

.page-content p {
  margin-bottom: 16px;
  color: #ccc;
  font-size: 15px;
}

.page-content ul, .page-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.page-content li {
  margin-bottom: 8px;
  color: #ccc;
  font-size: 15px;
}

/* ── Hero (landing page) ── */
.hero {
  text-align: center;
  padding: 60px 24px 40px;
}

.hero h1 {
  font-size: 36px;
  color: #fff;
  margin-bottom: 16px;
}

.hero p {
  font-size: 17px;
  color: #aaa;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero .cta-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #4285f4;
  color: #fff;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.hero .cta-btn:hover {
  background: #3367d6;
  text-decoration: none;
}

/* ── Features grid ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.feature-card {
  background: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 24px;
}

.feature-card h3 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: #999;
  line-height: 1.5;
}

/* ── How it works ── */
.how-it-works {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.how-it-works h2 {
  font-size: 24px;
  color: #fff;
  text-align: center;
  margin-bottom: 32px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-num {
  background: #4285f4;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.step-text h3 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 4px;
}

.step-text p {
  color: #999;
  font-size: 14px;
}

/* ── Footer ── */
.site-footer {
  background: #242424;
  border-top: 1px solid #333;
  padding: 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #888;
  font-size: 13px;
}

.footer-links a:hover {
  color: #ccc;
}

.site-footer .copyright {
  color: #555;
  font-size: 12px;
}

/* ── Viewer page (toolbar + image) ── */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2d2d2d;
  border-bottom: 1px solid #444;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar h1 {
  font-size: 15px;
  font-weight: 500;
}

.toolbar .meta {
  font-size: 12px;
  color: #999;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button {
  padding: 6px 14px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #3a3a3a;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.toolbar-actions button:hover {
  background: #4a4a4a;
}

.toolbar-actions button.primary {
  background: #4285f4;
  border-color: #4285f4;
}

.toolbar-actions button.primary:hover {
  background: #3367d6;
}

/* ── Ad banner top ── */
.ad-banner-top {
  text-align: center;
}

.ad-banner-top:has(script),
.ad-banner-top:has(iframe),
.ad-banner-top:has(ins) {
  background: #222;
  min-height: 90px;
  padding: 10px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Viewer body (screenshot + sidebar) ── */
.viewer-body {
  display: flex;
  flex: 1;
}

/* ── Ad sidebar ── */
.ad-sidebar {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
}

.ad-sidebar:has(script),
.ad-sidebar:has(iframe),
.ad-sidebar:has(ins) {
  width: 300px;
  padding: 20px 16px;
  border-left: 1px solid #333;
  overflow: visible;
}

.ad-slot {
  border-radius: 4px;
  margin-bottom: 20px;
}

.ad-slot:has(script),
.ad-slot:has(iframe),
.ad-slot:has(ins) {
  min-height: 250px;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot:first-child {
  position: sticky;
  top: 60px;
}

.image-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.image-area img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  border-radius: 4px;
  display: none;
}

.image-area img[src] {
  display: block;
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner p {
  color: #999;
  font-size: 14px;
}

.no-extension-msg {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.no-extension-msg h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #ccc;
}

.no-extension-msg p {
  color: #888;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Guide cards ── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.guide-card {
  display: block;
  background: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.guide-card:hover {
  border-color: #4285f4;
  background: #2a2a2a;
  text-decoration: none;
}

.guide-card h3 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
}

.guide-card p {
  font-size: 14px;
  color: #999;
  line-height: 1.5;
  margin-bottom: 12px;
}

.guide-card .read-more {
  font-size: 13px;
  color: #4285f4;
  font-weight: 500;
}

/* ── Article styles ── */
.article .breadcrumb {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}

.article .breadcrumb a {
  color: #6db3f2;
}

.article .article-meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
}

.article .article-nav {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.article kbd {
  background: #333;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 13px;
  color: #ddd;
  font-family: inherit;
}

.article pre {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.article code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: #e0e0e0;
}

.article p code {
  background: #2a2a2a;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 13px;
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 16px;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.page-content th,
.page-content td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid #333;
  color: #ccc;
}

.page-content th {
  background: #2a2a2a;
  color: #fff;
  font-weight: 600;
}

/* ── Content page ad areas ── */
.content-ad {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

/* Show ad areas only when they contain a script (ad code inserted) */
.content-ad:has(script),
.content-ad:has(iframe),
.content-ad:has(ins) {
  padding: 12px 24px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-ad-top:has(script),
.content-ad-top:has(iframe),
.content-ad-top:has(ins) {
  border-bottom: 1px solid #333;
  background: #1e1e1e;
}

.content-ad-bottom:has(script),
.content-ad-bottom:has(iframe),
.content-ad-bottom:has(ins) {
  border-top: 1px solid #333;
  background: #1e1e1e;
}
