:root {
  --bg: #1e1e22;
  --panel: #2a2a30;
  --border: #3a3a42;
  --text: #e6e6ea;
  --muted: #9a9aa6;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tools-right {
  margin-left: auto;
}

.filename {
  width: 160px;
  padding: 6px 8px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.filename:disabled {
  opacity: 0.5;
}

.ext {
  color: var(--muted);
  font-size: 14px;
  margin-left: -4px;
}

.btn {
  padding: 6px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: #4a4a54;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn[aria-pressed="true"] {
  background: #4f6bed;
  border-color: #4f6bed;
  color: #fff;
}

.canvas.cursor-text {
  cursor: text;
}

.canvas.cursor-crosshair {
  cursor: crosshair;
}

.text-input {
  position: fixed;
  margin: 0;
  padding: 0;
  border: 1px dashed #4f6bed;
  outline: none;
  background: rgba(255, 255, 255, 0.6);
  color: #000;
  font-family: "Work Sans", sans-serif;
  font-weight: 400;
  line-height: 1;
  white-space: pre;
  z-index: 10;
}

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.canvas {
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.empty-state {
  color: var(--muted);
  font-size: 15px;
  user-select: none;
}

.notice {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 8px 14px;
  font-size: 14px;
  color: #fff;
  background: #333a;
  border: 1px solid var(--border);
  border-radius: 6px;
  backdrop-filter: blur(4px);
  z-index: 20;
}

.notice[hidden] {
  display: none;
}
