/* ==========================================================================
   Demo mock-business sites (demos app)
   Theme colours come from CSS custom properties set on <body> per assistant:
   --demo-accent, --demo-accent-dark, --demo-accent-contrast, --demo-soft
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

body.demo {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1c2733;
  background: #fff;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--demo-accent, #0d4f8b); }
button { font: inherit; cursor: pointer; }

.demo-container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------------------
   "Demo by OplosCore" banner
   -------------------------------------------------------------------------- */
.demo-banner {
  background: #1c2733;
  color: #fff;
  font-size: 0.85rem;
}

.demo-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.demo-banner__note { opacity: 0.9; }

.demo-banner__back {
  color: #fff;
  white-space: nowrap;
  font-weight: 600;
  text-decoration: none;
}

.demo-banner__back:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Mock business chrome
   -------------------------------------------------------------------------- */
.biz-header {
  border-bottom: 1px solid #e3e9ef;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.biz-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.biz-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--demo-accent-dark, #093a66);
}

.biz-brand__mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent-contrast, #fff);
}

.biz-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.biz-nav a {
  color: #33424f;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.biz-nav a:hover { color: var(--demo-accent, #0d4f8b); }

.biz-btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  text-decoration: none;
  text-align: center;
}

.biz-btn--solid {
  background: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent-contrast, #fff);
}

.biz-btn--solid:hover { background: var(--demo-accent-dark, #093a66); }

.biz-btn--outline {
  border-color: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent, #0d4f8b);
  background: transparent;
}

.biz-btn--outline:hover {
  background: var(--demo-soft, #eef4fa);
}

/* Hero */
.biz-hero {
  background: linear-gradient(180deg, var(--demo-soft, #eef4fa) 0%, #fff 100%);
  padding: 4.5rem 0 3.5rem;
}

.biz-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--demo-accent, #0d4f8b);
  margin-bottom: 0.9rem;
}

.biz-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--demo-accent-dark, #093a66);
  margin-bottom: 1rem;
}

.biz-hero__lede {
  font-size: 1.1rem;
  color: #45566a;
  max-width: 38rem;
  margin-bottom: 1.8rem;
}

.biz-hero__actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* Services */
.biz-section__title {
  font-size: 1.6rem;
  color: var(--demo-accent-dark, #093a66);
  margin-bottom: 0.4rem;
}

.biz-section__lede { color: #45566a; margin-bottom: 1.6rem; }

.biz-services { padding: 3.5rem 0 1.5rem; }

.biz-services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}

.biz-service {
  border: 1px solid #e3e9ef;
  border-radius: 12px;
  padding: 1.25rem;
  background: #fff;
}

.biz-service h3 {
  font-size: 1.02rem;
  color: var(--demo-accent-dark, #093a66);
  margin-bottom: 0.4rem;
}

.biz-service p { font-size: 0.92rem; color: #45566a; }

/* Footer */
.biz-footer {
  margin-top: 3.5rem;
  background: var(--demo-accent-dark, #093a66);
  color: rgba(255, 255, 255, 0.92);
  padding: 2.2rem 0;
  font-size: 0.92rem;
}

.biz-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.biz-footer__note { max-width: 24rem; opacity: 0.8; }
.biz-footer a { color: #fff; }

/* --------------------------------------------------------------------------
   Calendar widget
   -------------------------------------------------------------------------- */
.biz-calendar { padding: 2rem 0 1rem; }

.cal {
  border: 1px solid #e3e9ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.cal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--demo-soft, #eef4fa);
  border-bottom: 1px solid #e3e9ef;
}

.cal__range { font-weight: 600; color: var(--demo-accent-dark, #093a66); }

.cal__nav-btn {
  border: 1px solid var(--demo-accent, #0d4f8b);
  color: var(--demo-accent, #0d4f8b);
  background: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.cal__nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: #e3e9ef;
}

.cal__day { background: #fff; padding: 0.7rem 0.55rem; }

.cal__day-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--demo-accent-dark, #093a66);
  text-align: center;
  margin-bottom: 0.6rem;
}

.cal__slot {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  border-radius: 6px;
  padding: 0.35rem 0.2rem;
  margin-bottom: 0.35rem;
  border: 1px solid transparent;
}

.cal__slot--free {
  background: var(--demo-soft, #eef4fa);
  color: var(--demo-accent-dark, #093a66);
  border-color: #cfe0ef;
}

.cal__slot--busy,
.cal__slot--past,
.cal__slot--unavailable {
  background: #f4f5f7;
  color: #9aa7b4;
  text-decoration: line-through;
}

.cal__slot--past,
.cal__slot--unavailable { text-decoration: none; opacity: 0.6; }

.cal__slot--mine {
  background: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent-contrast, #fff);
  font-weight: 700;
}

.cal__legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  border-top: 1px solid #e3e9ef;
  font-size: 0.82rem;
  color: #45566a;
}

.cal__legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }

.cal__swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  display: inline-block;
}

.cal__swatch--free { background: var(--demo-soft, #eef4fa); border: 1px solid #cfe0ef; }
.cal__swatch--busy { background: #f4f5f7; border: 1px solid #dde3e9; }
.cal__swatch--mine { background: var(--demo-accent, #0d4f8b); }

.cal__status {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #45566a;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Chat widget
   -------------------------------------------------------------------------- */

/* Elements below set an unconditional `display` value, which — at equal CSS
   specificity — overrides the browser's native `[hidden] { display: none }`
   rule. Without this, anything marked `hidden` (in markup or via JS) still
   renders. These selectors restore the expected hidden behaviour. */
.chat__panel[hidden],
.chat__launcher[hidden],
.chat__teaser[hidden] {
  display: none;
}

.chat {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat__teaser {
  position: relative;
  max-width: min(17rem, calc(100vw - 3rem));
  background: #fff;
  color: #1c2733;
  border: 1px solid #e3e9ef;
  border-radius: 14px;
  padding: 0.85rem 1.9rem 0.85rem 1rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 12px 32px rgba(9, 58, 102, 0.22);
  cursor: pointer;
  animation: chat-teaser-in 0.25s ease-out;
}

.chat__teaser::after {
  content: "";
  position: absolute;
  right: 1.5rem;
  bottom: -0.5rem;
  width: 0.9rem;
  height: 0.9rem;
  background: #fff;
  border-right: 1px solid #e3e9ef;
  border-bottom: 1px solid #e3e9ef;
  transform: rotate(45deg);
}

.chat__teaser-text {
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat__teaser-dismiss {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: none;
  background: none;
  color: #9aa7b4;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.2rem;
}

.chat__teaser-dismiss:hover { color: #1c2733; }

@keyframes chat-teaser-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent-contrast, #fff);
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(9, 58, 102, 0.35);
}

.chat__launcher:hover { background: var(--demo-accent-dark, #093a66); }

.chat__panel {
  width: min(24rem, calc(100vw - 2.2rem));
  height: min(34rem, calc(100vh - 6rem));
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e3e9ef;
  box-shadow: 0 16px 48px rgba(9, 58, 102, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat__header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  background: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent-contrast, #fff);
}

.chat__avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.chat__identity { display: flex; flex-direction: column; line-height: 1.3; }
.chat__identity strong { font-size: 1rem; }
.chat__identity span { font-size: 0.8rem; opacity: 0.85; }

.chat__close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f7f9fb;
}

.chat__msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat__msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e3e9ef;
  border-bottom-left-radius: 4px;
}

.chat__msg--user {
  align-self: flex-end;
  background: var(--demo-soft, #eef4fa);
  border: 1px solid #cfe0ef;
  border-bottom-right-radius: 4px;
}

.chat__msg--typing { color: #9aa7b4; font-style: italic; }

.chat__gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  align-self: flex-start;
  max-width: 92%;
  margin-top: -0.2rem;
}

.chat__gallery-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
}

.chat__gallery-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e3e9ef;
}

.chat__gallery-caption {
  font-size: 0.72rem;
  line-height: 1.25;
  color: #45566a;
}

.chat__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid #e3e9ef;
  background: #fff;
}

.chat__input {
  flex: 1;
  border: 1px solid #cfd8e1;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  outline: none;
}

.chat__input:focus { border-color: var(--demo-accent, #0d4f8b); }

.chat__send {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: none;
  background: var(--demo-accent, #0d4f8b);
  color: var(--demo-accent-contrast, #fff);
  flex-shrink: 0;
}

.chat__send:disabled { opacity: 0.5; }

.chat__note {
  text-align: center;
  font-size: 0.72rem;
  color: #9aa7b4;
  padding: 0 0.6rem 0.6rem;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .biz-nav { display: none; }
  .demo-banner__inner { flex-direction: column; gap: 0.15rem; align-items: flex-start; }

  .cal__grid { grid-template-columns: 1fr; }
  .cal__day { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
  .cal__day-label { margin-bottom: 0; flex-basis: 100%; text-align: left; }
  .cal__slot { width: auto; padding: 0.3rem 0.55rem; }
}
