:root {
  color-scheme: dark;
  --bg: #0a192f;
  --panel: #111f35;
  --panel-strong: #172844;
  --ink: #e6f0fa;
  --muted: #b8cbe0;
  --label: #d8e8f8;
  --line: #3a5c82;
  --accent: #00b894;
  --accent-dark: #27ae60;
  --warn: #f39c12;
  --ok: #00b894;
  --danger: #e5484d;
  --purple: #6c5ce7;
  --mono: "JetBrains Mono", "Fira Code", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(108, 92, 231, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 18px;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--accent);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.05;
  font-weight: 800;
}

h2 {
  font-size: 22px;
}

.brand p {
  margin-top: 6px;
  color: var(--muted);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--label);
  font-size: 14px;
  font-weight: 800;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1);
}

.status-ok {
  background: var(--ok);
  animation: statusPulse 1.8s ease-in-out infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(0, 184, 148, 0.02);
  }
}

.tabs {
  justify-self: center;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 31, 53, 0.78);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  cursor: pointer;
}

.tab.is-active {
  background: var(--accent);
  color: #061522;
  font-weight: 800;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 24px;
  align-items: start;
}

.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 25, 47, 0.76);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel {
  display: none;
  padding: 24px;
}

.panel.is-active {
  display: block;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field,
.switch,
.segmented {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(230, 240, 250, 0.04);
}

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  padding: 16px;
}

.field.wide {
  grid-template-columns: 1fr;
}

.field span,
.switch span,
.segmented legend {
  color: var(--label);
  font-size: 15px;
  font-weight: 850;
}

.field input[type="password"],
.field input[type="number"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1b31;
  padding: 0 12px;
  color: var(--ink);
}

.field input[type="number"] {
  width: 44px;
  min-height: 40px;
  appearance: textfield;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1b31;
  padding: 0;
  font-size: 20px;
  font-weight: 800;
  font-family: var(--mono);
  text-align: center;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.stepper-field {
  grid-template-columns: 1fr auto;
  min-height: 76px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-self: end;
}

.stepper button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(230, 240, 250, 0.05);
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.stepper button:hover {
  background: rgba(0, 184, 148, 0.22);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.12);
}

.stepper button:active {
  transform: scale(0.94);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
}

.switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 16px;
}

.switch input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  accent-color: var(--accent);
}

.switch span {
  line-height: 1.2;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-height: 84px;
  padding: 14px;
}

.segmented legend {
  grid-column: 1 / -1;
  padding: 0;
}

.segmented label {
  display: grid;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #0c1b31;
  cursor: pointer;
}

.segmented input:checked + span {
  border-color: var(--accent);
  background: rgba(0, 184, 148, 0.16);
  color: var(--accent);
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin: 18px 0;
}

.primary,
.secondary,
.icon-button,
.copy-button {
  border: 0;
  cursor: pointer;
}

.primary {
  min-height: 46px;
  border-radius: 6px;
  background: var(--accent);
  color: #061522;
  padding: 0 20px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 184, 148, 0.14);
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.18), 0 14px 28px rgba(0, 184, 148, 0.2);
}

.primary:active {
  transform: scale(0.97);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.secondary {
  min-height: 46px;
  border: 1px solid rgba(230, 240, 250, 0.22);
  border-radius: 6px;
  background: rgba(230, 240, 250, 0.06);
  color: var(--ink);
  padding: 0 18px;
  font-weight: 800;
  backdrop-filter: blur(10px);
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.secondary:hover {
  border-color: var(--purple);
  background: rgba(108, 92, 231, 0.16);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.14);
}

.secondary:active {
  transform: scale(0.97);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.feedback-action {
  border-color: rgba(243, 156, 18, 0.42);
  color: var(--warn);
}

.feedback-action:hover {
  border-color: var(--warn);
  background: rgba(243, 156, 18, 0.14);
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.12);
}

.icon-button,
.copy-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 184, 148, 0.12);
  color: var(--accent);
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.icon-button:hover,
.copy-button:hover {
  background: rgba(0, 184, 148, 0.2);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.12);
}

.icon-button:active,
.copy-button:active {
  transform: scale(0.94);
}

.icon-button svg,
.copy-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.result-box {
  position: relative;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px 62px 16px 16px;
}

.result-box.single {
  max-width: 720px;
}

.result-label {
  color: var(--label);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-value {
  margin-top: 14px;
  overflow-wrap: anywhere;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.18;
}

.result-value.password {
  font-family: var(--mono);
}

.phrase-highlight {
  color: var(--ink);
}

.phrase-token {
  white-space: nowrap;
}

.phrase-used {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.phrase-used-word,
.phrase-used-number {
  color: var(--warn);
}

.phrase-used-special {
  color: var(--purple);
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

.score {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

.meter {
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #203651;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--warn), var(--ok));
  box-shadow: 0 0 16px rgba(243, 156, 18, 0.2);
  transition: width 0.2s ease;
}

.entropy-line {
  margin: -6px 0 18px;
  color: var(--label);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.check-list,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.check-list {
  margin: 0;
}

.check-list div,
.stat-grid div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

dt,
dd {
  margin: 0;
}

dt,
.stat-grid small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

dd,
.stat-grid span {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
}

.stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 18px;
}

.usage-stats {
  margin-top: 18px;
}

.usage-stats h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.privacy-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.usage-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.usage-grid div {
  box-shadow: inset 0 1px 0 rgba(230, 240, 250, 0.04);
}

.usage-grid dd {
  color: var(--accent);
  font-family: var(--mono);
}

.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-chart {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(230, 240, 250, 0.04);
}

.wide-chart {
  grid-column: 1 / -1;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-head h4 {
  margin: 0;
  font-size: 15px;
}

.chart-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chart-head strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
}

.stats-switches {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stats-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(58, 92, 130, 0.72);
  border-radius: 8px;
  background: rgba(12, 27, 49, 0.62);
}

.stats-switch button {
  flex: 1;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.stats-switch button:hover {
  background: rgba(0, 184, 148, 0.12);
  color: var(--ink);
}

.stats-switch button:active {
  transform: scale(0.97);
}

.stats-switch button.is-active {
  background: var(--accent);
  color: #061522;
}

.trend-chart {
  overflow: hidden;
}

.trend-shell {
  height: 240px;
  border: 1px solid rgba(58, 92, 130, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(rgba(230, 240, 250, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 240, 250, 0.035) 1px, transparent 1px),
    rgba(7, 18, 33, 0.72);
  background-size: 100% 44px, 64px 100%;
  padding: 8px;
}

.trend-shell svg {
  display: block;
  width: 100%;
  height: 100%;
}

.trend-grid-line {
  stroke: rgba(230, 240, 250, 0.1);
  stroke-width: 1;
}

.trend-axis-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.trend-area {
  fill: rgba(0, 184, 148, 0.16);
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  filter: drop-shadow(0 0 8px rgba(0, 184, 148, 0.36));
}

.trend-point {
  fill: var(--warn);
  stroke: #071221;
  stroke-width: 2;
}

.trend-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.chart-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #203651;
}

.chart-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warn));
  transition: width 0.2s ease;
}

.chart-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.chart-values div {
  min-height: 56px;
  border: 1px solid rgba(58, 92, 130, 0.72);
  border-radius: 8px;
  background: rgba(12, 27, 49, 0.62);
  padding: 10px;
}

.chart-values dt {
  color: var(--muted);
  font-size: 12px;
}

.chart-values dd {
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.channel-bars {
  display: grid;
  gap: 10px;
}

.channel-row {
  display: grid;
  grid-template-columns: 170px minmax(80px, 1fr) 76px;
  gap: 10px;
  align-items: center;
}

.channel-row span {
  color: var(--label);
  font-size: 13px;
  font-weight: 800;
}

.channel-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #203651;
}

.channel-row i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.channel-row b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
}

.bot-aside {
  position: sticky;
  top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 31, 53, 0.78);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(230, 240, 250, 0.04);
}

.bot-aside-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-aside h2 {
  font-size: 16px;
  line-height: 1.1;
}

.bot-aside p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.bot-aside-links {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bot-mini-link {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(58, 92, 130, 0.78);
  border-radius: 8px;
  background: rgba(12, 27, 49, 0.72);
  color: var(--ink);
  padding: 8px;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.bot-mini-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.12);
}

.bot-mini-link:active {
  transform: scale(0.98);
}

.bot-logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(230, 240, 250, 0.06);
}

.bot-mini-link strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.seo-note {
  margin-top: 16px;
  border: 1px solid rgba(58, 92, 130, 0.55);
  border-radius: 8px;
  background: rgba(17, 31, 53, 0.46);
  padding: 14px 16px;
}

.seo-note h2 {
  font-size: 16px;
}

.seo-note p {
  max-width: 820px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(18px);
  opacity: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #061522;
  padding: 12px 14px;
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 820px) {
  .topbar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .bot-aside {
    position: static;
  }

  .bot-aside-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-grid,
  .result-grid,
  .stats-charts,
  .check-list,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .wide-chart {
    grid-column: auto;
  }

  .channel-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .stats-switches {
    grid-template-columns: 1fr;
  }

  .channel-row b {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 14px 0;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 64px;
    height: 64px;
  }

  .panel {
    padding: 16px;
  }

  .result-value {
    font-size: 25px;
  }

  .bot-aside-links {
    grid-template-columns: 1fr;
  }

  .chart-values {
    grid-template-columns: 1fr;
  }

  .stats-switch {
    flex-wrap: wrap;
  }

  .stats-switch button {
    min-width: calc(50% - 3px);
  }
}
