/* ===== Samin AI concierge ===== */
@property --sc-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---- launcher: floating gold-rimmed concierge capsule ---- */
.sc-launcher {
  --sc-a: 0deg;
  position: fixed; z-index: 95; left: 22px; bottom: 22px;
  display: flex; align-items: center; gap: 14px; direction: rtl;
  padding: 7px 24px 7px 7px;
  border-radius: 999px;
  color: #fff; text-align: right;
  background:
    radial-gradient(120% 160% at 0% 50%, rgba(201, 164, 92, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(40, 32, 19, 0.94), rgba(16, 12, 7, 0.96));
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 26px 60px -20px rgba(0, 0, 0, 0.7), 0 0 46px -14px rgba(201, 164, 92, 0.45), inset 0 1px 0 rgba(255, 243, 207, 0.12);
  overflow: hidden; isolation: isolate;
  transition: transform 0.6s var(--ease), opacity 0.4s, padding 0.6s var(--ease), gap 0.6s var(--ease), box-shadow 0.6s var(--ease);
  animation: scRim 7s linear infinite;
}
/* rotating gold rim */
.sc-launcher::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.2px;
  background: conic-gradient(from var(--sc-a), rgba(226, 201, 143, 0.18) 0deg, rgba(226, 201, 143, 0.18) 200deg, #af8a32 260deg, #fff3cf 300deg, #e2c98f 320deg, rgba(226, 201, 143, 0.18) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* light sweep */
.sc-launcher::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 196, 0.16), transparent);
  transform: skewX(-20deg); animation: scSweep 6.5s ease-in-out infinite;
}
@keyframes scRim { to { --sc-a: 360deg; } }
@keyframes scSweep { 0%, 60% { left: -60%; } 100% { left: 140%; } }
.sc-launcher:hover { transform: translateY(-4px); animation-duration: 2.5s; box-shadow: 0 32px 70px -20px rgba(0, 0, 0, 0.75), 0 0 60px -10px rgba(201, 164, 92, 0.6), inset 0 1px 0 rgba(255, 243, 207, 0.16); }
.sc-launcher:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 4px; }

.sc-orb-wrap { position: relative; flex: none; width: 60px; height: 60px; order: 2; animation: scFloat 6s ease-in-out infinite; }
.sc-orb-wrap .sc-orb { width: 60px; height: 60px; }
.sc-orb-wrap i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(226, 201, 143, 0.55); pointer-events: none; animation: scRipple 3.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.sc-orb-wrap i:nth-of-type(2) { animation-delay: 1.2s; }
.sc-orb-wrap i:nth-of-type(3) { animation-delay: 2.4s; }
@keyframes scFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 33% { transform: translateY(-3px) rotate(-5deg); } 66% { transform: translateY(1.5px) rotate(4deg); } }
@keyframes scRipple { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.55); opacity: 0; } }

.sc-copy { order: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 230px; overflow: hidden; transition: max-width 0.6s var(--ease), opacity 0.4s; }
.sc-copy b { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 800; line-height: 1.5; white-space: nowrap;
  background: linear-gradient(100deg, #fff 0%, #fff 40%, #f6e3b0 50%, #fff 60%, #fff 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: scText 5s ease-in-out infinite; }
.sc-copy b em { width: 7px; height: 7px; border-radius: 50%; background: #5ad19a; box-shadow: 0 0 0 0 rgba(90, 209, 154, 0.6); animation: scLive 2s infinite; flex: none; }
@keyframes scText { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes scLive { 70% { box-shadow: 0 0 0 6px rgba(90, 209, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(90, 209, 154, 0); } }
.sc-hint { position: relative; display: block; height: 1.7em; min-width: 170px; font-size: 0.76rem; color: var(--gold-300); white-space: nowrap; }
.sc-hint > span { position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; gap: 6px; opacity: 0; transform: translateY(70%); filter: blur(4px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease); }
.sc-hint > span.is-on { opacity: 1; transform: none; filter: none; }
.sc-hint > span.is-off { opacity: 0; transform: translateY(-70%); filter: blur(4px); }
.sc-eq { display: inline-flex; align-items: center; gap: 2px; height: 12px; }
.sc-eq i { width: 2px; border-radius: 2px; background: currentColor; animation: scEq 1.1s ease-in-out infinite; }
.sc-eq i:nth-child(2) { animation-delay: 0.15s; } .sc-eq i:nth-child(3) { animation-delay: 0.3s; } .sc-eq i:nth-child(4) { animation-delay: 0.45s; }
@keyframes scEq { 0%, 100% { height: 3px; } 50% { height: 11px; } }

/* compact: shrinks to the orb while scrolling down, expands on hover / when scrolling stops */
.sc-launcher.is-compact { padding: 7px; gap: 0; }
.sc-launcher.is-compact .sc-copy { max-width: 0; opacity: 0; }
.sc-launcher.is-compact:hover, .sc-launcher.is-compact:focus-visible { padding: 7px 24px 7px 7px; gap: 14px; }
.sc-launcher.is-compact:hover .sc-copy, .sc-launcher.is-compact:focus-visible .sc-copy { max-width: 230px; opacity: 1; }
.sc-open .sc-launcher { opacity: 0; pointer-events: none; transform: scale(0.85) translateY(10px); }

/* mini orb inside the mobile bar */
.mobile-bar .sc-orb-mini { width: 26px; height: 26px; box-shadow: 0 0 0 1px rgba(226, 201, 143, 0.5), 0 0 14px -2px rgba(201, 164, 92, 0.6); animation: scFloat 6s ease-in-out infinite; }

/* ---- voice orb (canvas-rendered in chat.js; --lvl 0..1 drives the halo) ---- */
.sc-orb {
  --lvl: 0;
  display: block; width: 52px; height: 52px; border-radius: 50%; position: relative; flex: none; isolation: isolate;
  box-shadow: 0 0 0 1px rgba(226, 201, 143, 0.4), 0 10px 26px -8px rgba(0, 0, 0, 0.55), 0 0 calc(8px + var(--lvl) * 34px) calc(var(--lvl) * 6px) rgba(236, 170, 120, calc(0.25 + var(--lvl) * 0.45));
  transform: scale(calc(1 + var(--lvl) * 0.08));
  transition: box-shadow 0.12s linear, transform 0.12s linear;
}
.sc-orb canvas { width: 100%; height: 100%; border-radius: 50%; }
.sc-orb.is-listening { box-shadow: 0 0 0 1px rgba(201, 138, 46, 0.7), 0 0 calc(12px + var(--lvl) * 40px) calc(var(--lvl) * 8px) rgba(201, 138, 46, 0.55); }
.sc-head .sc-orb { width: 44px; height: 44px; }

.sc-teaser {
  position: fixed; z-index: 94; left: 22px; bottom: 106px; max-width: 300px;
  padding: 16px 18px 14px; border-radius: 20px 20px 20px 6px;
  background: linear-gradient(150deg, rgba(40, 32, 19, 0.96), rgba(16, 12, 7, 0.97)); color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 201, 143, 0.28); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 0.9rem; line-height: 1.9;
  opacity: 0; transform: translateY(12px) scale(0.97); transform-origin: left bottom; pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.sc-teaser.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.sc-teaser b { color: var(--gold-300); }
.sc-teaser .sc-x { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.5); }
.sc-teaser .sc-x:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sc-teaser .sc-x svg { width: 14px; height: 14px; }
.sc-teaser button.sc-go { margin-top: 10px; font-weight: 700; color: var(--gold-300); display: inline-flex; gap: 6px; align-items: center; }
.sc-teaser button.sc-go svg { width: 16px; height: 16px; }

.sc-panel {
  position: fixed; z-index: 96; left: 24px; bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  height: min(700px, calc(100svh - 48px));
  display: flex; flex-direction: column;
  border-radius: 28px;
  background: var(--ivory);
  box-shadow: 0 50px 120px -30px rgba(20, 16, 9, 0.55), 0 0 0 1px rgba(74, 61, 28, 0.08);
  overflow: hidden;
  transform-origin: left bottom;
  opacity: 0; transform: translateY(20px) scale(0.96); pointer-events: none; visibility: hidden;
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease), visibility 0.45s;
}
.sc-open .sc-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }

.sc-head {
  position: relative; padding: 18px 18px 20px;
  background: radial-gradient(120% 140% at 100% 0%, #6b5222 0%, var(--wine-800) 55%, var(--wine-900));
  color: #fff; display: flex; align-items: center; gap: 12px;
}
.sc-head::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 18px; background: var(--ivory); border-radius: 18px 18px 0 0; }
.sc-head .sc-title { flex: 1; min-width: 0; line-height: 1.5; }
.sc-head .sc-title b { display: block; font-size: 1.02rem; }
.sc-head .sc-title small { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: rgba(255, 255, 255, 0.7); }
.sc-head .sc-title small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5ad19a; box-shadow: 0 0 0 3px rgba(90, 209, 154, 0.2); }
.sc-hbtn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); transition: background 0.25s, color 0.25s; }
.sc-hbtn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sc-hbtn[aria-pressed="true"] { background: rgba(226, 201, 143, 0.2); color: var(--gold-300); }
.sc-hbtn svg { width: 19px; height: 19px; }

.sc-body { flex: 1; overflow-y: auto; padding: 14px 16px 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.sc-body::-webkit-scrollbar { width: 6px; }
.sc-body::-webkit-scrollbar-thumb { background: rgba(74, 61, 28, 0.15); border-radius: 6px; }

.sc-hello { text-align: center; padding: 8px 6px 14px; }
.sc-hello .sc-orb { width: 84px; height: 84px; margin: 4px auto 14px; animation: scFloat 6s ease-in-out infinite; }
.sc-hello h3 { font-size: 1.15rem; color: var(--wine-800); }
.sc-hello p { font-size: 0.88rem; color: var(--ink-soft); margin-top: 6px; line-height: 1.9; }
.sc-hello .sc-listen { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; color: var(--wine); padding: 6px 14px; border-radius: 999px; background: var(--gold-100); }
.sc-hello .sc-listen svg { width: 16px; height: 16px; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.sc-chip { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 0.83rem; font-weight: 600; color: var(--wine-800); line-height: 1.6; transition: all 0.25s; text-align: right; }
.sc-chip:hover { border-color: var(--wine); background: var(--wine-800); color: #fff; }

.sc-msg { display: flex; margin: 10px 0; animation: scIn 0.5s var(--ease) both; }
@keyframes scIn { from { opacity: 0; transform: translateY(8px); } }
.sc-msg .sc-bubble { max-width: 86%; padding: 11px 15px; border-radius: 18px; font-size: 0.93rem; line-height: 1.95; word-wrap: break-word; }
.sc-msg.is-bot { justify-content: flex-start; }
.sc-msg.is-bot .sc-bubble { background: #fff; color: var(--ink); border-top-right-radius: 6px; box-shadow: 0 2px 10px rgba(33, 26, 16, 0.06); }
.sc-msg.is-user { justify-content: flex-end; }
.sc-msg.is-user .sc-bubble { background: var(--wine-800); color: #fff; border-top-left-radius: 6px; white-space: pre-wrap; }
.sc-bubble p + p, .sc-bubble p + ul, .sc-bubble ul + p, .sc-bubble ol + p, .sc-bubble p + ol { margin-top: 8px; }
.sc-bubble ul, .sc-bubble ol { padding-inline-start: 20px; margin: 6px 0; }
.sc-bubble li { margin: 2px 0; }
.sc-bubble li::marker { color: var(--gold); }
.sc-bubble strong { color: var(--wine); font-weight: 800; }
.sc-bubble a { color: var(--wine); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold-300); text-underline-offset: 4px; }
.sc-tools { display: flex; gap: 4px; margin-top: 6px; }
.sc-tool { height: 28px; padding: 0 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--ink-soft); background: var(--cream); transition: all 0.2s; }
.sc-tool:hover { color: var(--wine); background: var(--gold-100); }
.sc-tool svg { width: 14px; height: 14px; }
.sc-tool.is-playing { background: var(--wine-800); color: var(--gold-300); }
.sc-cursor::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-start: 4px; border-radius: 50%; background: var(--gold); animation: scBlink 0.9s infinite; vertical-align: middle; }
@keyframes scBlink { 50% { opacity: 0.2; } }
.sc-typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.sc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: scDot 1.2s infinite; }
.sc-typing i:nth-child(2) { animation-delay: 0.15s; }
.sc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes scDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.sc-note { margin: 12px auto; max-width: 90%; text-align: center; font-size: 0.82rem; font-weight: 600; padding: 10px 14px; border-radius: 14px; background: #e9f7ef; color: #1e7a4c; }
.sc-note.is-error { background: #fdecea; color: #a93226; }

.sc-compose { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #fff; }
.sc-row { display: flex; align-items: flex-end; gap: 8px; background: var(--ivory); border: 1px solid var(--line); border-radius: 18px; padding: 6px; transition: border-color 0.25s, box-shadow 0.25s; }
.sc-row:focus-within { border-color: var(--wine); box-shadow: 0 0 0 4px rgba(74, 61, 28, 0.07); }
.sc-input { flex: 1; min-height: 40px; max-height: 130px; resize: none; border: 0; outline: 0; background: transparent; padding: 8px 8px; font-size: 0.95rem; line-height: 1.7; }
.sc-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; transition: background 0.25s, color 0.25s, transform 0.25s; }
.sc-btn svg { width: 20px; height: 20px; }
.sc-send { background: var(--gold); color: var(--wine-900); }
.sc-send:disabled { opacity: 0.4; }
.sc-send svg { transform: scaleX(-1); }
.sc-mic { color: var(--wine); background: var(--gold-100); }
.sc-mic.is-rec { background: var(--coral); color: #fff; animation: scRec 1.2s infinite; }
@keyframes scRec { 50% { box-shadow: 0 0 0 6px rgba(201, 138, 46, 0.25); } }
.sc-rec-bar { display: none; align-items: center; gap: 10px; flex: 1; padding: 0 8px; font-size: 0.85rem; color: var(--coral); font-weight: 700; min-height: 40px; }
.sc-recording .sc-rec-bar { display: flex; }
.sc-recording .sc-input { display: none; }
.sc-wave { display: flex; gap: 3px; align-items: center; height: 20px; }
.sc-wave i { width: 3px; border-radius: 3px; background: var(--coral); animation: scWave 0.9s ease-in-out infinite; }
.sc-wave i:nth-child(2n) { animation-delay: 0.2s; }
.sc-wave i:nth-child(3n) { animation-delay: 0.4s; }
@keyframes scWave { 0%, 100% { height: 5px; } 50% { height: 18px; } }
.sc-foot { font-size: 0.68rem; color: var(--ink-mute); text-align: center; margin-top: 8px; line-height: 1.6; }

@media (max-width: 1023px) {
  .sc-launcher, .sc-teaser { display: none; }
  .sc-panel { left: 0; bottom: 0; width: 100vw; height: 100svh; border-radius: 0; }
  .sc-head { padding-top: calc(16px + env(safe-area-inset-top)); }
  .sc-compose { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { .sc-launcher, .sc-launcher::after, .sc-orb-wrap, .sc-orb-wrap i, .sc-copy b, .sc-eq i, .sc-hello .sc-orb, .mobile-bar .sc-orb-mini { animation: none !important; } }
