.protocol-notice {
  width: min(1320px, calc(100% - 36px));
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid rgba(197, 111, 61, 0.26);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 247, 236, 0.96), rgba(247, 238, 226, 0.92));
  color: #5f3a24;
  box-shadow: var(--shadow-sm);
  line-height: 1.65;
}

.protocol-notice strong {
  display: inline-block;
  margin-right: 8px;
}

.protocol-notice code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:root[data-theme='dark'] .protocol-notice {
  background: linear-gradient(180deg, rgba(53, 35, 24, 0.96), rgba(44, 30, 22, 0.94));
  color: #f2d8c5;
  border-color: rgba(216, 151, 107, 0.24);
}
:root {
  color-scheme: light;
  --bg-top: #efe8dc;
  --bg-bottom: #d8d0bf;
  --bg-spot-a: rgba(255, 244, 228, 0.8);
  --bg-spot-b: rgba(169, 197, 182, 0.24);
  --surface: rgba(255, 251, 244, 0.84);
  --surface-strong: rgba(255, 253, 249, 0.94);
  --surface-soft: rgba(255, 250, 242, 0.66);
  --surface-deep: rgba(243, 236, 226, 0.82);
  --surface-pill: rgba(255, 255, 255, 0.74);
  --surface-glass: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.82);
  --input-muted: rgba(249, 245, 238, 0.96);
  --ink: #1c2925;
  --ink-soft: #62716b;
  --ink-faint: #86928d;
  --line: rgba(53, 74, 64, 0.12);
  --line-strong: rgba(53, 74, 64, 0.2);
  --panel-border: rgba(53, 74, 64, 0.14);
  --accent: #c56f3d;
  --accent-deep: #924825;
  --accent-soft: #f6dfd0;
  --accent-pale: rgba(197, 111, 61, 0.12);
  --green: #16372f;
  --green-soft: #e8f0eb;
  --blue-soft: #e7eff4;
  --danger: #bf5448;
  --header-start: #15382f;
  --header-mid: #29483d;
  --header-end: #4b372f;
  --header-ink: #f8f4ec;
  --header-copy: rgba(248, 244, 236, 0.82);
  --header-eyebrow: rgba(248, 244, 236, 0.64);
  --header-chip-bg: rgba(255, 255, 255, 0.08);
  --header-chip-border: rgba(248, 244, 236, 0.16);
  --picker-shell: rgba(6, 11, 10, 0.22);
  --picker-border: rgba(248, 244, 236, 0.18);
  --picker-text-soft: rgba(248, 244, 236, 0.66);
  --picker-menu-bg: rgba(255, 252, 247, 0.96);
  --picker-menu-border: rgba(53, 74, 64, 0.14);
  --picker-icon-bg: linear-gradient(180deg, #fff2e2, #e3c0a8);
  --picker-icon-ink: #8d4e2d;
  --shadow-sm: 0 12px 24px rgba(36, 36, 28, 0.08);
  --shadow-md: 0 20px 48px rgba(30, 30, 24, 0.12);
  --shadow-lg: 0 28px 72px rgba(23, 22, 18, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: 'Palatino Linotype', 'STSong', 'Songti SC', serif;
  --font-sans: 'Segoe UI Variable Text', 'Microsoft YaHei UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --font-mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg-top: #0c1412;
  --bg-bottom: #151e1b;
  --bg-spot-a: rgba(81, 107, 96, 0.2);
  --bg-spot-b: rgba(194, 118, 71, 0.12);
  --surface: rgba(18, 29, 25, 0.84);
  --surface-strong: rgba(22, 34, 30, 0.92);
  --surface-soft: rgba(17, 27, 24, 0.74);
  --surface-deep: rgba(24, 37, 32, 0.88);
  --surface-pill: rgba(22, 35, 31, 0.92);
  --surface-glass: rgba(0, 0, 0, 0.26);
  --input-bg: rgba(20, 30, 27, 0.92);
  --input-muted: rgba(15, 24, 21, 0.96);
  --ink: #eef2ee;
  --ink-soft: #a6b1ac;
  --ink-faint: #89948f;
  --line: rgba(157, 182, 170, 0.14);
  --line-strong: rgba(157, 182, 170, 0.26);
  --panel-border: rgba(157, 182, 170, 0.16);
  --accent: #d8976b;
  --accent-deep: #b06d48;
  --accent-soft: rgba(85, 55, 38, 0.74);
  --accent-pale: rgba(216, 151, 107, 0.16);
  --green: #1e352e;
  --green-soft: rgba(35, 54, 47, 0.92);
  --blue-soft: rgba(40, 58, 68, 0.86);
  --danger: #ef8576;
  --header-start: #10211d;
  --header-mid: #22372f;
  --header-end: #322720;
  --header-ink: #f4f1ea;
  --header-copy: rgba(244, 241, 234, 0.78);
  --header-eyebrow: rgba(244, 241, 234, 0.58);
  --header-chip-bg: rgba(255, 255, 255, 0.06);
  --header-chip-border: rgba(244, 241, 234, 0.1);
  --picker-shell: rgba(0, 0, 0, 0.3);
  --picker-border: rgba(244, 241, 234, 0.12);
  --picker-text-soft: rgba(244, 241, 234, 0.6);
  --picker-menu-bg: rgba(19, 30, 26, 0.98);
  --picker-menu-border: rgba(157, 182, 170, 0.16);
  --picker-icon-bg: linear-gradient(180deg, #e4c4ac, #bc7f59);
  --picker-icon-ink: #fff5ea;
  --shadow-sm: 0 12px 24px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 22px 50px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 30px 76px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, var(--bg-spot-a), transparent 34%),
    radial-gradient(circle at 100% 14%, var(--bg-spot-b), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 28%, transparent 88%);
  opacity: 0.34;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

input {
  padding: 13px 14px;
}

input[type='number'] {
  appearance: textfield;
}

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

select {
  padding: 13px 42px 13px 14px;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: none;
  border-color: rgba(197, 111, 61, 0.72);
  box-shadow: 0 0 0 4px rgba(197, 111, 61, 0.16);
}

input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
}

.app-shell {
  position: relative;
  z-index: 0;
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.page-header,
.panel {
  animation: rise-in 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.page-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 34px;
  background: linear-gradient(135deg, var(--header-start) 0%, var(--header-mid) 55%, var(--header-end) 100%);
  color: var(--header-ink);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  overflow: visible;
}

.page-header::before,
.page-header::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.page-header::before {
  top: -92px;
  right: -34px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 68%);
}

.page-header::after {
  bottom: -84px;
  left: 24px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 211, 181, 0.12), transparent 66%);
}

.page-header__copy,
.page-header__actions {
  position: relative;
  z-index: 1;
}

.page-header__eyebrow {
  margin: 0 0 12px;
  color: var(--header-eyebrow);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-header h1,
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.page-header h1 {
  font-size: clamp(1.84rem, 3.2vw, 2.7rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
}

.page-header p {
  margin: 12px 0 0;
  max-width: 44rem;
  color: var(--header-copy);
  font-size: 0.92rem;
  line-height: 1.68;
}

.page-header__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--header-chip-border);
  border-radius: 999px;
  background: var(--header-chip-bg);
  color: var(--header-ink);
  backdrop-filter: blur(10px);
}

.page-header__actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 4;
}

.theme-picker {
  position: relative;
  z-index: 5;
  width: min(100%, 292px);
}

.theme-picker__button {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 10px 16px;
  border: 1px solid var(--picker-border);
  border-radius: 999px;
  background: var(--picker-shell);
  color: var(--header-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-md);
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.theme-picker__button:hover {
  transform: translateY(-1px);
}

.theme-picker__button:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), var(--shadow-md);
}

.theme-picker__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--picker-icon-bg);
  color: var(--picker-icon-ink);
  box-shadow: var(--shadow-sm);
}

.theme-picker__glyph {
  position: absolute;
  width: 22px;
  height: 22px;
  display: none;
}

.theme-picker__button[data-theme-mode='system'] .theme-picker__glyph--system,
.theme-picker__button[data-theme-mode='light'] .theme-picker__glyph--light,
.theme-picker__button[data-theme-mode='dark'] .theme-picker__glyph--dark {
  display: block;
}

.theme-picker__text {
  display: grid;
  gap: 4px;
  text-align: left;
}

.theme-picker__label {
  color: var(--picker-text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#themeMenuLabel {
  font-size: 0.92rem;
  font-weight: 700;
}

.theme-picker__chevron {
  width: 11px;
  height: 11px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.theme-picker__button[aria-expanded='true'] .theme-picker__chevron {
  transform: rotate(-135deg) translateY(-2px);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: grid;
  width: min(100vw - 24px, 320px);
  padding: 10px;
  border: 1px solid var(--picker-menu-border);
  border-radius: 24px;
  background: var(--picker-menu-bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu__item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.theme-menu__item:hover {
  background: var(--surface-soft);
}

.theme-menu__item[aria-checked='true'] {
  border-color: var(--line-strong);
  background: var(--green-soft);
}

.theme-menu__item[aria-checked='true']::after {
  content: '';
  position: absolute;
  right: 16px;
  width: 8px;
  height: 14px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

.theme-menu__item-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--accent-deep);
}

.theme-menu__item-icon svg {
  width: 20px;
  height: 20px;
}

.theme-menu__item-copy {
  display: grid;
  gap: 3px;
}

.theme-menu__item-copy > span {
  font-size: 0.92rem;
  font-weight: 700;
}

.theme-menu__item-copy > small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.page-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
}

.panel {
  position: relative;
  z-index: 1;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 30%, rgba(197, 111, 61, 0.18));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}


.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 0;
}

.panel-head h2 {
  font-size: 1.36rem;
  color: var(--ink);
}

.panel-head p,
.results-summary,
.security-note,
.selection-summary,
.strength-description,
.crack-time-hint,
.history-empty,
.history-meta,
.history-preview,
.inline-field span,
.select-group__label,
.select-group__hint {
  color: var(--ink-soft);
}

.panel-head p {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.64;
}

.panel-head--history {
  align-items: center;
  padding-bottom: 26px;
}
.settings-table {
  display: grid;
  gap: 0;
  padding: 10px 24px 20px;
}

.setting-row {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 18px;
  border-top: 1px solid var(--line);
}

.setting-row:first-child {
  border-top: none;
}

.setting-label,
.setting-control {
  padding: 18px 0;
}

.setting-label {
  display: flex;
  align-items: flex-start;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.setting-control--characters,
.setting-control--exclude,
.setting-control--options {
  flex-wrap: wrap;
}

.setting-control--characters,
.setting-control--exclude {
  align-items: flex-start;
}

.setting-control--characters {
  gap: 10px;
}

.setting-control--characters .inline-field,
.setting-control--exclude .inline-field {
  display: grid;
  grid-template-columns: max-content minmax(280px, 1fr);
  align-items: center;
  gap: 14px;
  align-self: flex-start;
}

.setting-control--characters .inline-field span,
.setting-control--exclude .inline-field span {
  white-space: nowrap;
}

.setting-control--split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.setting-control--detail {
  display: block;
}

.setting-row--action .setting-control--center {
  justify-content: flex-start;
}

.plain-check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.plain-check:hover,
.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.history-action:hover:not(:disabled),
.history-toggle:hover {
  transform: translateY(-1px);
}

.plain-check:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.plain-check--character {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 18px;
  border-color: rgba(53, 74, 64, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
}

.plain-check--character:has(input:checked) {
  border-color: rgba(197, 111, 61, 0.28);
  background: rgba(197, 111, 61, 0.08);
}

.plain-check--character span {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

:root[data-theme='dark'] input[type='checkbox'] {
  accent-color: var(--accent);
}

:root[data-theme='dark'] .plain-check--character {
  border-color: rgba(157, 182, 170, 0.2);
  background: linear-gradient(180deg, rgba(18, 30, 26, 0.88), rgba(13, 22, 20, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .plain-check--character:hover {
  border-color: rgba(216, 151, 107, 0.26);
  background: linear-gradient(180deg, rgba(22, 35, 31, 0.94), rgba(16, 27, 23, 0.82));
}

:root[data-theme='dark'] .plain-check--character:has(input:checked) {
  border-color: rgba(216, 151, 107, 0.34);
  background: linear-gradient(180deg, rgba(45, 60, 53, 0.96), rgba(26, 40, 35, 0.92));
}

.plain-check--option {
  align-items: flex-start;
  flex: 1 1 320px;
  min-height: auto;
  padding: 2px 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.plain-check--option + .plain-check--option {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.plain-check__content {
  display: grid;
  gap: 6px;
}

.plain-check__title {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.4;
}

.plain-check__hint {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.62;
}

.inline-field {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.inline-field--grow {
  flex: 1 1 320px;
}

.inline-field span {
  font-size: 0.78rem;
}

.select-group {
  display: grid;
  gap: 6px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.select-group__label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select-group__hint {
  font-size: 0.74rem;
}

.select-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.select-wrap em {
  font-style: normal;
  color: var(--ink);
  font-weight: 700;
}

.primary-button,
.secondary-button,
.history-action,
.history-toggle {
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button {
  min-width: 156px;
  padding: 13px 22px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff8f1;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 26px rgba(197, 111, 61, 0.24);
}

.secondary-button,
.history-action,
.history-toggle {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--ink);
}

.secondary-button {
  min-height: 44px;
  padding: 0 14px;
}

.secondary-button--subtle {
  background: transparent;
}

.history-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
}

.history-action--primary {
  border-color: transparent;
  background: var(--green);
  color: #f6f2ea;
}

.primary-button:disabled,
.secondary-button:disabled,
.history-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.selection-summary,
.strength-description,
.crack-time-hint,
.form-error,
.security-note,
.results-summary,
.history-empty {
  margin: 0;
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.detail-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-pill);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.detail-pill strong {
  color: var(--ink);
}

.detail-pill--highlight {
  background: linear-gradient(180deg, var(--accent-pale), rgba(255, 255, 255, 0.02));
  border-color: rgba(197, 111, 61, 0.24);
}

.strength-description {
  margin-top: 14px;
  line-height: 1.7;
}

.crack-time-hint {
  margin-top: 10px;
  padding-left: 14px;
  border-left: 3px solid rgba(197, 111, 61, 0.32);
  line-height: 1.62;
  font-size: 0.8rem;
}

.form-error {
  margin-top: 10px;
  color: var(--danger);
  font-weight: 600;
}

.results-summary,
.security-note {
  line-height: 1.68;
}

.results-actions,
.history-actions,
.password-card__meta,
.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.security-note {
  margin: 14px 24px 0;
}

.history-toolbar {
  margin: 0 24px;
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.history-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--input-muted);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.history-toggle__chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.history-toggle[aria-expanded='true'] .history-toggle__chevron {
  transform: rotate(-135deg) translateY(-2px);
}

.history-panel__body {
  padding: 0 0 18px;
}

.history-panel__body[hidden] {
  display: none;
}

.history-empty,
.results-empty {
  margin: 18px 24px 0;
  padding: 18px 0;
  border: none;
  border-top: 1px dashed var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.results-list,
.history-list {
  display: grid;
  gap: 12px;
  margin: 18px 24px 0;
}

.results-list {
  max-height: 980px;
  overflow: auto;
  padding-right: 4px;
}

.results-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  width: 8px;
}

.results-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(99, 113, 107, 0.28);
}

.password-card,
.history-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

.password-card__line,
.history-item__top {
  display: grid;
  gap: 12px;
}

.password-card__line {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
}

.password-card__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 38px;
  border-radius: 999px;
  background: rgba(197, 111, 61, 0.12);
  color: var(--accent-deep);
  font-weight: 700;
}

.password-value {
  display: block;
  overflow: auto;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--input-muted);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  white-space: nowrap;
}

.password-card__meta {
  margin-top: 12px;
}

.password-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--input-muted);
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.meta-pill {
  border-color: rgba(63, 94, 110, 0.16) !important;
  background: var(--blue-soft) !important;
  color: #355667 !important;
  font-weight: 700;
}

:root[data-theme='dark'] .meta-pill {
  color: #dceaf1 !important;
}

.history-item__top {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
}

.history-item__select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 40px;
  padding-top: 4px;
}

.history-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.history-meta,
.history-preview {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.58;
}

.history-actions {
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  min-width: 220px;
  max-width: min(340px, calc(100% - 24px));
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .page-main {
    grid-template-columns: 1fr;
  }

  .panel--settings,
  .panel--results,
  .panel--history {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 860px) {
  body {
    font-size: 13.5px;
  }

  .app-shell {
    width: min(100%, calc(100% - 16px));
    padding-top: 14px;
    padding-bottom: 28px;
  }

  .page-main {
    gap: 16px;
    margin-top: 16px;
  }

  .page-header,
  .setting-row,
  .history-item__top,
  .password-card__line {
    grid-template-columns: 1fr;
  }

  .page-header {
    gap: 18px;
    padding: 20px 16px 18px;
    border-radius: 26px;
  }

  .page-header h1 {
    font-size: 1.7rem;
    line-height: 1.04;
  }

  .page-header p {
    margin-top: 10px;
    font-size: 0.86rem;
    line-height: 1.58;
  }

  .page-header__badges {
    gap: 8px;
    margin-top: 14px;
  }

  .header-badge {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .page-header__actions {
    width: 100%;
    justify-content: stretch;
  }

  .theme-picker,
  .theme-picker__button,
  .history-toggle,
  .secondary-button,
  .primary-button,
  .history-action,
  .plain-check,
  .plain-check--option,
  .inline-field,
  .inline-field input {
    width: 100%;
  }

  .theme-picker {
    max-width: none;
  }

  .theme-picker__button {
    min-height: 60px;
    padding: 8px 12px;
    grid-template-columns: 42px minmax(0, 1fr) 10px;
    gap: 12px;
  }

  .theme-picker__icon {
    width: 38px;
    height: 38px;
  }

  .theme-picker__glyph {
    width: 18px;
    height: 18px;
  }

  .theme-picker__label {
    font-size: 0.62rem;
  }

  #themeMenuLabel {
    font-size: 0.88rem;
  }

  .theme-menu {
    width: 100%;
    top: calc(100% + 10px);
    border-radius: 18px;
  }

  .theme-menu__item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .theme-menu__item-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .theme-menu__item-icon svg {
    width: 18px;
    height: 18px;
  }

  .theme-menu__item-copy > span {
    font-size: 0.88rem;
  }

  .theme-menu__item-copy > small {
    font-size: 0.74rem;
    line-height: 1.42;
  }

  .panel {
    border-radius: 24px;
  }

  .panel-head,
  .settings-table,
  .security-note,
  .results-list,
  .history-list,
  .history-toolbar,
  .results-empty,
  .history-empty {
    margin-left: 0;
    margin-right: 0;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 16px 0;
  }

  .panel-head h2 {
    font-size: 1.2rem;
  }

  .panel-head p {
    font-size: 0.82rem;
    line-height: 1.58;
  }

  .panel-head--history {
    padding-bottom: 18px;
  }

  .settings-table {
    gap: 0;
    padding: 8px 14px 14px;
  }

  .setting-row {
    gap: 10px;
    padding: 0;
    border-radius: 0;
  }

  .setting-label,
  .setting-control {
    padding: 14px 0;
  }

  .setting-label {
    padding-bottom: 0;
    font-size: 0.8rem;
  }

  .setting-control {
    padding-top: 0;
    gap: 10px;
  }

  .plain-check {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 999px;
  }

  .plain-check--character {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 16px;
  }

  .plain-check--character span {
    font-size: 0.84rem;
  }

  .plain-check--option {
    min-height: auto;
    padding: 4px 0;
    border-radius: 0;
  }

  .plain-check--option + .plain-check--option {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 4px;
  }

  .plain-check__title {
    font-size: 0.84rem;
  }

  .plain-check__hint {
    font-size: 0.74rem;
    line-height: 1.52;
  }

  .inline-field span,
  .select-group__hint,
  .select-group__label {
    font-size: 0.72rem;
  }

  .select-group {
    gap: 6px;
    padding: 0;
    border-radius: 0;
  }

  .select-wrap {
    gap: 10px;
  }

  .setting-control--characters,
  .setting-control--exclude {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .setting-control--characters .plain-check--character {
    width: auto;
    flex: 0 0 auto;
  }

  .setting-control--characters .inline-field,
  .setting-control--exclude .inline-field {
    width: 100%;
    flex: 1 1 100%;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .setting-control--characters .inline-field span,
  .setting-control--exclude .inline-field span {
    white-space: normal;
  }

  .setting-control--split {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  .setting-control--split .select-group {
    width: auto;
    flex: 1 1 220px;
  }

  .results-actions,
  .history-actions,
  .history-toolbar,
  .detail-pills,
  .setting-control--options {
    display: grid;
    gap: 8px;
  }

  .primary-button,
  .secondary-button,
  .history-action {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .history-toggle {
    min-height: 42px;
    padding: 0 13px;
    font-size: 0.84rem;
    justify-content: space-between;
  }

  .history-toggle__count {
    min-width: 42px;
    min-height: 24px;
    font-size: 0.7rem;
  }

  .selection-summary,
  .strength-description,
  .crack-time-hint,
  .results-summary,
  .security-note,
  .history-empty,
  .results-empty {
    font-size: 0.82rem;
    line-height: 1.58;
  }

  .detail-pills {
    margin-top: 10px;
  }

  .detail-pill {
    min-height: 31px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .security-note,
  .results-list,
  .history-list,
  .results-empty,
  .history-empty,
  .history-toolbar {
    margin-top: 14px;
    margin-left: 14px;
    margin-right: 14px;
  }

  .results-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .password-card,
  .history-item {
    padding: 12px 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    background: transparent;
  }

  .password-card__index {
    width: 42px;
    height: 34px;
    font-size: 0.78rem;
  }

  .password-value {
    padding: 11px 12px;
    font-size: 0.82rem;
  }

  .password-card__meta {
    margin-top: 10px;
    gap: 6px;
  }

  .password-card__meta span {
    min-height: 27px;
    font-size: 0.72rem;
  }

  .history-title {
    font-size: 0.86rem;
  }

  .history-meta,
  .history-preview {
    font-size: 0.76rem;
    line-height: 1.54;
  }

  .toast {
    right: 14px;
    left: 14px;
    bottom: 14px;
    min-width: 0;
    max-width: none;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}