
:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #d0d5dd;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --bubble: #ffffff;
  --mine: #dbeafe;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  color: white;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
h1, h2, h3 { margin: 8px 0 12px; }
p { color: var(--muted); line-height: 1.4; }
input, button, textarea, select {
  width: 100%;
  padding: 12px;
  margin: 7px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 16px;
}
button, .btn {
  background: var(--blue);
  color: white;
  border: 0;
  text-align: center;
  text-decoration: none;
  display: block;
  font-weight: 650;
}
button:hover, .btn:hover { background: var(--blue-dark); }
.btn.secondary { background: #475467; }
.btn.green { background: var(--green); }
.list a {
  display: block;
  padding: 14px;
  margin: 8px 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}
.small { color: var(--muted); font-size: 13px; }
.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #fecaca;
}
.messages {
  height: 58vh;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}
.msg {
  background: var(--bubble);
  border: 1px solid #e5e7eb;
  margin: 8px 0;
  padding: 10px;
  border-radius: 14px;
  max-width: 92%;
}
.msg.mine {
  background: var(--mine);
  margin-left: auto;
}
.meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.photo {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.topbar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.topbar a {
  color: white;
  text-decoration: none;
  font-size: 14px;
}



.pin-hidden {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 1px;
  width: 1px;
}
.pin-display-wrap {
  max-width: 260px;
  position: relative;
  margin: 8px auto 10px;
}
.pin-display {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 6px;
  font-size: 20px;
  font-weight: 800;
  padding: 0 42px 0 14px;
  box-sizing: border-box;
  user-select: none;
}
.pin-eye {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-eye:active {
  background: #e2e8f0;
}
.pin-eye svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pin-pad {
  max-width: 260px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 10px auto;
}
.pin-pad button {
  border: 0;
  border-radius: 12px;
  height: 44px;
  padding: 0;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}
.pin-pad button.pin-clear,
.pin-pad button.pin-back {
  font-size: 14px;
  font-weight: 800;
}




.word-challenge {
  max-width: 460px;
  margin: 0 auto;
}

.word-target {
  text-align: center;
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 6px 0 14px 0;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.8vw, 10px);
  width: 100%;
}

.word-cell {
  min-width: 0;
  height: clamp(48px, 12vw, 64px);
  border: 1px solid #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: clamp(10px, 2.8vw, 15px);
  font-weight: 800;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 3px;
  line-height: 1.05;
}

.word-cell.selected {
  background: #dbeafe;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 2px #2563eb;
}

.word-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.word-actions button {
  height: 42px;
  margin-top: 0;
}

.word-progress {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
  min-height: 18px;
}

@media (max-height: 620px) {
  .word-target {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: clamp(20px, 5vw, 28px);
  }
  .word-cell {
    height: clamp(42px, 10vw, 54px);
  }
  .word-actions {
    margin-top: 8px;
  }
}

/* Authentication base visual styling */
:root {
  --bg: #090f1c;
  --panel: rgba(255,255,255,0.965);
  --text: #0b1220;
  --muted: #647084;
  --line: rgba(148,163,184,0.38);
  --blue: #1f5eff;
  --blue-dark: #174bd1;
  --green: #10b981;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(37,99,235,0.30), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(14,165,233,0.18), transparent 30%),
    linear-gradient(145deg, #07111f 0%, #0b1220 48%, #111827 100%);
  color: var(--text);
}

header {
  background: rgba(5, 12, 25, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  letter-spacing: 0.01em;
}

.wrap {
  width: min(100%, 760px);
  padding: clamp(16px, 4vw, 28px);
}

.card {
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.985), rgba(248,250,252,0.955));
  box-shadow:
    0 24px 70px rgba(2, 6, 23, 0.34),
    inset 0 1px 0 rgba(255,255,255,0.90);
}

.wrap > .card {
  max-width: 430px;
  margin: clamp(26px, 8vh, 70px) auto 0;
  padding: clamp(18px, 4vw, 26px);
}

h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
  margin-top: 0;
}

label {
  display: block;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  margin: 14px 0 5px;
}

p {
  margin-top: 0;
}

input, textarea, select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow:
    0 0 0 4px rgba(59,130,246,0.18),
    inset 0 1px 2px rgba(15,23,42,0.04);
}

button, .btn {
  border-radius: 14px;
  background: linear-gradient(180deg, #2f6dff, #1f5eff);
  box-shadow:
    0 12px 24px rgba(37,99,235,0.22),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

button:hover, .btn:hover {
  background: linear-gradient(180deg, #2b63e8, #174bd1);
}

button:active, .btn:active {
  transform: translateY(1px);
}

.error {
  border-radius: 14px;
  font-weight: 700;
}

.small a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.pin-display-wrap {
  max-width: 280px;
}

.pin-display {
  min-height: 44px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  border-color: #b8c4d4;
  box-shadow: inset 0 1px 3px rgba(15,23,42,0.08);
}

.pin-pad {
  max-width: 280px;
  gap: 8px;
}

.pin-pad button {
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc, #dbe3ef);
  border: 1px solid #cbd5e1;
  color: #0f172a;
  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
}

.pin-pad button:hover {
  background: linear-gradient(180deg, #ffffff, #cfd9e8);
}

.pin-pad button.pin-clear,
.pin-pad button.pin-back {
  background: linear-gradient(180deg, #eef2f7, #d6deeb);
}

.word-challenge {
  max-width: 520px;
}

.word-target {
  color: #0f172a;
  font-size: clamp(24px, 6vw, 36px);
  margin-bottom: 18px;
}

.word-grid {
  gap: clamp(7px, 2vw, 11px);
}

.word-cell {
  border-radius: 12px;
  border: 1px solid #b6c3d4;
  background: linear-gradient(180deg, #ffffff, #eef3f9);
  box-shadow: 0 7px 14px rgba(15,23,42,0.08);
}

.word-cell:hover {
  background: linear-gradient(180deg, #ffffff, #e1e9f4);
}

.word-cell.selected {
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  border-color: #2563eb;
  box-shadow:
    inset 0 0 0 2px #2563eb,
    0 8px 18px rgba(37,99,235,0.18);
}

.word-actions button.secondary,
button.secondary {
  background: linear-gradient(180deg, #64748b, #475569);
  box-shadow: 0 10px 20px rgba(71,85,105,0.20);
}

.word-actions button {
  border-radius: 14px;
}

@media (max-width: 520px) {
  header {
    padding: 12px 14px;
    font-size: 16px;
  }

  .wrap {
    padding: 14px;
  }

  .wrap > .card {
    margin-top: 18px;
    border-radius: 20px;
  }
}


/* Authentication mobile-first visual styling */
:root {
  --bg: #050914;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: rgba(148,163,184,0.20);
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --green: #22c55e;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(59,130,246,0.26), transparent 34%),
    radial-gradient(circle at 18% 76%, rgba(14,165,233,0.12), transparent 30%),
    linear-gradient(180deg, #050914 0%, #07111f 50%, #020617 100%);
  color: var(--text);
}

header {
  min-height: 48px;
  padding: 14px 18px;
  background: rgba(2,6,23,0.86);
  border-bottom: 1px solid rgba(148,163,184,0.12);
  box-shadow: none;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.wrap {
  width: min(100%, 520px);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card,
.wrap > .card,
.word-challenge {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 26px;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow:
    0 26px 80px rgba(0,0,0,0.46),
    inset 0 1px 0 rgba(255,255,255,0.055);
  color: #e5e7eb;
}

.wrap > .card + .card {
  margin-top: 16px;
}

h1, h2, h3 {
  color: #f8fafc;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 24px;
  line-height: 1.05;
  margin: 0 0 12px;
}

p {
  color: #a8b3c5;
  font-size: 14px;
}

label {
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

input, textarea, select {
  color: #f8fafc;
  background: rgba(2,6,23,0.42);
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 16px;
  box-shadow: none;
}

input::placeholder {
  color: #64748b;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(96,165,250,0.80);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.16);
}

button, .btn {
  border-radius: 16px;
  background: #2563eb;
  color: #ffffff;
  box-shadow: none;
  min-height: 46px;
  font-weight: 850;
}

button:hover, .btn:hover {
  background: #1d4ed8;
}

button:active, .btn:active {
  transform: translateY(1px);
}

.btn.green,
.list a,
a.btn.green {
  background: #16a34a;
  color: #ffffff;
}

.list a {
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}

.small {
  color: #94a3b8;
}

.small a {
  color: #93c5fd;
}

.error {
  background: rgba(127,29,29,0.50);
  color: #fecaca;
  border: 1px solid rgba(248,113,113,0.34);
  border-radius: 16px;
}

.card[style] {
  background: rgba(2,6,23,0.38) !important;
  border: 1px solid rgba(148,163,184,0.22) !important;
  box-shadow: none !important;
}

.card[style] .small {
  color: #94a3b8;
}

.card[style] h2 {
  color: #f8fafc;
  font-size: 22px;
}

.pin-display-wrap {
  max-width: 292px;
}

.pin-display {
  min-height: 46px;
  color: #f8fafc;
  background: rgba(2,6,23,0.42);
  border: 1px solid rgba(148,163,184,0.30);
  border-radius: 16px;
  box-shadow: none;
}

.pin-eye {
  color: #94a3b8;
}

.pin-eye:active {
  background: rgba(148,163,184,0.14);
}

.pin-pad {
  max-width: 292px;
  gap: 9px;
}

.pin-pad button {
  height: 52px;
  border-radius: 16px;
  background: rgba(30,41,59,0.88);
  border: 1px solid rgba(148,163,184,0.18);
  color: #f8fafc;
  box-shadow: none;
}

.pin-pad button:hover {
  background: rgba(51,65,85,0.96);
}

.pin-pad button.pin-clear,
.pin-pad button.pin-back {
  color: #cbd5e1;
  background: rgba(15,23,42,0.92);
}

.word-challenge {
  max-width: 430px;
}

.word-target {
  color: #f8fafc;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1;
  margin: 0 0 20px;
}

.word-grid {
  gap: 9px;
}

.word-cell {
  height: clamp(48px, 12vw, 58px);
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(30,41,59,0.86);
  color: #f8fafc;
  box-shadow: none;
  font-size: clamp(11px, 2.8vw, 14px);
  font-weight: 800;
}

.word-cell:hover {
  background: rgba(51,65,85,0.96);
}

.word-cell.selected {
  background: rgba(37,99,235,0.95);
  border-color: rgba(147,197,253,0.95);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.22);
}

.word-progress {
  color: #94a3b8;
}

.word-actions {
  gap: 9px;
}

.word-actions button.secondary,
button.secondary {
  background: rgba(71,85,105,0.95);
  color: #f8fafc;
  box-shadow: none;
}

@media (min-width: 720px) {
  .wrap {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  body {
    background:
      radial-gradient(circle at 50% -10%, rgba(59,130,246,0.20), transparent 38%),
      linear-gradient(180deg, #050914 0%, #07111f 54%, #020617 100%);
  }

  header {
    min-height: 46px;
    padding: 13px 15px;
  }

  .wrap {
    min-height: calc(100vh - 46px);
    padding: 14px;
  }

  .card,
  .wrap > .card,
  .word-challenge {
    max-width: none;
    padding: 20px;
    border-radius: 24px;
  }

  .word-grid {
    gap: 8px;
  }

  .word-cell {
    height: 52px;
  }
}


/* Minimal authentication screen styling */
.auth-minimal-card {
  padding-top: 22px;
}

.auth-minimal-card input[name="user_code"] {
  margin-top: 0;
}

.site-seal-minimal {
  color: #f8fafc;
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 18px;
}

button,
.pin-pad button,
.word-cell,
.pin-eye {
  -webkit-tap-highlight-color: transparent;
}

button:focus,
button:focus-visible,
.pin-pad button:focus,
.pin-pad button:focus-visible,
.word-cell:focus,
.word-cell:focus-visible,
.pin-eye:focus,
.pin-eye:focus-visible {
  outline: none !important;
}

.pin-pad button:focus,
.pin-pad button:focus-visible,
.word-cell:focus,
.word-cell:focus-visible {
  box-shadow: none !important;
}

.pin-pad button:hover,
.word-cell:hover {
  filter: none;
}

.pin-pad button:active,
.word-cell:active,
.word-cell.tap-ack {
  transform: scale(0.985);
}

.word-target {
  font-size: clamp(30px, 9vw, 42px);
  margin-bottom: 22px;
}

.word-progress {
  display: none !important;
}

.word-cell.selected {
  background: rgba(30,41,59,0.86);
  border-color: rgba(148,163,184,0.22);
  color: #f8fafc;
  box-shadow: none;
}

#submitWords:disabled {
  opacity: 1;
  background: #2563eb;
  color: #ffffff;
}

@media (hover: none) {
  .pin-pad button:hover {
    background: rgba(30,41,59,0.88);
  }

  .word-cell:hover {
    background: rgba(30,41,59,0.86);
  }
}


/* Authentication tap/focus residue suppression */
.site-seal-minimal {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

button,
.pin-pad button,
.word-cell,
.pin-eye {
  outline: 0 !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

button:focus,
button:focus-visible,
button:focus-within,
.pin-pad button:focus,
.pin-pad button:focus-visible,
.pin-pad button:focus-within,
.word-cell:focus,
.word-cell:focus-visible,
.word-cell:focus-within,
.pin-eye:focus,
.pin-eye:focus-visible,
.pin-eye:focus-within {
  outline: 0 !important;
  box-shadow: none !important;
}

.pin-pad button:focus,
.pin-pad button:focus-visible {
  background: rgba(30,41,59,0.88) !important;
  border-color: rgba(148,163,184,0.18) !important;
  color: #f8fafc !important;
}

.word-cell:focus,
.word-cell:focus-visible {
  background: rgba(30,41,59,0.86) !important;
  border-color: rgba(148,163,184,0.22) !important;
  color: #f8fafc !important;
}

.pin-pad button.pin-clear:focus,
.pin-pad button.pin-back:focus,
.pin-pad button.pin-clear:focus-visible,
.pin-pad button.pin-back:focus-visible {
  background: rgba(15,23,42,0.92) !important;
}

.word-cell.tap-ack {
  background: rgba(37,99,235,0.55) !important;
  border-color: rgba(147,197,253,0.45) !important;
  box-shadow: none !important;
}




/* V11.5 PATCH 1: pin-eye fixed-position override */
.pin-eye {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 4px !important;
  position: absolute !important;
  right: 7px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  box-shadow: none !important;
}
.pin-eye:active,
.pin-eye:focus,
.pin-eye:focus-visible {
  transform: translateY(-50%) !important;
  box-shadow: none !important;
  outline: none !important;
}


/* pin eye geometry */
.pin-eye {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 4px !important;
  position: absolute !important;
  right: 7px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  box-shadow: none !important;
}
.pin-eye:active,
.pin-eye:focus,
.pin-eye:focus-visible {
  transform: translateY(-50%) !important;
  box-shadow: none !important;
  outline: none !important;
}


.esp-hidden-input{display:none !important;}
