@font-face {
  font-family: "AppUi";
  src: local("Segoe UI"), local("Arial");
}

:root {
  color-scheme: light;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-soft: #f2f2ef;
  --ink: #191917;
  --muted: #74746d;
  --line: #deded8;
  --line-strong: #c9c9c1;
  --accent: #1e1e1b;
  --accent-contrast: #ffffff;
  --danger: #a52d2d;
  --danger-bg: #fff0ef;
  --warning: #735b00;
  --warning-bg: #fff7d7;
  --radius: 22px;
  --shadow: none;
  font-family: "AppUi", "Segoe UI", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 88% 6%, rgba(0,0,0,.035), transparent 26rem), var(--bg);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 28px;
}
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow-hu {
  letter-spacing: .06em;
  text-transform: none;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(34px, 4vw, 56px); line-height: .98; letter-spacing: -.045em; }
.lead { margin: 0; color: var(--muted); font-size: 15px; }
.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #4d4d48;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a8c58;
  box-shadow: 0 0 0 4px rgba(74,140,88,.12);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}
.controls-panel {
  position: sticky;
  top: 18px;
  padding: 23px;
}
.panel-heading, .preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-heading { margin-bottom: 16px; }
.panel-heading.compact { margin-bottom: 13px; }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.step {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #6a6a63;
  font-size: 10px;
  font-weight: 800;
}
.count-pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.field { display: grid; gap: 7px; min-width: 0; }
.field-full { width: 100%; }
.field-label { color: #4d4d48; font-size: 12px; font-weight: 750; }
.field-label small { color: var(--muted); font-size: 10px; font-weight: 600; }
.field-label strong { float: right; color: var(--muted); font-size: 11px; }
.field-help { color: #898982; font-size: 10px; line-height: 1.45; }
kbd {
  padding: 0 5px 1px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 9px;
}
textarea, input[type="number"], input[type="text"], select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fbfbfa;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
textarea { min-height: 132px; padding: 12px 13px; resize: vertical; line-height: 1.5; }
.prefix-input { min-height: 72px; resize: vertical; }
input[type="number"], input[type="text"], select { height: 42px; padding: 0 11px; }
textarea:focus, input[type="number"]:focus, input[type="text"]:focus, select:focus {
  border-color: #8f8f88;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,.055);
}
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-bottom: 12px;
}
.section-divider { height: 1px; margin: 19px 0; background: var(--line); }
.color-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
}
input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfbfa;
}
.color-text { text-transform: lowercase; }
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfbfa;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
.background-grid.transparent-active .toggle-row {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}
.section-help {
  margin: -3px 0 0;
  color: #898982;
  font-size: 10px;
  line-height: 1.45;
}
.compact-setting-row { margin-bottom: 7px; }
.notice {
  margin-bottom: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.notice.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(115,91,0,.18);
}
.notice.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(165,45,45,.16);
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .14s ease, opacity .14s ease;
}
.primary-button:hover:not(:disabled) { transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.button-icon { font-size: 16px; }
.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.preview-panel { padding: 28px; }
.preview-header { margin-bottom: 18px; }
.preview-header h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.format-summary { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.empty-state {
  display: grid;
  place-items: center;
  min-height: 250px;
  margin: 8px;
  padding: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}
.empty-state[hidden] { display: none !important; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
  font-size: 22px;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 12px;
  background-image:
    linear-gradient(45deg, #ecece8 25%, transparent 25%),
    linear-gradient(-45deg, #ecece8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ecece8 75%),
    linear-gradient(-45deg, transparent 75%, #ecece8 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
.canvas-wrap canvas {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  box-shadow: none;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}
.card-title, .card-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-title { margin: 0 0 3px; font-size: 14px; font-weight: 700; }
.card-filename { margin: 0; color: var(--muted); font-size: 12px; }
.card-download {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfa;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.card-download:disabled { opacity: .45; cursor: wait; }
.quality-disabled { opacity: .55; }
footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 4px 0;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .controls-panel { position: static; }
}
@media (max-width: 720px) {
  .shell { width: min(100%, calc(100% - 24px)); padding-top: 20px; }
  .topbar, footer, .preview-header, .panel-heading { flex-direction: column; align-items: flex-start; }
  .grid-two, .preview-grid { grid-template-columns: 1fr; }
  .preview-panel { padding: 18px; }
  .empty-state { margin: 4px; padding: 24px 18px; }
}

.remember-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  user-select: none;
}
.remember-box input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}
.remember-box span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.remember-box strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
}
.remember-box small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
