@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #27342e;
  background: #f6f7f2;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #78985c; outline-offset: 4px; }
main {
  width: 100%;
  max-width: 680px;
  margin: auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.generator { min-width: 0; background: #fff; border: 1px solid #e1e5d9; border-radius: 18px; box-shadow: 0 12px 40px #33412b06; overflow: hidden; }
.result-panel { background: #eef2e6; padding: 20px 18px; }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: #68735e; }
.badge { font-size: 12px; background: #e0e8d3; padding: 5px 9px; border-radius: 5px; color: #536c3c; font-weight: 600; }
.password-row { display: flex; align-items: flex-start; gap: 10px; min-height: 90px; padding-block: 18px; }
#password { display: block; flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(20px, 4.5vw, 26px); letter-spacing: .5px; overflow-wrap: anywhere; line-height: 1.6; user-select: all; -webkit-user-select: all; }
.copy { background: #ffffffa6; border: 1px solid #dce2d3; border-radius: 9px; flex: 0 0 44px; width: 44px; height: 44px; color: #5f6d54; display: grid; place-items: center; }
.copy svg { width: 20px; height: 20px; }
.strength-bars { display: flex; gap: 5px; }
.strength-bars i { height: 3px; border-radius: 5px; flex: 1; background: #8ba66b; }
.result-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 12px; line-height: 1.5; color: #68735e; margin-top: 11px; min-height: 18px; }
#copy-status { color: #4f6a36; overflow-wrap: anywhere; }
.settings { padding: 24px 18px; }
.length-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 15px; font-weight: 600; }
.length-heading output { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.length-heading div { white-space: nowrap; }
.length-heading div span { font-size: 13px; font-weight: 400; color: #727969; }
/* Keep the rounded track separate from the full-height touch target. */
input[type=range] { --range-progress: 21.43%; display: block; width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none; background: transparent; margin: 8px 0 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, #789258 var(--range-progress), #e9ece3 var(--range-progress)); }
input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 7px solid #789258; box-shadow: 0 1px 4px #0001; }
input[type=range]::-moz-range-thumb { box-sizing: border-box; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 7px solid #789258; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, #789258 var(--range-progress), #e9ece3 var(--range-progress)); }
.range-labels { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: #737c69; }
.estimate { display: flex; gap: 10px; background: #f7f8f4; border: 1px solid #edefe7; border-radius: 8px; margin: 20px 0 26px; padding: 12px; font-size: 13px; color: #68735e; line-height: 1.6; }
.estimate svg { width: 19px; height: 22px; flex-shrink: 0; color: #82966c; }
.estimate div { min-width: 0; overflow-wrap: anywhere; }
.estimate strong { font-weight: 600; color: #5c7149; }
.estimate small { display: block; font-size: 11px; color: #747e68; margin-top: 3px; }
.characters-heading { font-size: 14px; font-weight: 600; margin-bottom: 13px; }
.options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.option { position: relative; display: flex; align-items: center; gap: 10px; border: 1px solid #e5e8df; border-radius: 8px; min-width: 0; min-height: 50px; padding: 12px; font-size: 14px; cursor: pointer; touch-action: manipulation; }
.option:has(input:checked) { background: #fcfdf9; border-color: #d9e0ce; }
.option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check { height: 20px; width: 20px; border: 1px solid #aeb99e; border-radius: 4px; display: grid; place-items: center; flex-shrink: 0; }
.option input:checked + .check { background: #789258; border-color: #789258; }
.option input:checked + .check:after { content: '✓'; color: white; font-size: 14px; }
.option input:focus-visible { outline: none; }
.option:has(input:focus-visible) { outline: 3px solid #78985c; outline-offset: 3px; }
.example { margin-left: auto; color: #737e68; font-family: monospace; font-size: 12px; white-space: nowrap; }
.generate { display: flex; align-items: center; justify-content: center; gap: 10px; background: #293c30; color: #fff; border: 0; border-radius: 9px; min-height: 52px; width: 100%; margin-top: 24px; padding: 14px; font-size: 14px; font-weight: 500; transition: background .15s, transform .15s; }
.generate svg { width: 20px; height: 20px; flex-shrink: 0; }
.arrow { margin-left: auto; font-size: 20px; color: #c4d1be; }
.generate:active { transform: translateY(1px); }
.generate:disabled { opacity: .5; cursor: not-allowed; }
.error { font-size: 13px; color: #a44737; margin-bottom: 0; }
.privacy { display: flex; align-items: flex-start; justify-content: center; gap: 8px; color: #707b64; font-size: 12px; line-height: 1.7; text-align: center; margin: 20px 8px 0; text-wrap: pretty; }
.privacy > span { font-size: 22px; line-height: 1; flex-shrink: 0; }
/* Optional template sections retain the same responsive behavior. */
.topbar { max-width: 1240px; padding: 20px; margin: auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; text-decoration: none; color: #27342e; font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.brand-icon { font-size: 34px; margin-right: 10px; color: #496540; }
.brand-dot { color: #789c55; }
.local { font-size: 12px; color: #68735e; display: flex; gap: 8px; align-items: center; }
.local i { width: 6px; height: 6px; background: #79945e; border-radius: 50%; }
.intro { text-align: center; }
h1 { font-family: Manrope, sans-serif; font-size: clamp(26px, 5vw, 39px); line-height: 1.3; letter-spacing: -1px; font-weight: 800; margin: 17px 0; overflow-wrap: anywhere; }
h1 span { color: #7d8973; }
.intro p { font-size: 14px; color: #68735e; margin: 0 0 28px; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 1240px; margin: 24px auto 0; padding: 24px; border-top: 1px solid #e6e9df; font-size: 12px; color: #707b64; }
footer span:last-child { font-size: 10px; letter-spacing: 1px; }
@media (min-width: 540px) {
  main { padding: 32px 24px; }
  .result-panel { padding: 26px 28px 22px; }
  .settings { padding: 28px; }
  .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generate { position: relative; padding-inline: 44px; }
  .arrow { position: absolute; right: 20px; margin: 0; }
}
@media (min-width: 900px) {
  main { padding-top: 48px; padding-bottom: 40px; }
  .topbar { padding: 28px 48px; }
  footer { padding-inline: 48px; }
}
@media (hover: hover) and (pointer: fine) {
  .copy:hover { background: #fff; }
  .generate:hover { background: #3d5441; }
  .option:hover { border-color: #acbc99; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #e1e5d9; border-radius: 9px; background: #f7f8f4; color: #536348; font-size: 14px; font-weight: 600; text-align: left; }
.settings-toggle svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform .15s; }
.settings-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
#settings-panel:not([hidden]) { padding-top: 24px; }
[hidden] { display: none !important; }
