/* Encrypt / decode console. Served as its own file so the page ships no
   inline <style>; it only overrides the --noise-* custom properties. */
.noise-console {
  max-width: 640px;
  margin: 0 auto;
  padding: 26px;
  border-radius: 18px;
  border: 1px solid var(--noise-line, rgba(120, 160, 255, .18));
  background: var(--noise-surface, rgba(16, 22, 36, .72));
  color: var(--noise-text, #e6ecff);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 24px 70px -30px var(--noise-shadow, rgba(94, 234, 212, .45));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.noise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.noise-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--noise-muted, #8b98b8);
}
.noise-tag {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--noise-accent, #5eead4);
  border: 1px solid var(--noise-line, rgba(120, 160, 255, .18));
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.noise-label {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--noise-muted, #8b98b8);
  margin-bottom: 8px;
}
.noise-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--noise-text, #e6ecff);
  background: var(--noise-input, rgba(8, 12, 22, .6));
  border: 1px solid var(--noise-line, rgba(120, 160, 255, .18));
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.noise-input::placeholder { color: var(--noise-muted, #8b98b8); opacity: .75; }
.noise-input:focus {
  border-color: var(--noise-accent, #5eead4);
  box-shadow: 0 0 0 3px var(--noise-ring, rgba(94, 234, 212, .16));
}
/* The payload is a textarea, not a single-line input: a browser drops "\n" from
   an <input> value, so a pasted document would lose every line break. Only the
   payload grew; the key stays a one-line field. */
.noise-textarea {
  display: block;
  min-height: 8.5em;
  line-height: 1.5;
  resize: vertical;
}
.noise-field { display: block; margin-bottom: 16px; }
.noise-frame {
  position: relative;
  margin: 4px 0 14px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--noise-line, rgba(120, 160, 255, .18));
  background: var(--noise-input, rgba(8, 12, 22, .6));
  text-align: center;
}
.noise-frame-inner {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.noise-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #fff;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity .35s ease;
}
.noise-frame[data-state="ready"] img { opacity: 1; }
.noise-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background-color: var(--noise-skeleton, rgba(148, 163, 184, .12));
  background-image: linear-gradient(
    100deg,
    transparent 18%,
    var(--noise-skeleton-sheen, rgba(148, 163, 184, .3)) 50%,
    transparent 82%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation:
    noise-skeleton-sheen 1.5s linear infinite,
    noise-skeleton-fade 1.5s ease-in-out infinite;
}
.noise-frame[data-state="ready"] .noise-skeleton {
  opacity: 0;
  animation: none;
  transition: opacity .35s ease;
}
@keyframes noise-skeleton-sheen {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}
@keyframes noise-skeleton-fade {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}
.noise-status {
  min-height: 1.3em;
  margin: 0 0 20px;
  font-size: .82rem;
  color: var(--noise-muted, #8b98b8);
  text-align: center;
}
.noise-status[data-state="error"] { color: var(--noise-err, #fb7185); }
.noise-status[data-state="ok"] { color: var(--noise-accent, #5eead4); }
.noise-split {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 18px;
  color: var(--noise-muted, #8b98b8);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.noise-split::before, .noise-split::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--noise-line, rgba(120, 160, 255, .18));
}
.noise-decode { display: flex; gap: 10px; align-items: center; }
.noise-decode .noise-input { flex: 1; }
.noise-picker {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}
.noise-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.noise-picker-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--noise-line, rgba(120, 160, 255, .18));
  border-radius: 10px;
  background: var(--noise-input, rgba(8, 12, 22, .6));
  color: var(--noise-muted, #8b98b8);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.noise-picker-btn:hover { color: var(--noise-text, #e6ecff); border-color: var(--noise-accent, #5eead4); }
.noise-picker-input:focus-visible + .noise-picker-btn {
  border-color: var(--noise-accent, #5eead4);
  box-shadow: 0 0 0 3px var(--noise-ring, rgba(94, 234, 212, .16));
}
.noise-picker-icon { flex: none; width: 14px; height: 14px; transition: color .2s ease; }
.noise-picker-btn:hover .noise-picker-icon { color: var(--noise-accent, #5eead4); }
.noise-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: .02em;
  font-weight: 500;
}
.noise-picker[data-filled="true"] .noise-picker-name { color: var(--noise-text, #e6ecff); }
.noise-btn {
  flex: none;
  padding: 12px 20px;
  font-size: .82rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #04121a;
  background: var(--noise-accent, #5eead4);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.noise-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.noise-btn:active { transform: translateY(0); }
.noise-decoded {
  margin-top: 16px;
  min-height: 1.3em;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--noise-line, rgba(120, 160, 255, .18));
  background: var(--noise-input, rgba(8, 12, 22, .6));
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--noise-text, #e6ecff);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .noise-console { padding: 20px 16px; }
  .noise-decode { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .noise-skeleton, .noise-frame[data-state="ready"] .noise-skeleton { animation: none; }
  .noise-frame img, .noise-frame[data-state="ready"] .noise-skeleton { transition: none; }
}

/* Save button. Rendered as an <a> so it can carry the object URL directly;
   [hidden] has to be restated because the rule below sets display. */
.noise-save {
  display: block;
  width: fit-content;
  margin: 0 auto 16px;
  text-align: center;
  text-decoration: none;
}
.noise-save[hidden] { display: none; }
