:root {
  --ink: #1f2a33;
  --muted: #5c6870;
  --paper: #f6f5f1;
  --card: #ffffff;
  --accent: #1b5e4a;
  --accent-dark: #14493a;
  --accent-soft: #e3efe9;
  --error: #a4302f;
  --rule: #d8d5cc;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px;
}
.ui { font-family: Verdana, Geneva, sans-serif; }
.card {
  background: var(--card); border: 1px solid var(--rule); border-top: 6px solid var(--accent);
  max-width: 440px; width: 100%; padding: 32px 28px;
  box-shadow: 0 2px 10px rgba(31, 42, 51, .07);
}
h1 { font-size: 1.35rem; margin: 0 0 4px; }
.sub { font-size: .8rem; color: var(--muted); margin: 0 0 24px; }
label { display: block; font-size: .8rem; font-weight: bold; margin: 16px 0 6px; }
input {
  width: 100%; padding: 12px;
  font-size: 16px; /* 16px or more stops iPhone Safari zooming in on focus */
  font-family: 'Courier New', monospace; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: 4px; background: #fbfaf7; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
button {
  margin-top: 22px; width: 100%; padding: 13px;
  background: var(--accent); color: #fff; border: none; border-radius: 4px;
  font-size: .95rem; cursor: pointer; font-family: inherit;
}
button:hover { background: var(--accent-dark); }
button:disabled { opacity: .6; cursor: wait; }
.msg { margin: 16px 0 0; font-size: .85rem; line-height: 1.45; min-height: 1em; }
.msg.error { color: var(--error); }
.hint { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--rule);
        font-size: .75rem; color: var(--muted); line-height: 1.5; }
.hidden { display: none !important; }

.report-btn {
  margin-top: 10px; text-align: left; background: var(--accent-soft); color: var(--ink);
  border: 1px solid var(--rule); padding: 14px;
}
.report-btn:hover { background: #d3e6dd; }
.report-btn .term { font-weight: bold; display: block; }
.report-btn .fname { display: block; margin-top: 3px; font-size: .75rem; color: var(--muted); word-break: break-word; }
.linklike { background: none; color: var(--accent); text-decoration: underline; padding: 6px 0; width: auto; font-size: .8rem; }
.linklike:hover { background: none; color: var(--accent-dark); }

#viewer { max-width: 900px; width: 100%; }
.viewer-bar {
  background: var(--accent-soft); border: 1px solid var(--rule);
  padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between; font-size: .85rem;
}
.viewer-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.small {
  width: auto; margin: 0; padding: 9px 16px; font-size: .8rem; display: inline-block;
  background: var(--accent); color: #fff; text-decoration: none; border-radius: 4px; border: none; cursor: pointer;
}
.small.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
#pdfStatus { font-size: .85rem; margin: 12px 0 0; }
#pdfPages { margin-top: 10px; }
#pdfPages canvas {
  display: block; width: 100%; height: auto; background: #fff;
  border: 1px solid var(--rule); margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(31, 42, 51, .08);
}
