:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #f3f4f6;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  padding: 16px 20px;
  border-bottom: 1px solid #dbe1ea;
  background: #ffffff;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
}

.app-header p {
  margin: 4px 0 0;
  color: #334155;
  font-size: 14px;
}

.shortcut-hints {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-pill {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  padding: 14px;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dbe1ea;
  border-radius: 10px;
  overflow: hidden;
  min-height: 0;
}

.panel-head {
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e7ebf1;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

.toolbar,
.preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #e7ebf1;
  background: #f8fafc;
  flex-shrink: 0;
}

.toolbar button,
.preview-controls button,
.toolbar input,
.toolbar select {
  border: 1px solid #c9d3e2;
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}

.toolbar button,
.preview-controls button {
  cursor: pointer;
}

.toolbar input {
  min-width: 150px;
}

.toolbar select {
  min-width: 180px;
}

.toolbar button:hover,
.preview-controls button:hover {
  background: #f1f5f9;
}

.spacer {
  flex: 1;
}

.editor-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0;
  background: #fff;
  flex-shrink: 0;
}

.tab {
  border: 1px solid #d4dbe5;
  border-bottom: none;
  background: #eef2f7;
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.tab.is-active {
  background: #ffffff;
  font-weight: 600;
}

.editor-wrap {
  flex: 1;
  min-height: 0;
  border-top: 1px solid #d4dbe5;
}

.editor-pane {
  height: 100%;
  display: none;
}

.editor-pane.is-active {
  display: block;
}

.editor {
  width: 100%;
  height: 100%;
}

.status-row {
  padding: 8px 10px;
  border-bottom: 1px solid #e7ebf1;
  font-size: 13px;
  color: #334155;
  flex-shrink: 0;
}

.preview-wrap {
  flex: 1;
  min-height: 0;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f8fafc;
}

@media (max-width: 1200px) {
  body {
    overflow: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .left-panel,
  .right-panel {
    min-height: 520px;
  }
}
