/* ======================================================================
	Dark Neon
   ====================================================================== */

/* ------------------------------
   0) Scope root + reset (scoped)
------------------------------ */
.ai-kiosk-wrapper {
  /* containment = prevent layout/paint bleeding (portal-safe) */
  contain: layout paint style;
  isolation: isolate;

  /* sizing behavior */
  width: 100%;
  max-width: 100%;
  margin: 0;           /* 가운데 정렬 제거 */
  padding: 0;          /* 바깥 여백 제거 */
  flex: 1;
  

  flex: 1;              /* 부모가 flex일 때 확장 */
  min-height: 0;        /* flex 스크롤 허용 */
  display: flex;        /* 내부를 flex로 */

  width: 100%;
  max-width: 100%;

  margin: 0;
  padding: 0;

  background: transparent;


  /* typography baseline */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR",
    "Apple SD Gothic Neo", "Malgun Gothic", Arial, "Helvetica Neue", sans-serif;

  /* avoid inheriting crazy portal line-height */
  line-height: 1.35;

  /* allow portal background to show through if needed */
  background: transparent;

  /* prevents iOS tap highlight style issues inside kiosk */
  -webkit-tap-highlight-color: transparent;

  /* selection styling (scoped) */
  user-select: none;
}

.ai-kiosk-wrapper *,
.ai-kiosk-wrapper *::before,
.ai-kiosk-wrapper *::after {
  box-sizing: border-box;
}

.ai-kiosk-wrapper :where(h1, h2, h3, h4, h5, h6, p, figure) {
  margin: 0;
}

.ai-kiosk-wrapper :where(button, input) {
  font: inherit;
}

.ai-kiosk-wrapper :where(button) {
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
}

.ai-kiosk-wrapper :where(img, svg) {
  display: block;
  max-width: 100%;
}

/* allow text select only for chat content + input */
.ai-kiosk-wrapper :where(.ai-kiosk-answer-container, .ai-kiosk-msg-bubble, #aiInput) {
  user-select: text;
}

/* ------------------------------
   1) Theme tokens (scoped vars)
------------------------------ */
.ai-kiosk-wrapper {
  /* core palette */
  --k-bg-0: #070912;
  --k-bg-1: #0a0f1d;
  --k-bg-2: #0c1326;

  --k-surface-0: rgba(255, 255, 255, 0.04);
  --k-surface-1: rgba(255, 255, 255, 0.06);
  --k-surface-2: rgba(255, 255, 255, 0.09);

  --k-stroke-0: rgba(255, 255, 255, 0.08);
  --k-stroke-1: rgba(255, 255, 255, 0.12);
  --k-stroke-2: rgba(255, 255, 255, 0.18);

  --k-text-0: rgba(255, 255, 255, 0.92);
  --k-text-1: rgba(255, 255, 255, 0.78);
  --k-text-2: rgba(255, 255, 255, 0.62);
  --k-text-3: rgba(255, 255, 255, 0.46);

  /* neon accents */
  --k-neon-cyan: #34d7ff;
  --k-neon-violet: #a56bff;
  --k-neon-pink: #ff4fd8;
  --k-neon-lime: #66ffcc;
  --k-neon-amber: #ffcc66;

  /* semantic */
  --k-ok: #35ffb2;
  --k-warn: #ffd369;
  --k-bad: #ff5a7a;

  /* sizes */
  --k-radius-xxl: 22px;
  --k-radius-xl: 18px;
  --k-radius-lg: 14px;
  --k-radius-md: 12px;
  --k-radius-sm: 10px;

  --k-gap-xs: 8px;
  --k-gap-sm: 10px;
  --k-gap-md: 12px;
  --k-gap-lg: 14px;
  --k-gap-xl: 16px;

  --k-pad-sm: 10px;
  --k-pad-md: 12px;
  --k-pad-lg: 14px;
  --k-pad-xl: 16px;
  --k-pad-2xl: 18px;

  /* shadows (heavy GPU if too many) */
  --k-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --k-shadow-mid: 0 18px 44px rgba(0, 0, 0, 0.55);
  --k-shadow-hard: 0 28px 70px rgba(0, 0, 0, 0.68);

  /* glow */
  --k-glow-cyan: 0 0 26px rgba(52, 215, 255, 0.24);
  --k-glow-violet: 0 0 28px rgba(165, 107, 255, 0.20);
  --k-glow-pink: 0 0 28px rgba(255, 79, 216, 0.18);

  /* blur */
  --k-blur-sm: 10px;
  --k-blur-md: 14px;
  --k-blur-lg: 18px;

  /* animation */
  --k-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --k-dur-1: 140ms;
  --k-dur-2: 220ms;
  --k-dur-3: 360ms;

  /* layout (kiosk area) */
  --k-max-h: 88vh; /* keep inside portal; no global scroll lock */
  --k-min-h: 520px;

  /* header sizes */
  --k-header-h: 56px;

  /* sidebar width */
  --k-sidebar-w: 320px;

  /* input */
  --k-input-h: 52px;

  /* border style */
  --k-border: 1px solid var(--k-stroke-1);
}

/* Optional: “lite” mode inside kiosk (reduce GPU cost)
   Add class .kiosk-lite on .ai-kiosk-wrapper to reduce blurs/glows */
.ai-kiosk-wrapper.kiosk-lite {
  --k-blur-sm: 0px;
  --k-blur-md: 0px;
  --k-blur-lg: 0px;

  --k-glow-cyan: none;
  --k-glow-violet: none;
  --k-glow-pink: none;

  --k-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.45);
  --k-shadow-mid: 0 16px 34px rgba(0, 0, 0, 0.52);
  --k-shadow-hard: 0 22px 52px rgba(0, 0, 0, 0.62);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ai-kiosk-wrapper {
    --k-dur-1: 0ms;
    --k-dur-2: 0ms;
    --k-dur-3: 0ms;
  }
  .ai-kiosk-wrapper * {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
}

/* ------------------------------
   2) Dashboard shell (grid layout)
------------------------------ */
.ai-kiosk-dashboard {
  position: relative;
  width: 100%;
  min-height: var(--k-min-h);
  

  display: grid;
  grid-template-columns: var(--k-sidebar-w) 1fr;
  grid-template-rows: var(--k-header-h) 1fr;

  gap: var(--k-gap-lg);

  padding: var(--k-pad-xl);
  border-radius: var(--k-radius-xxl);

  /* glass panel */
  background:
    radial-gradient(1200px 560px at 18% -10%, rgba(52, 215, 255, 0.12), transparent 60%),
    radial-gradient(900px 560px at 92% 8%, rgba(165, 107, 255, 0.12), transparent 62%),
    radial-gradient(1100px 680px at 60% 110%, rgba(255, 79, 216, 0.08), transparent 64%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.10);

  box-shadow: var(--k-shadow-mid);
  backdrop-filter: blur(var(--k-blur-lg));
  -webkit-backdrop-filter: blur(var(--k-blur-lg));

  overflow: hidden; /* internal clipping only */
}

.ai-kiosk-dashboard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  /* subtle noise + vignette */
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.10), transparent 55%),
    radial-gradient(120% 100% at 50% 100%, rgba(0, 0, 0, 0.55), transparent 60%),
    linear-gradient(90deg, rgba(52, 215, 255, 0.08), transparent 28%, transparent 72%, rgba(165, 107, 255, 0.06));

  opacity: 0.55;
  mix-blend-mode: overlay;
}

.ai-kiosk-dashboard::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;

  /* aurora edge */
  background:
    linear-gradient(120deg,
      rgba(52, 215, 255, 0.16),
      rgba(165, 107, 255, 0.10),
      rgba(255, 79, 216, 0.12),
      rgba(102, 255, 204, 0.10)
    );
  filter: blur(22px);
  opacity: 0.22;
}

/* ------------------------------
   3) Header
------------------------------ */
.ai-kiosk-header {
  grid-column: 1 / -1;
  grid-row: 1;

  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-gap-md);

  padding: 10px 12px;
  border-radius: var(--k-radius-xl);

  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.10);

  box-shadow: var(--k-shadow-soft);
  backdrop-filter: blur(var(--k-blur-md));
  -webkit-backdrop-filter: blur(var(--k-blur-md));

  overflow: hidden;
}

.ai-kiosk-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 120px at 22% 20%, rgba(52, 215, 255, 0.16), transparent 60%),
    radial-gradient(700px 140px at 78% 30%, rgba(165, 107, 255, 0.14), transparent 62%);
  opacity: 0.8;
}

.ai-kiosk-title {
  position: relative;
  z-index: 1;

  display: inline-flex;
  align-items: baseline;
  gap: 10px;

  color: var(--k-text-0);
  font-weight: 820;
  letter-spacing: 0.2px;

  font-size: 16px;
  line-height: 1.1;

  text-shadow: 0 0 18px rgba(52, 215, 255, 0.18);
}

.ai-kiosk-controls {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--k-gap-sm);
  align-items: center;
}

/* Toggle button (voice) */
.ai-kiosk-btn-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 38px;
  padding: 0 14px;
  border-radius: 999px;

  color: var(--k-text-1);
  font-weight: 720;
  font-size: 13px;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(var(--k-blur-sm));
  -webkit-backdrop-filter: blur(var(--k-blur-sm));

  cursor: pointer;
  transition:
    transform var(--k-dur-1) var(--k-ease),
    background var(--k-dur-2) var(--k-ease),
    border-color var(--k-dur-2) var(--k-ease),
    color var(--k-dur-2) var(--k-ease),
    box-shadow var(--k-dur-2) var(--k-ease);
}

.ai-kiosk-btn-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--k-text-0);
}

.ai-kiosk-btn-toggle:active {
  transform: translateY(0px) scale(0.98);
}

.ai-kiosk-btn-toggle.active {
  color: rgba(255, 255, 255, 0.96);
  background:
    linear-gradient(180deg, rgba(52, 215, 255, 0.18), rgba(255, 255, 255, 0.06));
  border-color: rgba(52, 215, 255, 0.35);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.44),
    0 0 22px rgba(52, 215, 255, 0.18);
}

/* focus */
.ai-kiosk-btn-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(52, 215, 255, 0.22),
    0 0 0 1px rgba(52, 215, 255, 0.45),
    0 12px 26px rgba(0, 0, 0, 0.44);
}

/* ------------------------------
   4) Sidebar + menu grid
------------------------------ */
.ai-kiosk-sidebar {
  grid-column: 1;
  grid-row: 2;

  position: relative;
  border-radius: var(--k-radius-xl);

  padding: 12px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.26));
  border: 1px solid rgba(255, 255, 255, 0.10);

  box-shadow: var(--k-shadow-soft);
  backdrop-filter: blur(var(--k-blur-md));
  -webkit-backdrop-filter: blur(var(--k-blur-md));

  overflow: hidden;
}

.ai-kiosk-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 30% 10%, rgba(52, 215, 255, 0.10), transparent 62%),
    radial-gradient(520px 360px at 80% 28%, rgba(165, 107, 255, 0.10), transparent 64%);
  opacity: 0.9;
}

.ai-kiosk-menu-grid {
  position: relative;
  z-index: 1;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* menu buttons */
.ai-kiosk-menu-btn {
  position: relative;

  height: 46px;
  padding: 0 10px;

  border-radius: 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  color: var(--k-text-1);
  font-weight: 760;
  font-size: 13px;
  letter-spacing: 0.1px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(var(--k-blur-sm));
  -webkit-backdrop-filter: blur(var(--k-blur-sm));

  cursor: pointer;
  transition:
    transform var(--k-dur-1) var(--k-ease),
    background var(--k-dur-2) var(--k-ease),
    border-color var(--k-dur-2) var(--k-ease),
    color var(--k-dur-2) var(--k-ease),
    box-shadow var(--k-dur-2) var(--k-ease),
    filter var(--k-dur-2) var(--k-ease);
}

.ai-kiosk-menu-btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  pointer-events: none;

  background:
    linear-gradient(120deg,
      rgba(52, 215, 255, 0.00),
      rgba(52, 215, 255, 0.20),
      rgba(165, 107, 255, 0.20),
      rgba(255, 79, 216, 0.12),
      rgba(52, 215, 255, 0.00)
    );

  opacity: 0;
  filter: blur(8px);
  transition: opacity var(--k-dur-2) var(--k-ease);
}

.ai-kiosk-menu-btn:hover {
  transform: translateY(-1px);
  color: var(--k-text-0);
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.46),
    0 0 18px rgba(52, 215, 255, 0.08);
}

.ai-kiosk-menu-btn:hover::after {
  opacity: 0.55;
}

.ai-kiosk-menu-btn:active {
  transform: translateY(0px) scale(0.985);
}

.ai-kiosk-menu-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(52, 215, 255, 0.22),
    0 0 0 1px rgba(52, 215, 255, 0.45),
    0 14px 28px rgba(0, 0, 0, 0.46);
}

/* pressed state (JS can add .active) */
.ai-kiosk-menu-btn.active {
  color: rgba(255, 255, 255, 0.98);
  border-color: rgba(52, 215, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(52, 215, 255, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(52, 215, 255, 0.14);
}

/* ------------------------------
   5) Main chat area (flex column)
------------------------------ */
.ai-kiosk-chat-area {
  grid-column: 2;
  grid-row: 2;

  position: relative;
  border-radius: var(--k-radius-xl);

  display: flex;
  flex-direction: column;
  min-width: 0; /* critical for grid children overflow */

  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--k-shadow-soft);

  backdrop-filter: blur(var(--k-blur-md));
  -webkit-backdrop-filter: blur(var(--k-blur-md));

  overflow: hidden;
}

.ai-kiosk-chat-area::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    radial-gradient(760px 520px at 12% 18%, rgba(255, 79, 216, 0.07), transparent 62%),
    radial-gradient(820px 620px at 90% 22%, rgba(52, 215, 255, 0.08), transparent 62%),
    radial-gradient(800px 620px at 64% 112%, rgba(165, 107, 255, 0.08), transparent 62%);
  opacity: 0.95;
}

/* ------------------------------
   6) Answer container (scroll area)
------------------------------ */
.ai-kiosk-answer-container {
  position: relative;
  z-index: 1;

  flex: 1 1 auto;
  min-height: 0; /* allow flex scroll */
  overflow: auto;

  padding: 14px;
  border-radius: 16px;

  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 42px rgba(0, 0, 0, 0.40);

  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* custom scrollbars (webkit only, scoped) */
.ai-kiosk-answer-container::-webkit-scrollbar {
  width: 10px;
}
.ai-kiosk-answer-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.ai-kiosk-answer-container::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(52, 215, 255, 0.22), rgba(165, 107, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
}
.ai-kiosk-answer-container::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(52, 215, 255, 0.30), rgba(255, 79, 216, 0.22));
}

/* message bubble base */
.ai-kiosk-msg-bubble {
  position: relative;

  max-width: 92%;
  padding: 12px 14px;

  margin: 10px 0;

  border-radius: 16px;
  color: var(--k-text-0);
  font-size: 14px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);

  backdrop-filter: blur(var(--k-blur-sm));
  -webkit-backdrop-filter: blur(var(--k-blur-sm));

  word-break: break-word;
  overflow-wrap: anywhere;
}

/* assistant bubble styling (default) */
.ai-kiosk-msg-bubble {
  margin-right: auto;
}

.ai-kiosk-msg-bubble strong {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 0 14px rgba(52, 215, 255, 0.14);
}

.ai-kiosk-msg-bubble small {
  color: var(--k-text-2);
}

/* If JS adds classes for user/assistant, support them */
.ai-kiosk-msg-bubble.is-user {
  margin-left: auto;
  margin-right: 0;

  color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(52, 215, 255, 0.16), rgba(0, 0, 0, 0.22));
  border-color: rgba(52, 215, 255, 0.26);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.46),
    0 0 22px rgba(52, 215, 255, 0.10);
}

.ai-kiosk-msg-bubble.is-assistant {
  margin-right: auto;
  border-color: rgba(165, 107, 255, 0.20);
}

.ai-kiosk-msg-bubble.is-system {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;

  color: var(--k-text-1);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}

/* typing indicator placeholder */
.ai-kiosk-msg-bubble.is-typing {
  color: var(--k-text-2);
  background: rgba(255, 255, 255, 0.05);
}

/* links inside bubble */
.ai-kiosk-msg-bubble a {
  color: rgba(52, 215, 255, 0.92);
  text-decoration: none;
  border-bottom: 1px dashed rgba(52, 215, 255, 0.28);
}
.ai-kiosk-msg-bubble a:hover {
  border-bottom-color: rgba(52, 215, 255, 0.62);
}

/* inline code */
.ai-kiosk-msg-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 2px 6px;
  border-radius: 8px;
}

/* code blocks */
.ai-kiosk-msg-bubble pre {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 14px;

  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.10);

  overflow: auto;
}
.ai-kiosk-msg-bubble pre code {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

/* ------------------------------
   7) Input bar (no fixed; stays at bottom via flex)
------------------------------ */
.ai-kiosk-input-wrapper {
  position: relative;
  z-index: 2;

  margin-top: 12px;

  display: grid;
  grid-template-columns: 52px 1fr 88px;
  gap: 10px;
  align-items: center;

  padding: 10px;
  border-radius: 18px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);

  backdrop-filter: blur(var(--k-blur-md));
  -webkit-backdrop-filter: blur(var(--k-blur-md));
}

.ai-kiosk-input-wrapper::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  pointer-events: none;

  background:
    linear-gradient(120deg,
      rgba(52, 215, 255, 0.20),
      rgba(165, 107, 255, 0.16),
      rgba(255, 79, 216, 0.12)
    );
  opacity: 0.18;
  filter: blur(10px);
}

/* mic button */
.ai-kiosk-mic-btn {
  position: relative;

  height: var(--k-input-h);
  width: 52px;

  border-radius: 16px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: rgba(255, 255, 255, 0.92);
  font-weight: 820;
  font-size: 15px;

  background:
    linear-gradient(180deg, rgba(165, 107, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(165, 107, 255, 0.30);

  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.46),
    0 0 22px rgba(165, 107, 255, 0.14);

  cursor: pointer;
  transition:
    transform var(--k-dur-1) var(--k-ease),
    filter var(--k-dur-2) var(--k-ease),
    box-shadow var(--k-dur-2) var(--k-ease),
    border-color var(--k-dur-2) var(--k-ease);
}

.ai-kiosk-mic-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  border-color: rgba(165, 107, 255, 0.44);
}

.ai-kiosk-mic-btn:active {
  transform: translateY(0px) scale(0.985);
}

.ai-kiosk-mic-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(165, 107, 255, 0.22),
    0 0 0 1px rgba(165, 107, 255, 0.46),
    0 16px 34px rgba(0, 0, 0, 0.46);
}

/* input field */
.ai-kiosk-input-field {
  height: var(--k-input-h);
  width: 100%;
  border-radius: 16px;

  padding: 0 14px;

  color: rgba(255, 255, 255, 0.92);
  caret-color: rgba(52, 215, 255, 0.92);

  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06);

  outline: none;
  transition:
    border-color var(--k-dur-2) var(--k-ease),
    box-shadow var(--k-dur-2) var(--k-ease),
    background var(--k-dur-2) var(--k-ease);
}

.ai-kiosk-input-field::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.ai-kiosk-input-field:focus {
  border-color: rgba(52, 215, 255, 0.44);
  background: rgba(0, 0, 0, 0.28);
  box-shadow:
    0 0 0 3px rgba(52, 215, 255, 0.18),
    0 0 0 1px rgba(52, 215, 255, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* send button */
.ai-kiosk-send-btn {
  position: relative;

  height: var(--k-input-h);
  width: 100%;

  border-radius: 16px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-weight: 860;
  font-size: 14px;
  letter-spacing: 0.1px;

  color: rgba(255, 255, 255, 0.96);

  background:
    linear-gradient(180deg, rgba(52, 215, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(52, 215, 255, 0.34);

  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.50),
    0 0 26px rgba(52, 215, 255, 0.14);

  cursor: pointer;
  transition:
    transform var(--k-dur-1) var(--k-ease),
    filter var(--k-dur-2) var(--k-ease),
    border-color var(--k-dur-2) var(--k-ease),
    box-shadow var(--k-dur-2) var(--k-ease);
}

.ai-kiosk-send-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  border-color: rgba(52, 215, 255, 0.48);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.54),
    0 0 34px rgba(52, 215, 255, 0.18);
}

.ai-kiosk-send-btn:active {
  transform: translateY(0px) scale(0.985);
}

.ai-kiosk-send-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(52, 215, 255, 0.22),
    0 0 0 1px rgba(52, 215, 255, 0.46),
    0 18px 40px rgba(0, 0, 0, 0.54);
}

/* disabled states (JS can set disabled attr) */
.ai-kiosk-wrapper :where(.ai-kiosk-mic-btn, .ai-kiosk-send-btn, .ai-kiosk-menu-btn, .ai-kiosk-btn-toggle)[disabled],
.ai-kiosk-wrapper :where(.ai-kiosk-mic-btn, .ai-kiosk-send-btn, .ai-kiosk-menu-btn, .ai-kiosk-btn-toggle).is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
  transform: none !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

/* ------------------------------
   8) Utility states (optional)
------------------------------ */

/* "processing" state: add .is-busy to wrapper */
.ai-kiosk-wrapper.is-busy .ai-kiosk-send-btn {
  opacity: 0.78;
  cursor: wait;
}

.ai-kiosk-wrapper.is-busy .ai-kiosk-send-btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  pointer-events: none;

  background:
    linear-gradient(120deg,
      rgba(52, 215, 255, 0.0),
      rgba(52, 215, 255, 0.18),
      rgba(165, 107, 255, 0.16),
      rgba(255, 79, 216, 0.10),
      rgba(52, 215, 255, 0.0)
    );

  opacity: 0.6;
  filter: blur(10px);

  animation: ai-kiosk-shimmer 1.1s linear infinite;
}

@keyframes ai-kiosk-shimmer {
  0% { transform: translateX(-12%); }
  100% { transform: translateX(12%); }
}

/* toast style placeholder (if you add later) */
.ai-kiosk-toast {
  position: absolute;
  right: 14px;
  bottom: 74px;

  z-index: 10;
  padding: 10px 12px;
  border-radius: 14px;

  color: var(--k-text-0);
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow: var(--k-shadow-soft);
  backdrop-filter: blur(var(--k-blur-md));
  -webkit-backdrop-filter: blur(var(--k-blur-md));
}

/* ------------------------------
   9) Responsive rules
------------------------------ */
@media (max-width: 980px) {
  .ai-kiosk-wrapper {
    padding: 12px;
    max-width: 100%;
  }
  .ai-kiosk-dashboard {
    grid-template-columns: 300px 1fr;
  }
}

@media (max-width: 860px) {
  .ai-kiosk-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: var(--k-header-h) auto 1fr;
  }

  .ai-kiosk-sidebar {
    grid-column: 1;
    grid-row: 2;
  }

  .ai-kiosk-chat-area {
    grid-column: 1;
    grid-row: 3;
  }

  .ai-kiosk-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ai-kiosk-dashboard {
    padding: 12px;
    gap: 12px;
    border-radius: 18px;
  }

  .ai-kiosk-title {
    font-size: 14px;
  }

  .ai-kiosk-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .ai-kiosk-menu-btn {
    height: 44px;
    font-size: 12px;
    border-radius: 13px;
  }

  .ai-kiosk-input-wrapper {
    grid-template-columns: 50px 1fr 82px;
    padding: 9px;
    border-radius: 16px;
  }

  .ai-kiosk-input-field {
    padding: 0 12px;
  }
}

@media (max-width: 420px) {
  .ai-kiosk-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-kiosk-btn-toggle {
    padding: 0 12px;
    height: 36px;
    font-size: 12px;
  }
}

/* ------------------------------
   10) High-contrast safety
------------------------------ */
@media (prefers-contrast: more) {
  .ai-kiosk-dashboard,
  .ai-kiosk-header,
  .ai-kiosk-sidebar,
  .ai-kiosk-chat-area,
  .ai-kiosk-answer-container,
  .ai-kiosk-input-wrapper {
    border-color: rgba(255, 255, 255, 0.22);
  }

  .ai-kiosk-menu-btn,
  .ai-kiosk-btn-toggle,
  .ai-kiosk-mic-btn,
  .ai-kiosk-send-btn,
  .ai-kiosk-input-field {
    border-color: rgba(255, 255, 255, 0.22);
  }
}

/* ------------------------------
   11) Integration safety notes (no global)
------------------------------ */
/* If portal has a crazy button style like button{...}, this hard-resets inside kiosk */
.ai-kiosk-wrapper button.ai-kiosk-menu-btn,
.ai-kiosk-wrapper button.ai-kiosk-btn-toggle,
.ai-kiosk-wrapper button.ai-kiosk-mic-btn,
.ai-kiosk-wrapper button.ai-kiosk-send-btn {
  appearance: none;
  -webkit-appearance: none;
}

/* Portal inputs sometimes have border-radius overrides */
.ai-kiosk-wrapper input.ai-kiosk-input-field {
  appearance: none;
  -webkit-appearance: none;
}

/* Done */


/* =========================================
   MOBILE FIX PATCH (Scoped)
========================================= */
@media (max-width: 860px) {

  .ai-kiosk-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: var(--k-header-h) 1fr;
  }

  /* 사이드바를 오버레이로 */
  .ai-kiosk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: 85%;
    max-width: 340px;

    z-index: 1000;

    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .ai-kiosk-sidebar.is-open {
    transform: translateX(0);
  }

  /* 채팅 영역은 전체 차지 */
  .ai-kiosk-chat-area {
    grid-column: 1;
    grid-row: 2;
  }
}