@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --background: #f5f4f0;
  --command-background: #20252c;
  --output-background: #ffffff;
  --text: #252b30;
  --muted: #5d625e;
  --line: #dedfd8;
  --teal: #24685e;
  --blue: #315d95;
  --yellow: #86580a;
  --green: #49702d;
  --mono: 'JetBrains Mono', monospace;
  font-family: 'Atkinson', system-ui, sans-serif;
  --body-size: 15px;
  --small-size: 13px;
  font-size: var(--body-size);
  font-weight: 400;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); }
main {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 0 40px;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 0 23px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
h1 { display: flex; align-items: center; gap: 8px; margin: 0; font: inherit; font-size: var(--body-size); white-space: nowrap; }
h1 a { display: flex; color: var(--text); }
h1 img { display: block; filter: none; }
h1 span { font-family: var(--mono); color: var(--muted); font-size: var(--small-size); }
nav { display: flex; gap: 22px; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
button { padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
button:hover:not(:disabled) { color: var(--text); text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
nav button, footer { font-size: var(--small-size); }
a:focus-visible, button:focus-visible, .output:focus-visible, pre:focus-visible { outline: 1px solid var(--teal); outline-offset: 4px; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 36px; padding-top: 27px; }
.terminal { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#command-form {
  --text: #f2f2f0;
  --muted: #c6ccd3;
  color-scheme: dark;
  font-family: var(--mono);
  border-radius: 5px;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 15px;
  background: var(--command-background);
  border: 0;
}
#command-form:focus-within { outline: 2px solid #43867a; outline-offset: -1px; }
.prompt { white-space: nowrap; }
.directory { color: #abd4cd; font-size: var(--body-size); }
.dollar { color: var(--text); font-size: var(--body-size); }
#command { border: 0; border-radius: 0; background: transparent; color: #fff; outline: none; min-width: 0; flex: 1; padding: 5px 0; caret-color: #fff; font-size: var(--body-size); }
#command::placeholder { color: var(--muted); font-size: var(--body-size); opacity: 1; }
#command:disabled { color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; }
#command-form > button { padding: 4px 9px; border-radius: 3px; color: var(--text); font-size: var(--body-size); white-space: nowrap; }
.result-pane { display: flex; flex-direction: column; flex: none; height: auto; min-height: 210px; padding: 18px 20px; margin-bottom: 22px; background: var(--output-background); border: 1px solid var(--line); border-radius: 5px; }
.output-heading { display: flex; flex-shrink: 0; gap: 16px; align-items: center; min-height: 32px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 16px; color: var(--teal); font-size: var(--small-size); min-width: 0; }
#result-command { font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.response { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.output { flex: 1; min-height: 0; max-height: 360px; overflow: auto; scrollbar-width: thin; scrollbar-color: #a3aca6 transparent; line-height: 1.75; padding: 0 8px 15px 0; }
.entry { margin: 0; }
pre, code { font: inherit; font-family: var(--mono); font-variant-ligatures: none; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.code { white-space: pre; overflow: auto; padding-bottom: 6px; }
.note { margin: 0; color: var(--muted); font-size: var(--small-size); line-height: 1.8; }
.output > .note { font-size: var(--body-size); }
#step-note { flex-shrink: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--small-size); line-height: 1.7; }
#step-note p { margin: 0; }
.syntax-keyword { color: var(--blue); }
.syntax-function { color: var(--teal); }
.syntax-string { color: var(--yellow); }
.syntax-number { color: var(--green); }
.syntax-comment { color: var(--muted); }
.step-intro { min-height: 76px; padding-bottom: 18px; }
#step-title { font: inherit; font-size: 20px; margin: 0 0 10px; }
.hint { margin: 0; color: var(--teal); font-size: var(--body-size); line-height: 1.7; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; flex-shrink: 0; padding: 16px 0 20px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; line-height: 1.7; }
.suggestions button, .suggestions a { display: inline-block; color: var(--text); border: 1px solid #c8cec8; background: var(--output-background); border-radius: 3px; padding: 6px 10px; font-size: var(--small-size); text-align: left; overflow-wrap: anywhere; text-decoration: none; }
.suggestions button:hover, .suggestions a:hover { background: #e9eeea; border-color: #8caaa0; text-decoration: none; }
.suggestions .primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.suggestions .primary:hover { background: #1c574f; border-color: #1c574f; color: #fff; }
.suggestions [data-command] { font-family: var(--mono); }
#agent-form { padding-top: 0; overflow: auto; min-height: 0; }

#agent-prompt { display: block; resize: none; width: 100%; min-height: 135px; border: 0; background: transparent; padding: 0; border-radius: 0; line-height: 1.8; color: var(--text); font-size: var(--body-size); }
#agent-prompt:focus-visible { outline: 1px solid var(--line); outline-offset: 3px; }
#resume-live { grid-column: 1; grid-row: 1; color: var(--text); font-size: var(--small-size); text-align: left; line-height: 1.7; text-decoration: underline; text-underline-offset: 5px; }
.download { display: inline-block; margin-top: 15px; }
.progress { padding: 0; }
.progress h2 { text-align: right; padding-right: 27px; font: inherit; font-size: var(--small-size); color: var(--muted); margin: 0 0 30px; }
.progress ol { list-style: none; margin: 0; padding: 0; }
.milestone { position: relative; min-height: 48px; padding: 0 27px 0 0; text-align: right; font-size: var(--small-size); color: var(--muted); }
.milestone .mobile-label { display: none; }
.milestone::before { content: ''; position: absolute; top: 3px; right: 0; width: 9px; height: 9px; border: 1px solid #8d9891; border-radius: 50%; background: var(--background); z-index: 1; }
.milestone:not(:last-child)::after { content: ''; position: absolute; right: 5px; top: 13px; height: 38px; width: 1px; background: var(--line); }
.milestone.done { color: var(--text); }
.milestone.done::before { background: var(--teal); border-color: var(--teal); }
.milestone[aria-current] { color: var(--text); }
.milestone[aria-current]::before { border-color: var(--teal); outline: 3px solid #c7dcd5; outline-offset: 2px; }
.milestone small { display: block; font-size: var(--small-size); margin-top: 5px; color: var(--muted); }
footer { display: flex; flex-shrink: 0; align-items: center; gap: 20px; justify-content: space-between; padding: 17px 0 25px; color: var(--muted); border-top: 1px solid var(--line); line-height: 1.6; }
footer nav { flex-shrink: 0; }
#information, #live-dialog { width: min(640px, calc(100% - 40px)); max-height: calc(100svh - 40px); padding: 24px; color: var(--text); background: var(--output-background); border: 1px solid var(--line); font-size: var(--small-size); line-height: 1.8; }
:is(#information, #live-dialog)::backdrop { background: rgb(27 34 31 / .35); }
:is(#information, #live-dialog) form { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
:is(#information, #live-dialog) h2 { margin: 0; font: inherit; color: var(--teal); }
:is(#information, #live-dialog) p { margin: 0 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-height: 900px) { main { padding-top: 20px; padding-bottom: 20px; } }
@media (max-width: 900px) {
  main { padding: 0 25px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 105px; gap: 25px; }
  #command-form .directory { display: none; }
}
@media (max-width: 700px) {
  :root { --body-size: 14px; --small-size: 12px; }
  main { padding: 0 20px; }
  header { padding: 23px 0 19px; gap: 10px; }
  h1 { font-size: var(--small-size); }
  h1 span { display: none; }
  nav { gap: 18px; }
  .workspace { display: flex; flex-direction: column; gap: 0; padding-top: 17px; }
  .terminal { flex: 1; }
  .progress { order: -1; flex-shrink: 0; padding: 0; height: 68px; }
  .progress h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .progress ol { display: grid; grid-template-columns: repeat(6, 1fr); }
  .milestone { min-height: 49px; padding: 23px 0 0; text-align: center; font-size: var(--small-size); }
  .milestone::before { right: auto; left: calc(50% - 5px); top: 4px; }
  .milestone:not(:last-child)::after { right: auto; height: 1px; width: calc(100% - 10px); left: calc(50% + 5px); top: 9px; }
  .milestone small { display: none; }
  .milestone .desktop-label { display: none; }
  .milestone .mobile-label { display: block; white-space: nowrap; }
  #command-form { padding: 8px 11px; gap: 8px; min-height: 54px; }
  #command { font-size: var(--body-size); }
  #command::placeholder { font-size: var(--body-size); }
  #command-form > button { font-size: var(--body-size); }
  .result-pane { padding: 14px; margin-bottom: 16px; }
  .output-heading { min-height: 25px; margin-bottom: 12px; gap: 12px; font-size: var(--small-size); }
  .note { font-size: var(--small-size); }
  .controls { gap: 10px; padding: 14px 0 18px; }
  .step-intro { min-height: 102px; }
  .result-pane { min-height: 190px; }
  .hint { font-size: var(--body-size); text-align: left; }
  .suggestions { gap: 8px; margin-top: 0; }
  .suggestions button, .suggestions a { font-size: var(--small-size); }
  #agent-prompt { font-size: var(--body-size); min-height: 215px; }
  #step-note { font-size: var(--small-size); }
  footer { font-size: var(--small-size); padding: 15px 0 18px; }
  footer span { max-width: 225px; }
  footer nav { flex-direction: column; gap: 6px; }
  footer nav button { font-size: var(--small-size); text-align: right; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.telegram { overflow: auto; min-height: 0; flex: 1; padding-bottom: 12px; }
.telegram-name { color: var(--teal); font-size: var(--small-size); margin: 0 0 16px; }
.telegram-message { max-width: 570px; padding: 18px 20px; background: #eef4f1; border-radius: 5px; line-height: 1.8; }
.telegram-message p { margin: 0 0 18px; }
.telegram-actions { display: flex; gap: 28px; }
.telegram-actions button { color: var(--teal); font-size: var(--body-size); padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; }
.text-link { color: var(--teal); font-size: var(--small-size); text-decoration: underline; text-underline-offset: 4px; }
#try-live { margin-top: 24px; text-align: left; line-height: 1.8; }
#live-dialog #live-details { margin-top: 24px; }
#new-live-session { margin-top: 10px; }
#information pre { font-size: var(--small-size); margin-bottom: 20px; }
@media (max-width: 700px) { .telegram-message { padding: 14px; } .telegram-actions button { font-size: var(--small-size); } }

#telegram-qr { margin-top: 16px; }
#telegram-qr summary { color: var(--teal); cursor: pointer; }
#telegram-qr-code { display: block; width: 240px; max-width: 100%; height: auto; margin: 16px 0; background: white; }
#telegram-qr-help { margin-bottom: 0; }

#live-dialog { position: relative; }
#live-confetti { position: fixed; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }
#live-confetti i { position: absolute; top: -12px; width: 6px; height: 10px; opacity: 0; animation: completion-confetti 3400ms ease-out both; }
@keyframes completion-confetti {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  15% { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--drift), 110vh) rotate(var(--turn)); }
}
@media (prefers-reduced-motion: reduce) { #live-confetti { display: none; } #live-confetti i { animation: none; } }

#completion { overflow: auto; line-height: 1.8; }
#completion h2 { margin: 0 0 20px; font: inherit; color: var(--teal); }
#completion p { margin: 0 0 24px; }

#live-capacity, #live-privacy { margin-top: 12px; }

/* Keep code readable even when the browser is short or its text is enlarged. */
main.code-view { height: auto; }
.code-view .workspace { min-height: auto; }

.code-view .result-pane { flex: none; height: clamp(460px, 65svh, 680px); }
.code-view .output { max-height: none; padding-bottom: 8px; }

/* Draw the Enter symbol consistently, independent of the surrounding font. */
#command-form > button, .suggestions .enter-button { display: inline-flex; align-items: center; gap: 8px; }
.enter-icon { display: block; flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

#command-form > button.primary { background: #abd4cd; color: #202a2b; }
#command-form > button.primary:hover { background: #c1e2dc; color: #202a2b; text-decoration: none; }
