:root {
  --paper: #f1e8d6;
  --paper-deep: #e4d6bb;
  --ink: #1c1510;
  --muted: #5a5146;
  --faint: #8a7e6e;
  --rule: #d2c2a4;
  --card: #fffdf8;
  --accent: #8b2e16;
  --accent-2: #a33a1c;
  --header: #1c1612;
  --header-ink: #f6eee0;
  --focus: #1c4d6e;
  --serp-title: #1a0dab;
  --serp-url: #202124;
  --serp-desc: #4d5156;
  --ok: #1d5c3a;
  --warn: #8a4f0c;
  --long: #8b2424;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(26, 20, 14, 0.04), 0 18px 40px rgba(26, 20, 14, 0.09);
  --shadow-hover: 0 1px 0 rgba(26, 20, 14, 0.05), 0 22px 48px rgba(26, 20, 14, 0.14);
  --mono: "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --max: 72rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.06rem;
  line-height: 1.65;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 70% 42% at 100% 0%, rgba(139, 46, 22, 0.08), transparent 52%),
    radial-gradient(ellipse 48% 36% at 0% 8%, rgba(28, 77, 110, 0.055), transparent 48%);
}

a { color: var(--accent); }
a:hover { color: var(--accent-2); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 30;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--header);
  color: var(--header-ink);
  box-shadow: inset 0 -4px 0 var(--accent);
}

.header-inner,
.footer-inner,
.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0 1.1rem;
}

.wordmark {
  display: block;
  padding-left: 2.9rem;
  min-height: 2.3rem;
  text-decoration: none;
  color: var(--header-ink);
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.12;
  background: url("../favicon.svg") left center / 2.25rem 2.25rem no-repeat;
}
.wordmark span {
  display: block;
  margin-top: 0.18rem;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d7c4a4;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--header-ink);
  text-decoration: none;
  font-weight: 650;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.site-nav a:hover { background: rgba(255, 250, 241, 0.12); color: #fff; }
.site-nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

.hero,
.page {
  padding: 2.2rem 0 3.6rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.18;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.05rem, 4.6vw, 3.05rem);
  margin: 0 0 0.85rem;
  max-width: 22ch;
}

h2 { font-size: 1.55rem; margin: 2.3rem 0 0.7rem; }
h3 { font-size: 1.18rem; margin: 1.4rem 0 0.45rem; }

.lede {
  max-width: 44rem;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 1.7rem;
}

.note,
.assumption,
.empty,
.limit,
.msg {
  background: #f6ebd6;
  border: 1px solid var(--rule);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
}

.empty { color: var(--muted); }
.limit, .msg.is-error { color: var(--long); background: #f8e4dc; }
.msg.is-warn { color: var(--warn); background: #f6ead4; }
.msg.is-ok { color: var(--ok); background: #e4f0e7; }

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.95fr);
  gap: 1.5rem;
  align-items: start;
}

.panel,
.snippet-sheet,
.card {
  background: var(--card);
  border: 1px solid #cbb892;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel, .card { padding: 1.25rem 1.3rem 1.45rem; }

.snippet-sheet {
  padding: 0 0 1.35rem;
  overflow: hidden;
}
.snippet-sheet h2 {
  margin: 0 0 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--header);
  color: var(--header-ink);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.snippet-sheet .empty,
.snippet-sheet .serp,
.snippet-sheet .px-readout,
.snippet-sheet .msg,
.snippet-sheet .slug-out,
.snippet-sheet .robots-view,
.snippet-sheet .tree,
.snippet-sheet .url-list,
.snippet-sheet .og-mock {
  margin-left: 1.2rem;
  margin-right: 1.2rem;
}

.panel h2 { margin-top: 0; }

label {
  display: block;
  font-weight: 700;
  margin: 0.95rem 0 0.35rem;
}

label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  margin-top: 1.1rem;
}

input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.field-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.counter {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}
.counter[data-tone="ok"] { color: var(--ok); }
.counter[data-tone="short"] { color: var(--warn); }
.counter[data-tone="long"] { color: var(--long); }

input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: 1.5px solid #b79d74;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.78rem 0.85rem;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 46, 22, 0.15);
}

textarea { min-height: 6.5rem; resize: vertical; }
textarea.tall { min-height: 14rem; }

.meter {
  height: 8px;
  background: #e4d3b4;
  border-radius: 99px;
  overflow: hidden;
  margin: 0.5rem 0 0.2rem;
}
.meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--warn);
}
.meter[data-tone="ok"] > span { background: var(--ok); }
.meter[data-tone="long"] > span { background: var(--long); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

button,
.btn {
  appearance: none;
  border: 1px solid var(--header);
  background: var(--accent);
  color: #fff8ee;
  font: inherit;
  font-weight: 700;
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}
button.secondary,
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: #8a7350;
}
button:hover, .btn:hover { background: #6e2210; color: #fff; }
button.secondary:hover, .btn.secondary:hover {
  background: #f6ebd6;
  color: var(--ink);
}

.serp {
  font-family: Arial, sans-serif;
  max-width: 37.5rem;
  padding: 1rem 1.1rem 1.05rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(32, 33, 36, 0.1);
}
.serp.is-narrow { max-width: 20rem; }
.serp-cite {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.3rem;
}
.serp-fav {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f0fe;
  border: 1px solid #d2e3fc;
  color: #1967d2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.serp .serp-title {
  color: var(--serp-title);
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 0.2rem;
  overflow: hidden;
  white-space: nowrap;
}
.serp .serp-url {
  color: var(--serp-url);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  word-break: break-all;
}
.serp .serp-desc {
  color: var(--serp-desc);
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.px-readout {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.7rem 0 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.grid a.card {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
  border-top: 4px solid var(--accent);
  padding-bottom: 2.55rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.grid a.card:hover {
  border-color: var(--header);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.grid a.card h2,
.grid a.card h3 { margin: 0 0 0.4rem; font-size: 1.26rem; }
.grid a.card::after {
  content: "Open";
  position: absolute;
  right: 1.25rem;
  bottom: 0.95rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.faq details {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin: 0.55rem 0;
  box-shadow: 0 1px 0 rgba(26, 20, 14, 0.03);
}
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 0.55rem 0 0.15rem; }

.tree {
  font-family: var(--mono);
  font-size: 0.92rem;
  margin: 0;
  padding-left: 1rem;
}
.tree li { margin: 0.25rem 0; }
.tree .lvl-1 { margin-left: 0; }
.tree .lvl-2 { margin-left: 1rem; }
.tree .lvl-3 { margin-left: 2rem; }
.tree .lvl-4 { margin-left: 3rem; }
.tree .lvl-5 { margin-left: 4rem; }
.tree .lvl-6 { margin-left: 5rem; }

.robots-view {
  font-family: var(--mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}
.tok-ua { color: #1c4d6e; font-weight: 700; }
.tok-allow { color: var(--ok); font-weight: 700; }
.tok-disallow { color: var(--accent); font-weight: 700; }
.tok-sitemap { color: #5b3d8a; font-weight: 700; }
.tok-bad { color: var(--long); text-decoration: underline wavy; }

.slug-out {
  font-family: var(--mono);
  font-size: 1.05rem;
  word-break: break-all;
  background: #f6ebd6;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
}

.og-mock {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 28rem;
}
.og-art {
  height: 9.5rem;
  background: linear-gradient(135deg, #d8c9a6, #8b2e16 90%);
  color: #fff8ee;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}
.og-copy { padding: 0.85rem 1rem 1rem; }
.og-copy strong { display: block; margin-bottom: 0.3rem; }

.url-list {
  font-family: var(--mono);
  font-size: 0.88rem;
  max-height: 22rem;
  overflow: auto;
  margin: 0;
  padding-left: 1.2rem;
}

.hint {
  margin: 0.55rem 0 0;
  padding: 0.65rem 0.85rem;
  background: #f6ebd6;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.98rem;
}
.hint a { font-weight: 700; }

.continue {
  margin-top: 2rem;
  padding: 1.25rem 1.3rem 1.4rem;
  background: var(--card);
  border: 1px solid #cbb892;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.continue h2 { margin-top: 0; }

.continue-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0.2rem;
}
.continue-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.85rem;
  background: #fff;
  border: 1px solid #cbb892;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  color: var(--ink);
}
.continue-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.recent-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.recent-list button { max-width: 100%; text-align: left; }

.compare { margin-top: 2rem; }

.snippet-sheet .hint {
  margin-left: 1.2rem;
  margin-right: 1.2rem;
}

.site-footer {
  background: var(--header);
  color: #d7c4a4;
  padding: 1.9rem 0 2.4rem;
  font-size: 0.95rem;
  box-shadow: inset 0 4px 0 var(--accent);
}
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
}
.site-footer a { color: var(--header-ink); }

@media (min-width: 861px) {
  .studio .snippet-sheet {
    position: sticky;
    top: 5.4rem;
  }
}

@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  h1 { max-width: none; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .serp .serp-title { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grid a.card { transition: none; }
}
