:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #182235;
  --muted: #667085;
  --line: #e2e8f0;
  --primary: #315bd6;
  --primary-dark: #2447b3;
  --soft-blue: #edf3ff;
  --soft-green: #e9f8ef;
  --shadow: 0 12px 32px rgba(28, 45, 80, .06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #e8efff 0, transparent 35rem), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
.app { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 28px; }
.hero { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.brand-mark { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; background: #dfe8ff; font-size: 32px; flex: 0 0 auto; }
.eyebrow, .section-kicker { margin: 0 0 5px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--primary); }
h1 { margin: 0; font-size: clamp(28px, 5vw, 39px); letter-spacing: -.04em; line-height: 1.15; }
.subtitle { margin: 7px 0 0; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid rgba(222, 230, 241, .9); border-radius: 22px; padding: clamp(18px, 4vw, 28px); margin: 16px 0; box-shadow: var(--shadow); }
.status-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h2 { font-size: 21px; letter-spacing: -.025em; margin: 0 0 7px; }
h3 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 11px; white-space: nowrap; font-size: 12px; font-weight: 700; color: #237448; background: var(--soft-green); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2caa63; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.button { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: #eef1f6; color: #344054; }
.button-quiet { background: transparent; color: var(--muted); padding: 8px 10px; }
.button-quiet:hover { background: #f3f5f9; }
.finger-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 20px 0; }
.finger-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 15px; padding: 13px 4px 11px; color: #475467; font-size: 12px; font-weight: 650; cursor: pointer; user-select: none; }
.finger-option:has(input:checked) { background: var(--soft-blue); border-color: #91adff; color: #2349b5; box-shadow: inset 0 0 0 1px #91adff; }
.finger-option input { position: absolute; top: 8px; right: 8px; accent-color: var(--primary); }
.finger-emoji { font-size: 25px; min-height: 31px; }
.field-label { display: block; font-size: 13px; font-weight: 750; margin: 16px 0 7px; }
.input-row { display: flex; gap: 9px; }
input[type="text"], input:not([type]) { min-width: 0; flex: 1; border: 1px solid #d0d8e5; border-radius: 12px; padding: 12px 13px; outline: none; }
#phraseInput { min-width: 0; flex: 1; border: 1px solid #d0d8e5; border-radius: 12px; padding: 12px 13px; outline: none; }
#phraseInput:focus { border-color: #7292f3; box-shadow: 0 0 0 3px #e9efff; }
.form-message { min-height: 21px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.form-message.error { color: #b42318; }
.form-message.success { color: #16804a; }
.saved-heading { display: flex; align-items: center; gap: 9px; margin-top: 23px; }
.count-badge { display: inline-grid; place-items: center; min-width: 25px; height: 25px; border-radius: 99px; background: #eef2f8; color: #475467; font-size: 12px; font-weight: 800; }
.saved-list { display: grid; gap: 8px; margin-top: 12px; }
.empty-state { border: 1px dashed #d6deea; border-radius: 13px; padding: 17px; color: var(--muted); font-size: 13px; text-align: center; }
.saved-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px; }
.saved-item strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.saved-item small { display: block; color: var(--muted); margin-top: 3px; }
.delete-button { border: 0; border-radius: 9px; background: #fff0ef; color: #b42318; font-weight: 700; padding: 8px 10px; cursor: pointer; }
.simulator-grid { margin-top: 15px; }
.result-card { display: flex; gap: 14px; align-items: center; padding: 17px; background: #f7f9fd; border: 1px solid #e6ebf4; border-radius: 16px; }
.result-icon { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; background: #e6edff; font-size: 23px; }
.detected-phrase { font-size: 18px; font-weight: 800; margin: 2px 0 4px; overflow-wrap: anywhere; }
.code-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.action-row { display: flex; gap: 9px; margin-top: 13px; flex-wrap: wrap; }
footer { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: #8792a5; font-size: 11px; padding: 14px 4px; }
@media (max-width: 560px) {
  .app { width: min(100% - 20px, 920px); padding-top: 22px; }
  .hero { align-items: flex-start; gap: 12px; }
  .brand-mark { width: 52px; height: 52px; border-radius: 15px; font-size: 26px; }
  .eyebrow { font-size: 9px; }
  .status-panel { flex-direction: column; }
  .finger-grid { gap: 5px; }
  .finger-option { font-size: 10px; padding: 15px 2px 9px; border-radius: 11px; }
  .finger-option input { top: 5px; right: 5px; }
  .finger-emoji { font-size: 21px; }
  .input-row { flex-direction: column; }
  .input-row .button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .panel { border-radius: 17px; }
  footer { flex-direction: column; }
}
