/* Rakoon's chat panel (app/static/rakoon.js). Tokens from app.css :root only; logical properties, so he/ar and the rest
   share one sheet. Phones: a full-height sheet. From 720px (app.css's desktop breakpoint): a 400px panel docked at the
   inline-end side under the top bar, the page beside it stays usable. */

/* the round button */
.rk-fab { position: fixed; z-index: 25; inset-inline-end: max(16px, env(safe-area-inset-right));
  bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 18px); width: 60px; height: 60px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(var(--bg2), var(--bg2)) padding-box, var(--grad) border-box;
  box-shadow: 0 10px 30px rgba(214, 240, 60, .45), 0 0 0 5px rgba(15, 15, 20, .55);
  animation: rk-breathe 5s ease-in-out infinite, rk-glow 6s ease-in-out 2s infinite; transition: transform .16s ease, box-shadow .16s ease; }
/* a ring in the brand gradient that can expand from the button (the attention move; also a slow soft glow when idle) */
.rk-fab::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; background: var(--grad); opacity: 0; pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
.rk-fab.rk-wave { animation: rk-breathe 5s ease-in-out infinite; }
.rk-fab.rk-wave::after { animation: rk-ring 1.2s ease-out 2; }
.rk-fab.rk-wave .rk-fab-img { animation: rk-wave 1.4s ease-in-out 1; transform-origin: 50% 80%; }
@keyframes rk-glow { 0%, 88%, 100% { box-shadow: 0 10px 30px rgba(214, 240, 60, .45), 0 0 0 5px rgba(15, 15, 20, .55); }
  94% { box-shadow: 0 10px 34px rgba(214, 240, 60, .7), 0 0 0 5px rgba(15, 15, 20, .55), 0 0 28px 8px rgba(185, 226, 58, .35); } }
@keyframes rk-ring { 0% { transform: scale(1); opacity: .85; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes rk-wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-9deg); } 35% { transform: rotate(8deg); } 55% { transform: rotate(-7deg); } 75% { transform: rotate(5deg); } }
.rk-fab-img { width: 44px; height: 44px; display: block; pointer-events: none; }
.rk-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(214, 240, 60, .55), 0 0 0 5px rgba(15, 15, 20, .55); animation-play-state: paused; }
.rk-fab:active { transform: scale(.96); }
@keyframes rk-breathe { 0%, 80%, 100% { transform: scale(1); } 90% { transform: scale(1.06); } }
/* z-index 102: above the live player's tap-to-play layer (.ltap 100) and the caption handle (.capgrip 101) inside .eplayer */
/* the editor covers a phone's screen (rakoon.js sets .rk-covered while #ed is in #view); its top bar gets this small button instead */
.rk-ed-btn { display: none; position: absolute; z-index: 102; inset-block-start: 4px; inset-inline-end: 4px; width: 34px; height: 34px; padding: 2px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); border: 0; border-radius: 50%; background: var(--grad); cursor: pointer; }
.rk-ed-btn::after { content: ""; position: absolute; inset: -5px; }
.rk-ed-img { width: 100%; height: 100%; display: block; border-radius: 50%; background: var(--bg2); pointer-events: none; }
@media (max-width: 899px) { .rk-ed-btn { display: block; } .rk-fab.rk-covered { display: none; } }
@media (max-width: 719px) { body.rk-lift .rk-fab { bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 96px); } body.rk-lift .rk-bubble { bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 96px + 16px); } }   /* the new-video steps keep a Next bar above the tabs */
@media (min-width: 720px) { .rk-fab { bottom: 24px; } }

/* the panel */
.rk-panel { position: fixed; z-index: 50; inset-inline: 0; top: var(--rk-top, 0px); height: var(--rk-h, 100dvh); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg2), var(--bg) 220px); color: var(--text); overscroll-behavior: contain;
  animation: rk-up .22s ease-out; }
.rk-panel::before { content: ""; flex: none; height: 2px; background: var(--grad); }
@keyframes rk-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rk-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) {
  .rk-panel { inset-inline: auto; inset-inline-end: 0; width: 400px; border-inline-start: 1px solid var(--line);
    box-shadow: -18px 0 50px rgba(0, 0, 0, .35); animation-name: rk-in; }
  [dir="rtl"] .rk-panel { box-shadow: 18px 0 50px rgba(0, 0, 0, .35); animation-name: rk-in-rtl; }
  body.rk-docked { padding-inline-end: 400px; }
  /* half the screen when the customer widens it (.rk-wide in the head); the page beside it keeps the other half */
  .rk-panel.rk-wide-on { width: 50vw; }
  body.rk-docked.rk-wide-on { padding-inline-end: 50vw; }
  .rk-fab { inset-inline-end: 24px; }
}
.rk-ic.rk-wide { display: none; }
@media (min-width: 900px) { .rk-ic.rk-wide { display: grid; } .rk-wide[aria-pressed="true"] { color: var(--accent); } }
@keyframes rk-in-rtl { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* header */
.rk-head { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(54, 54, 66, .7); }
@media (min-width: 720px) { .rk-head { padding-top: 10px; } }
.rk-ring { flex: none; width: 44px; height: 44px; padding: 2px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 18px rgba(214, 240, 60, .4); }
.rk-ring-img { width: 100%; height: 100%; display: block; border-radius: 50%; background: var(--bg2); }
.rk-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rk-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; unicode-bidi: isolate; }
.rk-status { font-size: 13px; color: var(--muted); }
.rk-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 14px; color: var(--muted); cursor: pointer; }
.rk-ic:hover:not(:disabled) { background: var(--panel); color: var(--text); }

/* the conversation */
.rk-list { flex: 1; min-height: 0; overflow-y: auto; padding: 16px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.rk-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 4px 24px; max-width: 340px; }
.rk-hero { width: 96px; height: 96px; display: block; filter: drop-shadow(0 8px 24px rgba(214, 240, 60, .45)); }
.rk-hi { margin: 8px 0 0; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.rk-hi-sub { margin: 0 0 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.rk-sugg { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rk-chipbtn { min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-size: 14.5px; font-weight: 600; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.rk-chipbtn:hover { border-color: var(--accent); background: var(--panel2); }

.rk-msg { display: flex; align-items: flex-start; gap: 8px; animation: rk-pop .16s ease-out; }
.rk-me { justify-content: flex-end; }
.rk-av { flex: none; width: 30px; height: 30px; display: block; margin-top: 2px; }
.rk-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: min(88%, 520px); }
.rk-me .rk-col { align-items: flex-end; }
.rk-b { padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.rk-me .rk-b { background: var(--grad); color: var(--ink); border: 1px solid transparent;
  border-end-end-radius: 6px; }
.rk-bot .rk-b { background: var(--panel2); border: 1px solid var(--line); border-end-start-radius: 6px; }
@keyframes rk-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.rk-typing .rk-b { display: flex; gap: 5px; padding: 14px 16px; }
.rk-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: rk-dot 1.1s ease-in-out infinite; }
.rk-typing i:nth-child(2) { animation-delay: .15s; }
.rk-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rk-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.rk-errrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-inline: 38px 0; padding: 8px 12px; border-radius: 14px;
  background: rgba(255, 107, 129, .12); border: 1px solid rgba(255, 107, 129, .35); color: var(--text); font-size: 14px; }
.rk-retry { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; margin-block: -6px; background: none; border: 0; color: var(--accent);
  font-weight: 700; cursor: pointer; border-radius: 12px; }

/* a card: what Rakoon is going to do, and the tap that does it */
.rk-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: rk-pop .16s ease-out; }
.rk-card-t { font-weight: 800; font-size: 16px; }
.rk-rows { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rk-r { display: grid; grid-template-columns: minmax(70px, 34%) 1fr; gap: 10px; align-items: baseline; font-size: 14.5px; }
.rk-r dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.rk-r dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.rk-other { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 198, 92, .14); color: var(--warn); font-size: 12px; font-weight: 700; }
.rk-other[hidden] { display: none; }
.rk-show { align-self: flex-start; }
.rk-names { display: block; color: var(--muted); font-size: 13.5px; }
.rk-quote { margin: 0; padding: 4px 12px; border-inline-start: 3px solid var(--accent); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.rk-card-err { margin: 0; color: var(--bad); font-size: 14px; }
.rk-acts { display: flex; gap: 8px; }
.rk-acts .btn { flex: 1; min-height: 46px; padding: 10px 14px; }
.rk-acts .rk-go { flex: 2; }
.rk-done { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; }
.rk-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* the composer */
.rk-foot { flex: none; padding: 8px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid var(--line); background: rgba(21, 21, 28, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.rk-files { display: flex; flex-direction: column; gap: 6px; }
.rk-files:empty { display: none; }
/* "Start editing": the brand yellow (.btn.primary), the full width of the panel, shown only when every attached file is up (rakoon.js canStart) */
.rk-start { display: flex; inline-size: 100%; min-block-size: 52px; margin-block: 8px; justify-content: center; font-size: 17px; font-weight: 800; }
.rk-start[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .rk-start { animation: rk-start-in .28s ease-out; } }
@keyframes rk-start-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rk-note { margin: 0 0 2px; color: var(--warn); font-size: 13px; }
.rk-chip { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.rk-chip[data-state="err"] { border-color: rgba(255, 107, 129, .5); }
.rk-chip-ring { flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p, 0%), rgba(168, 163, 153, .25) 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
.rk-chip[data-state="done"] .rk-chip-ring { background: var(--ok); }
.rk-chip[data-state="err"] .rk-chip-ring { background: var(--bad); }
.rk-chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-chip-err { color: var(--bad); font-size: 13px; white-space: nowrap; }
.rk-chip-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 12px; }
.rk-chip-btn:hover { color: var(--text); background: var(--panel2); }
.rk-composer { display: flex; align-items: flex-end; gap: 6px; margin-block-start: 4px; }
.rk-ta { flex: 1; min-width: 0; min-height: 44px; max-height: 150px; resize: none; overflow-y: auto; padding: 10px 16px; border-radius: 22px; line-height: 22px;
  background: var(--panel); border: 1px solid var(--line); font-size: 16px; }
.rk-ta:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(214, 240, 60, .2); }
.rk-send { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--grad); color: #15151c; box-shadow: 0 6px 18px rgba(214, 240, 60, .35); transition: transform .16s ease; }
.rk-send:active:not(:disabled) { transform: scale(.94); }
.rk-send:disabled { background: var(--panel2); color: var(--muted); box-shadow: none; cursor: default; }
[dir="rtl"] .rk-send svg { transform: scaleX(-1); }                         /* the arrow points the way the text runs */

/* the line on the new-video screen */
.rk-entry { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line);
  box-shadow: inset 0 2px 0 rgba(214, 240, 60, .35); }
.rk-entry-img { flex: none; width: 40px; height: 40px; }
.rk-entry-t { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.35; }
.rk-entry-btn { flex: none; min-height: 44px; }
@media (max-width: 420px) { .rk-entry { flex-wrap: wrap; } .rk-entry-btn { width: 100%; } }

.rk-toast { position: fixed; z-index: 60; inset-inline: 12px; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); max-width: 420px; margin-inline: auto;
  padding: 12px 16px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .rk-fab, .rk-fab.rk-wave, .rk-fab.rk-wave::after, .rk-fab.rk-wave .rk-fab-img, .rk-panel, .rk-msg, .rk-card, .rk-typing i { animation: none !important; }
  .rk-fab, .rk-send, .rk-chipbtn { transition: none !important; }
  .rk-list { scroll-behavior: auto; }
}

/* dragging files over the panel */
.rk-dz { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px;
  background: rgba(15, 15, 20, .9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; animation: rk-pop .16s ease-out; }
.rk-dz[hidden] { display: none; }
.rk-dz-ring { position: absolute; inset: 12px; }
.rk-dz-svg { display: block; width: 100%; height: 100%; }
.rk-dz-img { width: 84px; height: 84px; filter: drop-shadow(0 8px 24px rgba(214, 240, 60, .5)); }
.rk-dz-t { font-size: 19px; font-weight: 800; text-align: center; }
.rk-fab-over { transform: scale(1.12); box-shadow: 0 14px 38px rgba(214, 240, 60, .7), 0 0 0 5px rgba(15, 15, 20, .55); }
@media (prefers-reduced-motion: reduce) { .rk-dz { animation: none !important; } }

/* the notice that Rakoon is an AI, under the suggestions on the opening screen */
.rk-ai-note { margin: 18px auto 0; max-width: 34ch; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }

/* the speech bubble by the round button: the panel's dark glass, a thin gradient border, a tail toward the mascot */
.rk-bubble { position: fixed; z-index: 26; inset-inline-end: calc(max(16px, env(safe-area-inset-right)) + 72px);
  bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 18px + 16px); width: max-content; max-width: min(260px, calc(100vw - 112px));
  border: 1px solid transparent; border-radius: 18px; border-end-end-radius: 6px;
  background: linear-gradient(rgba(28, 28, 37, .94), rgba(28, 28, 37, .94)) padding-box, var(--grad) border-box;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 0 24px rgba(214, 240, 60, .25);
  transform-origin: right bottom; animation: rk-bubble-in .28s ease-out; }
[dir="rtl"] .rk-bubble { transform-origin: left bottom; }
.rk-bubble[hidden] { display: none; }
.rk-bubble::after { content: ""; position: absolute; inset-inline-end: -7px; bottom: 16px; width: 12px; height: 12px; background: rgb(28, 28, 37);
  border-block-start: 1px solid var(--accent); border-inline-end: 1px solid var(--accent); transform: rotate(45deg); }
[dir="rtl"] .rk-bubble::after { transform: rotate(-45deg); }
.rk-bubble-main { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: start; padding: 12px 44px 13px 16px; padding-inline: 16px 44px;
  background: none; border: 0; border-radius: inherit; color: var(--text); cursor: pointer; }
.rk-bubble-t { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.rk-bubble-s { font-size: 14px; line-height: 1.45; color: var(--muted); }
.rk-bubble-x { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; }
.rk-bubble-x::after { content: ""; position: absolute; inset: -6px; }
.rk-bubble-x:hover { color: var(--text); background: var(--panel2); }
.rk-bubble-x svg { width: 16px; height: 16px; }
@keyframes rk-bubble-in { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
body.rk-docked .rk-bubble { display: none; }
@media (prefers-reduced-motion: reduce) { .rk-bubble, .rk-fab::after, .rk-fab-img { animation: none !important; } .rk-fab { animation: none !important; } }
@media (min-width: 720px) { .rk-bubble { bottom: 40px; inset-inline-end: 96px; } }

/* tokens (stage 3): the out-of-tokens note in the conversation, the estimate on a card */
.rk-sys { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 4px 0; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5;
  background: rgba(185, 226, 58, .07); border: 1px solid rgba(185, 226, 58, .25); color: var(--text); }
.rk-sys .rk-link { min-height: 36px; }
.rk-est { padding: 8px 12px; border-radius: 12px; font-size: 14.5px; background: rgba(185, 226, 58, .07); border: 1px solid rgba(185, 226, 58, .25); }
.rk-est[hidden] { display: none; }
.rk-est.short { background: rgba(255, 107, 129, .1); border-color: rgba(255, 107, 129, .35); }
.rk-est-s { margin: 2px 0 0; }
.rk-est-note { margin: 0; }
.rk-est-note .tklink { margin-inline-start: 6px; font-weight: 700; white-space: nowrap; }

/* Rakoon stays with the video: progress in the card, the ready and failed rows, the dot, the editor's opening line. Written by the page
   from a job's state and a checked number (rakoon.js "accompaniment"); constant translated text only. */
.rk-sugg[hidden], .rk-hi-sub[hidden] { display: none; }
.rk-watch { display: flex; flex-direction: column; gap: 8px; }
.rk-bar { height: 8px; border-radius: 999px; background: rgba(168, 163, 153, .25); overflow: hidden; }
.rk-bar > i { display: block; height: 100%; width: var(--p, 0%); min-width: 8px; border-radius: inherit; background: var(--grad); transition: width .6s ease; }
.rk-watch-t { color: var(--muted); font-size: 14px; }
.rk-ready { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(185, 226, 58, .08); border: 1px solid rgba(185, 226, 58, .32); }
.rk-ready-t { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.rk-ready-t b { font-weight: 800; }
.rk-ready-t .rk-done-ic { flex: none; color: var(--ok); }
.rk-ready-s { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.rk-ready-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-ready-acts .btn { flex: 1 1 auto; min-height: 46px; padding: 10px 14px; justify-content: center; text-align: center; }
.rk-ready .btn[hidden] { display: none; }
.rk-ready-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-ready-chips .rk-chipbtn { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.rk-failed-box { display: flex; flex-direction: column; gap: 6px; }
.rk-failed { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.5;
  background: rgba(255, 107, 129, .1); border: 1px solid rgba(255, 107, 129, .35); }
.rk-failed-ic { flex: none; color: var(--bad); margin-block-start: 1px; }
/* the dot: on the round button and on the editor's small button while a note about a video has not been seen */
.rk-dot::before { content: ""; position: absolute; z-index: 2; inset-block-start: -3px; inset-inline-end: -3px; width: 18px; height: 18px; box-sizing: border-box;
  border-radius: 50%; background: var(--bad); border: 3px solid var(--bg2); pointer-events: none; }
.rk-ed-btn.rk-dot::before { inset-block-start: -4px; inset-inline-end: -4px; width: 14px; height: 14px; border-width: 2px; }
@media (prefers-reduced-motion: reduce) { .rk-bar > i { transition: none !important; } }

/* the website lookup: the waiting text, the page-written "Rakoon looked at ..." line, a colour swatch on a card. Colours are the app's tokens;
   the swatch's own colour is set by rakoon.js through the CSSOM (never from this file). */
.rk-looking .rk-b { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.rk-wait-t { color: var(--muted); font-size: 14.5px; }
.rk-dots { display: inline-flex; gap: 5px; }
.rk-sys.rk-web { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; font-size: 14px; color: var(--muted); align-self: flex-start; max-inline-size: 100%; }
.rk-web-ic { flex: none; display: inline-flex; color: var(--accent); }
.rk-web-t { min-inline-size: 0; overflow-wrap: anywhere; }
.rk-site { color: var(--text); font-weight: 700; unicode-bidi: isolate; direction: ltr; }
.rk-colordd { display: flex; align-items: center; gap: 8px; }
.rk-swatch { flex: none; inline-size: 18px; block-size: 18px; border-radius: 50%; border: 2px solid var(--text); box-shadow: 0 0 0 1px var(--bg); }
.rk-hex { unicode-bidi: plaintext; }

/* Rakoon's replies (rakoon.js "reply renderer"): light Markdown drawn as plain elements. Every class here starts with rkr-, a namespace of its own: nothing
   a reply can produce looks like a card, a note, a row of the accompaniment or a button (those are rk-). Colours inside a reply are set by rakoon.js through
   the CSSOM (swatch()); the hairline around a swatch keeps a black or a white one visible on the bubble. */
.rk-b.rkr { display: flex; flex-direction: column; gap: 11px; white-space: normal; padding: 13px 16px 14px; font-size: 15.5px; line-height: 1.62; }
.rkr-p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rkr-h { margin: 4px 0 -3px; font-size: 16.5px; font-weight: 800; line-height: 1.4; letter-spacing: -.01em; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rkr-h:first-child { margin-block-start: 0; }
.rkr strong { font-weight: 700; color: var(--text); }
.rkr em { font-style: italic; }
.rkr-code { padding: 1px 6px; border-radius: 6px; background: rgba(243, 239, 230, .1); font-weight: 600; unicode-bidi: isolate; }
.rkr-hex { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; direction: ltr; unicode-bidi: isolate; font-weight: 700; letter-spacing: .02em; }

.rkr-chip { display: inline-flex; align-items: center; gap: 6px; padding-block: 0; padding-inline: 4px 8px; margin-block: 1px; border-radius: 9px; vertical-align: middle; line-height: 1.5;
  background: rgba(243, 239, 230, .07); border: 1px solid rgba(243, 239, 230, .14); font-size: .92em; white-space: nowrap; unicode-bidi: isolate; }
.rkr-sw { display: inline-block; flex: none; inline-size: 16px; block-size: 16px; border-radius: 5px; border: 1px solid rgba(243, 239, 230, .42); }
.rkr-sw-l { inline-size: 36px; block-size: 36px; border-radius: 11px; }

.rkr-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rkr-li { position: relative; padding-inline-start: 22px; overflow-wrap: anywhere; white-space: pre-line; unicode-bidi: isolate; }
.rkr-ul > .rkr-li::before { content: ""; position: absolute; inset-inline-start: 5px; inset-block-start: .78em; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--muted); }
.rkr-ol { counter-reset: rkr; }
.rkr-ol > .rkr-li { counter-increment: rkr; padding-inline-start: 33px; min-block-size: 24px; }
.rkr-ol > .rkr-li::before { content: counter(rkr); position: absolute; inset-inline-start: 0; inset-block-start: .12em; display: grid; place-items: center; inline-size: 24px; block-size: 24px;
  border-radius: 50%; background: rgba(243, 239, 230, .1); color: var(--text); font-size: 12.5px; font-weight: 800; line-height: 1; }

/* a list of colours: one row each, swatch, then the code and what the colour is */
.rkr-cl { gap: 7px; }
.rkr-crow { display: flex; align-items: center; gap: 12px; padding-block: 8px; padding-inline: 10px 12px; border-radius: 14px; background: rgba(243, 239, 230, .05);
  border: 1px solid rgba(243, 239, 230, .09); unicode-bidi: isolate; }
.rkr-cbody { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 1px; }
.rkr-cbody > .rkr-hex { align-self: flex-start; font-size: 14.5px; }
.rkr-cd { color: var(--muted); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.rkr-cd strong, .rkr-cd .rkr-code { color: var(--text); }

/* questions: a soft card, one row each, a number; the customer sees what is being asked. A tap only moves the cursor to the message box. */
.rkr-q { padding: 2px 14px; border-radius: 16px; background: rgba(185, 226, 58, .06); border: 1px solid rgba(185, 226, 58, .24); cursor: pointer; }
.rkr-ql { gap: 0; }
.rkr-ql > .rkr-li { padding-block: 11px; padding-inline-start: 36px; }
.rkr-ql > .rkr-li + .rkr-li { border-block-start: 1px solid rgba(243, 239, 230, .09); }
.rkr-ql > .rkr-li::before { inset-block-start: 11px; background: rgba(185, 226, 58, .2); }

@media (max-width: 719px) {
  .rk-list { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .rk-bot .rk-col { max-inline-size: calc(100% - 37px); }
  .rk-av { inline-size: 28px; block-size: 28px; }
}

/* the palette of a website lookup: the page's own card (from the server's `web.colors`), a row of larger swatches with their codes */
.rk-sys.rk-web.rk-pal { flex-wrap: wrap; align-items: center; gap: 10px 8px; padding: 12px 14px 14px; align-self: stretch; max-inline-size: 100%; margin-inline-start: 37px; }
.rk-pal-body { flex: 0 0 100%; display: flex; flex-direction: column; gap: 10px; }
.rk-pal-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px 10px; }
.rk-pal-sw { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0; margin: 0; background: none; border: 0; border-radius: 12px; color: var(--text); font: inherit; text-align: center; }
button.rk-pal-sw { cursor: pointer; }
.rk-pal-chip { display: block; block-size: 44px; border-radius: 12px; border: 1px solid rgba(243, 239, 230, .42); transition: transform .16s ease; }
button.rk-pal-sw:hover .rk-pal-chip { transform: translateY(-2px); }
button.rk-pal-sw:active .rk-pal-chip { transform: scale(.96); }
.rk-pal-hex { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.rk-pal-sw.rk-copied .rk-pal-hex { color: var(--ok); }
.rk-pal-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .rk-pal-chip { transition: none !important; } }

/* the question card (rakoon.js "question card"): Rakoon's questions one at a time, under its reply. Classes rk-ask* are the page's own; text from the model reaches them
   through textContent only, and nothing here is built from it. The foot sticks to the bottom of the list while the card is on screen, so the primary control stays in reach. */
.rk-sr { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.rk-ask { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: inset 0 2px 0 rgba(214, 240, 60, .45), 0 8px 24px rgba(0, 0, 0, .25); animation: rk-pop .16s ease-out; }
.rk-ask-in { display: flex; flex-direction: column; min-inline-size: 0; }
.rk-ask-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px 4px; }
.rk-ask-who { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-inline-size: 0; font-size: 14px; color: var(--accent); }
.rk-ask-who b { font-weight: 800; letter-spacing: -.01em; }
.rk-ask-av { flex: none; inline-size: 24px; block-size: 24px; display: block; }
.rk-ask-prog { color: var(--muted); font-size: 13px; font-weight: 700; unicode-bidi: plaintext; }
.rk-ask-dots { flex: 0 0 100%; display: flex; gap: 6px; padding-block-start: 4px; }
.rk-ask-dots i { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: rgba(168, 163, 153, .3); transition: inline-size .2s ease, background .2s ease; }
.rk-ask-dots i.ans { background: rgba(185, 226, 58, .6); }
.rk-ask-dots i.skip { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); }
.rk-ask-dots i.cur { inline-size: 22px; background: var(--accent); box-shadow: none; }
.rk-ask-step { display: flex; flex-direction: column; gap: 10px; padding: 10px 14px 0; animation: rk-pop .16s ease-out; }
.rk-ask-q { margin: 2px 0 0; font-size: 17px; font-weight: 800; line-height: 1.42; letter-spacing: -.01em; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rk-ask-hint { margin: -6px 0 0; color: var(--muted); font-size: 13px; }
.rk-ask-opts { display: flex; flex-direction: column; gap: 6px; }
.rk-ask-opt { display: flex; align-items: center; gap: 12px; inline-size: 100%; min-block-size: 48px; padding: 8px 14px; text-align: start; font: inherit; font-size: 15.5px; line-height: 1.4;
  color: var(--text); cursor: pointer; background: rgba(243, 239, 230, .05); border: 1px solid var(--line); border-radius: 14px; transition: border-color .16s ease, background .16s ease; }
.rk-ask-opt:hover { border-color: rgba(214, 240, 60, .55); background: rgba(243, 239, 230, .08); }
.rk-ask-opt[aria-checked="true"] { border-color: var(--accent); background: rgba(185, 226, 58, .13); }
.rk-ask-opt-other .rk-ask-ot { color: var(--muted); }
.rk-ask-opt-other[aria-checked="true"] .rk-ask-ot { color: var(--text); }
.rk-ask-mark { flex: none; inline-size: 24px; block-size: 24px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--muted); color: transparent; transition: background .16s ease, border-color .16s ease; }
.rk-ask-mark.sq { border-radius: 8px; }
.rk-ask-ck { display: grid; place-items: center; }
.rk-ask-ck svg { inline-size: 15px; block-size: 15px; }
.rk-ask-opt[aria-checked="true"] .rk-ask-mark { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.rk-ask-ot { flex: 1; min-inline-size: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rk-ask-sw { flex: none; display: inline-block; inline-size: 26px; block-size: 26px; border-radius: 8px; border: 1px solid rgba(243, 239, 230, .42); }
.rk-ask-hex { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; font-size: 14px; font-weight: 700; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.rk-ask-other { display: flex; flex-direction: column; gap: 6px; }
.rk-ask-other[hidden] { display: none; }
.rk-ask-input { inline-size: 100%; min-block-size: 48px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; }
.rk-ask-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(214, 240, 60, .2); }
.rk-ask-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.rk-ask-long { color: var(--warn); }
.rk-ask-foot { position: sticky; inset-block-end: 0; z-index: 1; display: flex; gap: 8px; margin-inline: -14px; padding: 10px 14px 12px; background: var(--panel);
  border-block-start: 1px solid rgba(54, 54, 66, .7); border-end-start-radius: var(--r); border-end-end-radius: var(--r); }
.rk-ask-foot .btn { flex: 1 1 0; min-inline-size: 0; min-block-size: 46px; padding: 10px 10px; font-size: 15px; }
.rk-ask-foot .rk-ask-next, .rk-ask-foot .rk-ask-send { flex: 1.6 1 0; }
.rk-ask-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rk-ask-row { display: flex; align-items: center; gap: 10px; inline-size: 100%; min-block-size: 52px; padding: 9px 12px; text-align: start; font: inherit; color: var(--text);
  background: rgba(243, 239, 230, .05); border: 1px solid rgba(243, 239, 230, .09); border-radius: 14px; }
button.rk-ask-row { cursor: pointer; transition: border-color .16s ease; }
button.rk-ask-row:hover { border-color: rgba(214, 240, 60, .55); }
.rk-ask-rb { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.rk-ask-rq { color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rk-ask-ra { font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rk-ask-ra.none { color: var(--muted); font-style: italic; }
.rk-ask-edit { flex: none; display: inline-flex; color: var(--muted); }
.rk-ask[data-state="sent"] .rk-ask-in, .rk-ask[data-state="closed"] .rk-ask-in { padding-block-end: 12px; }
.rk-ask[data-state="sent"] .rk-ask-sum, .rk-ask[data-state="closed"] .rk-ask-sum { padding: 8px 14px 0; }
.rk-ask[data-state="closed"] { opacity: .85; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.rk-ask-status { display: flex; align-items: center; gap: 6px; padding: 10px 14px 0; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.rk-ask-sent-ic { display: inline-flex; color: var(--ok); }
.rk-ask-sent-ic svg { inline-size: 18px; block-size: 18px; }
/* the answers as the customer's own bubble: the question muted, the answer in the normal weight */
.rk-b.rk-qa { display: flex; flex-direction: column; gap: 10px; white-space: normal; }
.rk-qa-p { display: flex; flex-direction: column; gap: 1px; }
.rk-qa-q { font-size: 13.5px; line-height: 1.4; color: rgba(21, 21, 28, .68); overflow-wrap: anywhere; unicode-bidi: isolate; }
.rk-qa-a { font-size: 15.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; unicode-bidi: isolate; }
@media (prefers-reduced-motion: reduce) { .rk-ask, .rk-ask-step { animation: none !important; } .rk-ask-opt, .rk-ask-mark, .rk-ask-dots i, button.rk-ask-row { transition: none !important; } }
/* read-only (sent or closed): the same list, quieter and shorter */
.rk-ask[data-state="sent"] .rk-ask-row, .rk-ask[data-state="closed"] .rk-ask-row { min-block-size: 0; padding: 6px 2px; background: none; border-color: transparent; border-radius: 0; border-block-end: 1px solid rgba(243, 239, 230, .09); }
.rk-ask[data-state="sent"] .rk-ask-sum, .rk-ask[data-state="closed"] .rk-ask-sum { gap: 0; }
.rk-ask[data-state="sent"] .rk-ask-ra, .rk-ask[data-state="closed"] .rk-ask-ra { font-size: 14.5px; }
.rk-col.rk-has-ask { flex: 1 1 auto; }                         /* the question card takes the width the column allows, not the width of the reply's text */
.rk-ask-step { padding-block-end: 4px; }

/* a change to several short videos: the ones left out (rakoon.js card, kind clips) */
.rk-skip { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); }
.rk-skip li { padding-block: 3px; overflow-wrap: anywhere; }
