/* ============================================================
   RMD Portal — editorial paper aesthetic
   inspired by weekreport: Fraunces + IBM Plex Sans/Mono
   palette: warm paper · deep ink · rust accent
   ============================================================ */

:root {
  color-scheme: light only;
  --paper:        #fbfaf5;
  --paper-2:      #f3f0e6;
  --paper-warm:   #f8f4e8;
  --paper-cool:   #f6f3eb;
  --ink:          #0d0d0d;
  --ink-2:        #2a2a2a;
  --sub-ink:      #454545;
  --mute:         #8a8784;
  --faint:        #bdbab1;
  --rule:         #e3dfd2;
  --rule-strong:  #0d0d0d;
  --accent:       #c64a02;
  --accent-deep:  #3a1500;
  --accent-soft:  #f4e0cc;
  --pos:          #1a6a3a;
  --neg:          #a8231e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--paper); }

body {
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); text-decoration: none; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-feature-settings: 'tnum' 1; }
.serif { font-family: 'Fraunces', Georgia, serif; }

/* ========== SHELL ========== */
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 40px 64px;
}

/* ========== MASTHEAD ========== */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.masthead .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}
.masthead .brand .dot {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(198, 74, 2, 0.12);
}
.masthead .brand-name {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.18em;
}
.masthead .brand-sep { color: var(--rule); }
.masthead .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.06em;
  text-align: right;
}
.masthead .meta strong { color: var(--ink); font-weight: 500; }
.masthead .meta .logout {
  display: inline-block;
  margin-left: 14px;
  padding: 4px 12px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--mute);
  letter-spacing: 0.16em;
  transition: all 0.15s ease;
}
.masthead .meta .logout:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ========== TITLE ROW ========== */
.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  padding: 6px 0 22px;
  border-bottom: 2px solid var(--rule-strong);
}
.title-row h1.title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.title-row h1.title em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  color: var(--accent);
}
.title-row .updated {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}
.title-row .updated b { color: var(--ink); font-weight: 500; }

/* ========== PULSE WIDGET ========== */
.pulse {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  margin-bottom: 38px;
}
.pulse-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pulse-head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 96;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.pulse-head h2 .sub {
  color: var(--mute);
  font-weight: 400;
  font-style: italic;
  font-variation-settings: 'opsz' 36, 'SOFT' 100;
  font-size: 0.66em;
  margin-left: 10px;
}
.pulse-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}
.pulse-card {
  padding: 22px 24px 22px 0;
  border-right: 1px solid var(--rule);
}
.pulse-card:first-child { padding-left: 0; }
.pulse-card:nth-child(n+2) { padding-left: 24px; }
.pulse-card:last-child { border-right: none; padding-right: 0; }
.pulse-card .lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  margin-bottom: 10px;
}
.pulse-card .val {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 500;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.pulse-card .val.accent {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.pulse-card .val.name {
  font-size: 28px;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 72, 'SOFT' 40;
  line-height: 1.1;
}
.pulse-card .hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--mute);
  font-family: 'IBM Plex Sans', sans-serif;
}
.pulse-card .forecast {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--sub-ink);
  line-height: 1.55;
  letter-spacing: 0.02em;
}
.pulse-card .forecast b {
  color: var(--accent);
  font-weight: 600;
}

/* ========== KC DAILY BLOCK ========== */
.kc-block {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  margin-bottom: 38px;
}
.kc-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  padding: 22px 0;
}
.kc-left { display: flex; flex-direction: column; gap: 8px; }
.kc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dotted var(--rule);
}
.kc-row:last-child { border-bottom: none; }
.kc-row .k {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--sub-ink);
}
.kc-row b {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 72;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.kc-row.accent b {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'opsz' 72, 'SOFT' 100;
}
.kc-right { display: flex; flex-direction: column; gap: 14px; }
.kc-row.big {
  padding: 6px 0 12px;
  border-bottom: 2px solid var(--rule-strong);
}
.kc-row.big .k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.kc-row.big b {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.kc-row.big b.accent {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.kc-shift {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}
.kc-shift .sh-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}
.kc-shift .sh-vals {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.kc-shift b {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 72;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.kc-shift .d {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--sub-ink);
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .kc-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ========== STAT ROW ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
  padding: 22px 0;
  margin-bottom: 38px;
}
.stat { padding: 0 26px; border-right: 1px solid var(--rule); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: none; padding-right: 0; }
.stat .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  margin-bottom: 10px;
}
.stat .value {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 500;
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat .value.accent {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.stat .value .unit {
  font-family: 'IBM Plex Mono', monospace;
  font-style: normal;
  font-size: 0.32em;
  font-weight: 400;
  color: var(--mute);
  margin-left: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ========== SECTION HEAD ========== */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}
.section-head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 96;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.section-head h2 .sub {
  color: var(--mute);
  font-weight: 400;
  font-style: italic;
  font-variation-settings: 'opsz' 36, 'SOFT' 100;
  font-size: 0.66em;
  margin-left: 10px;
  letter-spacing: -0.005em;
}
.section-head .hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
}

.section {
  margin-bottom: 42px;
}

/* ========== CARDS ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  min-height: 156px;
  transition: background 0.18s ease;
}
.card:hover {
  background: var(--paper-warm);
}
.card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.card .arrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--faint);
  transition: transform 0.2s ease, color 0.2s ease;
}
.card:hover .arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* Role badges on card header */
.card .head { gap: 8px; }
.badges {
  display: inline-flex;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  margin-right: 4px;
}
.rb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--sub-ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 3px;
  text-transform: none;
  line-height: 1;
}
.rb-admin     { background: var(--ink);     color: var(--paper); border-color: var(--ink); }
.rb-head      { background: var(--accent);  color: var(--paper); border-color: var(--accent); }
.rb-logist    { background: #1a6a3a;        color: var(--paper); border-color: #1a6a3a; }
.rb-kc        { background: #2d5d8b;        color: var(--paper); border-color: #2d5d8b; }
.rb-okk       { background: #7a3a8a;        color: var(--paper); border-color: #7a3a8a; }
.rb-marketing { background: #b67a3d;        color: var(--paper); border-color: #b67a3d; }
.card .name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
  margin-top: auto;
}
.card .desc {
  font-size: 12.5px;
  color: var(--sub-ink);
  line-height: 1.45;
}
.card .footer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.06em;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.card:hover .footer { opacity: 1; }
.card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(.2,.8,.2,1);
}
.card:hover::after { width: 100%; }

/* ========== NOTICE ========== */
.notice {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  color: var(--accent-deep);
  padding: 12px 18px;
  font-size: 13px;
  margin-bottom: 28px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.notice::before {
  content: 'ALERT';
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding-right: 14px;
  border-right: 1px solid rgba(198, 74, 2, 0.3);
}

/* ============================================================
   PANEL (admin)
   ============================================================ */
.notes-wrap {
  background: var(--paper);
  border: 1px solid var(--rule);
}
.notes-wrap textarea {
  width: 100%;
  min-height: 240px;
  padding: 16px 18px;
  border: none;
  background: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  outline: none;
}
.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper-warm);
}
#notes-status, #action-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
#notes-status.ok, #action-status.ok { color: var(--pos); }
#notes-status.err, #action-status.err { color: var(--neg); }

.btn-pri {
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-pri:hover { background: var(--accent); }
.btn-sec {
  display: inline-block;
  padding: 8px 14px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-sec:hover { border-color: var(--accent); color: var(--accent); }
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.panel-sec { margin-bottom: 48px; }
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.panel-grid.two { grid-template-columns: 1fr 1fr; }
.pi {
  background: var(--paper);
  padding: 18px 20px;
}
.pi.card { padding: 22px 24px; }
.pi .lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.pi .val {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.pi .val.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.pi ul { list-style: none; padding: 0; margin: 10px 0 0; }
.pi ul li {
  font-size: 12px;
  line-height: 1.7;
  padding-left: 14px;
  position: relative;
}
.pi ul li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.pi pre.cmd {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fdf6e7;
  border: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
}

.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.ptable th {
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  padding: 10px 14px;
  border-bottom: 2px solid var(--rule-strong);
  background: var(--paper-warm);
}
.ptable td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.ptable tr:last-child td { border-bottom: none; }
.ptable tr:hover td { background: var(--paper-warm); }
.ptable .mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.ptable .dim { color: var(--mute); font-size: 12px; }
.ptable.compact td { padding: 6px 10px; font-size: 12px; }
.cg-wrap { margin: 14px 0; }
.cg-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ============================================================
   CONTACTS PAGE
   ============================================================ */
.cgroup { margin-bottom: 40px; }
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.c-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
}
.c-card:hover { border-color: var(--ink); }
.c-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 36;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.c-role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.c-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.c-ch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  color: var(--ink);
  transition: all 0.15s ease;
}
.c-ch:hover { border-color: var(--accent); color: var(--accent); }
.c-ch .ico {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0;
}
.c-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
  font-size: 12px;
  color: var(--sub-ink);
  font-style: italic;
}

/* ============================================================
   LOGIN PAGE — split editorial layout
   ============================================================ */
.login-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--paper);
}

.login-art {
  background: var(--paper-2);
  padding: 48px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--rule);
}
.login-art .top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.login-art .top-meta .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-art .top-meta .dot {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(198, 74, 2, 0.12);
  display: inline-block;
}
.login-art .top-meta .brand b { color: var(--ink); font-weight: 600; }

.login-art .title-block { max-width: 560px; }
.login-art .eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.login-art h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: 84px;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.login-art h1 em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  color: var(--accent);
}
.login-art .lead {
  margin-top: 28px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--sub-ink);
  max-width: 440px;
}

.login-art .footer-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 40px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.login-art .footer-meta .label { display: block; margin-bottom: 4px; }
.login-art .footer-meta b { color: var(--ink); font-weight: 600; letter-spacing: 0.06em; }

/* decorative dashed track in the middle of the art panel */
.login-art .track {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 50%;
  height: 1px;
  background: repeating-linear-gradient(to right,
    var(--rule) 0, var(--rule) 4px,
    transparent 4px, transparent 9px);
  opacity: 0.5;
  pointer-events: none;
}

.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 48px;
  background: var(--paper);
}
.login-form {
  width: 100%;
  max-width: 360px;
}
.login-form .form-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-form .form-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.login-form h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 96, 'SOFT' 30;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 36px;
  color: var(--ink);
}
.login-form h2 em {
  font-style: italic;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  color: var(--accent);
}

.field {
  margin-bottom: 22px;
  position: relative;
}
.field label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 8px 0 10px;
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 18px;
  letter-spacing: -0.005em;
  outline: none;
  transition: border-color 0.2s ease;
}
.field input:focus { border-bottom-color: var(--accent); }
.field::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}
.field:focus-within::after { width: 100%; }

.btn {
  width: 100%;
  margin-top: 12px;
  padding: 16px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.btn:hover { background: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn::after {
  content: ' →';
  font-family: 'IBM Plex Mono', monospace;
}

.error {
  background: rgba(168, 35, 30, 0.08);
  border-left: 3px solid var(--neg);
  color: var(--neg);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 18px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em;
}

/* ============================================================
   LOGIST WORKSPACE — separate curated home for `logist` role
   ============================================================ */
.featured {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin-bottom: 50px;
}
.f-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px 26px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  min-height: 200px;
  transition: background 0.18s ease;
}
.f-card:hover { background: var(--paper-warm); }
.f-card::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 3px; width: 0;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(.2,.8,.2,1);
}
.f-card:hover::after { width: 100%; }

.f-card .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--mute);
}
.f-card .num .placeholder {
  color: var(--accent);
  margin-left: 8px;
}
.f-card .title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 96, 'SOFT' 40;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: auto;
}
.f-card .title em {
  font-style: italic;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  color: var(--accent);
}
.f-card .desc {
  font-size: 13.5px;
  color: var(--sub-ink);
  line-height: 1.5;
}
.f-card .url {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.08em;
  border-top: 1px dashed var(--rule);
  padding-top: 10px;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.f-card .url .arrow {
  color: var(--faint);
  transition: transform 0.2s ease, color 0.2s ease;
}
.f-card:hover .url .arrow {
  color: var(--accent);
  transform: translateX(3px);
}
.f-card.placeholder { background: var(--paper-cool); }
.f-card.placeholder .title { color: var(--sub-ink); }

/* Utilities strip */
.utilities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 50px;
}
.util {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--ink);
  transition: all 0.15s ease;
}
.util:hover { border-color: var(--ink); background: var(--paper-warm); }
.util .mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.14em;
}

/* ============================================================
   BOARD — книга отзывов (Reddit-style)
   ============================================================ */
.board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 26px 0 22px;
  flex-wrap: wrap;
}
.board-tabs { display: flex; gap: 6px; }
.board-tabs .bt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--rule);
  background: var(--paper);
  transition: all 0.15s ease;
}
.board-tabs .bt:hover { border-color: var(--ink); color: var(--ink); }
.board-tabs .bt.on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.board-tabs .bt .ct {
  font-size: 10px;
  opacity: 0.65;
}

.board-empty {
  padding: 28px 0;
  font-size: 14px;
  color: var(--mute);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.board-empty a { color: var(--accent); }

.board-feed {
  border-top: 1px solid var(--rule-strong);
}
.bp-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s ease;
}
.bp-row:hover { background: var(--paper-warm); }
.bp-row.is-closed { opacity: 0.72; }

/* vote column — голосование прямо в ленте */
.bp-vote {
  flex: 0 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 6px;
  border-right: 1px solid var(--rule);
}
.vmini {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 7px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  color: var(--mute);
  font-family: 'IBM Plex Mono', monospace;
  transition: background 0.12s ease, color 0.12s ease;
}
.vmini:hover { background: var(--paper-2); color: var(--ink); }
.vmini .vm-ico { font-size: 13px; }
.vmini .vm-c { font-size: 11px; font-variant-numeric: tabular-nums; }
.vmini.up.on   { color: var(--accent); background: var(--accent-soft); }
.vmini.down.on { color: var(--paper);  background: var(--ink); }
.vmini:disabled { opacity: 0.5; cursor: wait; }
.bp-net {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 48, 'SOFT' 30;
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  margin: 1px 0;
}

.bp-link {
  display: flex;
  align-items: stretch;
  gap: 18px;
  flex: 1;
  min-width: 0;
  padding: 18px 8px 18px 18px;
  position: relative;
}
.bp-thumb {
  flex: 0 0 84px;
  align-self: center;
  height: 64px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--rule);
}
.bp-main { flex: 1; min-width: 0; }
.bp-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 48, 'SOFT' 40;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
}
.bp-excerpt {
  margin-top: 5px;
  font-size: 13px;
  color: var(--sub-ink);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bp-meta {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.02em;
}
.bp-meta .dot-sep { color: var(--faint); }
.bp-stat { color: var(--sub-ink); }
.bp-arrow {
  align-self: center;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--faint);
  transition: transform 0.2s ease, color 0.2s ease;
}
.bp-row:hover .bp-arrow { transform: translateX(3px); color: var(--accent); }

.bp-badge {
  display: inline-block;
  vertical-align: middle;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  margin-right: 8px;
  border-radius: 3px;
}
.bp-badge.closed { background: var(--pos); color: var(--paper); }

/* ---- single post ---- */
.back-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 4px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.back-link:hover { background: var(--accent); border-color: var(--accent); }
.back-link.ghost {
  color: var(--sub-ink);
  background: var(--paper);
  border-color: var(--rule);
}
.back-link.ghost:hover { color: var(--accent); border-color: var(--accent); background: var(--paper); }
.post-wrap {
  border-top: 2px solid var(--rule-strong);
  padding-top: 24px;
  margin-top: 8px;
}
.post-head { margin-bottom: 18px; }
.post-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.post-meta {
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.post-meta b { color: var(--ink); font-weight: 500; }
.post-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 22px;
}
.post-body p { margin-bottom: 14px; }
.post-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.post-body a { color: var(--accent); text-decoration: underline; }

.post-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.pg-item {
  display: block;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
}
.pg-item img {
  display: block;
  max-height: 220px;
  max-width: 320px;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.pg-item:hover img { transform: scale(1.03); }

.vote-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px 0 24px;
  border-top: 1px solid var(--rule);
  border-bottom: 2px solid var(--rule-strong);
}
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  transition: all 0.15s ease;
}
.vote-btn:hover { border-color: var(--ink); }
.vote-btn .vb-ico { font-size: 13px; color: var(--mute); }
.vote-btn .vb-count {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 48;
  font-size: 20px;
  font-weight: 500;
  margin-left: 4px;
}
.vote-btn.up.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.vote-btn.up.on .vb-ico { color: var(--paper); }
.vote-btn.down.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.vote-btn.down.on .vb-ico { color: var(--paper); }
.vote-btn:disabled { opacity: 0.55; cursor: wait; }
.close-form { margin-left: auto; }

.comments { margin-top: 38px; }
.cmt {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.cmt-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.cmt-head b { color: var(--ink); font-weight: 500; }
.cmt-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.cmt-body p { margin-bottom: 8px; }
.cmt-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.cmt-body a { color: var(--accent); text-decoration: underline; }

.cmt-form { margin-top: 22px; }
.cmt-form textarea,
.new-form textarea,
.new-form input[type=text] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease;
}
.cmt-form textarea:focus,
.new-form textarea:focus,
.new-form input[type=text]:focus { border-color: var(--accent); }
.cmt-form .btn-pri { margin-top: 12px; }

/* ---- new topic form ---- */
.new-form {
  border-top: 1px solid var(--rule);
  padding-top: 26px;
  max-width: 720px;
}
.new-form .field { margin-bottom: 24px; }
.new-form .field label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.new-form .fhint {
  text-transform: none;
  letter-spacing: 0;
  color: var(--faint);
  font-size: 10px;
  margin-left: 8px;
}
.new-form input[type=file] {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--sub-ink);
}

@media (max-width: 700px) {
  .bp-thumb { display: none; }
  .post-title { font-size: 30px; }
  .vote-btn { flex: 1; justify-content: center; }
  .close-form { margin-left: 0; flex-basis: 100%; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-art { padding: 32px; min-height: 40vh; }
  .login-art h1 { font-size: 54px; }
  .login-form-wrap { padding: 32px; }
  .login-art .track { display: none; }
  .login-art .footer-meta { grid-template-columns: repeat(2, auto); gap: 24px; }

  .shell { padding: 24px 20px 48px; }
  .title-row { flex-direction: column; gap: 12px; align-items: flex-start; }
  .title-row h1.title { font-size: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
  .masthead .meta .logout { display: block; margin: 8px 0 0; }
}
