:root { color-scheme: dark; --red: #e0383e; --fg: #cfcfcf; --dim: #5f5f5f; --line: #161616; --hi: #fff; --bad: #8a4a4a; --good: #4a7a5a; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; color: var(--fg); font: 13px/1.6 ui-monospace, Consolas, "Cascadia Mono", monospace; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: 0; outline: 0; border-radius: 0; }
button { cursor: pointer; color: var(--dim); white-space: nowrap; }
button:hover { color: var(--hi); }
button:disabled { opacity: .4; cursor: default; }
input, select, textarea { width: 100%; padding: 8px 0; border-bottom: 1px solid var(--line); }
input:focus, select:focus { border-color: #333; }
input[type=number]::-webkit-inner-spin-button { display: none; }
::placeholder { color: #3a3a3a; }
option { background: #000; }
ul { list-style: none; }
[hidden] { display: none !important; }
.err { color: var(--bad); font-size: 12px; }
.ok { color: var(--good); font-size: 12px; }
.dim { color: var(--dim); }

#login { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
#login input { width: 180px; text-align: center; letter-spacing: 6px; }
#err { color: var(--bad); font-size: 12px; min-height: 19px; }

#app { display: grid; grid-template-columns: 220px 320px 1fr; height: 100%; }
#app.settings-open #list, #app.settings-open #view { display: none; }
#settings { grid-column: 2 / 4; display: flex; flex-direction: column; min-height: 0; }

aside, #list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.top { display: flex; justify-content: space-between; align-items: center; height: 44px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--dim); }

#folders { flex: 1; display: flex; flex-direction: column; padding: 8px 0; }
#folders button { text-align: left; padding: 6px 16px; }
#folders button.on { color: var(--hi); }
#me { color: var(--red); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#write { color: var(--fg); margin-bottom: 10px; }
.count { color: var(--fg); margin-left: 4px; }
.heart, button.liked { color: var(--red); }
.status { margin-left: auto; font-size: 12px; }

#account { position: relative; border-top: 1px solid var(--line); }
#current { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; color: var(--fg); text-align: left; }
#current:hover { color: var(--hi); }
#current-addr { overflow: hidden; text-overflow: ellipsis; }
#others { color: var(--dim); }
#menu { position: absolute; left: 8px; bottom: calc(100% + 4px); width: 340px; max-width: calc(100vw - 16px); background: #000; border: 1px solid #222; z-index: 10; }
#boxes { max-height: 50vh; overflow-y: auto; }
#boxes li { display: flex; gap: 8px; padding: 7px 14px; cursor: pointer; color: var(--dim); }
#boxes li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#boxes li.on, #boxes li:hover { color: var(--hi); }
#boxes .n { color: var(--fg); }
#newbox { display: flex; align-items: center; gap: 6px; padding: 2px 14px; border-top: 1px solid var(--line); }
#newbox input { flex: 1; min-width: 0; border: 0; }
#newbox select { width: auto; max-width: 140px; border: 0; color: var(--dim); }
.at { color: var(--dim); }
#boxerr:empty { display: none; }
#boxerr { padding: 0 14px 6px; }
#menu .foot { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); }

#messages { flex: 1; overflow-y: auto; }
#messages li { padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
#messages li:hover, #messages li.on { background: #080808; }
.row { display: flex; justify-content: space-between; gap: 12px; color: var(--dim); font-size: 12px; }
.who, .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { flex: none; }
.unread .subj { color: var(--hi); }
.unread .who::before { content: "* "; color: var(--hi); }
li.empty, p.empty { color: #333; cursor: default !important; border: 0 !important; background: none !important; }

#view { overflow-y: auto; padding: 0 32px 32px; display: flex; flex-direction: column; }
#view > .bar { height: 44px; flex: none; border-bottom: 1px solid var(--line); margin: 0 -32px; padding: 0 32px; }
#view h1 { font-size: 15px; font-weight: normal; color: var(--hi); margin: 20px 0 8px; }
#view p.empty { margin-top: 20px; }
dl { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; color: var(--dim); font-size: 12px; margin-bottom: 24px; }
dd { word-break: break-all; }
dd.warn { color: var(--bad); }
pre { white-space: pre-wrap; word-break: break-word; font: inherit; }
.bar { display: flex; gap: 16px; align-items: center; }

.compose { display: flex; flex-direction: column; flex: 1; padding-top: 12px; }
.compose textarea { flex: 1; min-height: 260px; resize: none; border: 0; padding-top: 16px; }
.compose .bar { padding-top: 12px; border-top: 1px solid var(--line); }

#settings .body { overflow-y: auto; padding: 8px 32px 48px; }
.section { max-width: 560px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h2 { font-size: 13px; font-weight: normal; color: var(--hi); margin-bottom: 12px; }
.rows li { display: flex; align-items: center; gap: 16px; padding: 4px 0; }
.rows .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { min-width: 0; }
.line { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.line input { flex: 1; min-width: 0; }
.line select { width: auto; max-width: 180px; }
.grid { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 4px 16px; }
.grid label { color: var(--dim); }
.grid .bar { padding-top: 12px; }
.note { color: #3d3d3d; font-size: 12px; margin-top: 16px; }
.sub { font-size: 12px; font-weight: normal; color: var(--dim); margin: 20px 0 4px; }
#outbox li { flex-wrap: wrap; }
.section > .err, .section > .ok { display: block; margin-top: 6px; }
.section > .err:empty, .section > .ok:empty { display: none; }

#cat { position: fixed; right: 20px; bottom: 14px; width: 56px; height: 56px; pointer-events: none; z-index: 5; }
#cat-eyes { transition: transform .15s ease-out; }
#cat .blink { transform-box: fill-box; transform-origin: center; animation: blink 7s infinite; filter: drop-shadow(0 0 1.5px #e0383e); }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }


.rows li.dnspanel { display: block; padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.dnspanel .line { margin: 4px 0 12px; max-width: 420px; }
.dnspanel label { color: var(--dim); }
.dnstable { display: flex; flex-direction: column; gap: 2px; }
.dnsrow { display: grid; grid-template-columns: 18px 70px 1fr 1.4fr; gap: 10px; align-items: baseline; padding: 3px 0; border-bottom: 1px solid #0d0d0d; }
.mark { font-weight: bold; }
.mark.ok { color: var(--good); }
.mark.no { color: var(--bad); }
.rtype { color: var(--dim); }
.rhost { color: var(--fg); word-break: break-all; }
.rval { color: var(--hi); word-break: break-all; }
.refresh { margin-top: 12px; border: 1px solid #222; padding: 4px 14px; }
@media (max-width: 800px) {
  .dnsrow { grid-template-columns: 18px 1fr; }
  .dnsrow .rhost, .dnsrow .rval { grid-column: 2; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #1a1a1a; }

@media (max-width: 800px) {
  #app { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  #settings { grid-column: 1; }
  aside, #list { border-right: 0; border-bottom: 1px solid var(--line); }
  #folders { flex-direction: row; flex-wrap: wrap; padding: 0 0 4px; }
  #write { margin-bottom: 0; }
  #messages { max-height: 40vh; }
  #view { padding: 0 16px 32px; }
  #view > .bar { margin: 0 -16px; padding: 0 16px; }
  #settings .body { padding: 8px 16px 48px; }
  .line { flex-wrap: wrap; }
  #cat { width: 40px; height: 40px; right: 12px; bottom: 10px; }
}
