:root {
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --code-bg: #f6f8fa;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #60a5fa;
  --code-bg: #1e293b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--muted);
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.brand a:hover {
  color: var(--accent);
}

.actions a {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.actions a:hover {
  text-decoration: underline;
}

.actions button {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  cursor: pointer;
}

.actions button:hover {
  background: var(--border);
}

.editor-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.05);
}

.dropzone p {
  margin: 0;
  font-size: 0.9rem;
}

#content {
  width: 100%;
  min-height: 280px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
}

#content:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
}

.primary {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.primary:hover {
  filter: brightness(1.1);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.app-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.app-footer .footer-credit {
  color: inherit;
  text-decoration: none;
}

.app-footer .footer-credit:hover {
  text-decoration: underline;
}
