/* Paleta = web a appka PSippr (sites/psippr.org/style.css, Theme.kt): černá, žlutý akcent. */
:root {
  --bg: #000000;
  --surface: #141414;
  --surface2: #1c1c1c;
  --accent: #f5c518;
  --text: #e0e0e0;
  --muted: #757575;
  --line: #262626;
  --bad: #e53935;
  --side-w: 240px;
}
* { box-sizing: border-box; }
/* `display: grid` u .login/.app jinak přebije atribut hidden — přihlašovací formulář zůstal
   viset nad poštou i po úspěšném přihlášení (29. 9. 2026: „webmail se nelze přihlásit") */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.dim { color: var(--muted); font-weight: 400; }
.small { font-size: 12px; }
.bad { color: var(--bad); }
.brand { font-size: 20px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.brand.big { font-size: 28px; text-align: center; margin-bottom: 18px; }
button { padding: 8px 14px; border-radius: 8px; border: 0; background: var(--accent); color: #000; font: inherit; font-weight: 600; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.icon { background: transparent; color: var(--text); padding: 6px 10px; font-size: 16px; }
button.icon:hover { background: var(--surface2); }
input, textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
textarea { resize: vertical; }

.login { min-height: 100vh; z-index: 3; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 12px; padding: 24px; }
.login form { display: grid; gap: 10px; }

.app { z-index: 2; display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: auto 1fr; height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 2px solid var(--accent); }
.search { flex: 1; max-width: 640px; }
.search input { border-radius: 20px; background: var(--surface2); }
.me { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
#menu { display: none; }

.side { padding: 12px 8px; overflow-y: auto; border-right: 1px solid var(--line); }
.compose-btn { margin: 4px 8px 14px; padding: 12px 20px; border-radius: 16px; }
.box { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; border-radius: 0 16px 16px 0; cursor: pointer; color: var(--text); }
.box:hover { background: var(--surface2); }
.box.active { background: var(--surface2); color: var(--accent); font-weight: 700; }
.box .n { font-size: 12px; font-weight: 700; }

.main { position: relative; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
#range { margin-left: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 28px 200px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: var(--surface); }
.row.unread { font-weight: 700; background: var(--surface); }
.row .from, .row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub .dim { font-weight: 400; }
.row .date { font-size: 12px; white-space: nowrap; }
.star { background: none; padding: 0; color: var(--muted); font-size: 16px; }
.star.on { color: var(--accent); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.msg { padding: 16px 24px 40px; max-width: 1000px; }
.msg h1 { font-size: 22px; font-weight: 500; margin: 6px 0 16px; }
.msg-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
#msg-html { width: 100%; min-height: 60vh; border: 0; background: #fff; border-radius: 8px; margin-top: 16px; }
#msg-text { white-space: pre-wrap; word-break: break-word; font: inherit; margin-top: 16px; }
.att { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.att a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); text-decoration: none; }

.compose { position: absolute; right: 24px; bottom: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 12px 12px 0 0; z-index: 10; }
.compose-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--surface2); border-radius: 12px 12px 0 0; }
.compose form { display: grid; gap: 8px; padding: 12px; }
.compose-foot { display: flex; justify-content: flex-start; }


@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  #menu { display: inline-block; }
  .side { position: fixed; top: 56px; bottom: 0; left: 0; width: var(--side-w); background: var(--bg); z-index: 5; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .me { display: none; }
  .row { grid-template-columns: 24px 1fr auto; }
  .row .sub { grid-column: 2 / -1; }
}

/* --- vrstvy (29. 9. 2026, pokyn: „žádná jednostránka, nepotřebné části skrýt jako vrstvy
   ve Photoshopu") — vidět je jen aktivní vrstva, ostatní jsou průhledné, neklikatelné
   a mimo tab pořadí; přepnutí je animované --- */
:root { --anim: 220ms; --ease: cubic-bezier(.2, .8, .2, 1); }
.layer, .pane {
  transition: opacity var(--anim) var(--ease), transform var(--anim) var(--ease), visibility 0s linear 0s;
}
.layer { position: fixed; inset: 0; }
.pane { position: absolute; inset: 0; overflow-y: auto; background: var(--bg); }
.layer.off, .pane.off {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--anim) var(--ease), transform var(--anim) var(--ease), visibility 0s linear var(--anim);
}
.layer.off { transform: scale(.985); }
.pane.off { transform: translateX(24px); }
.compose-layer { z-index: 10; background: rgba(0, 0, 0, .45); }
.compose-layer.off .compose { transform: translateY(24px); }
.compose { transition: transform var(--anim) var(--ease); }

/* --- snackbar notifikace --- */
.snackbar { position: fixed; left: 16px; bottom: 16px; z-index: 30; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.snack { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px;
  background: var(--surface2); color: var(--text); border-left: 4px solid var(--accent); box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
  transform: translateY(16px); opacity: 0; transition: opacity var(--anim) var(--ease), transform var(--anim) var(--ease); }
.snack.in { transform: none; opacity: 1; }
.snack.error { border-left-color: var(--bad); }
.snack button { margin-left: auto; background: none; color: var(--accent); padding: 0 4px; }
@media (prefers-reduced-motion: reduce) { :root { --anim: 1ms; } }
