/* ============================================================
   /lastenheft-generator: interview that ends in a requirements document.
   Tokens (colours, spacing, type scale, radius) come from werkstatt-tokens.css;
   only the layout widths below are page-specific.
   ============================================================ */

.lg-page{
  --lg-wrap:1180px;
  --lg-narrow:720px;
  --lg-progress-width:320px;
  /* The interview fills the screen below the navigation, so only the conversation scrolls */
  --lg-interview-height:calc(100dvh - var(--nav-h) - var(--space-xl) - var(--space-lg));
  --lg-interview-min-height:480px;
  --lg-typing-dot:6px;
  --lg-typing-cycle:1.2s;
  --lg-checkbox-size:18px;
  --lg-status-dot:10px;
  --lg-example-width:360px;
  --lg-example-width-mobile:240px;
  --lg-step-number:28px;

  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:var(--fs-text);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}

.lg-page *{box-sizing:border-box}
/* layout classes set display; the hidden attribute must still win */
.lg-page [hidden]{display:none!important}

/* the mobile drawer locks page scrolling while it is open */
.lg-locked{overflow:hidden}
/* During the interview the page stands still on wide screens; only the conversation and the progress scroll */
@media (min-width:901px){.lg-interviewing{overflow:hidden}}

/* ---------- layout ---------- */
/* Spacing rule: inside a panel every child sits on one rhythm (--space-md) set by the stack, never by own margins */
.lg-wrap{max-width:var(--lg-wrap);margin:0 auto;padding:0 var(--gutter)}
.lg-hero{padding:var(--space-3xl) 0 0}
/* Text left, an example document right; on narrow screens the example follows the text */
.lg-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) var(--lg-example-width);column-gap:var(--space-2xl);align-items:center}
@media (max-width:900px){
  .lg-hero-grid{grid-template-columns:1fr;row-gap:var(--space-xl)}
  .lg-example{max-width:var(--lg-example-width-mobile);justify-self:center;text-align:center}
}
.lg-example{display:flex;flex-direction:column;gap:var(--space-sm);color:inherit;text-decoration:none}
.lg-example img{display:block;width:100%;height:auto}
.lg-example:hover .lg-meta,.lg-example:focus-visible .lg-meta{color:var(--ink);text-decoration:underline;text-decoration-color:var(--signal)}
/* The three steps of the conversation, numbered in the accent colour */
.lg-steps{list-style:none;padding:0;counter-reset:lg-step;display:flex;flex-direction:column;gap:var(--space-sm);max-width:var(--lg-narrow)}
.lg-steps li{counter-increment:lg-step;display:grid;grid-template-columns:var(--lg-step-number) 1fr;column-gap:var(--space-sm);color:var(--ink-2)}
.lg-steps li::before{content:counter(lg-step);font-weight:700;color:var(--signal-text)}
.lg-stage{padding:var(--space-xl) 0 var(--space-4xl)}
.lg-stack{display:flex;flex-direction:column;gap:var(--space-md)}
.lg-stack>*{margin:0}
/* Both columns have the screen's height; each scrolls on its own and never hands the scroll on to the page */
.lg-interview{display:grid;grid-template-columns:minmax(0,1fr) var(--lg-progress-width);column-gap:var(--space-lg);height:var(--lg-interview-height);min-height:var(--lg-interview-min-height)}
.lg-progress{min-height:0;overflow-y:auto;overscroll-behavior:contain}
@media (max-width:900px){
  .lg-interview{grid-template-columns:1fr;row-gap:var(--space-lg);height:auto;min-height:0}
  .lg-chat{height:var(--lg-interview-height);min-height:var(--lg-interview-min-height)}
  .lg-progress{overflow-y:visible}
}

/* ---------- typography ---------- */
.lg-tag{align-self:flex-start;display:inline-block;font-size:var(--fs-subtext);font-weight:600;color:var(--ink-2);border:var(--line-hair) solid var(--rule-medium);border-radius:var(--radius-sm);padding:var(--space-2xs) var(--space-sm)}
.lg-title{font-family:var(--font-head);font-weight:var(--head-weight);font-stretch:var(--head-stretch);font-size:var(--fs-headline);line-height:1.02}
.lg-lead{font-size:var(--fs-mini);line-height:1.4;max-width:var(--lg-narrow)}
.lg-text{color:var(--ink-2);max-width:var(--lg-narrow)}
.lg-meta{font-size:var(--fs-subtext);color:var(--ink-3)}
.lg-hint{font-size:var(--fs-subtext);color:var(--ink-2)}
.lg-link{color:var(--ink);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--signal)}
.lg-error{font-size:var(--fs-subtext);color:var(--signal-text)}

/* ---------- panels ---------- */
.lg-panel{background:var(--sheet);border:var(--line-hair) solid var(--rule-soft);border-radius:var(--radius-sm);padding:var(--space-lg)}
.lg-panel-head{display:flex;justify-content:space-between;align-items:baseline;column-gap:var(--space-md);padding-bottom:var(--space-md);border-bottom:var(--line-hair) solid var(--rule-soft)}
.lg-panel-title{font-family:var(--font-head);font-stretch:var(--head-stretch);font-weight:700;font-size:var(--fs-mini);line-height:1.2;margin:0}

/* ---------- gate form ---------- */
.lg-gate{max-width:var(--lg-narrow)}
.lg-field{display:flex;flex-direction:column;gap:var(--space-2xs)}
.lg-label{font-size:var(--fs-subtext);font-weight:600;color:var(--ink-2)}
.lg-input{width:100%;font:inherit;font-size:var(--fs-control);color:var(--ink);background:var(--paper-2);border:var(--line-hair) solid var(--rule-medium);border-radius:var(--radius-sm);padding:var(--space-sm) var(--space-md)}
.lg-input:focus{outline:var(--line-strong) solid var(--signal);outline-offset:0}
.lg-textarea{resize:vertical;line-height:1.5}
.lg-notice{font-size:var(--fs-subtext);color:var(--ink-2);border-left:var(--line-strong) solid var(--signal);padding-left:var(--space-md)}
.lg-stack-tight{display:flex;flex-direction:column;gap:var(--space-xs)}
.lg-stack-tight>*{margin:0}
.lg-more summary{cursor:pointer;font-weight:600;color:var(--ink)}
.lg-more p{margin:var(--space-xs) 0 0}
.lg-consent{display:grid;grid-template-columns:var(--lg-checkbox-size) 1fr;column-gap:var(--space-sm);align-items:start;font-size:var(--fs-subtext);color:var(--ink-2)}
.lg-checkbox{width:var(--lg-checkbox-size);height:var(--lg-checkbox-size);margin:var(--space-2xs) 0 0;accent-color:var(--signal)}

/* ---------- buttons ---------- */
.lg-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-sm)}
.lg-actions-end{margin-left:auto}
.lg-button{font:inherit;font-size:var(--fs-control);font-weight:600;color:var(--ink);background:transparent;border:var(--line-hair) solid var(--rule);border-radius:var(--radius-sm);padding:var(--space-sm) var(--space-lg);cursor:pointer}
.lg-button:hover,.lg-button:focus-visible{background:var(--paper-2)}
.lg-button-primary{background:var(--signal);border-color:var(--signal);color:var(--signal-ink)}
.lg-button-primary:hover,.lg-button-primary:focus-visible{background:var(--signal);filter:brightness(1.1)}
.lg-button:disabled{opacity:.5;cursor:not-allowed}
/* Recording: the button turns into the stop control and shows the running time */
.lg-button.is-recording{border-color:var(--signal);color:var(--signal-text)}
.lg-button.is-recording::before{content:"";display:inline-block;width:var(--space-xs);height:var(--space-xs);margin-right:var(--space-xs);border-radius:50%;background:var(--signal);vertical-align:middle}

/* ---------- conversation ---------- */
.lg-chat{min-width:0;min-height:0}
.lg-chat-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.lg-transcript{list-style:none;padding:0;display:flex;flex-direction:column;gap:var(--space-md)}
.lg-turn{display:flex;flex-direction:column;gap:var(--space-2xs)}
.lg-turn-who{font-size:var(--fs-subtext);font-weight:600;color:var(--ink-3)}
.lg-turn-text{white-space:pre-wrap;margin:0}
.lg-turn-user .lg-turn-text{color:var(--ink-2)}
.lg-turn-assistant .lg-turn-text{color:var(--ink)}

/* While the answer is on its way: three dots, plus a sentence for long waits (writing the document) */
.lg-typing{display:flex;align-items:center;gap:var(--space-sm);font-size:var(--fs-subtext);color:var(--ink-2)}
.lg-typing-dots{display:inline-flex;gap:var(--space-2xs)}
.lg-typing-dots span{width:var(--lg-typing-dot);height:var(--lg-typing-dot);border-radius:50%;background:var(--ink-3);animation:lg-typing var(--lg-typing-cycle) infinite ease-in-out}
.lg-typing-dots span:nth-child(2){animation-delay:calc(var(--lg-typing-cycle) / 6)}
.lg-typing-dots span:nth-child(3){animation-delay:calc(var(--lg-typing-cycle) / 3)}
@keyframes lg-typing{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(calc(var(--lg-typing-dot) / -2))}}
@media (prefers-reduced-motion:reduce){.lg-typing-dots span{animation:none}}

/* ---------- proposal to confirm ---------- */
.lg-proposal{border:var(--line-hair) solid var(--rule);border-top:var(--line-strong) solid var(--signal);border-radius:var(--radius-sm);background:var(--paper-2);padding:var(--space-md)}
.lg-proposal-head{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-sm);font-weight:700}
.lg-proposal-points{padding-left:var(--space-lg)}
.lg-proposal-points li+li{margin-top:var(--space-2xs)}
.lg-badge{font-size:var(--fs-subtext);font-weight:600;color:var(--signal-ink);background:var(--signal);border-radius:var(--radius-sm);padding:0 var(--space-xs)}

/* ---------- composer ---------- */
.lg-composer{padding-top:var(--space-md);border-top:var(--line-hair) solid var(--rule-soft)}

/* ---------- progress ---------- */
.lg-checklist{list-style:none;padding:0;display:flex;flex-direction:column;gap:var(--space-sm)}
.lg-check{display:grid;grid-template-columns:var(--lg-status-dot) 1fr auto;column-gap:var(--space-sm);align-items:center;font-size:var(--fs-subtext);line-height:1.3}
.lg-check::before{content:"";width:var(--lg-status-dot);height:var(--lg-status-dot);border:var(--line-hair) solid var(--ink-3);border-radius:50%}
.lg-check-status{color:var(--ink-3)}
.lg-check.is-confirmed::before{background:var(--signal);border-color:var(--signal)}
.lg-check.is-confirmed .lg-check-status{color:var(--ink-2)}
/* The point under discussion sits on top; points still open stay folded so the column reads as progress, not as a form */
.lg-progress-current{display:flex;flex-direction:column;gap:var(--space-2xs);border-left:var(--line-strong) solid var(--signal);padding-left:var(--space-md)}
.lg-progress-toggle{cursor:pointer;font-size:var(--fs-subtext);font-weight:600;color:var(--ink-2)}
.lg-progress-open[open] .lg-progress-toggle{margin-bottom:var(--space-sm)}

/* ---------- document ---------- */
.lg-document{white-space:pre-wrap;word-wrap:break-word;font-family:var(--font-body);font-size:var(--fs-subtext);line-height:1.6;color:var(--ink);background:var(--paper-2);border:var(--line-hair) solid var(--rule-soft);border-radius:var(--radius-sm);padding:var(--space-lg)}
