/* =============================================================================
   x-ask.css: Ask Arena floating assistant (every page) + Agent C's shared dialog
   sheet (.xp-sheet, used by play.html and my.html). Agent C.
   The assistant is a "stadium screen": dark glass in every part of the day.
   ============================================================================= */
:root { --xa-acc: var(--acc, #c6ff3d); }

/* ---------------------------------------------------------------- floating button */
.xa-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 80;
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px; border-radius: 99px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #0c162b, #050a14); color: #eef3ff; text-align: left;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--xa-acc) 45%, transparent), 0 18px 40px -14px rgba(0, 0, 0, .7), 0 0 30px -8px color-mix(in srgb, var(--xa-acc) 45%, transparent);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease, box-shadow .3s ease; font-family: var(--sans, system-ui, sans-serif); }
.xa-fab:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--xa-acc), 0 22px 46px -14px rgba(0, 0, 0, .75), 0 0 40px -6px color-mix(in srgb, var(--xa-acc) 60%, transparent); }
.xa-fab:focus-visible { outline: 3px solid var(--xa-acc); outline-offset: 3px; }
html.xa-open .xa-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
.xa-fab-txt { display: grid; line-height: 1.1; }
.xa-fab-txt small { font-family: var(--mono, monospace); font-size: .56rem; font-weight: 600; letter-spacing: .16em; color: var(--xa-acc); }
.xa-fab-txt b { font-family: var(--disp, Impact, sans-serif); font-weight: 800; font-size: 1.22rem; text-transform: uppercase; letter-spacing: .02em; }
.xa-orb { display: block; width: 46px; height: 46px; flex: none; }
.xa-orb svg { width: 100%; height: 100%; display: block; overflow: visible; }
.xa-orb-ring { transform-origin: 24px 24px; animation: xaSpin 9s linear infinite; }
@keyframes xaSpin { to { transform: rotate(360deg); } }
.xa-fab .xa-orb { animation: xaBob 3.2s ease-in-out infinite; }
@keyframes xaBob { 50% { transform: translateY(-2px); } }

/* ---------------------------------------------------------------- dialog */
.xa-wrap { position: fixed; inset: 0; z-index: 93; }
.xa-scrim { position: absolute; inset: 0; background: rgba(3, 6, 14, .45); opacity: 0; transition: opacity .25s ease; }
.xa-wrap.on .xa-scrim { opacity: 1; }
.xa-panel { --ink: #eef3ff; --mut: #9aa8c2; --line: rgba(220, 232, 255, .1); --line2: rgba(220, 232, 255, .2); --card: #0c162b; --card2: #0a1325;
  position: absolute; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); height: min(680px, calc(100vh - 32px)); height: min(680px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; color: var(--ink); font-family: var(--sans, system-ui, sans-serif);
  background: linear-gradient(180deg, rgba(10, 20, 40, .97), rgba(5, 10, 20, .98)); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--xa-acc) 32%, transparent), 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 60px -20px color-mix(in srgb, var(--xa-acc) 35%, transparent);
  transform: translateY(24px) scale(.97); opacity: 0; transform-origin: 100% 100%; transition: transform .35s cubic-bezier(.2, .75, .2, 1), opacity .25s ease; }
.xa-wrap.on .xa-panel { transform: none; opacity: 1; }
.xa-panel::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: radial-gradient(120% 50% at 50% -10%, color-mix(in srgb, var(--xa-acc) 16%, transparent), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .015) 3px 4px); }
.xa-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.xa-head .xa-orb { width: 44px; height: 44px; }
.xa-ttl { flex: 1; min-width: 0; }
.xa-hud { display: flex; align-items: center; gap: 7px; font-family: var(--mono, monospace); font-size: .6rem; font-weight: 600; letter-spacing: .18em; color: var(--xa-acc); margin: 0; }
.xa-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--xa-acc); box-shadow: 0 0 8px var(--xa-acc); animation: xaBlink 1.6s steps(2, end) infinite; }
@keyframes xaBlink { 50% { opacity: .3; } }
.xa-ttl h2 { margin: 3px 0 2px; font-family: var(--disp, Impact, sans-serif); font-size: 1.7rem; font-weight: 800; text-transform: uppercase; line-height: 1; letter-spacing: .01em; color: #fff; }
.xa-status { margin: 0; font-size: .76rem; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xa-x { width: 38px; height: 38px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink); }
.xa-x:hover { background: rgba(255, 255, 255, .1); }
.xa-scan { position: relative; height: 2px; overflow: hidden; }
.xa-scan::after { content: ''; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, var(--xa-acc), transparent); opacity: 0; }
.xa-panel.thinking .xa-scan::after { opacity: 1; animation: xaScan 1s linear infinite; }
.xa-panel.listening .xa-scan::after { opacity: 1; background: linear-gradient(90deg, transparent, #ff5a4e, transparent); animation: xaScan .8s linear infinite; }
@keyframes xaScan { to { left: 100%; } }
.xa-log { position: relative; flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; overscroll-behavior: contain; }
.xa-msg { max-width: 92%; font-size: .92rem; line-height: 1.5; animation: xaIn .35s cubic-bezier(.2, .75, .2, 1) both; }
@keyframes xaIn { from { opacity: 0; transform: translateY(8px); } }
.xa-msg p { margin: 0; }
.xa-msg.bot { align-self: flex-start; padding: 10px 13px; border-radius: 4px 16px 16px 16px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.xa-msg.bot b { color: #fff; }
.xa-msg.bare { padding: 0; background: none; border: 0; max-width: 100%; width: 100%; }
.xa-msg.me { align-self: flex-end; padding: 9px 13px; border-radius: 16px 4px 16px 16px; background: var(--xa-acc); color: #07101f; font-weight: 600; }
.xa-msg.note { align-self: flex-start; font-size: .8rem; color: var(--mut); padding: 0 4px; }
.xa-msg.typing { padding: 12px 14px; }
.xa-typing { display: inline-flex; gap: 4px; }
.xa-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--xa-acc); animation: xaDot 1s ease-in-out infinite; }
.xa-typing i:nth-child(2) { animation-delay: .15s; } .xa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes xaDot { 50% { transform: translateY(-4px); opacity: .4; } }
.xa-msg a:not(.xa-btn):not(.xa-a):not(.xa-slot):not(.xa-pick) { color: var(--xa-acc); }

/* cards */
.xa-card { border-radius: 16px; border: 1px solid var(--line2); background: rgba(6, 12, 26, .8); overflow: hidden; }
.xa-card-h { margin: 0; padding: 9px 12px; font-family: var(--mono, monospace); font-size: .62rem; font-weight: 600; letter-spacing: .16em; color: var(--xa-acc); border-bottom: 1px solid var(--line); background: rgba(198, 255, 61, .04); }
.xa-areas { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; }
.xa-areas li { --tc: var(--xa-acc); }
.xa-a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 10px 9px 14px; border-radius: 12px; text-decoration: none; color: inherit; }
.xa-a::before { content: ''; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--tc); opacity: .5; }
.xa-areas li.is-free .xa-a { padding-right: 32px; }
.xa-areas li.is-free .xa-a::before { opacity: 1; box-shadow: 0 0 8px var(--tc); }
.xa-areas li.is-free .xa-a:hover, .xa-areas li.is-free .xa-a:focus-visible { background: rgba(198, 255, 61, .08); }
.xa-a-name { display: grid; min-width: 0; }
.xa-a-name b { font-size: .95rem; }
.xa-a-name small, .xa-a-tags { font-size: .74rem; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xa-a-tags { grid-column: 1 / -1; color: #ffc061; }
.xa-a-side { display: grid; justify-items: end; gap: 3px; }
.xa-go { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--xa-acc); }
.xa-amt { font-family: var(--mono, monospace); font-weight: 700; font-size: .9rem; color: #fff; white-space: nowrap; }
.xa-amt small { font-weight: 500; color: var(--mut); }
.xa-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-family: var(--mono, monospace); font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; background: rgba(255, 255, 255, .06); color: var(--mut); border: 1px solid var(--line); }
.xa-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.xa-pill.free { color: var(--xa-acc); border-color: color-mix(in srgb, var(--xa-acc) 40%, transparent); background: color-mix(in srgb, var(--xa-acc) 10%, transparent); }
.xa-pill.held { color: #ffc061; border-color: rgba(255, 192, 97, .35); }
.xa-pill.booked { color: #ff8a80; border-color: rgba(255, 138, 128, .3); }
.xa-pill.acad { color: #e3c35c; border-color: rgba(227, 195, 92, .35); }
.xa-pill.live { color: #ff8a80; }
.xa-hrow { --tc: var(--xa-acc); padding: 10px 12px; border-top: 1px solid var(--line); }
.xa-hrow:first-of-type { border-top: 0; }
.xa-hrow-h { margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.xa-hrow-h b { font-size: .92rem; } .xa-hrow-h b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); margin-right: 7px; box-shadow: 0 0 8px var(--tc); }
.xa-hrow-h small { font-size: .72rem; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xa-hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.xa-slot { display: grid; justify-items: center; padding: 7px 4px; border-radius: 10px; text-decoration: none; color: #fff; border: 1px solid color-mix(in srgb, var(--xa-acc) 35%, transparent); background: color-mix(in srgb, var(--xa-acc) 7%, transparent); transition: background .2s ease, transform .2s ease; }
.xa-slot b { font-family: var(--mono, monospace); font-size: .82rem; }
.xa-slot small { font-size: .68rem; color: var(--mut); }
.xa-slot.pk small { color: #ffc061; }
.xa-slot:hover, .xa-slot:focus-visible { background: var(--xa-acc); color: #07101f; transform: translateY(-2px); }
.xa-slot:hover small, .xa-slot:focus-visible small { color: #07101f; }
.xa-more { align-self: center; font-family: var(--mono, monospace); font-size: .74rem; color: var(--mut); padding: 0 4px; }
.xa-picks { display: grid; gap: 6px; }
.xa-pick { --tc: var(--xa-acc); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: #fff; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--tc); }
.xa-pick:hover, .xa-pick:focus-visible { border-color: var(--xa-acc); background: rgba(198, 255, 61, .08); }
.xa-pick small { font-family: var(--mono, monospace); color: var(--mut); }
.xa-pick .bi { color: var(--xa-acc); }
.xa-rows { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; border-radius: 16px; border: 1px solid var(--line2); background: rgba(6, 12, 26, .8); }
.xa-rows li { --tc: transparent; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; box-shadow: inset 3px 0 0 var(--tc); }
.xa-rows li + li { border-top: 1px solid var(--line); border-radius: 0; }
.xa-r-main { display: grid; min-width: 0; }
.xa-r-main b { font-size: .9rem; }
.xa-r-main small { font-size: .74rem; color: var(--mut); }
.xa-r-side { display: grid; justify-items: end; gap: 3px; flex: none; text-align: right; }
.xa-r-side small { font-size: .7rem; color: var(--mut); }
.xa-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: .88rem; background: var(--xa-acc); color: #07101f; }
.xa-btn.wa { background: #1faa59; color: #fff; }
.xa-sos { padding: 12px; border-radius: 14px; background: rgba(255, 90, 78, .14); border: 1px solid rgba(255, 90, 78, .45); }
.xa-msg.sos { max-width: 100%; width: 100%; padding: 0; border: 0; background: none; }
.xa-sos-h { margin: 0 0 10px; font-weight: 800; color: #ffb3ab; display: flex; gap: 8px; align-items: center; }
.xa-sos-row { display: flex; flex-wrap: wrap; gap: 8px; }
.xa-sos-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 12px; background: #ff5a4e; color: #fff; font-weight: 800; text-decoration: none; }
.xa-sos-btn.alt { background: rgba(255, 255, 255, .1); }

/* chips + form */
.xa-chips { position: relative; display: flex; gap: 6px; padding: 8px 14px 4px; overflow-x: auto; scrollbar-width: none; flex: none; }
.xa-chips::-webkit-scrollbar { display: none; }
.xa-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); color: var(--ink); font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.xa-chip:hover, .xa-chip:focus-visible { border-color: var(--xa-acc); background: rgba(198, 255, 61, .08); }
.xa-chip.go { border-color: color-mix(in srgb, var(--xa-acc) 45%, transparent); color: var(--xa-acc); }
.xa-form { position: relative; display: flex; gap: 8px; padding: 10px 14px 8px; flex: none; }
.xa-in { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .3); color: #fff; font-size: 16px; }
.xa-in::placeholder { color: #7f8ba3; }
.xa-in:focus { outline: none; border-color: var(--xa-acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--xa-acc) 20%, transparent); }
.xa-mic, .xa-send { width: 46px; height: 46px; flex: none; border-radius: 14px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); color: #fff; font-size: 1.1rem; }
.xa-send { background: var(--xa-acc); color: #07101f; border-color: transparent; }
.xa-mic.live { background: #ff5a4e; border-color: transparent; animation: xaPulse 1.2s ease-out infinite; }
@keyframes xaPulse { from { box-shadow: 0 0 0 0 rgba(255, 90, 78, .6); } to { box-shadow: 0 0 0 12px rgba(255, 90, 78, 0); } }
.xa-foot { position: relative; margin: 0; padding: 0 16px 12px; font-size: .68rem; color: #7f8ba3; }
.xa-foot a { color: #ff8a80; }
.xa-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.xa-panel :focus-visible { outline: 2px solid var(--xa-acc); outline-offset: 2px; }

@media (max-width: 560px) {
  .xa-fab { padding: 6px; }
  .xa-fab-txt { display: none; }
  .xa-fab .xa-orb { width: 50px; height: 50px; }
  .xa-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 22px 22px 0 0; transform-origin: 50% 100%; }
}
@media print { .xa-fab, .xa-wrap { display: none !important; } }

/* =============================================================================
   Shared dialog sheet for Agent C pages (play.html, my.html)
   ============================================================================= */
html.xp-lock { overflow: hidden; }
.xp-sheet { position: fixed; inset: 0; z-index: 94; display: grid; place-items: center; padding: 16px; }
.xp-scrim { position: absolute; inset: 0; background: rgba(3, 6, 14, .6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; transition: opacity .22s ease; }
.xp-sheet.on .xp-scrim { opacity: 1; }
.xp-dlg { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px 22px 20px; border-radius: 24px;
  background: var(--card, #fff); color: var(--ink, #0a1326); border: 1px solid var(--line2, rgba(0, 0, 0, .15)); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7);
  transform: translateY(20px) scale(.97); opacity: 0; transition: transform .3s cubic-bezier(.2, .75, .2, 1), opacity .22s ease; }
.xp-dlg.wide { width: min(680px, 100%); }
.xp-sheet.on .xp-dlg { transform: none; opacity: 1; }
.xp-dlg:focus { outline: none; }
.xp-x { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line, rgba(0, 0, 0, .1)); background: var(--card2, #f5f5f5); color: inherit; z-index: 2; }
.xp-dlg-hud { margin: 0 44px 8px 0; font-family: var(--mono, monospace); font-size: .64rem; font-weight: 600; letter-spacing: .18em; color: var(--acc-text, #3b6a00); }
.xp-dlg-h { margin: 0 40px 6px 0; font-family: var(--disp, Impact, sans-serif); font-size: clamp(1.9rem, 5vw, 2.5rem); font-weight: 800; text-transform: uppercase; line-height: .95; }
.xp-dlg-sub { margin: 0 0 16px; color: var(--mut, #555); font-size: .94rem; }
.xp-dlg .xp-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.xp-dlg .xp-hint { font-size: .86rem; color: var(--mut, #555); margin-top: 10px; }
.xp-dlg .xp-err { color: var(--play-text, #c42c22); font-size: .88rem; font-weight: 600; }
@media (max-width: 560px) {
  .xp-sheet { place-items: end stretch; padding: 0; }
  .xp-dlg, .xp-dlg.wide { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; max-height: 92dvh; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .xa-orb-ring, .xa-fab .xa-orb, .xa-dot { animation: none !important; }
}
