:root {
  --blue: #F02327;
  --navy: #262424;
  --ice: #f6f3f3;
  --text: #262424;
  --muted: #5f5757;
  --line: #e5d6d6;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ice);
  color: var(--text);
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2 { font-family: 'Inter', sans-serif; font-weight: 800; line-height: 1.2; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0; }

.topbar {
  background: var(--blue);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-logo { height: 40px; width: auto; display: block; }
.lang-switch { display: flex; gap: 4px; background: rgba(255,255,255,.15); padding: 4px; border-radius: 999px; }
.lang-switch button {
  border: 0; background: transparent; color: #fff; font: 700 14px 'Lato', sans-serif;
  min-width: 44px; min-height: 36px; border-radius: 999px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--blue); }

.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.intro { color: var(--muted); margin: 0 0 24px; }
.field { margin-bottom: 20px; }
.field > label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="url"], textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
input[type="text"]:focus, input[type="url"]:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
input[type="file"] { font: inherit; width: 100%; padding: 10px; background: #fff; border: 1.5px dashed var(--line); border-radius: 10px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 14px; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.error { font-size: 14px; color: #a32020; margin: 6px 0 0; font-weight: 700; }
.note { font-size: 14px; margin: 6px 0 0; }
.note:empty { display: none; }
.note.warn { color: #8a5a00; font-weight: 700; }
.note.error { color: #a32020; font-weight: 700; }
.hint a, .contest a { color: var(--blue); font-weight: 700; }
.hint a:hover, .contest a:hover { color: var(--navy); }
.contest {
  margin: 10px 0 0; padding: 12px 14px; border-radius: 10px;
  background: #fff; border: 1.5px solid var(--blue); color: var(--navy); font-size: 14px;
}

.post { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.post h2 { margin-bottom: 10px; }
.post textarea { resize: vertical; font-size: 14px; margin-bottom: 10px; }

.btn {
  font: 700 15px 'Lato', sans-serif;
  background: var(--blue); color: #fff;
  border: 0; border-radius: 999px;
  min-height: 44px; padding: 0 22px; cursor: pointer;
}
.btn:hover { background: var(--navy); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-secondary { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-secondary:hover { background: var(--ice); color: var(--navy); }

.preview-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; align-items: start; }
.card { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 2px rgba(38,36,36,.08); }
.card-title { font-weight: 700; margin: 0 0 2px; }
.card-sub { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.card .frame { position: relative; overflow: hidden; border-radius: 6px; background: var(--navy); }
.card .frame > .scaler { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.card .btn { width: 100%; margin-top: 12px; }
.card.wide { grid-column: 1 / -1; }
.status { color: var(--muted); font-size: 14px; min-height: 1.5em; }

#stage { position: fixed; left: -100000px; top: 0; pointer-events: none; }
