*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #2563eb; --brand-dark: #2563eb; --brand-light: #EEF2FF;
  --text: #111827; --text-muted: #64748b; --border: #0f172a;
  --bg: #F9FAFB; --white: #FFFFFF;
  --weak: #EF4444; --fair: #b45309; --good: #2563eb; --strong: #059669; --great: #059669;
  --radius: 10px; --shadow: 0 1px 3px rgba(0,0,0,.07); --shadow-md: 0 4px 16px rgba(0,0,0,.09);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* HEADER */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; color: var(--brand); }
.header-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { background: var(--brand-light); color: var(--brand-dark); font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* LAYOUT */
.app-main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.mode-tabs { display: flex; gap: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); width: fit-content; }
.mode-tab { padding: 10px 22px; border: none; background: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text-muted); border-right: 1px solid var(--border); transition: all .12s; }
.mode-tab:last-child { border-right: none; }
.mode-tab.active { background: var(--brand); color: white; }
.mode-tab:hover:not(.active) { background: var(--bg); color: var(--text); }

.app-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 780px) { .app-grid { grid-template-columns: 1fr; } }

/* OPTIONS */
.options-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 20px; display: flex; flex-direction: column; gap: 0; }
.mode-section { display: flex; flex-direction: column; gap: 18px; margin-bottom: 18px; }

.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-group > label:first-child { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.opt-group > label:first-child strong { color: var(--text); }
.opt-label-title { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.opt-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.opt-check input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.range-slider { width: 100%; accent-color: var(--brand); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }

.text-inp { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; }
.text-inp:focus { border-color: var(--brand); }

.sep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sep-btn { padding: 7px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--white); font-size: 12px; font-family: inherit; cursor: pointer; transition: all .12s; color: var(--text-muted); }
.sep-btn.active { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }

.btn-gen { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: white; border: none; border-radius: var(--radius); padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .12s, transform .1s; margin-top: 4px; }
.btn-gen:hover { background: var(--brand-dark); }
.btn-gen:active { transform: scale(.98); }

/* OUTPUT */
.output-panel { display: flex; flex-direction: column; gap: 16px; }

.password-display { background: #1E1B4B; border-radius: var(--radius); padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-md); }
.pw-text { font-family: 'Courier New', 'Monaco', 'Consolas', monospace; font-size: 22px; font-weight: 700; color: #A5B4FC; word-break: break-all; line-height: 1.4; letter-spacing: .05em; min-height: 60px; }
.pw-actions { display: flex; gap: 8px; }
.btn-copy { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; color: white; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; transition: background .12s; }
.btn-copy:hover { background: rgba(255,255,255,.2); }
.btn-copy.copied { background: var(--strong); border-color: var(--strong); }

/* Strength */
.strength-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.strength-bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.strength-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease, background .4s ease; }
.strength-info { display: flex; justify-content: space-between; align-items: center; }
.strength-label { font-size: 14px; font-weight: 700; }
.strength-entropy { font-size: 12px; color: var(--text-muted); }

/* Crack time */
.crack-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.crack-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.crack-val { font-size: 22px; font-weight: 800; color: var(--brand); }

/* Char breakdown */
.char-breakdown { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; gap: 12px; flex-wrap: wrap; }
.char-seg { flex: 1; min-width: 60px; text-align: center; }
.char-seg-count { font-size: 24px; font-weight: 800; }
.char-seg-label { font-size: 11px; color: var(--text-muted); }
.c-upper { color: #2563eb; } .c-lower { color: #2563eb; } .c-num { color: #b45309; } .c-sym { color: #EF4444; }

/* Batch */
.batch-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.btn-copy-all { background: var(--brand); color: white; border: none; border-radius: 6px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.batch-list { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-height: 400px; overflow-y: auto; }
.batch-item { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-family: monospace; font-size: 13px; color: #1E1B4B; gap: 10px; }
.batch-item:last-child { border-bottom: none; }
.batch-num { color: var(--text-muted); min-width: 24px; font-family: sans-serif; font-size: 12px; }
.batch-pw { flex: 1; }
.batch-copy { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.batch-copy:hover { background: var(--bg); color: var(--brand); }

/* Tips */
.tips-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tips-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 500px) { .tips-grid { grid-template-columns: 1fr; } }
.tip { font-size: 12px; color: var(--text-muted); line-height: 1.5; padding: 8px; background: var(--bg); border-radius: 6px; }
.tip strong { color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; line-height: 1.8; background: var(--white); margin-top: 20px; }
.site-footer code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.footer-small { font-size: 11px; color: #5b6878; }
