.phone-fit { position: relative; width: min(100%, 395px); aspect-ratio: 395 / 710; margin-inline: auto; }
.phone-fit > .sp { position: absolute; left: 0; top: 0; transform: scale(var(--sp-scale, 1)); transform-origin: 0 0; }
.sp {
  --bg: #ffffff;
  --panel: #f4f6f8;
  --raised: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --line: #dde2e8;
  --stripe: #f8f9fb;
  --accent: #0e7a5f;
  --accent-text: #ffffff;
  --accent-soft: #e3f3ee;
  --user: #e8f1fd;
  --user-text: #16324f;
  --chart-0: #0e7a5f;
  --chart-1: #2f6fb3;
  width: 395px;
  height: 710px;
  padding: 10px;
  border-radius: 54px;
  background: #0b0f12;
  box-shadow: inset 0 0 0 2px #2a3036, 0 0 0 1px rgba(0, 176, 80, .45), 0 0 50px rgba(0, 176, 80, .25), 0 30px 60px rgba(0, 0, 0, .45);
  text-align: left;
}
.sp *, .sp *::before, .sp *::after { box-sizing: border-box; }
.sp p { margin: 0; font-size: inherit; color: inherit; line-height: inherit; max-width: none; }
.sp__screen {
  position: relative;
  width: 375px;
  height: 690px;
  overflow: hidden;
  border-radius: 44px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sp__app { position: absolute; left: 0; right: 0; top: 0; height: 690px; display: flex; flex-direction: column; }
.sp__status {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 30px 0 34px;
  color: #11161b;
  font: 600 14px/1 "Segoe UI", system-ui, sans-serif;
  z-index: 3;
}
.sp__camera { position: absolute; left: 50%; top: 11px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: #0b0f12; }
.sp__icons { display: flex; align-items: center; gap: 6px; }
.sp__icons svg { display: block; fill: #11161b; }
.sp__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 36px 12px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.sp__brand { color: var(--accent); font-size: 20px; line-height: 1; }
.sp__brand::before { content: "\2726"; }
.sp__company { flex: 1; min-width: 0; padding: 3px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sp__actions { display: flex; gap: 6px; }
.sp__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--raised);
  color: var(--text);
  line-height: 1.5;
}
.sp__transcript { flex: 1; min-height: 0; overflow: hidden; padding: 14px 14px 6px; }
.sp.is-still .sp__transcript { overflow-y: auto; }
.sp .turn { margin: 0 0 16px; }
.sp .turn.user {
  width: fit-content;
  max-width: 88%;
  margin-left: auto;
  padding: 7px 11px;
  border-radius: 12px 12px 3px 12px;
  background: var(--user);
  color: var(--user-text);
}
.sp .turn p { margin: 0 0 8px; }
.sp .turn.assistant > :last-child > :last-child { margin-bottom: 0; }
.sp .turn strong { font-weight: 600; }
.sp .tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.sp .tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}
.sp .tool::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sp .tool.running::before { opacity: var(--sp-pulse, 1); }
.sp .thinking { display: inline-flex; gap: 4px; padding: 6px 2px; }
.sp .thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sp .table-wrap { margin: 8px 0 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.sp table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp th, .sp td { padding: 5px 9px; text-align: left; vertical-align: top; }
.sp th { background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; white-space: nowrap; }
.sp td { border-top: 1px solid var(--line); }
.sp tbody tr:first-child td { border-top: 0; }
.sp tbody tr:nth-child(even) { background: var(--stripe); }
.sp .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp .downloads { display: flex; justify-content: flex-end; gap: 6px; margin: -4px 0 10px; }
.sp .chart .downloads { margin: 6px 0 0; }
.sp .downloads span { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 13px; }
.sp .chart { margin: 8px 0 10px; padding: 10px 10px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.sp .chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sp .chart-title { fill: var(--text); font-size: 14px; font-weight: 600; }
.sp .chart-text { fill: var(--text); font-size: 11px; }
.sp .chart-muted { fill: var(--muted); font-size: 11px; }
.sp .chart-value { fill: var(--muted); font-size: 10px; }
.sp .chart-grid { stroke: var(--line); stroke-width: 1; }
.sp .chart-axis { stroke: var(--muted); stroke-width: 1; }
.sp .chart .c0 { fill: var(--chart-0); stroke: var(--chart-0); }
.sp .chart .c1 { fill: var(--chart-1); stroke: var(--chart-1); }
.sp .chart title { display: none; }
.sp .welcome { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 0; color: var(--muted); }
.sp .welcome p { margin: 0 0 4px; }
.sp .followups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.sp .followups > span:first-child { color: var(--muted); font-size: 12px; }
.sp .suggestion {
  display: inline-block;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  line-height: 1.4;
}
.sp .suggestion.pressed { background: #c8e8de; }
.sp__statusline { min-height: 14px; }
.sp__ask { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.sp__ask .sp__btn { min-height: 44px; border-radius: 10px; }
.sp__attach { padding: 8px 14px; }
.sp__input {
  position: relative;
  flex: 1;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.sp__input.is-focused { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sp__placeholder { position: absolute; left: 10px; top: 9px; right: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #8a94a3; }
.sp__input.has-text .sp__placeholder { display: none; }
.sp__caret { display: inline-block; width: 1.5px; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: var(--accent); }
.sp__input:not(.has-text) .sp__caret { position: absolute; left: 10px; top: 11px; }
.sp__send { padding: 8px 16px; border-color: var(--accent); background: var(--accent); color: var(--accent-text); font-weight: 600; }
.sp__foot { padding: 4px 14px 22px; background: var(--panel); color: var(--muted); font-size: 11px; line-height: 1.5; }
.sp__account { display: block; }
.sp__signout { color: var(--accent); font-weight: 600; text-decoration: underline; }
.sp.is-typing .sp__foot { display: none; }
.sp__keyboard {
  position: absolute;
  left: 0;
  right: 0;
  top: 690px;
  height: 236px;
  padding: 8px 3px 30px;
  background: #d3d7de;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}
.sp__row { display: flex; justify-content: center; gap: 5px; }
.sp__key {
  flex: 0 0 32px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  color: #11161b;
  font: 400 19px/1 "Segoe UI", system-ui, sans-serif;
}
.sp__key--wide { flex-basis: 44px; background: #aab1bc; font-size: 15px; }
.sp__key--space { flex: 0 0 176px; font-size: 14px; color: #5b6470; }
.sp__key--send { flex-basis: 76px; background: var(--accent); color: #fff; }
.sp__key--send svg { width: 20px; height: 20px; fill: currentColor; }
.sp__key.is-down { background: #aab1bc; }
.sp__key--send.is-down { background: #0a5c47; }
.sp__home { position: absolute; left: 50%; bottom: 7px; width: 124px; height: 5px; margin-left: -62px; border-radius: 3px; background: #11161b; z-index: 4; }
.sp__tap {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(17, 22, 27, .22);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
@media (prefers-reduced-motion: reduce) {
  .sp .reveal { opacity: 1 !important; transform: none !important; }
}
