@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; }
input[type="range"] { width: 100%; accent-color: var(--blue); }

.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-ghost { background: transparent; color: var(--muted); }
.btn-small { padding: 8px 13px; font-size: 13.5px; border-radius: 10px; }
.btn-danger { color: var(--danger); }

.pick-card {
  width: 100%; padding: 44px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--card); color: var(--blue);
  border: 2px dashed #b9cdf3; border-radius: var(--radius);
  font-size: 17px; font-weight: 600;
}
.pick-card:active { background: #eef4fe; }

.checker {
  background-image: conic-gradient(#e4eaf3 25%, #ffffff 0 50%, #e4eaf3 0 75%, #ffffff 0);
  background-size: 22px 22px;
}

.pad-wrap {
  position: relative;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(15, 37, 71, 0.13);
}
#pad { display: block; width: 100%; height: 280px; touch-action: none; }
.pad-line {
  position: absolute; left: 7%; right: 7%; bottom: 52px;
  border-top: 1.5px dashed rgba(15, 37, 71, 0.28);
  pointer-events: none;
}
.pad-x {
  position: absolute; left: 8%; bottom: 60px;
  font-size: 17px; color: rgba(15, 37, 71, 0.35);
  pointer-events: none; font-weight: 600;
}
.pad-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--muted); font-weight: 500;
  pointer-events: none; padding-bottom: 30px;
}

.stage-crop {
  position: relative;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(15, 37, 71, 0.13);
  background: #dfe7f2;
}
#crop-canvas { display: block; width: 100%; height: auto; touch-action: none; }

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

.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); }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 1.5px solid rgba(15, 37, 71, 0.18); }
.dot-black { background: #17202b; }
.dot-inkblue { background: #1d4ed8; }
.dot-navy { background: #1e3a8a; }


.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.slider-row label { width: 92px; font-size: 14px; font-weight: 600; color: var(--ink); flex-shrink: 0; }

.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; }

.busy {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.82);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid #c9d9f6; border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.busy-label { font-size: 14.5px; font-weight: 600; color: var(--ink); }

.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;
}
