/* SayWel, clickable. Shapes, sizes and colors follow the app's own window (lean/style.css): dark glass island,
   capsule buttons, a red Stop, labeled cue cards. Two palettes: the app's default, and color-coded (the app lets
   you set your own color for answers, résumé lines, definitions and ask-back lines). */
.sw { --ui: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
      --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
      --ease: cubic-bezier(.22, 1, .36, 1); }

/* the controls above the window */
.sw-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sw-tab { padding: 10px 16px; border: 1px solid #515967; border-radius: 10px; background: transparent; color: var(--ink);
  font: 700 1rem/1.2 system-ui, sans-serif; cursor: pointer; transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.sw-tab:hover { border-color: var(--blue); }
.sw-tab[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #132741; }
.sw-tab:focus-visible, .sw-chip:focus-visible, .sw-toggle button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sw-asklabel { margin: 4px 0 8px; font-size: .9rem; font-weight: 700; color: var(--muted); }
.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sw-chip { padding: 8px 13px; border: 1px solid #3d4350; border-radius: 999px; background: #1a1c22; color: var(--ink);
  font: 600 .93rem/1.25 system-ui, sans-serif; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.sw-chip:hover { border-color: #8aa6d6; }
.sw-chip[aria-pressed="true"] { border-color: var(--blue); background: #22324b; }

/* the screen: a video call, with SayWel at the top under the webcam */
.sw-screen { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid #2a2d35; background: #0b0c10;
  min-height: 560px; padding: 64px 18px 24px; isolation: isolate; }
.sw-tiles { position: absolute; inset: 0; z-index: -1; display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; padding: 10px; }
.sw-tile { position: relative; border-radius: 16px; background: radial-gradient(120% 90% at 50% 30%, #2b3342 0%, #161a22 60%, #101218 100%);
  display: grid; place-items: center; }
.sw-tile + .sw-tile { background: radial-gradient(120% 90% at 50% 30%, #2e2b3a 0%, #17151f 60%, #101016 100%); }
.sw-face { width: clamp(64px, 9vw, 104px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: #3a4252; color: #dfe6f3; font: 700 clamp(1.1rem, 2vw, 1.6rem)/1 var(--ui); opacity: .85; }
.sw-tile + .sw-tile .sw-face { background: #463f57; }
.sw-name { position: absolute; left: 12px; bottom: 10px; padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, .45);
  color: #e8eaf0; font: 600 .8rem/1.3 var(--ui); }
.sw-tile { box-shadow: inset 0 0 0 0 rgba(48, 209, 88, 0); transition: box-shadow .3s var(--ease); }
.sw-tile.speaking { box-shadow: inset 0 0 0 3px rgba(48, 209, 88, .85); }
.sw-caption { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); width: min(88%, 520px); padding: 8px 12px;
  border-radius: 10px; background: rgba(0, 0, 0, .62); color: #fff; font: 600 clamp(.82rem, 1.4vw, .98rem)/1.35 var(--ui); text-align: center; }
.sw-caption[hidden] { display: none; }
.sw-webcam { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%;
  background: #1d1f25; box-shadow: 0 0 0 3px #15171c; }

/* the island */
.sw-island { --island: rgba(24, 24, 27, .9); --ring: rgba(255, 255, 255, .23); --fill: rgba(118, 118, 128, .24);
  --label: #fff; --label-2: #d3d3d8; --label-3: #b6b6be; --card: rgba(0, 0, 0, .28); --rule: rgba(84, 84, 88, .6);
  --c-answer: #fafafa; --c-source: #e0e0e3; --c-definition: #fafafa; --c-ask: #d6e6ff; --c-gap: #ffd60a; --c-you: #d3d3d8;
  --c-right: #30d158; --c-almost: #ffd60a; --c-miss: #ff9f0a;
  position: relative; margin: 0 auto; width: min(100%, 600px); border-radius: 22px; background: var(--island);
  box-shadow: inset 0 0 0 1px var(--ring), 0 18px 50px rgba(0, 0, 0, .55); color: var(--label); font-family: var(--ui);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: width .32s var(--ease); }
.sw-island[data-layout="wide"] { width: min(100%, 940px); }
.sw-island[data-colors="coded"] { --c-answer: #ffffff; --c-source: #8ee6b0; --c-definition: #ffd479; --c-ask: #9cc8ff; --c-gap: #ffb27a; }
.sw-island[data-theme="light"] { --island: rgba(246, 246, 249, .96); --ring: rgba(0, 0, 0, .12); --fill: rgba(120, 120, 128, .16);
  --label: #18181b; --label-2: #3c3c43; --label-3: #6e6e76; --card: rgba(255, 255, 255, .9); --rule: rgba(60, 60, 67, .18);
  --c-answer: #18181b; --c-source: #303035; --c-definition: #18181b; --c-ask: #164a8b; --c-gap: #8a5a00; --c-you: #3c3c43;
  --c-right: #1a7f37; --c-almost: #8a5a00; --c-miss: #b3450e; box-shadow: inset 0 0 0 1px var(--ring), 0 18px 50px rgba(0, 0, 0, .4); }
.sw-island[data-theme="light"][data-colors="coded"] { --c-answer: #111114; --c-source: #0f6b3a; --c-definition: #7a4f00; --c-ask: #164a8b; --c-gap: #9a3f00; }

.sw-bar { display: flex; align-items: center; gap: 7px; min-height: 52px; padding: 6px 8px 6px 12px; font-size: 13px; color: var(--label-2); }
.sw-dots { flex: none; display: flex; align-items: center; gap: 2px; height: 14px; }
.sw-dots i { width: 3px; height: 6px; border-radius: 2px; background: #30d158; }
.sw-island[data-state="listening"] .sw-dots i { animation: sw-beat 1s var(--ease) infinite alternate; }
.sw-dots i:nth-child(2) { animation-delay: .15s !important; } .sw-dots i:nth-child(3) { animation-delay: .3s !important; } .sw-dots i:nth-child(4) { animation-delay: .45s !important; }
@keyframes sw-beat { from { height: 4px; } to { height: 14px; } }
.sw-qnum { flex: none; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--fill); color: var(--label-2);
  font: 600 12px/24px var(--ui); }
.sw-qnum:empty { display: none; }
.sw-qwrap { flex: 1; min-width: 0; }
.sw-q { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--label); font: 500 14px/1.3 var(--ui); }
.sw-status { font: 500 12px/1.3 var(--ui); color: var(--label-3); }
.sw-island[data-state="answer"] .sw-status { display: none; }
.sw-btn { flex: none; height: 30px; padding: 0 13px; border: 0; border-radius: 15px; background: var(--fill); color: var(--label);
  font: 600 13px/30px var(--ui); cursor: pointer; }
.sw-btn:hover { filter: brightness(1.15); }
.sw-btn:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.sw-hold[aria-pressed="true"] { background: #0a84ff; color: #fff; }
.sw-stop { background: rgba(255, 69, 58, .22); color: #ff6961; box-shadow: inset 0 0 0 1px rgba(255, 105, 97, .55); }
.sw-island[data-theme="light"] .sw-stop { color: #d70015; }
.sw-icon { width: 30px; padding: 0; background: transparent; color: var(--label-3); display: grid; place-items: center; }
.sw-icon:hover, .sw-icon[aria-expanded="true"] { background: var(--fill); color: var(--label); }

/* the menu: This call (switch mid-call), as in the app */
.sw-menu { position: absolute; z-index: 3; top: 50px; right: 8px; width: 270px; padding: 6px; border-radius: 14px;
  background: rgba(34, 34, 39, .99); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 14px 36px rgba(0, 0, 0, .46); color: #fff; }
.sw-menu[hidden], .sw-menu-modes[hidden] { display: none; }
.sw-menu-modes { display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 2px 0 10px; }
.sw-menu-cap { flex: 1; font: 500 13px var(--ui); color: #fff; }
.sw-menu-modes button { height: 26px; padding: 0 8px; border: 0; border-radius: 13px; background: transparent; color: #b6b6be;
  font: 500 12px var(--ui); cursor: pointer; }
.sw-menu-modes button[aria-checked="true"] { background: #636366; color: #fff; font-weight: 600; }
.sw-menu-modes button:focus-visible { outline: 2px solid #0a84ff; }
.sw-menu-foot { margin: 4px 10px 6px; font: 500 12px/1.35 var(--ui); color: #b6b6be; }

/* the answer */
.sw-body { display: grid; gap: 14px; padding: 2px 14px 14px; }
.sw-body:empty { display: none; }
.sw-island[data-layout="wide"] .sw-body { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.sw-main, .sw-side { display: grid; gap: 10px; align-content: start; }
.sw-side:empty { display: none; }
.sw-cue { display: grid; gap: 5px; animation: sw-in .45s var(--ease) both; }
@keyframes sw-in { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.sw-tag { font: 600 12.5px/1.2 var(--ui); color: var(--label-3); padding-left: 2px; }
.sw-text { display: block; padding: 11px 14px; border-radius: 14px; background: var(--card); text-align: center;
  font: 600 17px/1.32 var(--display); color: var(--c-answer); text-wrap: balance; }
.sw-from { font: 500 12px var(--ui); color: var(--label-3); white-space: nowrap; }
.sw-lead .sw-text { padding: 16px 18px; font: 700 clamp(20px, 2.4vw, 27px)/1.22 var(--display); letter-spacing: -.01em; }
[data-color="source"] .sw-text { color: var(--c-source); font-size: 16px; }
[data-color="definition"] .sw-text { color: var(--c-definition); font-size: 15px; font-weight: 500; text-align: left; }
[data-color="ask"] .sw-text { color: var(--c-ask); font-size: 16px; font-weight: 500; text-align: left; }
[data-color="gap"] .sw-text { color: var(--c-gap); font-size: 14px; font-weight: 600; text-align: left; background: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-gap) 45%, transparent); }
[data-color="you"] .sw-text { color: var(--c-you); font-weight: 500; font-style: italic; }
[data-color="right"] .sw-text { color: var(--c-right); } [data-color="almost"] .sw-text { color: var(--c-almost); } [data-color="miss"] .sw-text { color: var(--c-miss); }
[data-color="right"] .sw-text, [data-color="almost"] .sw-text, [data-color="miss"] .sw-text { font-size: 16px; text-align: left; }
.sw-rule { height: 1px; margin: 4px 2px; background: var(--rule); }

.sw-note { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 4; padding: 8px 14px; border-radius: 12px;
  background: rgba(24, 24, 27, .92); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); color: #fff; font: 600 13px var(--ui); white-space: nowrap; }
.sw-note[hidden] { display: none; }

/* under the window: legend, settings, who it's for */
.sw-under { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px 40px; margin-top: 18px; align-items: start; }
.sw-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: .92rem; color: var(--muted); }
.sw-legend li { display: inline-flex; align-items: center; gap: 7px; }
.sw-legend i { width: 11px; height: 11px; border-radius: 3px; }
.sw-toggles { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: flex-end; }
.sw-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 10px; background: #1a1c22; border: 1px solid #2d3139; }
.sw-toggle span { padding: 0 6px 0 8px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.sw-toggle button { padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: 600 .85rem system-ui, sans-serif; cursor: pointer; }
.sw-toggle button[aria-pressed="true"] { background: #2e3a50; color: #fff; }
.sw-who { margin: 18px 0 4px; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.sw-tip { margin: 0; max-width: 70ch; }
.sw-files { margin: 8px 0 0; font-size: .9rem; }
.sw-fine { margin: 14px 0 0; font-size: .85rem; }

@media (max-width: 860px) {
  .sw-under { grid-template-columns: 1fr; }
  .sw-toggles { justify-content: flex-start; }
  .sw-layout-toggle { display: none; }
  .sw-island[data-layout="wide"] .sw-body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sw-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 2px 20px 6px; scrollbar-width: none; }
  .sw-chips::-webkit-scrollbar { display: none; }
  .sw-chip { flex: none; }
  .sw-screen { min-height: 520px; padding: 46px 8px 18px; border-radius: 16px; }
  .sw-tiles { grid-template-columns: 1fr; grid-template-rows: 1.4fr 1fr; }
  .sw-hold, .sw-icon.sw-win { display: none; }
  .sw-bar { gap: 5px; padding-left: 9px; }
  .sw-lead .sw-text { font-size: 19px; }
  .sw-text { font-size: 15px; }
  .sw-menu { width: min(270px, calc(100% - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
  .sw-cue { animation: none; }
  .sw-island[data-state="listening"] .sw-dots i { animation: none; height: 10px; }
  .sw-island { transition: none; }
}

/* v2 layout (Khalil, 12-01): the call stays visible. The people sit in a strip along the bottom with their names,
   a ring and a "Speaking" badge on whoever is talking; SayWel stays at the top and scrolls inside itself. */
.sw-screen { min-height: 730px; padding: 22px 18px 0; display: flex; flex-direction: column; }
.sw-webcam { display: none; }
.sw-island { order: 1; width: min(100%, 540px); max-height: 440px; display: flex; flex-direction: column; flex: none; }
.sw-island[data-layout="wide"] { width: min(100%, 900px); }
.sw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sw-tiles { position: relative; inset: auto; z-index: 1; order: 2; margin-top: auto; height: 250px; padding: 14px 0 16px; grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 14px; }
.sw-face { width: 76px; }
.sw-name { font-size: .9rem; }
.sw-tile.speaking::after { content: "Speaking"; position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 8px;
  background: rgba(48, 209, 88, .2); color: #7ef0a0; font: 700 .78rem/1.3 var(--ui); }
.sw-caption { bottom: 46px; width: min(92%, 460px); font-size: .9rem; }
.sw-asker { display: block; margin-bottom: 2px; font: 700 12px/1.3 var(--ui); color: #7ef0a0; }
.sw-asker:empty { display: none; }
.sw-island[data-theme="light"] .sw-asker { color: #1a7f37; }
@media (max-width: 560px) {
  .sw-screen { min-height: 660px; padding: 12px 8px 0; }
  .sw-island { max-height: 420px; }
  .sw-tiles { height: 190px; gap: 8px; }
  .sw-face { width: 54px; }
  .sw-caption { bottom: 40px; font-size: .8rem; }
}/* v2: tighter lines so a full answer fits without scrolling, the Answer always in view */
.sw-body { gap: 8px; padding: 0 12px 12px; }
.sw-main, .sw-side { gap: 6px; }
.sw-cue { gap: 3px; }
.sw-tag { font-size: 11.5px; }
.sw-text { padding: 7px 12px; font-size: 14.5px; border-radius: 12px; }
.sw-lead .sw-text { padding: 10px 14px; font-size: clamp(17px, 1.8vw, 21px); }
[data-color="source"] .sw-text, [data-color="ask"] .sw-text { font-size: 14px; }
[data-color="definition"] .sw-text, [data-color="gap"] .sw-text { font-size: 13.5px; }
.sw-island { max-height: 480px; }.sw-island { max-height: 510px; }
.sw-screen { min-height: 760px; }
