/* Activity Detail demo. Values mirror AppTheme.light and shared app controls. */
.demo-section {
  padding-bottom: 96px;
  scroll-margin-top: 100px;
}
.demo-caption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}
.demo-caption h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.quiet-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0 8px 12px;
  font: inherit;
  cursor: pointer;
}
.demo-caption .quiet-button {
  margin-left: auto;
}
.quiet-button:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.app-demo,
.app-demo-dialog {
  --app-bg: #fbf9fa;
  --app-surface: #fff;
  --app-soft: #f5f3f5;
  --app-primary: #303e51;
  --app-primary-fill: #475569;
  --app-ink: #1b1b1d;
  --app-muted: #44474c;
  --app-line: #e4e2e3;
  --app-outline: #c4c6cd;
  color: var(--app-ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.app-demo {
  --app-gutter: 12px;
  --app-page-top: 12px;
  --app-content-max: 100%;
  overflow: hidden;
  background: var(--app-bg);
  border: 1px solid var(--app-outline);
  border-radius: 16px;
  box-shadow: 0 16px 60px -36px #303e5140;
}
.app-demo-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.app-demo button,
.app-demo-dialog button,
.app-demo input,
.app-demo-dialog input,
.app-demo textarea,
.app-demo select {
  font: inherit;
}
.app-demo-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--app-primary);
  font-weight: 500;
  cursor: pointer;
  transition:
    background 140ms ease-out,
    transform 80ms ease-out;
}
.app-demo-button:hover {
  background: var(--app-soft);
}
.app-demo-button:active,
.app-demo-mic:active {
  transform: scale(0.98);
}
.app-demo-button.primary {
  background: var(--app-primary-fill);
  color: #fff;
}
.app-demo-button.primary:hover {
  background: #515f74;
}
.app-demo-button.secondary {
  background: var(--app-soft);
  border-color: var(--app-line);
}
.app-demo-button.secondary:hover {
  background: #efedef;
}
.app-demo-icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--app-primary);
  cursor: pointer;
}
.app-demo-icon-button:hover {
  background: var(--app-soft);
}
.app-demo button:disabled,
.app-demo select:disabled {
  cursor: default;
  opacity: 0.6;
}
.app-demo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px var(--app-gutter);
  border-bottom: 1px solid var(--app-line);
  background: var(--app-surface);
  color: var(--app-primary);
}
.app-demo-toolbar > span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
/* Mirror ActivityDetailPage padding and ActivityDetailScreen’s content-width
   decisions. Container queries keep the embedded preview honest at any width. */
.app-demo-content {
  container: activity / inline-size;
  width: 100%;
  max-width: calc(var(--app-content-max) + 2 * var(--app-gutter));
  margin-inline: auto;
  padding: calc(var(--app-page-top) + 48px) var(--app-gutter)
    var(--app-page-top);
}
.app-demo-category {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--app-primary-fill);
  color: #e4e9f0;
  font-size: 12px;
}
.app-demo-hero h3 {
  margin: 12px 0 24px;
  color: var(--app-ink);
  font-size: 32px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.app-demo-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 24px;
  font-size: 14px;
}
.app-demo-details > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-demo-details .app-demo-icon {
  width: 17px;
  height: 17px;
  color: #85868b;
}
.app-demo-details span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.app-demo-contact > span {
  font-size: 12px;
  text-transform: none;
  color: #73757a;
}
.app-demo-contact p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.app-demo-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 48px;
}
.app-demo-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: 0 4px 20px -12px #303e511f;
}
.app-demo-metric {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.app-demo-metric > div {
  display: grid;
  gap: 3px;
}
.app-demo-metric strong {
  color: var(--app-primary);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.app-demo-metric span {
  color: var(--app-muted);
  font-size: 12px;
}
.app-demo-metric > span {
  font-weight: 600;
  text-align: right;
}
.app-demo-hours progress {
  display: block;
  width: 100%;
  height: 4px;
  margin: 12px 0 48px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--app-line);
  accent-color: var(--app-primary);
}
.app-demo-hours progress::-webkit-progress-bar {
  background: var(--app-line);
}
.app-demo-hours progress::-webkit-progress-value {
  background: var(--app-primary);
  border-radius: 999px;
}
.app-demo-hours progress::-moz-progress-bar {
  background: var(--app-primary);
  border-radius: 999px;
}
.app-demo fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.app-demo-hours .app-demo-button {
  display: flex;
  width: 100%;
  min-height: 44px;
}
.app-demo-hours .app-demo-button + .app-demo-button {
  margin-top: 4px;
}
.app-demo-hours .app-demo-button.primary .app-demo-icon {
  fill: currentColor;
  stroke: none;
  width: 17px;
}
.app-demo-hours .is-running .app-demo-icon {
  fill: none !important;
  stroke: currentColor !important;
}
.app-demo-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px auto;
  align-items: start;
  gap: 12px;
}
.app-demo h4,
.app-demo-dialog h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
}
.app-demo-card-head h4 {
  flex: 1;
}
.app-demo-card-head .app-demo-button {
  padding: 6px 10px;
  min-height: 40px;
  font-size: 12px;
}
.app-demo-card-head .app-demo-icon {
  width: 17px;
  height: 17px;
}
.app-demo-dictation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--app-primary);
  font-weight: 700;
}
.app-demo-mic {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid #687588;
  border-radius: 50%;
  background: var(--app-primary-fill);
  color: #fff;
  box-shadow: 0 8px 20px #303e5130;
  cursor: pointer;
  transition:
    background 140ms,
    transform 80ms;
}
.app-demo-mic:hover {
  background: #515f74;
}
.app-demo-mic .app-demo-icon {
  width: 32px;
  height: 32px;
}
.app-demo textarea,
.app-demo-dialog input {
  display: block;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--app-outline);
  border-radius: 8px;
  padding: 12px;
  background: var(--app-surface);
  color: var(--app-ink);
}
.app-demo textarea {
  resize: vertical;
  min-height: 104px;
  font-size: 14px;
  line-height: 1.55;
}
.app-demo textarea::placeholder {
  color: #666970;
  opacity: 1;
}
.app-demo-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
}
.app-demo-prompt > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--app-muted);
  font-size: 12px;
}
.app-demo-prompt .app-demo-icon {
  width: 14px;
  height: 14px;
}
.app-demo-prompt .app-demo-button {
  min-height: 36px;
  padding: 4px;
  font-size: 12px;
}
.app-demo-save {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.app-demo-timeline {
  margin-top: 48px;
}
.app-demo-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--app-line);
  margin-bottom: 24px;
}
.app-demo-timeline select {
  width: 148px;
  max-width: 50%;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-ink);
  cursor: pointer;
}
.app-demo-timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 24px;
}
.app-demo-timeline-row:last-child {
  padding-bottom: 0;
}
.app-demo-timeline-row:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 11px;
  width: 1px;
  background: var(--app-line);
}
.app-demo-marker {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--app-line);
  border-radius: 50%;
  background: #e4e2e3;
  color: var(--app-primary);
}
.app-demo-marker.memory {
  background: #d2e1f7;
}
.app-demo-marker .app-demo-icon {
  width: 14px;
  height: 14px;
}
.app-demo-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 12px;
}
.app-demo-entry-meta > span {
  background: #e4e2e3;
  border-radius: 4px;
  padding: 2px 6px;
}
.app-demo-record {
  padding: 16px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: var(--app-surface);
}
.app-demo-record h5 {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.app-demo-record p {
  margin: 0;
  color: var(--app-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.app-demo-duration {
  flex: 0 0 auto;
  background: var(--app-soft);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.app-demo-edit-entry {
  margin-top: 8px;
  min-height: 32px;
  padding: 4px 0;
  font-size: 12px;
}
.demo-footnote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.app-demo-note {
  margin: 0;
  padding: 16px 32px;
  color: var(--app-muted);
}
.app-demo-toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid #c4d6e0;
  border-radius: 12px;
  padding: 16px 20px;
  background: #e8eef5;
  color: #303e51;
  box-shadow: 0 6px 24px #303e5120;
  font-size: 14px;
}
.app-demo-toast:empty {
  display: none;
}
.app-demo-dialog {
  width: min(640px, calc(100% - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid var(--app-outline);
  border-radius: 16px;
  padding: 0;
  background: var(--app-bg);
  box-shadow: 0 16px 60px #0003;
}
.app-demo-dialog::backdrop {
  background: #1b1b1d66;
  backdrop-filter: blur(3px);
}
.app-demo-dialog[open] {
  animation: demo-dialog-in 220ms ease-out;
}
.app-demo-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-line);
}
.app-demo-dialog h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}
.app-demo-dialog-body {
  padding: 24px;
}
.app-demo-dialog-body h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 16px;
}
.app-demo-dialog-body h4:first-child {
  margin-top: 0;
}
.app-demo-dialog label {
  display: block;
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 12px;
}
.app-demo-dialog input + label {
  margin-top: 16px;
}
.app-demo-dialog input[readonly] {
  background: var(--app-soft);
}
.app-demo-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.app-demo-field-row + .app-demo-field-row {
  margin-top: 16px;
}
.app-demo-field-row > div {
  min-width: 0;
}
.app-demo-duration-preview {
  display: flex;
  justify-content: space-between;
  margin: 24px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #efedef;
  color: var(--app-muted);
}
.app-demo-duration-preview strong {
  font-weight: 600;
  color: var(--app-primary);
}
.app-demo-error {
  margin: 10px 0 0;
  color: #ba1a1a;
  font-size: 12px;
}
.app-demo-error:empty {
  display: none;
}
.app-demo-dialog-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--app-line);
  background: var(--app-bg);
}
.app-demo-transcript {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 16px;
  line-height: 1.7;
}
@keyframes demo-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* AppBreakpoints: phone <600, tablet 600–839, desktop 840–1199,
   large desktop 1200+. The app uses the same text and control sizes throughout. */
@media (min-width: 600px) {
  .app-demo {
    --app-gutter: 24px;
    --app-page-top: 24px;
    --app-content-max: 720px;
  }
}
@media (min-width: 840px) {
  .app-demo {
    --app-gutter: 32px;
    --app-content-max: 1040px;
  }
}
@media (min-width: 1200px) {
  .app-demo {
    --app-gutter: 40px;
    --app-page-top: 32px;
    --app-content-max: 1360px;
  }
}
@container activity (min-width: 430px) {
  .app-demo-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container activity (min-width: 900px) {
  .app-demo-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}
@media (max-width: 599px) {
  .demo-section {
    padding-bottom: 64px;
  }
  .demo-caption {
    gap: 4px 10px;
  }
  .demo-caption-note {
    display: none;
  }
  .app-demo {
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .app-demo-edit-label {
    display: none;
  }
  .app-demo-toolbar [data-edit-activity] {
    width: 44px;
    height: 44px;
    padding: 0;
  }
  .app-demo-card-head {
    gap: 8px;
  }
  .app-demo-card-head .app-demo-button {
    padding-inline: 8px;
  }
  .app-demo textarea,
  .app-demo-dialog input,
  .app-demo-timeline select {
    font-size: 16px;
  }
  .app-demo-button,
  .app-demo-icon-button,
  .app-demo-card-head .app-demo-button,
  .app-demo-prompt .app-demo-button,
  .app-demo-edit-entry,
  .app-demo-timeline select {
    min-height: 44px;
  }
  .app-demo-dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    border-radius: 24px 24px 0 0;
  }
  .app-demo-dialog-body,
  .app-demo-dialog-head,
  .app-demo-dialog-actions {
    padding: 16px;
  }
  .app-demo-dialog-actions {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .app-demo-toast {
    bottom: 16px;
    right: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-demo *,
  .app-demo-dialog,
  .app-demo-dialog * {
    animation: none !important;
    transition: none !important;
  }
}

.demo-invite {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  border: 1px solid #d6dfe9;
  border-radius: 10px;
  padding: 20px 24px;
  background: #e8eef5;
}
.demo-invite p {
  margin: 0;
  color: #303e51;
}
.demo-invite .button {
  flex: 0 0 auto;
}
@media (max-width: 600px) {
  .demo-invite {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }
}
