/* Coach demo styling. Message geometry follows ai-elements/MessageContent;
   task rows reuse app-preview.css. */
.ai-work-section {
  --ai-ground: var(--site-inverse-surface);
  --ai-text: var(--site-inverse-text);
  --ai-muted: var(--site-inverse-secondary);
  --ai-rule: #353936;
  --ai-highlight: var(--site-inverse-accent);
  background: var(--ai-ground);
  color: var(--ai-text);
  scroll-margin-top: 64px;
}
.ai-work-section .ai-coach-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 48px;
  align-items: center;
}
.ai-work-section .app-preview {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: var(--site-radius-panel);
  box-shadow: 0 18px 44px #1117;
  background: var(--ap-panel);
}
.ai-work-section .app-preview p {
  font-size: 14px;
  line-height: 1.8;
}
.ai-work-section .home-kicker {
  color: var(--ai-highlight);
  font-size: 13px;
  margin-bottom: 20px;
}
.ai-work-section h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.48;
  font-weight: 500;
  letter-spacing: -0.035em;
}
.ai-intro {
  color: var(--ai-muted);
  font-size: 15px;
  line-height: 1.9;
  margin-top: 22px;
}
.ai-work-tabs.home-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 32px;
}
.ai-work-tabs.home-tabs button {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--site-radius-panel);
  background: #ffffff08;
  padding: 13px 16px;
  overflow: hidden;
  white-space: normal;
  text-align: left;
  box-shadow: none;
  color: var(--ai-muted);
}
.ai-work-tabs.home-tabs button[aria-selected="true"] {
  color: var(--ai-text);
  background: #cfdbc916;
  box-shadow: none;
}
/* Keep the line on the straight left edge, clear of the card's 12px corners.
   Grow its height rather than scaling it so the round caps keep their shape. */
.ai-work-tabs.has-auto-rotation button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 2px;
  height: calc((100% - 24px) * var(--preview-progress, 0));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ai-highlight) 55%, transparent);
  pointer-events: none;
  transition: height 100ms linear;
}
.ai-work-tabs.home-tabs button:hover {
  color: var(--ai-text);
}
.ai-tab-label {
  display: block;
  font-size: 11px;
  margin-bottom: 5px;
  color: var(--ai-muted);
}
.ai-work-tabs strong {
  display: inline;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
}
.ai-tab-description {
  display: inline;
  color: var(--ai-muted);
  font-size: 13px;
  line-height: 1.8;
  margin-left: 10px;
}
.calendar-view-tabs.home-tabs button {
  background: var(--site-surface-subtle);
}
.calendar-view-tabs.home-tabs button[aria-selected="true"] {
  background: var(--site-brand-soft);
}
.ai-work-tabs button[aria-selected="false"] .ai-tab-description {
  display: none;
}
.ai-work-section :focus-visible {
  outline: 2px solid var(--ai-highlight);
  outline-offset: 5px;
}
.ai-demo-column {
  min-width: 0;
}
.ai-demo-stage {
  border-radius: var(--site-radius-stage);
  padding: 40px clamp(28px, 3vw, 44px);
  background:
    linear-gradient(90deg, #fff1 1px, transparent 1px) 0 0 / 55px 55px,
    linear-gradient(#fff1 1px, transparent 1px) 0 0 / 55px 55px,
    radial-gradient(ellipse at 10% 5%, #c4bba3, transparent 65%),
    linear-gradient(145deg, #aab3a0, #777f6b 48%, #343b30);
}
.ai-demo-stage {
  height: 590px;
  display: flex;
  align-items: center;
}
.ai-demo-panel {
  width: 100%;
}
.ai-demo-panel .app-preview {
  height: 510px;
}
.ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 16px;
  min-height: 54px;
  border-bottom: 1px solid var(--ap-line);
  padding: 15px 21px;
}
.ai-card-header strong {
  font-size: 14px;
  font-weight: 550;
}
.ai-card-header strong > span {
  color: var(--ap-muted);
  font-size: 12px;
  font-weight: 400;
  margin-left: 9px;
}
.ai-header-icons {
  display: flex;
  gap: 15px;
  color: var(--ap-muted);
}
.ai-header-icons svg,
.ai-small-icon,
.ai-send svg,
.ai-chevron {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 19px;
  padding: 23px 22px 18px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.ai-chat-user {
  align-self: flex-end;
  max-width: 88%;
  padding: 11px 14px;
  border-radius: var(--site-radius-small);
  background: var(--ap-ink);
  color: var(--ap-panel);
  font-size: 13px;
  line-height: 1.75;
}
.ai-chat-assistant {
  max-width: 94%;
}
.ai-work-section .ai-chat-assistant p {
  font-size: 13px;
  line-height: 1.85;
}
.ai-chat-assistant ul {
  margin: 8px 0;
  padding-left: 21px;
  font-size: 13px;
  line-height: 1.85;
}
.ai-chat-compose {
  margin: 0 13px 13px;
  padding: 12px;
  background: var(--ap-soft-2);
  border: 1px solid var(--ap-line);
  border-radius: var(--site-radius-control);
  color: var(--ap-muted);
  font-size: 12px;
  flex: none;
}
.ai-chat-compose > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.ai-chat-compose > div > span:first-child {
  font-size: 19px;
}
.ai-send {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: var(--site-radius-small);
  background: var(--ap-ink);
  color: var(--ap-panel);
}
.ai-demo-caption {
  color: var(--ai-caption, #eef0e6);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  margin-top: 24px;
}
.ai-demo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  color: var(--ai-muted);
  font-size: 10px;
  padding: 10px 0 0;
}
.ai-replay {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 4px 0 4px 12px;
  font: inherit;
}
.ai-replay:hover {
  color: var(--ai-text);
}
.ai-demo-column:has(#ai-breakdown:not([hidden])) .ai-replay {
  visibility: hidden;
}
.ai-day-grid {
  display: grid;
  grid-template-columns: 45px 1fr;
  padding: 22px 16px 0 12px;
}
.ai-day-hours {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr)) 14px;
  height: calc(100% + 14px);
  font-size: 10px;
  color: var(--ap-muted);
  transform: translateY(-7px);
}
.ai-day-track {
  position: relative;
  height: 100%;
  background: linear-gradient(to bottom, var(--ap-line) 0 1px, transparent 1px);
  background-size: 100% 20%;
}
.ai-time-block {
  position: absolute;
  left: 7px;
  right: 0;
  top: var(--top);
  height: var(--height);
  padding: 7px 12px;
  border-radius: var(--site-radius-small);
  overflow: hidden;
  transform-origin: top;
  border-left: 3px solid;
}
.ai-day-track > .ai-time-block:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 3px;
}
.ai-day-track > .ai-time-block:first-child > span {
  margin-top: 0;
  white-space: nowrap;
}
.ai-time-block strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}
.ai-time-block > span {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}
.ai-time-meeting {
  background: var(--ap-purple);
  color: var(--ap-purple-ink);
  border-color: #a592c9;
}
.ai-time-break,
.ai-time-lunch {
  background: var(--ap-blue);
  color: var(--ap-blue-ink);
  border-color: #87a8d0;
}
.ai-time-meeting > span,
.ai-time-break > span {
  display: none;
}
.ai-time-focus {
  background: #fce3d7;
  color: #973d21;
  border-color: var(--ap-accent);
  padding-top: 12px;
}
.ai-time-focus small {
  display: block;
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 8px;
  font-size: 10px;
  opacity: 0.85;
}
.ai-detail-muted {
  color: var(--ap-muted);
  font-size: 11px;
}
.ai-breakdown-body {
  padding: 24px 18px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.ai-work-section .ai-breakdown-body > p {
  color: var(--ap-muted);
  font-size: 12px;
  margin: 0 0 22px 5px;
}
.ai-task-tree > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  border-radius: var(--site-radius-small);
  cursor: pointer;
  color: var(--ap-ink);
  font-size: 13.5px;
  line-height: 1.6;
}
.ai-task-tree > summary::-webkit-details-marker {
  display: none;
}
.ai-task-tree > summary:hover {
  background: var(--ap-soft-2);
}
.ai-task-tree > summary .app-check {
  margin-top: 0;
}
.ai-task-tree > summary > span:not(.app-check) {
  flex: 1;
  min-width: 0;
}
.ai-task-tree > summary small {
  font-size: 10px;
  color: var(--ap-muted);
  flex: none;
}
.ai-chevron {
  width: 12px;
  height: 12px;
  color: var(--ap-muted);
  transition: transform 0.2s;
}
.ai-task-tree[open] > summary .ai-chevron {
  transform: rotate(90deg);
}
.ai-tree-children {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--ap-line);
}
.ai-breakdown-card .app-task {
  align-items: center;
  padding: 11px 4px;
  gap: 8px;
}
.ai-breakdown-card .app-task .app-check {
  margin-top: 0;
}
.ai-breakdown-card .app-task + .app-task {
  border-top-color: var(--ap-line-soft);
}
.ai-nested-tree > summary {
  padding: 11px 4px;
}
.ai-nested-tree .ai-tree-children {
  margin-left: 14px;
  padding-left: 12px;
}
.ai-nested-tree .app-task {
  font-size: 12px;
  padding-block: 10px;
}
.ai-other-task {
  margin-top: 10px;
}
.ai-tree-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 16px 20px;
  color: var(--ap-muted);
  font-size: 11px;
  border-top: 1px solid var(--ap-line);
  flex: none;
}
.ai-tree-hint svg {
  width: 12px;
  height: 12px;
}
.ai-work-section .ai-task-tree :focus-visible {
  outline-color: var(--ap-accent);
  outline-offset: 1px;
}
.ai-work-section .ai-enter {
  animation: ai-message-in 0.55s var(--delay, 0s) both;
}
.ai-work-section .ai-time-proposed {
  animation: ai-suggestion-in 0.35s 0.8s both;
}
.ai-work-section:not(.is-in-view) .ai-demo-panel * {
  animation-play-state: paused;
}
.ai-task-tree[open] > .ai-tree-children > .ai-child {
  animation: ai-child-in 0.35s var(--delay, 0s) both;
}
@keyframes ai-message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ai-suggestion-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes ai-child-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 1100px) and (min-width: 1001px) {
  .ai-work-tabs strong {
    font-size: 16px;
  }
  .ai-intro br {
    display: none;
  }
}
@media (max-width: 1000px) {
  .ai-work-section .ai-coach-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
  .ai-coach-copy {
    max-width: 550px;
    width: 100%;
    margin-inline: auto;
  }
  .ai-demo-column {
    width: 100%;
    max-width: 550px;
    margin-inline: auto;
  }
  .ai-work-tabs.home-tabs {
    margin-top: 28px;
  }
  .ai-work-tabs.home-tabs button {
    padding: 14px 16px;
  }
  .ai-tab-description {
    max-width: 430px;
  }
}
@media (max-width: 480px) {
  .ai-work-section h2 {
    font-size: 27px;
  }
  .ai-intro {
    font-size: 13px;
  }
  .ai-work-tabs strong {
    font-size: 16px;
  }
  .ai-tab-description {
    font-size: 12px;
  }
  .ai-demo-stage {
    height: 660px;
    padding: 22px 12px 18px;
    border-radius: var(--site-radius-panel);
  }
  .ai-demo-panel .app-preview {
    height: 565px;
  }
  .ai-card-header {
    padding-inline: 16px;
  }
  .ai-messages {
    padding: 20px 14px;
    gap: 16px;
  }
  .ai-chat-user {
    max-width: 94%;
    font-size: 12px;
    padding: 9px 12px;
  }
  .ai-work-section .ai-chat-assistant p,
  .ai-chat-assistant ul {
    font-size: 12px;
  }
  .ai-demo-caption {
    font-size: 10px;
    margin-top: 20px;
  }
  .ai-breakdown-body {
    padding-inline: 10px;
  }
  .ai-breakdown-card .app-task,
  .ai-task-tree > summary {
    font-size: 12px;
  }
  .ai-breakdown-card .app-task-meta {
    display: none;
  }
  .ai-tree-children {
    margin-left: 10px;
    padding-left: 10px;
  }
  .ai-nested-tree .ai-tree-children {
    margin-left: 7px;
    padding-left: 8px;
  }
  .ai-nested-tree .app-task {
    font-size: 11px;
  }
  .ai-day-grid {
    padding-right: 12px;
    grid-template-columns: 36px 1fr;
  }
  .ai-time-block {
    left: 4px;
    padding-inline: 8px;
  }
  .ai-time-block strong {
    font-size: 12px;
  }
  .ai-time-block > span {
    font-size: 10px;
  }
  .ai-time-focus small {
    left: 8px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-work-section .ai-demo-panel *,
  .ai-task-tree[open] > .ai-tree-children > .ai-child {
    animation: none;
    transition: none;
  }
  .ai-replay {
    display: none;
  }
}
