/* Open Graph Preview — orange/amber theme */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  --accent:  #f97316;
  --agrad:   linear-gradient(135deg, #f97316, #f59e0b);
  --bg:      #0f0f13;
  --card:    #18181f;
  --card2:   #1e1e28;
  --text:    #f1f1f7;
  --text2:   #9090aa;
  --faint:   #252533;
  --border:  #2a2a3a;
  --border2: #3a3a50;
  --input:   #12121a;
  --red:     #ef4444;
  --green:   #10b981;
  --amber:   #f59e0b;
  --info:    #38bdf8;
}

/* ── Base ── */
body { background: var(--bg); color: var(--text); font-family: system-ui,-apple-system,sans-serif; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Header ── */
.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; background: rgba(15,15,19,.9); backdrop-filter: blur(12px); }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 34px; height: 34px; border-radius: 9px; }
.logo-text { font-size: 15px; font-weight: 700; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { font-size: 14px; color: var(--text2); transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* ── Hero ── */
.hero { text-align: center; padding: 52px 20px 40px; background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(249,115,22,.1) 0%, transparent 70%); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.3); border-radius: 20px; color: var(--accent); font-size: 12px; font-weight: 600; padding: 4px 12px; margin-bottom: 16px; }
.hero h1 { font-size: clamp(26px,5vw,42px); font-weight: 800; line-height: 1.15; letter-spacing: -.5px; margin-bottom: 12px; }
.hero h1 .g { background: var(--agrad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { color: var(--text2); font-size: 16px; max-width: 600px; margin: 0 auto; line-height: 1.65; }

/* ── Page ── */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 70px; }
.tool-card  { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 40px; display: flex; flex-direction: column; gap: 20px; }

/* ── Fetch bar ── */
.fetch-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fetch-input {
  flex: 1;
  background: var(--input);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  height: 40px;
  padding: 0 14px;
  transition: border-color .2s;
  min-width: 0;
}
.fetch-input:focus { outline: none; border-color: var(--accent); }
.fetch-input::placeholder { color: var(--text2); }
.fetch-btn {
  background: var(--agrad);
  border: none;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 18px;
  height: 40px;
  white-space: nowrap;
  transition: opacity .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.fetch-btn:hover:not(:disabled) { opacity: .88; }
.fetch-btn:disabled { opacity: .5; cursor: default; }
.clear-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  height: 40px;
  padding: 0 14px;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.clear-btn:hover { border-color: var(--red); color: var(--red); }
.fetch-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); border-radius: 8px; color: #fca5a5; font-size: 13px; padding: 10px 14px; }
.fetching-spinner { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Two-column layout ── */
.og-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) { .og-layout { grid-template-columns: 1fr; } }

/* ── Form panel ── */
.form-panel { display: flex; flex-direction: column; gap: 14px; }

.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.field-counter { font-weight: 400; font-size: 10px; }
.field-counter.warn { color: var(--amber); }
.field-counter.over { color: var(--red); }

.og-input, .og-textarea, .og-select {
  background: var(--input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 11px;
  transition: border-color .2s;
  width: 100%;
}
.og-textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
.og-input:focus, .og-textarea:focus, .og-select:focus { outline: none; border-color: var(--accent); }
.og-input::placeholder, .og-textarea::placeholder { color: var(--text2); }
.og-select { cursor: pointer; }
.og-select option { background: #1e1e28; }

/* Image preview inside form */
.img-thumb-row { display: flex; align-items: center; gap: 10px; }
.img-thumb {
  width: 60px;
  height: 40px;
  border-radius: 5px;
  background: var(--faint);
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-status { font-size: 11px; }
.img-status.ok  { color: var(--green); }
.img-status.err { color: var(--red); }
.img-status.wait { color: var(--text2); }

/* Advanced toggle */
.adv-toggle {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  padding: 7px 12px;
  transition: border-color .15s, color .15s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}
.adv-toggle:hover { border-color: var(--accent); color: var(--accent); }
.adv-chevron { transition: transform .2s; margin-left: auto; }
.adv-chevron.open { transform: rotate(180deg); }
.adv-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; }
.adv-note { font-size: 11px; color: var(--text2); }

/* ── Result panel ── */
.result-panel { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 860px) { .result-panel { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; } }
.result-panel::-webkit-scrollbar { width: 5px; }
.result-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* Platform tabs */
.platform-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.platform-tab {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  transition: border-color .15s, color .15s, background .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.platform-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(249,115,22,.08); }

/* Image placeholder (shared) */
.preview-img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--border2);
}
.preview-img-placeholder svg { opacity: .5; }
.preview-img-placeholder span { font-size: 11px; }

/* ── Twitter/X card ── */
.tw-card {
  background: #000;
  border: 1px solid #2f3336;
  border-radius: 16px;
  overflow: hidden;
  max-width: 500px;
}
.tw-img-wrap { width: 100%; aspect-ratio: 2/1; overflow: hidden; }
.tw-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-body { padding: 12px 14px; }
.tw-domain { font-size: 13px; color: #71767b; margin-bottom: 3px; }
.tw-title { font-size: 15px; font-weight: 600; color: #e7e9ea; margin-bottom: 2px; line-height: 1.35; }
.tw-desc  { font-size: 13px; color: #71767b; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Twitter summary (small) card */
.tw-card.summary .tw-img-wrap { display: none; }
.tw-card.summary .tw-body { display: flex; gap: 12px; padding: 12px; }
.tw-card.summary .tw-thumb { width: 100px; height: 100px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.tw-card.summary .tw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tw-card.summary .tw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }

/* ── Facebook card ── */
.fb-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  max-width: 500px;
  font-family: Helvetica, Arial, sans-serif;
}
.fb-img-wrap { width: 100%; aspect-ratio: 1.91/1; overflow: hidden; background: #e4e6ea; }
.fb-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-body { background: #f2f3f5; padding: 10px 12px; border-top: 1px solid #ddd; }
.fb-site  { font-size: 11px; text-transform: uppercase; color: #8a8d91; letter-spacing: .3px; margin-bottom: 3px; }
.fb-title { font-size: 14px; font-weight: 600; color: #1c1e21; line-height: 1.35; margin-bottom: 2px; }
.fb-desc  { font-size: 13px; color: #606770; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Discord embed ── */
.dc-embed {
  background: #2b2d31;
  border-left: 4px solid #5865f2;
  border-radius: 4px;
  padding: 10px 14px 12px;
  max-width: 440px;
}
.dc-site  { font-size: 12px; color: #5865f2; margin-bottom: 6px; font-weight: 500; }
.dc-title { font-size: 14px; font-weight: 700; color: #949cf7; margin-bottom: 4px; }
.dc-desc  { font-size: 13px; color: #dbdee1; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dc-img-wrap { width: 100%; aspect-ratio: 2/1; border-radius: 4px; overflow: hidden; }
.dc-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Slack unfurl ── */
.sl-unfurl {
  background: #1a1d21;
  border-left: 4px solid #36c5f0;
  border-radius: 4px;
  padding: 10px 14px 12px;
  max-width: 440px;
}
.sl-site  { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.sl-title { font-size: 14px; font-weight: 700; color: #36c5f0; margin-bottom: 3px; }
.sl-desc  { font-size: 13px; color: #9b9ea4; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sl-img-wrap { width: 100%; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; }
.sl-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── WhatsApp card ── */
.wa-bubble {
  background: #005c4b;
  border-radius: 10px 10px 10px 0;
  padding: 4px;
  max-width: 320px;
}
.wa-preview {
  background: #023c30;
  border-left: 4px solid #25d366;
  border-radius: 6px;
  overflow: hidden;
}
.wa-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.wa-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wa-body { padding: 8px 10px 6px; }
.wa-title  { font-size: 13px; font-weight: 700; color: #e9edef; line-height: 1.3; margin-bottom: 2px; }
.wa-desc   { font-size: 12px; color: rgba(233,237,239,.7); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.wa-domain { font-size: 11px; color: rgba(233,237,239,.45); }
.wa-time   { padding: 0 4px 3px; text-align: right; font-size: 10px; color: rgba(233,237,239,.5); }

/* ── iMessage ── */
.im-bubble {
  background: #007aff;
  border-radius: 18px 18px 4px 18px;
  padding: 4px;
  max-width: 300px;
}
.im-preview {
  background: rgba(0,0,0,.15);
  border-radius: 14px 14px 0 14px;
  overflow: hidden;
}
.im-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.im-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-body { padding: 8px 10px 6px; }
.im-site  { font-size: 10px; text-transform: uppercase; color: rgba(255,255,255,.7); letter-spacing: .5px; margin-bottom: 2px; }
.im-title { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; }

/* Platform wrapper */
.platform-preview-wrap { min-height: 120px; }
.platform-label { font-size: 11px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }

/* ── Validation ── */
.validation-box { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.val-header { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.val-title { font-size: 13px; font-weight: 700; }
.val-score { font-size: 12px; font-weight: 700; }
.val-score.all-pass { color: var(--green); }
.val-score.has-error { color: var(--red); }
.val-score.has-warn  { color: var(--amber); }
.val-list { display: flex; flex-direction: column; }
.val-item { display: flex; align-items: flex-start; gap: 9px; padding: 7px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.val-item:last-child { border-bottom: none; }
.val-icon { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.val-icon.pass { background: rgba(16,185,129,.15); color: var(--green); }
.val-icon.fail-error { background: rgba(239,68,68,.12); color: var(--red); }
.val-icon.fail-warn  { background: rgba(245,158,11,.1); color: var(--amber); }
.val-icon.fail-info  { background: rgba(56,189,248,.1); color: var(--info); }
.val-icon svg { width: 10px; height: 10px; }
.val-label { flex: 1; color: var(--text); }
.val-note  { color: var(--text2); margin-top: 1px; }

/* ── Generated code ── */
.code-box { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.code-header { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.code-title { font-size: 13px; font-weight: 700; }
.copy-code-btn {
  background: var(--agrad);
  border: none;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  transition: opacity .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.copy-code-btn:hover { opacity: .88; }
.code-pre {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: #c9d1d9;
  padding: 14px;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  max-height: 320px;
  overflow-y: auto;
}
.code-pre::-webkit-scrollbar { height: 5px; width: 5px; }
.code-pre::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Info sections ── */
.info-sections-wrap { display: flex; flex-direction: column; gap: 0; margin-bottom: 40px; }
.info-section { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 28px 32px; border-bottom: none; }
.info-section:first-child { border-radius: 16px 16px 0 0; }
.info-section:last-child  { border-radius: 0 0 16px 16px; border-bottom: 1px solid var(--border); }
.info-icon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.info-icon { width: 36px; height: 36px; border-radius: 9px; background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); }
.info-icon svg { width: 16px; height: 16px; }
.info-section h2 { font-size: 17px; font-weight: 700; }
.info-body { font-size: 14px; line-height: 1.75; color: var(--text2); }
.info-body p + p { margin-top: 10px; }
.info-body ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.info-body strong { color: var(--text); }
.info-body code { background: var(--card2); border: 1px solid var(--border); border-radius: 4px; color: #fb923c; font-size: 12px; padding: 1px 5px; }

/* ── Related tools ── */
.related-section { margin-bottom: 40px; }
.related-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.related-header h2 { font-size: 20px; font-weight: 700; }
.view-all-link { display: flex; align-items: center; gap: 5px; color: var(--accent); font-size: 13px; font-weight: 600; transition: opacity .2s; }
.view-all-link:hover { opacity: .8; }
.view-all-link svg { width: 14px; height: 14px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 14px; }
.related-tool-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; transition: border-color .2s, transform .2s; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.related-tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.rt-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; flex-shrink: 0; }
.rt-icon svg { width: 20px; height: 20px; color: #fff; }
.rt-name { font-size: 14px; font-weight: 700; }
.rt-desc { font-size: 12px; color: var(--text2); line-height: 1.5; flex: 1; }
.rt-link { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 600; margin-top: 4px; }
.rt-link svg { width: 12px; height: 12px; }

/* ── Blog cards ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 16px; }
.blog-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .2s, transform .2s; }
.blog-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.blog-cat { border-radius: 12px; font-size: 11px; font-weight: 700; padding: 3px 9px; align-self: flex-start; }
.blog-title { font-size: 14px; font-weight: 700; line-height: 1.4; }
.blog-excerpt { font-size: 12px; color: var(--text2); line-height: 1.55; flex: 1; }
.blog-meta { font-size: 11px; color: var(--text2); }
.blog-read { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 600; margin-top: 2px; }
.blog-read svg { width: 12px; height: 12px; }

/* ── Footer ── */
.site-footer { background: var(--card); border-top: 1px solid var(--border); padding: 50px 20px 0; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 40px; padding-bottom: 40px; }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { max-width: 280px; }
.footer-tagline { font-size: 13px; color: var(--text2); line-height: 1.6; margin-top: 12px; }
.footer-nav-wrap { display: flex; gap: 50px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text2); margin-bottom: 4px; }
.footer-col a { font-size: 13px; color: var(--text2); transition: color .2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 20px; }
.footer-bottom .inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.footer-bottom p { font-size: 12px; color: var(--text2); }
