/* Sen chat: styles for the new pieces (uploads, copy, Stop, rink diagrams) in
   both views, then the redesign's restyle of the whole panel and Sen settings.
   Everything in the second half is scoped to body.v3-on, so the classic view
   only gains the new controls and keeps its look. */

/* ── New pieces, both views ─────────────────────────────────────────── */
.sen-ico-v3 { display: none; }

.sen-attach-btn {
  width: 44px; height: 44px; min-width: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #E7ECF1; border-radius: var(--r-pill, 999px); background: #fff;
  color: #566579; cursor: pointer; padding: 0; touch-action: manipulation;
}
.sen-attach-btn:hover { color: #2C3440; border-color: rgba(44,52,64,0.22); }
.sen-attach-btn:focus-visible,
.sen-act:focus-visible,
.sen-chip-x:focus-visible,
.sen-stop:focus-visible { outline: 2px solid #6E86A6; outline-offset: 2px; }

.chat-input-area { flex-wrap: wrap; }
.sen-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.sen-chips[hidden] { display: none; }
.sen-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 4px; border: 1px solid rgba(44,52,64,0.12); border-radius: 8px;
  background: #fff; font-size: 12px; color: #2C3440; line-height: 1.25;
}
.sen-chip-thumb {
  width: 32px; height: 32px; border-radius: 5px; object-fit: cover; flex: none;
  background: #E7ECF1; display: grid; place-items: center; color: #7A8698;
}
.sen-chip-meta { display: flex; flex-direction: column; min-width: 0; }
.sen-chip-meta b { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sen-chip-meta small { color: #7A8698; font-size: 11px; }
.sen-chip-x {
  width: 24px; height: 24px; border: 0; background: none; border-radius: 5px;
  color: #7A8698; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.sen-chip-x:hover { background: #E7ECF1; color: #2C3440; }
.sen-attach-err { width: 100%; margin: 0; font-size: 12px; line-height: 1.4; color: #A8443C; }
.sen-attach-err:empty { display: none; }
.sen-chips-sent { margin-bottom: 6px; }
.chat-bubble-row.user .sen-chips-sent .sen-chip { background: rgba(255,255,255,0.92); }
.chat-panel.sen-drop { outline: 2px dashed #6E86A6; outline-offset: -6px; }

/* Copy under each reply */
.sen-acts { display: flex; gap: 2px; margin: 2px 0 0 -6px; }
.sen-act {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px;
  border: 0; background: none; border-radius: 6px; font: inherit; font-size: 12px; color: #7A8698; cursor: pointer;
}
.sen-act:hover { background: #E7ECF1; color: #2C3440; }
.sen-act.is-done { color: #2C3440; }
.sen-tip {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: #2C3440; color: #fff; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 5px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s;
}
.sen-act:hover .sen-tip, .sen-act:focus-visible .sen-tip, .sen-act.is-done .sen-tip { opacity: 1; }
@media (hover: none) { .sen-tip { display: none; } }

/* Thinking line with Stop */
.chat-thinking .sen-thinking-label { display: none; }
.sen-stop {
  margin-left: 6px; border: 1px solid rgba(44,52,64,0.22); background: #fff; color: #2C3440;
  font: inherit; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  align-self: center; animation: none !important; width: auto !important; height: auto !important; opacity: 1 !important;
}
.sen-stop:hover { border-color: #2C3440; }
.chat-thinking { align-items: center; }
.sen-stopped-note { align-self: flex-start; font-size: 12px; color: #7A8698; margin: -4px 0 0; }

/* Rink diagram inside a reply */
.sen-rink { border: 1px solid rgba(44,52,64,0.12); border-radius: 10px; background: #fff; padding: 10px 10px 8px; margin: 4px 0 10px;
  word-break: normal; overflow-wrap: normal; }
/* Only the rink itself stretches to the card; legend swatches and the Replay icon keep their own size. */
.sen-rink > svg { display: block; width: 100%; height: auto; }
.sen-rink-legend svg, .sen-rink-foot svg { flex: none; display: block; }
.sen-rink-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; line-height: 1.3; color: #7A8698; margin-top: 6px; }
.sen-rink-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex: none; }
.sen-rink-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.sen-rink-foot p { margin: 0 !important; font-size: 12px; color: #7A8698; line-height: 1.4; }
.sen-rink-foot p b { color: #2C3440; font-weight: 600; }
.sen-rink-foot .sen-act { flex: none; margin: 0; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .sen-tip { transition: none; } }

/* Pieces only the redesign shows */
.sen-scout, .sen-ctx-chip, .sen-bar, .sen-mark { display: none; }
.sen-act-lbl { font-weight: 500; }

/* ── Redesign: Sen panel ───────────────────────────────────────────── */
/* The header borrows the app's dark rail, with a faint rink behind it. The
   conversation sits on paper; Sen answers with cards. Torii red marks Send. */
body.v3-on #colRight {
  --sx-mineral: #2C3440; --sx-paper: #F5F3EE; --sx-fog: #E7ECF1; --sx-steel: #6E86A6; --sx-torii: #C2524A; --sx-torii-deep: #A8443C;
  --sx-squash: #D4864A; --sx-ink-2: #566579; --sx-ink-3: #7A8698; --sx-rail-2: #8E9BAD;
  --sx-rule: rgba(44,52,64,0.10); --sx-rule-strong: rgba(44,52,64,0.20);
  --sx-lift: 0 1px 2px rgba(44,52,64,0.06), 0 6px 16px rgba(44,52,64,0.06);
}
body.v3-on #colRight .sen-ico-classic { display: none; }
body.v3-on #colRight .sen-ico-v3 { display: block; }
body.v3-on #colRight .chat-panel {
  background: var(--sx-paper); border: 0; border-radius: 0; box-shadow: none; color: var(--sx-mineral);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Header */
body.v3-on #colRight .chat-header {
  position: relative; isolation: isolate; overflow: hidden; background: var(--sx-mineral); border-bottom: 0; padding: 14px 10px 14px 18px;
}
body.v3-on #colRight .chat-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background:
    radial-gradient(circle at 88% 120%, transparent 0 58px, rgba(110,134,166,.35) 58px 59px, transparent 59px),
    linear-gradient(90deg, transparent 0 calc(72% - 1px), rgba(194,82,74,.45) calc(72% - 1px) 72%, transparent 72%),
    linear-gradient(90deg, transparent 0 calc(58% - 2px), rgba(110,134,166,.4) calc(58% - 2px) 58%, transparent 58%);
}
body.v3-on #colRight .chat-header-title { color: #fff; align-items: center; gap: 10px; letter-spacing: 0; }
body.v3-on #colRight .sen-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--sx-torii); color: #fff; flex: none;
}
body.v3-on #colRight .chat-header-copy { display: flex; flex-direction: column; gap: 0; }
body.v3-on #colRight .chat-header-name { color: #fff; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
body.v3-on #colRight .chat-header-sub { display: block; color: var(--sx-rail-2); font-size: 0.75rem; font-weight: 400; }
body.v3-on #colRight .chat-minimize-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--sx-rail-2); background: none; border: 0;
}
body.v3-on #colRight .chat-minimize-btn:hover { background: rgba(231,236,241,.10); color: #fff; }
body.v3-on #colRight .chat-minimize-btn:focus-visible { outline: 2px solid var(--sx-steel); outline-offset: 2px; }
/* The scouting strip replaces the plain context badge */
body.v3-on #colRight .chat-context-badge { display: none !important; }
body.v3-on #colRight .sen-scout:not([hidden]) {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center;
  margin: 14px -10px -14px -18px; padding: 12px 18px 14px; background: rgba(0,0,0,.16); border-top: 1px solid rgba(231,236,241,.08);
}
body.v3-on #colRight .sen-scout-av {
  width: 40px; height: 40px; border-radius: 50%; background: var(--sx-fog); color: var(--sx-mineral); display: grid; place-items: center;
  font-weight: 700; font-size: 14px; box-shadow: 0 0 0 2px var(--sx-mineral), 0 0 0 3.5px var(--sx-torii);
}
body.v3-on #colRight .sen-scout-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
body.v3-on #colRight .sen-scout-who b { color: #fff; font-size: 0.9375rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3-on #colRight .sen-scout-who span { color: var(--sx-rail-2); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3-on #colRight .sen-scout-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
body.v3-on #colRight .sen-scout-stat { padding: 0 10px; border-left: 1px solid rgba(231,236,241,.12); min-width: 0; }
body.v3-on #colRight .sen-scout-stat:first-child { padding-left: 0; border-left: 0; }
body.v3-on #colRight .sen-scout-stat small { display: block; font-size: 11px; color: var(--sx-rail-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3-on #colRight .sen-scout-stat strong {
  font-size: 1.5rem; font-weight: 650; font-stretch: 75%; font-variant-numeric: tabular-nums; color: #fff; line-height: 1.1; letter-spacing: -0.01em;
}
body.v3-on #colRight .sen-scout-stat em { display: block; font-style: normal; font-size: 0.75rem; font-weight: 600; margin-top: 1px; color: var(--sx-rail-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3-on #colRight .sen-scout-stat em.is-good { color: #8FC79A; }
body.v3-on #colRight .sen-scout-stat em.is-watch { color: var(--sx-squash); }

/* Sen's read on the athlete, as a card */
body.v3-on #colRight .dd-sen-ctx { border-bottom: 0; background: var(--sx-paper); padding: 16px 16px 0; }
body.v3-on #colRight .dd-sen-ctx-athlete-line { display: none; }
body.v3-on #colRight .dd-sen-insight-block { margin: 0; background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--sx-lift); }
body.v3-on #colRight .dd-sen-insight-kicker {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 0.75rem; font-weight: 600; color: var(--sx-torii-deep); text-transform: none; letter-spacing: 0;
}
body.v3-on #colRight .dd-sen-insight-kicker-dot {
  width: 13px; height: 11px; border-radius: 0; box-shadow: none; background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 22'%3E%3Cpath d='M1 3.2C8 1.6 18 1.6 25 3.2L24.4 5.6C17.8 4.3 8.2 4.3 1.6 5.6Z' fill='%23C2524A'/%3E%3Crect x='3.5' y='8' width='19' height='2' fill='%23C2524A'/%3E%3Crect x='6' y='4.6' width='2.4' height='16.4' fill='%23C2524A'/%3E%3Crect x='17.6' y='4.6' width='2.4' height='16.4' fill='%23C2524A'/%3E%3C/svg%3E");
}
body.v3-on #colRight .dd-sen-insight-text { font-size: 0.875rem; line-height: 1.55; color: var(--sx-mineral); font-weight: 400; }

body.v3-on #colRight .chat-messages { background: var(--sx-paper); padding: 18px 16px 8px; gap: 18px; }

/* Quick actions as tiles */
body.v3-on #colRight .chat-welcome { padding: 0; }
body.v3-on #colRight .chat-welcome-greeting { color: var(--sx-ink-2); font-size: 0.875rem; padding: 0 2px 14px; }
body.v3-on #colRight .sidebar-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.v3-on #colRight .sidebar-section-label {
  grid-column: 1 / -1; font-size: 0.8125rem; font-weight: 600; color: var(--sx-mineral); text-transform: none; letter-spacing: 0; margin: 0 2px; padding: 0;
}
body.v3-on #colRight .sidebar-quick-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; width: auto; min-height: 92px; margin: 0;
  text-align: left; background: #fff; border: 1px solid var(--sx-rule); border-radius: 12px; padding: 12px; box-shadow: none;
  font: inherit; font-size: 0.84375rem; font-weight: 600; line-height: 1.3; color: var(--sx-mineral); white-space: normal;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
body.v3-on #colRight .sidebar-quick-btn::before {
  content: ""; width: 28px; height: 28px; border-radius: 8px; flex: none; margin-bottom: 2px;
  background: var(--sx-fog) no-repeat center / 16px 16px var(--sx-icon, none);
}
body.v3-on #colRight .sidebar-quick-btn::after {
  content: attr(data-sub); font-size: 0.75rem; font-weight: 400; color: var(--sx-ink-3); line-height: 1.35;
}
body.v3-on #colRight .sidebar-quick-btn:first-of-type::before { background-color: var(--sx-torii); }
body.v3-on #colRight .sidebar-quick-btn:hover { border-color: var(--sx-rule-strong); box-shadow: var(--sx-lift); transform: translateY(-1px); background: #fff; color: var(--sx-mineral); }
body.v3-on #colRight .sidebar-quick-btn:focus-visible { outline: 2px solid var(--sx-steel); outline-offset: 2px; }
body.v3-on #colRight .sidebar-quick-btn[hidden] { display: none; }
body.v3-on #colRight .sidebar-quick-btn[data-action="summarize-week"] { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C3440' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M6 16l4-5 3 3 5-7'/%3E%3C/svg%3E"); }
body.v3-on #colRight .sidebar-quick-btn[data-action="draft-session"],
body.v3-on #colRight .sidebar-quick-btn[data-action="what-next"] { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C3440' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='14' r='5'/%3E%3Cpath d='M12.5 10.5 20 6v4l-6 2.5'/%3E%3Cpath d='M4 7 2 5'/%3E%3C/svg%3E"); }
body.v3-on #colRight .sidebar-quick-btn[data-action="generate-report"],
body.v3-on #colRight .sidebar-quick-btn[data-action="ask-development"] { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C3440' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1M9 10h6M9 14h6M9 18h3'/%3E%3C/svg%3E"); }
body.v3-on #colRight .sidebar-quick-btn[data-action="athlete-focus"] { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C3440' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Ccircle cx='12' cy='12' r='.8' fill='%232C3440'/%3E%3C/svg%3E"); }
/* The first tile's icon sits on red, so it is drawn in white */
body.v3-on #colRight .sidebar-quick-btn[data-action="summarize-week"]:first-of-type,
body.v3-on #colRight .sidebar-quick-btn[data-action="what-next"]:first-of-type { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M6 16l4-5 3 3 5-7'/%3E%3C/svg%3E"); }
body.v3-on #colRight .sidebar-quick-btn[data-action="what-next"]:first-of-type { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='14' r='5'/%3E%3Cpath d='M12.5 10.5 20 6v4l-6 2.5'/%3E%3Cpath d='M4 7 2 5'/%3E%3C/svg%3E"); }
body.v3-on #colRight .sidebar-quick-btn[data-action="ask-development"]:first-of-type { --sx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1M9 10h6M9 14h6M9 18h3'/%3E%3C/svg%3E"); }
body.v3-on #colRight .sen-quick-back {
  background: none; border: 0; padding: 2px 0; margin: 0 18px; font: inherit; font-size: 0.75rem; color: var(--sx-ink-3); box-shadow: none; align-self: flex-start;
}
body.v3-on #colRight .sen-quick-back:hover { color: var(--sx-mineral); }
body.v3-on #colRight .sen-quick-back[hidden] { display: none; }

/* Your messages: dark bubbles */
body.v3-on #colRight .chat-bubble-row.user .chat-bubble {
  background: var(--sx-mineral); color: var(--sx-fog); max-width: 84%; padding: 9px 13px; border-radius: 14px 14px 4px 14px; font-size: 0.875rem; line-height: 1.5;
}
body.v3-on #colRight .chat-bubble-row.user .sen-chips-sent .sen-chip { background: rgba(231,236,241,.10); border-color: transparent; color: var(--sx-fog); }
body.v3-on #colRight .chat-bubble-row.user .sen-chips-sent .sen-chip-meta small { color: var(--sx-rail-2); }

/* Sen's answers: a torii avatar, a name line, then the answer */
body.v3-on #colRight .chat-bubble-row.assistant { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-items: start; }
body.v3-on #colRight .chat-bubble-row.assistant::before {
  content: ""; grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 7px; margin-top: 1px;
  background: var(--sx-mineral) no-repeat center / 14px 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 22'%3E%3Cpath d='M1 3.2C8 1.6 18 1.6 25 3.2L24.4 5.6C17.8 4.3 8.2 4.3 1.6 5.6Z' fill='%23FFFFFF'/%3E%3Crect x='3.5' y='8' width='19' height='2' fill='%23FFFFFF'/%3E%3Crect x='6' y='4.6' width='2.4' height='16.4' fill='%23FFFFFF'/%3E%3Crect x='17.6' y='4.6' width='2.4' height='16.4' fill='%23FFFFFF'/%3E%3C/svg%3E");
}
body.v3-on #colRight .chat-bubble-row.assistant > .chat-bubble,
body.v3-on #colRight .chat-bubble-row.assistant > .sen-acts { grid-column: 2; }
body.v3-on #colRight .chat-bubble-row.assistant .chat-bubble {
  background: none; padding: 0; border-radius: 0; max-width: 100%; width: 100%; font-size: 0.875rem; line-height: 1.6; color: var(--sx-mineral);
}
body.v3-on #colRight .chat-bubble-row.assistant .chat-bubble::before {
  content: "Sen"; display: block; font-size: 0.75rem; font-weight: 600; color: var(--sx-mineral); line-height: 1.4; margin-bottom: 4px;
}
body.v3-on #colRight .sen-md p { margin: 0 0 10px; }
body.v3-on #colRight .sen-md strong { font-weight: 650; }
body.v3-on #colRight .sen-md h3 { font-size: 0.90625rem; font-weight: 650; letter-spacing: -0.005em; margin: 16px 0 6px; color: var(--sx-mineral); }
body.v3-on #colRight .sen-md h4 { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; margin: 12px 0 4px; color: var(--sx-mineral); }
body.v3-on #colRight .sen-md ul { margin: 0 0 10px; padding-left: 18px; }
body.v3-on #colRight .sen-md li::marker { color: var(--sx-steel); }
/* A numbered list reads as a plan: a white card with numbered steps */
body.v3-on #colRight .sen-md ol {
  list-style: none; counter-reset: sx; margin: 4px 0 12px; padding: 0; background: #fff; border-radius: 12px; box-shadow: var(--sx-lift); overflow: hidden;
}
body.v3-on #colRight .sen-md ol > li {
  counter-increment: sx; position: relative; margin: 0; padding: 10px 14px 10px 46px; border-top: 1px solid var(--sx-rule); line-height: 1.45;
}
body.v3-on #colRight .sen-md ol > li:first-child { border-top: 0; }
body.v3-on #colRight .sen-md ol > li::before {
  content: counter(sx); position: absolute; left: 14px; top: 10px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--sx-mineral); display: grid; place-items: center; box-sizing: border-box;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
body.v3-on #colRight .sen-md ol > li:first-child::before { background: var(--sx-torii); border-color: var(--sx-torii); color: #fff; }
body.v3-on #colRight .sen-md ol ul { margin: 4px 0 0; }
body.v3-on #colRight .chat-inline-link { color: var(--sx-mineral); font-weight: 600; }
body.v3-on #colRight .ai-http-status { color: var(--sx-ink-3); font-size: 0.75rem; margin-top: 4px; }

/* Drill card */
body.v3-on #colRight .sen-rink { border: 0; border-radius: 12px; background: #fff; box-shadow: var(--sx-lift); padding: 10px 10px 4px; margin: 4px 0 12px; }
body.v3-on #colRight .sen-rink > svg { border-radius: 8px; background: #F7FAFC; }
body.v3-on #colRight .sen-rink-legend { padding: 2px 4px 0; }
body.v3-on #colRight .sen-rink-foot { padding: 4px 4px 8px; }
body.v3-on #colRight .sen-rink-foot p { font-size: 0.78125rem; color: var(--sx-ink-2); line-height: 1.45; }
body.v3-on #colRight .sen-rink-foot p b { display: block; color: var(--sx-mineral); font-size: 0.875rem; font-weight: 650; margin-bottom: 1px; }
body.v3-on #colRight .sen-rink-foot .sen-act { border: 1px solid var(--sx-rule-strong); background: #fff; border-radius: 999px; padding: 0 10px; color: var(--sx-mineral); font-weight: 600; }
body.v3-on #colRight .sen-rink-foot .sen-act:hover { border-color: var(--sx-mineral); }

/* Copy and Listen */
body.v3-on #colRight .sen-acts { margin: 6px 0 0 -8px; gap: 2px; }
body.v3-on #colRight .sen-acts .sen-act { color: var(--sx-ink-3); border-radius: 999px; }
body.v3-on #colRight .sen-acts .sen-act:hover { background: #fff; color: var(--sx-mineral); }
body.v3-on #colRight .sen-acts .sen-act.is-on { background: #fff; color: var(--sx-torii-deep); }

/* Thinking: Sen's mark breathes, a bar runs, Stop sits on the right */
body.v3-on #colRight .chat-thinking {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 6px; align-items: center; align-self: stretch;
  background: none; padding: 0; border-radius: 0; font-size: 0.8125rem; color: var(--sx-ink-2);
}
body.v3-on #colRight .chat-thinking::before {
  content: ""; width: 26px; height: 26px; border-radius: 7px; grid-row: 1;
  background: var(--sx-mineral) no-repeat center / 14px 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 22'%3E%3Cpath d='M1 3.2C8 1.6 18 1.6 25 3.2L24.4 5.6C17.8 4.3 8.2 4.3 1.6 5.6Z' fill='%23FFFFFF'/%3E%3Crect x='3.5' y='8' width='19' height='2' fill='%23FFFFFF'/%3E%3Crect x='6' y='4.6' width='2.4' height='16.4' fill='%23FFFFFF'/%3E%3Crect x='17.6' y='4.6' width='2.4' height='16.4' fill='%23FFFFFF'/%3E%3C/svg%3E");
  animation: sxBreathe 1.6s ease-in-out infinite;
}
@keyframes sxBreathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
body.v3-on #colRight .chat-thinking > span:not(.sen-thinking-label):not(.sen-bar) { display: none; }
body.v3-on #colRight .chat-thinking .sen-thinking-label {
  display: block; grid-column: 2; grid-row: 1; width: auto; height: auto; background: none; animation: none; opacity: 1; border-radius: 0;
}
body.v3-on #colRight .chat-thinking .sen-stop { grid-column: 3; grid-row: 1; margin: 0; }
body.v3-on #colRight .chat-thinking .sen-bar {
  display: block; grid-column: 2 / -1; grid-row: 2; height: 3px; border-radius: 3px; background: var(--sx-fog); overflow: hidden;
  width: auto !important; opacity: 1 !important; animation: none !important;
}
body.v3-on #colRight .chat-thinking .sen-bar::after {
  content: ""; display: block; width: 40%; height: 100%; background: var(--sx-steel); border-radius: 3px; animation: sxSlide 1.4s ease-in-out infinite;
}
@keyframes sxSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* Composer: a white dock floating on paper */
body.v3-on #colRight .chat-input-area {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 2px; row-gap: 6px; align-items: center;
  margin: 8px 12px 12px; padding: 10px 8px 8px 14px; background: #fff; border: 0; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(44,52,64,.08), 0 8px 24px rgba(44,52,64,.10);
}
body.v3-on #colRight .chat-input-area:focus-within { box-shadow: 0 0 0 2px var(--sx-steel), 0 8px 24px rgba(44,52,64,.10); }
body.v3-on #colRight .chat-input-area > .sen-chips,
body.v3-on #colRight .chat-input-area > .sen-attach-err,
body.v3-on #colRight .chat-input-area > .chat-input { grid-column: 1 / -1; }
body.v3-on #colRight .chat-btn-stack { display: contents; }
body.v3-on #colRight .chat-input {
  border: 0; background: none; padding: 0 6px 0 0; border-radius: 0; min-height: 42px; max-height: 140px;
  font: inherit; font-size: 16px; line-height: 1.5; color: var(--sx-mineral); box-shadow: none;
}
@media (min-width: 769px) { body.v3-on #colRight .chat-input { font-size: 0.875rem; } }
body.v3-on #colRight .chat-input:focus { border: 0; box-shadow: none; }
body.v3-on #colRight .chat-input::placeholder { color: var(--sx-ink-3); }
body.v3-on #colRight .sen-attach-btn,
body.v3-on #colRight .chat-input-settings-btn {
  width: 32px; height: 32px; min-width: 32px; min-height: 32px; border: 0; border-radius: 8px; background: none; color: var(--sx-ink-3); display: grid; place-items: center; padding: 0;
}
body.v3-on #colRight .sen-attach-btn { grid-column: 1; }
body.v3-on #colRight .chat-input-settings-btn { grid-column: 2; }
body.v3-on #colRight .sen-attach-btn:hover,
body.v3-on #colRight .chat-input-settings-btn:hover { background: var(--sx-fog); color: var(--sx-mineral); }
body.v3-on #colRight .chat-input-settings-btn:focus-visible { outline: 2px solid var(--sx-steel); outline-offset: 2px; }
body.v3-on #colRight .sen-ctx-chip:not([hidden]) {
  display: inline-flex; grid-column: 3; justify-self: start; align-items: center; gap: 6px; max-width: 100%; margin-left: 6px; min-width: 0;
  font-size: 0.75rem; color: var(--sx-ink-2); background: var(--sx-fog); border-radius: 999px; padding: 3px 10px 3px 4px;
}
body.v3-on #colRight .sen-ctx-chip i {
  width: 18px; height: 18px; border-radius: 50%; background: var(--sx-mineral); color: var(--sx-fog); font-style: normal; font-size: 9px; font-weight: 700; display: grid; place-items: center; flex: none;
}
body.v3-on #colRight .sen-ctx-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3-on #colRight .chat-send-btn,
body.v3-on.mobile-trainer #colRight .chat-send-btn {
  grid-column: 4; width: 34px; height: 34px; min-width: 34px; min-height: 34px; border-radius: 50%; border: 0;
  background: var(--sx-torii); color: #fff; display: grid; place-items: center;
}
body.v3-on #colRight .chat-send-btn:hover,
body.v3-on.mobile-trainer #colRight .chat-send-btn:hover { background: var(--sx-torii-deep); }
body.v3-on #colRight .chat-send-btn:disabled { opacity: 1; background: var(--sx-fog); color: var(--sx-ink-3); }
body.v3-on #colRight .chat-send-btn:focus-visible { outline: 2px solid var(--sx-steel); outline-offset: 2px; }

/* Expand makes the panel wider from the right edge; the conversation keeps a readable column */
body.v3-on[data-page="app"] .page-layout.chat-expanded .col-right:not(.chat-overlay-mode) {
  flex: none; left: auto; right: 0; width: min(920px, 100vw); max-width: 100vw;
}
body.v3-on .page-layout.chat-expanded #colRight .chat-messages > *,
body.v3-on .page-layout.chat-expanded #colRight .dd-sen-insight-block { max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
body.v3-on .page-layout.chat-expanded #colRight .chat-input-area { width: calc(100% - 24px); max-width: 744px; margin-left: auto; margin-right: auto; }
body.v3-on .page-layout.chat-expanded #colRight .sen-quick-back { width: 100%; max-width: 720px; margin: 0 auto; text-align: left; align-self: center; }
@media (prefers-reduced-motion: no-preference) {
  body.v3-on[data-page="app"] .page-layout .col-right:not(.chat-overlay-mode) { transition: width .2s ease; }
}
@media (prefers-reduced-motion: reduce) {
  body.v3-on #colRight .chat-thinking::before, body.v3-on #colRight .chat-thinking .sen-bar::after { animation: none; }
  body.v3-on #colRight .sidebar-quick-btn { transition: none; }
}

/* ── Redesign: Sen settings ─────────────────────────────────────────── */
body.v3-on .settings-overlay { background: rgba(44,52,64,0.32); backdrop-filter: none; }
body.v3-on .settings-modal {
  background: #fff; border: 1px solid rgba(44,52,64,0.12); border-radius: 10px; box-shadow: 0 16px 40px rgba(44,52,64,0.18);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: #2C3440;
}
body.v3-on .settings-header { background: #fff; border-bottom: 1px solid rgba(44,52,64,0.12); padding: 18px 16px 16px 24px; align-items: flex-start; }
body.v3-on .settings-title { color: #2C3440; font-size: 1.375rem; font-weight: 650; letter-spacing: -0.015em; text-transform: none; }
body.v3-on .settings-subtitle { color: #566579; font-size: 0.875rem; margin-top: 2px; }
body.v3-on .settings-close { width: 32px; height: 32px; border-radius: 8px; background: none; border: 0; color: #7A8698; display: grid; place-items: center; }
body.v3-on .settings-close:hover { background: #E7ECF1; color: #2C3440; }
body.v3-on .settings-body { padding: 8px 24px; gap: 0; }
body.v3-on .settings-field { padding: 16px 0; margin: 0; border-bottom: 1px solid rgba(44,52,64,0.12); }
body.v3-on .settings-field:last-child { border-bottom: 0; }
body.v3-on .settings-field label {
  display: block; font-size: 0.8125rem; font-weight: 600; color: #2C3440; text-transform: none; letter-spacing: 0; margin: 0 0 6px;
}
body.v3-on .settings-field select,
body.v3-on .settings-field input,
body.v3-on .settings-field textarea {
  width: 100%; border: 1px solid rgba(44,52,64,0.22); border-radius: 8px; background-color: #fff; color: #2C3440;
  font: inherit; font-size: 0.875rem; padding: 9px 12px; box-shadow: none;
}
body.v3-on .settings-field select:focus,
body.v3-on .settings-field input:focus,
body.v3-on .settings-field textarea:focus { outline: 0; border-color: #6E86A6; box-shadow: 0 0 0 3px rgba(110,134,166,0.18); }
body.v3-on .settings-field .field-hint { color: #7A8698; font-size: 0.75rem; margin-top: 6px; }
body.v3-on .settings-footer {
  display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; padding: 16px 24px 20px;
  border-top: 1px solid rgba(44,52,64,0.12); background: #fff;
}
body.v3-on .settings-footer .btn {
  width: auto; margin: 0; background: #C2524A; color: #fff; border-radius: 8px; padding: 9px 16px; font-size: 0.875rem; font-weight: 600;
}
body.v3-on .settings-footer .btn:hover { background: #A8443C; }
body.v3-on .settings-footer .btn-ghost {
  width: auto; margin: 0; background: none; color: #566579; border: 1px solid rgba(44,52,64,0.22); border-radius: 8px;
  padding: 9px 16px; font-size: 0.875rem; font-weight: 500;
}
body.v3-on .settings-footer .btn-ghost:hover { color: #2C3440; border-color: #2C3440; }

/* ── Sen on a phone: a full-screen sheet ─────────────────────────────── */
@media (max-width: 768px) {
  /* One clear way out (an X), and no expand button: the chat already fills the screen */
  body.v3-on #colRight #chatFullscreenBtn { display: none; }
  body.v3-on #colRight #chatMinimizeBtn .sen-min-dash { display: none; }
  body.v3-on #colRight #chatMinimizeBtn .sen-min-x { display: block !important; }
  body.v3-on #colRight .chat-minimize-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  /* The rink lines behind the header cross the buttons at this width, so the phone header is plain */
  body.v3-on #colRight .chat-header::before { display: none; }
  body.v3-on #colRight .chat-header { padding: calc(10px + env(safe-area-inset-top, 0px)) 6px 10px 16px; }
  /* The sheet is one colour to the bottom edge, with room for the home indicator */
  body.v3-on #colRight.mob-ai-open { background: var(--sx-paper); }
  body.v3-on #colRight .chat-panel { padding-bottom: env(safe-area-inset-bottom, 0px); }
  /* Quick actions: full-width rows, icon on the left, lined up with the greeting above them */
  body.v3-on #colRight .chat-welcome-greeting { font-size: 0.9375rem; padding: 0 0 16px; }
  body.v3-on #colRight .sidebar-quick-actions { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: none; margin: 0; gap: 8px; align-items: stretch; justify-items: stretch; }
  body.v3-on #colRight .sidebar-section-label { margin: 0 0 2px; }
  body.v3-on #colRight .sidebar-quick-btn {
    display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center;
    width: 100%; min-height: 64px; padding: 12px 14px; font-size: 0.9375rem;
  }
  body.v3-on #colRight .sidebar-quick-btn::before { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; background-size: 18px 18px; }
  body.v3-on #colRight .sidebar-quick-btn::after { grid-column: 2; font-size: 0.8125rem; }
}

/* Quick actions are full-width rows at every width: the panel is never wider than 440px, and three tiles in two columns left one stranded */
body.v3-on #colRight .sidebar-quick-actions { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: none; margin: 0; gap: 8px; align-items: stretch; justify-items: stretch; }
body.v3-on #colRight .sidebar-section-label { margin: 0 0 2px; }
body.v3-on #colRight .sidebar-quick-btn {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center;
  width: 100%; min-height: 64px; padding: 12px 14px;
}
body.v3-on #colRight .sidebar-quick-btn::before { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; background-size: 18px 18px; }
body.v3-on #colRight .sidebar-quick-btn::after { grid-column: 2; }
body.v3-on #colRight .sidebar-quick-btn[hidden] { display: none; }

/* Athletes and parents on a phone: Sen opens as the same full-screen sheet the trainer gets */
@media (max-width: 768px) {
  body.v3-on.v3-portal[data-page="app"] .page-layout:not(.chat-minimized) #colRight:not(.chat-overlay-mode) {
    display: flex !important; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    width: 100% !important; max-width: none; height: auto !important; z-index: 1200; background: var(--sx-paper); overflow: hidden;
  }
  body.v3-on.v3-portal[data-page="app"] .page-layout:not(.chat-minimized) #colRight .chat-panel { height: 100%; flex: 1; min-height: 0; }
}

/* What Sen is doing while no words are arriving yet (a web search) */
.sen-live-status { margin: 6px 0 0; font-size: 0.8125rem; color: #7A8698; font-style: italic; }

