@font-face {
  font-family: "BalooWord";
  src: url("vendor/fonts/baloo2-word.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #0f2547;
  --muted: #8494ab;
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #dbe4f0;
  --danger: #dc2626;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-icon { width: 44px; height: 44px; border-radius: 11px; }
.wordmark {
  font-family: "BalooWord", -apple-system, sans-serif;
  font-size: 26px; font-weight: 700; line-height: 1; color: var(--ink);
  letter-spacing: 0.2px;
}
.wordmark-ku { color: var(--blue); }
.tagline { font-size: 9.5px; letter-spacing: 0.5px; color: var(--muted); margin-top: 3px; font-weight: 600; line-height: 1.28; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle { display: flex; background: #e8eef7; border-radius: 999px; padding: 2px; }
.lang-btn { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lang-btn.lang-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 37, 71, 0.18); }
.version-badge { font-size: 12px; font-weight: 600; color: var(--blue); background: #e3ecfd; padding: 5px 10px; border-radius: 999px; }

.container { max-width: 560px; margin: 0 auto; padding: 18px 16px 28px; }

.btn {
  border: 0; border-radius: 14px; padding: 13px 18px;
  font-size: 15.5px; font-weight: 600; text-align: center;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-dark); }
.btn-primary:disabled { background: #b9cdf3; cursor: default; }
.btn-secondary { background: #e8eef7; color: var(--ink); }
.btn-small { padding: 8px 13px; font-size: 13.5px; border-radius: 10px; }
.btn-danger { color: var(--danger); }

.group-label { font-size: 13px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); margin: 16px 2px 8px; text-transform: uppercase; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-size: 14.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip-active { border-color: var(--blue); background: #e3ecfd; color: var(--blue-dark); }

.field { display: block; margin-top: 10px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.txt {
  width: 100%; font: inherit; font-size: 15.5px; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; outline: none;
}
.txt:focus { border-color: var(--blue); }
textarea.txt { resize: vertical; min-height: 44px; }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 14.5px; font-weight: 500; }
.check-row input { width: 19px; height: 19px; accent-color: var(--blue); }

.preview-wrap {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(15, 37, 71, 0.13);
  background: #fff;
}
.preview-wrap canvas { display: block; width: 100%; height: auto; }

.color-row { display: flex; gap: 10px; }
.color-field {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 8px 8px 8px 13px; font-size: 14px; font-weight: 600;
}
.color-field input[type="color"] {
  width: 46px; height: 34px; border: 0; border-radius: 8px; background: none; padding: 0; cursor: pointer;
}

.tool-row { display: flex; gap: 8px; margin-top: 12px; }
.tool-row .btn { flex: 1; }

.action-col { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }

.dev-footer { margin-top: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dev-by { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.dev-credit { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 700; text-decoration: none; }
.dev-credit svg { color: var(--blue); flex: none; }
.about-toggle { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); cursor: pointer; }
.about-p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.65; color: var(--muted); text-align: left; }

.dialog {
  border: 0; border-radius: 20px; padding: 22px;
  width: min(92vw, 340px); margin: auto;
  background: var(--card); color: var(--ink);
}
.dialog::backdrop { background: rgba(10, 22, 40, 0.5); }
.dialog-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 70; max-width: 88vw;
  background: #10233f; color: #fff;
  font-size: 14px; font-weight: 500;
  padding: 11px 16px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.35);
  text-align: center;
}
