[x-cloak] { display: none !important; }

:root {
  --bone-50: #f4f3ee;
  --line: rgba(10,13,10,.14);
  --line-dark: rgba(223,229,221,.12);
  --phos: #15a259;
  --phos-bright: #23c46c;
}

* { border-radius: 0 !important; }

html { scrollbar-color: rgba(21,162,89,.4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(21,162,89,.28); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(21,162,89,.5); border: 2px solid transparent; background-clip: padding-box; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* CRT scanlines — faint horizontal raster */
.scanlines {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(10,13,10,.04) 0px,
    rgba(10,13,10,.04) 1px,
    transparent 1px,
    transparent 3px
  );
}
html.dark .scanlines {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(120,255,180,.035) 0px,
    rgba(120,255,180,.035) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* Blinking terminal cursor */
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.cursor-blink { animation: blink 1.1s steps(1) infinite; }

/* Chips — square filter toggles */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 30px; padding: 0 .7rem;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid var(--line);
  color: #615d4e;
  background: transparent;
  white-space: nowrap;
  transition: all .12s ease;
}
html.dark .chip { border-color: var(--line-dark); color: #929c8e; }
.chip:hover { border-color: var(--phos); color: var(--phos); }
html.dark .chip:hover { border-color: var(--phos-bright); color: var(--phos-bright); }
.chip-on {
  background: var(--phos); color: #070907 !important;
  border-color: var(--phos) !important;
}
html.dark .chip-on { background: var(--phos-bright); color: #070907 !important; border-color: var(--phos-bright) !important; }

/* Sidebar rows */
.sb-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  height: 34px; padding: 0 .6rem;
  border: 1px solid transparent;
  font-size: 12.5px; letter-spacing: .02em;
  color: #45423a;
  transition: background .1s, color .1s, border-color .1s;
}
html.dark .sb-row { color: #bcc4b9; }
.sb-row:hover { background: rgba(21,162,89,.07); color: #093521; }
html.dark .sb-row:hover { background: rgba(35,196,108,.08); color: #84e9aa; }
.sb-row-active {
  border-left: 2px solid var(--phos);
  background: rgba(21,162,89,.09); color: #0d6238; font-weight: 600;
}
html.dark .sb-row-active { background: rgba(35,196,108,.1); color: #4fdc88; }

/* Ghost buttons */
.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 32px; padding: 0 .6rem;
  border: 1px solid transparent;
  color: inherit;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  transition: background .1s, border-color .1s, color .1s;
}
.btn-ghost:hover { background: rgba(21,162,89,.08); border-color: var(--line); }
html.dark .btn-ghost:hover { background: rgba(35,196,108,.08); border-color: var(--line-dark); }

/* Icon buttons (top bar / actions) */
.iconbtn {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  color: #45423a;
  transition: background .1s, color .1s, border-color .1s;
}
html.dark .iconbtn { color: #bcc4b9; }
.iconbtn:hover { background: rgba(21,162,89,.08); color: var(--phos); border-color: var(--line); }
html.dark .iconbtn:hover { background: rgba(35,196,108,.08); color: var(--phos-bright); border-color: var(--line-dark); }

/* Kbd */
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px;
  border: 1px solid var(--line);
  background: rgba(10,13,10,.04);
  color: #45423a;
  letter-spacing: 0;
}
html.dark kbd { background: rgba(223,229,221,.05); border-color: var(--line-dark); color: #929c8e; }

/* Toast animation */
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.animate-toast { animation: toastIn .18s steps(4) both; }

/* Soft spin for refresh */
@keyframes spinSoft { to { transform: rotate(360deg); } }
.animate-spin-soft i { animation: spinSoft .8s linear; transform-origin: center; }

/* Mail row selection / cursor */
.mail-row.selected { background: rgba(21,162,89,.08) !important; box-shadow: inset 2px 0 0 var(--phos); }
html.dark .mail-row.selected { background: rgba(35,196,108,.09) !important; }
.mail-row[data-current="1"] { background: rgba(10,13,10,.04); box-shadow: inset 2px 0 0 rgba(21,162,89,.5); }
html.dark .mail-row[data-current="1"] { background: rgba(223,229,221,.04); }

iframe#mailFrame { color-scheme: light dark; }

/* Mail row link reset */
.mail-row { text-decoration: none; color: inherit; }

/* Square checkbox accent */
input[type="checkbox"] { accent-color: var(--phos); }
