:root {
  --bg: #07100d;
  --bg-deep: #040a08;
  --panel: #0c1914;
  --panel-soft: rgba(14, 30, 23, 0.72);
  --panel-solid: #0e1d17;
  --line: rgba(197, 238, 179, 0.12);
  --line-strong: rgba(197, 238, 179, 0.24);
  --text: #eef7ee;
  --text-soft: #d3e2d6;
  --muted: #93a99c;
  --muted-2: #6c8176;
  --accent: #d4ff7a;
  --accent-strong: #bff04f;
  --accent-ink: #142006;
  --mint: #8be8c1;
  --danger: #ff9b88;
  --danger-soft: rgba(255, 155, 136, 0.1);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.2);
  --font-thai: "Anuphan", "Noto Sans Thai", "Sarabun", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --topbar-height: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.is-booting {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 4% -8%, rgba(110, 239, 172, 0.1), transparent 60%),
    radial-gradient(1000px 700px at 102% 8%, rgba(212, 255, 122, 0.065), transparent 55%),
    var(--bg);
  font-family: var(--font-thai);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(220, 255, 210, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 255, 210, 0.022) 1px, transparent 1px);
  background-size: 74px 74px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 10%, transparent 78%);
}

::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(212, 255, 122, 0.72);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.012em;
}

svg {
  display: block;
}

code,
pre {
  font-family: var(--font-mono);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(197, 238, 179, 0.14);
  border-radius: 999px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--accent);
  background:
    radial-gradient(circle at 32% 20%, rgba(212, 255, 122, 0.11), transparent 55%),
    rgba(216, 255, 194, 0.035);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: inset 0 0 24px rgba(212, 255, 122, 0.035);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-word {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-word em {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.26em;
  line-height: 1;
}

/* ---------------------------------- boot ---------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.boot-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.boot-screen p {
  color: var(--muted);
  font-size: 13px;
}

.boot-logo {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: var(--accent);
  background: rgba(212, 255, 122, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  animation: boot-pulse 2.2s ease-in-out infinite;
}

.boot-logo svg {
  width: 40px;
  height: 40px;
}

.boot-line {
  position: relative;
  width: 130px;
  height: 2px;
  overflow: hidden;
  background: rgba(197, 238, 179, 0.1);
  border-radius: 999px;
}

.boot-line::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  background: var(--accent);
  border-radius: inherit;
  animation: boot-line 1.3s ease-in-out infinite;
}

@keyframes boot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(212, 255, 122, 0.07);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(212, 255, 122, 0);
  }
}

@keyframes boot-line {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(330%);
  }
}

/* --------------------------------- login ---------------------------------- */

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(480px, 0.92fr);
  min-height: 100dvh;
}

.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  padding: clamp(28px, 4vw, 58px);
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 620px at 78% 46%, rgba(139, 232, 193, 0.075), transparent 65%),
    radial-gradient(420px 420px at 22% 72%, rgba(212, 255, 122, 0.04), transparent 70%);
}

.auth-art::after {
  content: "01001  ลับ  เฉพาะคุณ  10110  vault";
  position: absolute;
  right: -6vw;
  bottom: 7vh;
  width: 62vw;
  color: rgba(218, 255, 207, 0.035);
  font-family: var(--font-mono);
  font-size: clamp(40px, 6vw, 96px);
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
  transform: rotate(-5deg);
  pointer-events: none;
  user-select: none;
}

.auth-brand {
  position: relative;
  z-index: 2;
}

.auth-orbit {
  position: absolute;
  top: 6%;
  right: clamp(-230px, -12vw, -120px);
  width: clamp(400px, 36vw, 560px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.72;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(197, 238, 179, 0.11);
  border-radius: 50%;
}

.orbit-a {
  inset: 0;
}

.orbit-b {
  inset: 13%;
  border-style: dashed;
  border-color: rgba(197, 238, 179, 0.09);
  animation: orbit-spin 80s linear infinite;
}

.orbit-b::after {
  content: "";
  position: absolute;
  top: 11%;
  right: 10%;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(212, 255, 122, 0.8);
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(105px, 10vw, 138px);
  height: clamp(105px, 10vw, 138px);
  margin: calc(clamp(105px, 10vw, 138px) / -2) 0 0 calc(clamp(105px, 10vw, 138px) / -2);
  color: var(--accent);
  background:
    radial-gradient(circle at 38% 25%, rgba(212, 255, 122, 0.13), transparent 58%),
    rgba(8, 18, 14, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow:
    0 0 70px rgba(139, 232, 193, 0.08),
    inset 0 0 40px rgba(212, 255, 122, 0.03);
}

.orbit-core svg {
  width: 42%;
  height: 42%;
}

.orbit-token {
  position: absolute;
  padding: 7px 10px;
  color: rgba(139, 232, 193, 0.66);
  background: rgba(5, 13, 10, 0.7);
  border: 1px solid rgba(197, 238, 179, 0.1);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: pre;
  backdrop-filter: blur(8px);
}

.token-a {
  top: 15%;
  left: 10%;
  animation: token-float 7s ease-in-out infinite;
}

.token-b {
  top: 47%;
  left: -2%;
  animation: token-float 9s ease-in-out -2s infinite;
}

.token-c {
  right: 3%;
  bottom: 15%;
  animation: token-float 8s ease-in-out -4s infinite;
}

.orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(212, 255, 122, 0.65);
  border-radius: 50%;
}

.dot-a {
  top: 22%;
  right: 19%;
}

.dot-b {
  bottom: 24%;
  left: 20%;
  background: rgba(139, 232, 193, 0.5);
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes token-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

.auth-hero {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 44px 0;
}

.auth-hero h1 {
  margin: 20px 0 24px;
  font-size: clamp(46px, 5.4vw, 82px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.07;
}

.auth-hero h1 span {
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}

.auth-hero h1 span::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: -7px;
  left: 2px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.45;
}

.auth-sub {
  max-width: 470px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.auth-proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--text-soft);
  background: rgba(10, 22, 17, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.auth-proof svg {
  width: 14px;
  height: 14px;
  color: var(--mint);
}

.auth-art-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
  background: rgba(6, 14, 11, 0.4);
}

/* ---------------------------------- lock ---------------------------------- */

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 48px);
  overflow-y: auto;
  background:
    radial-gradient(800px 600px at 15% 0%, rgba(139, 232, 193, 0.09), transparent 62%),
    radial-gradient(700px 540px at 100% 100%, rgba(212, 255, 122, 0.05), transparent 60%),
    var(--bg);
}

.lock-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 120vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.55;
}

.lock-halo::before,
.lock-halo::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(197, 238, 179, 0.1);
  border-radius: 50%;
}

.lock-halo::before {
  inset: 0;
}

.lock-halo::after {
  inset: 15%;
  border-style: dashed;
  border-color: rgba(212, 255, 122, 0.08);
  animation: orbit-spin 90s linear infinite;
}

.lock-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.lock-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lock-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.lock-brand .brand-mark svg {
  width: 22px;
  height: 22px;
}

.lock-brand .brand-word {
  font-size: 18px;
}

.lock-card {
  padding: clamp(24px, 4vw, 34px);
  background:
    radial-gradient(360px 240px at 100% 0%, rgba(139, 232, 193, 0.06), transparent 65%),
    linear-gradient(160deg, rgba(15, 31, 24, 0.94), rgba(7, 17, 12, 0.96));
  border: 1px solid var(--line);
  border-radius: 27px;
  box-shadow: var(--shadow);
}

.lock-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 25px;
  color: var(--accent);
  background:
    radial-gradient(circle at 35% 20%, rgba(212, 255, 122, 0.12), transparent 62%),
    rgba(212, 255, 122, 0.035);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
}

.lock-emblem svg {
  width: 27px;
  height: 27px;
}

.lock-emblem-ring {
  position: absolute;
  inset: -9px;
  border: 1px dashed rgba(212, 255, 122, 0.15);
  border-radius: 24px;
  animation: orbit-spin 45s linear infinite;
}

.lock-card h1 {
  margin: 13px 0 8px;
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.lock-sub {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.lock-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 9px 11px;
  background: rgba(4, 11, 8, 0.42);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.lock-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.lock-account-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.35;
}

.lock-account-copy strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lock-account-copy span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lock-logout {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 10px;
}

.lock-logout:hover {
  color: var(--danger);
}

.lock-notice,
.lock-error {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 11.5px;
  line-height: 1.65;
}

.lock-notice {
  color: var(--mint);
  background: rgba(139, 232, 193, 0.06);
  border: 1px solid rgba(139, 232, 193, 0.14);
}

.lock-error {
  color: #ffc8bb;
  background: rgba(255, 143, 122, 0.07);
  border: 1px solid rgba(255, 143, 122, 0.18);
}

.drive-connect {
  padding: 18px;
  text-align: center;
  background: rgba(4, 11, 8, 0.4);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.drive-connect-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  color: var(--mint);
  background: rgba(139, 232, 193, 0.06);
  border: 1px solid rgba(139, 232, 193, 0.12);
  border-radius: 14px;
}

.drive-connect-icon svg {
  width: 23px;
  height: 23px;
}

.drive-connect p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.lock-action {
  width: 100%;
  height: 52px;
  border-radius: 13px;
  font-size: 13px;
  text-decoration: none;
}

.lock-action svg {
  width: 18px;
  height: 18px;
}

.pin-field {
  margin-bottom: 15px;
}

.pin-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.pin-field input {
  display: block;
  width: 100%;
  height: 58px;
  padding: 0 0 0 0.42em;
  color: var(--text);
  text-align: center;
  background: rgba(3, 9, 6, 0.5);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 0.42em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pin-field input::placeholder {
  color: #52665a;
  font-size: 13px;
  letter-spacing: 0;
}

.pin-field input:hover {
  border-color: rgba(197, 238, 179, 0.19);
}

.pin-field input:focus {
  background: rgba(4, 11, 8, 0.7);
  border-color: rgba(212, 255, 122, 0.48);
  box-shadow: 0 0 0 4px rgba(212, 255, 122, 0.065);
}

.pin-field.has-error input {
  border-color: rgba(255, 155, 136, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 155, 136, 0.06);
}

.pin-warning {
  margin: 4px 0 10px;
  padding: 11px 13px;
  color: #f5ce8c;
  background: rgba(245, 206, 140, 0.055);
  border: 1px solid rgba(245, 206, 140, 0.14);
  border-radius: 11px;
  font-size: 10.5px;
  line-height: 1.7;
}

.pin-warning strong {
  color: #ffe0a8;
  font-weight: 500;
}

.pin-hint {
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.pin-submit {
  justify-content: space-between;
  width: 100%;
  height: 56px;
  margin-top: 16px;
  padding: 0 9px 0 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
}

.pin-dialog-icon {
  color: var(--accent);
  background: rgba(212, 255, 122, 0.06);
  border-color: rgba(212, 255, 122, 0.16);
}

.delete-pin-dialog .pin-field {
  margin: 18px 0 0;
  text-align: left;
}

.delete-pin-dialog .pin-field input {
  height: 52px;
  font-size: 20px;
  letter-spacing: 0.35em;
}

.delete-pin-dialog .delete-pin-error {
  margin-top: 8px;
  text-align: left;
}

.delete-pin-dialog .dialog-actions {
  margin-top: 18px;
}

.change-pin-dialog {
  max-height: calc(100dvh - 24px);
}

.change-pin-dialog .dialog-body {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.change-pin-dialog .change-pin-field {
  margin: 12px 0 0;
  text-align: left;
}

.change-pin-dialog .change-pin-field input {
  height: 46px;
  font-size: 18px;
  letter-spacing: 0.3em;
}

.change-pin-dialog .change-pin-warning {
  margin: 12px 0 0;
  text-align: left;
  font-size: 10px;
}

.change-pin-dialog .change-pin-error {
  margin-top: 8px;
  text-align: left;
}

.change-pin-dialog .dialog-actions {
  margin-top: 16px;
}

.change-pin-dialog .dialog-actions .btn-primary {
  height: 44px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
}

.lock-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 18px 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.lock-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(197, 238, 179, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.lock-retry {
  width: 100%;
  margin-top: 14px;
}

.lock-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
  padding-top: 18px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  text-align: center;
}

.lock-foot svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--mint);
  opacity: 0.65;
}

.lock-page-foot {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-align: center;
  opacity: 0.7;
}

.lock-now-btn:hover {
  color: var(--accent);
  background: rgba(212, 255, 122, 0.06);
}

.login-card {
  width: 100%;
  max-width: 430px;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
}

.login-card h2 {
  margin: 14px 0 10px;
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.login-sub {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 300;
}

.login-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #ffc8bb;
  background: rgba(255, 143, 122, 0.07);
  border: 1px solid rgba(255, 143, 122, 0.18);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
}

.btn-google {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  color: #102015;
  background: #f2f8f1;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-google:hover {
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  filter: saturate(0.4);
}

.google-g {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.btn-google .btn-arrow {
  width: 19px;
  height: 19px;
  margin-left: auto;
  color: #445449;
}

.login-dev {
  margin-top: 22px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-dev {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  color: var(--text-soft);
  background: rgba(197, 238, 179, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-dev:hover {
  background: rgba(197, 238, 179, 0.06);
  border-color: var(--line-strong);
}

.dev-warning {
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.dev-warning code {
  color: var(--muted);
}

.setup-hint {
  margin-top: 22px;
  padding: 16px;
  background: rgba(14, 30, 23, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.setup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #f8d38d;
  font-size: 12.5px;
  font-weight: 500;
}

.setup-head svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.setup-steps {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.setup-steps code {
  color: var(--mint);
  font-size: 10.5px;
  word-break: break-all;
}

.setup-hint pre {
  margin: 0 0 10px;
  padding: 11px 12px;
  overflow-x: auto;
  color: var(--text-soft);
  background: rgba(4, 10, 7, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.7;
}

.setup-hint > p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
}

.setup-hint > p code {
  color: var(--muted);
}

.login-legal {
  display: flex;
  gap: 9px;
  margin-top: 24px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}

.login-legal svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--mint);
  opacity: 0.7;
}

.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 46px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.login-foot i {
  width: 2px;
  height: 2px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.6;
}

/* ---------------------------------- app ----------------------------------- */

.app-shell {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 clamp(18px, 4vw, 52px);
  background: rgba(6, 15, 11, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.topbar .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.topbar .brand-mark svg {
  width: 22px;
  height: 22px;
}

.topbar .brand-word {
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 5px;
  background: rgba(12, 26, 20, 0.62);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--accent-ink);
  background: linear-gradient(145deg, #e6ffb3, #93d977);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-copy {
  display: flex;
  flex-direction: column;
  max-width: 190px;
  padding-right: 8px;
  line-height: 1.3;
}

.account-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-email {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.logout-btn:hover {
  color: #ffd0c7;
  background: var(--danger-soft);
}

.shell {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  align-items: start;
  gap: clamp(18px, 2.4vw, 32px);
  width: min(100%, 1460px);
  min-height: calc(100dvh - var(--topbar-height));
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 34px) clamp(18px, 4vw, 52px) 52px;
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 26px);
  display: flex;
  flex-direction: column;
  gap: 17px;
  height: calc(100dvh - var(--topbar-height) - 58px);
  min-height: 470px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 32, 25, 0.88), rgba(8, 19, 14, 0.9));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-head h2 {
  margin-top: 7px;
  font-size: 21px;
  font-weight: 500;
}

.count-pill {
  display: grid;
  place-items: center;
  min-width: 33px;
  height: 25px;
  padding: 0 9px;
  color: var(--accent);
  background: rgba(212, 255, 122, 0.07);
  border: 1px solid rgba(212, 255, 122, 0.16);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
}

.new-btn {
  width: 100%;
  height: 48px;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  font-size: 13.5px;
}

.new-btn svg {
  width: 17px;
  height: 17px;
}

.sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-label span:last-child {
  letter-spacing: 0;
}

.message-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  min-height: 90px;
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
}

.message-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 11px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.message-item:hover {
  background: rgba(212, 255, 122, 0.035);
  border-color: rgba(197, 238, 179, 0.09);
}

.message-item.is-active {
  background: linear-gradient(90deg, rgba(212, 255, 122, 0.115), rgba(212, 255, 122, 0.025));
  border-color: rgba(212, 255, 122, 0.21);
}

.message-item.is-active::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: -1px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 14px rgba(212, 255, 122, 0.35);
}

.item-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--accent);
  background: rgba(212, 255, 122, 0.055);
  border: 1px solid rgba(212, 255, 122, 0.1);
  border-radius: 11px;
}

.item-icon svg {
  width: 18px;
  height: 18px;
}

.item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.message-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-date {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.item-chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted-2);
  opacity: 0.6;
}

.message-item.is-active .item-chevron {
  color: var(--accent);
  opacity: 1;
}

.message-item.is-broken .message-name {
  color: var(--muted);
}

.skeleton {
  position: relative;
  height: 60px;
  overflow: hidden;
  background: rgba(197, 238, 179, 0.035);
  border: 1px solid rgba(197, 238, 179, 0.05);
  border-radius: 13px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  transform: translateX(-100%);
  animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
  100% {
    transform: translateX(100%);
  }
}

.list-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 14px;
  text-align: center;
}

.empty-illustration {
  width: 82px;
  height: 82px;
  margin-bottom: 16px;
  color: var(--mint);
  opacity: 0.65;
}

.empty-illustration svg {
  width: 100%;
  height: 100%;
}

.list-empty h3 {
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 500;
}

.list-empty p {
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.text-btn {
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  font-size: 11.5px;
  cursor: pointer;
}

.text-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.list-error {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 15px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  line-height: 1.5;
}

.sidebar-foot-note {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sidebar-link {
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-size: 9.5px;
  white-space: nowrap;
  cursor: pointer;
}

.sidebar-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-foot svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--mint);
  opacity: 0.6;
}

/* -------------------------------- workspace -------------------------------- */

.workspace {
  min-width: 0;
}

.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.workspace-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: rgba(11, 24, 18, 0.72);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab svg {
  width: 16px;
  height: 16px;
}

.tab:hover {
  color: var(--text-soft);
}

.tab.is-active {
  color: var(--accent);
  background: rgba(212, 255, 122, 0.075);
  border-color: rgba(212, 255, 122, 0.14);
}

.workspace-secure {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(139, 232, 193, 0.4);
  animation: pulse-dot 2.6s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 232, 193, 0.3);
  }
  60%,
  100% {
    box-shadow: 0 0 0 7px rgba(139, 232, 193, 0);
  }
}

.workspace-scroll {
  padding-bottom: 8px;
}

.view {
  position: relative;
  min-height: 620px;
  padding: clamp(28px, 3.4vw, 50px);
  overflow: hidden;
  background:
    radial-gradient(600px 380px at 100% -8%, rgba(139, 232, 193, 0.045), transparent 65%),
    linear-gradient(160deg, rgba(15, 31, 24, 0.91), rgba(8, 19, 14, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  animation: view-in 0.35s ease both;
}

.view::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(32px, 6vw, 90px);
  width: 88px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-head {
  margin-bottom: clamp(26px, 4vw, 40px);
}

.view-head h1,
.decoder-head h1,
.decoder-empty h1 {
  margin: 13px 0 10px;
  font-size: clamp(31px, 3.2vw, 44px);
  font-weight: 500;
  letter-spacing: -0.032em;
}

.view-sub {
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.75;
}

.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(225px, 0.62fr);
  align-items: start;
  gap: clamp(24px, 4vw, 54px);
}

.secret-form {
  max-width: 620px;
}

.field {
  margin-bottom: 22px;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label-row label {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.field-hint {
  color: var(--muted-2);
  font-size: 10px;
}

.char-count {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.char-count.is-near {
  color: #ffd38a;
}

.char-count.is-full {
  color: var(--accent);
}

.input-wrap,
.textarea-wrap {
  position: relative;
}

.input-wrap input,
.textarea-wrap textarea {
  display: block;
  width: 100%;
  color: var(--text);
  background: rgba(3, 9, 6, 0.48);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input {
  height: 55px;
  padding: 0 46px 0 16px;
  font-size: 15px;
}

.textarea-wrap textarea {
  min-height: 155px;
  padding: 15px 16px;
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
}

.input-wrap input::placeholder,
.textarea-wrap textarea::placeholder {
  color: #5d7065;
  font-weight: 300;
}

.input-wrap input:hover,
.textarea-wrap textarea:hover {
  border-color: rgba(197, 238, 179, 0.19);
}

.input-wrap input:focus,
.textarea-wrap textarea:focus {
  background: rgba(4, 11, 8, 0.68);
  border-color: rgba(212, 255, 122, 0.48);
  box-shadow: 0 0 0 4px rgba(212, 255, 122, 0.065);
}

.field.has-error .input-wrap input,
.field.has-error .textarea-wrap textarea {
  border-color: rgba(255, 155, 136, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 155, 136, 0.06);
}

.input-icon {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.clipboard-helper {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  border: 0;
  pointer-events: none;
}

.legal-page {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) 0;
  color: var(--text-soft);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  text-decoration: none;
}

.legal-page .eyebrow {
  margin-bottom: 14px;
}

.legal-page h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.legal-updated {
  margin-bottom: 36px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.legal-page section {
  margin-bottom: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.legal-page h2 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.legal-page p + p {
  margin-top: 10px;
}

.legal-page ul {
  margin: 0;
  padding-left: 20px;
}

.legal-page li + li {
  margin-top: 5px;
}

.legal-page a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.legal-page code {
  color: var(--mint);
  font-size: 11px;
}

.legal-back {
  margin-top: 34px;
  font-size: 12px !important;
}

.field-error {
  margin-top: 7px;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.encrypt-note {
  display: flex;
  gap: 11px;
  margin: 4px 0 25px;
  padding: 13px 15px;
  color: var(--muted);
  background: rgba(212, 255, 122, 0.028);
  border: 1px dashed rgba(212, 255, 122, 0.16);
  border-radius: 13px;
  font-size: 11px;
  line-height: 1.7;
}

.encrypt-note strong {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.encrypt-note p {
  min-width: 0;
}

.note-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--mint);
  background: rgba(139, 232, 193, 0.06);
  border-radius: 9px;
}

.note-icon svg {
  width: 17px;
  height: 17px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:disabled,
.btn.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 34px rgba(171, 232, 74, 0.12);
}

.btn-primary:hover {
  background: #e0ff9d;
  box-shadow: 0 16px 40px rgba(171, 232, 74, 0.18);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.submit-btn {
  justify-content: space-between;
  width: 100%;
  height: 57px;
  padding: 0 9px 0 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}

.btn-end {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  color: var(--accent-ink);
  background: rgba(20, 32, 6, 0.1);
  border-radius: 11px;
}

.btn-end svg {
  width: 19px;
  height: 19px;
}

.btn.is-loading .btn-end svg {
  display: none;
}

.btn.is-loading .btn-end::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(20, 32, 6, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.how-card {
  position: sticky;
  top: calc(var(--topbar-height) + 150px);
  padding: 24px;
  background:
    radial-gradient(220px 160px at 100% 0%, rgba(212, 255, 122, 0.045), transparent 60%),
    rgba(5, 12, 9, 0.34);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.how-card h3 {
  margin: 14px 0 22px;
  font-size: 20px;
  line-height: 1.45;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 12px;
}

.step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--accent);
  background: rgba(212, 255, 122, 0.06);
  border: 1px solid rgba(212, 255, 122, 0.12);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.steps strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.steps p {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
}

.how-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font-size: 9.5px;
}

.how-lock svg {
  width: 16px;
  height: 16px;
  color: var(--mint);
  opacity: 0.65;
}

/* -------------------------------- decoder --------------------------------- */

.decoder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 490px;
  padding: 40px 20px;
  text-align: center;
}

.decoder-empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin-bottom: 30px;
  color: var(--accent);
}

.empty-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(212, 255, 122, 0.18);
  border-radius: 50%;
  animation: orbit-spin 40s linear infinite;
}

.empty-ring::before,
.empty-ring::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 50%;
}

.empty-ring::before {
  top: 8px;
  left: 26px;
  width: 5px;
  height: 5px;
  box-shadow: 0 0 16px rgba(212, 255, 122, 0.7);
}

.empty-ring::after {
  right: 10px;
  bottom: 30px;
  width: 3px;
  height: 3px;
  opacity: 0.6;
}

.decoder-empty-art svg {
  width: 55px;
  height: 55px;
  opacity: 0.9;
}

.decoder-empty .view-sub {
  max-width: 390px;
}

.decoder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.decoder-title-wrap {
  min-width: 0;
}

.decoder-head h1 {
  overflow-wrap: anywhere;
}

.decoder-meta {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.danger-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 155, 136, 0.035);
}

.danger-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 155, 136, 0.2);
}

.cipher-card {
  margin-bottom: 24px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(139, 232, 193, 0.035), transparent 60%),
    rgba(3, 9, 6, 0.38);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.cipher-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cipher-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.cipher-label svg {
  width: 16px;
  height: 16px;
  color: var(--mint);
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  color: var(--mint);
  background: rgba(139, 232, 193, 0.06);
  border: 1px solid rgba(139, 232, 193, 0.14);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.secure-badge svg {
  width: 11px;
  height: 11px;
}

.cipher-text {
  min-height: 43px;
  padding: 11px 13px;
  overflow-wrap: anywhere;
  color: rgba(139, 232, 193, 0.74);
  background: rgba(2, 7, 5, 0.6);
  border: 1px solid rgba(197, 238, 179, 0.06);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  word-break: break-all;
}

.cipher-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.plaintext-area {
  max-width: 760px;
}

.plaintext-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
  padding: 22px;
  border-radius: var(--radius-lg);
  transition: background 0.28s ease, border-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
}

.plaintext-card[data-state="hidden"] {
  background:
    repeating-linear-gradient(135deg, rgba(197, 238, 179, 0.018) 0 8px, transparent 8px 16px),
    rgba(4, 11, 8, 0.42);
  border: 1px dashed rgba(197, 238, 179, 0.16);
}

.plaintext-card[data-state="revealed"] {
  color: #17250f;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    #e6ffc2;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(212, 255, 122, 0.12),
    0 0 70px rgba(194, 255, 109, 0.07);
}

.plaintext-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plaintext-card[data-state="hidden"] .plaintext-top {
  color: var(--muted-2);
}

.plaintext-card[data-state="revealed"] .plaintext-top {
  color: rgba(23, 37, 15, 0.52);
}

.auto-hide {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: rgba(23, 37, 15, 0.6);
  background: rgba(23, 37, 15, 0.07);
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: 0;
}

.plaintext-placeholder {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 20px 0;
  color: var(--muted-2);
  text-align: center;
}

.plaintext-placeholder svg {
  width: 30px;
  height: 30px;
  color: var(--mint);
  opacity: 0.55;
}

.plaintext-placeholder p {
  font-size: 12px;
  line-height: 1.8;
}

.plaintext-placeholder span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.plaintext-content {
  animation: reveal-text 0.4s ease both;
}

@keyframes reveal-text {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.plaintext-text {
  min-height: 90px;
  color: #17250f;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.plaintext-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  color: #203215;
  background: rgba(23, 37, 15, 0.08);
  border: 1px solid rgba(23, 37, 15, 0.13);
  border-radius: 9px;
  font-size: 10.5px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-small svg {
  width: 14px;
  height: 14px;
}

.btn-small:hover {
  background: rgba(23, 37, 15, 0.14);
}

.btn-small.ghost {
  background: transparent;
}

.reveal-btn {
  width: 100%;
  height: 56px;
  margin-top: 16px;
  gap: 9px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
}

.reveal-btn svg {
  width: 19px;
  height: 19px;
}

.reveal-hint {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 9.5px;
  text-align: center;
}

/* ------------------------------ mobile chrome ------------------------------ */

.mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  color: var(--muted);
  background: none;
  border: 0;
  font-size: 12px;
  cursor: pointer;
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

.mobile-bar-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------------------------------- toast ---------------------------------- */

.toast {
  position: fixed;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 16px 11px 12px;
  color: var(--text-soft);
  background: #12241b;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  line-height: 1.5;
  animation: toast-in 0.25s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.toast[data-type="error"] .toast-icon {
  color: #2b0d06;
  background: var(--danger);
}

.toast[data-type="info"] .toast-icon {
  color: #06221a;
  background: var(--mint);
}

.toast-icon::before {
  content: "✓";
}

.toast[data-type="error"] .toast-icon::before {
  content: "!";
}

.toast[data-type="info"] .toast-icon::before {
  content: "i";
}

/* --------------------------------- dialog ---------------------------------- */

.confirm-dialog {
  width: calc(100% - 32px);
  max-width: 400px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.confirm-dialog::backdrop {
  background: rgba(2, 7, 5, 0.74);
  backdrop-filter: blur(6px);
}

.dialog-body {
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(300px 180px at 50% 0%, rgba(255, 155, 136, 0.045), transparent 65%),
    #0d1c16;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  animation: dialog-in 0.22s ease both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 17px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 155, 136, 0.16);
  border-radius: 16px;
}

.dialog-icon svg {
  width: 24px;
  height: 24px;
}

.dialog-body h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.dialog-body > p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.dialog-body > p span {
  color: var(--text-soft);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 24px;
}

.btn-ghost {
  height: 44px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 12.5px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
}

.btn-danger {
  height: 44px;
  color: #321009;
  background: var(--danger);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
}

.btn-danger:hover {
  background: #ffb2a2;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 12px;
  color: #321009;
  background: var(--danger);
  border-radius: 10px;
  text-align: center;
}

/* -------------------------------- responsive ------------------------------- */

@media (max-width: 1220px) {
  .compose-grid {
    grid-template-columns: 1fr;
  }

  .how-card {
    display: none;
  }
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 335px minmax(0, 1fr);
  }

  .sidebar {
    padding: 19px;
  }

  .view {
    padding: clamp(26px, 3.5vw, 38px);
  }
}

@media (max-width: 959px) {
  :root {
    --topbar-height: 64px;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .topbar {
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
  }

  .topbar .brand-mark {
    width: 36px;
    height: 36px;
  }

  .topbar .brand-word {
    font-size: 17px;
  }

  .topbar .brand-word em {
    font-size: 6.5px;
  }

  .shell {
    display: block;
    width: 100%;
    min-height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top));
    padding: 0;
  }

  .sidebar {
    position: static;
    display: flex;
    height: auto;
    max-height: none;
    min-height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 20px 16px calc(26px + env(safe-area-inset-bottom));
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar-head h2 {
    font-size: 23px;
  }

  .sidebar .new-btn {
    height: 51px;
    font-size: 14px;
  }

  .message-list {
    flex: 0 1 auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .message-item {
    padding: 12px;
  }

  .sidebar-foot {
    margin-top: auto;
    padding-top: 18px;
  }

  .list-empty {
    flex: 1;
    min-height: 280px;
  }

  .workspace {
    display: none;
    padding: 10px 16px calc(38px + env(safe-area-inset-bottom));
  }

  body[data-view="compose"] .workspace,
  body[data-view="decoder"] .workspace {
    display: block;
  }

  body[data-view="compose"] .sidebar,
  body[data-view="decoder"] .sidebar {
    display: none;
  }

  .mobile-bar {
    display: flex;
  }

  .workspace-top {
    display: none;
  }

  .workspace-scroll {
    padding-bottom: 0;
  }

  .view {
    min-height: auto;
    padding: 25px 20px;
    border-radius: 24px;
  }

  .view::before {
    left: 20px;
  }

  .view-head h1,
  .decoder-head h1,
  .decoder-empty h1 {
    font-size: 31px;
  }

  .view-sub {
    font-size: 12.5px;
  }

  .decoder-empty {
    min-height: 460px;
    padding: 52px 12px;
  }

  .decoder-head {
    align-items: center;
  }

  .decoder-head h1 {
    font-size: 27px;
  }

  .cipher-card {
    padding: 17px;
  }

  .plaintext-card {
    min-height: 205px;
    padding: 19px;
  }

  .plaintext-text {
    font-size: 19px;
  }

  .reveal-btn {
    height: 54px;
  }

  .textarea-wrap textarea {
    resize: none;
  }

  .auth-screen {
    grid-template-columns: 1fr;
  }

  .lock-screen {
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  }

  .lock-shell {
    gap: 16px;
  }

  .lock-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .lock-emblem {
    width: 56px;
    height: 56px;
    margin-bottom: 21px;
    border-radius: 18px;
  }

  .lock-emblem-ring {
    inset: -8px;
    border-radius: 22px;
  }

  .lock-card h1 {
    font-size: 29px;
  }

  .pin-field input {
    height: 56px;
  }

  .lock-brand .brand-word {
    font-size: 17px;
  }

  .auth-art {
    display: none;
  }

  .auth-panel {
    display: block;
    min-height: 100dvh;
    padding: calc(26px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
    background:
      radial-gradient(560px 420px at 90% -10%, rgba(139, 232, 193, 0.09), transparent 65%),
      transparent;
  }

  .login-card {
    max-width: 440px;
    margin: 0 auto;
  }

  .login-mobile-brand {
    display: flex;
  }

  .login-card h2 {
    font-size: 32px;
  }

  .login-foot {
    margin-top: 36px;
  }

  .toast {
    right: 16px;
    left: 16px;
    max-width: none;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .account-copy {
    display: flex;
    max-width: 120px;
    padding-right: 3px;
  }

  .account-name {
    display: none;
  }

  .account-email {
    max-width: 120px;
    font-size: 9px;
  }

  .account {
    gap: 7px;
    padding: 3px 3px 3px 4px;
  }

  .account .icon-btn {
    width: 32px;
    height: 32px;
  }

  .logout-btn {
    width: 33px;
    height: 33px;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .workspace {
    padding-top: 4px;
  }

  .reveal-hint {
    font-size: 9px;
  }
}

@media (max-width: 370px) {
  .account-copy {
    display: none;
  }
}

@media (max-width: 390px) {
  .topbar .brand-word em {
    display: none;
  }

  .brand-word {
    font-size: 17px;
  }

  .field-hint {
    display: none;
  }

  .view {
    padding: 22px 16px;
  }

  .login-card h2 {
    font-size: 29px;
  }

  .login-legal {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
