:root {
  color-scheme: dark;
  --bg: #17171b;
  --panel: #1c1c21;
  --line: #36353d;
  --text: #e8e5ed;
  --muted: #aaa5b2;
  --purple: #9e48c1;
  --link: #cb8fe4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button {
  background: var(--purple);
  color: white;
  border: 1px solid transparent;
  padding: 11px 19px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 650;
  min-height: 44px;
}
button:hover {
  filter: brightness(1.12);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
button.quiet {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}
a {
  color: var(--link);
  text-underline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-weight: 500;
  font-size: 42px;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 14px;
}
h2 {
  font-size: 22px;
  font-weight: 500;
}
h3 {
  font-size: 17px;
  font-weight: 500;
}
small,
.muted {
  color: var(--muted);
}
.mono,
.eyebrow,
.metadata {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.eyebrow {
  margin-bottom: 22px;
  text-transform: uppercase;
}
.skip {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100;
  background: var(--bg);
  padding: 12px;
}
.skip:focus {
  top: 0;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  background: #131317;
  border-right: 1px solid var(--line);
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  padding: 0 14px 25px;
  color: #ddd6e5;
  font-size: 12px;
  letter-spacing: 0.24em;
  line-height: 1.7;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.16em;
  margin-top: 9px;
}
.brand .seal {
  color: var(--link);
  font-size: 26px;
  display: block;
  margin-bottom: 14px;
}
nav {
  overflow: auto;
  flex: 1;
}
nav a {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
  min-height: 38px;
}
nav a:hover {
  background: #212026;
  color: var(--text);
}
nav a.active {
  color: #eee2f4;
  border-color: var(--purple);
  background: #9e48c112;
}
nav .icon {
  font:
    10px ui-monospace,
    monospace;
  min-width: 22px;
  color: #92829c;
}
.account {
  border-top: 1px solid var(--line);
  padding: 18px 12px 0;
  margin-top: 20px;
}
.account .username {
  font-size: 13px;
  display: block;
}
.account .role {
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 0.12em;
  color: var(--link);
}
.account .actions {
  gap: 0;
  margin: 10px -12px 0;
  flex-wrap: wrap;
}
.collapsed aside {
  width: 76px;
  padding-inline: 8px;
}
.collapsed .nav-label,
.collapsed .brand-text,
.collapsed .account .username,
.collapsed .account .role {
  display: none;
}
.collapsed .brand {
  padding-inline: 10px;
}
.collapsed .brand .seal {
  margin: 0;
}
.collapsed .account {
  padding: 12px 0;
}
.collapsed .account .actions {
  margin: 0;
  justify-content: center;
}
.collapsed main {
  margin-left: 76px;
}
.collapsed nav a {
  padding: 9px;
}
.collapsed .account button {
  font-size: 8px;
  padding: 5px;
}
main {
  margin-left: 224px;
  min-height: 100vh;
  padding: 38px 6vw 80px;
}
.topline {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 54px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 38px;
}
.page-head p {
  color: var(--muted);
  max-width: 560px;
  font-size: 13px;
}
.home {
  min-height: calc(100vh - 175px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 70px;
  text-align: center;
}
.home h1 {
  color: #51305f;
  font-size: clamp(32px, 5.2vw, 80px);
  font-weight: 600;
  letter-spacing: 0.035em;
  white-space: nowrap;
}
.home .mono {
  line-height: 2.3;
  letter-spacing: 0.2em;
}
.home button {
  margin-top: 30px;
}
.login {
  max-width: 400px;
  margin: 12vh auto;
  padding: 0 24px;
}
.login .brand {
  padding: 0;
  margin-bottom: 64px;
}
.login h1 {
  font-size: 32px;
}
.login button {
  width: 100%;
  margin-top: 14px;
}
.login .eyebrow {
  margin-top: 30px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 32px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.field.wide {
  grid-column: 1/-1;
}
.field > span,
.field > label {
  color: #bbb5c3;
  font-size: 12px;
}
.field small {
  font-size: 12px;
  margin-top: -3px;
}
.check-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #bbb5c3;
  font-size: 12px;
  cursor: pointer;
}
.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: #1d1d23;
  border: 1px solid #49434f;
  border-radius: 0;
  color: var(--text);
  padding: 11px 12px;
  min-height: 45px;
}
.field textarea {
  min-height: 138px;
  line-height: 1.8;
  resize: vertical;
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  opacity: 1;
  background: transparent;
  color: #ddd6e5;
  border-color: #39343e;
}
.history .field textarea {
  min-height: 220px;
  background: #19191e;
  border: 0;
  border-bottom: 1px solid #51445c;
  padding: 16px 0;
}
.history .field {
  margin-bottom: 30px;
}
.history .field > span {
  font-size: 21px;
  color: var(--text);
}
.history .form-grid {
  display: block;
}
.history .field small {
  margin: 7px 0;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.toolbar {
  display: flex;
  gap: 12px;
  margin: 0 0 28px;
}
.toolbar input,
.toolbar select {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  min-width: 0;
}
.toolbar input {
  flex: 1;
}
.row {
  border-top: 1px solid var(--line);
  padding: 23px 0;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.row .row-open {
  background: transparent;
  text-align: left;
  color: var(--text);
  letter-spacing: 0;
  font-size: 17px;
  padding: 0;
  font-weight: 400;
  flex: 1;
}
.row small {
  display: block;
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  margin-top: 6px;
}
.empty {
  padding: 55px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.metadata {
  line-height: 2;
  margin: 22px 0;
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
}
.readonly {
  border-left: 2px solid var(--purple);
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 26px;
}
.section-block {
  grid-column: 1/-1;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 12px;
}
.array-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.array-item .form-grid {
  gap: 14px;
}
.array-item .field textarea {
  min-height: 90px;
}
.question {
  border-top: 1px solid var(--line);
  padding: 30px 0;
}
.question h2 {
  font-size: 18px;
  max-width: 790px;
  line-height: 1.65;
  letter-spacing: 0;
}
.question .number {
  font:
    11px ui-monospace,
    monospace;
  color: var(--link);
  display: block;
  margin-bottom: 15px;
}
.question textarea {
  min-height: 90px;
}
.attachments {
  border-top: 1px solid var(--line);
  margin-top: 35px;
  padding-top: 24px;
}
.attachment {
  margin: 18px 0;
}
.attachment img {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
}
.attachment iframe {
  width: 100%;
  height: 500px;
  background: white;
}
.attachment audio,
.attachment video {
  max-width: 100%;
}
.attachment video {
  max-height: 400px;
}
.portrait {
  width: 132px;
  height: 166px;
  object-fit: cover;
  float: right;
  margin: 0 0 25px 25px;
}
.map-figure {
  margin: 0;
}
.map-link {
  display: block;
  line-height: 0;
}
.map {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
}
.map-caption {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
.anomaly-scroll {
  background: radial-gradient(
    circle at 50% 12%,
    #130719 0,
    #050207 34rem,
    #000 68rem
  );
  color: #f8f4ff;
  font-family: "Times New Roman", serif;
  margin: 0 -3vw;
  overflow: hidden;
  padding: 0 clamp(18px, 5vw, 84px) 18vh;
}
.anomaly-opening {
  height: 76vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.anomaly-opening .symbol {
  color: #fff;
  font-size: clamp(68px, 9vw, 108px);
  line-height: 1;
  text-shadow:
    0 0 24px rgba(180, 92, 255, 0.28),
    0 0 90px rgba(180, 92, 255, 0.2);
  animation: anomaly-breathe 4.8s ease-in-out infinite;
}
.scroll-hint {
  color: #756b79;
  font:
    10px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.38em;
  margin-top: 24px;
}
.decode-block {
  position: relative;
  isolation: isolate;
  min-height: 82vh;
  display: grid;
  place-items: center;
  margin: 0 auto 8vh;
  padding: clamp(48px, 10vh, 110px) clamp(20px, 8vw, 112px);
  border-top: 1px solid rgba(180, 92, 255, 0.08);
}
.decode-block::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(76vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(132, 42, 174, 0.28),
    rgba(89, 24, 119, 0.12) 28%,
    transparent 68%
  );
  filter: blur(24px);
  opacity: 0.52;
  transform: translateX(14%) scale(0.78);
  transition:
    opacity 1.8s ease,
    transform 2.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.decode-block:nth-child(even)::before {
  transform: translateX(-14%) scale(0.78);
}
.decode-block.revealed::before {
  opacity: 0.9;
  transform: translateX(5%) scale(1);
}
.decode-block:nth-child(even).revealed::before {
  transform: translateX(-5%) scale(1);
}
.encoded,
.decoded {
  grid-area: 1 / 1;
  width: min(860px, 100%);
  overflow-wrap: anywhere;
}
.encoded {
  color: #d8bded;
  font:
    clamp(11px, 1.15vw, 14px)/1.9 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.09em;
  opacity: 0.82;
  text-shadow: 0 0 12px rgba(180, 92, 255, 0.45);
  transition:
    opacity 0.9s ease,
    filter 0.9s ease,
    transform 0.9s ease;
}
.decoded {
  font-size: clamp(23px, 2.8vw, 36px);
  letter-spacing: 0.045em;
  line-height: 1.8;
  transform: translateY(18px);
  transition: transform 1s ease;
}
.decoded .word {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(13px);
  transition:
    opacity 0.72s ease,
    filter 0.72s ease,
    transform 0.72s ease;
}
.decode-block.revealed .encoded {
  opacity: 0;
  filter: blur(9px);
  transform: translateY(-28px);
  pointer-events: none;
  transition-delay: 0.5s;
}
.decode-block.revealed .decoded {
  transform: translateY(0);
  transition-delay: 0.62s;
}
.decode-block.revealed .decoded .word {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  transition-delay: calc(0.62s + var(--word-index) * 36ms);
}
.decode-block.final {
  min-height: 100vh;
  border-top: 0;
}
.decode-block.final .decoded {
  font-size: clamp(40px, 6vw, 82px);
  line-height: 1.15;
  text-align: center;
}
@keyframes anomaly-breathe {
  50% {
    opacity: 0.72;
    transform: scale(0.97);
  }
}
.message-body {
  white-space: pre-wrap;
  max-width: 850px;
  font-size: 17px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.rich-editor {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: rgba(8, 14, 17, 0.72);
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}
.rich-toolbar button,
.rich-toolbar select,
.rich-toolbar input {
  min-height: 2.5rem;
  width: auto;
  margin: 0;
}
.rich-toolbar button {
  padding: 0.45rem 0.7rem;
}
[data-effect="neon"],
[data-effect="neon"] * {
  text-shadow:
    0 0 2px currentColor,
    0 0 7px currentColor,
    0 0 14px currentColor,
    0 0 24px currentColor;
}
.rich-toolbar select {
  padding: 0.4rem 1.8rem 0.4rem 0.55rem;
}
.rich-color-label {
  display: inline-flex;
}
.rich-toolbar input[type="color"] {
  min-width: 2.8rem;
  padding: 0.2rem;
  cursor: pointer;
}
.rich-input {
  min-height: 15rem;
  padding: 1rem;
  color: var(--text);
  line-height: 1.65;
  outline: 0;
  overflow-wrap: anywhere;
}
.rich-input:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.rich-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.rich-input ul,
.rich-input ol,
.message-body ul,
.message-body ol {
  padding-left: 1.6rem;
}
.rich-fallback[hidden] {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 700px) {
  .rich-toolbar {
    gap: 0.3rem;
  }
  .rich-toolbar button,
  .rich-toolbar select,
  .rich-toolbar input {
    min-height: 2.75rem;
  }
  .rich-toolbar select {
    max-width: 9rem;
  }
  .rich-input {
    min-height: 12rem;
  }
}
nav a[data-section="messages"] {
  position: relative;
}
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: auto;
  border-radius: 999px;
  background: #b91c35;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.collapsed .unread-badge {
  position: absolute;
  right: 3px;
  top: 0;
}
.notes {
  border-top: 1px solid var(--line);
  margin-top: 38px;
  padding-top: 28px;
}
.link-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#notice {
  position: fixed;
  bottom: 25px;
  right: 30px;
  max-width: calc(100vw - 32px);
  background: #302039;
  border-left: 3px solid var(--purple);
  padding: 12px 20px;
  color: white;
  z-index: 50;
  font-size: 12px;
  box-shadow: 0 6px 25px #0005;
}
#notice:empty {
  display: none;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  max-width: 440px;
  padding: 30px;
}
dialog::backdrop {
  background: #0009;
}
.mobile-toggle {
  display: none;
}
.inline-error {
  color: #efabb9;
  font-size: 13px;
}
.inline-error:empty {
  display: none;
}
.loading {
  color: var(--muted);
  padding: 40px 0;
}
.password-panel {
  max-width: 500px;
}
details {
  margin-top: 25px;
}
summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.version {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.publication {
  margin-top: 26px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.publication input {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px;
}
.read-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (min-width: 1500px) {
  main {
    padding-left: 8vw;
    padding-right: 8vw;
  }
}
@media (max-height: 860px) and (min-width: 701px) {
  aside {
    padding-top: 16px;
  }
  .brand {
    padding-bottom: 15px;
  }
  .brand .seal {
    margin-bottom: 5px;
  }
  nav a {
    padding-block: 6px;
    min-height: 34px;
  }
  .account {
    margin-top: 10px;
    padding-top: 10px;
  }
}
@media (max-width: 1000px) {
  main {
    padding-inline: 35px;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .home h1 {
    white-space: normal;
  }
  .form-grid {
    gap: 22px;
  }
}
@media (max-width: 700px) {
  aside,
  .collapsed aside {
    width: 224px;
    transform: translateX(-100%);
    transition: transform 0.15s;
  }
  .menu-open aside {
    transform: translateX(0);
  }
  .collapsed .nav-label,
  .collapsed .brand-text,
  .collapsed .account .username,
  .collapsed .account .role {
    display: initial;
  }
  .collapsed nav a {
    padding: 8px 12px;
  }
  .collapsed .brand {
    padding: 0 14px 20px;
  }
  .collapsed .brand .seal {
    margin-bottom: 14px;
  }
  .collapsed .account button {
    font-size: 10px;
  }
  .collapsed .account .actions {
    justify-content: flex-start;
  }
  main,
  .collapsed main {
    margin-left: 0;
    padding: 24px 22px 70px;
  }
  .mobile-toggle {
    display: block;
    position: fixed;
    right: 15px;
    top: 13px;
    z-index: 20;
    background: var(--panel) !important;
  }
  .topline {
    padding-right: 60px;
    margin-bottom: 38px;
    font-size: 9px;
  }
  .topline span:last-child {
    display: none;
  }
  h1 {
    font-size: 34px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .home h1 {
    font-size: 38px;
  }
  .home {
    padding-bottom: 30px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar input {
    width: 100%;
  }
  .page-head {
    margin-bottom: 26px;
  }
  .anomaly-scroll {
    margin-inline: -22px;
    padding-inline: 16px;
  }
  .decode-block {
    min-height: 78vh;
    margin-bottom: 5vh;
    padding: 56px 18px;
  }
  .encoded {
    font-size: 11px;
    line-height: 1.78;
    letter-spacing: 0.055em;
  }
  .decoded {
    font-size: 22px;
    line-height: 1.55;
  }
  .row {
    gap: 12px;
  }
  .row .metadata {
    display: none;
  }
  .portrait {
    width: 90px;
    height: 115px;
  }
  .attachment iframe {
    height: 350px;
  }
  #notice {
    right: 16px;
    bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.pdf-form,
.pdf-card {
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line, #41364e);
  border-radius: 12px;
}
.pdf-form {
  display: grid;
  gap: 18px;
}
.pdf-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.pdf-choice input {
  width: 20px;
  flex: 0 0 20px;
}
.pdf-recipients {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.pdf-form fieldset {
  min-width: 0;
  padding: 16px;
}
.pdf-card h2,
.pdf-card p {
  overflow-wrap: anywhere;
}
.pdf-form input[type="file"] {
  max-width: 100%;
}
.pdf-card .actions {
  flex-wrap: wrap;
}
