:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17261e;
  background: #f5f7f2;
  font-synthesis: none;
  --muted: #4e6056;
  --line: #d9e1d8;
  --accent: #24563d;
  --focus: #347653;
  --error: #92392d;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; min-width: 0; line-height: 1.55; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

::selection { color: #173d2a; background: #d7e9da; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.frame { width: min(calc(100% - 48px), 990px); margin-inline: auto; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar-content {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 680;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #e1f1e4;
  background: #204734;
}

.brand-mark::before, .brand-mark::after {
  position: absolute;
  content: "";
  border: 1.5px solid currentColor;
}

.brand-mark::before { width: 8px; height: 7px; top: 7px; border-radius: 5px 5px 0 0; }
.brand-mark::after { width: 13px; height: 10px; top: 13px; border-radius: 2px; }

.language, .paste-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  background: #fff;
  font-size: .875rem;
  font-weight: 650;
}

.language:hover, .paste-button:hover { background: #ecf4ed; }
.language:active, .paste-button:active { background: #dcebe0; }
.language { display: inline-flex; align-items: center; text-decoration: none; }

.intro { padding: 56px 0 28px; }

.intro h1 {
  margin: 0 0 8px;
  font-size: 2.625rem;
  line-height: 1.19;
  font-weight: 720;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.intro p, .help-intro p { margin: 0; color: var(--muted); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.key-panel, .code-panel {
  min-width: 0;
  min-height: 258px;
  padding: 24px 26px;
  border-radius: 14px;
}

.key-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: #fff;
}

.key-panel label { font-weight: 690; }
.field-help { margin: 4px 0 15px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }

.input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px;
  border: 1px solid #aabaae;
  border-radius: 9px;
  background: #f8faf7;
}

.input-row:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px #dcebe0; }
.input-row:has(input[aria-invalid="true"]) { border-color: var(--error); }

.input-row input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0 7px;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  caret-color: var(--accent);
  font-family: var(--mono);
}

.input-row input::placeholder { color: #5b6f62; font-family: system-ui, sans-serif; }
.paste-button { flex-shrink: 0; }

.secret-actions { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 4px; }

.text-button {
  min-height: 36px;
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-size: .875rem;
  font-weight: 650;
}

.text-button:hover { text-decoration: underline; text-underline-offset: .2em; }

.secret-status {
  margin: 4px 0 0;
  color: var(--error);
  font-size: .875rem;
}

.secret-status:empty { margin: 0; }

.key-footer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: .875rem;
}

.local-mark {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 2px solid #4e795b;
  border-radius: 50%;
}

.code-panel {
  display: flex;
  flex-direction: column;
  color: #f0f7ef;
  background: #192f26;
  --focus: #b1dbb8;
}

.code-header { display: flex; align-items: center; gap: 12px; justify-content: space-between; }

.code-header h2 { margin: 0; font-size: 1rem; font-weight: 660; }

#countdown {
  min-width: 3.25ch;
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  color: #c0d6c3;
  font-size: .9rem;
}

.code-panel[data-expiring="true"] #countdown { color: #f9d9a0; }

.account {
  overflow-wrap: anywhere;
  margin: 8px 0 0;
  color: #c0d6c3;
  font-size: .875rem;
}

.code-display {
  display: grid;
  min-height: 72px;
  align-content: center;
  padding-block: 7px;
  flex: 1;
}

#otp-code {
  justify-self: start;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #f0f7ef;
  background: transparent;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 3.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  line-height: 1.15;
}

#otp-code:disabled { color: #a3b6a9; }
#otp-code:not(:disabled):hover { color: #bfe4c4; }
#otp-code[data-digits="8"] { font-size: 2.65rem; }
.code-hint { margin-top: 2px; color: #c0d6c3; font-size: .875rem; }

#time-progress {
  display: block;
  width: 100%;
  height: 4px;
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #3c594a;
  color: #b1dbb8;
}
#time-progress::-webkit-progress-bar { background: #3c594a; }
#time-progress::-webkit-progress-value { background: #b1dbb8; }
#time-progress::-moz-progress-bar { background: #b1dbb8; }
.code-panel[data-expiring="true"] #time-progress::-webkit-progress-value { background: #f9d9a0; }
.code-panel[data-expiring="true"] #time-progress::-moz-progress-bar { background: #f9d9a0; }

.copy-button {
  display: flex;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 17px;
  padding: 7px 12px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #162f23;
  background: #bfe4c4;
  font-weight: 690;
}

.copy-button:not(:disabled):hover { background: #d5efd7; }
.copy-button:not(:disabled):active { background: #9acaa2; }
.copy-button:disabled { border-color: #476456; color: #b6cabb; background: #233e32; }
.copy-status:not(.sr-only) { margin: 10px 0 0; color: #f9d9a0; font-size: .875rem; }

.copy-mark { position: relative; width: 16px; height: 16px; flex: 0 0 16px; }
.copy-mark::before, .copy-mark::after {
  position: absolute;
  width: 10px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  content: "";
}
.copy-mark::before { inset: 0 auto auto 1px; }
.copy-mark::after { inset: 4px auto auto 5px; background: #bfe4c4; }
.copy-button:disabled .copy-mark::after { background: #233e32; }
.copy-button:not(:disabled):hover .copy-mark::after { background: #d5efd7; }
.copy-button:not(:disabled):active .copy-mark::after { background: #9acaa2; }

.help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 24px;
  align-items: start;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 23px;
}

.help-intro h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 700; }
.help-intro p, .answer { font-size: .875rem; }
.questions details { border-bottom: 1px solid var(--line); }
.questions details:first-child { margin-top: -4px; }

.questions summary {
  display: flex;
  min-height: 49px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-block: 9px;
  cursor: pointer;
  list-style: none;
  font-size: .9375rem;
  font-weight: 660;
}

.questions summary::-webkit-details-marker { display: none; }
.questions summary:hover { color: var(--accent); }
.questions summary::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin-right: 4px;
  border: solid #53705d;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}

.questions details[open] summary::after { transform: translateY(2px) rotate(225deg); }

.answer { padding: 0 8px 15px 0; color: var(--muted); }
.answer p { margin: 0; max-width: 70ch; overflow-wrap: anywhere; }
.answer a { color: var(--accent); text-underline-offset: .2em; }
.answer p + p { margin-top: 6px; }
.answer code + p { margin-top: 7px; }

.answer code {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  background: #fff;
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 35px 0 26px;
  font-size: .875rem;
  color: var(--muted);
}
.footer a { color: var(--accent); text-underline-offset: .2em; }

@media (max-width: 720px) {
  .frame { width: min(calc(100% - 36px), 500px); }
  .topbar-content { min-height: 60px; }
  .intro { padding: 35px 0 21px; }
  .intro h1 { font-size: 1.9rem; }
  .workspace, .help { grid-template-columns: minmax(0, 1fr); }
  .workspace { gap: 11px; }
  .key-panel, .code-panel { padding: 17px 19px; min-height: auto; }
  .key-footer { padding-top: 10px; }
  .code-display { min-height: 66px; }
  #otp-code { font-size: 2.7rem; }
  #otp-code[data-digits="8"] { font-size: 2.3rem; }
  .help { margin-top: 25px; gap: 8px; padding-top: 17px; }
  .footer { margin-top: 24px; }
}

@media (max-width: 340px) {
  .frame { width: calc(100% - 26px); }
  #otp-code[data-digits="8"] { font-size: 2rem; }
}
