:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #242b26;
  background: #f2f3ed;
  font-size: 16px;
  line-height: 1.5;
  --ink: #242b26;
  --green: #245c46;
  --muted: #56655a;
  --stroke: #d7ded2;
  --surface: #fffffa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
.top { background: #21382b; color: #f5faea; }
.top-inner {
  max-width: 1080px; margin: 0 auto; display: flex; align-items: center;
  gap: 1rem; padding: 1.6rem max(1.25rem, env(safe-area-inset-left));
}
.emblem {
  display: grid; place-items: center; flex: 0 0 2.8rem; height: 2.8rem;
  font-size: 1.65rem; font-weight: 750; color: #253b2d; background: #cbe8a8; border-radius: .65rem;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: -.025em; line-height: 1.2; }
.top-label { color: #c6d9bf; font-size: .82rem; }
.top-action { margin-left: auto; color: #f5faea !important; }
main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.deck { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.4fr); gap: 1rem; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: .9rem;
  padding: 1.2rem; box-shadow: 0 2px 6px #21382b0a; min-width: 0;
}
.gate { max-width: 31rem; margin: 1rem auto; }
.gate p { margin: .55rem 0 1.25rem; color: var(--muted); }
h2 { font-size: 1.22rem; letter-spacing: -.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 2.6rem; }
.settings, .controls, .history { margin-top: 1rem; }
.history summary { font-size: 1.05rem; font-weight: 650; cursor: pointer; }
.receipts { list-style: none; padding: 0; margin: .55rem 0 0; }
.receipts li { padding: .5rem 0; border-top: 1px solid var(--stroke); }
.receipts small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.settings p { margin-top: .35rem; }
button, .button, input, select {
  font: inherit; min-height: 2.85rem; border: 1px solid var(--stroke); border-radius: .55rem;
}
button, .button {
  background: var(--green); color: white; font-weight: 650; border-color: var(--green);
  padding: .5rem .85rem; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: .3rem; text-decoration: none; text-align: center;
}
button:disabled, button[aria-disabled=true] { opacity: .53; cursor: not-allowed; }
button:not(:disabled):hover, .button:hover { filter: brightness(.92); }
.quiet { color: var(--green); background: transparent; border-color: transparent; }
.secondary { background: #eaf3e4; border-color: #b7cdb5; color: #244c37; }
.danger { background: #fff0e9; border-color: #e7bfae; color: #8a382a; }
.danger-text { color: #8a382a; }
label, .field-title { display: block; font-size: .92rem; font-weight: 640; }
input, select {
  width: 100%; margin-top: .25rem; color: var(--ink); background: white; padding: .5rem .65rem;
}
:focus-visible { outline: 3px solid #669a61; outline-offset: 3px; }
.gate form button, #save-alias { margin-top: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 .45rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; line-height: 1.4; margin-top: .5rem; }
.job {
  width: 100%; text-align: left; justify-content: flex-start; display: block;
  background: white; color: var(--ink); border-color: var(--stroke); margin-top: .65rem;
  overflow-wrap: anywhere;
}
.job small { display: block; color: var(--muted); font-weight: 450; margin-top: .12rem; }
.job[aria-pressed=true] { background: #edf5e6; border-color: #7fa47b; }
.draft {
  font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow: auto;
  margin: .28rem 0 1rem; background: #f2f4ed; padding: .8rem; border: 1px solid var(--stroke); border-radius: .55rem;
}
.recipient { margin-top: .38rem; font-weight: 650; overflow-wrap: anywhere; }
#open-tg { margin-top: .7rem; }
.notice { padding: .75rem .9rem; margin-bottom: 1rem; border-radius: .6rem; color: #244c37; background: #e6f4d9; }
.notice[data-error=true] { color: #7a2c20; background: #ffebe3; }
.aliases { list-style: none; padding: 0; margin: .6rem 0; }
.aliases li {
  border-top: 1px solid var(--stroke); padding: .45rem 0; display: flex; justify-content: space-between;
  align-items: center; gap: .6rem; overflow-wrap: anywhere;
}
.form-grid { display: grid; grid-template-columns: .8fr 1fr 1.2fr; gap: .75rem; align-items: end; }
@media (max-width: 690px) {
  .deck, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .top-inner { gap: .65rem; padding-top: 1.05rem; padding-bottom: 1.05rem; }
  main { padding: .75rem .75rem max(2rem, env(safe-area-inset-bottom)); }
  .panel { padding: .95rem; }
  .actions button { flex: 1 1 10rem; }
  .top-action { padding-left: .35rem; padding-right: .35rem; }
}
