* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  background: #fff;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 30px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 400;
  color: #333;
}

.view-toggle {
  display: flex;
  gap: 10px;
}

.view-toggle button {
  padding: 4px 12px;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 13px;
}

.view-toggle button:hover {
  background: #f5f5f5;
}

.view-toggle button.selected {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

/* Cheatsheet Layout */
.cheatsheet {
  display: flex;
  gap: 30px;
}

.sidebar {
  width: 140px;
  flex-shrink: 0;
}

.category-list {
  list-style: none;
}

.category-list li {
  margin-bottom: 2px;
}

.category-list a {
  display: block;
  padding: 3px 8px;
  color: #666;
  font-size: 13px;
}

.category-list a:hover {
  color: #0066cc;
  text-decoration: none;
}

.category-list li.selected a {
  background: #f0f0f0;
  color: #333;
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
}

.search-box {
  margin-bottom: 20px;
}

.search-box input {
  width: 200px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: #0066cc;
}

/* Categories */
.categories {
  column-count: 3;
  column-gap: 30px;
}

.category {
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 25px;
}

.category-name {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 8px;
  color: #333;
}

/* Item table */
.category-items {
  border: 1px solid #ddd;
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  display: inline-block;
  width: 100%;
}

.item-row {
  display: flex;
  border-bottom: 1px solid #eee;
}

.item-row:last-child {
  border-bottom: none;
}

.item-label {
  width: 90px;
  flex-shrink: 0;
  padding: 4px 8px;
  background: #f8f8f8;
  border-right: 1px solid #eee;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
}

.item-content {
  flex: 1;
  padding: 4px 8px;
  font-family: monospace;
  font-size: 13px;
}

.item-name {
  color: #0066cc;
  cursor: help;
}

.item-name:hover {
  text-decoration: underline;
}

.item-symbol {
  color: #0066cc;
  cursor: help;
}

/* Tooltip */
.tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 10px 12px;
  max-width: 400px;
  z-index: 1000;
  font-size: 13px;
}

.tooltip-sig {
  font-family: monospace;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.tooltip-desc {
  margin-bottom: 6px;
}

.tooltip-args {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.tooltip-arg {
  margin-right: 10px;
}

.tooltip-example {
  font-family: monospace;
  font-size: 12px;
  background: #f5f5f5;
  padding: 6px 8px;
  margin: 0;
}

/* Companion View */
.companion {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.companion-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.prompt-display {
  text-align: center;
}

.prompt-empty {
  font-size: 18px;
  color: #999;
}

.prompt-name {
  font-size: 48px;
  font-family: monospace;
  color: #0066cc;
  margin-bottom: 10px;
}

.prompt-signature {
  font-family: monospace;
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.prompt-description {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
  max-width: 600px;
}

.prompt-args {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.companion-arg {
  margin: 0 8px;
}

.companion-arg strong {
  color: #0066cc;
}

.prompt-example {
  display: inline-block;
  font-family: monospace;
  font-size: 14px;
  background: #f5f5f5;
  padding: 10px 15px;
  border: 1px solid #ddd;
}

/* Companion Controls */
.companion-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding-top: 30px;
  border-top: 1px solid #ddd;
  width: 100%;
  max-width: 600px;
}

.playback-controls {
  display: flex;
  gap: 10px;
}

.play-btn, .next-btn {
  padding: 8px 20px;
  font-size: 14px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

.play-btn {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

.play-btn:hover {
  background: #0055aa;
}

.next-btn:hover {
  background: #f5f5f5;
}

.interval-controls {
  display: flex;
  gap: 5px;
}

.interval-btn {
  padding: 4px 10px;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 13px;
}

.interval-btn:hover {
  background: #f5f5f5;
}

.interval-btn.selected {
  background: #e0e0e0;
  color: #333;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.filter-label {
  color: #666;
  font-size: 13px;
  margin-right: 5px;
}

.filter-btn {
  padding: 2px 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 12px;
}

.filter-btn:hover {
  background: #f5f5f5;
}

.filter-btn.selected {
  background: #e0e0e0;
  color: #333;
}

/* Responsive */
@media (max-width: 1000px) {
  .categories {
    column-count: 2;
  }
}

@media (max-width: 700px) {
  .categories {
    column-count: 1;
  }

  .cheatsheet {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
}
