:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  color: #0d1c3c;
  background: #f5f8ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #0c1c3f;
  --muted: #65738c;
  --accent: #1258ef;
  --accent-2: #4299ff;
  --border: #dce3f0;
  --field-border: #d3dbea;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
select,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #80b4ff;
  outline-offset: 2px;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse 65% 55% at 51% 2%, #eef4ff 0%, transparent 80%), #f6f9ff;
  padding: 76px 24px 42px;
}
.page-shell::before,
.page-shell::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  opacity: 0.58;
}
.page-shell::before {
  width: 580px;
  height: 580px;
  top: -360px;
  right: -235px;
  background: linear-gradient(135deg, #d8e8ff, #a9d2ff);
  transform: rotate(25deg);
}
.page-shell::after {
  width: 560px;
  height: 560px;
  bottom: -335px;
  left: -265px;
  background: linear-gradient(145deg, #aed3ff, #e6efff);
}
.app-container {
  width: min(100%, 872px);
  margin: 0 auto;
}
.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 34px 32px;
}
.app-mark {
  flex: none;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  color: #165ff2;
  border-radius: 24px;
  background: linear-gradient(138deg, #e3efff, #c8dfff);
  border: 1px solid #d3e5ff;
}
.hero-copy {
  min-width: 0;
}
.eyebrow {
  margin: 0 0 5px;
  color: #3765b1;
  letter-spacing: 0.105em;
  font-size: 10.5px;
  font-weight: 800;
}
h1 {
  color: var(--ink);
  font-weight: 760;
  font-size: clamp(27px, 4vw, 38px);
  letter-spacing: -1.45px;
  line-height: 1.17;
  margin: 0 0 8px;
}
.hero-subtitle {
  font-size: 16px;
  color: #425371;
  margin: 0;
  line-height: 1.5;
}

.generator-card {
  padding: 34px 36px 0;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 26px;
  border: 1px solid rgba(210, 222, 242, 0.75);
  box-shadow:
    0 25px 60px rgba(40, 72, 135, 0.1),
    0 2px 8px rgba(40, 72, 135, 0.035);
}
.section-heading label,
.field label,
.code-header h2 {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.27px;
  line-height: 1.45;
}
.section-heading p,
.field-description {
  margin: 2px 0 13px;
  color: #60708b;
  line-height: 1.45;
  font-size: 13.4px;
}
.secret-input-group {
  display: flex;
  height: 51px;
  border: 1px solid var(--field-border);
  border-radius: 9px;
  background: #fff;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  overflow: hidden;
}
.secret-input-group:focus-within {
  border-color: #5694ff;
  box-shadow: 0 0 0 3px #d6e6ff;
}
.secret-input-group.input-error {
  border-color: #df7474;
}
.secret-input-group input {
  flex: 1;
  min-width: 0;
  padding: 0 15px;
  border: 0;
  outline: 0;
  color: #102044;
  font-size: 17px;
  letter-spacing: 0.06em;
}
.secret-input-group input::placeholder {
  color: #a6aec0;
  letter-spacing: normal;
}
.secret-input-group input:focus-visible {
  outline: 0;
}
.show-button {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-width: 111px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--field-border);
  color: #293a58;
  background: #f7f9fe;
  font-size: 14px;
  font-weight: 650;
}
.show-button:hover {
  background: #eff4ff;
}
.helper-text {
  margin: 9px 0 0;
  color: #65738c;
  font-size: 12.7px;
  line-height: 1.5;
}
.error-message {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 0 0;
  color: #bb333d;
  font-size: 13px;
}
.error-message svg {
  flex: none;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 30px;
}
.field-description {
  margin-bottom: 11px;
}
.select-wrap,
.number-wrap {
  position: relative;
  height: 49px;
  background: white;
  border: 1px solid var(--field-border);
  border-radius: 9px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.select-wrap:focus-within,
.number-wrap:focus-within {
  border-color: #5694ff;
  box-shadow: 0 0 0 3px #d6e6ff;
}
.select-wrap select,
.number-wrap input {
  display: block;
  width: 100%;
  height: 100%;
  color: #0e2044;
  background: transparent;
  border: 0;
  border-radius: inherit;
  padding: 0 16px;
  outline: 0;
  font-size: 16px;
  appearance: none;
}
.select-wrap select {
  padding-right: 48px;
  cursor: pointer;
}
.select-wrap svg {
  position: absolute;
  color: #165ff2;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  pointer-events: none;
}
.number-wrap input {
  appearance: textfield;
}
.number-wrap input::-webkit-outer-spin-button,
.number-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field .helper-text {
  margin-top: 8px;
}
.algorithm-field {
  margin-top: 29px;
}

.code-section {
  margin-top: 30px;
  border-top: 1px solid #e7edf6;
  padding-top: 27px;
}
.countdown-row {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 29px;
}
.progress-track {
  position: relative;
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 100px;
  background: #e8effc;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #185af2, #459bff);
  transition: width 0.12s linear;
}
.countdown-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  color: #465675;
  font-size: 13.5px;
  font-weight: 600;
}
.countdown-label svg {
  flex: none;
}
.countdown-label strong {
  color: #155df3;
  font-weight: 750;
}
.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.code-header h2 {
  margin: 0;
}
.token-box {
  position: relative;
  min-height: 133px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 13px;
  border: 1.5px solid #7cb3ff;
  background: linear-gradient(105deg, #eff6ff, #e6f0ff 58%, #e8f2ff);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.65),
    0 8px 18px rgba(20, 77, 172, 0.06);
}
.token-box output {
  font-size: clamp(41px, 9vw, 67px);
  font-weight: 730;
  line-height: 1.25;
  letter-spacing: 0.17em;
  padding-left: 0.17em;
  font-variant-numeric: tabular-nums;
  color: #091d52;
  text-align: center;
  user-select: all;
  overflow-wrap: anywhere;
}
.token-box.token-empty output {
  font-size: clamp(20px, 6vw, 36px);
  letter-spacing: 0.05em;
  color: #9caec9;
}

/* Lightweight code utilities: appear on hover or keyboard focus, always available on touch. */
.token-hover-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(160, 187, 227, 0.62);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 3px 14px rgba(11, 41, 91, 0.09);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.17s ease,
    transform 0.17s ease;
}
.token-box:hover .token-hover-actions,
.token-box:focus-within .token-hover-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.token-icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #2b4b7f;
  background: transparent;
  transition:
    color 0.15s,
    background-color 0.15s;
}
.token-icon-button:hover {
  color: #1157e6;
  background: #eaf2ff;
}
.token-icon-button:active {
  background: #dceaff;
}
.token-box.token-concealed output {
  color: #60779e;
  letter-spacing: 0.21em;
  user-select: none;
}
.token-box.token-extended output {
  font-size: clamp(27px, 6.4vw, 53px);
  letter-spacing: 0.09em;
  padding-left: 0.09em;
}
.token-box.token-extended.token-concealed output {
  letter-spacing: 0.13em;
}
@media (hover: none) {
  .token-hover-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 9px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.button:not(:disabled):active {
  transform: translateY(1px);
}
.button-secondary {
  color: #384b6a;
  background: #f9fbff;
  border: 1px solid #d1dbea;
}
.button-secondary:hover:not(:disabled) {
  background: #f0f5ff;
}
.button-primary {
  min-width: 163px;
  color: white;
  background: #1558ed;
  border: 1px solid #1558ed;
  box-shadow: 0 3px 8px rgba(21, 88, 237, 0.14);
}
.button-primary:hover:not(:disabled) {
  background: #0b4cda;
  box-shadow: 0 5px 13px rgba(21, 88, 237, 0.23);
}
.button:disabled {
  opacity: 0.5;
  box-shadow: none;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding: 24px 0 27px;
  border-top: 1px solid #e7edf6;
}
.privacy-note {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #5c6b85;
  font-size: 12.4px;
  line-height: 1.45;
}
.privacy-note svg {
  flex: none;
  color: #50627f;
}
.brand-note {
  flex: none;
  color: #61708a;
  font-size: 12.3px;
  padding-left: 20px;
  border-left: 1px solid #e1e8f4;
}
.brand-note strong {
  color: #195eec;
  font-weight: 700;
}
.bottom-note {
  margin: 23px 0 0;
  text-align: center;
  font-size: 12px;
  color: #8492a9;
}
.bottom-note span {
  margin: 0 6px;
}
.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;
}

@media (max-width: 680px) {
  .page-shell {
    padding: 34px 13px 28px;
  }
  .hero {
    gap: 15px;
    margin: 0 8px 23px;
  }
  .app-mark {
    width: 59px;
    height: 59px;
    border-radius: 17px;
  }
  .app-mark svg {
    width: 29px;
    height: 29px;
  }
  .eyebrow {
    font-size: 9px;
  }
  h1 {
    font-size: clamp(23px, 5.4vw, 31px);
    letter-spacing: -0.8px;
  }
  .hero-subtitle {
    font-size: 12.5px;
  }
  .generator-card {
    border-radius: 20px;
    padding: 23px 18px 0;
  }
  .section-heading label,
  .field label,
  .code-header h2 {
    font-size: 15.5px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 25px;
  }
  .algorithm-field {
    margin-top: 23px;
  }
  .code-section {
    margin-top: 26px;
    padding-top: 23px;
  }
  .countdown-row {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 11px;
    margin-bottom: 25px;
  }
  .countdown-label {
    justify-content: flex-end;
  }
  .progress-track {
    flex: auto;
    height: 9px;
  }
  .token-box {
    min-height: 107px;
  }
  .token-box output {
    font-size: clamp(36px, 8.5vw, 58px);
    letter-spacing: 0.12em;
    padding-left: 0.12em;
  }
  .token-box.token-extended output {
    font-size: clamp(22px, 6vw, 41px);
    letter-spacing: 0.05em;
    padding-left: 0.05em;
  }
  .card-footer {
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 25px;
    padding: 21px 0 23px;
  }
  .brand-note {
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 380px) {
  .hero {
    align-items: flex-start;
  }
  h1 {
    font-size: 23px;
  }
  .actions {
    gap: 8px;
  }
  .button {
    flex: 1;
    padding: 0 8px;
    min-width: 0;
    gap: 6px;
    font-size: 13px;
  }
  .show-button {
    min-width: 90px;
    padding: 0 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Project additions: brand mark, inline icon sprite, notices, and legacy states. */
.app-mark {
  background: #0b1833;
  border-color: rgba(11, 24, 51, 0.12);
  overflow: hidden;
}

.app-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.notice {
  margin: 0 0 18px;
  padding: 14px 18px;
  color: #8a2c34;
  background: #fff7f7;
  border: 1px solid #f2c9c9;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.notice code {
  color: #6f2029;
  font-size: 0.95em;
}

.error-message {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 0 0;
  color: #bb333d;
  font-size: 13px;
  line-height: 1.45;
}

.error-message .error-text {
  min-width: 0;
}

.clipboard-fallback {
  position: fixed;
  top: -1000px;
  left: -1000px;
  opacity: 0;
}

.brand-note a {
  color: #195eec;
  font-weight: 700;
  text-decoration: none;
}

.brand-note a:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    font-size: 13px;
  }
}

.sound-toggle {
  margin-left: auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #dce3f0;
  border-radius: 9px;
  color: #2b4b7f;
  background: #fff;
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}

.sound-toggle:hover {
  color: #1558ed;
  background: #eef4ff;
}

.sound-toggle[aria-pressed='true'] {
  color: #1558ed;
  border-color: #c9dcff;
  background: #f5f9ff;
}
