:root {
  --tool-bg: #050505;
  --tool-panel: #0c0d0d;
  --tool-panel-soft: #111313;
  --tool-text: #f4f5f4;
  --tool-muted: rgba(244,245,244,.62);
  --tool-line: rgba(255,255,255,.12);
  --tool-green: #35d477;
  --tool-danger: #ff6b6b;
}
html[data-theme="light"] {
  --tool-bg: #f7f6f2;
  --tool-panel: #ffffff;
  --tool-panel-soft: #f0efeb;
  --tool-text: #111214;
  --tool-muted: rgba(17,18,20,.62);
  --tool-line: rgba(17,18,20,.12);
  --tool-danger: #b42318;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.tool-mode {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at 75% 8%, rgba(53,212,119,.08), transparent 26rem), var(--tool-bg);
  color: var(--tool-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.toolShell {
  width: min(calc(100% - 32px), 920px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 96px 0 22px;
  display: grid;
  align-content: center;
}
.toolIntro { max-width: 720px; margin-bottom: 16px; }
.toolIntro h1 { margin: 0; font-size: clamp(34px, 6vw, 58px); line-height: .98; letter-spacing: -.05em; }
.toolLead { max-width: 650px; margin: 10px 0 0; color: var(--tool-muted); font-size: 14px; line-height: 1.45; }
.passwordTool {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--tool-line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--tool-panel) 94%, transparent);
  box-shadow: 0 24px 64px rgba(0,0,0,.16);
}
.passwordOutputRow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.passwordOutput {
  width: 100%; min-width: 0; height: 46px; padding: 0 13px;
  border: 1px solid var(--tool-line); border-radius: 12px;
  background: var(--tool-panel-soft); color: var(--tool-text);
  font: 700 15px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em; outline: none;
}
.passwordOutput:focus { border-color: var(--tool-green); box-shadow: 0 0 0 3px rgba(53,212,119,.14); }
.toolButton {
  min-height: 46px; padding: 0 16px; border: 1px solid var(--tool-line); border-radius: 12px;
  background: transparent; color: var(--tool-text); font: inherit; font-weight: 760; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.toolButton:hover { border-color: var(--tool-green); }
.toolButton:active { transform: translateY(1px); }
.toolButton:focus-visible { outline: 3px solid var(--tool-green); outline-offset: 3px; }
.toolButton--primary { border-color: var(--tool-green); background: var(--tool-green); color: #041109; }
.toolButton[disabled] { opacity: .45; cursor: not-allowed; }
.passwordControls { display: grid; gap: 10px; }
.passwordLength { display: grid; grid-template-columns: auto minmax(0, 1fr) 38px; gap: 10px; align-items: center; min-height: 38px; }
.passwordLength label, .passwordOptions label { font-weight: 680; }
.passwordLength output { color: var(--tool-green); text-align: right; font-weight: 800; }
.passwordLength input[type="range"] { width: 100%; accent-color: var(--tool-green); }
.passwordOptions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.passwordOption {
  min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px;
  border: 1px solid var(--tool-line); border-radius: 12px; background: var(--tool-panel-soft); font-size: 13px;
}
.passwordOption input { width: 17px; height: 17px; margin: 0; accent-color: var(--tool-green); }
.passwordActions { display: grid; }
.passwordStatus { min-height: 16px; margin: 0; color: var(--tool-muted); font-size: 12px; line-height: 1.3; }
.passwordStatus:empty { display: none; }
.passwordStatus[data-kind="ok"] { color: var(--tool-green); }
.passwordStatus[data-kind="error"] { color: var(--tool-danger); }
.passwordPrivacy {
  margin: 0; padding-top: 9px; border-top: 1px solid var(--tool-line);
  color: var(--tool-muted); font-size: 11px; line-height: 1.35;
}
/* The password tool is intentionally a one-screen utility. The shared footer is
   not part of this task surface; legal links remain available from the menu/site. */
body.tool-mode > [data-dark-footer-slot] { display: none !important; }
@media (max-width: 760px) {
  .toolShell {
    width: min(calc(100% - 20px), 920px);
    min-height: 100dvh;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 0 max(10px, env(safe-area-inset-bottom, 0px));
    align-content: center;
  }
  .toolIntro { margin-bottom: 10px; }
  .toolIntro h1 { font-size: clamp(28px, 9vw, 38px); }
  .toolLead { margin-top: 6px; font-size: 12px; line-height: 1.3; }
  .passwordTool { gap: 9px; padding: 12px; border-radius: 16px; }
  .passwordOutputRow { grid-template-columns: minmax(0, 1fr) auto; }
  .passwordOutput, .toolButton { height: 42px; min-height: 42px; }
  .toolButton { padding: 0 12px; font-size: 13px; }
  .passwordLength { min-height: 34px; grid-template-columns: auto minmax(0, 1fr) 34px; gap: 8px; font-size: 12px; }
  .passwordOptions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .passwordOption { min-height: 38px; padding: 0 9px; font-size: 11.5px; }
  .passwordOption input { width: 16px; height: 16px; }
  .passwordPrivacy { padding-top: 7px; font-size: 10.5px; line-height: 1.25; }
}
@media (max-width: 380px) {
  .toolShell { width: calc(100% - 16px); padding-top: calc(66px + env(safe-area-inset-top, 0px)); }
  .toolIntro h1 { font-size: 27px; }
  .toolLead { font-size: 11px; }
  .passwordOutput { font-size: 13px; }
  .passwordOption { padding: 0 7px; font-size: 10.5px; }
}
@media (max-height: 700px) and (max-width: 760px) {
  .toolShell { padding-top: calc(62px + env(safe-area-inset-top, 0px)); padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .toolIntro { margin-bottom: 7px; }
  .toolIntro h1 { font-size: 26px; }
  .toolLead { font-size: 10.5px; line-height: 1.2; }
  .passwordTool { gap: 7px; padding: 10px; }
  .passwordOutput, .toolButton { height: 38px; min-height: 38px; }
  .passwordOption { min-height: 34px; }
  .passwordPrivacy { font-size: 9.5px; padding-top: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* DARK 3.8.9 — password-tool buttons use the same 42px public action contract. */
.toolButton{
  box-sizing: border-box;
  min-height: 42px !important;
  height: 42px !important;
  max-height: 42px !important;
  padding: 0 14px !important;
  border: 1px solid #f5f5f2 !important;
  border-radius: 12px !important;
  background: #f5f5f2 !important;
  color: #050505 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: border-color .14s ease, box-shadow .14s ease !important;
}
.toolButton:is(:hover, :focus-visible, :active){
  border-color: var(--tool-green) !important;
  background: #f5f5f2 !important;
  color: #050505 !important;
  box-shadow: 0 0 0 1px rgba(53,212,119,.22) !important;
  outline: none !important;
  transform: none !important;
}
html[data-theme="light"] .toolButton{
  border-color: #111214 !important;
  background: #111214 !important;
  color: #ffffff !important;
}
html[data-theme="light"] .toolButton:is(:hover, :focus-visible, :active){
  border-color: var(--tool-green) !important;
  background: #111214 !important;
  color: #ffffff !important;
}
