.dev-test-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.dev-test.shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.dev-test-chrome .chrome-meta {
  font-size: 0.8rem;
}

.dev-test-sidebar-col {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.dev-test-sidebar {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.dev-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dev-type-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
}

.dev-type-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(91, 141, 238, 0.1);
}

.dev-list-label {
  margin-top: 0.5rem;
}

.dev-sidebar-top {
  flex-shrink: 0;
}

.dev-question-list {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
}

.dev-question-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1.3;
}

.dev-question-item:hover {
  border-color: var(--accent);
}

.dev-question-item.active {
  border-color: var(--accent);
  background: rgba(91, 141, 238, 0.12);
}

.dev-question-item .qid {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.15rem;
}

.dev-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
  word-break: break-all;
  padding: 0.5rem;
  background: var(--surface2);
  border-radius: 6px;
  max-height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
}

.dev-create-section {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  overflow-y: auto;
  flex-shrink: 0;
  max-height: 45%;
}

.dev-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.dev-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dev-create-form .form-group {
  margin-bottom: 0.6rem;
}

.dev-create-form .form-input {
  font-size: 0.85rem;
  min-height: 36px;
  padding: 0.5rem 0.65rem;
}

.dev-create-text {
  min-height: 72px;
  resize: vertical;
}

.dev-create-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.dev-create-row .form-group {
  margin-bottom: 0;
}

.dev-create-submit {
  width: 100%;
  min-height: 44px;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.dev-create-error {
  color: var(--danger, #ff5252);
  font-size: 0.78rem;
  margin: 0;
}

.dev-test-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.dev-test-canvas {
  flex: 1;
  overflow-y: auto;
}

.dev-test-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.dev-test-actions .btn {
  flex: 1;
  min-width: 0;
}

.dev-debug-panel {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.dev-debug-summary {
  cursor: pointer;
  user-select: none;
}

.dev-debug-pre {
  overflow: auto;
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--success);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
}

.dev-mobile-nav {
  display: none;
}

@media (max-width: 700px) {
  .dev-mobile-nav {
    display: flex;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 0.35rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    gap: 0.35rem;
  }

  .dev-mobile-tab {
    flex: 1;
    min-height: 44px;
    padding: 0.5rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    background: var(--surface2);
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
  }

  .dev-mobile-tab.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(91, 141, 238, 0.12);
  }

  .dev-test-layout {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .dev-test-sidebar-col {
    display: contents;
  }

  .dev-mobile-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .dev-mobile-panel.active {
    display: flex;
    flex-direction: column;
  }

  .dev-mobile-panel[data-panel="add"].active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dev-test-sidebar {
    width: 100%;
    border-right: none;
    padding: 0;
    overflow: hidden;
  }

  .dev-sidebar-top {
    padding: 0.85rem 1rem 0.65rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .dev-sidebar-top .dev-type-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .dev-sidebar-top .dev-type-tabs::-webkit-scrollbar {
    display: none;
  }

  .dev-sidebar-top .dev-type-tab {
    flex-shrink: 0;
  }

  .dev-question-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 1rem;
  }

  .dev-meta {
    max-height: 96px;
    margin: 0 1rem 0.85rem;
    flex-shrink: 0;
  }

  .dev-create-section {
    width: 100%;
    max-height: none;
    border-top: none;
    padding: 0.85rem 1rem 1.25rem;
  }

  .dev-panel-title {
    display: none;
  }

  .dev-create-row {
    grid-template-columns: 1fr;
  }

  .dev-test-main .preview-strip {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .dev-test-main .preview-value {
    flex: 1 1 100%;
    white-space: normal;
    text-align: center;
    font-size: 1rem;
  }

  .dev-test-main .preview-strip .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  .dev-test-main .preview-strip .btn-ghost {
    display: none;
  }

  .dev-test-actions {
    padding: 0.75rem 1rem 1rem;
  }

  .dev-test-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .dev-test-canvas {
    padding: 0.85rem 1rem 1rem;
  }

  .dev-debug-panel:not([open]) .dev-debug-pre {
    display: none;
  }
}

@media (min-width: 701px) {
  .dev-create-section .dev-panel-title {
    display: none;
  }

  .dev-debug-panel .dev-debug-summary {
    pointer-events: none;
  }

  .dev-debug-panel .dev-debug-summary::-webkit-details-marker {
    display: none;
  }
}
