@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --bg-color: #f7f6f2;
  --surface: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: #6b6b6b;
  --gold-primary: #b79045;
  --gold-light: #e8dcc4;
  --border-color: #e5e3dc;
  --danger: #d94b4b;
  --success: #3e885b;
  --shadow-elegant: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  --font-heading: 'Playfair Display', serif;
  --font-ui: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-color);
  padding: 2rem 0 2.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.sidebar-brand-mark {
  width: 32px;
  height: 32px;
  background: var(--text-main);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-style: italic;
  flex-shrink: 0;
}

.sidebar h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-main);
}

.sidebar-tagline {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0.5rem;
}

.sidebar button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 1rem 1.75rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: flex-start;
}

.sidebar button:hover {
  color: var(--text-main);
  background: #faf9f6;
}

.sidebar button.active {
  color: var(--gold-primary);
  font-weight: 600;
  border-left-color: var(--gold-primary);
  background: #faf9f6;
}

.main {
  flex: 1;
  padding: 2.5rem 3rem;
  overflow-y: auto;
  max-width: 1200px;
}

h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-main);
}

h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.sub {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.glass,
.luxury-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: var(--shadow-elegant);
}

.card {
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  box-shadow: 0 14px 32px -12px rgba(183, 144, 69, 0.18);
}

.card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.dropzone {
  border: 2px dashed var(--gold-light);
  border-radius: 4px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  background: #faf9f6;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover {
  border-color: var(--gold-primary);
  background: #fff;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dropzone strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-heading);
  font-weight: 600;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

input[type="number"],
input[type="text"],
input[type="range"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--border-color);
  background: #faf9f6;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--text-main);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--gold-primary);
  color: #fff;
}

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

.btn.secondary {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn.secondary:hover {
  border-color: var(--text-main);
  background: transparent;
}

.preview-img {
  max-height: 280px;
  max-width: 100%;
  border-radius: 2px;
  border: 1px solid var(--border-color);
  object-fit: contain;
  background: #faf9f6;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 2px;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  border-left: 4px solid transparent;
}

.alert.error {
  background: #fef2f2;
  color: var(--danger);
  border-left-color: var(--danger);
}

.alert.ok {
  background: #eaf1ec;
  color: var(--success);
  border-left-color: var(--success);
}

.alert.loading,
.alert.warn {
  background: #fdfaf2;
  color: var(--gold-primary);
  border-left-color: var(--gold-primary);
}

.mt { margin-top: 1rem; }

.file-list {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.tool-hint {
  font-size: 0.82rem;
  color: var(--gold-primary);
  background: #fdfaf2;
  border-left: 3px solid var(--gold-primary);
  padding: 0.65rem 1rem;
  margin: 0 0 1rem;
}

.tool-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background: #faf9f6;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  resize: vertical;
}

.tool-textarea.mono,
pre.tool-textarea {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dash-group h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-count {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #faf9f6;
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.page-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  background: #faf9f6;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.swatch {
  width: 88px;
  height: 64px;
  border-radius: 2px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  padding: 0.35rem;
}

.swatch span {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.1rem 0.25rem;
  font-family: monospace;
}

.dual-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .dual-pane { grid-template-columns: 1fr; }
}

.diff-out {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  background: #faf9f6;
  border: 1px solid var(--border-color);
  padding: 1rem;
  overflow: auto;
  max-height: 400px;
}

.diff-out ins, .diff-add { background: #eaf1ec; text-decoration: none; }
.diff-out del, .diff-del { background: #fef2f2; text-decoration: line-through; }

.regex-test {
  white-space: pre-wrap;
  font-family: var(--font-ui);
  line-height: 1.5;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  background: #fff;
  min-height: 4rem;
}

.regex-test mark {
  background: #e8dcc4;
  color: var(--text-main);
  padding: 0 2px;
}

.markdown-preview {
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  background: #fff;
  min-height: 200px;
  line-height: 1.6;
}

.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 {
  font-family: var(--font-heading);
  margin-top: 1rem;
}

.markdown-preview pre {
  background: #faf9f6;
  padding: 0.75rem;
  overflow: auto;
  font-size: 0.85rem;
}

.markdown-preview code {
  background: #faf9f6;
  padding: 0.1rem 0.35rem;
  font-size: 0.85rem;
}

.qs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.qs-table th, .qs-table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.qs-table th {
  background: #faf9f6;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.uuid-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.uuid-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-family: monospace;
  font-size: 0.82rem;
}

.color-swatch-preview {
  width: 100%;
  height: 48px;
  border-radius: 2px;
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.tool-editor {
  padding: 1.75rem;
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
  }
  .sidebar-brand { padding: 0 1.25rem 1rem; }
  .sidebar button { padding: 0.75rem 1.25rem; }
  .main { padding: 1.5rem; }
  .row { grid-template-columns: 1fr; }
}
