.na-app {
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  margin: 0 auto;
}
.na-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.na-heading-title,
.na-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.na-heading-title img {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
}
.na-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.na-heading-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.na-context-note {
  max-width: 72ch;
  margin: 9px 0 22px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}
.na-context {
  display: grid;
  gap: 12px;
  margin: 0 0 13px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.na-context-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.na-context-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.na-context-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.na-context-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.na-context-fields > label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.na-context .nc-field {
  display: grid;
  width: 100%;
  min-width: 0;
}
.na-context .nc-control {
  width: 100%;
  min-width: 0;
  justify-content: space-between;
}
.na-messages {
  position: relative;
  max-height: min(62dvh, 760px);
  min-height: 290px;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 24px clamp(10px, 3vw, 32px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
#na-message-list {
  min-width: 0;
}
.na-welcome {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 8px;
  text-align: center;
}
.na-welcome .nc-empty {
  padding: 8px 12px 12px;
}
.na-welcome .nc-empty-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
}
.na-welcome .nc-empty h2 {
  font-size: 20px;
  letter-spacing: -0.025em;
}
.na-welcome .nc-empty p {
  max-width: 52ch;
  line-height: 1.6;
}
.na-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 22px auto 0;
  text-align: left;
}
.na-suggestions > p {
  grid-column: 1 / -1;
  margin: 0 0 1px;
  color: var(--text-muted);
  font-size: 12px;
}
.na-suggestion {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.na-suggestion:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.na-turn {
  max-width: 860px;
  min-width: 0;
  margin: 0 auto 26px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--border);
}
.na-turn:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}
.na-user {
  display: grid;
  justify-items: end;
  min-width: 0;
  gap: 5px;
}
.na-user .na-speaker {
  text-align: right;
}
.na-user-text {
  max-width: min(86%, 72ch);
  padding: 8px 13px 8px 0;
  border-right: 2px solid var(--accent);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  text-align: right;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.na-speaker {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.na-assistant {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  margin-top: 20px;
}
.na-assistant > img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.na-response {
  min-width: 0;
  max-width: 78ch;
  padding: 1px 0 0 14px;
  border-left: 1px solid var(--border);
  color: var(--text);
  line-height: 1.65;
}
.na-assistant-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
  margin: 0 0 6px;
}
.na-assistant-heading .na-speaker {
  color: var(--text);
}
.na-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.na-state-mark,
.na-tool-state {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--text-muted);
}
.na-status-active .na-state-mark {
  background: var(--accent);
}
.na-status-waiting .na-state-mark {
  background: var(--yellow);
}
.na-status-done .na-state-mark {
  background: var(--green);
}
.na-status-error .na-state-mark,
.na-status-cancelled .na-state-mark {
  background: var(--red);
}
.na-thinking,
.na-activities {
  margin: 10px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.na-thinking summary,
.na-activities summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 36px;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.na-thinking summary:hover,
.na-activities summary:hover,
.na-tool summary:hover {
  color: var(--text);
}
.na-thinking > div {
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--border-strong);
}
.na-thinking .markdown {
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.na-activities > summary {
  width: fit-content;
}
.na-tool-list {
  display: grid;
  gap: 1px;
  margin: 3px 0 4px 1px;
  border-left: 1px solid var(--border-strong);
  padding-left: 12px;
}
.na-tool {
  min-width: 0;
}
.na-tool > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  padding: 5px 0;
  cursor: pointer;
}
.na-tool-state {
  width: 6px;
  height: 6px;
}
.na-tool-running {
  background: var(--accent);
}
.na-tool-completed {
  background: var(--green);
}
.na-tool-error {
  background: var(--red);
}
.na-tool-name {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.na-tool-status {
  color: var(--text-muted);
  font-size: 12px;
}
.na-tool-detail {
  min-width: 0;
  padding: 0 0 8px 14px;
}
.na-tool-detail pre,
.na-answer pre,
.code-block pre {
  max-width: 100%;
  margin: 8px 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  padding: 12px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}
.na-tool-detail code {
  overflow-wrap: anywhere;
}
.na-answer {
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.na-answer > :first-child {
  margin-top: 7px;
}
.na-answer > :last-child {
  margin-bottom: 0;
}
.na-answer code {
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
.na-answer :not(pre) > code {
  border-radius: 4px;
  background: var(--surface-3);
  padding: 1px 4px;
}
.na-answer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.na-answer table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  overflow: auto;
  border-collapse: collapse;
  font-size: 13px;
}
.na-answer th,
.na-answer td {
  min-width: 100px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  text-align: left;
  vertical-align: top;
}
.na-answer th {
  background: var(--surface-2);
  color: var(--text);
}
.code-block {
  max-width: 100%;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
}
.code-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 5px 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
}
.code-block header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.code-block button {
  min-height: 32px;
  flex: none;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
}
.code-block button:hover {
  background: var(--surface-3);
  color: var(--text);
}
.code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.code-keyword {
  color: var(--accent);
}
.code-string {
  color: var(--status-done);
}
.code-number {
  color: var(--status-review);
}
.code-comment {
  color: var(--text-muted);
  font-style: italic;
}
.na-response-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}
.na-response-actions .nw-chip,
.na-retry {
  min-height: 34px;
  font-size: 12px;
}
.na-error {
  margin: 10px 0;
  border-left: 2px solid var(--red);
  padding: 6px 10px;
  color: var(--red);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.na-retry {
  margin-top: 4px;
}
.na-bottom {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 208px;
  box-shadow: var(--shadow);
}
#na-form {
  position: relative;
  min-width: 0;
  margin: 10px 0 0;
}
#na-form #na-prompt {
  display: block;
  width: 100%;
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}
.na-source {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.na-source textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
}
.na-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 9px 0 0;
}
.na-composer-actions .na-save {
  margin-right: auto;
  border-color: transparent;
  color: var(--text-muted);
}
.na-composer-actions .na-save:hover {
  border-color: var(--border);
  color: var(--text);
}
.na-keyboard-hint {
  margin-right: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.na-composer-actions .button {
  min-height: var(--control-height);
  padding-inline: 16px;
  font-size: 13px;
}
.na-composer-actions .na-stop {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border-strong));
  color: var(--red);
}
.na-slash {
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.na-slash button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}
.na-slash button:hover,
.na-slash [aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.na-queue {
  margin: 10px 0 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.na-queue-heading {
  margin: 0;
  padding: 8px 0 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.na-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.na-queue-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.na-queue-item button {
  min-height: 34px;
  flex: none;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
}
.na-queue-item button:hover {
  background: var(--surface-3);
  color: var(--text);
}
.na-footer {
  max-width: 80ch;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.na-proposal {
  min-width: 0;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-strong);
}
.na-proposal h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}
.na-proposal > p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.na-proposal fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 14px 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px;
}
.na-proposal legend {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.na-proposal label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.na-proposal .nc-field {
  display: grid;
  width: 100%;
  min-width: 0;
}
.na-proposal .nc-control {
  width: 100%;
  min-width: 0;
}
.na-proposal-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.na-proposal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.na-proposal-buttons button {
  min-height: var(--control-height);
}
.na-proposal fieldset:disabled {
  opacity: 0.68;
}
.na-proposal > .button {
  min-height: var(--control-height);
  margin-top: 2px;
}
.na-app :where(button, textarea, select, [tabindex="0"]):focus-visible,
.na-app details > summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
[hidden] {
  display: none !important;
}
@media (max-width: 960px) {
  .na-context-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .na-heading h1 {
    font-size: 20px;
  }
  .na-heading,
  .na-heading-actions {
    gap: 8px;
  }
  .na-heading-actions .nw-chip {
    min-height: 40px;
  }
  .na-context {
    padding: 12px;
  }
  .na-messages {
    max-height: 54dvh;
    min-height: 230px;
    padding: 18px 10px;
  }
  .na-turn {
    margin-bottom: 20px;
    padding-bottom: 18px;
  }
  .na-assistant {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    margin-top: 16px;
  }
  .na-assistant > img {
    width: 24px;
    height: 24px;
  }
  .na-response {
    padding-left: 10px;
  }
  .na-user-text {
    max-width: 95%;
  }
  .na-suggestions {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-top: 16px;
  }
  .na-suggestion {
    min-height: 44px;
  }
  .na-proposal-meta {
    grid-template-columns: minmax(0, 1fr);
  }
  .na-proposal fieldset {
    padding: 11px;
  }
  .na-keyboard-hint {
    display: none;
  }
  .na-composer-actions {
    justify-content: flex-end;
  }
  .na-composer-actions button {
    min-height: 44px;
  }
  .na-composer-actions .na-save {
    margin-right: auto;
  }
  .na-bottom {
    right: 12px;
    bottom: 196px;
  }
}
@media (max-width: 480px) {
  .na-heading-title {
    gap: 8px;
  }
  .na-heading-title img {
    width: 26px;
    height: 26px;
  }
  .na-heading h1 {
    font-size: 20px;
  }
  .na-heading-actions {
    gap: 6px;
  }
  .na-heading-actions .nw-chip {
    padding-inline: 9px;
    font-size: 12px;
  }
  .na-context-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .na-context-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .na-context .nc-control {
    min-height: 44px;
  }
  .na-welcome {
    padding: 20px 0;
  }
  .na-welcome .nc-empty h2 {
    font-size: 20px;
  }
  .na-user-text {
    max-width: 100%;
  }
  .na-composer-actions {
    gap: 7px;
  }
  .na-composer-actions .button {
    padding-inline: 12px;
  }
  .na-composer-actions .na-save {
    padding-inline: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .na-app *,
  .na-app *::before,
  .na-app *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
:root[data-reduce-motion="true"] .na-app *,
:root[data-reduce-motion="true"] .na-app *::before,
:root[data-reduce-motion="true"] .na-app *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
