/* Toppu: the chat (.tp), the AI check call-out on the marking page (.ai-cta) and the checked
   script (.osm). Same language as the paper maker: pale cyan, bright blue, DM Sans headings,
   the flat ocean art. The examiner's marks are the one new colour: red ink. */
.tp, .osm, .ai-cta { --tp-blue: #1cb0f6; --tp-cyan: #cefbff; --tp-pink: #d665bd; --tp-navy: #102b3e; --tp-ring: #f0f0f0; --tp-ink: #e11d48; --tp-display: "DM Sans", "DM Sans Fallback", var(--tp-font, Inter, system-ui, sans-serif); }

/* ── Chat ──────────────────────────────────────────────────────────────── */
main.tp-host { padding: 0; gap: 0; }
.tp { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); background: #fff; border-radius: inherit; overflow: hidden; }
.tp :focus-visible { outline: 3px solid rgba(28, 176, 246, .55); outline-offset: 2px; }
.tp-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 16px 12px; background: #fafafa; box-shadow: inset -2px 0 0 var(--tp-ring); }
.tp-side__top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; font-family: var(--tp-display); font-size: 15px; }
.tp-side__top strong { font-weight: 500; }
.tp-side ol { flex: 1; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; display: grid; gap: 2px; align-content: start; }
.tp-side li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 12px; }
.tp-side li > button:first-child { display: grid; gap: 1px; padding: 8px 10px; border: 0; background: none; color: #262626; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; min-width: 0; }
.tp-side li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-side li small { font-size: 11.5px; color: #a3a3a3; }
.tp-side li .tp-icon { opacity: 0; width: 30px; height: 30px; margin-right: 4px; }
.tp-side li:hover, .tp-side li.is-on { background: #fff; box-shadow: inset 0 0 0 2px var(--tp-ring); }
.tp-side li:hover .tp-icon, .tp-side li:focus-within .tp-icon { opacity: 1; }
.tp-side li.is-on > button:first-child { font-weight: 500; }
.tp-side__none { padding: 10px; font-size: 12.5px; line-height: 1.5; color: #8a8a8a; }
.tp-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: none; color: #525252; cursor: pointer; }
.tp-icon:hover { background: #f1f1f1; color: #0a0a0a; }
.tp-only-small { display: none; }
.tp-new { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2px #ececec; color: #262626; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.tp-new:hover { box-shadow: inset 0 0 0 2px #d4d4d4; }
.tp-new.is-wide { width: 100%; }

.tp-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.tp-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; box-shadow: inset 0 -2px 0 var(--tp-ring); }
.tp-title { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.tp-title img { width: 30px; height: 30px; }
.tp-title strong { font-family: var(--tp-display); font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.tp-title span { overflow: hidden; font-size: 13px; color: #8a8a8a; text-overflow: ellipsis; white-space: nowrap; }
.tp-models { display: inline-flex; gap: 3px; padding: 3px; border-radius: 13px; background: #f3f3f3; }
.tp-models button { height: 32px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: #525252; font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .15s ease, color .15s ease; }
.tp-models button[aria-checked="true"] { background: var(--tp-navy); color: #fff; }
.tp-models button:disabled { opacity: .4; cursor: not-allowed; }

.tp-thread { overflow-y: auto; overscroll-behavior: contain; padding: 22px max(18px, calc((100% - 760px) / 2)) 12px; scroll-behavior: smooth; }
.tp-msg { display: grid; margin-bottom: 14px; }
.tp-msg.is-user { justify-items: end; margin-top: 20px; }
.tp-bubble { max-width: min(560px, 86%); padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--tp-cyan); color: #0a0a0a; font-size: 15px; line-height: 1.5; }
.tp-bubble p { margin: 0; overflow-wrap: anywhere; }
.tp-shots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tp-shots img { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; }
.tp-shots span { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .6); font-size: 12.5px; color: #525252; }
.tp-msg.is-toppu { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.tp-msg.is-more { margin-top: -6px; }
.tp-face { width: 34px; height: 34px; }
.tp-body { min-width: 0; }
.tp-text { font-size: 15.5px; line-height: 1.65; color: #171717; overflow-wrap: anywhere; }
.tp-text > :first-child { margin-top: 0; } .tp-text > :last-child { margin-bottom: 0; }
.tp-text p { margin: 0 0 10px; }
.tp-text h4 { margin: 14px 0 6px; font-family: var(--tp-display); font-size: 16.5px; font-weight: 500; }
.tp-text ul, .tp-text ol { margin: 0 0 10px; padding-left: 22px; list-style: revert; }
.tp-text li { margin: 3px 0; }
.tp-text a { color: #0879b3; text-decoration: underline; text-underline-offset: 2px; }
.tp-text code { padding: 1px 5px; border-radius: 6px; background: #f3f3f3; font: 13.5px/1.5 ui-monospace, Menlo, monospace; }
.tp-code { margin: 0 0 10px; padding: 12px 14px; overflow-x: auto; border-radius: 12px; background: var(--tp-navy); color: #e6f7ff; }
.tp-code code { padding: 0; background: none; color: inherit; }
.tp-math.is-block { display: block; margin: 8px 0; overflow-x: auto; text-align: center; }
.tp-table { margin: 0 0 10px; overflow-x: auto; }
.tp-table table { border-collapse: collapse; font-size: 14px; }
.tp-table th, .tp-table td { padding: 6px 10px; border: 1.5px solid #ececec; text-align: left; }
.tp-table th { background: #fafafa; font-weight: 600; }
.tp-typing { display: inline-flex; gap: 5px; padding: 12px 2px; }
.tp-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--tp-blue); animation: tp-bob 1s ease-in-out infinite; }
.tp-typing i:nth-child(2) { animation-delay: .14s; } .tp-typing i:nth-child(3) { animation-delay: .28s; }
@keyframes tp-bob { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.tp-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-step { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; background: #f5f5f5; color: #525252; font-size: 12.5px; font-weight: 500; }
.tp-step b { font-weight: 700; }
.tp-step i { width: 12px; height: 12px; border: 2px solid rgba(28, 176, 246, .3); border-top-color: var(--tp-blue); border-radius: 50%; animation: tp-spin .7s linear infinite; }
.tp-step.is-done { background: rgba(206, 251, 255, .6); color: #0879b3; }
.tp-step.is-error { background: #fff1f2; color: #be123c; }
@keyframes tp-spin { to { transform: rotate(1turn); } }
.tp-note { margin: 8px 0 0; font-size: 12.5px; color: #8a8a8a; }
.tp-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff1f2; color: #9f1239; font-size: 14px; }
.tp-fail p { flex: 1 1 220px; margin: 0; }

/* Cards: what a tool shows the student. */
.tp-card { margin: 0 0 14px 44px; max-width: 640px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--tp-ring); overflow: hidden; animation: tp-in .32s cubic-bezier(.2, .85, .25, 1) backwards; }
@keyframes tp-in { from { opacity: 0; transform: translateY(8px); } }
.tp-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: rgba(206, 251, 255, .42); }
.tp-card > header img { width: 26px; height: 26px; object-fit: contain; }
.tp-card > header strong { flex: 1; min-width: 0; font-family: var(--tp-display); font-size: 15.5px; font-weight: 500; letter-spacing: -.01em; }
.tp-card > header span { font-size: 12.5px; color: rgba(10, 10, 10, .6); white-space: nowrap; }
.tp-card > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; box-shadow: inset 0 2px 0 var(--tp-ring); }
.tp-wait { margin: 0; padding: 14px; font-size: 13.5px; color: #8a8a8a; }
.tp-btn { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px 0 14px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2px #ececec; color: #171717; font: inherit; font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: box-shadow .15s ease, background .15s ease, transform .1s ease; }
.tp-btn:hover { box-shadow: inset 0 0 0 2px #d4d4d4; }
.tp-btn:active { transform: scale(.97); }
.tp-btn.is-main { background: var(--tp-blue); box-shadow: none; color: #fff; }
.tp-btn.is-main:hover { background: #12a3e8; }
.tp-qs, .tp-res, .tp-plan { margin: 0; padding: 0; list-style: none; }
.tp-qs li + li, .tp-res li + li { box-shadow: inset 0 2px 0 var(--tp-ring); }
.tp-qs a { display: grid; gap: 6px; padding: 12px 14px; color: inherit; text-decoration: none; }
.tp-qs a:hover, .tp-res a:hover { background: #fafafa; }
.tp-qs__text { font-family: var(--font-noto-serif), Georgia, serif; font-size: 14.5px; line-height: 1.5; }
.tp-qs__meta, .tp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tp-qs__meta i, .tp-chips i, .tp-res i { padding: 2px 8px; border-radius: 8px; background: var(--tp-cyan); color: #0879b3; font-size: 11.5px; font-style: normal; font-weight: 600; white-space: nowrap; }
.tp-res a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 11px 14px; color: inherit; font-size: 14px; text-decoration: none; }
.tp-res small { font-size: 12px; color: #8a8a8a; white-space: nowrap; }
.tp-res svg { color: #a3a3a3; }
.tp-card--row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.tp-card--row > img { width: 46px; height: 46px; object-fit: contain; }
.tp-card--row strong { display: block; font-family: var(--tp-display); font-size: 15.5px; font-weight: 500; }
.tp-card--row span { display: block; margin-top: 1px; font-size: 13px; color: #737373; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-card--paper { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 14px; background: rgba(206, 251, 255, .3); box-shadow: inset 0 0 0 2px rgba(28, 176, 246, .35); }
.tp-paper__art { grid-row: 1 / 3; width: 64px; height: 64px; object-fit: contain; }
.tp-paper__text strong { display: block; margin-bottom: 6px; font-family: var(--tp-display); font-size: 16px; font-weight: 500; line-height: 1.3; }
.tp-card--paper .tp-chips i { background: #fff; }
.tp-paper__go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tp-card--q { padding-bottom: 0; }
.tp-q__text { padding: 14px 14px 6px; font-family: var(--font-noto-serif), Georgia, serif; font-size: 15px; line-height: 1.6; }
.tp-q__text img { max-width: 100%; height: auto; }
.tp-q__parts { margin: 0; padding: 0 14px 8px 34px; font-family: var(--font-noto-serif), Georgia, serif; font-size: 14.5px; line-height: 1.55; }
.tp-card--q .qbx-paper-opts { margin: 0; padding: 0 14px 12px; font-family: var(--font-noto-serif), Georgia, serif; font-size: 14.5px; }
.tp-plan > li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 10px 14px; }
.tp-plan > li + li { box-shadow: inset 0 2px 0 var(--tp-ring); }
.tp-plan b { padding-top: 3px; font-size: 12.5px; font-weight: 600; color: #525252; }
.tp-plan ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tp-plan ul li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 14px; }
.tp-plan small { font-size: 12px; color: #8a8a8a; white-space: nowrap; }
.tp-sub { padding: 2px 8px; border-radius: 8px; background: color-mix(in srgb, var(--tp-pink) 14%, #fff); color: #a3368b; font-size: 11.5px; font-style: normal; font-weight: 600; white-space: nowrap; }
.tp-sub--chemistry, .tp-sub--biology, .tp-sub--english-core { background: var(--tp-cyan); color: #0879b3; }

/* The first screen of a new chat. */
.tp-hello { display: grid; gap: 16px; max-width: 760px; margin: 0 auto; }
.tp-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 148px; border-radius: 16px; background: rgba(206, 251, 255, .42); box-shadow: inset 0 0 0 2px rgba(10, 10, 10, .05); }
.tp-hero__art { position: absolute; z-index: -1; right: 0; bottom: 0; width: 56%; height: 100%; object-fit: cover; object-position: 100% 100%; -webkit-mask-image: linear-gradient(to right, transparent 6%, #000 46%); mask-image: linear-gradient(to right, transparent 6%, #000 46%); }
.tp-hero__text { max-width: 430px; padding: 20px 24px; }
.tp-hero h1 { margin: 0; font-family: var(--tp-display); font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.tp-hero p { margin: 8px 0 0; font-size: 14.5px; font-weight: 500; line-height: 1.5; color: rgba(10, 10, 10, .7); }
.tp-starts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tp-start { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--tp-ring); color: #0a0a0a; font: inherit; text-align: left; cursor: pointer; transition: box-shadow .16s ease, transform .12s ease; }
.tp-start img { width: 46px; height: 46px; object-fit: contain; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.tp-start strong { display: block; font-family: var(--tp-display); font-size: 15px; font-weight: 500; }
.tp-start small { display: block; margin-top: 2px; overflow: hidden; font-size: 12px; color: #8a8a8a; text-overflow: ellipsis; white-space: nowrap; }
.tp-start:hover { box-shadow: inset 0 0 0 2px var(--tp-blue); }
.tp-start:hover img { transform: scale(1.1) rotate(-5deg); }
.tp-start:active { transform: scale(.98); }
.tp-tip { margin: 0; font-size: 13px; color: #8a8a8a; text-align: center; }
.tp-tip kbd { padding: 1px 7px; border-radius: 6px; background: #f1f1f1; font: 600 12.5px ui-monospace, Menlo, monospace; color: #404040; }
.tp-off { margin: 0; padding: 10px 14px; border-radius: 12px; background: #fff7ed; color: #9a3412; font-size: 13.5px; }

/* The box you type in. */
.tp-composer { position: relative; padding: 8px max(18px, calc((100% - 760px) / 2)) 12px; }
.tp-box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: end; padding: 7px; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 2px #e5e5e5, 0 10px 26px -18px rgba(16, 43, 62, .4); transition: box-shadow .16s ease; }
.tp-box:focus-within { box-shadow: inset 0 0 0 2px var(--tp-blue), 0 10px 26px -18px rgba(16, 43, 62, .4); }
.tp-input { min-height: 38px; max-height: 180px; padding: 8px 4px; border: 0; background: none; color: #0a0a0a; font: inherit; font-size: 15.5px; line-height: 1.45; resize: none; outline: none !important; }
.tp-send { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 14px; background: var(--tp-blue); color: #fff; cursor: pointer; transition: background .15s ease, transform .1s ease; }
.tp-send:hover { background: #12a3e8; } .tp-send:active { transform: scale(.94); }
.tp-send.is-stop { background: var(--tp-navy); }
.tp-fine { margin: 7px 0 0; font-size: 11.5px; color: #a3a3a3; text-align: center; }
.tp-attach { display: flex; gap: 8px; margin-bottom: 8px; }
.tp-attach[hidden] { display: none; }
.tp-attach span { position: relative; }
.tp-attach img { display: block; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; box-shadow: inset 0 0 0 2px var(--tp-ring); }
.tp-attach button { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--tp-navy); color: #fff; cursor: pointer; }
.tp-menu { position: absolute; left: max(18px, calc((100% - 760px) / 2)); right: max(18px, calc((100% - 760px) / 2)); bottom: calc(100% - 2px); z-index: 5; display: grid; max-height: 300px; padding: 6px; overflow-y: auto; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--tp-ring), 0 18px 40px -18px rgba(16, 43, 62, .45); }
.tp-menu[hidden] { display: none; }
.tp-menu button { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: #171717; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.tp-menu b { font-weight: 600; color: #0879b3; }
.tp-menu small { overflow: hidden; max-width: 240px; font-size: 12px; color: #a3a3a3; text-overflow: ellipsis; white-space: nowrap; }
.tp-menu button[aria-selected="true"], .tp-menu button:hover { background: rgba(206, 251, 255, .6); }

@media (max-width: 1100px) {
  .tp { grid-template-columns: minmax(0, 1fr); }
  .tp-side { position: absolute; z-index: 30; inset: 0 auto 0 0; width: min(300px, 86%); transform: translateX(-102%); transition: transform .26s cubic-bezier(.2, .85, .25, 1); box-shadow: none; }
  .tp.is-side .tp-side { transform: none; box-shadow: 20px 0 50px -20px rgba(16, 43, 62, .4); }
  .tp { position: relative; }
  .tp-only-small { display: grid; }
}
@media (max-width: 600px) {
  .tp-head { padding: 8px 10px; gap: 6px; }
  .tp-title span, .tp-new span { display: none; }
  .tp-new { padding: 0 10px; }
  .tp-models button { padding: 0 9px; font-size: 12.5px; }
  .tp-thread { padding: 14px 12px 8px; }
  .tp-composer { padding: 6px 10px 10px; }
  .tp-menu { left: 10px; right: 10px; }
  .tp-menu button { grid-template-columns: 110px minmax(0, 1fr); } .tp-menu small { display: none; }
  .tp-card { margin-left: 0; }
  .tp-hero { min-height: 196px; align-items: flex-start; }
  .tp-hero__art { width: 100%; height: 56%; -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 46%); mask-image: linear-gradient(to bottom, transparent 4%, #000 46%); object-position: 82% 100%; }
  .tp-hero__text { padding: 16px 16px 0; } .tp-hero h1 { font-size: 22px; } .tp-hero p { font-size: 13.5px; }
  .tp-starts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tp-card--row { grid-template-columns: auto minmax(0, 1fr); } .tp-card--row > .tp-btn { grid-column: 1 / -1; justify-content: center; }
  .tp-plan > li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tp-fine { display: none; }
}

/* ── "Let Toppu check it" on the marking page ──────────────────────────── */
.ai-cta { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0 0 18px; padding: 14px 16px; border-radius: 16px; background: rgba(206, 251, 255, .42); box-shadow: inset 0 0 0 2px rgba(28, 176, 246, .35); }
.ai-cta > img { width: 64px; height: 64px; object-fit: contain; }
.ai-cta strong { display: block; font-family: var(--tp-display); font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.ai-cta span { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: rgba(10, 10, 10, .72); }
.ai-cta__go { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--tp-blue); color: #fff; font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s ease, transform .1s ease; }
.ai-cta__go:hover { background: #12a3e8; } .ai-cta__go:active { transform: scale(.97); }
.ai-cta__go:disabled { opacity: .55; cursor: progress; }
.ai-cta__bar { grid-column: 1 / -1; display: grid; gap: 6px; }
.ai-cta__bar[hidden] { display: none; }
.ai-cta__bar i { display: block; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .9); overflow: hidden; }
.ai-cta__bar b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--tp-blue); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.ai-cta__bar small { font-size: 12.5px; color: #0879b3; font-weight: 500; }
.ai-cta__fail { grid-column: 1 / -1; margin: 0; padding: 9px 12px; border-radius: 12px; background: #fff1f2; color: #9f1239; font-size: 13.5px; }

/* ── The checked script (on-screen marking) ────────────────────────────── */
.osm { margin: 0 0 26px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--tp-ring); overflow: hidden; font-family: var(--tp-font, Inter, system-ui, sans-serif); background: #fff; }
.osm-bar { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; background: rgba(206, 251, 255, .42); box-shadow: inset 0 -2px 0 rgba(10, 10, 10, .05); }
.osm-bar img { width: 52px; height: 52px; object-fit: contain; }
.osm-bar strong { display: block; font-family: var(--tp-display); font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.osm-bar span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: rgba(10, 10, 10, .7); }
.osm-score { display: flex; align-items: baseline; gap: 5px; padding: 6px 14px; border: 2.5px solid var(--tp-ink); border-radius: 50%/60%; color: var(--tp-ink); transform: rotate(-4deg); }
.osm-score b { font: 700 26px/1 "Comic Sans MS", "Bradley Hand", "Segoe Print", cursive; }
.osm-score i { font: 600 14px/1 "Comic Sans MS", "Bradley Hand", "Segoe Print", cursive; font-style: normal; }
.osm-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.osm--nopages .osm-body { grid-template-columns: minmax(0, 1fr); }
.osm-script { display: grid; gap: 14px; max-height: 86vh; padding: 14px; overflow-y: auto; background: #eef1f3; scroll-behavior: smooth; }
.osm-page { position: relative; margin: 0; background: #fff; box-shadow: 0 6px 20px -12px rgba(16, 43, 62, .5); }
.osm-page img { display: block; width: 100%; height: auto; }
.osm-page figcaption { position: absolute; right: 8px; bottom: 6px; padding: 2px 8px; border-radius: 8px; background: rgba(16, 43, 62, .7); color: #fff; font-size: 11px; }
.osm-ink { position: absolute; inset: 0; pointer-events: none; color: var(--tp-ink); font-family: "Comic Sans MS", "Bradley Hand", "Segoe Print", cursive; }
.osm-span { position: absolute; left: 1.2%; width: 5%; border-left: 2.5px solid currentColor; border-radius: 8px 0 0 8px; opacity: .85; }
.osm-span b { position: absolute; top: -2px; left: 6px; padding: 0 5px; border-radius: 6px; background: rgba(255, 255, 255, .86); font-size: clamp(10px, 1.5vw, 14px); font-weight: 700; white-space: nowrap; }
.osm-total { position: absolute; right: 2%; display: grid; place-items: center; min-width: 2.4em; padding: .18em .5em .22em; border: 2.5px solid currentColor; border-radius: 50%; background: rgba(255, 255, 255, .88); font-size: clamp(13px, 2vw, 20px); font-weight: 700; line-height: 1; transform: translateY(-60%) rotate(-5deg); pointer-events: auto; cursor: pointer; }
.osm-total i { display: block; margin-top: 2px; padding-top: 2px; border-top: 2px solid currentColor; font-size: .72em; font-style: normal; }
.osm-total.is-full { color: #15803d; }
.osm-tick { position: absolute; left: 7%; display: inline-flex; align-items: center; gap: 4px; font-size: clamp(15px, 2.4vw, 24px); font-weight: 700; line-height: 1; transform: translateY(-50%); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.osm-tick.is-tick { color: #15803d; }
.osm-tick em { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .88); font-size: .5em; font-style: normal; white-space: nowrap; }
.osm-page.is-lit { outline: 3px solid var(--tp-blue); outline-offset: 2px; }
.osm-panel { display: grid; gap: 14px; align-content: start; max-height: 86vh; padding: 14px; overflow-y: auto; box-shadow: inset 2px 0 0 var(--tp-ring); }
.osm--nopages .osm-panel { max-height: none; box-shadow: none; }
.osm-sec h4 { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #737373; }
.osm-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.osm-cell { display: grid; justify-items: center; padding: 5px 2px 4px; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 2px #ececec; color: #171717; font: inherit; cursor: pointer; transition: box-shadow .14s ease, transform .1s ease; }
.osm-cell i { font-size: 10.5px; font-style: normal; color: #8a8a8a; }
.osm-cell b { font-size: 15px; font-weight: 600; line-height: 1.15; }
.osm-cell small { font-size: 10px; color: #a3a3a3; }
.osm-cell.is-full { background: #f0fdf4; box-shadow: inset 0 0 0 2px #bbf7d0; } .osm-cell.is-full b { color: #15803d; }
.osm-cell.is-part { background: #fffbeb; box-shadow: inset 0 0 0 2px #fde68a; } .osm-cell.is-part b { color: #b45309; }
.osm-cell.is-zero { background: #fff1f2; box-shadow: inset 0 0 0 2px #fecdd3; } .osm-cell.is-zero b { color: #be123c; }
.osm-cell.is-skip { opacity: .55; }
.osm-cell:hover { transform: translateY(-1px); }
.osm-cell.is-on { box-shadow: inset 0 0 0 2.5px var(--tp-blue); }
.osm-hint, .osm-note, .osm-none { margin: 0; font-size: 12.5px; line-height: 1.5; color: #8a8a8a; }
.osm-detail { padding: 12px; border-radius: 14px; background: #fafafa; animation: tp-in .24s cubic-bezier(.2, .85, .25, 1); }
.osm-detail[hidden] { display: none; }
.osm-detail header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.osm-detail header strong { font-family: var(--tp-display); font-size: 16px; font-weight: 500; }
.osm-detail header span { font-weight: 600; color: var(--tp-ink); }
.osm-jump { margin-left: auto; height: 28px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--tp-cyan); color: #0879b3; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.osm-steps { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.osm-steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 1.4; }
.osm-steps p { margin: 0; }
.osm-steps span { font-weight: 700; } .osm-steps b { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.osm-steps .is-got span, .osm-steps .is-got b { color: #15803d; } .osm-steps .is-half span, .osm-steps .is-half b { color: #b45309; } .osm-steps .is-lost span, .osm-steps .is-lost b { color: #be123c; }
.osm-remark { margin: 0 0 8px; padding: 8px 10px; border-left: 3px solid var(--tp-ink); border-radius: 0 8px 8px 0; background: #fff; font-size: 13.5px; line-height: 1.5; }
.osm-changed { margin: 0 0 8px; font-size: 12.5px; color: #b45309; }
.osm-fix { font-size: 12.5px; font-weight: 500; color: #0879b3; text-decoration: underline; text-underline-offset: 2px; }
.pv-solution { margin: 8px 0 4px; padding: 10px 12px; border-left: 3px solid #1cb0f6; border-radius: 0 10px 10px 0; background: rgba(206, 251, 255, .35); font-size: .95em; }
.pv-solution > b { display: block; margin-bottom: 4px; font: 600 11.5px/1.2 var(--tp-font, Inter, sans-serif); letter-spacing: .06em; text-transform: uppercase; color: #0879b3; }
@media (max-width: 900px) {
  .osm-body { grid-template-columns: minmax(0, 1fr); }
  .osm-panel { order: -1; max-height: none; box-shadow: inset 0 -2px 0 var(--tp-ring); }
  .osm-script { max-height: none; padding: 8px; }
  .ai-cta { grid-template-columns: 48px minmax(0, 1fr); } .ai-cta > img { width: 48px; height: 48px; } .ai-cta__go { grid-column: 1 / -1; justify-content: center; }
  .osm-bar { grid-template-columns: 40px minmax(0, 1fr) auto; } .osm-bar img { width: 40px; height: 40px; } .osm-bar span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tp *, .osm *, .ai-cta * { animation: none !important; transition: none !important; } }
body.reduce-motion .tp *, body.reduce-motion .osm *, body.reduce-motion .ai-cta * { animation: none !important; transition: none !important; }
@media print { .osm-script, .osm-panel { max-height: none; overflow: visible; } .ai-cta { display: none; } }
