:root {
  color-scheme: light only;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.editor-section {
  display: flex;
  height: 70vh;
}

.panel {
  width: 50%;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.left {
  border-right: 1px solid #ccc;
}

#clear-btn {
  align-self: flex-end;
  margin-bottom: 10px;
  background: none;
  border: 1px solid #ccc;
  font-size: 20px;
  line-height: 1;
  padding: 0 10px;
  cursor: pointer;
  color: #000;
}

#clear-btn:hover {
  background: #f0f0f0;
}

#input {
  width: 100%;
  height: 100%;
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  border: 1px solid #ccc;
  padding: 10px;
  resize: none;
}

#copy-btn {
  margin-bottom: 10px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
}

#copy-btn:hover {
  background: #0056b3;
}

#copy-btn:active {
  background: #004085;
}

#copy-btn.copied {
  background: #28a745;
}

#preview {
  width: 100%;
  height: calc(100% - 40px);
  border: 1px solid #ccc;
}

.error {
  color: red;
  padding: 20px;
  font-family: monospace;
}

.cheatsheet {
  border-top: 2px solid #ccc;
  padding: 20px;
  background: #f9f9f9;
}

.cheatsheet h2 {
  margin-bottom: 16px;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
}

.cheatsheet h2::before {
  content: '\25BC ';
  font-size: 12px;
}

.cheatsheet.collapsed h2::before {
  content: '\25B6 ';
}

.cheatsheet.collapsed .cheatsheet-content {
  display: none;
}

.cheatsheet-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.description-text {
  grid-column: 1 / -1;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.description-text p {
  margin: 0 0 10px;
}

.description-text ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.description-text li {
  margin-bottom: 4px;
}

.cheat-item {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
}

.cheat-item h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
}

.cheat-item code {
  display: block;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  background: #f5f5f5;
  padding: 8px;
  margin-bottom: 8px;
  white-space: pre;
  overflow-x: auto;
}

.cheat-item .result {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  background: #e8f4e8;
  padding: 8px;
  white-space: pre;
  overflow-x: auto;
  border-left: 3px solid #28a745;
}

.status-bar {
  padding: 8px 16px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-bar .size-ok {
  color: #22c55e;
}

.status-bar .size-warn {
  color: #ef4444;
}
