:root {
  --orange: #ff5f76;
  --lime: #d9f34a;
  --teal: #156f73;
  --blue: #5138c9;
}

.brand-mark { background: #9b7bff; }
.side-tip { background: #d9f34a; }
.principles { background: #5138c9; }
.lesson-badge { background: #9b7bff; }
.portal-back { display: inline-flex; margin: 0 10px 18px; color: var(--muted); font: 750 11px var(--mono); text-decoration: none; text-transform: uppercase; }
.portal-back:hover { color: var(--ink); }
.home h1 { font-size: clamp(54px, 6vw, 90px); }

.model-card { position: relative; width: 100%; max-width: 610px; min-width: 0; transform: rotate(1deg); }
.model-card::before { content: ""; position: absolute; inset: -18px 24px 18px -18px; border: 2px solid var(--ink); border-radius: 20px; background: #16c9c1; transform: rotate(-3deg); }
.prediction-window { position: relative; border: 2px solid var(--ink); border-radius: 16px; background: #f1edff; box-shadow: 10px 12px 0 var(--ink); overflow: hidden; }
.prediction-body { min-height: 370px; padding: 30px; }
.prompt-label { color: var(--muted); font: 800 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.prompt-line { margin: 12px 0 28px; padding: 16px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); font: 750 16px/1.5 var(--mono); }
.token { display: inline-block; margin: 2px; padding: 2px 5px; border: 1px solid var(--ink); border-radius: 4px; background: #d9f34a; }
.prediction-title { margin-bottom: 12px; font: 900 11px var(--mono); text-transform: uppercase; }
.prediction-list { display: grid; gap: 10px; }
.prediction-row { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; font: 12px var(--mono); }
.prediction-track { height: 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.prediction-fill { display: block; height: 100%; background: #9b7bff; }
.prediction-row:first-child .prediction-fill { background: #16c9c1; }
.next-token { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 2px solid var(--ink); font: 800 12px var(--mono); }
.next-token b { padding: 6px 9px; border: 2px solid var(--ink); border-radius: 7px; background: #d9f34a; }
.model-sticker { position: absolute; right: -18px; bottom: -24px; z-index: 3; display: grid; place-items: center; width: 108px; height: 108px; border: 2px solid var(--ink); border-radius: 50%; background: #ff5f76; font: 900 12px/1.15 var(--mono); text-align: center; transform: rotate(-8deg); }

.prompt-lab-shell { display: grid; grid-template-columns: minmax(310px, .9fr) minmax(360px, 1.1fr) 250px; gap: 18px; margin-top: 34px; }
.prompt-panel { min-width: 0; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.prompt-panel-bar { display: flex; align-items: center; justify-content: space-between; min-height: 46px; gap: 10px; padding: 9px 12px; border-bottom: 2px solid var(--ink); background: var(--paper-2); font: 800 11px var(--mono); text-transform: uppercase; }
.prompt-panel-actions { display: flex; gap: 7px; }
.prompt-panel-bar button, .prompt-preset { padding: 5px 9px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--white); font: 750 10px var(--mono); cursor: pointer; }
.prompt-panel-bar button.primary { background: #9b7bff; color: var(--ink); }
.prompt-editor { display: block; width: 100%; min-height: 350px; padding: 18px; border: 0; outline: 0; resize: vertical; background: #171916; color: #f7f3e8; font: 13px/1.65 var(--mono); tab-size: 2; }
.prompt-editor:focus-visible { outline: 3px solid #16c9c1; outline-offset: -5px; }
.prompt-presets { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px; border-top: 2px solid var(--ink); background: #eee9ff; }
.prompt-preset:hover { background: #d9f34a; }
.prompt-analysis { min-height: 423px; padding: 17px; }
.prompt-score { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.prompt-score strong { font: 900 30px var(--mono); }
.score-track { height: 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.score-fill { height: 100%; background: #9b7bff; transition: width .25s ease; }
.score-label { font: 800 10px var(--mono); text-transform: uppercase; }
.signal-list { display: grid; gap: 8px; margin: 16px 0; }
.signal { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding: 9px 10px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper); font-size: 12px; }
.signal b { font-family: var(--mono); }
.signal.pass { background: #dcf8ed; }
.signal.pass .signal-mark { color: var(--teal); }
.signal-mark { font: 900 14px var(--mono); }
.prompt-brief { margin-top: 14px; padding: 14px; border: 2px solid var(--ink); border-radius: 10px; background: #eee9ff; }
.prompt-brief h3 { margin: 0 0 8px; font-size: 16px; }
.prompt-brief dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; margin: 0; font-size: 12px; }
.prompt-brief dt { color: var(--muted); font: 800 10px var(--mono); text-transform: uppercase; }
.prompt-brief dd { margin: 0; overflow-wrap: anywhere; }
.prompt-disclaimer { margin: 14px 0 0; color: var(--muted); font: 10px/1.5 var(--mono); }
.prompt-lab-shell .lab-guide { box-shadow: 4px 4px 0 var(--ink); }

.model-experiment { margin-block: 24px; }
.model-experiment h2 { margin-top: 0; }
.model-experiment fieldset { min-width: 0; margin: 18px 0; padding: 16px; border: 2px solid var(--ink); border-radius: 10px; }
.model-experiment legend { padding-inline: 6px; font-weight: 850; }
.mechanics-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.mechanics-controls label { display: grid; gap: 6px; font-weight: 750; }
.mechanics-controls input, .model-experiment select { width: 100%; min-height: 44px; padding: 8px; border: 2px solid var(--ink); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; }
.mechanics-chunks { display: grid; gap: 10px; }
.mechanics-chunks label { display: flex; align-items: center; gap: 8px; min-height: 36px; overflow-wrap: anywhere; }
.mechanics-chunks input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--blue); }
.model-experiment .prompt-preset { min-height: 44px; padding: 10px 14px; }
.model-experiment :is(input, select, button):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.model-experiment table { font-size: 12px; }
.model-experiment caption { text-align: left; margin-bottom: 10px; }
.model-experiment table { table-layout: fixed; }
.model-experiment th, .model-experiment td { padding: 10px 5px; overflow-wrap: anywhere; }

@media (max-width: 1220px) {
  .prompt-lab-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .prompt-lab-shell .lab-guide { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .home h1 { font-size: clamp(46px, 15.5vw, 66px); }
  .model-card { max-width: calc(100vw - 52px); margin-inline: auto; transform: none; }
  .model-card::before { inset: -12px 12px 12px -10px; transform: rotate(-1deg); }
  .prediction-body { min-height: 330px; padding: 22px; }
  .prediction-row { grid-template-columns: 74px 1fr 38px; }
  .model-sticker { right: -8px; width: 84px; height: 84px; font-size: 10px; }
  .prompt-lab-shell { grid-template-columns: 1fr; }
  .prompt-lab-shell .lab-guide { grid-column: auto; order: -1; }
  .prompt-editor { min-height: 285px; }
  .prompt-analysis { min-height: 0; }
}
