/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────── */
:root {
  --bg:       #111d27;
  --bg1:      #0d1b24;
  --bg2:      #0a1520;
  --bg3:      #141e2a;
  --border:   #1e3248;
  --teal:     #2a8a8a;
  --teal-l:   #3ababa;
  --text:     #cdd6e0;
  --text-dim: #6a8090;
  --err:      #c04040;
  --ok:       #2a8a50;
  --radius:   6px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--teal-l); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Honeycomb background pattern ──────────── */
.honeycomb-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.honeycomb-bg svg { width: 100%; height: 100%; opacity: 0.045; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.site-logo {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--teal);
  text-shadow: 0 0 8px #0a5555;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.site-nav { display: flex; gap: 12px; align-items: center; }
/* nav-panel: on desktop children flow directly into the flex row */
.nav-panel { display: contents; }
/* burger button: hidden on desktop */
.nav-burger-btn { display: none; background: none; border: none; color: var(--text-dim); font-size: 1.3em; line-height: 1; cursor: pointer; padding: 2px 4px; }
.nav-burger-btn:hover { color: var(--text); }
.nav-logout-form { display: contents; }
.site-nav a, .site-nav form button {
  color: var(--text-dim);
  font-size: 0.9em;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.site-nav a:hover, .site-nav form button:hover { color: var(--text); text-decoration: none; }
.nav-sep { color: var(--border); font-size: 0.85em; user-select: none; }
.nav-home-hex { color: var(--teal-l); font-weight: bold; }
.nav-invite-badge { display: inline-flex; align-items: center; justify-content: center;
  background: #2255cc; color: #fff; font-size: 0.7em; font-weight: 700;
  border-radius: 50%; min-width: 14px; height: 14px; line-height: 14px;
  padding: 0 3px; margin-left: 2px; vertical-align: middle; }
.nav-mail { text-decoration: none; opacity: 0.6; color: var(--teal-l); line-height: 1; vertical-align: middle; display: inline-flex; align-items: center; gap: 4px; }
.nav-mail.has-unread { opacity: 1; }
.nav-mail-icon { line-height: 1; }
.nav-mail-label { font-size: 1em; }
.nav-mail-badge { display: inline-flex; align-items: center; justify-content: center;
  background: #c44; color: #fff; font-size: 0.7em; font-weight: 700;
  border-radius: 50%; min-width: 14px; height: 14px; line-height: 14px;
  padding: 0 3px; margin-left: 2px; vertical-align: middle; }
.nav-current { color: var(--text-dim); font-size: 0.9em; cursor: default; }

/* ── Language switcher ──────────────────────── */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.85em;
  font-family: inherit;
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lang-btn:hover { border-color: var(--teal); color: var(--text); }
.lang-arrow { font-size: 0.7em; opacity: 0.6; }
.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 130px;
  list-style: none;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.lang-menu.open { display: block; }
.lang-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 0.85em;
  color: var(--text-dim);
  white-space: nowrap;
}
.lang-menu a:hover { background: var(--bg2); color: var(--text); text-decoration: none; }
.site-nav a:hover, .site-nav form button:hover { color: var(--text); text-decoration: none; }

/* ── Responsive nav (burger menu) ──────────── */
@media (max-width: 720px) {
  .site-header { position: relative; }

  /* Show burger button */
  .nav-burger-btn { display: flex; align-items: center; justify-content: center; }

  /* Hide all separators */
  .nav-sep { display: none !important; }

  /* Panel hidden by default; shown as full-width dropdown when open */
  .nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
    flex-direction: column;
    z-index: 200;
    padding: 4px 0;
  }
  .nav-panel.open { display: flex; }

  /* Items inside the open panel */
  .nav-panel a,
  .nav-panel .nav-mail {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 0.95em;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
  }
  .nav-panel a:last-child { border-bottom: none; }
  .nav-panel a:hover { background: var(--bg3); color: var(--text); }

  /* Logout: icon only */
  .nav-logout-label { display: none; }

  /* Lang switcher: flag only */
  .lang-label, .lang-arrow { display: none; }
  .lang-btn { padding: 4px 6px; }
}

.main { flex: 1; padding: 40px 24px; }

/* ── Card ──────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 440px;
  margin: 0 auto;
}
.card h1 { font-size: 1.2em; color: var(--teal-l); margin-bottom: 20px; }

/* ── Form ──────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.82em; color: var(--text-dim); margin-bottom: 5px; }
.field label .opt { font-style: italic; opacity: 0.7; }
.field-hint { margin: 5px 0 0; font-size: 0.78em; color: var(--text-dim); opacity: 0.8; }
.input-suggest { position: relative; }
.input-suggest input { padding-right: 64px; width: 100%; box-sizing: border-box; }
.suggest-btns { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; }
.suggest-btns button {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 1em;
  font-family: inherit;
  color: var(--teal);
  opacity: 0.55;
  padding: 0 4px;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.15s;
}
.suggest-btns button:hover { opacity: 1; }
.suggest-btns button:disabled { opacity: 0.2; cursor: wait; }

input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.95em;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2399bbbb' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
select option { background: var(--bg3); color: var(--text); }
input:focus {
  outline: none;
  border-color: var(--teal);
}

.btn[hidden] { display: none; }
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 0.9em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: #1e2e3e; border-color: var(--teal); color: #fff; text-decoration: none; }
.btn-primary { background: #0e3a3a; border-color: var(--teal); color: var(--teal-l); }
.btn-primary:hover { background: #1a5050; }
.btn-danger  { background: #2a0e0e; border-color: #5a1a1a; color: #e06060; }
.btn-danger:hover  { background: #3a1414; border-color: var(--err); }
.btn-full { width: 100%; }

/* ── Alerts ────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88em;
  margin-bottom: 16px;
}
.alert-err { background: #1e0a0a; border: 1px solid #5a1a1a; color: #e07070; }
.alert-ok  { background: #0a1e12; border: 1px solid #1a5a2e; color: #70e090; }
.alert-info{ background: #0a1420; border: 1px solid var(--border); color: var(--text-dim); }

/* ── Mnemonic seed display ──────────────────── */
.seed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.seed-word {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-family: monospace;
  font-size: 0.88em;
  color: var(--teal-l);
}
.seed-word span {
  display: block;
  font-family: inherit;
  font-size: 0.75em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

/* ── Mnemonic input row ─────────────────────── */
.mnemonic-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.mnemonic-inputs input {
  text-align: center;
  font-family: monospace;
  font-size: 0.88em;
  padding: 7px 6px;
}

/* ── Avatar picker ──────────────────────────── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.avatar-opt {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.avatar-opt:hover, .avatar-opt.selected { border-color: var(--teal-l); }
input[name=avatar] { display: none; }

/* ── Avatar display ─────────────────────────── */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Profile card (base/) ───────────────────── */
.profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0 24px;
}
.profile-name { font-size: 1.3em; font-weight: 600; }
.profile-since { font-size: 0.8em; color: var(--text-dim); margin-top: 2px; }

/* ── hex tile pulse animations ──────────────────── */
/* filter is on the wrapper (no clip-path) so glow escapes the hex boundary */
@keyframes hexPulse-solo {
  0%,100% { filter: drop-shadow(0 0 3px #1a2a38); }
  50%     { filter: drop-shadow(0 0 11px #aac8e0); }
}
@keyframes hexPulse-multi {
  0%,100% { filter: drop-shadow(0 0 3px #1a4a4a); }
  50%     { filter: drop-shadow(0 0 11px #3ababa); }
}
@keyframes hexPulse-misc {
  0%,100% { filter: drop-shadow(0 0 3px #2a1a4a); }
  50%     { filter: drop-shadow(0 0 11px #8866cc); }
}
/* hex tile honeycomb — odd rows = 4 tiles (offset), even rows = 5 tiles */
.tile-grid {
  --hw: clamp(120px, calc((100vw - 48px) / 5), 160px);
  --hh: calc(var(--hw) * 1.1547);
  display: flex;
  flex-wrap: wrap;
  width: calc(var(--hw) * 5);
  margin: 24px auto 0;
  padding-bottom: calc(var(--hh) * 0.25);
}
/* wrapper carries layout + animation; clip-path lives on .tile inside */
.tile-wrap {
  width: var(--hw);
  height: var(--hh);
  margin: 0 0 calc(var(--hh) * -0.25);
  flex-shrink: 0;
}
.tile-wrap:nth-child(9n+1) { margin-left: calc(var(--hw) / 2); }
.tile-wrap--solo  { animation: hexPulse-solo  3s ease-in-out infinite; }
.tile-wrap--multi { animation: hexPulse-multi 4s ease-in-out infinite; }
.tile-wrap--misc  { animation: hexPulse-misc  5s ease-in-out infinite; }
.tile-wrap--solo:hover  { animation: none; filter: drop-shadow(0 0 14px #66aadd); }
.tile-wrap--multi:hover { animation: none; filter: drop-shadow(0 0 14px #44cccc); }
.tile-wrap--misc:hover  { animation: none; filter: drop-shadow(0 0 14px #9977dd); }
.tile-wrap--soon { opacity: 0.55; }
.tile-wrap--soon:hover  { animation: none; filter: none; opacity: 0.7; }
/* tile: clip-path + background only, no filter/animation */
.tile {
  width: 100%;
  height: 100%;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--bg2);
  box-sizing: border-box;
  padding: 16px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.tile--solo  { background: linear-gradient(145deg, #2a3e52 0%, #1a2c40 25%, #1a2c40 75%, #0e1a28 100%); }
.tile--multi { background: linear-gradient(145deg, #162e3e 0%, #0a1e2e 25%, #0a1e2e 75%, #040e18 100%); }
.tile--misc  { background: linear-gradient(145deg, #22183a 0%, #161425 25%, #161425 75%, #0a0816 100%); }
.tile--soon  { cursor: default; }
.tile--solo:hover  { background: #223248; color: var(--text); text-decoration: none; }
.tile--multi:hover { background: #0e2030; color: var(--text); text-decoration: none; }
.tile--misc:hover  { background: #1e1a32; color: var(--text); text-decoration: none; }
.tile-icon { font-size: 1.8em; margin-bottom: 6px; }
.tile-label { font-size: 0.78em; color: var(--text-dim); margin-top: 3px; }
@media (max-width: 700px) {
  .tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); width: auto; gap: 10px; padding-bottom: 0; }
  .tile-wrap { width: auto; height: auto; margin: 0; animation: none; }
  .tile-wrap:nth-child(9n+1) { margin-left: 0; }
  .tile-wrap--solo:hover, .tile-wrap--multi:hover, .tile-wrap--misc:hover { filter: none; }
  .tile { clip-path: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
  .tile--solo:hover, .tile--multi:hover, .tile--misc:hover { border-color: var(--teal); }
}

/* ── Account sections ───────────────────────── */
.section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  max-width: 540px;
  margin-bottom: 16px;
}
.section h2 { font-size: 1em; color: var(--teal-l); margin-bottom: 16px; }
.section-danger { border-color: #3a1414; }
.section-danger h2 { color: #e06060; }

.links { margin-top: 14px; font-size: 0.85em; color: var(--text-dim); }
.links a { margin-right: 14px; }

/* ── Footer ────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 32px 24px 20px;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 860px;
  margin: 0 auto 24px;
}
.footer-col h3 {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 0.88em;
  margin-bottom: 6px;
}
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-copy {
  text-align: center;
  font-size: 0.78em;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  max-width: 860px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-links { grid-template-columns: 1fr; }
}

/* ── Inbox layout ──────────────────────────────────────────────────────────── */
.main--inbox { max-width: none; display: flex; flex-direction: column; }

.inbox-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 148px);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.inbox-tabs {
  flex: 0 0 180px;
  width: 180px;
  background: var(--bg2);
  overflow-y: auto;
  padding: 6px 0;
}

.inbox-resizer {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--border);
  transition: background 0.15s;
  position: relative;
}
.inbox-resizer[hidden] { display: none; }
.inbox-resizer:hover,
.inbox-resizer.dragging { background: var(--teal-d); }
.inbox-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  font-size: 0.83em;
  cursor: pointer;
  text-align: left;
  gap: 4px;
}
.inbox-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.inbox-tab.active { color: var(--teal-l); background: rgba(0,200,200,0.06); border-left-color: var(--teal-l); }
.inbox-subtabs[hidden] { display: none; }
.inbox-subtabs { display: flex; flex-direction: column; }
.inbox-subtab {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 5px 10px 5px 24px;
  background: none; border: none; border-left: 2px solid transparent;
  color: var(--text-dim); font-size: 0.78em; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-subtab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.inbox-subtab.active { color: var(--teal-l); background: rgba(0,200,200,0.04); border-left-color: var(--teal-l); }
.inbox-tab-sep { border: none; border-top: 1px solid var(--border); margin: 6px 8px; }
.inbox-tab--folder { background: var(--bg1); }
.inbox-badge {
  background: var(--teal-d);
  color: var(--text);
  border-radius: 9px;
  font-size: 0.72em;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.inbox-body { display: flex; flex: 1; min-width: 0; overflow: hidden; }

.inbox-list { display: flex; flex-direction: column; flex: 1 1 420px; min-width: 150px; overflow: hidden; background: var(--bg); }

.inbox-list-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-height: 38px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  font-size: 0.76em;
  color: var(--text-dim);
  flex-shrink: 0;
}
.inbox-list-hdr .col-sender { flex: 1; }
.inbox-list-hdr .col-date   { min-width: 118px; text-align: right; }
.inbox-sortable { cursor: pointer; user-select: none; }
.inbox-sortable:hover { color: var(--teal-l); }

.inbox-rows { flex: 1; overflow-y: auto; }

.inbox-list-foot {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; min-height: 38px; border-top: 1px solid var(--border);
  background: var(--bg2); font-size: 0.76em;
}
.inbox-foot-left  { display: flex; align-items: center; gap: 5px; }
.inbox-foot-right { display: flex; align-items: center; gap: 4px; }
.inbox-foot-ctrl {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  font-size: 1em; padding: 2px 6px; border-radius: var(--radius); cursor: pointer;
  font-family: inherit;
}
.inbox-foot-ctrl:focus { outline: 1px solid var(--teal); }
.inbox-pager { display: flex; align-items: center; gap: 2px; }
.pg-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  padding: 1px 6px; border-radius: 3px; cursor: pointer; font-size: 1em; line-height: 1.5;
  font-family: inherit;
}
.pg-btn:hover:not(:disabled) { color: var(--text); border-color: var(--teal); }
.pg-btn:disabled { opacity: 0.25; cursor: default; }
.pg-info { color: var(--text-dim); white-space: nowrap; padding: 0 5px; }

.inbox-row.row-filtered { display: none; }
.inbox-row[hidden] { display: none; }
.inbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.84em;
}
.inbox-row:hover  { background: rgba(255,255,255,0.03); }
.inbox-row.active { background: rgba(0,200,200,0.06); border-left: 2px solid var(--teal-l); }
.inbox-row.unread .inbox-from,
.inbox-row.unread .inbox-subj { font-weight: 600; color: var(--text); }

.inbox-row-main { flex: 1; min-width: 0; }
.inbox-row-top  { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.inbox-from     { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-ts       { color: var(--text-dim); font-size: 0.88em; white-space: nowrap; flex-shrink: 0; }
.inbox-subj     { color: var(--text-dim); font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.inbox-empty    { padding: 20px 14px; color: var(--text-dim); font-size: 0.85em; }

.inbox-detail {
  flex: 1 1 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg2);
}
.inbox-detail-hdr {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  min-height: 38px;
}
.inbox-detail-hdr button { background: none; border: none; color: var(--text-dim); font-size: 1.1em; cursor: pointer; padding: 0 4px; line-height: 1; }
.inbox-detail-hdr button:hover { color: var(--text); }
.det-hdr-info { flex: 1; text-align: center; font-size: 0.82em; color: var(--text); line-height: 1.4; }
.det-hdr-info b { font-weight: 600; }
#det-reply-btn.btn { background: var(--teal-d); border: 1px solid var(--teal-l); color: #fff; font-size: 0.78em !important; padding: 3px 10px !important; }
#det-reply-btn.btn:hover { background: var(--teal-l); color: #fff; }
.inbox-detail-body-wrap { flex: 1; overflow-y: auto; padding: 14px; font-size: 0.85em; background: var(--bg); }
.inbox-detail-text { color: var(--text-dim); line-height: 1.7; word-break: break-word; }
.inbox-detail-foot { padding: 6px 14px; min-height: 38px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg2); display: flex; align-items: center; }
.det-foot-form { display: flex; justify-content: flex-end; gap: 8px; }
option[hidden] { display: none; }
.inbox-tab.has-unread { font-weight: 700; }
.back-arrow { font-size:0.75em;vertical-align:middle;margin-right:10px;opacity:0.75;color:var(--teal-l);text-decoration:none;font-weight:700; }
/* Confirm modal */
.modal-box--sm { max-width: 400px; }
.modal-box--sm .modal-body { padding: 20px 24px; }
.modal-box--sm .modal-body h2 { font-size: 1em; font-weight: 600; margin: 0 0 10px; color: var(--text); line-height: 1.4; }
.modal-box--sm .modal-body p { margin: 0; line-height: 1.55; color: var(--text-dim); font-size: 0.9em; }
.modal-box--sm .modal-body p:empty { display: none; }
.inbox-detail-placeholder { color: var(--text-dim); font-size: 0.85em; opacity: 0.5; padding: 32px 0; text-align: center; }

@media (max-width: 900px) {
  .inbox-detail { display: none; }
  .inbox-detail.mobile-open {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
  }
}

/* ── Inbox controls (above tab buttons) ────────────────────────────────────── */
.inbox-ctrl {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.inbox-ctrl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.8em;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  line-height: 1.2;
}
.inbox-ctrl-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.inbox-ctrl-btn.compose { color: var(--teal-l); font-weight: 600; }
.inbox-ctrl-btn.compose:hover { background: rgba(0,200,200,0.08); }

/* ── Compose modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 480px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.88em;
  flex-shrink: 0;
}
.modal-hdr button { background: none; border: none; color: var(--text-dim); font-size: 1.1em; cursor: pointer; line-height: 1; padding: 0 2px; }
.modal-hdr button:hover { color: var(--text); }
.modal-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Autocomplete dropdown ──────────────────────────────────────────────────── */
.ac-wrap { position: relative; }
.ac-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 10;
  max-height: 160px;
  overflow-y: auto;
}
.ac-dropdown[hidden] { display: none; }
.ac-item { padding: 6px 10px; font-size: 0.85em; cursor: pointer; color: var(--text); }
.ac-item:hover { background: var(--bg); color: var(--teal-l); }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--teal-d);
  color: var(--teal-l);
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 0.83em;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── Content page ───────────────────────────── */
.content-page {
  max-width: 720px;
  margin: 0 auto;
}
.content-page h1 {
  font-size: 1.4em;
  color: var(--teal-l);
  margin-bottom: 24px;
}
.content-page h2 {
  font-size: 1em;
  color: var(--teal-l);
  margin: 24px 0 8px;
}
.content-page h3 {
  font-size: 0.95em;
  color: var(--teal-l);
  margin: 16px 0 6px;
}
.content-page pre {
  background: #050f05;
  border: 1px solid #1a3a1a;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0 20px;
  overflow-x: auto;
}
.content-page pre code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82em;
  color: #33ff33;
  line-height: 1.7;
  text-shadow: 0 0 6px rgba(51,255,51,0.35);
}
.content-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
  margin: 16px 0 20px;
}
.content-page th {
  background: var(--bg2);
  color: var(--teal-l);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border);
}
.content-page td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}
.content-page tr:nth-child(even) td { background: var(--bg2); }
.content-page p, .content-page li {
  font-size: 0.92em;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 10px;
}
.content-page ul { padding-left: 20px; margin-bottom: 10px; }
.content-page address { font-style: normal; color: var(--text-dim); font-size: 0.92em; line-height: 1.8; }
.content-page .lang-note {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.82em;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ── Changelog ──────────────────────────────── */
.changelog-list { margin-top: 8px; }
.changelog-entry {
  display: flex;
  gap: 20px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9em;
}
.changelog-date { color: var(--text-dim); font-size: 0.85em; white-space: nowrap; min-width: 90px; }
.changelog-msg  { color: var(--text); }
