/* /ai-solutions — page styles on top of co.css (dark theme) */

.ai-hero { padding-top: clamp(48px, 7vw, 96px); }
.ai-facts { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.ai-facts li { padding: 18px 16px 0 0; }
.ai-facts li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.ai-facts b { display: block; font-size: 1.25rem; letter-spacing: -.02em; }
.ai-facts span { display: block; color: var(--ink-2); font-size: var(--t-small); margin-top: 4px; }

.ai-device { margin: 0; display: grid; justify-items: center; gap: 18px; }
.ai-device img { width: min(100%, 460px); height: auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,.55)); }
.ai-device figcaption { font-size: var(--t-small); color: var(--ink-3); text-align: center; }

/* hardware lineup */
.hw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .hw { grid-template-columns: 1fr; } }
.hw-card { background: var(--bg-2); border-radius: var(--r-lg); padding: clamp(28px, 3.4vw, 44px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.hw-img { height: clamp(150px, 16vw, 200px); width: 100%; display: grid; place-items: center; margin-bottom: 28px; }
.hw-img img { max-height: 100%; max-width: min(100%, 340px); width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0,0,0,.5)); }
.hw-card h3 { font-size: clamp(1.375rem, 1.15rem + .7vw, 1.75rem); letter-spacing: -.022em; margin-bottom: 8px; }
.hw-card p { color: var(--ink-2); max-width: 40ch; margin: 0; }
.hw-card .hw-note { margin-top: 14px; font-size: var(--t-small); color: var(--ink-3); }
.hw-slides { position: relative; }
.hw-slides img { position: absolute; inset: 0; margin: auto; opacity: 0; transform: translateX(18px) scale(.985);
  transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
.hw-slides img.is-on { opacity: 1; transform: none; }
.hw-slides img.is-out { opacity: 0; transform: translateX(-18px) scale(.985); }
@media (prefers-reduced-motion: reduce) { .hw-slides img, .hw-slides img.is-out { transform: none; } }
.ai-monitor-tag i, .live-dot { display: none; }

/* tabs */
.ai-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--bg-3); margin-bottom: 20px; }
.ai-demo-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2); font-size: var(--t-small); font-weight: 550; cursor: pointer;
  transition: color var(--dur-ui) var(--ease-out), background-color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.ai-demo-btn:hover { color: var(--ink); }
.ai-demo-btn:active { transform: scale(.97); }
.ai-demo-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }

.ai-stage { border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-1); overflow: hidden; }
.ai-demo-video { display: none; }
.ai-demo-video.active { display: block; }
.ai-demo-video > video { width: 100%; max-height: 72vh; background: #000; display: block; object-fit: contain; }

/* emotion panel */
.emo-panel { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; }
.emo-left { padding: 20px; border-right: 1px solid var(--line); }
.emo-right { padding: 20px; display: grid; gap: 16px; align-content: start; }
.emo-video-wrap { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: #050506; }
#emoLocalVideo { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; top: 0; left: 0; }
#emoProcessedFrame { width: 100%; height: 100%; object-fit: cover; }
#emoProcessedFrame[src=""] { visibility: hidden; }
.emo-video-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 28px; color: var(--ink-3); }
.emo-video-placeholder h3 { color: var(--ink); font-size: 1.25rem; letter-spacing: -.02em; }
.emo-video-placeholder p { margin: 0; font-size: var(--t-small); color: var(--ink-2); max-width: 40ch; }
.emo-stats-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px;
  border-radius: 12px; background: rgba(0,0,0,.62); color: rgba(255,255,255,.75); font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.emo-stats-bar b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.emo-controls { display: flex; gap: 10px; margin-top: 16px; }
.emo-btn-start.active { background: #30D158; color: #04140A; }

.emo-box { border-radius: var(--r-md); background: var(--bg-2); padding: 16px; }
.emo-box-head { display: flex; align-items: center; gap: 8px; font-size: var(--t-small); font-weight: 600; margin-bottom: 12px; }
.emo-model { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.emo-pulse, .emo-narrative-dot { display: none; }
.emo-pulse.live { background: #30D158; box-shadow: 0 0 0 0 rgba(48,209,88,.6); animation: emoPulse 1.6s var(--ease-out) infinite; }
.emo-narrative-dot.busy { background: var(--accent); animation: emoBlink 1s steps(1) infinite; }
@keyframes emoPulse { 70% { box-shadow: 0 0 0 8px rgba(48,209,88,0); } 100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); } }
@keyframes emoBlink { 50% { opacity: .3; } }
.emo-card-area { display: grid; gap: 10px; min-height: 120px; }
.emo-empty { display: grid; place-items: center; min-height: 120px; color: var(--ink-3); font-size: var(--t-small); text-align: center; }
.emo-empty p { margin: 0; }
.emo-narrative-text { font-size: var(--t-small); line-height: 1.55; color: var(--ink-2); min-height: 64px; }

.emo-card { border-radius: 14px; background: var(--card); padding: 14px; transition: opacity var(--dur-ui) var(--ease-out); }
.emo-card-head { display: flex; align-items: center; gap: 8px; font-size: var(--t-micro); color: var(--ink-3); font-weight: 600; letter-spacing: .05em; }
.emo-chip { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: var(--r-pill); background: var(--bg-3); color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.emo-chip-warn { color: #FFD60A; }
.emo-hero { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.emo-gauge { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.emo-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.emo-gauge-bg { fill: none; stroke: var(--bg-3); stroke-width: 6; }
.emo-gauge-fg { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 300ms var(--ease-out); }
.emo-gauge-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 650; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.emo-gauge-num i { font-style: normal; font-size: .7em; color: var(--ink-3); }
.emo-hero-txt { flex: 1; min-width: 0; }
.emo-card-label { font-size: 1.25rem; font-weight: 650; text-transform: capitalize; letter-spacing: -.02em; }
.emo-card-conf { font-size: var(--t-micro); color: var(--ink-3); }
.emo-spark { width: 100%; height: 28px; margin-top: 6px; }
.emo-spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.emo-spark-ph { height: 28px; margin-top: 6px; }
.emo-bars { display: grid; gap: 6px; }
.emo-bar-row { display: grid; grid-template-columns: 76px 1fr 46px; align-items: center; gap: 8px; font-size: var(--t-micro); }
.emo-bar-lbl { color: var(--ink-2); text-transform: capitalize; }
.emo-bar-track { height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.emo-bar-fill { height: 100%; border-radius: 3px; transition: width 300ms var(--ease-out); }
.emo-bar-val { text-align: right; font-family: var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.emo-rest { display: flex; justify-content: space-between; font-size: var(--t-micro); color: var(--ink-3); padding-top: 4px; border-top: 1px solid var(--line); }
.emo-rest-v { font-family: var(--mono); }

/* chat */
.ai-chat-split { align-items: start; }
.ai-chat-split.reverse { grid-template-columns: 1fr 1.05fr; }
.ai-specs { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.ai-specs li { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.ai-specs li::before { content: ""; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23FF8A2B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }

.llm-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.llm-mode { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: left; border-radius: 14px;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: border-color var(--dur-ui) var(--ease-out), background-color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.llm-mode:hover { border-color: var(--line-2); }
.llm-mode:active { transform: scale(.98); }
.llm-mode.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.llm-mode-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-3); color: var(--ink-2); }
.llm-mode.active .llm-mode-icon { color: var(--accent); }
.llm-mode b { display: block; font-size: var(--t-small); font-weight: 600; letter-spacing: -.01em; }
.llm-mode small { display: block; font-size: var(--t-micro); color: var(--ink-3); }

.chat { display: flex; flex-direction: column; height: min(640px, 78vh); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-2); overflow: hidden; }
.section-tint .chat { background: var(--bg); }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-id { display: flex; align-items: center; gap: 10px; }
.chat-id b { display: block; font-size: var(--t-small); }
.chat-id small { display: block; font-size: var(--t-micro); color: var(--ink-3); }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--t-small);
  background: #FF8A2B; color: #1D1D1F; }
.chat-avatar.tara { background: #2E86C1; color: #fff; }
.chat-clear { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--ink-2); font-size: var(--t-micro); font-weight: 600; cursor: pointer; transition: color var(--dur-ui) var(--ease-out), border-color var(--dur-ui) var(--ease-out); }
.chat-clear:hover { color: var(--ink); border-color: var(--line-2); }

.llm-chat-messages, .tara-chat-messages { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.llm-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; }
.llm-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.llm-msg-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: #FF8A2B; color: #1D1D1F; }
.tara-msg-avatar { background: #2E86C1; color: #fff; }
.llm-msg-user .llm-msg-avatar { background: var(--bg-3); color: var(--ink-2); font-size: 9px; }
.llm-msg-content { padding: 10px 14px; border-radius: 18px; border-top-left-radius: 6px; background: var(--bg-3); font-size: .9375rem; line-height: 1.55; min-width: 0; }
.llm-msg-user .llm-msg-content { background: var(--accent); color: var(--accent-ink); border-radius: 18px; border-top-right-radius: 6px; }
.llm-msg-text { overflow-wrap: anywhere; }
.llm-msg-text .md-pre { margin: 8px 0; padding: 12px; border-radius: 10px; background: #000; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.llm-msg-text .md-code { font-family: var(--mono); font-size: .85em; padding: 1px 5px; border-radius: 5px; background: var(--bg-3); }
.llm-msg-text .md-h { margin: 8px 0 4px; font-size: 1rem; letter-spacing: -.01em; }
.llm-msg-text .md-ul { margin: 6px 0; padding-left: 18px; }
.llm-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.llm-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: typing 1.2s var(--ease-in-out) infinite; }
.llm-typing span:nth-child(2) { animation-delay: .15s; }
.llm-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.llm-chat-notes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.llm-note { min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  font-size: var(--t-micro); cursor: pointer; transition: color var(--dur-ui) var(--ease-out), border-color var(--dur-ui) var(--ease-out); }
.llm-note:hover { color: var(--ink); border-color: var(--line-2); }
.chat-input { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color var(--dur-ui) var(--ease-out); }
.section-tint .chat .chat-input { background: var(--bg-2); }
.chat-input:focus-within { border-color: var(--accent); }
.llm-chat-input { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: .9375rem; line-height: 1.45;
  padding: 8px 0; max-height: 120px; }
.llm-chat-input::placeholder { color: var(--ink-3); }
.chat-send { width: 36px; height: 36px; border-radius: 50%; border: 0; flex-shrink: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); transition: transform var(--dur-press) var(--ease-out), opacity var(--dur-ui) var(--ease-out); }
.chat-send:active { transform: scale(.94); }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-foot { display: flex; justify-content: space-between; padding: 10px 16px 14px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .03em; }

/* certificate banner (created by ai.js) */
.cert-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  padding: 14px 52px 14px 18px; border-radius: var(--r-md); background: rgba(17,17,19,.92); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--ink); font-size: var(--t-small);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
.cert-msg { display: inline-flex; align-items: center; gap: 10px; }
.cert-msg svg { color: var(--accent); flex-shrink: 0; }
.cert-hint { color: var(--ink-3); font-size: var(--t-micro); }
.cert-close { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; }
.cert-close:hover { color: var(--ink); }

@media (max-width: 900px) {
  .emo-panel { grid-template-columns: 1fr; }
  .emo-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-chat-split.reverse { grid-template-columns: 1fr; }
  .ai-chat-split.reverse > :first-child { order: 2; }
}
@media (max-width: 560px) {
  .ai-facts { grid-template-columns: 1fr; }
  .ai-facts li + li { padding-left: 0; border-left: 0; }
  .llm-modes { grid-template-columns: 1fr; }
  .ai-tabs { display: flex; border-radius: var(--r-md); }
  .ai-demo-btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .emo-pulse.live, .emo-narrative-dot.busy, .llm-typing span { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .cert-banner, .emo-stats-bar, .ai-monitor-tag { background: #111113; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 560px) {
  .cert-banner { left: 8px; right: 8px; bottom: 8px; padding: 12px 48px 12px 14px; justify-content: flex-start; font-size: var(--t-micro); }
  .cert-hint { display: none; }
}
