:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
button, input { font: inherit; }
.app {
  width: min(100% - 28px, 620px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(22px, env(safe-area-inset-bottom));
}
.header { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.brand-mark {
  display: grid; place-items: center; width: 100px; height: 48px; flex: 0 0 auto;
  border-radius: 14px; background: mediumpurple; color: #fff; font-weight: 800; letter-spacing: -1px;
  padding: 0px 10px; font-size: 20px;
}
h1 { margin: 0; font-size: clamp(1.35rem, 5vw, 1.7rem); letter-spacing: -.035em; }
.subtitle { margin: 4px 0 0; color: #68738a; font-size: .9rem; }
.field-label { display: block; font-weight: 700; margin-bottom: 8px; }
.input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
#text-input {
  display: block;
  width: 80%;
  min-width: 0;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #d7ddea;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  outline: none;
  box-shadow: 0 1px 2px #16213a08;
}
#text-input:focus { border-color: #4778f5; box-shadow: 0 0 0 3px #4778f51c; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; margin: 8px 2px 18px; color: #778197; font-size: .8rem; }
#status { text-align: right; }
.result {
  background: #fff; border: 1px solid #e1e6ef; border-radius: 18px; padding: 20px;
  box-shadow: 0 8px 28px #17203308;
}
.canvas-wrap { display: grid; place-items: center; max-height: 60vw; position: relative;}
#empty-state { text-align: center; color: #8993a7; }
#empty-state p { margin: 10px 0 0; font-size: .9rem; }
.empty-symbol { font-size: 4rem; line-height: 1; color: #c5ccda; }
#qr-canvas {
  display: none;
  width: 60vw;
  height: 60vw;
  max-width: 60vw;
  max-height: 60vw;
  object-fit: contain;
  image-rendering: pixelated;
}
.qr-info { margin: 12px 0 0; text-align: center; color: #7a8497; font-size: .8rem; }
.actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
button { min-height: 48px; padding: 11px 16px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 700; }
button:focus-visible { outline: 3px solid #4778f5; outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: #245cf4; color: #fff; }
.primary:not(:disabled):active { background: #1748ce; }
.secondary { background: #e9edf5; color: #27334a; }
.paste-btn { flex: 1; min-width: 68px; padding-inline: 12px; }
.privacy-note { margin: 15px 2px 22px; color: #7a8497; font-size: .82rem; line-height: 1.5; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #7a8497; font-size: .8rem; }
.install-btn { min-height: 36px; padding: 7px 12px; background: #e3eaff; color: #204fce; }
@media (min-width: 600px) {
  .app { padding-top: 42px; }
  .result { padding: 28px; }
  .canvas-wrap { min-height: 360px; }
  #qr-canvas { width: min(60vw, 360px); height: min(60vw, 360px); }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s ease, opacity .12s ease; }
}
