/* ==========================================================================
   Ridgeline AI, live Concierge demo component
   Presented as a device on a desk, not a gray chat box
   ========================================================================== */

.demo-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

/* Copper halo behind the device, gives the object weight on the page */
.demo-wrap::before {
  content: '';
  position: absolute;
  inset: -8% -6% -12%;
  background:
    radial-gradient(58% 46% at 50% 8%, rgba(176,113,58,.28), transparent 72%),
    radial-gradient(48% 40% at 78% 92%, rgba(68,84,106,.20), transparent 76%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}

.device {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: linear-gradient(180deg, var(--night-2) 0%, var(--night) 100%);
  border: 1px solid rgba(247,245,242,.14);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-deep);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Every internal row must be allowed to shrink below its content width,
   otherwise the horizontally scrolling switcher widens the whole device. */
.device > * { min-width: 0; max-width: 100%; }

/* Hairline of light along the top edge, reads as glass */
.device::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  z-index: 3;
}

/* --- Chrome bar --------------------------------------------------------- */
.device-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8125rem 1rem;
  border-bottom: 1px solid rgba(247,245,242,.10);
  background: rgba(247,245,242,.03);
  flex: none;
}
.device-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--copper) 0%, var(--copper-deep) 100%);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 2px 10px -3px rgba(176,113,58,.7);
}
.device-id { min-width: 0; flex: 1; }
.device-id strong {
  display: block;
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  color: var(--night-text);
  letter-spacing: -.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-id span {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .75rem;
  color: var(--night-muted);
  line-height: 1.4;
}

/* --- Practice switcher -------------------------------------------------- */
.switch {
  display: flex;
  gap: .375rem;
  padding: .75rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(247,245,242,.08);
  flex: none;
  -webkit-overflow-scrolling: touch;
}
.switch::-webkit-scrollbar { display: none; }

.switch button {
  flex: none;
  background: transparent;
  border: 1px solid rgba(247,245,242,.16);
  color: var(--night-muted);
  font-size: .8125rem;
  font-weight: 500;
  padding: .6875rem 1rem;
  min-height: 44px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background-color .2s var(--ease);
}
.switch button:hover { color: var(--night-text); border-color: rgba(247,245,242,.34); }
.switch button[aria-selected='true'] {
  background: var(--copper);
  border-color: var(--copper);
  color: #FFF;
  font-weight: 600;
}

/* --- Transcript --------------------------------------------------------- */
.stream {
  padding: 1.125rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  overflow-y: auto;
  height: 340px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
@media (min-width: 1024px) { .stream { height: 380px; } }
@media (prefers-reduced-motion: reduce) { .stream { scroll-behavior: auto; } }

.stream::-webkit-scrollbar { width: 5px; }
.stream::-webkit-scrollbar-track { background: transparent; }
.stream::-webkit-scrollbar-thumb { background: rgba(247,245,242,.16); border-radius: 3px; }

.msg {
  max-width: 86%;
  padding: .75rem .9375rem;
  font-size: .9375rem;
  line-height: 1.55;
  border-radius: 14px;
  animation: rise .32s var(--ease) both;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } }

.msg-bot {
  align-self: flex-start;
  background: rgba(247,245,242,.07);
  border: 1px solid rgba(247,245,242,.10);
  color: var(--night-text);
  border-bottom-left-radius: 5px;
}
.msg-user {
  align-self: flex-end;
  background: var(--copper);
  color: #FFF;
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 16px -10px rgba(176,113,58,.9);
}

/* Light markdown rendered from the API reply */
.msg strong { font-weight: 650; }
.msg-bot strong { color: #FFF; }
.msg ul { margin: .5rem 0 0; padding-left: 1.125rem; display: grid; gap: .3125rem; }
.msg li { line-height: 1.5; }
.msg p + p { margin-top: .5rem; }
.msg :first-child { margin-top: 0; }

/* Typing indicator */
.typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: .875rem .9375rem;
  background: rgba(247,245,242,.07);
  border: 1px solid rgba(247,245,242,.10);
  border-radius: 14px;
  border-bottom-left-radius: 5px;
}
.typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--night-muted);
  animation: blink 1.3s var(--ease) infinite;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blink {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

/* --- Starter prompts ---------------------------------------------------- */
.starters {
  display: flex;
  flex-wrap: wrap;
  gap: .4375rem;
  padding: 0 1rem .875rem;
  flex: none;
}
.starters button {
  background: rgba(247,245,242,.05);
  border: 1px solid rgba(247,245,242,.14);
  color: var(--night-text);
  font-size: .8125rem;
  padding: .625rem .875rem;
  min-height: 40px;
  border-radius: 100px;
  cursor: pointer;
  text-align: left;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.starters button:hover {
  background: rgba(176,113,58,.18);
  border-color: var(--copper);
  transform: translateY(-1px);
}
.starters button:active { transform: translateY(0); }

/* --- Composer ----------------------------------------------------------- */
.composer {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  padding: .8125rem 1rem 1rem;
  border-top: 1px solid rgba(247,245,242,.10);
  background: rgba(247,245,242,.02);
  flex: none;
}
.composer textarea {
  flex: 1;
  background: rgba(247,245,242,.06);
  border: 1px solid rgba(247,245,242,.16);
  border-radius: 10px;
  color: var(--night-text);
  padding: .6875rem .8125rem;
  font-size: .9375rem;
  line-height: 1.45;
  resize: none;
  max-height: 108px;
  min-height: 44px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
  font-family: var(--sans);
}
.composer textarea::placeholder { color: var(--night-muted); }
.composer textarea:focus {
  outline: none;
  border-color: var(--copper);
  background: rgba(247,245,242,.09);
  box-shadow: 0 0 0 3px rgba(176,113,58,.20);
}
.composer button {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: none;
  background: var(--copper);
  color: #FFF;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .15s var(--ease), opacity .2s var(--ease);
}
.composer button:hover:not(:disabled) { background: var(--copper-deep); transform: translateY(-1px); }
.composer button:disabled { opacity: .45; cursor: not-allowed; }

.device-note {
  padding: 0 1rem 1rem;
  font-size: .6875rem;
  color: var(--night-muted);
  text-align: center;
  line-height: 1.5;
  flex: none;
}

/* ==========================================================================
   Static widget previews, used on customization.html, section 03
   Four genuinely different treatments, not four recolors of one box.
   Shared building blocks below, then one override block per variant.
   ========================================================================== */

.widget-fig { display: flex; flex-direction: column; align-items: flex-start; }

.wcard {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.wcard:hover { transform: translateY(-4px); }

.wb {
  font-size: .8125rem;
  line-height: 1.5;
  padding: .5625rem .75rem;
  max-width: 88%;
  margin: 0;
}

.wlauncher {
  margin-top: 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: #FFF;
  font-size: .8125rem;
  font-weight: 600;
}

/* --- 1, Ridgeline Dental: rounded and soft --------------------------------- */
.wcard-soft {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #FFF;
  box-shadow: var(--shadow-lift);
}
.wcard-soft:hover { box-shadow: 0 2px 4px rgba(33,31,29,.05), 0 22px 44px -20px rgba(33,31,29,.30); }
.wcard-soft .wcard-head {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .875rem 1rem;
  background: linear-gradient(135deg, #2F6F62, #234F45);
  color: #FFF;
}
.wcard-soft .wcard-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 700;
  flex: none;
}
.wcard-soft strong { font-size: .875rem; font-weight: 600; display: block; line-height: 1.3; }
.wcard-soft .wcard-head span { font-size: .6875rem; opacity: .85; display: flex; align-items: center; gap: .375rem; }
.wcard-dot { width: 6px; height: 6px; border-radius: 50%; background: #7FD9A8; display: inline-block; }
.wcard-soft .wcard-body { padding: 1rem; display: grid; gap: .5625rem; background: #FBFAF9; }
.wcard-soft .wb-bot  { background: #FFF; border: 1px solid rgba(33,31,29,.10); border-radius: 14px; border-bottom-left-radius: 4px; color: var(--ink-2); justify-self: start; }
.wcard-soft .wb-user { background: #2F6F62; border-radius: 14px; border-bottom-right-radius: 4px; color: #FFF; justify-self: end; }
.wcard-soft .wcard-foot { display: flex; gap: .5rem; align-items: center; padding: .75rem 1rem 1rem; background: #FBFAF9; }
.wcard-soft .wcard-input { flex: 1; font-size: .75rem; color: #9A928A; background: #FFF; border: 1px solid rgba(33,31,29,.12); border-radius: 100px; padding: .5rem .875rem; }
.wcard-soft .wcard-send { width: 30px; height: 30px; border-radius: 50%; background: #2F6F62; display: grid; place-items: center; color: #FFF; flex: none; }
.wlauncher-fab { width: 44px; height: 44px; border-radius: 50%; background: #2F6F62; justify-content: center; box-shadow: 0 10px 24px -12px rgba(47,111,98,.7); }

/* --- 2, Ridgeline Animal Hospital: notched and energetic ------------------- */
.wcard-tab {
  border-radius: 8px 8px 20px 20px;
  border: none;
  background: #FFF;
  box-shadow: 0 2px 4px rgba(33,31,29,.05), 0 18px 36px -18px rgba(33,31,29,.28);
  clip-path: polygon(0 0, 88% 0, 100% 14%, 100% 100%, 0 100%);
}
.wcard-tab .wcard-head {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1rem 1rem .875rem;
  background: #D9782E;
  color: #FFF;
}
.wcard-badge-hex {
  width: 30px; height: 30px;
  flex: none;
  background: rgba(255,255,255,.2);
  border-radius: 7px;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
}
.wcard-badge-hex svg { transform: rotate(-45deg); }
.wcard-tab strong { font-size: .75rem; font-weight: 700; letter-spacing: .04em; display: block; line-height: 1.3; }
.wcard-tab .wcard-head span { font-size: .6875rem; opacity: .88; display: flex; align-items: center; gap: .375rem; margin-top: .1875rem; }
.wcard-tab .wcard-body { padding: 1.125rem 1rem; display: grid; gap: .625rem; background: #FFF9F3; }
.wb-tab-bot  { background: #FFF; border: 1px solid rgba(217,120,46,.22); border-radius: 4px 14px 14px 14px; color: var(--ink-2); justify-self: start; }
.wb-tab-user { background: #211F1D; border-radius: 14px 4px 14px 14px; color: #FFF; justify-self: end; }
.wcard-foot-tab { display: flex; gap: .625rem; align-items: center; padding: .75rem 1rem 1rem; background: #FFF9F3; }
.wcard-input-tab { flex: 1; font-size: .75rem; color: #B8987E; background: #FFF; border: 1px solid rgba(217,120,46,.28); border-radius: 6px; padding: .5rem .75rem; }
.wcard-send-tab { flex: none; background: #D9782E; color: #FFF; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; padding: .5rem .875rem; border-radius: 6px; }
.wlauncher-pill { background: #D9782E; padding: .625rem 1.25rem; border-radius: 100px; box-shadow: 0 10px 24px -12px rgba(217,120,46,.7); }

/* --- 3, Ridgeline Aesthetics: quiet editorial, no color fill --------------- */
.wcard-editorial {
  border-radius: 2px;
  border: 1px solid rgba(33,31,29,.16);
  background: #FCFBF9;
  box-shadow: none;
}
.wcard-editorial:hover { box-shadow: 0 20px 40px -26px rgba(33,31,29,.22); }
.wcard-head-editorial {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem 1.25rem .875rem;
  border-bottom: 1px solid rgba(33,31,29,.12);
}
.wcard-head-editorial strong { font-family: var(--display); font-weight: 500; font-size: 1.0625rem; letter-spacing: -.01em; color: var(--ink); }
.wcard-head-editorial span { font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wcard-body-editorial { padding: 1.125rem 1.25rem; display: grid; gap: .75rem; }
.wb-editorial-bot, .wb-editorial-user {
  max-width: none;
  padding: 0;
  font-size: .875rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink-2);
}
.wb-editorial-user { color: var(--ink); font-weight: 500; font-style: normal; }
.wb-editorial-user::before { content: '\2014\0020'; font-style: normal; color: var(--muted); }
.wcard-foot-editorial { padding: 0 1.25rem 1.25rem; }
.wcard-input-editorial {
  display: block;
  font-size: .8125rem;
  color: #A69E93;
  border-top: 1px solid rgba(33,31,29,.14);
  padding-top: .75rem;
}
.wlauncher-text { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.wlauncher-text span { display: inline-block; transition: transform .2s var(--ease); }
.widget-fig:hover .wlauncher-text span { transform: translateX(3px); }

/* --- 4, Ridgeline Surgical Group: structured and precise ------------------- */
.wcard-structured {
  border-radius: 0;
  border: 1px solid rgba(33,31,29,.18);
  background: #FFF;
  box-shadow: 0 1px 2px rgba(33,31,29,.05);
}
.wcard-stripe { height: 4px; background: #3A5A82; flex: none; }
.wcard-head-structured {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9375rem 1rem;
  background: #1D2C3E;
  color: #FFF;
}
.wcard-badge-sq {
  width: 26px; height: 26px;
  flex: none;
  background: #3A5A82;
  display: grid;
  place-items: center;
}
.wcard-head-structured strong { font-size: .75rem; font-weight: 700; letter-spacing: .06em; display: block; line-height: 1.3; }
.wcard-status { font-size: .625rem; letter-spacing: .1em; color: #8FB0D6; display: block; margin-top: .25rem; }
.wcard-body-structured { padding: 1rem; display: grid; gap: .5rem; background: #F4F5F7; }
.wb-structured-bot  { background: #FFF; border: 1px solid rgba(58,90,130,.22); color: var(--ink-2); justify-self: start; }
.wb-structured-user { background: #3A5A82; color: #FFF; justify-self: end; }
.wcard-foot-structured { display: flex; gap: .5rem; align-items: center; padding: .75rem 1rem; background: #F4F5F7; border-top: 1px solid rgba(33,31,29,.1); }
.wcard-input-structured { flex: 1; font-size: .75rem; color: #8A93A0; background: #FFF; border: 1px solid rgba(58,90,130,.28); padding: .5rem .75rem; }
.wcard-send-structured { flex: none; width: 28px; height: 28px; background: #3A5A82; color: #FFF; display: grid; place-items: center; }
.wlauncher-sq { width: 40px; height: 40px; background: #1D2C3E; justify-content: center; box-shadow: 0 10px 24px -12px rgba(29,44,62,.7); }
