#ks-helper,.ks-dock,.ks-tour-note,.ks-tour-target {
  --ks-accent:var(--accent,#255acb);
  --ks-accent-dark:var(--accent-dark,#1a46a9);
  --ks-tint:var(--accent2,#eaf0ff);
  --ks-accent-line:#c4d1ec;
  --ks-surface:var(--card,#fff);
  --ks-page:var(--bg,#fbf9f5);
  --ks-text:var(--ink,#2b2622);
  --ks-muted:var(--muted,#716d68);
  --ks-line:var(--line,#e8e1d8);
}
#ks-helper{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:70;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ks-text);isolation:isolate}
#ks-helper * { box-sizing: border-box; }
#ks-helper[hidden], #ks-helper [hidden] { display: none !important; }

/* The character and its dismiss control stay separate pointer targets. */
.ks-dock {
  --ks-size: 112px;
  --ks-right: 14px;
  --ks-bottom: 12px;
  position: fixed;
  z-index: 65;
  --ks-dock-inset: max(var(--ks-right), env(safe-area-inset-right));
  right: var(--ks-dock-inset);
  bottom: max(var(--ks-bottom), env(safe-area-inset-bottom));
  width: var(--ks-size);
  height: var(--ks-size);
  pointer-events: none;
}
.ks-dock[data-collapsed="false"] {
  bottom: max(calc(var(--ks-bottom) - 6px), env(safe-area-inset-bottom, 0px));
}
.ks-dock-greeting {
  --ks-bubble-max: 270px;
  position: absolute;
  right: calc(85% + 5px);
  bottom: 28%;
  box-sizing: border-box;
  width: var(--ks-bubble-max);
  max-width: calc(100vw - var(--ks-dock-inset) - 85% - 5px - max(10px, env(safe-area-inset-left)));
  padding: 10px 14px;
  border: 1px solid #e2d7cb;
  border-radius: 16px;
  background: #fffdf9;
  color: #493d35;
  box-shadow: 0 3px 12px rgb(61 40 26 / 10%);
  font: 600 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  pointer-events: auto;
}
.ks-dock-greeting::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 55%;
  width: 7px;
  height: 7px;
  border-top: 1px solid #e2d7cb;
  border-right: 1px solid #e2d7cb;
  background: inherit;
  transform: rotate(45deg);
}
.ks-dock[hidden], .ks-dock [hidden], button.ks-header-entry[hidden] { display: none !important; }
.ks-dock button {
  appearance: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.ks-dock[data-collapsed="true"] {
  width: max-content;
  height: 44px;
}
.ks-dock .ks-dock-restore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d8c4b8;
  border-radius: 24px;
  background: #fffaf5;
  color: #5e382f;
  box-shadow: 0 2px 9px rgb(61 40 26 / 13%);
  font: 650 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
}
.ks-dock-restore .ks-return-icon {
  color: #8a574c;
  font: 500 19px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (hover: hover) {
  .ks-dock .ks-dock-restore:hover { border-color: #aa8776; background: #fff4ed; }
}
.ks-dock .ks-dock-open {
  position: absolute;
  inset: 0;
  overflow: visible;
  border-radius: 45% 45% 32% 32%;
}
.ks-dock-open .ks-mascot {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--ks-size);
  height: var(--ks-size);
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
  filter: saturate(1.3) contrast(1.08) drop-shadow(0 2px 3px rgb(70 44 29 / 13%));
}
.ks-dock .ks-dock-dismiss {
  position: absolute;
  right: -8px;
  top: -24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.ks-dock-dismiss span {
  display: grid;
  place-content: center;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 1px solid #d9cfc4;
  border-radius: 50%;
  background: #fffdf9;
  box-shadow: 0 1px 4px rgb(56 41 31 / 14%);
  color: #584d42;
  font: 500 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ks-dock-dismiss:hover span, .ks-dock-dismiss:focus-visible span { border-color: #88796b; }
.ks-dock button:focus-visible, button.ks-header-entry:focus-visible { outline: 2px solid var(--accent-dark, #1a46a9); outline-offset: 1px; }
.ks-header-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}
button.ks-header-entry {
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: var(--accent-dark, #1a46a9);
  font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  cursor: pointer;
}
button.ks-header-entry:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1360px) {
  body:not(:has(.header-logout)) .ks-header-brand { flex-direction: row; align-items: center; gap: 22px; }
}
@media (max-width: 620px), (max-height: 500px) {
  .ks-dock { --ks-size: 80px; --ks-right: 10px; --ks-bottom: 8px; }
  .ks-dock-greeting {
    --ks-bubble-max: 161px;
    padding: 8px 11px;
    border-radius: 14px;
    font-size: 13px;
  }
  .ks-dock .ks-dock-dismiss { top: -39px; right: -6px; }
  .ks-dock-dismiss span { width: 20px; height: 20px; font-size: 16px; transform: translateY(3px); }
  button.ks-header-entry { font-size: 12px; }
}
/* First opening: the same character greets the visitor beside a short introduction. */
.ks-welcome-scene {
  position: fixed;
  z-index: 70;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 4px 12px;
  box-sizing: border-box;
  width: min(392px, calc(100vw - 24px));
  padding: 18px 34px 14px 10px;
  border: 1px solid #e2d7cb;
  border-radius: 24px;
  background: radial-gradient(ellipse at 0% 90%, #fbecde, transparent 64%), #fffdf9;
  box-shadow: 0 8px 32px rgb(61 40 26 / 16%);
  color: #49382e;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: ks-enter .2s ease-out;
}
.ks-welcome-scene[hidden] { display: none !important; }
.ks-welcome-character { grid-column: 1; grid-row: 1 / 4; }
.ks-welcome-character .ks-mascot { width: 100%; height: auto; aspect-ratio: 1; }
.ks-welcome-title, .ks-welcome-copy, .ks-welcome-skip { grid-column: 2; }
.ks-welcome-scene .ks-welcome-title {
  align-self: end;
  margin: 0;
  color: #483225;
  font: 700 19px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ks-welcome-scene .ks-welcome-copy {
  margin: 0;
  color: #655345;
  font: inherit;
}
.ks-welcome-scene button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  cursor: pointer;
}
.ks-welcome-scene .ks-welcome-skip {
  justify-self: start;
  min-height: 36px;
  color: #744a38;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ks-welcome-scene .ks-welcome-close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #76685e;
  font-size: 22px;
  line-height: 1;
}
.ks-welcome-scene button:focus-visible { outline: 2px solid var(--accent-dark,#1a46a9); outline-offset: -2px; }
@media (max-width: 620px), (max-height: 500px) {
  .ks-welcome-scene {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 2px 8px;
    padding: 14px 32px 9px 7px;
    border-radius: 20px;
  }
  .ks-welcome-scene .ks-welcome-title { font-size: 17px; }
  .ks-welcome-scene .ks-welcome-skip { min-height: 44px; }
  .ks-welcome-scene .ks-welcome-close { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .ks-welcome-scene { animation: none; }
}
/* Keep a finger-sized target around the compact mobile restore label. */
@media (max-width: 620px), (max-width: 960px) and (max-height: 500px) and (pointer: coarse) {
  .ks-dock .ks-dock-restore,
  .ks-dock .ks-dock-restore:hover {
    position: relative;
    isolation: isolate;
    gap: 0;
    min-height: 44px;
    padding: 0 9px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
  }
  .ks-dock-restore::before {
    content: "";
    position: absolute;
    inset: 7px 0;
    z-index: -1;
    pointer-events: none;
    border: 1px solid #d8c4b8;
    border-radius: 20px;
    background: #fffaf5;
    box-shadow: 0 1px 4px rgb(61 40 26 / 13%);
  }
  .ks-dock-restore .ks-return-icon { display: none; }
  .ks-dock .ks-dock-restore:focus-visible { outline: none; }
  .ks-dock-restore:focus-visible::before {
    outline: 2px solid var(--accent-dark, #1a46a9);
    outline-offset: 2px;
  }
}
#ks-helper button,#ks-helper input,#ks-helper a{font:inherit}#ks-helper button,#ks-helper a{-webkit-tap-highlight-color:transparent}#ks-helper button{cursor:pointer}#ks-helper button:focus-visible,#ks-helper a:focus-visible,#ks-helper input:focus-visible{outline:3px solid var(--ks-accent);outline-offset:3px}
.ks-greeting { margin: 0 0 4px; color: var(--ks-text); font-weight: 600; }
.ks-greeting-rest { visibility: hidden; }
.ks-dock-greeting.is-typing .ks-greeting-text::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 1em;
  margin: .18em 0 0 1px;
  background: currentColor;
}
.ks-mascot{width:124px;height:124px;display:block;filter:saturate(1.3) contrast(1.08) drop-shadow(0 5px 6px #202a3714);transform-origin:50% 85%}
.ks-panel{width:480px;max-width:calc(100vw - 32px);background:var(--ks-page);border:1px solid var(--ks-line);border-radius:24px;box-shadow:0 18px 60px #202a3726;overflow:hidden;display:flex;flex-direction:column;max-height:min(660px,calc(100dvh - max(16px,env(safe-area-inset-bottom)) - 16px));animation:ks-enter .2s ease-out}
.ks-header{display:flex;align-items:center;gap:10px;padding:9px 14px;background:#f6efe5;color:var(--ks-text);border-bottom:1px solid var(--ks-line)}
.ks-avatar{display:grid;place-items:center;width:64px;height:64px;border-radius:18px;background:#f7dbe3;color:#752c44;font-size:22px;flex-shrink:0}
.ks-avatar:empty::before,.ks-avatar:has(.ks-mascot[hidden])::before{content:"♡"}
.ks-avatar .ks-mascot{width:100%;height:100%}.ks-title{margin:0;font-size:16px;font-weight:750;line-height:1.3}.ks-subtitle{font-size:11px;color:#66594f;margin-top:3px}.ks-header-copy{flex:1}.ks-close{border:0;background:transparent;color:inherit;width:44px;height:44px;font-size:25px!important;border-radius:12px}
.ks-content{padding:18px 18px 12px;overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin}.ks-welcome{margin:0 0 14px;font-size:14px;line-height:1.6}.ks-quick{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ks-quick button{background:var(--ks-tint);border:1px solid var(--ks-accent-line);border-radius:13px;min-height:64px;text-align:left;padding:11px 12px;line-height:1.35;color:var(--ks-accent-dark);font-size:12px!important;font-weight:600!important;transition:background .15s,transform .15s}.ks-quick button:hover{background:#dce6fc;transform:translateY(-1px)}.ks-quick button span{display:block;font-size:18px;margin-bottom:3px;color:var(--ks-accent)}
.ks-log{display:flex;flex-direction:column;gap:10px;margin-top:14px}.ks-message{margin:0;padding:12px 14px;border-radius:15px;background:#fff;border:1px solid var(--ks-line);line-height:1.6;overflow-wrap:anywhere}.ks-message--user{align-self:flex-end;max-width:90%;background:var(--ks-tint);border:0;color:var(--ks-accent-dark)}.ks-message p{margin:0 0 8px}.ks-message p:last-child{margin-bottom:0}.ks-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:11px}.ks-action{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 12px;border:1px solid var(--ks-accent-line);border-radius:10px;text-decoration:none!important;background:var(--ks-surface)!important;color:var(--ks-accent-dark)!important;font-size:12px!important;font-weight:650!important;box-shadow:none!important}.ks-action--primary{background:var(--ks-accent)!important;color:#fff!important;border-color:var(--ks-accent)}
.ks-compose{display:flex;gap:8px;padding:12px 16px 10px;border-top:1px solid var(--ks-line);background:var(--ks-surface);flex-shrink:0}.ks-compose input{min-width:0;flex:1;width:100%;border:1px solid var(--ks-line);border-radius:12px;background:#fff;padding:11px 12px;font-size:16px!important;color:var(--ks-text)}.ks-send{width:44px;height:44px;border-radius:12px;border:0;background:var(--ks-accent);color:#fff;font-size:22px!important;flex-shrink:0}.ks-foot{display:flex;align-items:center;justify-content:space-between;padding:0 16px 12px;background:var(--ks-surface);gap:8px}.ks-foot button,.ks-foot a{border:0;background:none;padding:4px 0;font-size:11px!important;color:var(--ks-muted)!important;text-decoration:none;min-height:28px}.ks-foot a{color:var(--ks-accent)!important}.ks-foot button:hover,.ks-foot a:hover{text-decoration:underline}
.ks-tour-target{outline:3px solid var(--ks-accent)!important;outline-offset:5px!important;box-shadow:0 0 0 8px #255acb18!important;scroll-margin:100px 0 240px}
.ks-tour-note{position:fixed;z-index:72;left:16px;bottom:max(20px,env(safe-area-inset-bottom));max-width:300px;width:calc(100vw - 150px);padding:14px 16px;background:var(--ks-surface);border:1px solid var(--ks-accent-line);border-radius:18px;box-shadow:0 6px 30px #202a3726;font:13px/1.5 -apple-system,BlinkMacSystemFont,Arial,sans-serif;color:var(--ks-text)}.ks-tour-note strong{display:block;margin-bottom:4px}.ks-tour-note button{margin-top:8px;min-height:40px;padding:8px 12px;border:0;border-radius:9px;color:#fff;background:var(--ks-accent);font:inherit;cursor:pointer}
@keyframes ks-breathe{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-3px) rotate(1deg)}}@keyframes ks-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(max-width:600px){#ks-helper{right:10px;bottom:max(8px,env(safe-area-inset-bottom))}.ks-mascot{width:88px;height:88px}.ks-panel{width:480px;max-width:calc(100vw - 20px);max-height:calc(100dvh - max(8px,env(safe-area-inset-bottom)) - 8px);border-radius:22px}.ks-header{padding:10px 10px 10px 16px}.ks-content{padding:14px}.ks-quick button{min-height:58px}.ks-tour-note{bottom:16px}}
@media(max-height:500px){.ks-panel{max-height:calc(100dvh - 32px);margin-bottom:0}.ks-content{min-height:60px}.ks-mascot{width:74px;height:74px}}
@media(prefers-reduced-motion:reduce){#ks-helper *,#ks-helper{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.ks-memory-note{flex-shrink:0;padding:5px 14px;font-size:10px;color:var(--ks-muted);border-bottom:1px solid var(--ks-line)}
.ks-history-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.ks-history-nav button{font:inherit;font-size:11px!important;color:var(--ks-accent);background:none;border:1px solid var(--ks-line);border-radius:9px;padding:7px 10px;cursor:pointer;min-height:32px}
.ks-memory-note[hidden],.ks-history-nav[hidden],.ks-history-nav button[hidden]{display:none}
/* v8 conversation layout. Mascot artwork, colors and animation sizing stay unchanged. */
.ks-header,.ks-foot{flex-shrink:0}.ks-header-copy{min-width:0}.ks-header .ks-reset{display:grid;place-items:center;width:36px;height:40px;border:0;border-radius:10px;background:transparent;color:inherit;font-size:22px!important;flex-shrink:0}.ks-close{flex-shrink:0}
#ks-helper button:disabled{cursor:default;opacity:.55}#ks-helper[data-busy=true] [data-chat-send],#ks-helper[data-busy=true] .ks-quick button{cursor:wait}.ks-compose input[readonly]{background:var(--ks-page)}.ks-content{scroll-behavior:auto;outline-offset:-4px!important}.ks-message{min-width:0;max-width:100%;flex-shrink:0}.ks-message-text{white-space:pre-wrap}.ks-message--user{white-space:pre-wrap}.ks-message .ks-courses{display:grid;gap:12px;margin-top:12px}.ks-message .ks-courses:first-child{margin-top:0}
.ks-course{min-width:0;overflow:hidden;border:1px solid var(--ks-line);border-radius:13px;background:var(--ks-surface);padding:12px}.ks-course-top{display:flex;align-items:center;gap:12px;margin-bottom:12px}.ks-course-cover{position:relative;width:88px;height:88px;flex:0 0 88px;border-radius:10px;background:var(--ks-tint);overflow:hidden;display:grid;place-items:center}.ks-cover-fallback{font-size:32px;color:var(--ks-accent)}.ks-course-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}.ks-course-heading{min-width:0;flex:1}.ks-course h3{margin:0 0 5px;font-size:15px;line-height:1.35;font-weight:750;color:var(--ks-text);overflow-wrap:anywhere}.ks-course .ks-course-price{margin:0;font-size:17px;line-height:1.3;font-weight:750;color:var(--ks-accent-dark);font-variant-numeric:tabular-nums}.ks-course :is(.ks-course-reason,.ks-course-description){margin:0 0 12px;padding:0 0 0 9px;border-left:2px solid var(--ks-accent-line);color:var(--ks-text);font-size:14px;line-height:1.5;overflow-wrap:anywhere}.ks-course-actions{display:flex;flex-wrap:wrap;gap:7px}.ks-course-actions .ks-action--primary{width:100%}.ks-course-actions button{flex:1;white-space:normal;line-height:1.35;padding:8px 9px}.ks-actions .ks-action{white-space:normal;line-height:1.35;text-align:center}.ks-action:hover{background:var(--ks-tint)!important;border-color:var(--ks-accent)}
.ks-action--primary:hover,.ks-send:not(:disabled):hover{background:var(--ks-accent-dark)!important;color:#fff!important}
.ks-header button:hover{background:var(--ks-line)}
#ks-helper .ks-header button:focus-visible{outline-color:var(--ks-text);outline-offset:-3px}
.ks-compose input:focus-visible{border-color:var(--ks-accent)}
.ks-compose input::placeholder{color:var(--ks-muted);opacity:1}
.ks-error p{color:#a23e33}
.ks-loading{display:flex;align-items:center;gap:8px;padding:2px 4px 2px 0;font-size:12px;color:var(--ks-muted);flex-shrink:0}
.ks-loading .ks-mascot{width:68px;height:68px;flex-shrink:0}.ks-loading button{margin-left:auto;border:0;border-radius:8px;padding:7px 6px;min-height:36px;background:transparent;color:var(--ks-muted);font-size:11px!important}.ks-loading button:hover{text-decoration:underline}.ks-error{background:#fff0ed;border:1px solid #ebc8c0;padding:12px 13px;border-radius:13px;font-size:12px;line-height:1.5;flex-shrink:0}.ks-error p{margin:0 0 8px}.ks-error .ks-action{min-height:36px;padding:7px 12px}.ks-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 16px;background:var(--ks-tint);border-top:1px solid var(--ks-line);font-size:12px;line-height:1.4;flex-shrink:0;max-height:110px;overflow:auto}.ks-notice button{border:1px solid var(--ks-accent-line);border-radius:8px;background:var(--ks-surface);color:var(--ks-accent-dark);min-height:36px;padding:6px 10px;flex-shrink:0}.ks-foot{flex-wrap:wrap}.ks-foot a,.ks-foot button{line-height:1.35}
@media(max-width:600px){.ks-content{padding:12px}.ks-header{gap:7px;padding-left:13px}.ks-avatar{width:54px;height:54px;border-radius:15px}.ks-title{font-size:15px}.ks-header .ks-reset{width:32px}.ks-close{width:44px}.ks-subtitle{font-size:11px}.ks-message{padding:11px 12px}.ks-quick button{padding:9px 10px;min-height:58px}.ks-course{padding:10px}.ks-course-top{gap:10px}.ks-course-cover{width:72px;height:72px;flex-basis:72px}.ks-course h3{font-size:14px;line-height:1.35}.ks-course .ks-course-price{font-size:16px}.ks-course :is(.ks-course-reason,.ks-course-description){font-size:13px}.ks-compose{padding:10px 12px 8px}.ks-compose input{padding:10px;font-size:16px!important}.ks-foot{padding:0 12px 10px;column-gap:10px;row-gap:0}.ks-foot button,.ks-foot a{font-size:10px!important}.ks-notice{padding:8px 12px}.ks-course-actions button{font-size:11px!important}.ks-loading{gap:6px}.ks-loading .ks-mascot{width:56px;height:56px}}


#ks-helper .ks-allowance { font: 500 13px/1.4 system-ui,sans-serif; background:#f0f5ff; color:#2b4380; padding:7px 14px; }
#ks-helper .ks-allowance a { color:#2449a5; text-decoration:underline; }
#ks-helper .ks-allowance[hidden], #ks-helper .ks-allowance a[hidden] { display:none; }
