.app-root {
  container-type: inline-size;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 22px;
  color: var(--text, #f2f4fa);
  font: inherit;
  font-size: 13px;
}
.app-root *,
.app-root *::before,
.app-root *::after {
  box-sizing: border-box;
}
.app-root h2,
.app-root h3,
.app-root p {
  margin: 0;
}
.app-heading {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.app-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex-shrink: 0;
}
.app-toolbar .app-heading,
.app-toolbar h3 {
  flex: 1;
  min-width: 130px;
}
.app-button {
  appearance: none;
  border: 1px solid var(--border, #424653);
  border-radius: 8px;
  background: var(--surface, #20232d);
  color: var(--text, #f2f4fa);
  font: inherit;
  font-weight: 500;
  padding: 9px 12px;
  min-height: 38px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.app-button:hover {
  border-color: var(--accent, #c3aeff);
  background: color-mix(
    in srgb,
    var(--accent, #c3aeff) 10%,
    var(--surface, #20232d)
  );
}
.app-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.app-root :is(button, input, textarea, select, a):focus-visible {
  outline: 2px solid var(--accent, #c3aeff);
  outline-offset: 3px;
}
.app-primary {
  background: var(--accent, #c3aeff);
  color: #161321;
  border-color: transparent;
}
.app-danger {
  color: var(--text, #f2f4fa);
  border-style: dashed;
  align-self: flex-start;
}
.app-input {
  min-width: 0;
  width: 100%;
  background: color-mix(in srgb, var(--surface, #20232d) 85%, transparent);
  color: var(--text, #f2f4fa);
  border: 1px solid var(--border, #424653);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  line-height: 1.5;
}
.app-input::placeholder {
  color: var(--muted, #b6b9c5);
  opacity: 1;
}
.app-toolbar > .app-input {
  flex: 1;
  width: auto;
  min-width: 140px;
}
.app-status {
  min-height: 20px;
  flex-shrink: 0;
  color: var(--muted, #b6b9c5);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.app-description {
  color: var(--muted, #b6b9c5);
  max-width: 60ch;
  line-height: 1.7;
}
.app-empty {
  color: var(--muted, #b6b9c5);
  padding: 22px 10px;
  line-height: 1.7;
}
.app-editor {
  flex: 1;
  min-height: 140px;
  resize: none;
  line-height: 1.8;
  font-size: 14px;
  tab-size: 2;
}
.app-notes-editor {
  background: transparent;
  border: 0;
  padding: 10px 2px;
  font-size: 16px;
}
.app-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  color: var(--muted, #b6b9c5);
}
.app-breadcrumbs .app-button {
  border-color: transparent;
  background: transparent;
  padding: 5px;
}
.app-file-split {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(220px, 1.3fr);
  gap: 18px;
  flex: 1;
  min-height: 200px;
}
.app-file-list {
  overflow: auto;
  min-width: 0;
  border-right: 1px solid var(--border, #424653);
  padding-right: 12px;
}
.app-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #424653);
}
.app-file-type {
  font-size: 10px;
  color: var(--muted, #b6b9c5);
  width: 32px;
}
.app-file-open {
  flex: 1;
  min-width: 80px;
  text-align: left;
  background: transparent;
  border-color: transparent;
}
.app-file-row > .app-button:not(.app-file-open) {
  padding: 5px 8px;
  min-height: 30px;
  font-size: 10px;
}
.app-selected {
  border-color: var(--accent, #c3aeff);
}
.app-file-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}
.app-file-editor h3 {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.app-calc {
  width: min(100%, 360px);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-calc-result {
  text-align: right;
  font-size: 42px;
  letter-spacing: -0.05em;
  line-height: 1.3;
  padding: 14px 0;
  overflow-wrap: anywhere;
}
.app-calc-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.app-calc-keys .app-button {
  min-height: 48px;
  font-size: 17px;
}
.app-browser-home {
  padding: 32px 4px;
  white-space: pre-line;
  line-height: 1.8;
  max-width: 62ch;
  font-size: 15px;
}
.app-bookmarks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
}
.app-bookmarks .app-toolbar > .app-button:first-child {
  flex: 1;
  text-align: left;
  word-break: break-word;
}
.app-terminal {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  gap: 8px;
}
.app-terminal-output {
  flex: 1;
  min-height: 160px;
  overflow: auto;
  padding: 2px;
}
.app-terminal-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
  margin: 0 0 12px;
}
.app-terminal-prompt {
  color: var(--accent, #c3aeff);
}
.app-terminal .app-input {
  border: 0;
  background: transparent;
  padding: 10px 4px;
}
.app-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--border, #424653);
  padding: 15px 0;
}
.app-setting-row select {
  width: 180px;
}
.app-setting-row input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: var(--accent, #c3aeff);
}
.app-metrics {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr);
  margin: 0;
}
.app-metrics dt,
.app-metrics dd {
  margin: 0;
  padding: 14px 4px;
  line-height: 1.6;
  border-bottom: 1px solid var(--border, #424653);
  overflow-wrap: anywhere;
}
.app-metrics dt {
  color: var(--muted, #b6b9c5);
  padding-right: 18px;
}
.app-chat-transcript {
  flex: 1;
  min-height: 130px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 3px;
}
.app-chat-message {
  max-width: 92%;
  padding: 15px 17px;
  border-radius: 12px;
  background: var(--surface, #20232d);
  border: 1px solid var(--border, #424653);
}
.app-chat-user {
  align-self: flex-end;
  background: color-mix(
    in srgb,
    var(--accent, #c3aeff) 9%,
    var(--surface, #20232d)
  );
}
.app-chat-role {
  display: block;
  font-size: 11px;
  color: var(--muted, #b6b9c5);
  margin-bottom: 7px;
}
.app-chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.app-chat-composer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.app-chat-composer textarea {
  min-height: 70px;
  max-height: 140px;
  resize: vertical;
}
.app-chat-composer .app-toolbar {
  justify-content: flex-end;
}
@container (max-width: 560px) {
  .app-file-split {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    min-height: 350px;
  }
  .app-file-list {
    border-right: 0;
    border-bottom: 1px solid var(--border, #424653);
    max-height: 180px;
    flex-shrink: 0;
    padding-right: 0;
  }
  .app-file-editor {
    min-height: 200px;
    flex: 1;
  }
  .app-file-row > .app-button:not(.app-file-open) {
    min-height: 44px;
  }
  .app-chat-message {
    max-width: 100%;
  }
}
@media (max-width: 600px) {
  .app-root {
    padding: 14px;
    gap: 12px;
  }
  .app-button {
    min-height: 44px;
  }
  .app-file-split {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    min-height: 350px;
  }
  .app-file-list {
    border-right: 0;
    border-bottom: 1px solid var(--border, #424653);
    max-height: 180px;
    flex-shrink: 0;
    padding-right: 0;
  }
  .app-file-editor {
    min-height: 200px;
    flex: 1;
  }
  .app-file-row > .app-button:not(.app-file-open) {
    min-height: 44px;
  }
  .app-metrics {
    grid-template-columns: minmax(95px, 1fr) minmax(100px, 1fr);
  }
  .app-chat-message {
    max-width: 100%;
  }
}
