:root {
  --taupe: #615A50; --teal: #7CBDB3; --teal-d: #2F6A60;
  --gold: #E1B911; --gold-d: #8A6F0C; --ink: #211E19; --paper: #FAF8F2;
  --line: #e4e0d6; --muted: #8a8479; --bg: #f3f1ea;
  --radius: 12px; --font: 'Barlow', system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; }

.app__header { display: flex; align-items: center; gap: 14px; padding: 18px 24px; background: var(--taupe); color: #fff; }
.app__header h1 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: .04em; text-transform: uppercase; }
.app__header .tag { font-size: 13px; opacity: .8; margin-left: auto; }
.brandmark { width: 40px; height: 40px; flex: none; background: #fff; border-radius: 8px; padding: 5px; }

.layout { display: grid; grid-template-columns: 360px 1fr; gap: 0; min-height: calc(100vh - 70px); }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

.panel { padding: 22px 24px; }
.panel--controls { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.panel--preview { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 18px; padding-top: 36px; }

.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--taupe); }
.input, .select {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.input:focus, .select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }

.toggle { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--teal-d); }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--teal-d); }
.range-row output { font-size: 13px; color: var(--muted); min-width: 34px; text-align: right; }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; border-top: 1px solid var(--line); padding-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--taupe); border-radius: 8px; background: var(--taupe); color: #fff;
  cursor: pointer; transition: transform .05s ease, background .15s ease;
}
.btn:hover { background: #4f483f; } .btn:active { transform: scale(.98); }
.btn--ghost { background: #fff; color: var(--taupe); }
.btn--ghost:hover { background: #f6f4ee; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.preview-stage { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 460px; display: flex; align-items: center; justify-content: center; }
.preview-stage svg { width: 100%; height: auto; display: block; }

.meta { width: 100%; max-width: 460px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.status { font-size: 13px; padding: 8px 12px; border-radius: 8px; background: #eef6f3; color: var(--teal-d); }
.status--err { background: #fbecec; color: #a3382f; }
.status--warn { background: #fdf5e3; color: var(--gold-d); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 20px; background: var(--bg); color: var(--taupe); font-size: 12px; margin-right: 6px; }

.preset-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.toast--show { opacity: 1; }

.preview-stage { background-color: #fff; background-image: linear-gradient(45deg, #00000012 25%, transparent 25%, transparent 75%, #00000012 75%), linear-gradient(45deg, #00000012 25%, transparent 25%, transparent 75%, #00000012 75%); background-size: 24px 24px; background-position: 0 0, 12px 12px; }
.history { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.history__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; background: #fff; }
.history__item:hover { background: #f6f4ee; }
.history__url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 6px; }
.history__del:hover { color: #a3382f; background: #fbecec; }
.history__empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }
