:root {
  color-scheme: light;
  --background: #eef5fb;
  --surface: #ffffff;
  --ink: #1b2733;
  --muted: #5c6b78;
  --line: #cfdbe6;
  --accent: #1677c7;
  --accent-2: #4aa37a;
  --radius: 3px;
  --gap: 20px;
  --panel-padding: 24px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--background);
  line-height: 1.5;
}

body.texture-grid { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 36px 36px; }
body.texture-paper { background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.45) 0 2px, transparent 2px 7px); }
body.texture-bands { background-image: linear-gradient(180deg, rgba(255,255,255,0.65) 0 22%, transparent 22% 100%); }
body.texture-blueprint { background-image: linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px); background-size: 22px 22px; }

a { color: inherit; }

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

nav a { text-decoration: none; }
nav a:hover { color: var(--accent); }

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.index-main { display: grid; gap: var(--gap); }

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: var(--gap);
  align-items: stretch;
  padding: 34px 0 10px;
}

.tool-copy,
.tool-panel,
.content-section,
.legal-page article,
.visual-board,
.quick-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-copy {
  padding: var(--panel-padding);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.font-mono-accent h1,
.font-mono-accent .eyebrow,
.font-mono-accent button { font-family: var(--font-mono); }

.tagline {
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.tool-panel { padding: var(--panel-padding); }

.tool-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--ink);
  padding: 10px 12px;
}

button {
  align-self: end;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

button:hover { background: var(--accent-2); }

.tool-output,
.result-list {
  display: block;
  margin-top: 18px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 16px;
  font-weight: 700;
}

.result-list {
  display: grid;
  gap: 10px;
  font-weight: 500;
}

.result-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}

.ad-frame {
  min-height: 92px;
  margin: 10px 0 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.ad-frame.empty { visibility: hidden; }

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.content-section { padding: var(--panel-padding); }

.content-section h2,
.legal-page h1,
.legal-page h2 {
  margin: 0 0 10px;
  letter-spacing: 0;
}

.content-section p,
.legal-page p {
  color: var(--muted);
}

.content-section ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 800; }

.legal-page article {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 32px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.support-shell,
.tool-first-shell,
.editorial-tool,
.console-shell {
  display: grid;
  gap: var(--gap);
}

.support-shell { grid-template-columns: minmax(0, 1fr) 280px; }
.tool-first-shell { grid-template-columns: minmax(320px, 1.15fr) minmax(0, 0.85fr); align-items: stretch; padding-top: 28px; }
.editorial-main { width: min(940px, calc(100% - 32px)); }
.editorial-main .tool-copy { text-align: center; }
.editorial-tool { grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr); }
.sidebar-main { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.sidebar-column,
.workspace-column { display: grid; gap: var(--gap); }
.compact-main { width: min(980px, calc(100% - 32px)); }
.console-shell { grid-template-columns: minmax(0, 1fr); }
.layout-compact-console .tool-copy { border-left: 8px solid var(--accent); }
.layout-tool-first .tool-panel { border-top: 8px solid var(--accent-2); }
.layout-editorial-guide .visual-board { min-height: 280px; }
.layout-sidebar-lab .site-header { align-items: flex-start; }

.quick-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
  padding: 14px;
}

.quick-rail span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.6);
  font-size: 0.86rem;
}

.visual-board {
  min-height: 180px;
  padding: var(--panel-padding);
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
}

.visual-board::before {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 34%;
  height: 58%;
  border: 2px solid var(--accent-2);
  transform: skew(-8deg);
  opacity: 0.65;
}

.visual-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.visual-lines {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.visual-lines i {
  display: block;
  width: calc(48% + var(--line) * 9%);
  max-width: 100%;
  border-bottom: 8px solid var(--accent);
  color: transparent;
  opacity: calc(0.42 + var(--line) * 0.11);
}

.shape-outlined .tool-copy,
.shape-outlined .tool-panel,
.shape-outlined .content-section,
.shape-outlined .quick-rail,
.shape-outlined .visual-board,
.shape-outlined .legal-page article { box-shadow: 6px 6px 0 var(--line); }

.density-dense .tagline,
.density-dense .content-section p { font-size: 0.95rem; }

@media (max-width: 760px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-shell,
  .content-grid,
  .tool-form,
  .support-shell,
  .tool-first-shell,
  .editorial-tool,
  .sidebar-main {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 2rem; }
  .tool-copy, .tool-panel, .content-section, .legal-page article, .visual-board { padding: 22px; }
}
