@layer reset, base, components, responsive;
/* HINA identity shared by the product and service website. */
:root {
  --hina-brand: #ff5800;
  --hina-font-ui: -apple-system-body, ui-sans-serif, -apple-system, system-ui, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
}

/* Resets, typography and design tokens shared across every viewport. */
@layer reset {
  * {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
    color: inherit;
  }
  button,
  a {
    -webkit-tap-highlight-color: transparent;
  }
  button {
    cursor: pointer;
  }
  button:disabled {
    cursor: not-allowed;
  }
  img {
    display: block;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}
@layer base {
  :root {
    --page: #f7f7f7;
    --surface: #fff;
    --text: #202020;
    --muted: #777;
    --border: #e6e6e6;
    --brand: var(--hina-brand);
    --radius: 12px;
    --icon-button-size: 32px;
    --font-ui: var(--hina-font-ui);
    --font-regular: 400;
    --font-medium: 500;
    --font-emphasis: 600;
    --scrollbar-thumb: #b8b8b8;
    --scrollbar-size: 6px;
  }
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }
  *::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
    background: transparent;
  }
  *::-webkit-scrollbar-track,
  *::-webkit-scrollbar-corner {
    background: transparent;
  }
  *::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--scrollbar-thumb);
  }
  body {
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--page);
  }
  h1 {
    font-size: 28px;
    font-weight: var(--font-regular);
    line-height: 1.5;
  }
  h2 {
    font-size: 20px;
    font-weight: var(--font-medium);
    line-height: 1.6;
  }
  h3 {
    font-size: 17px;
    font-weight: var(--font-medium);
    line-height: 1.7;
  }
  p {
    overflow-wrap: anywhere;
  }
  :focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
  }
  button {
    border: 0;
    background: transparent;
  }
  button:disabled {
    opacity: 0.45;
  }
  input,
  textarea,
  select {
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--page);
    padding: 12px;
    min-width: 0;
    max-width: 100%;
  }
  textarea {
    resize: vertical;
    width: 100%;
  }
  input[type='checkbox'],
  input[type='radio'] {
    accent-color: var(--text);
    width: 18px;
    height: 18px;
    padding: 0;
    flex-shrink: 0;
  }
  input[type='number'] {
    max-width: 220px;
  }
  label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
  }
  select {
    appearance: none;
    background-image: url('/design-assets/37f0c7a3-a0b3-4c2c-b0ec-ed0dfe6c84fa.svg');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px !important;
  }
  label:not(:last-child) {
    margin-bottom: 20px;
  }
  fieldset {
    border: 0;
    padding: 0;
    margin: 20px 0;
  }
  legend {
    font-size: 15px;
    font-weight: var(--font-medium);
    margin-bottom: 10px;
  }
  summary {
    cursor: pointer;
    font-size: 14px;
    color: var(--muted);
    padding: 10px 0;
  }
  details p {
    margin: 10px 0;
  }
  audio {
    width: 100%;
    max-width: 100%;
    margin: 16px 0;
  }
  small,
  .muted {
    font-size: 12px;
    color: var(--muted);
  }
  strong {
    font-weight: var(--font-emphasis);
  }
  ::selection {
    background: #ffe1ce;
  }
}

/* Shared components and feature styles. Rules retain their cascade order. */
@layer components {
  .row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .button {
    display: inline-flex;
    min-height: 44px;
    padding: 10px 20px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    gap: 8px;
    border: 1px solid transparent;
  }
  .button.primary {
    background: var(--text);
    color: #fff;
  }
  .button.secondary {
    background: #fff;
    border-color: #c8c8c8;
  }
  .button.ghost {
    background: transparent;
  }
  .button.danger {
    color: #fff;
    background: #a22a24;
  }
  .button:hover:not(:disabled) {
    filter: brightness(0.95);
  }
  .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-button-size);
    height: var(--icon-button-size);
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 24px;
  }
  .icon-button:hover {
    background: #efefef;
  }
  .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .icon img {
    max-width: none;
  }
  .icon.down {
    transform: rotate(90deg);
  }
  .icon.left {
    transform: rotate(180deg);
  }
  .icon.up {
    transform: rotate(-90deg);
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 16px;
    white-space: nowrap;
    padding: 0;
  }
  .panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 0;
  }
  .app-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 0px minmax(0, 1fr);
    transition: grid-template-columns 260ms ease;
  }
  .app-shell.sidebar-open {
    grid-template-columns: 248px minmax(0, 1fr);
  }
  .workspace {
    grid-column: 2;
  }
  .sidebar {
    grid-column: 1;
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 260ms ease,
      visibility 260ms;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  .sidebar {
    width: 248px;
    height: 100dvh;
    position: sticky;
    top: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 30;
    background: var(--page);
    font-size: 14px;
  }
  .sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
  }
  .sidebar-heading strong {
    font-size: 18px;
  }
  .sidebar-row {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 36px;
    gap: 8px;
    padding: 4px 0;
    text-align: left;
    border-radius: 8px;
  }
  .sidebar-row span:last-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .project-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    color: var(--muted);
    font-size: 12px;
  }
  .sidebar-section-heading {
    gap: 6px;
  }
  .recent-heading {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 0;
    flex: 1;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
  }
  .recent-heading-chevron {
    display: inline-flex;
    opacity: 0;
    transform: rotate(0);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }
  .recent-heading-chevron .icon {
    width: 12px;
    height: 12px;
  }
  .recent-heading-chevron[data-open='true'] {
    transform: rotate(90deg);
  }
  .sidebar-section-heading:is(:hover, :focus-within) .recent-heading-chevron {
    opacity: 1;
  }
  @media (hover: none) {
    .recent-heading-chevron {
      opacity: 1;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .recent-heading-chevron {
      transition: none;
    }
  }
  [data-scrollbar-on-hover] {
    --scrollbar-thumb: transparent;
    transition: --scrollbar-thumb 180ms ease;
  }
  :is(.scroll-area, textarea)[data-scrollbar-on-hover][data-scrollable='false'] {
    overflow-y: hidden;
  }
  [data-scrollbar-on-hover]:is(:hover, :focus-within),
  :is(.sidebar, .chat-history):hover [data-scrollbar-on-hover] {
    --scrollbar-thumb: #b8b8b8;
  }
  @media (hover: none) {
    [data-scrollbar-on-hover] {
      --scrollbar-thumb: #b8b8b8;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    [data-scrollbar-on-hover] {
      transition: none;
    }
  }
  .sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .project[data-drop-target] {
    position: relative;
    isolation: isolate;
  }
  :is(.sidebar, .chat-history) .project[data-drop-target]::before {
    background: #fff4eb;
    outline: 2px solid var(--accent, #ff5a00);
    outline-offset: -2px;
  }
  .research-row[data-dragging] {
    opacity: 0.45;
  }
  .project-row {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 36px;
  }
  .project-row > .sidebar-row {
    min-width: 0;
    padding-right: 4px;
  }
  .project-row .hover-action {
    position: absolute;
    right: 0;
    gap: 0;
    background: var(--page);
  }
  .project-row .icon-button {
    width: 30px;
    height: 32px;
  }
  .hover-action {
    opacity: 0;
    flex-shrink: 0;
  }
  @media (hover: none) {
    .research-row .hover-action {
      opacity: 1;
    }
  }
  .hover-row:hover .hover-action,
  .hover-row:focus-within .hover-action {
    opacity: 1;
  }
  .folder-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .research-row {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 8px;
    height: 36px;
    padding-left: 28px;
  }
  .sidebar-unread-dot {
    position: absolute;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    pointer-events: none;
    transition: opacity 120ms ease;
  }
  @media (hover: hover) {
    .research-row:hover .sidebar-unread-dot,
    .research-row:focus-within .sidebar-unread-dot {
      opacity: 0;
    }
  }
  @media (hover: none) {
    .sidebar-unread-dot {
      position: static;
      flex-shrink: 0;
      margin-inline: 8px;
    }
  }
  .research-row.selected {
    background: #ededed;
  }
  .research-row > button {
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    padding: 4px 0;
    text-align: left;
    flex: 1;
    font-size: 14px;
  }
  .research-row .icon-button {
    width: 28px;
    height: 32px;
  }
  .sidebar-footer {
    padding-top: 6px;
  }
  .account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    font-size: 11px;
    font-weight: 400;
  }
  .account-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
  }
  .account-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
  }
  .account-details {
    margin: 0;
    display: grid;
    gap: 20px;
  }
  .account-details dt {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
  }
  .account-details dd {
    margin: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .sidebar-shade {
    display: none;
  }
  .workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }
  .app-header {
    background: white;
    display: flex;
    min-height: 64px;
    padding: 8px 20px;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }
  .header-title {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
  }
  .research-title {
    min-width: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 15px;
  }
  .header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
  }
  .development-label {
    color: #8a451a;
    background: #fff5e9;
    font-size: 11px;
    padding: 2px 20px;
    flex-shrink: 0;
  }
  .tabs {
    background: white;
    min-height: 56px;
    padding: 0 24px;
    flex-shrink: 0;
  }
  .tabs button {
    font-size: 14px;
    padding: 15px 8px 17px;
    color: var(--muted);
    position: relative;
  }
  .tabs button[aria-current='page'] {
    color: var(--text);
  }
  .sliding-tabs {
    position: relative;
  }
  .tab-indicator {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--brand);
    pointer-events: none;
    transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  @media (prefers-reduced-motion: reduce) {
    .tab-indicator {
      transition: none;
    }
  }
  .workspace-body {
    padding: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .home {
    flex: 1;
    background: #fff;
    overflow: auto;
  }
  .home-inner {
    margin: clamp(70px, 16vh, 160px) auto 60px;
  }
  .home h1 {
    font-size: 32px;
    margin-bottom: 28px;
  }
  .composer {
    background: var(--page);
    border-radius: 24px;
    flex-direction: column;
    flex-shrink: 0;
    border: 1px solid transparent;
  }
  .composer:focus-within {
    border-color: #c7c7c7;
  }
  .composer textarea {
    border: 0;
    padding: 0;
    min-height: 56px;
    resize: none;
    background: transparent;
    border-radius: 0;
    font-size: 16px;
  }
  .composer textarea:focus {
    outline: none;
  }
  .send {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--text);
    color: white;
  }
  .send::before {
    content: '';
    position: absolute;
    inset: -9px;
  }
  .send .icon,
  .send .icon img {
    width: 14px;
    height: 14px;
  }
  .send .icon img {
    filter: brightness(0) invert(1);
  }
  .send:disabled {
    background: #e6e6e6;
    opacity: 0.6;
  }
  .send:disabled .icon img {
    filter: none;
  }
  .recent {
    margin-top: 36px;
  }
  .recent h2 {
    font-size: 12px;
    color: var(--muted);
    font-weight: var(--font-regular);
    margin-bottom: 14px;
  }
  .recent > button {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 14px 0;
  }
  .recent > button small {
    display: block;
    margin-bottom: 6px;
  }
  .editor-grid {
    display: grid;
    grid-template-columns: minmax(260px, 30%) minmax(0, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 0;
  }
  .design-chat {
    --design-chat-inset: 24px;
    --chat-column-inset: 12px;
    display: flex;
    flex-direction: column;
    padding: 0 var(--design-chat-inset) var(--design-chat-inset);
    min-height: 0;
  }
  .chat-scroll {
    padding-top: var(--design-chat-inset);
    overflow: auto;
    flex: 1;
    min-height: 0;
  }
  .user-bubble {
    background: var(--page);
    padding: 14px 18px;
    border-radius: 20px;
    margin: 0 0 24px auto;
    max-width: 85%;
    width: fit-content;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }
  .assistant-message {
    line-height: 1.85;
    margin-bottom: 28px;
  }
  .assistant-message p {
    margin: 12px 0;
    white-space: pre-wrap;
  }
  .planning-next-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }
  .planning-next-actions .button {
    white-space: normal;
  }
  .chat-answer-summary {
    display: grid;
    gap: 16px;
  }
  .chat-answer-question {
    color: var(--muted);
    margin-bottom: 4px;
  }
  .chat-rich-text {
    overflow-wrap: anywhere;
    line-height: 1.85;
  }
  .chat-rich-text :is(p, ul, ol, blockquote, pre) {
    margin-block: 12px;
  }
  .chat-rich-text > :first-child {
    margin-top: 0;
  }
  .chat-rich-text > :last-child {
    margin-bottom: 0;
  }
  .chat-rich-text :is(ul, ol) {
    padding-inline-start: 1.6em;
  }
  .chat-rich-text li + li {
    margin-top: 6px;
  }
  .chat-rich-text li > p {
    margin-block: 4px;
  }
  .chat-rich-text :is(strong, h3, h4) {
    font-weight: var(--font-emphasis);
  }
  .chat-rich-text :is(h3, h4) {
    font-size: 1em;
    margin-block: 20px 8px;
  }
  .chat-rich-text a:not(.source-pill) {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .chat-rich-text pre {
    overflow-x: auto;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--page);
    white-space: pre;
  }
  .assistant-message small {
    display: block;
    margin-top: 10px;
  }
  .compact {
    margin-top: 0;
    border-radius: 20px;
    padding: 14px;
  }
  .compact textarea {
    font-size: 14px;
  }
  .flow-toolbar,
  .results-heading,
  .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }
  .flow-toolbar {
    margin-bottom: 28px;
  }
  .flow-toolbar h1 {
    font-size: 24px;
  }
  .section-heading h2 {
    font-size: 16px;
  }
  .question-section {
    margin-bottom: 28px;
  }
  .question-section > .section-heading {
    margin-bottom: 12px;
  }
  .question-card,
  .form-card {
    border: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    background: #fff;
    position: relative;
  }
  .question-card.dragging {
    z-index: 10;
    box-shadow: 0 10px 30px #0002;
  }
  .drag-handle {
    width: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    cursor: grab;
  }
  .question-content {
    min-width: 0;
    flex: 1;
  }
  .question-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .question-top select {
    padding: 6px 8px;
    width: 172px;
    min-height: 36px;
    font-size: 12px;
  }
  .question-number {
    font-size: 12px;
    color: var(--muted);
  }
  .required-mark {
    color: var(--brand);
    margin-left: 6px;
  }
  .question-title-input {
    padding: 8px 0;
    background: white;
    border-radius: 0;
    font-size: 16px;
    font-weight: var(--font-medium);
    min-height: 68px;
    resize: vertical;
  }
  .question-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .question-controls small {
    font-size: 12px;
  }
  .inline-label {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    font-size: 12px;
  }
  .inline-label select {
    padding: 8px;
    min-height: 36px;
    font-size: 12px;
  }
  .toggle-hit {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .toggle-track {
    width: 40px;
    height: 24px;
    border-radius: 12px;
    background: #ddd;
    display: flex;
    align-items: center;
    padding: 3px;
    transition: background 0.15s;
  }
  .toggle-track > span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px #0002;
    transition: transform 0.15s;
  }
  .toggle-hit.on .toggle-track {
    background: var(--text);
  }
  .choice-edit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
  }
  .choice-edit-row input:not([type='checkbox']) {
    flex: 1;
    width: 0;
    font-size: 14px;
    padding: 8px;
  }
  .choice-symbol {
    width: 16px;
    height: 16px;
    border: 1px solid #aaa;
    flex-shrink: 0;
  }
  .choice-symbol.single {
    border-radius: 50%;
  }
  .text-action {
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    gap: 8px;
  }
  .add-question {
    width: 100%;
    min-height: 80px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
  }
  .results {
    flex: 1;
    padding: 24px 28px;
    overflow: auto;
    min-height: 0;
  }
  .results-heading {
    margin-bottom: 24px;
  }
  .response-stats {
    margin: 24px 0 36px;
  }
  .response-stats > div {
    display: flex;
    flex-direction: column;
  }
  .response-stats strong {
    font-weight: var(--font-medium);
  }
  .response-stats span {
    font-size: 12px;
    color: var(--muted);
  }
  .response-table-head,
  .response-table > button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 130px 20px;
    gap: 12px;
    align-items: center;
    padding: 16px;
    text-align: left;
  }
  .response-table-head {
    color: var(--muted);
    font-size: 12px;
  }
  .response-table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
  }
  .response-table > button {
    min-height: 72px;
    width: 100%;
    border-top: 1px solid var(--border);
    font-size: 14px;
  }
  .response-table > button:hover {
    background: var(--page);
  }
  .response-table > button strong {
    font-weight: var(--font-medium);
  }
  .status-pill {
    background: var(--page);
    border-radius: 6px;
    padding: 3px 8px;
    width: fit-content;
    font-size: 12px;
  }
  .answer-detail {
    margin: 20px 0 32px;
  }
  .answer-detail h3 {
    margin-bottom: 14px;
  }
  .answer-value {
    background: var(--page);
    border-radius: 12px;
    white-space: pre-wrap;
  }
  .filter-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 20px;
    gap: 4px;
  }
  .filter-icon i {
    height: 1.5px;
    background: currentColor;
    width: 18px;
  }
  .filter-icon i:nth-child(2) {
    width: 12px;
  }
  .filter-icon i:last-child {
    width: 6px;
  }
  .filter-icon.active {
    color: var(--brand);
  }
  .aggregate-question {
    padding: 28px 0 36px;
  }
  .aggregate-question:last-child {
    border: 0;
  }
  .chart {
    margin: 16px 0 20px;
  }
  .chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 12px 0;
    width: 100%;
    text-align: left;
    font-size: 14px;
  }
  .chart-row strong {
    font-size: 14px;
    font-weight: var(--font-medium);
  }
  .chart-row small {
    margin-left: 8px;
  }
  .chart-row:disabled {
    opacity: 1;
  }
  .bar-track {
    grid-column: 1/-1;
    background: #eee;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
  }
  .bar-track > span {
    display: block;
    background: var(--brand);
    height: 100%;
    border-radius: 4px;
  }
  .report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 40px;
    align-items: start;
  }
  .report-document .results-heading {
    align-items: start;
  }
  .report-document .results-heading h1 {
    font-size: 24px;
  }
  .report-document > .muted {
    margin-bottom: 20px;
  }
  .report-section {
    padding-top: 30px;
    scroll-margin-top: 24px;
  }
  .report-section h2 {
    margin-bottom: 18px;
  }
  .report-section h3 {
    margin: 24px 0 14px;
  }
  .report-section p {
    margin-bottom: 16px;
    line-height: 1.9;
  }
  .report-section section {
    scroll-margin-top: 24px;
  }
  .report-toc {
    position: sticky;
    top: 0;
    font-size: 13px;
    max-height: 70vh;
    overflow: auto;
    padding-left: 12px;
  }
  .report-toc a {
    display: block;
    padding: 8px 0;
    line-height: 1.6;
    color: var(--muted);
  }
  .report-toc a.active {
    font-weight: var(--font-emphasis);
    color: var(--text);
    font-size: 14px;
  }
  .report-toc .toc-child {
    padding-left: 14px;
  }
  .analysis-block {
    margin: 18px 0 24px;
  }
  .analysis-block p {
    white-space: pre-wrap;
  }
  .block-sources {
    margin-block-start: 12px;
  }
  .block-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
  }
  .evidence-tag {
    color: #936040;
    background: #fff2e9;
    border-radius: 4px;
    padding: 2px 8px;
  }
  .source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    min-height: 32px;
    padding: 4px 0;
  }
  .source-link:hover {
    color: var(--text);
    text-decoration: underline;
  }
  .table-scroll {
    overflow: auto;
  }
  table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
  }
  th,
  td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
  }
  th {
    font-weight: var(--font-emphasis);
    background: var(--page);
  }
  blockquote {
    margin: 16px 0;
    border-inline-start: 2px solid var(--border);
    padding: 8px 16px;
  }
  blockquote > :first-child {
    margin-block-start: 0;
  }
  blockquote > :last-child {
    margin-block-end: 0;
  }
  .source-answer {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
  }
  .source-answer + .source-answer {
    margin-top: 16px;
  }
  .source-answer-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    text-align: left;
    font-weight: var(--font-emphasis);
    transition: background 150ms ease;
  }
  .source-answer-heading:hover {
    background: var(--page);
  }
  .source-answer-content {
    padding: 0 20px 20px;
  }
  .source-answer-item + .source-answer-item {
    margin-top: 16px;
  }
  .source-answer-question {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 8px;
  }
  .source-answer-text {
    background: var(--page);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .analysis-chat {
    --chat-column-inset: 36px;
    --chat-column-max: 900px;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .chat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
  }
  .analysis-chat-scroll {
    overflow: auto;
    flex: 1;
    min-height: 0;
    padding-bottom: 0;
  }
  .chat-welcome {
    margin: 8vh 0 40px;
  }
  .chat-welcome h1 {
    margin-bottom: 28px;
  }
  .chat-suggestions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .chat-suggestions button {
    border-radius: 12px;
    background: var(--page);
    padding: 20px;
    font-size: 14px;
    text-align: left;
  }
  .chat-turn {
    margin-bottom: 24px;
  }
  .chat-turn .assistant-message {
    margin-top: 28px;
  }
  .chat-turn .user-bubble {
    max-width: 80%;
  }
  .modal-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(90 + var(--modal-depth, 0) * 2);
    background: #0006;
    backdrop-filter: blur(1px);
  }
  .modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: calc(91 + var(--modal-depth, 0) * 2);
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100dvh - 64px);
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 80px #0003;
  }
  .modal.wide {
    width: min(760px, calc(100vw - 32px));
  }
  .modal-close {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
  .modal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
  }
  .modal > p {
    margin-bottom: 16px;
  }
  .modal form > .button {
    margin-top: 12px;
  }
  .menu {
    z-index: 100;
    min-width: 190px;
    max-width: calc(100vw - 24px);
    background: white;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 6px 28px #0002;
    font-size: 14px;
  }
  .menu [role='menuitem'] {
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    outline: none;
  }
  .menu [data-highlighted] {
    background: var(--page);
  }
  .danger-text {
    color: #a22a24;
  }
  .tooltip {
    z-index: 110;
    background: #202020;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
    max-width: 280px;
  }
  .checkbox-label {
    flex-direction: row;
    align-items: center;
    font-size: 14px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .settings-form h3 {
    margin: 30px 0 20px;
  }
  .inline-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
  }
  .inline-form label {
    margin: 0 !important;
  }
  .inline-form label:first-child {
    flex: 1;
    min-width: 160px;
  }
  .access-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 20px;
  }
  .access-form label {
    margin: 0;
    min-width: 0;
  }
  .access-form label:first-child {
    flex: 1 1 240px;
  }
  .access-list {
    margin-top: 24px;
  }
  .access-member-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
  }
  .access-person {
    flex: 1 1 160px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .access-person small {
    display: block;
    font-size: 12px;
  }
  .link-list {
    margin-top: 24px;
  }
  .link-list > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
  }
  .link-list > div > span {
    flex: 1;
    min-width: 0;
  }
  .link-list small {
    display: block;
  }
  .history-row {
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
  }
  .history-row span {
    color: var(--muted);
    font-size: 12px;
  }
  .error-message {
    color: #9c2824;
    background: #fff3f1;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin: 12px 0;
  }
  .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    font-size: 14px;
    color: var(--muted);
  }
  .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 24px;
    min-height: 50vh;
    padding: 40px 20px;
  }
  .empty-state h1 {
    font-size: 24px;
  }
  .report-skeleton {
    padding: 40px 0;
    max-width: 850px;
    margin: 0 auto;
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .login {
    max-width: 480px;
    margin: 15vh auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .login form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .respondent {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 32px 40px;
    min-height: 100dvh;
    background: #fff;
  }
  body:has(.respondent) {
    background: white;
  }
  .respondent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 24px;
  }
  .respondent-progress {
    width: 96px;
    height: 4px;
    background: #e6e6e6;
    border-radius: 2px;
    overflow: hidden;
  }
  .respondent-progress > span {
    height: 100%;
    display: block;
    background: var(--brand);
    transition: width 0.3s;
  }
  .respondent-intro {
    padding-top: 40px;
  }
  .respondent-intro h1 {
    margin-bottom: 24px;
  }
  .respondent-intro > p {
    margin-bottom: 24px;
  }
  .intro-facts,
  .completion-details {
    background: var(--page);
    border-radius: 12px;
    padding: 20px;
  }
  .intro-facts {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .intro-facts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 14px;
  }
  .intro-facts span {
    color: var(--muted);
  }
  .publication-facts span {
    color: var(--text);
  }
  .respondent-intro > .button {
    width: 100%;
    margin-top: 32px;
  }
  .respondent-question {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 120px);
  }
  .question-prompt {
    padding: 32px 0;
  }
  .question-prompt h1 {
    font-size: 24px;
    margin-top: 12px;
    font-weight: var(--font-medium);
  }
  .question-prompt p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
  }
  .respondent-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 8px 0 0;
  }
  .respondent-choices label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0;
    cursor: pointer;
    font-size: 16px;
  }
  .respondent-choices .checked {
    border-color: var(--text);
    background: var(--page);
  }
  .respondent-input {
    background: var(--page);
    padding: 20px;
    border-radius: 20px;
    margin: 4px 0 16px;
  }
  .respondent-input textarea {
    background: transparent;
    padding: 0;
    font-size: 18px;
    line-height: 1.8;
    border-radius: 0;
    min-height: 180px;
  }
  .respondent-input textarea:focus {
    outline: none;
  }
  .recording-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
  }
  .recording-controls .mic-button {
    order: 1;
  }
  .mic-button {
    border-radius: 50%;
    background: white;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
  }
  .recording .stop-icon {
    display: block;
    width: 16px;
    height: 16px;
    background: #c63e34;
    border-radius: 3px;
  }
  .respondent-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
    padding-top: 24px;
    gap: 12px;
  }
  .respondent-question-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .respondent-navigation {
    display: flex;
    gap: 20px;
  }
  .respondent-navigation > button {
    color: var(--text);
    font-size: 24px;
    line-height: 1;
  }
  .respondent-navigation > button:disabled {
    opacity: 0.3;
    cursor: default;
  }
  .respondent-question-number {
    font-size: 16px;
  }
  .respondent-actions > .button {
    width: 100%;
    min-height: 48px;
  }
  .completion-mark {
    color: #16803d;
    background: #edf7ef;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    font-size: 24px;
    border-radius: 50%;
  }
  .completion-details {
    width: min(100%, 560px);
    text-align: left;
    display: grid;
    gap: 24px;
    margin: 8px 0;
  }
  .completion-details h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px;
  }
  .completion-details p {
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
    white-space: pre-line;
  }
  .completion-reward {
    margin: 0 0 12px;
    display: grid;
    gap: 8px;
    font-size: 14px;
  }
  .completion-reward > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .completion-reward dt {
    color: var(--muted);
  }
  .completion-reward dd {
    margin: 0;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  .tab-content,
  .editor-grid {
    animation: tab-enter 180ms ease-out;
  }
  @keyframes tab-enter {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  .chat-panel {
    padding: 20px 24px;
    overflow: hidden;
  }
  .chat-panel > .tab-content {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .analysis-chat-layout {
    grid-template-rows: minmax(0, 1fr);
    flex: 1;
    display: grid;
    grid-template-columns: 0px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    transition: grid-template-columns 240ms ease;
    position: relative;
  }
  .analysis-chat-layout.history-open {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .analysis-chat {
    grid-column: 2;
    width: 100%;
    min-height: 0;
    min-width: 0;
  }
  .chat-history {
    grid-column: 1;
    padding: 0 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 200ms ease,
      visibility 200ms;
  }
  .history-open .chat-history {
    opacity: 1;
    visibility: visible;
  }
  .chat-history-shade {
    display: none;
  }
  .streaming-reply {
    padding: 20px 0;
  }
  .streaming-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.9;
    margin-bottom: 14px;
  }
  .job-progress-history {
    color: var(--muted);
    font-size: 13px;
  }
  .job-progress-history > .accordion-trigger {
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    color: inherit;
    font-size: inherit;
  }
  .job-progress-history ol {
    list-style: none;
    margin: 12px 0 0;
    padding-left: 16px;
    border-left: 1px solid var(--border);
  }
  .job-progress-history li + li {
    margin-top: 10px;
  }
  .thinking-status {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    color: var(--muted);
    font-size: 13px;
  }
  .thinking-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: thinking-pulse 1.2s ease-in-out infinite;
  }
  .thinking-label {
    background: linear-gradient(100deg, #777 20%, #bbb 45%, #555 60%, #777 80%);
    background-size: 240% 100%;
    color: transparent;
    background-clip: text;
    animation: thinking-shimmer 2s linear infinite;
  }
  .stream-cursor {
    display: inline-block;
    width: 6px;
    height: 14px;
    margin-left: 3px;
    background: currentColor;
    animation: thinking-pulse 1s ease-in-out infinite;
  }
  @keyframes thinking-pulse {
    50% {
      opacity: 0.25;
      transform: scale(0.75);
    }
  }
  @keyframes thinking-shimmer {
    to {
      background-position: -240% 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .thinking-dot,
    .thinking-label,
    .stream-cursor {
      animation: none;
    }
  }
  .composer,
  .composer:focus-within,
  .composer textarea:focus {
    border-color: transparent;
    outline: none;
    box-shadow: none;
    transition: none;
  }
  .composer {
    position: relative;
    padding-bottom: 50px;
  }
  .composer .send {
    right: 16px;
    bottom: 14px;
  }
  .attachment-tools {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    align-self: stretch;
    padding-right: 32px;
    margin-top: 8px;
  }
  .attachment-tools > .icon-button {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .attach-plus {
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
  }
  .attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    padding: 5px 8px;
    background: white;
    border: 1px solid var(--border);
    font-size: 12px;
    max-width: 190px;
    min-width: 0;
  }
  .attachment-chip > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .attachment-chip img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
  }
  .attachment-chip button {
    flex-shrink: 0;
    font-size: 16px;
    width: 20px;
    height: 24px;
  }
  .attachment-history {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
  }
  .design-chat,
  .analysis-chat,
  .question-flow {
    position: relative;
  }
  .question-flow {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
  }
  .question-flow-scroll {
    padding: 28px 28px 28px 36px;
    flex: 1;
    min-height: 0;
    overflow: auto;
  }
  .question-flow.has-proposal .question-flow-scroll {
    padding-bottom: 120px;
  }
  .proposal-actions {
    position: absolute;
    z-index: 12;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 20px #00000012;
  }
  .proposal-actions .icon-button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 26px;
    background: var(--surface, #f7f7f7);
  }
  .proposal-actions .proposal-use {
    color: #fff;
    background: #207849;
  }
  .proposal-actions .proposal-use:hover {
    background: #17623a;
  }
  .proposal-summary,
  .question-change-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  .proposal-summary {
    margin-bottom: 24px;
    font-size: 13px;
  }
  .proposal-summary p {
    flex-basis: 100%;
    line-height: 1.8;
  }
  .question-change {
    overflow-wrap: anywhere;
  }
  .question-change .drag-handle {
    pointer-events: none;
  }
  .question-change.added {
    background: #f0faf3;
    border-color: #a5d5b6;
  }
  .question-change.removed {
    background: #fff3f2;
    border-color: #edb5b1;
  }
  .question-change-heading {
    font-size: 12px;
    margin-bottom: 18px;
  }
  .question-change-heading > .muted {
    margin-left: auto;
  }
  .question-change-title {
    font-size: 16px;
    line-height: 1.8;
    white-space: pre-wrap;
  }
  .question-change-description {
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
  }
  .question-change-options {
    margin: 18px 0 0;
    padding-left: 22px;
    line-height: 2;
  }
  .question-change-setting {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.8;
  }
  .changed-text {
    white-space: pre-wrap;
  }
  .changed-text.is-replacement {
    display: inline-grid;
    gap: 8px;
    width: 100%;
    vertical-align: top;
  }
  .change-remove {
    background: #fce0dd;
    color: #9f2922;
    text-decoration: line-through;
  }
  .change-add {
    background: #dcefe2;
    color: #175b34;
    text-decoration: none;
  }
  .change-label {
    font-size: 12px;
    border-radius: 4px;
    padding: 2px 6px;
    background: #f1f1f1;
  }
  .change-label.added {
    color: #175b34;
    background: #dcefe2;
  }
  .change-label.removed {
    color: #9f2922;
    background: #fce0dd;
  }
  .change-label.changed {
    color: #545454;
    background: #eee;
  }
  .chat-scroll,
  .analysis-chat-scroll,
  .question-flow-scroll {
    scrollbar-width: none;
  }
  .chat-scroll::-webkit-scrollbar,
  .analysis-chat-scroll::-webkit-scrollbar,
  .question-flow-scroll::-webkit-scrollbar {
    display: none;
  }
  .scroll-index {
    position: absolute;
    left: 2px;
    top: 80px;
    bottom: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 14;
  }
  .scroll-index-item {
    position: relative;
    min-height: 5px;
    max-height: 18px;
    flex: 1;
    pointer-events: auto;
  }
  .scroll-index-item > button {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2px 3px;
  }
  .scroll-index-item > button > span {
    display: block;
    width: var(--tick-width, 7px);
    height: 2px;
    flex-shrink: 0;
    background: #d3d5d6;
    transition:
      width 140ms ease,
      background 140ms ease;
  }
  .scroll-index-item > button.is-emphasized > span {
    background: #222;
  }
  .scroll-peek {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: min(280px, calc(100vw - 85px));
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 5px 24px #0001;
    border-radius: 14px;
    pointer-events: none;
    animation: peek-in 130ms ease-out;
    font-size: 13px;
  }
  .scroll-peek strong {
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: var(--font-medium);
  }
  .scroll-peek p {
    margin-top: 6px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
  }
  @keyframes peek-in {
    from {
      opacity: 0;
      translate: -4px 0;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
  .analysis-chat {
    padding: 0 24px;
  }
  .analysis-chat .chat-toolbar {
    margin-inline: -24px;
  }
  .history-open .chat-toolbar > .icon-button {
    visibility: hidden;
  }
  .chat-history {
    padding-right: 14px;
    gap: 8px;
  }
  .chat-history .sidebar-heading strong {
    font-size: 15px;
  }
  .chat-history .research-row {
    padding-left: 28px;
  }
  .chat-history .research-row.active {
    background: var(--page);
  }
  .modal {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .modal-body {
    overflow: auto;
    min-height: 0;
    scrollbar-width: thin;
  }
  .modal-body > p {
    margin-bottom: 16px;
  }
  .modal-body > form > .button {
    margin-top: 12px;
  }
  .analysis-chat {
    max-width: none;
    margin: 0;
  }
  .analysis-chat .chat-turn,
  .analysis-chat .chat-welcome {
    max-width: 900px;
    margin-inline: auto;
  }
  .project-row:hover,
  .project-row:focus-within,
  .project-row:has([data-state='open']) {
    background: #ececec;
    border-radius: 10px;
  }
  .project-row:hover .hover-action,
  .project-row:focus-within .hover-action,
  .project-row:has([data-state='open']) .hover-action {
    opacity: 1;
    background: #ececec;
  }
  .project-row:hover > .sidebar-row,
  .project-row:focus-within > .sidebar-row {
    padding-right: 64px;
  }
  .project-row .hover-action .icon-button {
    color: #777;
  }
  .project-row .hover-action .icon-button:hover {
    color: #202020;
  }
  .composer {
    display: grid;
    align-items: end;
    gap: 12px 8px;
    padding: 16px;
  }
  .composer textarea {
    grid-column: 1 / -1;
    width: 100%;
  }
  .composer .attachment-tools {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    min-height: 26px;
    padding: 0 0 0 34px;
    margin: 0;
    align-self: end;
    align-items: flex-end;
  }
  .composer .attachment-tools > .icon-button {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 26px;
    height: 26px;
  }
  .composer .send {
    grid-row: 2;
    position: relative;
    inset: auto;
    align-self: end;
    width: 26px;
    height: 26px;
  }
  .chat-messages {
    display: flow-root;
  }
  :is(.design-chat, .analysis-chat) :is(.chat-messages, .composer, .planning-questions) {
    width: min(var(--chat-column-max, 100%), 100% - 2 * var(--chat-column-inset));
    margin-inline: auto;
  }
  .assistant-message,
  .streaming-text {
    font-weight: var(--font-regular);
  }
  .toggle-track {
    flex: 0 0 40px;
    position: relative;
    overflow: hidden;
  }
  .toggle-track > span {
    flex: 0 0 18px;
  }
  .toggle-hit.on .toggle-track > span {
    transform: translateX(16px);
  }
  .question-identity {
    gap: 10px;
  }
  .question-identity .row {
    gap: 4px;
  }
  .question-identity small {
    font-size: 12px;
    color: var(--muted);
  }
  .screening-hint {
    display: block;
    margin: 4px 0 12px;
    font-size: 12px;
  }
  .choice-edit-row input[type='checkbox'] {
    flex: 0 0 18px;
    width: 18px;
  }
  .inline-flow {
    margin: 20px 0;
  }
  .inline-flow figcaption {
    font-weight: var(--font-medium);
    margin-bottom: 12px;
  }
  .inline-flow ol {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    list-style: none;
    padding: 0;
  }
  .inline-flow li {
    position: relative;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--page);
    max-width: 240px;
  }
  .inline-flow li:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -20px;
    color: var(--muted);
  }
  .sidebar .sidebar-row:hover,
  .sidebar .sidebar-row:focus-visible,
  .sidebar .research-row:hover,
  .sidebar .research-row:focus-within,
  .sidebar .project-row:hover,
  .chat-history .sidebar-row:hover,
  .chat-history .sidebar-row:focus-visible,
  .chat-history .research-row:hover,
  .chat-history .research-row:focus-within,
  .chat-history .project-row:hover,
  .research-row.selected,
  .chat-history .research-row.active {
    background: #ededed;
  }
  .study-about-trigger {
    display: flex;
    width: fit-content;
    margin-inline: auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: var(--muted);
  }
  .study-about-trigger:hover {
    color: var(--text);
  }
  .study-about-trigger .icon {
    width: 14px;
    height: 14px;
  }
  .modal:has(.study-about) .modal-heading {
    margin-bottom: 24px;
  }
  .modal:has(.study-about) .modal-heading h2 {
    font-size: 18px;
    font-weight: 600;
  }
  .study-about {
    display: grid;
    gap: 28px;
    padding-bottom: 8px;
    font-weight: var(--font-regular);
  }
  .study-about h2 {
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.65;
  }
  .study-about h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  .study-about p {
    margin: 0;
    font-size: 14px;
    font-weight: var(--font-regular);
    line-height: 1.85;
    color: #444;
    overflow-wrap: anywhere;
  }
  .study-about p + p {
    margin-top: 16px;
  }
  .study-about strong {
    font-weight: 600;
    color: inherit;
  }
  body,
  .modal,
  .answer-value {
    font-weight: var(--font-regular);
  }
  .modal-heading h2 {
    font-size: 18px;
    font-weight: var(--font-medium);
  }
  .answer-detail h3,
  .response-document .answer-detail h2 {
    font-size: 14px;
    font-weight: var(--font-regular);
    margin-bottom: 12px;
    line-height: 1.7;
  }
  .answer-detail {
    margin-bottom: 28px;
  }
  .answer-value {
    font-size: 14px;
    line-height: 1.9;
    padding: 16px 18px;
  }
  .aggregate-question {
    padding-block: 20px;
    margin-bottom: 12px;
  }
  .aggregate-question .section-heading {
    margin-bottom: 12px;
  }
  .aggregate-question .section-heading h2 {
    font-size: 16px;
    font-weight: var(--font-medium);
  }
  .aggregate-question .chart {
    margin-block: 8px 12px;
  }
  .aggregate-question .chart-row {
    padding-block: 6px;
    gap: 4px 12px;
    font-size: 13px;
  }
  .aggregate-question .bar-track {
    height: 5px;
  }
  .report-heading {
    margin-bottom: 24px;
  }
  .report-section > h2 {
    font-weight: var(--font-medium);
  }
  .report-section h3 {
    font-weight: var(--font-medium);
  }
  .source-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-block: 4px;
  }
  .source-pill {
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 999px;
    background: #f1f1f1;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: var(--font-regular);
    line-height: 1.6;
    color: #666;
    text-decoration: none;
  }
  .source-pill:hover {
    background: #e7e7e7;
    color: var(--text);
  }
  .source-preview {
    z-index: 100;
    max-width: min(380px, calc(100vw - 32px));
    max-height: 350px;
    overflow: auto;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px #0002;
    font-size: 13px;
    font-weight: var(--font-regular);
  }
  .source-preview > a {
    font-weight: var(--font-medium);
    display: block;
    margin-bottom: 14px;
  }
  .source-preview small {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .source-preview p {
    line-height: 1.8;
    margin: 0;
  }
  .source-preview div + div {
    margin-top: 16px;
  }
  .response-document {
    width: min(900px, calc(100% - 32px));
    margin: 32px auto;
    padding: 32px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
  }
  .response-document header {
    margin-bottom: 32px;
  }
  .response-document header a {
    font-size: 14px;
    color: var(--muted);
  }
  .response-document h1 {
    font-size: 22px;
    margin-top: 20px;
  }
  .modal-overlay[data-state='open'] {
    animation: modal-overlay-in 140ms ease-out;
  }
  .modal-overlay[data-state='closed'] {
    animation: modal-overlay-out 120ms ease-in;
  }
  .modal[data-state='open'] {
    animation: modal-content-in 160ms ease-out;
  }
  .modal[data-state='closed'] {
    animation: modal-content-out 120ms ease-in;
  }
  @keyframes modal-overlay-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  @keyframes modal-overlay-out {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }
  @keyframes modal-content-in {
    from {
      opacity: 0;
      transform: translate(-50%, calc(-50% + 6px)) scale(0.99);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
  @keyframes modal-content-out {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
      transform: translate(-50%, calc(-50% + 4px));
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .modal[data-state],
    .modal-overlay[data-state] {
      animation: none;
    }
  }
  @media (max-width: 600px) {
    .response-document {
      padding: 20px;
      margin-top: 16px;
    }
  }
  .notice-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 120;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: max-content;
    max-width: min(440px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px #0002;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: var(--font-regular);
    line-height: 1.7;
    animation: notice-rise 180ms ease-out both;
  }
  .notice-toast button {
    padding: 0;
    flex: 0 0 20px;
    height: 24px;
    color: var(--muted);
  }
  .notice-toast.is-closing {
    animation: notice-leave 250ms ease-in both;
  }
  .source-extra {
    margin-left: 6px;
    color: var(--muted);
  }
  .source-preview-person > a {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: 10px;
  }
  .source-preview-person + .source-preview-person {
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 16px;
  }
  .block-meta .evidence-tag {
    border-radius: 999px;
  }
  @keyframes notice-rise {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes notice-leave {
    from {
      opacity: 1;
      transform: translateX(0);
    }
    to {
      opacity: 0;
      transform: translateX(calc(100% + 32px));
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .notice-toast,
    .notice-toast.is-closing {
      animation: none;
    }
  }
  .scroll-index {
    pointer-events: auto;
  }
  .scroll-index-item {
    opacity: 0;
    transition: opacity 180ms ease;
  }
  .scroll-index.is-visible .scroll-index-item {
    opacity: 1;
  }
  @media (prefers-reduced-motion: reduce) {
    .scroll-index-item {
      transition: none;
    }
  }
  .question-card,
  .form-card {
    border-radius: 12px;
    gap: 4px;
    margin-bottom: 16px;
  }
  .question-card .drag-handle {
    width: 24px;
    opacity: 0.45;
  }
  .question-card:hover .drag-handle,
  .question-card:focus-within .drag-handle {
    opacity: 1;
  }
  .question-top {
    margin-bottom: 14px;
    min-height: 36px;
  }
  .question-top .question-number {
    font-size: 12px;
    white-space: nowrap;
  }
  .question-card .question-identity .toggle-hit {
    width: 36px;
    height: 32px;
  }
  .question-card .question-identity .toggle-track {
    flex-basis: 32px;
    width: 32px;
    height: 20px;
    padding: 3px;
  }
  .question-card .question-identity .toggle-track > span {
    flex-basis: 14px;
    width: 14px;
    height: 14px;
  }
  .question-card .question-identity .toggle-hit.on .toggle-track > span {
    transform: translateX(12px);
  }
  .question-card .question-actions .icon-button {
    width: 28px;
    height: 28px;
  }
  .question-card .question-title-input {
    display: block;
    width: 100%;
    max-height: 260px;
    border: 0;
    border-radius: 8px;
    background: #f7f7f7;
    line-height: 1.7;
    resize: none;
    overflow-y: auto;
  }
  .question-card .choice-editor {
    margin: 0 0 16px;
  }
  .choice-editor-heading,
  .question-card .choice-edit-row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: center;
  }
  .choice-editor-heading {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .choice-editor-heading > span:first-child {
    grid-column: 2;
  }
  .choice-editor.is-screening .choice-editor-heading,
  .question-card .is-screening .choice-edit-row {
    grid-template-columns: 16px minmax(0, 1fr) 32px 28px;
  }
  .question-card .choice-edit-row {
    margin: 4px 0;
  }
  .question-card .choice-edit-row > input:not([type='checkbox']) {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
  }
  .question-card .choice-edit-row .icon-button {
    width: 28px;
    height: 28px;
    font-size: 19px;
    color: #999;
  }
  .question-card .choice-edit-row .icon-button:hover {
    color: var(--text);
    background: #efefef;
  }
  .question-card .choice-edit-row input[type='checkbox'] {
    justify-self: center;
  }
  .question-card .choice-editor > .text-action {
    margin-left: 26px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--muted);
  }
  .question-card .screening-hint {
    margin: 4px 0 0 26px;
    font-size: 11px;
  }
  .question-card .question-controls {
    gap: 12px 24px;
    margin-top: 16px;
  }
  .question-card .inline-label {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
  }
  .question-card .inline-label select {
    min-height: 32px;
    font-size: 12px;
    padding: 6px 28px 6px 10px;
    border-radius: 6px;
    color: var(--text);
  }
  .question-card details {
    margin-top: 14px;
    font-size: 13px;
  }
  @media (max-width: 600px) {
    .question-card {
      gap: 2px;
    }
    .question-card .drag-handle {
      width: 20px;
    }
    .question-card .question-title-input {
      font-size: 15px;
    }
    .question-card .question-controls {
      gap: 10px 16px;
    }
  }
  .scroll-index {
    width: 32px;
  }
  .scroll-index-item > button {
    width: 32px;
  }
  .scroll-peek {
    left: 38px;
  }
  .question-card .question-title-input,
  .question-card .choice-edit-row > input:not([type='checkbox']),
  .question-card select,
  .question-card details textarea {
    background: #fff;
    transition: background-color 140ms ease;
  }
  .question-card .question-title-input:hover,
  .question-card .question-title-input:focus,
  .question-card .choice-edit-row > input:not([type='checkbox']):hover,
  .question-card .choice-edit-row > input:not([type='checkbox']):focus,
  .question-card select:hover,
  .question-card select:focus,
  .question-card details textarea:hover,
  .question-card details textarea:focus {
    background: #f5f5f5;
  }
  .question-card .question-title-input {
    padding-left: 0;
    padding-right: 8px;
  }
  .question-format {
    margin: 4px 0 16px;
  }
  .question-card .question-format .inline-label {
    justify-content: flex-start;
  }
  .question-card .question-format select {
    min-width: 130px;
  }
  .question-card .question-controls:empty {
    display: none;
  }
  .question-card {
    animation: question-appear 160ms ease-out;
  }
  .question-card.removing {
    pointer-events: none;
    overflow: hidden;
    animation: question-remove 180ms ease-in forwards;
  }
  @keyframes question-appear {
    from {
      opacity: 0;
      translate: 0 6px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
  @keyframes question-remove {
    from {
      opacity: 1;
      max-height: var(--question-exit-height);
    }
    to {
      opacity: 0;
      max-height: 0;
      padding-block: 0;
      margin-bottom: 0;
      border-block-width: 0;
    }
  }
  .modal-body {
    padding: 6px;
    border-radius: 0;
    scrollbar-gutter: stable;
  }
  .modal-body form,
  .modal-body label {
    min-width: 0;
    max-width: 100%;
  }
  .modal-body input,
  .modal-body textarea,
  .modal-body select {
    min-width: 0;
    max-width: 100%;
  }
  .modal-body :focus-visible {
    outline-offset: 1px;
  }
  @media (prefers-reduced-motion: reduce) {
    .question-card,
    .question-card.removing {
      animation: none;
    }
  }
  .question-card .question-identity {
    gap: 12px;
    flex-wrap: wrap;
  }
  .question-card .question-type-pill select {
    border-radius: 999px;
    min-height: 28px;
    background-color: #f3f3f3;
    font-size: 12px;
  }
  .choice-editor.is-screening .choice-editor-heading .choice-target-label {
    grid-column: 3;
  }
  .choice-edit-row {
    animation: choice-appear 150ms ease-out;
  }
  .choice-edit-row.removing {
    pointer-events: none;
    overflow: hidden;
    animation: choice-remove 160ms ease-in forwards;
  }
  @keyframes choice-appear {
    from {
      opacity: 0;
      translate: 0 4px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
  @keyframes choice-remove {
    from {
      opacity: 1;
      max-height: 50px;
    }
    to {
      opacity: 0;
      max-height: 0;
      margin-block: 0;
    }
  }
  .research-introduction {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 32px;
  }
  .question-flow .question-flow-scroll {
    padding-block-start: 0;
  }
  .research-introduction .editable-title,
  .research-introduction .research-title-input {
    width: 100%;
    height: auto;
    min-height: 36px;
    white-space: normal;
  }
  .research-introduction .editable-title > span:first-child {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .research-introduction .introduction-title {
    font-size: 24px;
    line-height: 1.5;
  }
  .research-introduction .introduction-description {
    font-size: 16px;
    line-height: 1.7;
  }
  .research-introduction textarea {
    min-height: 100px;
    resize: vertical;
  }
  .editable-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 7px;
    padding: 5px 8px;
    max-width: 100%;
    text-align: left;
  }
  .editable-title > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .editable-title:hover,
  .editable-title:focus-visible {
    background: #ededed;
  }
  .title-edit-icon {
    display: flex;
    flex: 0 0 16px;
    opacity: 0;
  }
  .title-edit-icon .icon {
    width: 16px;
    height: 16px;
  }
  .editable-title:hover .title-edit-icon,
  .editable-title:focus-visible .title-edit-icon {
    opacity: 1;
  }
  .research-title-input {
    width: min(620px, 48vw);
    min-width: 0;
    height: 36px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: var(--font-regular);
  }
  @media (max-width: 600px) {
    .research-title-input {
      width: 100%;
      font-size: 14px;
    }
    .question-card .question-identity {
      gap: 6px 10px;
    }
    .question-card .question-type-pill select {
      max-width: 128px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .choice-edit-row,
    .choice-edit-row.removing {
      animation: none;
    }
  }
  .home-inner h1,
  .chat-welcome h1 {
    font-weight: var(--font-regular);
  }
  .composer {
    grid-template-columns: minmax(0, 1fr) auto 26px;
  }
  .composer.has-mode {
    grid-template-columns: minmax(0, 1fr) auto auto 26px;
  }
  .composer .custom-select.composer-mode {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-height: 26px;
    padding: 3px 6px;
    gap: 6px;
    background: transparent;
    font-size: 12px;
    align-self: end;
  }
  .composer .custom-select.composer-mode:hover,
  .composer .custom-select.composer-mode[data-state='open'] {
    background: #ececec;
  }
  .composer.has-mode .voice-input {
    grid-column: 3;
  }
  .composer.has-mode .send {
    grid-column: 4;
  }
  .composer .send {
    grid-column: 3;
  }
  .voice-input {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    display: flex;
    align-items: center;
  }
  .voice-mic {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
  }
  .voice-mic:hover {
    background: #e9e9e9;
  }
  .voice-mic:disabled {
    opacity: 0.35;
  }
  .voice-capsule {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    width: 74px;
    height: 26px;
    padding: 2px 6px;
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    background: var(--page);
  }
  .voice-capsule button {
    display: grid;
    place-items: center;
    width: 18px;
    height: 20px;
    padding: 0;
    flex-shrink: 0;
  }
  .voice-capsule canvas {
    width: 36px;
    height: 20px;
    flex-shrink: 0;
  }
  .voice-processing-slot {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
  }
  .voice-processing {
    display: block;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 2px solid #dedede;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  @keyframes dictation-pulse {
    from {
      opacity: 0.45;
    }
    to {
      opacity: 1;
    }
  }
  .project-row:hover .folder-icon {
    --folder-fill: #ededed;
  }
  @media (prefers-reduced-motion: reduce) {
    .voice-processing {
      animation: none;
    }
  }
  :focus-visible,
  .modal-body :focus-visible {
    outline: none;
    box-shadow: none;
  }
  .question-card .type-text select {
    background-color: #fff0e7;
    color: #975021;
  }
  .question-card .type-single select {
    background-color: #edf3ff;
    color: #46649b;
  }
  .question-card .type-multiple select {
    background-color: #f3efff;
    color: #71549b;
  }
  .question-flow-scroll {
    overflow-anchor: none;
  }
  .question-card .question-type-pill .answer-type-control {
    position: relative;
    display: inline-block;
    font-size: 12px;
    line-height: 1.5;
  }
  .type-pill-measure {
    display: block;
    visibility: hidden;
    white-space: nowrap;
    padding: 6px 30px 6px 11px;
    font: inherit;
  }
  .question-card .question-type-pill select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    min-width: 0;
    padding: 6px 30px 6px 11px;
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    font: inherit;
    line-height: 1.5;
  }
  .type-pill-chevron {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
  }
  .type-pill-chevron .icon {
    width: 12px;
    height: 12px;
  }
  .source-tags {
    vertical-align: middle;
    margin: 0 0 0 7px;
  }
  .continuous-prose {
    font-weight: var(--font-regular);
    line-height: 1.9;
  }
  /* Render the selected text ourselves; native selects reserve inconsistent arrow space. */
  .question-card .question-type-pill .type-pill-measure {
    visibility: visible;
    position: relative;
    z-index: 1;
    pointer-events: none;
    padding-right: 30px;
  }
  .question-card .question-type-pill select {
    color: transparent;
  }
  .question-card .question-type-pill select option {
    color: #202020;
  }
  .question-card .type-text .type-pill-measure {
    color: #975021;
  }
  .question-card .type-single .type-pill-measure {
    color: #46649b;
  }
  .question-card .type-multiple .type-pill-measure {
    color: #71549b;
  }
  .type-pill-chevron {
    z-index: 2;
  }
  .source-tags {
    margin-left: 0;
  }
  .voice-mic {
    padding: 0;
    flex: 0 0 26px;
  }
  .voice-mic svg {
    display: block;
  }
  .icon > svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  .response-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }
  .response-stats-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .response-stats > div {
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    gap: 4px;
  }
  .response-stats strong {
    font-size: 28px;
  }
  .aggregate-info {
    display: grid;
    gap: 16px;
  }
  .answer-detail-skeleton {
    min-height: 260px;
    display: grid;
    gap: 24px;
    padding: 8px 0;
  }
  .answer-detail-skeleton span {
    display: block;
    border-radius: 10px;
    background: #f5f5f5;
    animation: dictation-pulse 1s ease-in-out infinite alternate;
  }
  @media (max-width: 600px) {
    .response-stats {
      gap: 8px;
    }
    .response-stats > div {
      padding: 12px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .folder-front {
      transition: none !important;
    }
    .answer-detail-skeleton span {
      animation: none;
    }
  }
  .aggregate-question {
    border-bottom: 0;
  }
  .question-card {
    container-type: inline-size;
    padding: 20px 20px 16px 8px;
  }
  .question-card .drag-handle {
    align-self: flex-start;
  }
  .question-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 16px;
  }
  .question-card-prompt {
    flex: 1;
    min-width: 0;
  }
  .question-card .question-number {
    padding-inline-start: 10px;
    display: block;
    margin: 2px 0 8px;
    font-size: 11px;
  }
  .question-card .question-title-input {
    margin: 0;
    padding: 8px 10px;
    font-size: 16px;
    font-weight: var(--font-regular);
    min-height: 44px;
  }
  .question-card-heading .question-type-pill {
    flex: 0 0 auto;
  }
  .question-description-input {
    width: 100%;
    display: block;
    margin-bottom: 16px;
    background: #fff;
    padding: 8px 10px;
    min-height: 36px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    resize: none;
  }
  .question-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-inline: 10px;
    margin-bottom: 8px;
    min-width: 0;
  }
  .question-card .question-card-meta .question-number {
    padding-inline-start: 0;
    margin: 0;
    flex-shrink: 0;
  }
  .button.question-condition-trigger {
    min-width: 0;
    padding: 4px 10px;
    min-height: 28px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    background: var(--page);
    justify-content: flex-start;
    gap: 6px;
  }
  .question-condition-trigger[data-configured='true'] {
    background: color-mix(in srgb, var(--brand) 12%, white);
    color: var(--brand);
  }
  .question-condition-trigger > .icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
  }
  .question-condition-trigger > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .question-conditions {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
  }
  .question-condition {
    --condition-choice-gap: 20px;
    display: grid;
    gap: var(--condition-choice-gap);
    padding-block: 12px;
  }
  .question-conditions > .collapsible + .collapsible .question-condition {
    border-top: 1px solid var(--border);
  }
  .question-condition .custom-select {
    width: 100%;
    min-width: 0;
  }
  .question-condition-choices {
    display: grid;
    gap: var(--condition-choice-gap);
  }
  .question-condition-choices .checkbox-label {
    margin-bottom: 0;
    overflow-wrap: anywhere;
  }
  .condition-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
  }
  .condition-add.button {
    border-style: dashed;
    width: 100%;
  }
  .question-description-input:hover,
  .question-description-input:focus {
    background: #f5f5f5;
  }
  .answer-preview {
    margin: 0 10px 20px;
    max-width: 420px;
    padding: 10px 0;
    color: #aaa;
    font-size: 13px;
    border-bottom: 1px dashed #ddd;
  }
  .question-card .choice-editor {
    margin-bottom: 12px;
  }
  .question-card .choice-edit-row {
    grid-template-columns: 16px minmax(0, 1fr) 28px;
    gap: 8px;
  }
  .question-card .has-routing .choice-edit-row {
    grid-template-columns: 16px minmax(0, 1fr) 28px minmax(130px, 43%);
  }
  .question-card .choice-routing {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
  }
  .choice-routing > .icon {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    opacity: 0.45;
  }
  .question-card .choice-routing select {
    min-width: 0;
    width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12px;
    text-overflow: ellipsis;
    border-radius: 6px;
  }
  .question-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
  }
  .question-card .question-footer .question-controls {
    margin: 0;
  }
  .question-footer-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-left: auto;
  }
  .question-footer-actions .icon-button {
    width: 30px;
    height: 30px;
    color: #777;
  }
  .question-footer-actions .icon {
    width: 17px;
    height: 17px;
  }
  .question-footer-actions .icon-button:hover {
    color: #202020;
  }
  .question-add-icon {
    font-size: 21px;
    font-weight: var(--font-regular);
  }
  .branch-priority-note {
    display: block;
    color: #888;
    font-size: 11px;
    margin-top: 10px;
  }
  @container (max-width: 480px) {
    .question-card .has-routing .choice-edit-row {
      grid-template-columns: 16px minmax(0, 1fr) 28px;
    }
    .question-card .choice-routing {
      grid-column: 2 / -1;
      margin: -4px 0 8px;
    }
  }
  @media (max-width: 600px) {
    .question-card {
      padding: 14px 12px 14px 4px;
    }
  }
  .question-card .drag-handle {
    height: 24px;
    margin-top: -1px;
  }
  .question-card .choice-editor > .choice-add-row {
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    min-height: 38px;
    margin: 8px 0 0;
    border: 1px dashed #ddd;
    border-radius: 8px;
    color: #888;
    background: transparent;
    transition:
      background-color 140ms ease,
      border-color 140ms ease;
    font-size: 13px;
    font-weight: var(--font-regular);
  }
  .choice-add-row > span:first-child {
    justify-self: center;
    font-size: 19px;
    line-height: 1;
  }
  .question-card .choice-editor > .choice-add-row:hover,
  .question-card .choice-editor > .choice-add-row:focus-visible {
    background: #f5f5f5;
    border-color: #bbb;
    color: #333;
  }
  :is(.sidebar, .chat-history) .project-row:hover > .sidebar-row {
    background: transparent;
  }
  .question-card .choice-editor {
    --choice-symbol-left: 0px;
  }
  .question-card .choice-edit-row,
  .question-card .choice-editor > .choice-add-row {
    margin-inline-start: var(--choice-symbol-left);
    margin-inline-end: 0;
  }
  .custom-select {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--page);
    color: var(--text);
    text-align: left;
    font-size: 14px;
  }
  .custom-select > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .custom-select > .icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
  }
  .custom-select:hover,
  .custom-select[data-state='open'] {
    background: #ececec;
  }
  .select-menu {
    width: max(190px, var(--radix-dropdown-menu-trigger-width));
    max-width: min(640px, calc(100vw - 24px));
    min-width: 0;
    max-height: var(--radix-dropdown-menu-content-available-height);
    overflow-y: auto;
  }
  .menu .select-option {
    display: flex;
    justify-content: space-between;
    gap: 16px;
  }
  .menu .select-option > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .menu .select-option > .icon {
    flex-shrink: 0;
  }
  .menu .select-option[data-disabled] {
    opacity: 0.45;
    cursor: default;
  }
  .question-card .answer-type-select {
    width: auto;
    min-height: 28px;
    padding: 6px 10px 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
  }
  .question-card .type-text .answer-type-select {
    background: #fff0e7;
    color: #975021;
  }
  .question-card .type-single .answer-type-select {
    background: #edf3ff;
    color: #46649b;
  }
  .question-card .type-multiple .answer-type-select {
    background: #f3efff;
    color: #71549b;
  }
  .question-card .choice-routing .custom-select {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12px;
  }
  .question-controls .custom-select {
    width: auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .aggregate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 48px;
    display: grid;
    align-items: stretch;
    row-gap: 36px;
  }
  .aggregate-grid .aggregate-question {
    margin-bottom: 0;
    min-width: 0;
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    row-gap: 0;
    padding: 20px 0;
  }
  .aggregate-question .section-heading {
    align-items: flex-start;
  }
  .aggregate-question .section-heading h2 {
    flex: 1;
    min-width: 0;
  }
  .share-form input,
  .share-form .custom-select,
  .share-form > .button {
    height: 48px;
  }
  .link-list .link-revoke {
    color: #c1352d;
  }
  :is(.sidebar, .chat-history) > .project-heading {
    margin-bottom: -8px;
  }
  .sidebar {
    padding-top: 8px;
  }
  :is(.sidebar, .chat-history) > .sidebar-heading {
    height: 48px;
    flex-shrink: 0;
  }
  :is(.sidebar, .chat-history) > .sidebar-heading strong {
    font-size: 18px;
    font-weight: var(--font-regular);
  }
  .project-heading .icon-button {
    width: 28px;
    height: 32px;
    margin-left: auto;
  }
  :is(.sidebar, .chat-history) .recent-project .research-row {
    padding-left: 0;
  }
  .project-heading .icon-button,
  .project-row .hover-action .icon-button {
    color: var(--muted);
    background: transparent;
  }
  .project-heading .icon-button:hover,
  .project-heading .icon-button:focus-visible,
  .project-row .hover-action .icon-button:hover,
  .project-row .hover-action .icon-button:focus-visible {
    color: var(--text);
    background: transparent;
  }
  :is(.sidebar, .chat-history) .sidebar-scroll {
    padding-inline: 8px;
    margin-inline: -8px;
  }
  :is(.sidebar, .chat-history) :is(.research-row, .project-row),
  :is(.sidebar, .chat-history) > .sidebar-row,
  .sidebar-footer > .sidebar-row {
    position: relative;
    isolation: isolate;
  }
  :is(.sidebar, .chat-history) .project[data-drop-target]::before,
  :is(.sidebar, .chat-history) :is(.research-row, .project-row)::before,
  :is(.sidebar, .chat-history) > .sidebar-row::before,
  .sidebar-footer > .sidebar-row::before {
    content: '';
    position: absolute;
    inset: 0 -8px;
    z-index: -1;
    border-radius: 8px;
    background: inherit;
    pointer-events: none;
  }
  :is(.sidebar, .chat-history) .project[data-drop-target]::before {
    background: #fff4eb;
  }
  .sidebar-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    flex: 1;
  }
  .sidebar-label > span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .sidebar-label.is-scrolling > span {
    width: max-content;
    overflow: visible;
    text-overflow: clip;
  }
  .chat-history {
    font-size: 14px;
    padding-left: 8px;
    margin-left: -8px;
    width: 228px;
  }
  :is(.sidebar, .chat-history) .icon-button {
    color: var(--muted);
    background: transparent;
  }
  :is(.sidebar, .chat-history) .icon-button:is(:hover, :focus-visible, [data-state='open']) {
    color: var(--text);
    background: transparent;
  }
  :is(.sidebar, .chat-history) .sidebar-row > .icon {
    color: var(--text);
  }
  :is(.sidebar, .chat-history) .sidebar-row:is(:hover, :focus-visible) > .icon {
    color: var(--text);
  }
  :is(.sidebar, .chat-history) .icon-button .icon img {
    opacity: 0.55;
  }
  :is(.sidebar, .chat-history)
    .icon-button:is(:hover, :focus-visible, [data-state='open'])
    .icon
    img,
  :is(.sidebar, .chat-history) .sidebar-row:is(:hover, :focus-visible) > .icon img {
    opacity: 1;
  }
  .report-loading-skeleton {
    max-width: 880px;
    padding-block: 24px;
  }
  .report-loading-section {
    display: grid;
    gap: 14px;
    margin-bottom: 36px;
  }
  .report-loading-section > span {
    display: block;
    height: 16px;
    border-radius: 6px;
    background: linear-gradient(100deg, #f0f0f0 25%, #f8f8f8 45%, #f0f0f0 65%);
    background-size: 220% 100%;
    animation: report-shimmer 1.6s ease-in-out infinite;
  }
  .report-loading-section > .skeleton-heading {
    width: 35%;
    height: 26px;
    margin-bottom: 10px;
  }
  .report-loading-section > .skeleton-short {
    width: 70%;
  }
  .report-loading-section > .skeleton-chart {
    height: 140px;
    margin-top: 12px;
  }
  @keyframes report-shimmer {
    from {
      background-position: 100% 0;
    }
    to {
      background-position: -100% 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .report-loading-section > span {
      animation: none;
    }
  }
  .question-card .choice-editor > .choice-add-row {
    display: flex;
    justify-content: center;
    margin-inline: -8px;
    padding: 8px 16px;
    gap: 8px;
    text-align: center;
  }
  .choice-add-row > span:last-child {
    padding-left: 0;
  }
  .question-card .is-screening .choice-edit-row {
    grid-template-columns: 16px minmax(0, 1fr) auto 28px;
  }
  .question-card .screening-target {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
  }
  .question-answer-details {
    margin-bottom: 8px;
  }
  .question-answer-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: var(--font-regular);
    cursor: pointer;
    list-style: none;
  }
  .question-answer-details > summary::-webkit-details-marker {
    display: none;
  }
  .question-answer-details > summary .icon {
    width: 14px;
    height: 14px;
  }
  .question-answer-details:not([open]) {
    margin-bottom: 0;
  }
  .collapsible {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition:
      grid-template-rows 200ms ease,
      opacity 160ms ease;
  }
  .collapsible[data-open='true'] {
    grid-template-rows: 1fr;
    opacity: 1;
  }
  .collapsible-inner {
    min-height: 0;
    overflow: hidden;
  }
  .accordion-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    text-align: left;
    font-size: 14px;
    font-weight: var(--font-regular);
    color: var(--muted);
  }
  .accordion-chevron {
    display: inline-flex;
    transition: transform 200ms ease;
  }
  .accordion-chevron .icon {
    width: 14px;
    height: 14px;
  }
  .accordion[data-open='true'] > .accordion-trigger .accordion-chevron {
    transform: rotate(90deg);
  }
  .accordion .collapsible-inner > p {
    margin-block: 10px;
  }
  .question-answer-details > .accordion-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 12px;
  }
  .question-answer-details > .accordion-trigger {
    padding-inline-end: 0;
  }
  .question-answer-details > .accordion-trigger .accordion-chevron {
    width: 28px;
    flex: 0 0 28px;
    justify-content: center;
  }
  .question-answer-details > .collapsible {
    margin-inline: -8px;
  }
  .question-answer-details > .collapsible > .collapsible-inner {
    padding-inline: 8px;
  }
  .question-card .choice-editor .choice-edit-row {
    margin-inline-start: 10px;
  }
  .question-card .choice-editor > .choice-add-row {
    margin-inline-start: 10px;
    margin-inline-end: 0;
    width: calc(100% - 10px);
  }
  .sidebar-collapsible {
    margin-inline: -8px;
  }
  .sidebar-collapsible > .collapsible-inner {
    padding-inline: 8px;
  }
  @media (prefers-reduced-motion: reduce) {
    .collapsible,
    .accordion-chevron {
      transition: none;
    }
  }
  .boolean-choice {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0 0 20px;
  }
  .boolean-choice > label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
  }
  .answer-detail-modal {
    height: auto;
    max-height: calc(100dvh - 32px);
  }
  .answer-detail-modal > .modal-body {
    flex: 0 1 auto;
  }
  .report-document {
    font-size: 14px;
  }
  .empty-state-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .empty-state-title {
    margin: 0;
    font-size: 24px;
    font-weight: var(--font-medium);
    line-height: 1.5;
  }
  .modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
  }
  .modal-actions > .button {
    margin: 0;
  }
  .question-card .is-screening.has-routing .choice-routing {
    grid-column: 2 / -1;
    margin: 0 0 8px;
  }
  .analysis-chat > .composer {
    align-self: center;
    margin-inline: auto;
  }
  .home-inner {
    width: min(900px, calc(100% - 64px));
  }
  .home-inner > .chat-welcome {
    margin: 0 0 28px;
  }
  .chat-welcome h1 {
    font-size: 28px;
    font-weight: var(--font-regular);
    line-height: 1.5;
  }
  .chat-suggestions button {
    transition: background-color 160ms ease;
  }
  .chat-suggestions button:not(:disabled):hover,
  .chat-suggestions button:focus-visible {
    background-color: #ebebeb;
  }
  .chat-suggestions button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 112px;
  }
  .chat-suggestions .suggestion-label {
    position: relative;
    z-index: 1;
    display: block;
    max-width: calc(100% - 72px);
    line-height: 1.65;
  }
  .suggestion-illustration {
    position: absolute;
    pointer-events: none;
    user-select: none;
    width: 146px;
    height: 146px;
    max-width: none;
    right: -27px;
    bottom: -33px;
    object-fit: contain;
  }
  .question-skeletons {
    display: grid;
    gap: 16px;
    margin-block: 16px;
  }
  .question-skeleton {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: grid;
    gap: 18px;
  }
  .question-skeleton > span {
    display: block;
    height: 16px;
    border-radius: 6px;
    background: linear-gradient(100deg, #f0f0f0 25%, #f8f8f8 45%, #f0f0f0 65%);
    background-size: 220% 100%;
    animation: report-shimmer 1.6s ease-in-out infinite;
  }
  .question-skeleton > .skeleton-label {
    width: 24%;
    height: 12px;
  }
  .question-skeleton > .skeleton-short {
    width: 70%;
  }
  @media (prefers-reduced-motion: reduce) {
    .question-skeleton > span {
      animation: none;
    }
  }
  .content-skeleton {
    display: grid;
    gap: 18px;
    width: 100%;
    padding-block: 20px;
  }
  .content-skeleton > span,
  .inline-skeleton {
    display: block;
    height: 16px;
    border-radius: 6px;
    background: linear-gradient(100deg, #f0f0f0 25%, #f8f8f8 45%, #f0f0f0 65%);
    background-size: 220% 100%;
    animation: report-shimmer 1.6s ease-in-out infinite;
  }
  .content-skeleton > .skeleton-heading {
    width: 38%;
    height: 24px;
  }
  .content-skeleton > span:last-child:not(:first-child) {
    width: 72%;
  }
  .header-title > .content-skeleton {
    width: min(260px, 25vw);
    padding: 0;
  }
  .sidebar-scroll .content-skeleton {
    padding-inline: 10px;
  }
  .inline-skeleton {
    display: inline-block;
    width: 88px;
    vertical-align: middle;
  }
  @media (prefers-reduced-motion: reduce) {
    .content-skeleton > span,
    .inline-skeleton {
      animation: none;
    }
  }
  .header-actions > .header-button-skeleton {
    width: 96px;
    height: 44px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .empty-state-title,
  .chat-welcome h1,
  .home h1,
  .question-prompt h1,
  .response-stats strong,
  .response-table > button strong {
    font-weight: var(--font-regular);
  }
  textarea.chat-textarea {
    resize: none;
  }
  textarea.chat-textarea[data-autosize='always'] {
    min-height: 0;
    line-height: 1.65;
  }
  .composer textarea.chat-textarea {
    width: calc(100% + 12px);
    max-width: none;
    margin-right: -12px;
    padding-right: 12px;
  }
  .results:has(> .tab-content > .empty-state) {
    display: flex;
    flex-direction: column;
  }
  .results > .tab-content:has(> .empty-state) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: min-content;
  }
  .results > .tab-content > .empty-state {
    flex: 1;
    min-height: auto;
    padding-block: 24px;
  }
  .results > .tab-content:has(> .empty-state) > .results-heading,
  .results > .tab-content:has(> .empty-state) > .response-stats {
    flex-shrink: 0;
  }
  .menu {
    transform-origin: var(--radix-dropdown-menu-content-transform-origin);
  }
  .menu[data-state='open'] {
    animation: menu-open 140ms ease-out;
  }
  .menu[data-state='closed'] {
    animation: menu-close 100ms ease-in forwards;
    pointer-events: none;
  }
  @keyframes menu-open {
    from {
      opacity: 0;
      transform: scale(0.97);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  @keyframes menu-close {
    from {
      opacity: 1;
      transform: scale(1);
    }
    to {
      opacity: 0;
      transform: scale(0.97);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .menu[data-state] {
      animation: none;
    }
  }
  .planning-questions {
    flex-shrink: 0;
    border: 1px solid var(--line, #e5e5e5);
    border-radius: 18px;
    padding: 16px;
    margin-top: 0;
    max-height: min(60dvh, 620px);
    overflow-y: auto;
    background: white;
    animation: tab-enter 160ms ease;
  }
  .planning-heading,
  .planning-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .planning-heading {
    font-size: 13px;
  }
  .planning-heading .row {
    gap: 2px;
  }
  .planning-count {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .planning-title {
    font-size: 15px;
    font-weight: var(--font-regular);
    line-height: 1.65;
    margin: 14px 0;
  }
  .planning-options {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    min-width: 0;
  }
  .planning-options:empty {
    display: none;
  }
  .planning-option {
    display: flex;
    flex-direction: row;
    margin-bottom: 0;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--page);
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
  }
  .planning-option:not(:last-child) {
    margin-bottom: 0;
  }
  .planning-option input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #222;
  }
  .planning-input {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border: 1px solid var(--line, #e5e5e5);
    border-radius: 12px;
    padding: 10px;
    margin-top: 12px;
  }
  .planning-input .chat-textarea {
    flex: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
  }
  .planning-actions {
    justify-content: flex-end;
    margin-top: 14px;
  }
  .planning-actions .button {
    padding: 8px 14px;
  }
  @media (prefers-reduced-motion: reduce) {
    .planning-questions {
      animation: none;
    }
  }
  .scroll-area {
    --scroll-fade-size: 24px;
    --scroll-fade-top: 0px;
    --scroll-fade-bottom: 0px;
  }
  .scroll-area[data-fade-top='true'] {
    --scroll-fade-top: min(var(--scroll-fade-size), 25%);
  }
  .scroll-area[data-fade-bottom='true'] {
    --scroll-fade-bottom: min(var(--scroll-fade-size), 25%);
  }
  .scroll-area:is([data-fade-top='true'], [data-fade-bottom='true']) {
    mask-image: linear-gradient(
      to bottom,
      transparent,
      #000 var(--scroll-fade-top),
      #000 calc(100% - var(--scroll-fade-bottom)),
      transparent
    );
  }
  .menu.scroll-area {
    max-height: var(--radix-dropdown-menu-content-available-height);
    overflow-y: auto;
  }
  .design-chat > .planning-questions:not([hidden]) + .composer {
    margin-top: 12px;
  }
}

@layer components {
  .question-flow-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 16px;
  }
  .question-flow-toolbar > .questionnaire-history {
    grid-column: 2;
  }
  .question-flow-toolbar > .autosave-status {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
    text-align: right;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .questionnaire-history {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 13px;
  }
  .questionnaire-history > span {
    min-width: 44px;
    text-align: center;
  }
  .audience-groups {
    border: 0;
    padding: 0;
    margin: 24px 0;
    min-width: 0;
    display: grid;
    gap: 24px;
  }
  .form-card {
    margin: 0;
    padding: 24px;
    flex-direction: column;
    gap: 20px;
  }
}

/* Layout adaptations. 640px: phone controls; 899px: compact workspace. Component-specific thresholds remain scoped to their content. */
@layer responsive {
  @media (max-width: 1200px) {
    .question-flow {
      padding: 24px;
    }
    .design-chat {
      --design-chat-inset: 18px;
    }
    .report-layout {
      grid-template-columns: minmax(0, 1fr) 170px;
      gap: 24px;
    }
    .results {
      padding: 24px;
    }
    .header-title {
      gap: 12px;
    }
    .header-actions .button {
      padding: 10px 14px;
    }
  }
  @media (max-width: 899px) {
    .app-shell,
    .app-shell.sidebar-open {
      grid-template-columns: 0px minmax(0, 1fr);
    }
    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      box-shadow: 10px 0 30px #0002;
    }
    .sidebar-shade {
      opacity: 0;
      pointer-events: none;
      transition: opacity 260ms ease;
      display: block;
      position: fixed;
      inset: 0;
      background: #0006;
      z-index: 29;
    }
    .sidebar-open .sidebar-shade {
      opacity: 1;
      pointer-events: auto;
    }
    .app-header {
      padding: 8px 12px;
    }
    .report-toc {
      display: none;
    }
    .report-layout {
      display: block;
    }
    .header-title .brand {
      display: none;
    }
    .header-title .research-title {
      max-width: 30vw;
    }
    .editor-grid {
      grid-template-columns: minmax(260px, 35%) minmax(0, 1fr);
    }
    .hover-action {
      opacity: 1;
    }
  }
  @media (max-width: 640px) {
    body {
      font-size: 16px;
    }
    h1 {
      font-size: 24px;
    }
    .app-header {
      min-height: 64px;
      padding: 8px 12px;
      gap: 4px;
    }
    .header-title {
      gap: 8px;
    }
    .header-title .research-title {
      font-size: 13px;
    }
    .header-actions {
      gap: 2px;
    }
    .header-actions > .button {
      font-size: 12px;
      padding: 8px 12px;
    }
    .header-title .brand {
      display: flex;
    }
    .header-title:has(.research-title) .brand {
      display: none;
    }
    .header-actions .icon-button {
      width: 36px;
    }
    .development-label {
      padding: 2px 12px;
      font-size: 10px;
    }
    .tabs {
      padding: 0 12px;
    }
    .workspace-body {
      padding: 8px;
    }
    .home h1 {
      font-size: 24px;
      margin-bottom: 24px;
    }
    .composer {
      padding: 16px;
      border-radius: 24px;
    }
    .composer textarea {
      font-size: 16px;
      min-height: 64px;
    }
    .editor-grid {
      display: flex;
      flex-direction: column;
    }
    .editor-grid .design-chat {
      display: none;
    }
    .editor-grid.show-chat .design-chat {
      display: flex;
      flex: 1;
    }
    .editor-grid.show-chat .question-flow {
      display: none;
    }
    .question-flow {
      flex: 1;
    }
    .flow-toolbar {
      margin-bottom: 20px;
    }
    .flow-toolbar h1 {
      font-size: 20px;
    }
    .flow-toolbar .button {
      min-height: 40px;
      padding: 8px 12px;
    }
    .drag-handle {
      width: 30px;
    }
    .question-top select {
      width: 142px;
    }
    .question-top .icon-button {
      width: 32px;
    }
    .question-controls {
      gap: 12px;
    }
    .results {
      padding: 20px 16px;
    }
    .results-heading {
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    .results-heading h1 {
      font-size: 24px;
    }
    .response-stats {
      margin: 20px 0;
    }
    .response-table-head,
    .response-table > button {
      grid-template-columns: minmax(0, 1fr) 64px 20px;
      padding: 14px 12px;
      gap: 8px;
    }
    .response-table-head > span:nth-child(3),
    .response-table > button > span:nth-child(3) {
      display: none;
    }
    .chat-panel {
      padding: 20px 16px 16px;
    }
    .chat-welcome {
      margin: 6vh 0 32px;
    }
    .chat-welcome h1 {
      font-size: 22px;
    }
    .chat-suggestions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .chat-suggestions button {
      padding: 14px;
      font-size: 13px;
      min-height: 86px;
    }
    .chat-toolbar {
      margin-bottom: 16px;
    }
    .chat-toolbar .button {
      padding: 8px;
      font-size: 12px;
    }
    .analysis-block p {
      font-size: 15px;
    }
    .assistant-message {
      line-height: 1.8;
    }
    .report-section h2 {
      font-size: 19px;
    }
    .modal {
      padding: 16px;
      max-height: calc(100dvh - 32px);
    }
    .modal-close {
      width: 28px;
      height: 28px;
      min-width: 28px;
    }
    .modal-heading {
      margin-bottom: 20px;
    }
    .modal-heading h2 {
      font-size: 18px;
    }
    .link-list .button {
      font-size: 12px;
      padding: 8px 12px;
    }
    .inline-form .button {
      width: 100%;
    }
    .sidebar-row,
    .research-row {
      min-height: 44px;
    }
    :is(.sidebar, .chat-history) .icon-button {
      min-height: 36px;
    }
    .respondent {
      padding: 0 22px 24px;
    }
    .respondent-header {
      height: 72px;
    }
    .respondent-intro {
      padding-top: 24px;
    }
    .respondent-intro h1 {
      font-size: 24px;
    }
    .question-prompt {
      padding: 24px 0;
    }
    .question-prompt h1 {
      font-size: 22px;
      line-height: 1.7;
    }
    .respondent-input {
      padding: 18px;
    }
    .respondent-input textarea {
      font-size: 17px;
    }
    .empty-state {
      padding: 24px 12px;
    }
    .row {
      gap: 8px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
      animation-duration: 0.001ms !important;
      transition-duration: 0.001ms !important;
    }
  }
  @media (max-width: 899px) {
    .analysis-chat-layout.history-open {
      grid-template-columns: 0px minmax(0, 1fr);
    }
    .chat-history {
      position: absolute;
      inset: 0 auto 0 0;
      width: min(248px, calc(100% - 44px));
      height: 100%;
      padding: 8px 12px;
      margin: 0;
      background: white;
      border-radius: 0;
      box-shadow: none;
      opacity: 1;
      z-index: 16;
      transform: translateX(-100%);
      transition:
        transform 260ms ease,
        visibility 260ms;
    }
    .history-open .chat-history {
      transform: translateX(0);
    }
    .chat-history-shade {
      display: block;
      position: absolute;
      inset: 0;
      background: #00000014;
      border-radius: 0;
      z-index: 15;
      opacity: 0;
      pointer-events: none;
      transition: opacity 260ms ease;
    }
    .history-open .chat-history-shade {
      opacity: 1;
      pointer-events: auto;
    }
    .chat-panel {
      padding: 16px;
    }
    .chat-panel > .tab-content {
      height: 100%;
    }
    .analysis-chat {
      padding: 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .app-shell,
    .sidebar,
    .sidebar-shade,
    .tab-content,
    .editor-grid,
    .analysis-chat-layout,
    .chat-history {
      animation: none;
      transition: none;
    }
  }
  @media (max-width: 640px) {
    .question-flow-scroll {
      padding: 20px 12px 20px 28px;
    }
    .design-chat {
      padding-inline: var(--panel-header-inline, 22px);
    }
    .analysis-chat {
      padding-inline: 20px;
    }
    .analysis-chat .chat-toolbar {
      margin-inline: -20px;
    }
    .scroll-index {
      left: 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .scroll-peek,
    .scroll-index-item > button > span {
      animation: none;
      transition: none;
    }
  }
  .results:not(.chat-panel) {
    padding: 32px 36px;
  }
  @media (max-width: 1100px) {
    .aggregate-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 28px 40px;
    }
  }
  @media (max-width: 760px) {
    .results:not(.chat-panel) {
      padding: 24px 22px;
    }
    .aggregate-grid {
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
    }
  }
  .composer textarea.chat-textarea {
    min-height: 0;
    resize: none;
  }
  .report-document .analysis-block p {
    font-size: inherit;
  }
  @media (max-width: 899px) {
    .chat-history {
      margin-left: 0;
    }
  }
  @media (max-width: 480px) {
    .chat-suggestions {
      grid-template-columns: 1fr;
    }
    .chat-suggestions button {
      min-height: 94px;
      padding: 18px 20px;
    }
    .chat-suggestions .suggestion-label {
      max-width: calc(100% - 88px);
    }
    .suggestion-illustration {
      width: 132px;
      height: 132px;
      right: -17px;
      bottom: -32px;
    }
  }
  .workspace-body {
    --panel-header-block: 32px;
    --panel-header-inline: 36px;
  }
  .results:not(.chat-panel),
  .chat-panel,
  .question-flow-scroll {
    padding: var(--panel-header-block) var(--panel-header-inline);
  }
  .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-height: 36px;
    gap: 16px;
    margin: 0 0 28px;
  }
  .panel-heading h1 {
    margin: 0;
    font-size: 24px;
    font-weight: var(--font-regular);
    line-height: 1.5;
  }
  .panel-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }
  .panel-heading-actions .custom-select {
    width: clamp(96px, 22vw, 280px);
  }
  .analysis-chat {
    padding-inline: 0;
  }
  .analysis-chat .chat-toolbar {
    margin-inline: 0;
  }
  @media (max-width: 760px) {
    .workspace-body {
      --panel-header-block: 24px;
      --panel-header-inline: 22px;
    }
    .panel-heading {
      gap: 8px;
    }
  }
  @media (min-width: 641px) {
    .editor-grid {
      position: relative;
      --editor-chat-width: 30%;
      grid-template-columns:
        clamp(min(260px, 40%), var(--editor-chat-width), max(40%, min(55%, calc(100% - 332px))))
        minmax(0, 1fr);
    }
    .panel-divider {
      position: absolute;
      z-index: 5;
      left: clamp(
        min(260px, 40%),
        var(--editor-chat-width),
        max(40%, min(55%, calc(100% - 332px)))
      );
      top: 0;
      bottom: 0;
      width: 12px;
      cursor: col-resize;
      touch-action: none;
      user-select: none;
    }
    .panel-divider::after {
      content: '';
      position: absolute;
      inset: 12px 5px;
      border-radius: 2px;
      background: transparent;
      transition: background 150ms ease;
    }
    .panel-divider:hover::after,
    .panel-divider:active::after,
    .panel-divider:focus-visible::after {
      background: #ccc;
    }
  }
  @media (max-width: 640px) {
    .panel-divider {
      display: none;
    }
  }
  .research-tabs {
    display: flex;
    gap: 32px;
    width: fit-content;
    max-width: 100%;
  }
  @media (min-width: 641px) and (max-width: 1200px) {
    .research-tabs {
      gap: 24px;
    }
  }
  .research-tabs > button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  @media (max-width: 640px) {
    .panel-heading h1 {
      font-size: 20px;
    }
    .tabs {
      padding-inline: 12px;
    }
    .research-tabs {
      width: 100%;
      gap: 0;
      justify-content: space-between;
    }
    .research-tabs > button {
      padding-inline: 6px;
      font-size: 13px;
    }
  }
  .editor-view-switch {
    display: none;
  }
  .mobile-content-navigation {
    display: none;
  }
  @media (max-width: 899px) {
    .workspace-body[data-view='質問'] {
      container: editor / inline-size;
    }
  }
  @media (max-width: 899px) {
    .mobile-content-navigation {
      display: block;
      margin-bottom: 24px;
      min-width: 0;
    }
    .mobile-content-navigation .custom-select {
      width: 100%;
      max-width: 100%;
    }
    .aggregate-question,
    .report-section,
    .report-section > section {
      scroll-margin-top: 20px;
    }
    .respondent-input textarea {
      min-height: 0;
      resize: none;
    }
    .respondent-actions {
      position: sticky;
      bottom: 0;
      z-index: 2;
      padding: 20px 0 max(12px, env(safe-area-inset-bottom));
      background: linear-gradient(to bottom, transparent, white 16px);
    }
  }
  @media (max-width: 640px) {
    .home-inner {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 20px;
      width: calc(100% - 32px);
      margin: 32px auto 24px;
    }
    .home-inner > .chat-welcome {
      display: contents;
    }
    .home-inner .chat-welcome h1 {
      grid-row: 1;
      font-size: 24px;
      margin: 0;
    }
    .home-inner > .composer {
      grid-row: 2;
      width: 100%;
      margin: 0;
    }
    .home-inner .chat-suggestions {
      grid-row: 3;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .home-inner .chat-suggestions button {
      min-height: 88px;
      height: auto;
      padding: 14px 12px;
      font-size: 13px;
    }
    .home-inner .suggestion-label {
      max-width: 100%;
      position: relative;
      z-index: 1;
      padding-right: 20px;
    }
    .home-inner .suggestion-illustration {
      width: 85px;
      height: 85px;
      right: -24px;
      opacity: 0.55;
    }
    .response-stats {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      margin-block: 20px;
    }
    .response-stats-four {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .response-stats > div {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      padding: 12px 10px;
      min-width: 0;
      min-height: 86px;
      gap: 6px;
    }
    .response-stats span {
      font-size: 12px;
      line-height: 1.5;
      white-space: nowrap;
    }
    .response-stats strong {
      font-size: 24px;
      line-height: 1.25;
      overflow-wrap: anywhere;
      font-variant-numeric: tabular-nums;
    }
    .question-flow {
      padding: 18px 12px;
    }
    .question-card {
      padding: 14px 12px 12px 0;
    }
    .question-card-heading {
      gap: 8px;
    }
    .question-card .question-footer-actions .icon-button,
    .question-card .choice-edit-row > .icon-button {
      width: 40px;
      height: 40px;
    }
    .question-card .choice-edit-row {
      grid-template-columns: 16px minmax(0, 1fr) 40px;
    }
    .question-card .has-routing .choice-edit-row {
      grid-template-columns: 16px minmax(0, 1fr) 40px;
    }
    .question-card .choice-routing {
      grid-column: 2 / -1;
    }
    .share-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      gap: 14px 12px;
    }
    .share-form > label:first-child {
      grid-column: 1 / -1;
    }
    .share-form > label:nth-child(2) {
      grid-column: 1;
    }
    .share-form > .button {
      grid-column: 2;
      width: auto;
      margin: 0;
    }
    .modal-body:has(.modal-actions) {
      --scroll-fade-bottom: 0px;
    }
    .modal-body .modal-actions {
      position: sticky;
      bottom: 0;
      z-index: 3;
      background: white;
      padding-block: 16px 4px;
      box-shadow: 0 -12px 12px white;
    }
  }
  .menu .menu-item-mobile {
    display: none;
  }
  @media (max-width: 640px) {
    .header-actions > .button,
    .header-actions > .header-button-skeleton,
    .menu .menu-item-desktop {
      display: none;
    }
    .menu .menu-item-mobile {
      display: flex;
    }
    .header-title {
      flex: 1;
      min-width: 0;
    }
    .header-title .research-title {
      max-width: none;
      width: 100%;
    }
  }
  .editor-mobile-toolbar {
    display: none;
  }
  @container editor (max-width: 820px) {
    .design-chat > .planning-questions {
      flex-shrink: 1;
      min-height: 0;
    }
    .design-chat > .composer {
      flex-shrink: 0;
    }
    .editor-grid .panel-divider {
      display: none;
    }
    .editor-grid.show-chat .design-chat {
      display: flex;
      flex: 1;
    }
    .editor-grid.show-chat .question-flow {
      display: none;
    }
    .flow-toolbar > h1 {
      display: none;
    }
    .editor-view-switch {
      display: inline-flex;
      align-items: center;
      padding: 3px;
      border-radius: 10px;
      background: #f1f1f1;
      white-space: nowrap;
    }
    .editor-view-switch > button {
      padding: 6px 9px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: var(--font-regular);
      line-height: 1.5;
      color: var(--muted);
      transition:
        background 160ms ease,
        color 160ms ease;
    }
    .editor-view-switch > button[aria-pressed='true'] {
      background: white;
      color: var(--text);
      box-shadow: 0 1px 3px #0000000a;
    }
    .editor-grid .question-flow-toolbar {
      margin-top: 72px;
    }
    .editor-mobile-toolbar {
      display: block;
      position: absolute;
      top: 24px;
      left: var(--panel-header-inline);
      z-index: 8;
    }
    .editor-grid .question-flow-scroll {
      padding-top: 24px;
    }
    .editor-grid {
      display: flex;
      flex-direction: column;
      gap: 0;
      position: relative;
      overflow: hidden;
    }
    .editor-grid .design-chat,
    .editor-grid .question-flow {
      animation: editor-view-slide 240ms cubic-bezier(0.2, 0, 0, 1);
    }
    .editor-grid .design-chat {
      overflow: hidden;
      display: none;
      padding-top: 80px;
      --editor-slide-from: -100%;
    }
    .editor-grid .question-flow {
      flex: 1;
      min-height: 0;
      padding: 0;
      --editor-slide-from: 100%;
    }
  }
  @keyframes editor-view-slide {
    from {
      transform: translateX(var(--editor-slide-from));
    }
    to {
      transform: translateX(0);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .editor-grid .design-chat,
    .editor-grid .question-flow {
      animation: none;
    }
  }
  @media (max-width: 640px) {
    .notice-toast {
      left: 50%;
      right: auto;
      bottom: max(16px, env(safe-area-inset-bottom));
      translate: -50% 0;
    }
    .notice-toast.is-closing {
      animation-name: notice-leave-mobile;
    }
  }
  @keyframes notice-leave-mobile {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(calc(100% + 32px));
    }
  }
}

@layer responsive {
  @media (max-width: 899px) {
    textarea.chat-textarea[data-autosize='compact'] {
      resize: none;
      min-height: 0;
      line-height: 1.65;
    }
  }
}
