:root {
  --bg: #1b1c1f;
  --header: #161618;
  --panel: #121316;
  --panel-2: #1a1b1f;
  --line: #2a2c32;
  --ink: #f2f3f5;
  --muted: #9999a0;
  --dim: #6c6c70;
  --cyan: #29e4f1;
  --cyan-2: #1cbbb9;
  --blue: #189dca;
  --gold: #bb9a6c;
  --red: #e34949;
  --ok: #3ad39a;
  --warn: #e0b25c;
  --weibo: #ff8200;
  --grad: linear-gradient(90deg, #189dca, #1cbcb8);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.hidden { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.error-text { color: #ff8b8b; min-height: 1.2em; font-size: 13px; }

.kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--cyan);
  font-weight: 700;
}
.kicker.warn { color: #ff8b8b; }

.btn {
  border: 1px solid #3a3d45;
  background: transparent;
  color: #d8d8dc;
  border-radius: 2px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.btn:hover { border-color: var(--cyan-2); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn.primary {
  background: var(--grad);
  border-color: #1cbbb9;
  color: #fff;
}
.btn.primary:disabled { opacity: 0.38; cursor: not-allowed; }
.btn.danger {
  border-color: #7a3030;
  color: #ffb4b4;
  background: rgba(227, 73, 73, 0.12);
}

/* login */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: #0e0f12;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(40, 228, 241, 0.12), transparent 32%),
    radial-gradient(circle at 82% 88%, rgba(24, 157, 202, 0.16), transparent 36%),
    linear-gradient(#1b1c1f, #0e0f12);
}
.login-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%);
}
.login-card {
  position: relative;
  width: 400px;
  padding: 28px 32px 32px;
  background: rgba(18, 19, 22, 0.92);
  border: 1px solid #2c2e36;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--cyan-2);
}
.login-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.login-card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.login-logo { display: block; height: 56px; width: auto; margin: 0 auto 8px; }
.login-title { display: block; width: 220px; margin: 0 auto 6px; }
.login-kicker {
  text-align: center;
  letter-spacing: 0.28em;
  color: var(--cyan);
  font-size: 11px;
  margin: 0 0 22px;
}
.login-card label { display: block; font-size: 12px; margin-bottom: 14px; color: var(--muted); }
.login-card input {
  display: block; width: 100%; margin-top: 6px;
  border: 1px solid #3a3d45; border-radius: 2px;
  padding: 10px 12px; background: #0e0f12;
}
.login-card input:focus { outline: none; border-color: var(--cyan-2); }
.password-field { position: relative; display: block; }
.login-card .password-field { margin-top: 6px; }
.login-card .password-field input { margin-top: 0; padding-right: 40px; }
.password-toggle {
  position: absolute; right: 4px; top: 0; bottom: 0;
  width: 32px; margin: 0; padding: 0;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer;
}
.password-toggle svg { width: 18px; height: 18px; display: block; }
.password-toggle .eye-off { display: none; }
.password-toggle.is-visible .eye-on { display: none; }
.password-toggle.is-visible .eye-off { display: block; }
.password-toggle:hover,
.password-toggle:focus-visible { color: var(--cyan); }
.password-toggle:focus { outline: none; }
.login-card button[type="submit"] {
  width: 100%; margin-top: 6px; padding: 12px;
  background: var(--grad); color: #fff; border: 1px solid #1cbbb9;
  cursor: pointer; letter-spacing: 0.12em;
}

/* app chrome */
.app { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  height: 72px;
  background: var(--header);
  border-bottom: 1px solid #222328;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px 0 8px; flex-shrink: 0;
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--grad);
  opacity: 0.85;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-logo img { display: block; height: 64px; width: auto; }
.brand-text strong { display: block; font-size: 16px; letter-spacing: 0.04em; }
.brand-text .en {
  display: block; font-size: 11px; letter-spacing: 0.18em;
  color: var(--muted); margin-top: 2px;
}
.top-meta { display: flex; gap: 10px; align-items: center; }
.top-meta .btn { white-space: nowrap; }
.user-chip {
  font-size: 12px; color: var(--gold);
  padding: 4px 10px; border: 1px solid rgba(187,154,108,.35);
  white-space: nowrap;
}
.badge {
  font-size: 12px; padding: 4px 10px;
  border: 1px solid #3a3d45; color: var(--muted);
  background: #111214;
}
.badge.ok { border-color: rgba(58,211,154,.5); color: var(--ok); }
.badge.warn { border-color: rgba(224,178,92,.5); color: var(--warn); }
.badge.err { border-color: rgba(227,73,73,.55); color: #ff8b8b; }

.layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) minmax(240px, 340px);
  gap: 10px;
  padding: 10px;
}
.col { min-height: 0; overflow: auto; min-width: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  pointer-events: none;
}
.col.left::before, .col.center::before, .alert-zone::before {
  top: 0; left: 0; border-top: 1px solid var(--cyan-2); border-left: 1px solid var(--cyan-2);
}
.col.left::after, .col.center::after, .log-zone::after {
  bottom: 0; right: 0; border-bottom: 1px solid var(--cyan-2); border-right: 1px solid var(--cyan-2);
}
.col.left, .col.center { padding: 16px; }
.col.left {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}
.col.right {
  border: 0; background: transparent; padding: 0;
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
}
.col-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.col-head h2, .log-zone h2, .uplink h2 {
  margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.06em;
}
.uplink {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker refresh"
    "title  refresh"
    "hint   hint"
    "meta   meta"
    "filters filters";
  column-gap: 10px;
  row-gap: 6px;
  align-items: start;
  min-width: 0;
}
.uplink .kicker { grid-area: kicker; }
.uplink h2 { grid-area: title; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uplink .hint { grid-area: hint; margin: 0; min-width: 0; }
.uplink #refresh-inbox {
  grid-area: refresh;
  white-space: nowrap;
  align-self: start;
  justify-self: end;
}
.scan-meta {
  grid-area: meta;
  font-size: 12px;
  color: var(--dim);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-filters {
  grid-area: filters;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.filter-chip {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 5px 8px;
  border: 1px solid #3a3d45;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  text-align: left;
}
.filter-chip .lab {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-chip .n {
  color: var(--dim);
  flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--cyan-2); color: #fff; }
.filter-chip.active {
  border-color: var(--cyan-2);
  color: var(--cyan);
  background: rgba(28, 187, 185, 0.12);
}
.log-cats .filter-chip {
  width: auto;
  display: inline-flex;
  grid-template-columns: none;
  padding: 4px 8px;
}

.draft-status-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.draft-status-wrap select {
  background: #0e0f12;
  border: 1px solid #3a3d45;
  border-radius: 2px;
  padding: 4px 8px;
  min-width: 108px;
}
.draft-status-wrap select:focus { outline: none; border-color: var(--cyan-2); }

.status-menu {
  position: fixed;
  z-index: 30;
  min-width: 128px;
  background: #16171b;
  border: 1px solid #2c2e36;
  padding: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.status-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
}
.status-menu button:hover { background: rgba(28, 187, 185, 0.12); }
.status-menu button.active { color: var(--cyan); }

.dropzone {
  display: block;
  border: 1px dashed #3a8ea8;
  background: #0e0f12;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  color: #cfd0d4;
}
.dropzone span { display: block; font-size: 13px; }
.dropzone em { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--dim); }
.dropzone:hover, .dropzone.dragover { border-color: var(--cyan); background: rgba(41, 228, 241, 0.08); }

.mail-list { list-style: none; margin: 0; padding: 0; min-height: 0; overflow: auto; }
.mail-list li {
  border: 1px solid #2a2c32;
  background: #16171b;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.mail-list li:hover { border-color: #3a8ea8; }
.mail-list li.active {
  border-color: var(--cyan-2);
  background: rgba(28, 187, 185, 0.08);
  box-shadow: inset 2px 0 0 var(--cyan);
}
.mail-from { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.mail-from > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-subject { margin: 6px 0 2px; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: 11px; color: var(--dim); margin: 0 0 4px; }
.mail-preview { font-size: 12px; color: #7d7e84; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.status-pill {
  font-size: 11px; padding: 1px 7px;
  border: 1px solid #3a3d45; color: var(--muted);
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
  flex-shrink: 0;
}
.status-pill:hover { border-color: #8a8d96; color: #fff; }
.status-pill.tested { border-color: rgba(28,187,184,.55); color: var(--cyan); }
.status-pill.published { border-color: rgba(58,211,154,.5); color: var(--ok); }
.status-pill.failed { border-color: rgba(227,73,73,.55); color: #ff8b8b; }
.status-pill.publishing { border-color: rgba(224,178,92,.5); color: var(--warn); }
.status-pill.skipped { border-color: rgba(187,154,108,.45); color: var(--gold); }
.status-pill.pending { border-color: #3a3d45; color: var(--muted); }
.status-pill.unverified { border-color: rgba(224,178,92,.55); color: var(--warn); }
.status-pill:disabled { cursor: default; opacity: 0.85; }
.status-pill:disabled:hover { border-color: inherit; color: inherit; }
.dup-flag { font-size: 11px; color: var(--warn); margin: -2px 0 4px; }
.draft-banner {
  border: 1px solid rgba(224,178,92,.5);
  background: rgba(224,178,92,.08);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 13px;
  color: #f0d9a8;
}
.draft-banner strong { display: block; margin-bottom: 4px; color: var(--warn); }
.draft-banner p { margin: 0 0 8px; line-height: 1.5; }
.draft-banner .banner-actions { display: flex; gap: 8px; }
.setup-title { margin: 4px 0 8px; font-size: 20px; color: #fff; }
#setup-view .login-card { max-width: 420px; }
#setup-view form { display: flex; flex-direction: column; gap: 10px; }
.credential-text {
  background: #101216;
  border: 1px solid #33363d;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  color: #f0d9a8;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 8px 0 4px;
}

.steps {
  list-style: none; display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px; padding: 0; margin: 14px 0 10px;
}
.steps li {
  font-size: 11px;
  border: 1px solid #2a2c32;
  background: #16171b;
  padding: 10px 8px;
  min-height: 72px;
}
.steps li.ok {
  border-color: #2f5156;
  background: rgba(41, 228, 241, 0.05);
}
.steps li.error { border-color: rgba(227,73,73,.55); color: #ff8b8b; background: rgba(227,73,73,0.1); }
.steps li.running,
.steps li.current {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(41, 228, 241, 0.14);
  box-shadow: 0 0 16px rgba(41, 228, 241, 0.18);
}
.steps li.error.current {
  border-color: rgba(227,73,73,.8);
  color: #ff8b8b;
  background: rgba(227,73,73,0.16);
  box-shadow: 0 0 16px rgba(227, 73, 73, 0.18);
}
.step-num {
  display: block; width: 18px; height: 18px; line-height: 16px;
  border: 1px solid currentColor; border-radius: 50%;
  text-align: center; font-size: 10px; margin-bottom: 6px; color: var(--muted);
}
.steps li.ok .step-num { color: var(--cyan-2); border-color: var(--cyan-2); }
.steps li.current .step-num {
  color: #081216;
  background: var(--grad);
  border-color: transparent;
  font-weight: 700;
}
.steps li.error.current .step-num {
  color: #fff;
  background: var(--red);
}
.steps .sid { display: block; color: #cfd0d4; margin-bottom: 4px; }
.steps li.current .sid { color: var(--cyan); }
.steps .smsg { display: block; color: var(--dim); line-height: 1.3; word-break: break-all; }
.steps .step-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--cyan);
  font-weight: 600;
  text-decoration: none;
}
.steps .step-link:hover { text-decoration: underline; }
.steps .step-link.hint { color: var(--dim); font-weight: 500; cursor: default; }
.inline-link {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}
.inline-link:hover { text-decoration: underline; }

.empty {
  margin-top: 72px; text-align: center; color: var(--muted);
  position: relative;
}
.empty-ghost {
  display: block;
  font-size: 42px; letter-spacing: 0.28em; font-style: italic;
  color: rgba(255,255,255,0.04); margin-bottom: 8px;
}

.mode-bar {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  align-items: center;
  flex-wrap: wrap;
}
.visible-picker {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.visible-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.visible-seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel-2);
}
.visible-opt {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.visible-opt + .visible-opt { border-left: 1px solid var(--line); }
.visible-opt:hover { color: var(--ink); }
.visible-opt:disabled,
.visible-opt:disabled:hover {
  color: var(--muted);
  opacity: 0.45;
  cursor: not-allowed;
}
.visible-opt.active {
  color: var(--ink);
  background: rgba(28, 187, 184, 0.16);
}
.visible-opt[data-visible="0"].active {
  color: var(--warn);
  background: rgba(224, 178, 92, 0.16);
}
.pane-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 8px;
}
#edit-pane .pane-actions { justify-content: flex-end; }
.pane-actions .btn { min-width: 120px; }
.pane-actions .btn:disabled { opacity: 0.38; cursor: not-allowed; }
.review-btn {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: rgba(224, 178, 92, 0.75);
  color: var(--warn);
  background: rgba(224, 178, 92, 0.1);
  letter-spacing: 0.04em;
}
.review-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.review-btn:hover:not(:disabled) {
  border-color: var(--warn);
  color: #fff;
  background: rgba(224, 178, 92, 0.22);
}
.pane-actions .review-btn.is-done,
.pane-actions .review-btn.is-done:disabled {
  opacity: 1;
  cursor: default;
  border-color: rgba(58, 211, 154, 0.7);
  color: #d9ffef;
  background: rgba(58, 211, 154, 0.16);
}
.review-btn.is-done .review-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: inset 0 0 0 2px rgba(18, 19, 22, 0.35);
  position: relative;
}
.review-btn.is-done .review-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 3px;
  height: 6px;
  border: solid #123028;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.preview-label {
  font-size: 11px; letter-spacing: 0.16em; color: var(--gold);
  margin: 8px 0 10px;
}
.weibo-card {
  max-width: 560px; margin: 0 auto 16px;
  border: 1px solid #eadfce;
  border-radius: 4px; padding: 16px;
  background: #fff; color: #1d1d1f;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.wb-head { display: flex; gap: 10px; align-items: flex-start; }
.wb-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  object-fit: cover; background: #111; flex-shrink: 0;
  display: block;
}
.wb-head-meta { min-width: 0; padding-top: 2px; }
.wb-name-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.wb-name {
  font-weight: 700;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-name:hover { color: var(--weibo); }
.wb-vip {
  width: 15px; height: 15px; border-radius: 3px; background: #ffb114;
  color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center;
  flex-shrink: 0; line-height: 1; font-family: Arial, sans-serif;
}
.wb-member {
  height: 15px; padding: 0 4px; border-radius: 3px;
  background: linear-gradient(180deg, #ffe3a4, #e0b25c);
  color: #6a4a12; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0; line-height: 1;
}
.wb-meta-row { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.wb-time, .wb-from { font-size: 12px; color: #939393; }
.wb-text { margin: 12px 0; white-space: pre-wrap; line-height: 1.6; font-size: 15px; }
.wb-text .wb-link { color: #eb7340; }
.wb-media { display: grid; gap: 4px; }
.wb-media.g1 { grid-template-columns: 1fr; }
.wb-media.g2, .wb-media.g4 { grid-template-columns: 1fr 1fr; }
.wb-media.g3, .wb-media.g5, .wb-media.g6, .wb-media.g7, .wb-media.g8, .wb-media.g9 {
  grid-template-columns: 1fr 1fr 1fr;
}
.wb-media img, .wb-media video {
  width: 100%; height: 280px; object-fit: contain; background: #f3f3f3;
  cursor: zoom-in;
}
.wb-media.g1 img, .wb-media.g1 video {
  height: 640px;
  object-fit: contain;
}
.wb-media img:hover, .wb-media video:hover { outline: 2px solid #eb7340; outline-offset: -2px; }
.wb-foot {
  display: flex; justify-content: space-around; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #ececec; color: #8a8a8a; font-size: 13px;
}

#edit-text {
  width: 100%; border: 1px solid #3a3d45; border-radius: 2px;
  padding: 12px; resize: vertical; background: #0e0f12; color: #f2f3f5;
  white-space: pre-wrap; line-height: 1.55;
}
#edit-text:focus { outline: none; border-color: var(--cyan-2); }
.count-row { text-align: right; font-size: 12px; color: var(--dim); margin: 4px 0 10px; }
.media-edit-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; }
.media-edit .dropzone { margin-bottom: 10px; }
.media-list { display: flex; flex-wrap: wrap; gap: 8px; }
.media-chip {
  width: 120px; border: 1px solid #2a2c32; overflow: hidden; position: relative; background: #0e0f12;
}
.media-chip img, .media-chip video {
  width: 100%; height: 180px; object-fit: contain; display: block; background: #111;
  cursor: zoom-in;
}
.media-chip img:hover, .media-chip video:hover { outline: 1px solid var(--cyan-2); outline-offset: -1px; }
.media-chip button {
  position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0,0,0,.7);
  color: #fff; cursor: pointer; font-size: 11px; padding: 2px 6px;
  z-index: 1;
}
.media-chip span { display: block; font-size: 11px; padding: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-chip.pending { border-color: var(--cyan-2); }
.media-chip.pending span { color: var(--cyan); }

.alert-zone, .log-zone { padding: 14px; min-height: 0; }
.alert-zone { flex: 0 0 38%; overflow: auto; }
.log-zone { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.log-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px;
}
.log-day-btn {
  border: 1px solid #3a3d45;
  background: #111214;
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.log-day-btn:hover { border-color: var(--cyan-2); color: #fff; }
.log-calendar {
  position: fixed;
  z-index: 35;
  width: 268px;
  padding: 10px;
  background: #16171b;
  border: 1px solid #2c2e36;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  height: auto;
}
.log-calendar .cal-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.log-calendar .cal-title {
  flex: 1; display: flex; gap: 6px; min-width: 0;
}
.log-calendar .cal-title select {
  flex: 1; min-width: 0;
  background: #0e0f12; border: 1px solid #3a3d45; color: var(--ink);
  padding: 4px 6px; font-size: 12px;
}
.log-calendar .cal-nav {
  width: 28px; height: 28px; padding: 0;
  border: 1px solid #3a3d45; background: transparent; color: var(--ink);
  cursor: pointer; font-size: 16px; line-height: 1;
}
.log-calendar .cal-nav:hover { border-color: var(--cyan-2); color: var(--cyan); }
.log-calendar .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 32px);
  grid-auto-rows: 32px;
  justify-content: space-between;
  align-content: start;
  gap: 2px;
}
.log-calendar .cal-dow,
.log-calendar .cal-day,
.log-calendar .cal-pad {
  min-width: 0;
  min-height: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 32px;
  text-align: center;
  font-size: 12px;
  box-sizing: border-box;
}
.log-calendar .cal-dow {
  color: var(--dim);
  font-size: 11px;
}
.log-calendar .cal-pad { visibility: hidden; pointer-events: none; }
.log-calendar .cal-day {
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 2px;
  position: relative;
  -webkit-appearance: none;
  appearance: none;
}
.log-calendar .cal-day:hover { background: rgba(28, 187, 185, 0.12); color: var(--cyan); }
.log-calendar .cal-day.today { box-shadow: inset 0 0 0 1px rgba(28, 187, 185, 0.45); }
.log-calendar .cal-day.selected { background: var(--grad); color: #fff; }
.log-calendar .cal-day.has-log::after {
  content: "";
  position: absolute; left: 50%; bottom: 4px;
  width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--cyan-2);
}
.log-calendar .cal-day.selected.has-log::after { background: #fff; }
.log-calendar .cal-foot {
  display: flex; justify-content: flex-end; margin-top: 8px;
}
.log-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.log-list { flex: 1; overflow: auto; }
.alert-list, .log-list { list-style: none; margin: 10px 0 0; padding: 0; }
.alert-list li {
  border-left: 2px solid #e34949;
  background: rgba(227, 73, 73, 0.08);
  padding: 8px 10px; margin-bottom: 8px; font-size: 13px;
}
.alert-list .ts, .log-list .ts { color: var(--dim); font-size: 11px; display: block; }
.log-list li {
  font-size: 12px; padding: 7px 0;
  border-bottom: 1px dashed #2a2c32;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #b9bbc2;
}
.log-list li.error { color: #ff8b8b; }
.log-list li.warn { color: var(--warn); }

.confirm-mask {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: rgba(8, 9, 12, 0.72);
}
.confirm-card {
  width: min(420px, calc(100vw - 32px));
  padding: 22px 24px 20px;
  background: #16171b;
  border: 1px solid #2c2e36;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  position: relative;
}
.confirm-card::before,
.confirm-card::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--cyan-2);
}
.confirm-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.confirm-card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.confirm-card h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: 0.04em; }
.confirm-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.users-card { width: min(560px, calc(100vw - 32px)); }
.users-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 40vh; overflow: auto; }
.users-list li {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed #2a2c32; font-size: 13px;
}
.users-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.users-actions select {
  background: #0e0f12; border: 1px solid #3a3d45; color: var(--ink);
  padding: 4px 6px; font-size: 12px;
}
.users-form {
  display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px;
  margin-top: 14px;
}
.users-form input, .users-form select {
  background: #0e0f12; border: 1px solid #3a3d45; color: var(--ink);
  padding: 6px 8px; font-size: 13px;
}
.users-form .password-field { min-width: 0; }
.users-form .password-field input { width: 100%; padding-right: 34px; }
@media (max-width: 700px) {
  .users-form { grid-template-columns: 1fr; }
}

.admin-page .admin-app { min-height: 100vh; }
.admin-nav {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 18px 0;
}
.admin-nav a {
  padding: 7px 14px;
  border: 1px solid #3a3d45;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.admin-nav a:hover { border-color: var(--cyan-2); color: #fff; }
.admin-nav a.active {
  color: #fff;
  border-color: var(--cyan-2);
  background: rgba(28, 187, 185, 0.16);
}
.admin-layout {
  display: block;
  padding: 16px 18px 24px;
  max-width: 960px;
  margin: 0 auto;
}
.admin-panel { padding: 18px 20px 20px; min-height: 420px; }
.admin-users-list { max-height: none; }
.admin-users-form {
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto auto;
}
.password-dialog .password-field { margin-top: 10px; }
.password-dialog .password-field input {
  width: 100%;
  background: #0e0f12;
  border: 1px solid #3a3d45;
  color: var(--ink);
  padding: 8px 34px 8px 10px;
  font: inherit;
}
.password-dialog .error-text { margin-top: 8px; }
.rules-form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.rules-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.rules-form input[type="text"] {
  width: 100%;
  background: #0e0f12;
  border: 1px solid #3a3d45;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.rules-form input[type="text"]:focus { outline: none; border-color: var(--cyan-2); }
@media (max-width: 980px) {
  .admin-users-form { grid-template-columns: 1fr; }
}

.media-viewer {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(8, 9, 12, 0.88);
  padding: 32px 24px 24px;
}
.media-viewer-close {
  position: absolute; top: 16px; right: 18px;
  border: 1px solid #3a3d45; background: #16171b; color: #f2f3f5;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}
.media-viewer-close:hover { border-color: var(--cyan-2); color: var(--cyan); }
.media-viewer img, .media-viewer video {
  max-width: min(96vw, 1400px);
  max-height: calc(100vh - 72px);
  object-fit: contain;
  background: #000;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}
.media-viewer img { cursor: zoom-out; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .col.left { min-height: 280px; max-height: 48vh; }
  .col.right { min-height: 420px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
