:root {
  --ink: #1d2923;
  --muted: #5c6961;
  --paper: #fffef9;
  --canvas: #edf1ec;
  --line: #cbd4cc;
  --green: #24543c;
  --green-light: #e1eee5;
  --blue: #315e78;
  --red: #a33b35;
  --red-light: #f7e4e1;
  --gold: #e0a52b;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; overflow-x: clip; }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.65; }
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .65rem .9rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.guide-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; padding: clamp(2rem, 6vw, 5rem) max(1rem, calc((100vw - 1180px) / 2)); background: var(--green); color: white; }
.guide-header > div { max-width: 820px; }
.guide-header h1 { margin: 0 0 .75rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 7vw, 5.8rem); line-height: .95; }
.guide-header p:last-child { max-width: 68ch; margin: 0; color: #e4eee7; font-size: 1.08rem; }
.eyebrow { margin: 0 0 .55rem; color: var(--red); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.guide-header .eyebrow { color: #f2c1bc; }
.app-link { flex: 0 0 auto; border: 1px solid white; border-radius: 6px; padding: .65rem 1rem; color: white; font-weight: 850; text-decoration: none; }

main { width: min(1180px, calc(100% - 32px)); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.5rem; align-items: start; margin: 0 auto; padding: 2.5rem 0 5rem; }
.contents { position: sticky; top: 1rem; display: grid; gap: .4rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--paper); }
.contents strong { margin-bottom: .2rem; }
.contents a { padding: .2rem 0; font-size: .88rem; font-weight: 700; text-decoration: none; }
.guide-content { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.guide-content > section, .admin-guide { min-width: 0; scroll-margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.guide-content > section { padding: clamp(1.2rem, 4vw, 2.4rem); }

h2, h3, p { margin-top: 0; }
h2 { margin-bottom: .85rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; }
h3 { margin: 1.65rem 0 .55rem; font-size: 1.15rem; }
p, li { max-width: 78ch; }
code { border-radius: 3px; padding: .08rem .28rem; background: #e8ede8; color: #183c2a; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
pre { max-width: 100%; overflow: auto; border-radius: 7px; padding: 1rem; background: #17251e; color: #f4f7f4; font: .82rem/1.55 "SFMono-Regular", Consolas, monospace; white-space: pre; }
pre code { padding: 0; background: transparent; color: inherit; }

.workflow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.workflow-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: #f7f9f6; }
.workflow-card.recommended { border-top: 5px solid var(--green); background: var(--green-light); }
.workflow-card h3 { margin-top: .3rem; }
.path-label { margin-bottom: 0; color: var(--green); font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.steps { padding-left: 1.35rem; }
.steps li, ul li { margin: .55rem 0; }
.note, .important { margin-top: 1.25rem; border-left: 5px solid var(--blue); padding: 1rem 1.1rem; background: #e4eef4; }
.important { border-color: var(--red); background: var(--red-light); }
.note p, .important p { margin: .3rem 0 0; }

.prompt-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-radius: 7px 7px 0 0; padding: .75rem 1rem; background: var(--green); color: white; }
.prompt-toolbar strong, .prompt-toolbar span { display: block; }
.prompt-toolbar span { color: #dce8df; font-size: .78rem; }
.prompt-toolbar button { border: 1px solid white; border-radius: 5px; padding: .5rem .8rem; background: white; color: var(--green); font-weight: 850; }
.ai-prompt { margin-top: 0; border-radius: 0 0 7px 7px; max-height: 760px; }

.field-table { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.field-row { display: grid; grid-template-columns: minmax(130px, .6fr) minmax(100px, .45fr) minmax(260px, 2fr); }
.field-row > * { min-width: 0; border-bottom: 1px solid var(--line); padding: .65rem .75rem; }
.field-row:last-child > * { border-bottom: 0; }
.field-heading { background: var(--green-light); font-weight: 850; }

.admin-guide { order: 98; }
#server-admin { order: 99; }
.admin-guide > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; color: var(--muted); cursor: pointer; list-style: none; }
.admin-guide > summary::-webkit-details-marker { display: none; }
.admin-guide > summary strong, .admin-guide > summary small { display: block; }
.admin-guide > summary strong { color: var(--ink); }
.admin-guide .toggle-label { flex: 0 0 auto; color: var(--blue); font-size: .82rem; font-weight: 850; }
.admin-guide[open] > summary { border-bottom: 1px solid var(--line); }
.admin-guide[open] .toggle-label { font-size: 0; }
.admin-guide[open] .toggle-label::before { content: "Hide directions"; font-size: .82rem; }
.admin-guide > section { margin: 1rem; padding: clamp(1rem, 3vw, 1.6rem); }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .contents { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contents strong { grid-column: 1 / -1; }
  .workflow-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .guide-header { align-items: flex-start; flex-direction: column; }
  .contents { grid-template-columns: 1fr; }
  .contents strong { grid-column: auto; }
  .field-row { grid-template-columns: 1fr; border-bottom: 1px solid var(--line); }
  .field-row > * { border-bottom: 0; }
  .prompt-toolbar { position: static; align-items: flex-start; }
  .admin-guide > summary { align-items: flex-start; }
}
