/* Meta Tag Generator — tool styles on the shared design (site/assets/site.css, Docs/DESIGN_SYSTEM.md v2).
   Colours come from the shared tokens. Exception, documented in tests/site/site-constants.js: the illustrative
   search-result and social-card previews keep the neutral colours of the surfaces they imitate. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }

/* Page */
.container { width: min(100% - 2rem, 1100px); margin: 0 auto; padding: 0; }
.hero { text-align: center; padding: 48px 0 20px; margin: 0; }
.eyebrow, .kicker { color: var(--violet); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow { display: inline-block; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-ink); }
h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; margin: 18px 0 12px; }
.hero p:last-child { max-width: 620px; margin: auto; color: var(--muted); font-size: 1.05rem; }
h2 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { margin: 0 0 10px; font-size: 1.05rem; }

/* In-page section links */
.page-sections { margin: 0 auto 24px; }
.page-sections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.page-sections a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--violet); font-weight: 600; text-decoration: none; background: var(--surface); border: 1px solid var(--line); }
.page-sections a:hover { background: var(--violet-soft); color: var(--violet-ink); }

/* Tool card */
.tool-card { position: relative; max-width: 860px; margin: auto; padding: clamp(20px, 4vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 55px rgba(15, 23, 42, .07); }
.st-related { max-width: 860px; margin-left: auto; margin-right: auto; } /* Stage 6: same width as the tool cards above it */
.tool-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 20px 20px 0 0; background: linear-gradient(90deg, var(--primary), var(--violet), var(--teal)); }
.tool-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.tool-card-head .kicker { margin: 0 0 4px; }
.pill { white-space: nowrap; padding: 5px 10px; color: var(--teal-ink); background: var(--teal-soft); border-radius: 99px; font-size: .78rem; font-weight: 700; }

/* Form */
form { display: grid; gap: 18px; }
.field { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
fieldset { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 14px; }
legend { padding: 0 6px; font-weight: 700; font-size: .92rem; color: var(--violet-ink); }
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.req, .opt { font-weight: 500; color: var(--muted); }
input, textarea, select { width: 100%; border: 1px solid var(--field-line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
input, select { padding: 11px 12px; min-height: 44px; }
textarea { resize: vertical; min-height: 96px; padding: 12px 14px; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error-ink); border-width: 2px; }
.hint, .count, .field-error { margin: 6px 0 0; font-size: .82rem; }
.hint { color: var(--muted); }
.count { color: var(--muted); font-variant-numeric: tabular-nums; }
.count.is-review { color: var(--warning-ink); }
.field-error { color: var(--error-ink); font-weight: 600; }
.field-error:empty, .count:empty { display: none; }

/* Checks */
.checks { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.checks-summary { font-weight: 500; color: var(--muted); font-size: .9rem; }
.checks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks-list li { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 10px; font-size: .9rem; background: var(--tint); }
.badge { flex: none; min-width: 58px; text-align: center; padding: 1px 8px; border-radius: 99px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); background: var(--surface); border: 1px solid currentColor; }
.checks-list li.fix { background: var(--error-bg); }
.checks-list li.fix .badge { color: var(--error-ink); }
.checks-list li.review { background: var(--warning-bg); }
.checks-list li.review .badge { color: var(--warning-ink); }
.disclaimer { margin: 12px 0 0; color: var(--muted); font-size: .82rem; }

/* Social fieldsets */
fieldset.group { display: grid; gap: 16px; }
.group-hint { margin: -4px 0 0; }

/* Previews (illustrative; images are never loaded). Preview colours imitate the real surfaces. */
.previews { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.preview-stack { display: grid; gap: 20px; margin-top: 14px; }
.preview-figure { margin: 0; min-width: 0; }
.preview-figure figcaption { font-weight: 700; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.card-type { font-weight: 500; }
.serp { max-width: 600px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; font-family: Arial, Helvetica, sans-serif; }
.serp-site { display: flex; align-items: center; gap: 10px; min-width: 0; }
.serp-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--line); border: 1px solid var(--line); }
.serp-lines { display: grid; min-width: 0; line-height: 1.3; }
.serp-name { color: #202124; font-size: 14px; }
.serp-url { color: #4d5156; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serp-title { margin: 8px 0 4px; color: #1a0dab; font-size: 20px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serp-desc { margin: 0; color: #4d5156; font-size: 14px; line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.is-placeholder { font-style: italic; color: var(--muted) !important; }
.preview-note { margin: 6px 0 0; color: var(--warning-ink); font-size: .82rem; }
.preview-note:empty { display: none; }
.social-card { max-width: 500px; border: 1px solid #cfd9de; border-radius: 14px; overflow: hidden; background: #FFFFFF; }
.social-card.is-summary { display: flex; }
.card-image { display: grid; place-items: center; padding: 10px; background: var(--line); color: var(--muted); font-size: .8rem; text-align: center; overflow-wrap: anywhere; aspect-ratio: 1.91 / 1; }
.social-card.is-summary .card-image { flex: none; width: 120px; aspect-ratio: 1 / 1; border-right: 1px solid #cfd9de; }
.card-body { min-width: 0; padding: 10px 14px 12px; }
.card-domain, .card-title, .card-desc { margin: 0; }
.card-domain { color: #536471; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { color: #0f1419; font-size: 15px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-desc { color: #536471; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* Output */
.result { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.code-output { margin: 0; padding: 16px; min-height: 90px; max-height: 360px; overflow: auto; background: var(--teal-soft); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 13px; color: var(--ink); font: .86rem/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.lang-note { margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 14px; }
#copyButton { border: 0; border-radius: 12px; min-height: 44px; padding: 11px 16px; background: var(--primary); color: #FFFFFF; font: inherit; font-size: .9rem; font-weight: 750; cursor: pointer; white-space: nowrap; }
#copyButton:hover:not(:disabled) { background: var(--primary-hover); }
#copyButton:active:not(:disabled) { background: var(--primary-hover); }
#copyButton:disabled { background: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }
.text-button { border: 0; min-height: 44px; padding: 6px 4px; background: transparent; color: var(--violet); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.status { min-height: 22px; margin: 10px 0 0; color: var(--muted); font-size: .85rem; }

/* Small screens */
@media (max-width: 650px) {
  .container { width: min(100% - 32px, 1100px); }
  .hero { padding: 32px 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .tool-card-head { flex-direction: column; }
  #copyButton { width: 100%; }
  .actions { justify-content: center; }
}
@media (forced-colors: active) { .tool-card::before { background: CanvasText; } }
