/* SPDX-License-Identifier: AGPL-3.0-or-later */
:root { --bg: #fafafa; --fg: #1b1b1b; --muted: #666; --line: #d6d6d6; --accent: #2457a6; --lock: #fff1c2; --warn: #fff4e0; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181b; --fg: #e6e6e6; --muted: #9a9a9a; --line: #3a3d42; --accent: #7aa7ff; --lock: #4a3f17; --warn: #3a2f1c; }
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 980px; padding: 1rem; font: 16px/1.45 system-ui, sans-serif; background: var(--bg); color: var(--fg); }
h1 { margin: .2rem 0; font-size: 1.6rem; }
.sub, .muted, .info { color: var(--muted); }
.info { font-weight: normal; font-size: .85rem; }
.lbl { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
textarea, pre { width: 100%; font: 15px/1.4 ui-monospace, Menlo, Consolas, monospace; background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: .6rem; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; min-height: 3rem; }
.controls { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: .5rem; }
button { font: inherit; padding: .4rem .9rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 4px; cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
select { font: inherit; }
#status { color: var(--muted); font-size: .9rem; }
.note { background: var(--warn); border: 1px solid var(--line); padding: .5rem .7rem; border-radius: 4px; margin-top: 1rem; }
.keygrid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.cell { border: 1px solid var(--line); border-radius: 4px; text-align: center; padding: 2px 0 4px; }
.cell .c { font: 600 13px ui-monospace, monospace; color: var(--muted); }
.cell input[type=text] { width: 2em; text-align: center; font: 600 16px ui-monospace, monospace; text-transform: uppercase; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--fg); }
.cell.locked { background: var(--lock); }
.cell.absent { opacity: .45; }
.cell label { display: block; font-size: 11px; color: var(--muted); }
.keystrings { margin-top: .6rem; font-size: .9rem; }
.keystrings code { font: 14px ui-monospace, monospace; letter-spacing: .15em; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: .3rem .4rem; vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.sel { background: rgba(127,127,127,.12); }
td.pt { font-family: ui-monospace, monospace; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { margin-top: 2rem; font-size: .85rem; color: var(--muted); }
footer a { color: var(--accent); }
@media (max-width: 640px) { .keygrid { grid-template-columns: repeat(7, 1fr); } td.pt { max-width: 160px; } }
#vigKey, #crib { font: 16px ui-monospace, monospace; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--fg); text-transform: uppercase; }
#rkLocks { margin: .2rem 0; padding-left: 1.2rem; }
#rkLocks button, #cribTable button { padding: .1rem .5rem; font-size: .8rem; }
#cribTable tbody tr { cursor: default; }
select { max-width: 100%; }
.keystrings > div:not(.muted) { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre; }
.words { font: 15px/1.6 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: 4px; padding: .4rem .6rem; margin-bottom: .3rem; word-break: break-word; }
.words .w { cursor: pointer; border-radius: 3px; }
.words .w:hover { background: var(--lock); }
.controls.examples { margin: 0 0 .5rem; }
#exInfo { margin: 0 0 .6rem; }
#exInfo p { margin: .2rem 0; }
#exDetails summary { cursor: pointer; color: var(--muted); }
#exNote { white-space: pre-wrap; }
