.service-page {
  background-image:
    radial-gradient(circle at 88% 7%, rgba(122,66,220,.13), transparent 23%),
    radial-gradient(circle at 7% 27%, rgba(0,169,157,.1), transparent 18%);
}

.service-page .site-header { background: color-mix(in srgb, var(--bg) 91%, transparent); }
.service-page .main-nav a[aria-current="page"] { color: var(--purple); font-weight: 800; }
.service-page .section-pad { padding: clamp(42px, 5vw, 72px) 0; }

.service-hero { padding: clamp(34px, 5vw, 68px) 0 clamp(48px, 6vw, 82px); overflow: hidden; }
.service-hero-grid { display: grid; grid-template-columns: 1.14fr .86fr; gap: clamp(42px, 7vw, 90px); align-items: center; }
.service-hero h1 { max-width: 15ch; font-size: clamp(2.8rem, 5vw, 5.1rem); }
.service-hero .hero-lead { max-width: 720px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: var(--purple); }

.service-visual { position: relative; min-height: 650px; display: grid; place-items: center; }
.service-visual::before { content: ""; position: absolute; inset: 6% 2% 2% 8%; border-radius: 48% 52% 42% 58% / 48% 38% 62% 52%; background: linear-gradient(145deg, #e1d5ff, #cbf7ef 58%, #f8dcec); transform: rotate(4deg); }
.messenger-demo-wrap { position: relative; z-index: 1; width: min(312px, calc(100vw - 40px)); max-width: 312px; margin-inline: auto; }
.smartphone-shell { position: relative; box-sizing: border-box; width: 100%; max-width: 312px; aspect-ratio: 1 / 2; padding: 11px; border: 1px solid rgba(255,255,255,.54); border-radius: 46px; background: linear-gradient(145deg, #2f2145, #15101e 58%, #342150); box-shadow: 0 30px 70px rgba(50,29,79,.24), inset 0 0 0 1px rgba(255,255,255,.1); }
.smartphone-shell::before, .smartphone-shell::after { content: ""; position: absolute; left: -3px; width: 3px; border-radius: 3px 0 0 3px; background: #34284a; }
.smartphone-shell::before { top: 118px; height: 58px; }
.smartphone-shell::after { top: 190px; height: 82px; }
.smartphone-camera { position: absolute; z-index: 3; top: 17px; left: 50%; width: 86px; height: 22px; border-radius: 0 0 14px 14px; background: #17111f; transform: translateX(-50%); box-shadow: inset 0 -1px 0 rgba(255,255,255,.08); }
.smartphone-camera::after { content: ""; position: absolute; top: 7px; right: 15px; width: 6px; height: 6px; border-radius: 50%; background: #352b48; box-shadow: inset 0 0 0 1px rgba(126,95,173,.45); }
.messenger-window { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 0; border-radius: 36px; background: rgba(255,255,255,.96); box-shadow: inset 0 0 0 1px rgba(61,29,103,.08); }
.messenger-head { display: flex; align-items: center; gap: 11px; min-height: 74px; padding: 21px 16px 11px; border-bottom: 1px solid rgba(61,29,103,.09); background: linear-gradient(110deg, rgba(122,66,220,.11), rgba(0,169,157,.08)); }
.messenger-head > div:nth-child(2) { display: grid; gap: 2px; }
.messenger-head strong { color: var(--purple-deep); font-size: .88rem; }
.messenger-head span { color: var(--muted); font-size: .68rem; }
.messenger-head > b { margin-left: auto; color: rgba(61,29,103,.4); letter-spacing: .1em; }
.bot-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px 7px 13px 7px; background: linear-gradient(145deg, var(--purple), var(--teal)); color: #fff; font-size: .75rem; font-weight: 900; box-shadow: 0 8px 18px rgba(99,61,190,.2); }
.chat-log { min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding: 15px; scrollbar-color: rgba(104,64,191,.28) transparent; background: linear-gradient(180deg, rgba(251,249,255,.92), rgba(240,252,249,.66)); }
.chat-log:focus-visible { outline: 3px solid rgba(0,169,157,.28); outline-offset: -3px; }
.chat-bubble { width: fit-content; max-width: 88%; padding: 10px 13px; border-radius: 15px; color: var(--purple-deep); font-size: .76rem; line-height: 1.45; box-shadow: 0 6px 18px rgba(61,29,103,.05); animation: chat-in .24s ease both; }
.bot-message { align-self: flex-start; border: 1px solid rgba(61,29,103,.08); border-bottom-left-radius: 5px; background: #fff; }
.user-message { align-self: flex-end; border-bottom-right-radius: 5px; background: linear-gradient(135deg, #e4d8ff, #c9f5ed); font-weight: 750; }
.action-message { color: #fff; background: linear-gradient(135deg, #7440d7, #4c2d7a); }
.chat-bubble:nth-child(2) { animation-delay: .04s; }
.chat-bubble:nth-child(3) { animation-delay: .08s; }
.chat-bubble:nth-child(4) { animation-delay: .12s; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 94%; }
.chat-actions button { min-height: 38px; padding: 7px 12px; border: 1px solid rgba(102,61,189,.2); border-radius: 999px; background: #fff; color: var(--purple); cursor: pointer; font-size: .7rem; font-weight: 800; }
.chat-actions button:hover:not(:disabled) { border-color: var(--purple); background: #f5f0ff; }
.chat-actions button:disabled { cursor: default; opacity: .46; }
.chat-actions button:focus-visible, .demo-choices button:focus-visible { outline: 3px solid rgba(0,169,157,.3); outline-offset: 2px; }
.chat-stage { display: flex; align-items: center; gap: 9px; margin: 6px 0; color: var(--muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.chat-stage::before, .chat-stage::after { content: ""; flex: 1; height: 1px; background: rgba(61,29,103,.12); }
.demo-resource { display: flex; align-items: center; gap: 11px; align-self: flex-start; min-width: 180px; padding: 12px 14px; border: 1px solid rgba(0,169,157,.22); border-radius: 16px; background: linear-gradient(135deg, #fff, #e6fbf7); box-shadow: 0 8px 20px rgba(0,121,113,.07); animation: chat-in .24s ease both; }
.demo-resource > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #dff8f3; font-size: 1rem; }
.demo-resource div { display: grid; gap: 2px; }
.demo-resource b { color: var(--purple-deep); font-size: .78rem; }
.demo-resource small { color: var(--muted); font-size: .65rem; }
.demo-controls { border-top: 1px solid rgba(61,29,103,.08); background: #fff; }
.demo-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 9px 12px 6px; }
.demo-choices button { min-width: 0; min-height: 54px; display: grid; place-items: center; align-content: center; gap: 3px; padding: 5px 4px; border: 1px solid rgba(102,61,189,.18); border-radius: 15px; background: #fbf9ff; color: var(--purple); cursor: pointer; font-size: .64rem; line-height: 1.1; font-weight: 800; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.demo-choices button:hover { border-color: var(--purple); transform: translateY(-1px); }
.demo-choices button.is-active { border-color: transparent; background: var(--purple); color: #fff; }
.scenario-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 8px; background: rgba(122,66,220,.09); color: currentColor; font-size: .92rem; line-height: 1; }
.demo-choices button.is-active .scenario-icon { background: rgba(255,255,255,.16); }
.demo-meta { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 19px; padding: 1px 12px 8px; }
.scenario-dots { display: flex; align-items: center; gap: 6px; }
.scenario-dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(61,29,103,.2); transition: width .2s, background .2s; }
.scenario-dots i.is-active { width: 18px; background: linear-gradient(90deg, var(--purple), var(--teal)); }
.demo-caption { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: .68rem; }
@keyframes chat-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.mini-icon, .type-icon { display: grid; place-items: center; color: var(--purple-deep); font-weight: 900; box-shadow: inset 0 0 0 1px rgba(61,29,103,.08); }
.mini-icon { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg, #e8dcff, #caf6ee); font-size: .7rem; }
.type-icon { width: 54px; height: 54px; border-radius: 18px 8px 18px 8px; background: linear-gradient(145deg, #ddceff, #bcf2e9); font-size: 1.05rem; transform: rotate(-2deg); }

.catalog-section { scroll-margin-top: 92px; }
.catalog-section .section-heading { max-width: 820px; }
.bot-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; margin-top: 38px; }
.bot-card { scroll-margin-top: 92px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.86); box-shadow: 0 14px 42px rgba(61,29,103,.07); transition: border-color .25s, box-shadow .25s; }
.bot-card:target, .bot-card.is-open { border-color: color-mix(in srgb, var(--purple) 52%, transparent); box-shadow: 0 20px 58px rgba(61,29,103,.14); }
.bot-card-summary { min-height: 344px; display: flex; flex-direction: column; padding: clamp(24px, 3vw, 32px); }
.bot-card-head { display: flex; align-items: center; gap: 16px; }
.bot-card-number { margin-left: auto; color: rgba(61,29,103,.38); font-size: .75rem; font-weight: 850; letter-spacing: .1em; }
.bot-card h3 { margin: 22px 0 12px; font-size: clamp(1.35rem, 2vw, 1.72rem); }
.bot-card-intro { margin-bottom: 20px; font-size: .94rem; }
.mini-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 22px; padding: 0; list-style: none; }
.mini-flow li { position: relative; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fbf9ff; color: var(--muted); font-size: .74rem; }
.mini-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -10px; z-index: 2; color: var(--teal); font-weight: 900; }
.card-toggle { align-self: flex-start; min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--purple); cursor: pointer; font-weight: 820; }
.card-toggle:hover { border-color: var(--purple); }

.bot-card-details { padding: 0 clamp(24px, 3vw, 32px) clamp(28px, 4vw, 38px); border-top: 1px solid var(--line); }
.bot-card-details[hidden] { display: none; }
.detail-block { padding-top: 24px; }
.detail-block h4 { margin: 0 0 9px; font-size: .93rem; color: var(--purple-deep); }
.detail-block p, .detail-block li { color: var(--muted); font-size: .9rem; }
.detail-block p { margin-bottom: 0; }
.detail-block ul { margin: 0; padding-left: 20px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.detail-actions .button { min-height: 44px; padding-inline: 18px; font-size: .86rem; }
.collapse-button { min-height: 44px; padding: 0 18px; border: 0; background: transparent; color: var(--purple); cursor: pointer; font-weight: 820; }

.ai-catalog-bridge { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(22px, 4vw, 38px); align-items: center; padding: clamp(28px, 5vw, 48px); border: 1px solid rgba(122,66,220,.2); border-radius: 30px; background: linear-gradient(135deg, rgba(234,223,255,.94), rgba(220,250,244,.9) 62%, rgba(255,255,255,.92)); box-shadow: 0 20px 58px rgba(61,29,103,.1); }
.ai-bridge-icon { width: clamp(74px, 9vw, 104px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 30% 70% 62% 38% / 42% 38% 62% 58%; background: linear-gradient(145deg, var(--purple), var(--teal)); color: white; box-shadow: 0 16px 34px rgba(92,53,168,.2); font-size: clamp(1.25rem, 3vw, 1.9rem); font-weight: 900; transform: rotate(-3deg); }
.ai-catalog-bridge h3 { margin: 7px 0 14px; font-size: clamp(1.65rem, 3vw, 2.45rem); }
.ai-catalog-bridge p { max-width: 790px; margin: 0 0 10px; }
.ai-catalog-bridge .button { margin-top: 14px; }

.service-footer { margin-top: 8px; }

@media (max-width: 1100px) {
  .service-visual { min-height: 610px; max-width: 620px; width: 100%; margin-inline: auto; }
  .messenger-demo-wrap { width: min(292px, calc(100vw - 40px)); max-width: 292px; }
  .smartphone-shell { max-width: 292px; }
}

@media (max-width: 960px) {
  .service-hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .service-page .section-pad { padding: 42px 0; }
  .service-hero { padding: 30px 0 46px; }
  .service-hero h1 { font-size: clamp(2.35rem, 11vw, 3.35rem); }
  .service-visual { min-height: 590px; }
  .messenger-demo-wrap { width: min(282px, calc(100vw - 32px)); max-width: 282px; }
  .smartphone-shell { padding: 8px; border-radius: 38px; }
  .smartphone-shell::before { top: 104px; height: 48px; }
  .smartphone-shell::after { top: 166px; height: 66px; }
  .smartphone-camera { top: 14px; width: 76px; height: 20px; }
  .smartphone-shell { max-width: 282px; }
  .messenger-window { border-radius: 31px; }
  .messenger-head { min-height: 68px; padding: 19px 13px 9px; }
  .chat-log { padding: 12px; }
  .chat-bubble { max-width: 92%; font-size: .72rem; }
  .demo-choices { gap: 5px; padding-inline: 9px; }
  .demo-choices button { min-height: 52px; }
  .demo-meta { padding-inline: 9px; }
  .bot-catalog { grid-template-columns: 1fr; }
  .ai-catalog-bridge { grid-template-columns: 1fr; }
  .ai-bridge-icon { width: 72px; }
  .bot-card-summary { min-height: 0; }
  .mini-flow { margin-top: 8px; }
  .bot-card { scroll-margin-top: 78px; }
  .catalog-section { scroll-margin-top: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .bot-card, .demo-choices button, .scenario-dots i { transition: none; }
  .chat-bubble, .demo-resource { animation: none; }
  .chat-log { scroll-behavior: auto; }
}
