/* ============================================================
   SIMUKA — Simulasi UKK TKJ 2026
   Theme: ruangguru-inspired — vibrant orange primary,
          blue secondary, white / very-light surfaces, Inter,
          pill buttons + rounded (12px) cards, friendly energy.
   ============================================================ */

:root {
  --bg:           #f5f8fc;
  --bg-grad-a:    #ffffff;
  --bg-grad-b:    #eef4fb;

  --surface:      #ffffff;
  --surface-2:    #f7f9fc;   /* recessed fields / section blocks */

  --ink:          #0a2540;   /* primary text — dark navy */
  --ink-soft:     #46566b;   /* secondary text */
  --ink-faint:    #8a98a8;   /* hints, placeholders */

  --primary:      #f26d0f;   /* ruangguru orange */
  --primary-700:  #d85c0a;   /* orange gradient terminus */
  --primary-500:  #f5821f;   /* orange hover top-stop */
  --primary-tint: #fdeee2;   /* light orange fill */

  --secondary:      #007bff; /* ruangguru blue */
  --secondary-700:  #1480d8; /* interactive blue */
  --secondary-tint: #e0eefa; /* light blue fill */

  --line:         #e6eaf0;
  --line-strong:  #d5dce5;

  --sev-low:      #1fa971;
  --sev-low-bg:   #e6f7ef;
  --sev-med:      #e08a0b;
  --sev-med-bg:   #fef3e0;
  --sev-high:     #e23b3b;
  --sev-high-bg:  #fde8e8;

  --radius:       12px;   /* cards */
  --radius-sm:    10px;   /* inner blocks / controls */
  --shadow:       0 6px 22px -12px rgba(10,37,64,.18);
  --shadow-sm:    0 4px 14px -8px rgba(10,37,64,.16);
  --ring:         0 0 0 3px rgba(242,109,15,.22);

  --font-display: "Inter", system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(242,109,15,.10), transparent 60%),
    radial-gradient(900px 480px at -8% 0%, rgba(0,123,255,.08), transparent 55%),
    linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b));
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===================== Header ===================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  box-shadow: 0 2px 12px rgba(10,37,64,.06);
}
.app-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  color: #fff;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  box-shadow: 0 6px 16px -8px rgba(242,109,15,.6);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.3px; color: var(--ink); }
.brand__subtitle { font-size: .76rem; color: var(--secondary-700); font-weight: 600; letter-spacing: .2px; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav__tab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-soft);
  background: #f2f5f9;
  border: 1px solid transparent;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.nav__tab:hover { color: var(--primary); background: #ffe9d8; }
.nav__tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  box-shadow: 0 6px 16px -8px rgba(242,109,15,.7);
}
.nav__tab:active { transform: translateY(1px); }

/* ===================== Layout ===================== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 22px 80px;
}

.view { display: none; }
.view.is-active { display: block; animation: viewIn .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-head { margin-bottom: 22px; }
.view-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -.5px;
}
.view-title::after {
  content: "";
  display: block;
  width: 52px; height: 4px;
  border-radius: 999px;
  background: var(--primary);
  margin-top: 10px;
}
.view-desc { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* ===================== Cards ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}

/* ===================== Forms ===================== */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-weight: 600; font-size: .9rem; color: var(--ink); }
label { font-weight: 600; font-size: .9rem; color: var(--ink); }

select, input[type="text"], input[type="number"], input[type="password"], textarea {
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 200px;          /* ruangguru pill inputs */
  padding: 12px 18px;
  width: 100%;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { resize: vertical; line-height: 1.5; border-radius: 14px; }  /* multiline softer */
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
  linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 42px;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--ring);
}
.hint { color: var(--ink-faint); font-size: .8rem; font-weight: 400; }
.hint code, .note code { font-family: var(--font-mono); font-size: .82em; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; border: 1px solid var(--line); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Radio pills */
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill { position: relative; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #f2f5f9;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink-soft);
  transition: all .16s ease;
}
.radio-pill:hover span { border-color: var(--primary); }
.radio-pill input:checked + span {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary-700);
}
.radio-pill input:focus-visible + span { box-shadow: var(--ring); }

.combo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.combo select { flex: 1 1 240px; }
.combo__sep { color: var(--ink-faint); font-size: .85rem; }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* ===================== Buttons ===================== */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  border: 1px solid transparent;
  border-radius: 100px;          /* primary pill */
  padding: 12px 26px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: #fafbfc;
  box-shadow: 0 8px 20px -8px rgba(242,109,15,.6);
}
.btn--primary:hover { box-shadow: 0 10px 24px -8px rgba(242,109,15,.78); filter: brightness(1.04); }
.btn--ghost {
  background: var(--secondary-tint);
  border: 1px solid var(--secondary-700);
  color: var(--secondary-700);
  border-radius: 35px;
}
.btn--ghost:hover { background: #d2e7fb; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.is-loading .btn__label { opacity: .7; }

/* ===================== Scenario result ===================== */
.scenario-result { display: flex; flex-direction: column; gap: 16px; }
.scenario-result .card { animation: cardIn .5s cubic-bezier(.2,.7,.2,1) both; }
.scenario-result .card:nth-child(2) { animation-delay: .06s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.scenario-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px; margin-bottom: 4px;
}
.scenario-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; margin: 0 0 8px; color: var(--ink);
}
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scenario-id-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-faint); }
.scenario-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tag {
  font-size: .76rem; font-weight: 700; letter-spacing: .3px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--primary-tint); color: var(--primary-700);
  border: 1px solid rgba(242,109,15,.3);
}
.tag--mode { background: var(--secondary-tint); color: var(--secondary-700); border-color: rgba(20,128,216,.3); }

.section {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px 16px;
}
.section__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.section__title {
  font-family: var(--font-display);
  font-size: .8rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--primary); font-weight: 700; margin: 0;
}
.section__body { margin: 0; color: var(--ink); white-space: pre-wrap; }
.copy-btn {
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft);
  border-radius: 8px; padding: 5px 11px; font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .14s ease; white-space: nowrap;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.copy-btn.is-done { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-700); }

.hidden-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff7ec; border: 1px solid #f0d9b0; color: #7a5a1e;
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .88rem;
}
.hidden-note svg { flex: 0 0 auto; margin-top: 1px; }

.open-assess-btn { align-self: flex-start; }

/* ===================== Read-only banner ===================== */
.read-only-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--secondary-tint); border: 1px solid #bbd9fb; color: var(--secondary-700);
  border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 18px;
  font-size: .9rem;
}
.read-only-banner strong { color: var(--primary); }

/* ===================== Input tabs ===================== */
.tabs { display: flex; gap: 4px; margin-bottom: -1px; }
.tabs__btn {
  font-family: var(--font-display); font-weight: 600; font-size: .92rem;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 10px 18px; cursor: pointer;
  transition: all .16s ease;
}
.tabs__btn:hover { color: var(--primary); }
.tabs__btn.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 -2px 0 var(--primary) inset; }
.panel { display: none; border-top-left-radius: 0; }
.panel.is-active { display: block; animation: viewIn .35s ease both; }

/* ===================== Terminal ===================== */
.terminal {
  margin-top: 20px;
  border: 1px solid #0c2233;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0b1f2e;
  box-shadow: var(--shadow);
}
.terminal__bar {
  display: flex; align-items: center; gap: 7px;
  background: #0a1a27; padding: 9px 13px; border-bottom: 1px solid #16303f;
}
.terminal__dot { width: 11px; height: 11px; border-radius: 50%; background: #2c4a5e; }
.terminal__dot:nth-child(1){ background:#ff5f57; }
.terminal__dot:nth-child(2){ background:#febc2e; }
.terminal__dot:nth-child(3){ background:#28c840; }
.terminal__title { margin-left: 8px; color: #6f93a8; font-family: var(--font-mono); font-size: .76rem; }
.terminal__body {
  font-family: var(--font-mono);
  font-size: .83rem;
  color: #cfe3ee;
  padding: 14px 16px;
  max-height: 420px; overflow-y: auto;
  line-height: 1.55;
}
.log-line { white-space: pre-wrap; word-break: break-word; }
.log-cmd { color: #5bd6c0; }
.log-cmd::before { content: "❯ "; color: #2f9e8f; }
.log-out { color: #cfe3ee; }
.log-err { color: #ff8a8a; }
.log-done { color: #ffd479; border-top: 1px dashed #2c4a5e; margin-top: 8px; padding-top: 8px; }
.log-info { color: #8fb6c9; font-style: italic; }

/* ===================== Results ===================== */
.results { display: flex; flex-direction: column; gap: 18px; }
.summary-banner {
  background: linear-gradient(180deg, var(--secondary), var(--secondary-700));
  color: #fff; border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); border: 1px solid rgba(20,128,216,.4);
  animation: cardIn .45s ease both;
}
.summary-banner h3 { font-family: var(--font-display); margin: 0 0 8px; font-size: 1.1rem; color: #fff; }
.summary-banner p { margin: 0; color: #eaf3fe; }

.issues-head { font-family: var(--font-display); color: var(--ink); font-size: 1.05rem; margin: 4px 0 0; }
.issue-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  animation: cardIn .5s ease both;
}
.issue-card.sev-low  { border-left-color: var(--sev-low); }
.issue-card.sev-med  { border-left-color: var(--sev-med); }
.issue-card.sev-high { border-left-color: var(--sev-high); }

.issue-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.issue-area { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.sev-badge {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 4px 11px; border-radius: 999px;
}
.sev-badge.low  { background: var(--sev-low-bg);  color: var(--sev-low); }
.sev-badge.med  { background: var(--sev-med-bg);  color: var(--sev-med); }
.sev-badge.high { background: var(--sev-high-bg); color: var(--sev-high); }

.hint-block { margin: 0 0 12px; color: var(--ink-soft); }
.hint-block strong { color: var(--primary); display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; font-family: var(--font-display); }

.issue-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn--l2 { background: var(--secondary-tint); border: 1px solid var(--secondary-700); color: var(--secondary-700); border-radius: 35px; }
.btn--l2:hover { background: #d2e7fb; }
.btn--l3 { background: var(--sev-high-bg); border: 1px solid #f1b7b7; color: var(--sev-high); border-radius: 35px; }
.btn--l3:hover { background: #fbd9d9; }

.code-block {
  position: relative; margin: 12px 0 10px;
  background: #0b1f2e; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid #16303f;
}
.code-block__bar { background: #0a1a27; padding: 7px 12px; color: #6f93a8; font-family: var(--font-mono); font-size: .72rem; border-bottom: 1px solid #16303f; }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code-block code { font-family: var(--font-mono); font-size: .82rem; color: #cfe3ee; white-space: pre; }
.code-block .copy-btn { position: absolute; top: 6px; right: 8px; }

.warn-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: #fff7ec; border: 1px solid #f0d9b0; color: #7a5a1e;
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: .82rem; margin-bottom: 10px;
}
.concept { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }
.concept strong { color: var(--primary); }

/* ===================== Settings ===================== */
.status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-weight: 500; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-faint); box-shadow: 0 0 0 4px rgba(138,152,168,.18); }
.status-dot.ok { background: var(--sev-low); box-shadow: 0 0 0 4px rgba(31,169,113,.18); }
.status-dot.no { background: var(--sev-med); box-shadow: 0 0 0 4px rgba(224,138,11,.18); }
.note { font-size: .82rem; color: var(--ink-faint); margin: 16px 0 0; }

/* ===================== Toast ===================== */
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--radius-sm); padding: 13px 16px;
  box-shadow: var(--shadow); font-size: .9rem; color: var(--ink);
  animation: toastIn .3s ease both;
}
.toast.err { border-left-color: var(--sev-high); }
.toast.ok  { border-left-color: var(--sev-low); }
.toast.info{ border-left-color: var(--primary); }
.toast strong { display: block; margin-bottom: 2px; font-family: var(--font-display); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.is-leaving { animation: toastOut .3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ===================== Tutorial / Latihan ===================== */
.tutorial-result { display: flex; flex-direction: column; gap: 16px; }
.tutorial-result > .card { animation: cardIn .5s cubic-bezier(.2,.7,.2,1) both; }

.tut-list { margin: 6px 0 0; padding-left: 22px; color: var(--ink-soft); }
.tut-list li { margin-bottom: 6px; }
.tut-list li:last-child { margin-bottom: 0; }
.tut-list--ol { list-style: decimal; color: var(--ink); }
.tut-list--ol li { padding-left: 2px; }

.tut-steps { margin: 8px 0 0; padding-left: 22px; color: var(--ink); list-style: decimal; }
.tut-steps > li { margin-bottom: 16px; }
.tut-steps > li:last-child { margin-bottom: 0; }
.step-gui-label {
  font-family: var(--font-display); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .6px; color: var(--primary); font-weight: 700;
  display: block; margin-bottom: 3px;
}
.step-text { margin: 0 0 8px; color: var(--ink); white-space: pre-wrap; }
.step-note { font-size: .82rem; color: var(--ink-faint); margin: 6px 0 0; }
.step-note::before { content: "Catatan: "; font-weight: 600; color: var(--ink-soft); }

/* ===================== Checklist (langkah kerja) ===================== */
.checklist { margin: 8px 0 0; padding-left: 0; list-style: none; counter-reset: step; }
.checklist__item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  counter-increment: step;
  transition: border-color .14s ease, background .14s ease;
}
.checklist__item::before {
  content: counter(step);
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-tint); color: var(--primary-700);
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
}
.checklist__box { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; cursor: pointer; }
.checklist__text { color: var(--ink); line-height: 1.5; }
.checklist__item:has(.checklist__box:checked) { background: var(--sev-low-bg); border-color: var(--sev-low); }
.checklist__item:has(.checklist__box:checked) .checklist__text { text-decoration: line-through; color: var(--ink-soft); }

/* ===================== Asisten AI chat ===================== */
.chat-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: #fafbfc; border: none; cursor: pointer;
  box-shadow: 0 10px 26px -8px rgba(242,109,15,.6);
  display: grid; place-items: center;
  transition: transform .16s ease, box-shadow .16s ease;
}
.chat-bubble:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(242,109,15,.8); }
.chat-bubble svg { width: 26px; height: 26px; }
.chat-bubble[hidden] { display: none; }

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 71; width: 384px; max-width: calc(100vw - 32px); }
.chat[hidden] { display: none; }
.chat__panel {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  height: 540px; max-height: calc(100vh - 40px);
  overflow: hidden;
  animation: viewIn .3s ease both;
}
.chat__header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px;
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: #fff; border-bottom: 2px solid rgba(255,255,255,.3);
}
.chat__title { display: flex; flex-direction: column; line-height: 1.15; }
.chat__name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.chat__sub { font-size: .74rem; color: #ffe2cc; }
.chat__close {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 1.2rem; line-height: 1; transition: background .14s ease;
}
.chat__close:hover { background: rgba(255,255,255,.22); }

.chat__messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface-2);
}
.msg { max-width: 86%; padding: 9px 13px; border-radius: 13px; font-size: .9rem; line-height: 1.5; }
.msg__role { font-size: .66rem; text-transform: uppercase; letter-spacing: .6px; opacity: .65; margin-bottom: 3px; font-family: var(--font-display); font-weight: 600; }
.msg__text { white-space: pre-wrap; word-break: break-word; }
.msg--user { align-self: flex-end; background: linear-gradient(180deg, var(--primary), var(--primary-700)); color: #fafbfc; border-bottom-right-radius: 4px; }
.msg--user .msg__role { color: #ffe2cc; opacity: .85; }
.msg--assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.msg--error { align-self: flex-start; background: var(--sev-high-bg); border: 1px solid #f1b7b7; color: var(--sev-high); border-bottom-left-radius: 4px; }

.typing { align-self: flex-start; display: flex; gap: 5px; align-items: center; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; border-bottom-left-radius: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: typingBounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.chat__input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.chat__input textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; line-height: 1.45; }
.chat__send { flex: 0 0 auto; }

/* ===================== Footer ===================== */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 8px;
}
.site-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer__copy { font-size: .82rem; color: var(--ink-faint); }
.site-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--secondary-700);
  text-decoration: none;
  transition: color .14s ease;
}
.site-footer__link:hover { color: var(--primary); }
.site-footer__link svg { display: block; }

/* ===================== Responsive ===================== */
@media (max-width: 720px) {
  .app-header__inner { padding: 10px 16px; }
  .brand__subtitle { display: none; }
  .container { padding: 22px 16px 70px; }
  .view-title { font-size: 1.6rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .nav__tab { padding: 8px 14px; font-size: .85rem; }
}
@media (max-width: 480px) {
  .combo { flex-direction: column; align-items: stretch; }
  .combo__sep { text-align: center; }
  .site-footer__inner { flex-direction: column; text-align: center; gap: 8px; }
}

.active-tutorial-note {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, .14);
  color: #c7d2fe;
  font-size: .88rem;
  line-height: 1.4;
}
