/* QR NightNote — shared, dependency-free styles */
:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2ff;
  --text: #172033;
  --muted: #5b6578;
  --line: #dce2ee;
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-soft: #e0e7ff;
  --focus: #f59e0b;
  --success: #087f5b;
  --danger: #c92a2a;
  --shadow: 0 12px 36px rgba(30, 41, 59, .08);
  --radius: 18px;
  --max: 1180px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1220;
  --surface: #151c2c;
  --surface-2: #1d2740;
  --text: #edf2ff;
  --muted: #aab4c7;
  --line: #2d3950;
  --brand: #a5b4fc;
  --brand-dark: #c7d2fe;
  --brand-soft: #283462;
  --success: #63e6be;
  --danger: #ff8787;
  --shadow: 0 12px 36px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button, .button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
img, canvas, svg { max-width: 100%; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--surface); color: var(--text); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.container { width: min(100% - 28px, var(--max)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-row { min-height: 66px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; }
.brand-mark svg { width: 23px; height: 23px; }
.nav-toggle { margin-left: auto; border: 1px solid var(--line); color: var(--text); background: var(--surface); border-radius: 10px; padding: 8px 11px; cursor: pointer; }
.site-nav { display: none; position: absolute; inset: 66px 0 auto; padding: 12px 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.site-nav.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.site-nav a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 9px; font-size: .92rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.language-link { min-width: 40px; padding: 7px 8px; border-radius: 9px; color: var(--text); text-decoration: none; text-align: center; font-size: .85rem; font-weight: 700; }
main { min-height: 65vh; }
.tool-hero { padding: 26px 0 12px; }
.hero-copy { max-width: 800px; margin-bottom: 22px; }
h1 { margin: 0 0 10px; font-size: clamp(1.75rem, 5vw, 2.7rem); line-height: 1.16; letter-spacing: -.035em; }
.hero-copy p { margin: 0; color: var(--muted); font-size: 1.04rem; }
.tool-grid { display: grid; gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-panel { padding: 20px; }
.preview-panel { padding: 20px; position: sticky; top: 84px; }
.panel-title { margin: 0 0 14px; font-size: 1.1rem; }
.field { margin-bottom: 15px; }
.field-row { display: grid; gap: 12px; }
label, .label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 700; }
input:not([type="checkbox"]):not([type="color"]), select, textarea {
  display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); padding: 11px 12px; min-height: 46px;
}
textarea { resize: vertical; min-height: 100px; }
input[type="color"] { width: 100%; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.check-label { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check-label input { width: 18px; height: 18px; accent-color: var(--brand); }
.hint { display: block; margin-top: 5px; color: var(--muted); font-size: .82rem; }
.settings { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.settings summary { cursor: pointer; font-weight: 800; margin-bottom: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.range-value { color: var(--muted); font-weight: 500; }
.qr-stage { min-height: 286px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 14px; background: #eef1f6; padding: 16px; overflow: hidden; }
.qr-stage canvas { display: block; width: min(100%, 320px); height: auto; image-rendering: pixelated; }
.qr-empty { color: #596579; text-align: center; padding: 24px; }
.qr-status { min-height: 26px; margin: 10px 0; color: var(--muted); font-size: .88rem; }
.qr-status.error { color: var(--danger); }
.download-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border: 1px solid transparent; border-radius: 11px; padding: 10px 16px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 750; cursor: pointer; }
.button:hover { background: var(--brand-dark); color: #fff; }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button.secondary:hover { background: var(--surface-2); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.privacy-note { margin: 12px 0 0; color: var(--muted); font-size: .8rem; text-align: center; }
.ad-slot { min-height: 120px; margin: 24px auto; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: .76rem; letter-spacing: .05em; }
.ad-slot::before { content: "ADVERTISEMENT · ADSENSE PLACEHOLDER"; padding: 12px; }
.ads-configured .ad-slot::before { content: "ADVERTISEMENT"; }
.ad-slot:has(ins) { display: block; padding: 10px; }
.ad-slot:has(ins)::before { display: block; }
.ad-slot ins { display: block; min-height: 100px; }
.content-wrap { max-width: 850px; margin: 28px auto 0; }
.content-card { padding: clamp(20px, 4vw, 38px); }
.prose h2 { margin: 1.8em 0 .6em; font-size: 1.45rem; line-height: 1.3; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.5em 0 .45em; font-size: 1.12rem; }
.prose p, .prose li { color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 7px; }
.prose strong { color: var(--text); }
.faq { margin-top: 30px; }
.faq h2 { margin-bottom: 14px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 16px 4px; cursor: pointer; font-weight: 750; }
.faq details p { margin: 0; padding: 0 4px 17px; color: var(--muted); }
.related { padding: 30px 0 12px; }
.related h2 { font-size: 1.3rem; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.related-grid a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-decoration: none; font-weight: 650; }
.related-grid a::after { content: "→"; }
.site-footer { margin-top: 32px; padding: 30px 0; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; gap: 20px; }
.footer-brand p { color: var(--muted); max-width: 450px; margin: 8px 0 0; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 18px; align-content: start; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.copyright { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.cookie-banner { position: fixed; z-index: 50; left: 14px; right: 14px; bottom: 14px; max-width: 680px; margin: auto; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 60px rgba(0, 0, 0, .25); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0 0 12px; color: var(--muted); font-size: .88rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.cookie-actions .button { min-height: 40px; padding: 7px 13px; }
.legal-hero { padding: 38px 0 10px; }
.legal-meta { color: var(--muted); font-size: .88rem; }
.notice { border-left: 4px solid var(--brand); padding: 12px 16px; background: var(--surface-2); border-radius: 0 10px 10px 0; }
@media (min-width: 600px) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .container { width: min(100% - 48px, var(--max)); }
  .nav-toggle { display: none; }
  .site-nav { display: flex; position: static; padding: 0; border: 0; box-shadow: none; background: transparent; flex: 1; justify-content: center; }
  .site-nav a { padding: 8px 7px; font-size: .78rem; }
  .header-row { gap: 8px; }
  .tool-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); gap: 24px; }
  .form-panel, .preview-panel { padding: 26px; }
  .tool-hero { padding-top: 34px; }
}
@media (min-width: 1120px) { .site-nav a { padding: 8px 10px; font-size: .84rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .ad-slot, .cookie-banner, .related, .download-row { display: none !important; } body { background: #fff; color: #000; } .panel { box-shadow: none; } }
