/* AIRadar Akademi — "Daha fazla öğren" unit assistant (client/program.js assistPanel). Own file, .as- prefix; uses the
   design tokens of style.css (and --ak-* when present). No inline styles anywhere (CSP style-src 'self'). */
.as { --as-acc: var(--ak-acc, var(--acc, #2563eb)); --as-acc-d: var(--ak-acc-d, var(--acc-d, #1d4ed8)); --as-acc-l: var(--ak-acc-l, var(--acc-l, #eff4ff));
  --as-line: var(--ak-line, var(--line, #e3e8f0)); --as-muted: var(--ak-muted, var(--muted, #64748b)); --as-r: var(--ak-r, var(--r, 16px));
  margin: 28px 0; background: var(--card, #fff); border: 1px solid var(--as-line); border-radius: var(--as-r); box-shadow: var(--shadow, 0 4px 16px rgba(15, 23, 42, .06)); overflow: hidden; }

/* header */
.as-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: linear-gradient(135deg, #eef4ff 0%, #ecfdf8 100%); border-bottom: 1px solid var(--as-line); }
.as-ic { flex: 0 0 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2563eb, #0d9488); box-shadow: 0 6px 16px rgba(37, 99, 235, .28); }
.as-ic svg { width: 22px; height: 22px; }
.as-head h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.2px; }
.as-sub { margin: 2px 0 0; color: var(--as-muted); font-size: .86rem; line-height: 1.4; }
.as-sub b { color: var(--ink2, #334155); font-weight: 700; }
.as-quota { margin-left: auto; text-align: right; font-size: .78rem; color: var(--as-muted); white-space: nowrap; }
.as-quota progress { display: block; width: 110px; height: 6px; margin: 4px 0 0 auto; border: 0; border-radius: 99px; overflow: hidden; background: #dbe4f0; appearance: none; }
.as-quota progress::-webkit-progress-bar { background: #dbe4f0; border-radius: 99px; }
.as-quota progress::-webkit-progress-value { background: var(--as-acc); border-radius: 99px; }
.as-quota progress::-moz-progress-bar { background: var(--as-acc); border-radius: 99px; }
.as-quota.low progress::-webkit-progress-value { background: #f59e0b; } .as-quota.low progress::-moz-progress-bar { background: #f59e0b; }

.as-body { padding: 16px 20px 20px; }

/* safe use guide */
.as-safe { border: 1px solid #d1fae5; background: #f0fdf8; border-radius: 12px; margin: 0 0 14px; font-size: .88rem; }
.as-safe summary { cursor: pointer; list-style: none; padding: 9px 12px; font-weight: 700; color: #0f766e; display: flex; align-items: center; gap: 8px; }
.as-safe summary::-webkit-details-marker { display: none; }
.as-safe summary svg { width: 16px; height: 16px; }
.as-safe summary::after { content: "▾"; margin-left: auto; opacity: .6; } .as-safe[open] summary::after { content: "▴"; }
.as-safe ul { margin: 0; padding: 0 14px 10px 32px; color: #134e4a; } .as-safe li { margin: 3px 0; }

/* modes */
.as-label { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--as-muted); margin: 4px 0 8px; }
.as-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; margin-bottom: 14px; }
.as-mode { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; background: #fff; border: 1.5px solid var(--as-line); border-radius: 12px; padding: 9px 11px; font: inherit; cursor: pointer; color: var(--ink, #0f172a); transition: border-color .12s, box-shadow .12s, background .12s; }
.as-mode:hover { border-color: #bfd3fe; }
.as-mode svg { width: 18px; height: 18px; color: var(--as-acc); }
.as-mode b { font-size: .88rem; } .as-mode small { font-size: .74rem; color: var(--as-muted); line-height: 1.3; }
.as-mode[aria-pressed="true"] { border-color: var(--as-acc); background: var(--as-acc-l); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.as-mode[aria-pressed="true"] b { color: var(--as-acc-d); }

/* level */
.as-level { display: inline-flex; background: #eef2f7; padding: 4px; border-radius: 999px; gap: 2px; margin-bottom: 14px; }
.as-level button { border: 0; background: transparent; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink2, #334155); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.as-level button[aria-checked="true"] { background: #fff; color: var(--as-acc-d); font-weight: 800; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.as-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* thread */
.as-thread { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 14px; max-height: 560px; overflow-y: auto; scroll-behavior: smooth; }
.as-empty { text-align: center; border: 1.5px dashed var(--as-line); border-radius: 14px; padding: 18px 14px; color: var(--as-muted); font-size: .9rem; }
.as-empty p { margin: 0 0 10px; }
.as-sugg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.as-chip { border: 1px solid #cfe0ff; background: var(--as-acc-l); color: var(--as-acc-d); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; text-align: left; line-height: 1.35; }
.as-chip:hover { background: #e0ebff; }
.as-msg { max-width: 92%; border-radius: 16px; padding: 11px 14px; line-height: 1.6; font-size: .95rem; }
.as-msg.me { align-self: flex-end; background: var(--as-acc); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.as-msg.me .as-mode-tag { display: block; font-size: .72rem; opacity: .8; margin-bottom: 2px; }
.as-msg.ai { align-self: flex-start; background: #f8fafc; border: 1px solid var(--as-line); border-bottom-left-radius: 6px; }
.as-msg.ai.fixed { background: #f1f5f9; }
.as-msg.ai.safety { background: #fff7ed; border-color: #fed7aa; }
.as-msg.ai.safety.selfharm { background: #fdf2f8; border-color: #f9a8d4; }
.as-msg.ai.fallback { background: #fffbeb; border-color: #fde68a; }
.as-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--as-muted); margin-bottom: 6px; }
.as-meta svg { width: 14px; height: 14px; }
.as-meta.safety { color: #9a3412; } .as-meta.selfharm { color: #9d174d; }
.as-text { white-space: pre-wrap; }
.as-para { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--as-line); } .as-para h3 { margin: 0 0 4px; font-size: .88rem; } .as-para p { margin: 0; font-size: .88rem; }
.as-src { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: .76rem; align-items: center; color: var(--as-muted); }
.as-src span { background: #eef2f7; color: var(--ink2, #334155); border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.as-fu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.as-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: .74rem; color: var(--as-muted); }
.as-foot button { margin-left: auto; border: 0; background: none; color: var(--as-muted); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; text-decoration: underline; }
.as-foot button:disabled { text-decoration: none; cursor: default; }

/* self-check */
.as-check { margin-top: 12px; background: #fff; border: 1px solid var(--as-line); border-radius: 12px; padding: 10px 12px; }
.as-check p { margin: 0 0 8px; font-weight: 700; font-size: .9rem; }
.as-opts { display: grid; gap: 6px; }
.as-opts button { text-align: left; border: 1.5px solid var(--as-line); background: #fff; border-radius: 10px; padding: 8px 11px; font: inherit; font-size: .88rem; cursor: pointer; }
.as-opts button:hover:enabled { border-color: #bfd3fe; }
.as-opts button.right { border-color: var(--good-bd, #86efac); background: var(--good-bg, #ecfdf3); color: var(--good, #15803d); font-weight: 700; }
.as-opts button.wrong { border-color: var(--bad-bd, #fca5a5); background: var(--bad-bg, #fef2f2); color: var(--bad, #b91c1c); }
.as-ckres { margin: 8px 0 0; font-size: .86rem; }

/* typing */
.as-typing { display: inline-flex; gap: 4px; align-items: center; color: var(--as-muted); font-size: .86rem; }
.as-typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: as-b 1s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: .15s; } .as-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes as-b { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .as-typing i { animation: none; } .as-thread { scroll-behavior: auto; } }

/* composer */
.as-compose { border: 1.5px solid var(--as-line); border-radius: 14px; background: #fff; transition: border-color .12s, box-shadow .12s; }
/* clearly visible focus (review-akademi-v3 L4): same 3 px ring as :focus-visible elsewhere, on the whole composer */
.as-compose:focus-within { border-color: var(--as-acc); box-shadow: 0 0 0 3px #93c5fd; }
.as-level button:focus-visible, .as-mode:focus-visible, .as-chip:focus-visible, .as-opts button:focus-visible, .as-send:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.as-compose textarea { display: block; width: 100%; border: 0; resize: vertical; min-height: 64px; max-height: 240px; padding: 12px 14px 4px; font: inherit; font-size: .95rem; background: transparent; color: var(--ink, #0f172a); outline: none; }
.as-cbar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 8px 14px; }
.as-hint { font-size: .76rem; color: var(--as-muted); } .as-count { font-size: .74rem; color: var(--as-muted); margin-left: auto; font-variant-numeric: tabular-nums; } .as-count.near { color: #b45309; }
.as-send { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 11px; padding: 9px 16px; font: inherit; font-weight: 800; font-size: .9rem; color: #fff; background: linear-gradient(135deg, #2563eb, #0ea5e9); cursor: pointer; box-shadow: 0 6px 14px rgba(37, 99, 235, .25); }
.as-send svg { width: 16px; height: 16px; } .as-send:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.as-warn { margin: 8px 0 0; border-radius: 10px; padding: 8px 12px; font-size: .84rem; background: var(--warn-bg, #fff7e6); color: var(--warn, #92400e); }
.as-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .76rem; color: var(--as-muted); }
.as-tools button { border: 0; background: none; font: inherit; font-size: .76rem; font-weight: 700; color: var(--as-muted); cursor: pointer; text-decoration: underline; }

@media (max-width: 640px) {
  .as-head { padding: 14px; flex-wrap: wrap; } .as-quota { margin-left: 58px; text-align: left; } .as-quota progress { margin: 4px 0 0; }
  .as-body { padding: 14px; }
  .as-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-mode small { display: none; }
  .as-msg { max-width: 100%; }
  .as-hint { display: none; }
}
.as .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; }
.as-opts button:disabled { opacity: 1; cursor: default; color: var(--ink2, #334155); }
.as-opts button.right:disabled { color: var(--good, #15803d); } .as-opts button.wrong:disabled { color: var(--bad, #b91c1c); }
