:root {
  color-scheme: light;
  --bg: #f4f0e7;
  --surface: #fffaf2;
  --panel: #fbf7ef;
  --panel2: #edf3eb;
  --text: #26362e;
  --muted: #66736b;
  --line: #d7d8cf;
  --line-strong: #c8cec4;
  --action: #426957;
  --action-strong: #315846;
  --on-action: #ffffff;
  --accent: #557964;
  --technical: #5f6f92;
  --reference: #53678a;
  --success: #3f7657;
  --shadow: rgba(25, 43, 34, 0.08);
  --focus-glow: rgba(95, 111, 146, 0.16);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101914;
  --surface: #17231d;
  --panel: #1b2922;
  --panel2: #22332a;
  --text: #edf3ed;
  --muted: #a4b3a9;
  --line: #31453a;
  --line-strong: #465d51;
  --action: #356f57;
  --action-strong: #427d64;
  --on-action: #f7fbf8;
  --accent: #94b49f;
  --technical: #9aa9d1;
  --reference: #a6b7d7;
  --success: #75a88a;
  --shadow: rgba(0, 0, 0, 0.18);
  --focus-glow: rgba(154, 169, 209, 0.18);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 6%, color-mix(in srgb, var(--action) 8%, transparent), transparent 32%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}

button, input { font: inherit; }

.appbar {
  min-height: 86px;
  padding: 18px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--shadow) 42%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.brandMark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  background: var(--action);
  display: grid;
  place-items: center;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--shadow) 82%, transparent);
}

.brandMark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--on-action);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brandLine {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
}

.brandLine strong {
  font-size: 23px;
  letter-spacing: -0.7px;
  color: var(--action);
}

.version {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--panel2);
}

.brandLockup p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.brandLockup .tagline { opacity: 0.82; }

.themeToggle {
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 38%, transparent);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.themeToggle .themeIcon {
  font-size: 17px;
  line-height: 1;
  color: var(--technical);
}

.themeToggle .themeText {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1px;
  color: var(--muted);
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 88px) 0 38px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  gap: clamp(34px, 7vw, 92px);
  align-items: start;
}

.intro { padding-top: 24px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.55px;
  opacity: 0.88;
}

.accent { color: var(--accent); }

h1 {
  margin: 0;
  max-width: 640px;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -3.2px;
  font-weight: 720;
}

.lead {
  max-width: 530px;
  color: var(--muted);
  font-size: 16px;
  margin: 25px 0 0;
}

.continuity {
  margin-top: 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  opacity: 0.90;
}

.continuity span {
  background: color-mix(in srgb, var(--panel2) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 999px;
  padding: 7px 10px;
}

.continuity b { color: var(--accent); }

.transferCard {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 34px);
  box-shadow:
    0 12px 32px var(--shadow),
    0 1px 0 color-mix(in srgb, var(--surface) 72%, white 28%) inset;
}

.cardIcon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--panel2);
  color: var(--accent);
  font-size: 23px;
  margin-bottom: 17px;
}

h2 {
  margin: 0 0 5px;
  font-size: 25px;
  letter-spacing: -0.7px;
  line-height: 1.2;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 20px;
}

input {
  width: 100%;
  margin: 8px 0 16px;
  padding: 17px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  font: 30px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  letter-spacing: 11px;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.55;
  font-size: 23px;
  letter-spacing: 8px;
}

button {
  border: 0;
  border-radius: 13px;
  min-height: 50px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

button:active { transform: scale(0.99); }
button:disabled { opacity: 0.46; cursor: not-allowed; }

button:focus-visible,
input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--technical) 74%, transparent);
  outline-offset: 3px;
}

input:focus-visible {
  border-color: color-mix(in srgb, var(--technical) 72%, var(--line-strong));
  box-shadow: 0 0 0 5px var(--focus-glow);
  background: var(--surface);
}

.primary {
  width: 100%;
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--action) 18%, transparent);
}

.primary:hover { background: var(--action-strong); }

.secondary {
  width: 100%;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  margin-top: 11px;
}

.successTitle {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 20px;
}

.successDot {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--success);
  color: var(--on-action);
  display: grid;
  place-items: center;
  font-weight: 900;
}

#note {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow-wrap: anywhere;
  font: 14px/1.72 inherit;
  max-height: 470px;
  overflow: auto;
}

#note h3,
#note h4 {
  color: var(--accent);
  line-height: 1.35;
  margin: 20px 0 7px;
}

#note .note-diagnosis { color: #a64c54; }
:root[data-theme="dark"] #note .note-diagnosis { color: #e38a91; }
#note .note-investigation { color: var(--reference); }

#note h3:first-child,
#note h4:first-child { margin-top: 0; }

#note h3 { font-size: 18px; }
#note h4 { font-size: 15px; }
#note p { margin: 0 0 9px; color: var(--text); }
#note ul, #note ol { margin: 0 0 11px; padding-left: 23px; }
#note strong { color: var(--text); }

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--muted);
  font-size: 10px;
  opacity: 0.76;
}

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .appbar { position: static; padding: 15px 18px; }
  .themeToggle {
    min-width: 42px;
    min-height: 40px;
    padding: 8px 10px;
    justify-content: center;
  }
  .themeToggle .themeText {
    font-size: 10px;
  }
  main {
    width: min(620px, calc(100% - 28px));
    grid-template-columns: 1fr;
    padding-top: 34px;
    gap: 28px;
  }
  .intro { padding-top: 0; }
  h1 { font-size: clamp(42px, 12vw, 62px); }
  .lead { margin-top: 18px; }
  footer { width: min(620px, calc(100% - 28px)); }
}

@media (max-width: 460px) {
  .version { display: none; }
  .themeToggle .themeText { display: none; }
  .brandLockup .tagline { display: none; }
  .transferCard { border-radius: 20px; padding: 22px 18px; }
  input { letter-spacing: 8px; }
}

:root[data-theme="dark"] .transferCard {
  box-shadow:
    0 14px 30px var(--shadow),
    0 1px 0 color-mix(in srgb, var(--line-strong) 38%, transparent) inset;
}
