.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sim-wrap { padding: clamp(128px, 14vh, 156px) 0 72px; }
.sim-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 auto 34px; max-width: 760px; }
.sim-head .eyebrow { margin-bottom: 14px; }
.sim-head h1 { font: 300 clamp(38px, 5.4vw, 72px)/1.02 var(--sans); font-stretch: 112%; letter-spacing: -.045em; margin: 0 0 16px; text-wrap: balance; }
.sim-head .sub { font-size: 17px; color: var(--ink-2); max-width: 600px; margin: 0; text-wrap: pretty; }
.sim-head .modes { margin-top: 22px; }

/* the four stages of the run, lit as it goes */
.stages { list-style: none; margin: 0 0 16px; padding: 18px 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-radius: var(--r-3); position: relative; }
.stages li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding-right: 18px; }
.stages li:not(:last-child)::after { content: ""; position: absolute; left: 26px; right: 10px; top: 7px; height: 1px; background: var(--line); }
.stages li.done:not(:last-child)::after { background: rgb(255 255 255 / .4); }
.stages i { margin-bottom: 10px !important; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .28); background: transparent; align-self: start; margin-top: 0; transition: background .4s ease, box-shadow .4s ease, transform .4s var(--ease); }
.stages b { font-weight: 600; font-size: 14.5px; color: var(--ink-3); transition: color .3s ease; line-height: 1.1; }
.stages span { font-size: 13px; color: var(--ink-3); opacity: .75; line-height: 1.35; margin-top: 3px; }
.stages li.now i { background: #f5f5f7; box-shadow: 0 0 0 5px rgb(255 255 255 / .1), 0 0 18px rgb(255 255 255 / .35); transform: scale(1.05); }
.stages li.now b { color: var(--ink); }
.stages li.now span { color: var(--ink-2); opacity: 1; }
.stages li.done i { background: rgb(255 255 255 / .55); box-shadow: none; }
.stages li.done b { color: var(--ink-2); }
@media (max-width: 760px) {
  .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 12px; }
  .stages li { justify-items: center; text-align: center; padding: 0 4px; }
  .stages li:not(:last-child)::after { left: calc(50% + 14px); right: calc(-50% + 14px); }
  .stages span { display: none; }
  .stages b { font-size: 12.5px; }
}

/* before the first step: a calm start screen instead of an empty box */
.idle { margin: auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; max-width: 380px; padding: 24px 8px; animation: rise .6s var(--ease) both; }
.idle .mark { width: 78px; height: auto; opacity: .9; margin-bottom: 12px; animation: breathe 5s ease-in-out infinite; }
.idle b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.idle span { font-size: 14.5px; color: var(--ink-3); line-height: 1.55; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .idle .mark { animation: none; } }

/* progress line along the top of the controls */
.bar { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0; background: #f5f5f7; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.bar[hidden] { display: none; }
.modes { display: inline-flex; background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-2); padding: 4px; gap: 2px; }
.modes button { border: 0; background: none; font: 500 14px var(--sans); color: var(--ink-3); padding: 8px 14px; border-radius: var(--r-1); cursor: pointer; }
.modes button[aria-checked="true"] { background: #f5f5f7; color: #000; }
.modes button { border-radius: 999px; }

.sim { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: stretch; }
@media (max-width: 940px) { .sim { grid-template-columns: 1fr; } }
.chat, .mem { padding: 0; border-radius: var(--r-3); display: flex; flex-direction: column; height: clamp(520px, calc(100svh - 300px), 720px); overflow: hidden; }
@media (max-width: 940px) { .chat, .mem { height: auto; } .msgs { min-height: 300px; max-height: 62vh; } .mem-body { max-height: 70vh; } }
.chat-head { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.session { font-weight: 600; }
.chat-sub { font: 12.5px var(--mono); color: var(--ink-3); }
.msgs { list-style: none; margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; min-height: 0; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; animation: rise .45s var(--ease) both; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: #f5f5f7; color: #000; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 4px; }
.msg code { font-size: 13px; background: rgb(255 255 255 / .1); padding: 1px 5px; border-radius: 4px; }
.msg.user code { background: rgb(0 0 0 / .08); }
.op { align-self: flex-start; font: 12.5px/1.5 var(--mono); color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-1); padding: 6px 10px; max-width: 92%; animation: rise .45s var(--ease) both; overflow-wrap: anywhere; }
.op b { color: var(--accent-text); font-weight: 500; }
.op .hit { display: block; color: var(--ink-3); }
.op .hit.top { color: var(--ink); }
.sys { align-self: center; font: 12.5px var(--mono); color: var(--ink-3); text-align: center; padding: 6px 0; animation: rise .45s var(--ease) both; }
.sys.digest { align-self: stretch; text-align: left; background: rgb(0 0 0 / .3); border: 1px dashed var(--line-2); border-radius: var(--r-2); padding: 10px 12px; white-space: pre-wrap; color: var(--ink-2); }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--sunk); border-radius: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .msg, .op, .sys { animation: none; } .typing i { animation: none; opacity: .6; } }
.controls, .composer { border-top: 0; padding: 12px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer { flex-direction: column; align-items: stretch; border-top: 1px solid var(--line); }
.composer textarea { width: 100%; resize: none; border: 0; background: rgb(0 0 0 / .35); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-2); padding: 10px 12px; font: 15px/1.5 var(--sans); color: var(--ink); min-height: 48px; }
.composer textarea:focus-visible { outline: 1.5px solid #fff; outline-offset: 0; }
.composer-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.composer-row #send { margin-left: auto; }
.hint { margin: 0; font-size: 13px; color: var(--ink-3); }
.progress { margin-left: auto; font: 12.5px var(--mono); color: var(--ink-3); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.mem .tablist { border-bottom: 1px solid var(--line); }
.n { font: 500 11.5px var(--mono); color: var(--ink-3); background: rgb(255 255 255 / .08); border-radius: 10px; padding: 1px 6px; margin-left: 4px; }
.n.dot { background: #f5f5f7; color: #000; }
.mem-path { font: 12px var(--mono); color: var(--ink-3); padding: 10px 20px 0; overflow-wrap: anywhere; }
.mem-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 20px 20px; }
.chat-head, .controls, .composer, .mem .tablist, .mem-path { flex: none; }
.empty { color: var(--ink-3); font-size: 14.5px; padding: 18px 0; }
.notes li.empty { display: block; }
.empty code { font-size: 13px; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; display: grid; gap: 3px; animation: rise .45s var(--ease) both; }
.notes li:first-child { border-top: 0; }
.notes .id { font: 11.5px var(--mono); color: var(--ink-3); }
.notes li.fresh { background: linear-gradient(90deg, rgb(255 255 255 / .08), transparent 70%); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.notes li.dreamed .t { color: var(--ink-3); }
.tr { border: 1px solid var(--line); background: rgb(0 0 0 / .2); border-radius: var(--r-2); padding: 10px 12px; margin-bottom: 10px; font: 12.5px/1.6 var(--mono); color: var(--ink-2); }
.tr h4 { margin: 0 0 6px; font: 500 12.5px var(--mono); color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.tr h4 span { color: var(--ink-3); font-weight: 400; }
.tr p { margin: 0; overflow-wrap: anywhere; }
.red { color: #000; background: #f5f5f7; border-radius: 3px; padding: 0 3px; }
.wiki-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.wiki-list button { border: 0; background: rgb(255 255 255 / .07); border-radius: var(--r-1); font: 12.5px var(--mono); padding: 5px 9px; cursor: pointer; color: var(--ink-2); }
.wiki-list button[aria-pressed="true"] { background: #f5f5f7; color: #000; }
.page { font: 13px/1.7 var(--mono); white-space: pre-wrap; background: rgb(0 0 0 / .3); border-radius: var(--r-2); padding: 14px; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.dream-summary { font-size: 14.5px; color: var(--ink-2); margin: 6px 0 12px; }
.dfile { border: 1px solid var(--line); border-radius: var(--r-2); margin-bottom: 10px; overflow: hidden; }
.dfile h4 { margin: 0; padding: 8px 12px; font: 500 12.5px var(--mono); background: rgb(255 255 255 / .05); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dfile h4 span { color: var(--ink-3); font-weight: 400; }
.dfile pre { margin: 0; padding: 8px 0; font: 12.5px/1.6 var(--mono); overflow-x: auto; }
.dfile pre span { display: block; padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dfile .a { background: var(--add-bg); color: var(--add); }
.dfile .d { color: var(--del); text-decoration: line-through; text-decoration-color: rgb(255 255 255 / .2); }
.dfile .ctx { color: var(--ink-3); }
.dream-actions { display: flex; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; align-items: center; }
.dream-actions .note { font-size: 13px; color: var(--ink-3); }
.pulse { box-shadow: 0 0 0 0 rgb(255 255 255 / .4); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgb(255 255 255 / 0); } 100% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.done-card { align-self: stretch; background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-2); padding: 14px 16px; font-size: 14.5px; animation: rise .45s var(--ease) both; }
.done-card a { color: #fff; font-weight: 500; }

.tablist button[aria-selected="true"] .n { background: rgb(0 0 0 / .1); color: #000; }
.mem-body .empty { text-align: center; max-width: 340px; margin: 48px auto 0; line-height: 1.6; }
