* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  /* 100vh measures against the largest viewport on iOS Safari and Chrome
     mobile, so the composer ends up behind the address bar until the user
     scrolls. 100dvh tracks the currently-visible area, so nothing hides. */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  color: #222;
  background: #fafafa;
}

aside::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background-color: #f3f3f1;
  background-image: url('/image/epistery-base-1000.png');
  /*background-size: var(--pattern-size, 1000px) var(--pattern-size, 1000px);*/
  background-position: center;
  background-repeat: repeat;
  opacity: 0.05;
  overflow:hidden;
  z-index: -1;
}

aside {
  position: relative;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 0 0 280px;
  min-height: 0;
}

.me {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 8px;
}
.me-text { flex: 1; min-width: 0; }

/* Drawer pills — three variants share a chunky pill shell.
   - .pill-data     credits/POL strip with a "…" details affordance
   - .pill-identity green outer with a nested white pill (name) + Connect
   - .pill-cta      full green "Initialize Identity" with a "?" affordance
   All are full-width, ~52px tall, deeply rounded (pill geometry). */
.pill {
  display: flex;
  align-items: center;
  margin: 10px 12px;
  height: 48px;
  border-radius: 26px;
  border: 1px solid #c9d2bd;
  background: #fafaf6;
  color: #1a1a1a;
  font-size: 14px;
  overflow: hidden;
  padding: 0 6px 0 0;
  box-sizing: border-box;
}
.pill-cta[hidden] { display: none; }
.pill .pill-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 0;
}
.pill .pill-body b { font-weight: 700; color: #1a2f0a; }

/* Affordance "buttons" — pill-shaped, green-tinted, sits on the right */
.pill-affordance {
  height: 36px;
  min-width: 38px;
  padding: 0 12px;
  border: 1px solid #a8c896;
  border-radius: 19px;
  background: #d9ead3;
  color: #1a2f0a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background-color 0.12s;
}
.pill-affordance:hover { background: #c2dab1; }
.pill-affordance:focus { outline: 2px solid #2d5016; outline-offset: 1px; }

/* Credits row uses uppercase labels to match the spec image. */
.pill-data { background: #f4f4ef; }
.pill-data .pill-stat { letter-spacing: 0.5px; text-transform: uppercase; font-size: 13px; }

/* Identity row: green outer container with a nested white "inner" pill on
   the left holding the label, and Connect text on the right. The inner
   pill creates the layered look from the spec image. */
.pill-identity {
  background: #d9ead3;
  border-color: #a8c896;
  padding: 5px;
}
.pill-identity .identity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0px solid #c9d2bd;
  margin-right: 6px;
  flex-shrink: 0;
  z-index:10;
}
.pill-identity .pill-inner {
  flex: 1;
  background: white;
  height: 100%;
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #222;
  cursor: pointer;
  padding: 0 16px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid #c9d2bd;
}
.pill-identity .pill-inner:hover { background: #f5f9ee; }
.pill-action-text {
  background: transparent;
  border: none;
  color: #1a2f0a;
  font-weight: 600;
  font-size: 14px;
  padding: 0 20px 0 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.pill-action-text:hover { color: #2d5016; }

/* CTA pill — replaces the old identity-mint-cta. Full green, large
   call-to-action with a ? help affordance. */
.pill-cta {
  background: #d9ead3;
  border-color: #a8c896;
  cursor: pointer;
  font-weight: 600;
  color: #1a2f0a;
  font-size: 15px;
  width: calc(100% - 24px);
}
.pill-cta:hover { background: #cfe2c4; }
.pill-cta:disabled { opacity: 0.5; cursor: wait; }
.pill-cta .pill-cta-text { letter-spacing: 0.3px; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar-footer {
  padding: 12px;
  font-size: 11px;
  color: #888;
  text-align: center;
  border-top: 1px solid #ddd;
}
.sidebar-footer a { color: #2d5016; text-decoration: none; }
.sidebar-footer a:hover { text-decoration: underline; }

/* Tabbed settings modal: identity / credits / tokens */
.tabs {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #ddd;
  gap: 2px;
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 10px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: #1a2f0a; background: #f3f3f1; }
.tab.is-active { color: #1a2f0a; border-bottom-color: #2d5016; font-weight: 600; }
.tab-pane { width: 100%; }
.tab-pane[hidden] { display: none; }

/* "→" jump button on the identity recap rows — small unobtrusive nudge to
   the matching tab. */
.detail-value-with-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-jump {
  background: transparent;
  border: 1px solid #c9d2bd;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 13px;
  color: #1a2f0a;
  cursor: pointer;
  line-height: 1.6;
}
.tab-jump:hover { background: #d9ead3; }

/* Credits detail rows inside the popup */
.credits-detail { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; padding: 4px 0; border-bottom: 1px solid #eee;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #666; font-size: 12px; }
.addr-mini { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #555; }

.icon-btn {
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
}
.icon-btn:hover { background: #ebebe9; }

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.modal-card {
  position: relative;
  background: white; padding: 24px; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; gap: 16px;
  align-items: center;
  max-width: 360px;
  /* Keep the modal usable when keyboard or chrome shrinks the viewport. */
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-card h2 { margin: 0; font-size: 16px; }
.modal-body { font-size: 13px; line-height: 1.45; color: #333; width: 100%; }
.modal-body p { margin: 0 0 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #f3f3f1; padding: 1px 4px; border-radius: 3px; }
.qr { background: white; padding: 8px; }
.qr svg { display: block; }
.share-address {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  text-align: center;
  background: #f3f3f1;
  padding: 8px;
  border-radius: 4px;
  width: 100%;
}
.share-identity { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.share-row { display: flex; flex-direction: column; gap: 2px; }
.share-row.primary .share-address {
  background: #e7f0d8; color: #1a2f0a; font-size: 11px;
}
.share-label { font-size: 11px; color: #888; padding-left: 4px; }
.connect-addr-row { display: flex; gap: 6px; width: 100%; }
.connect-addr-row input {
  flex: 1;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 0;
}
.connect-addr-row button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 13px;
}
.connect-addr-row button.primary { background: #1a2f0a; color: white; border-color: #1a2f0a; }
.share-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a2f0a;
  padding: 2px 6px;
}
.copyable { cursor: pointer; user-select: all; transition: background-color 0.15s; }
.copyable:hover { background: #e9e8e3 !important; }
#me-address.copyable { display: inline-block; padding: 1px 4px; border-radius: 3px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; width: 100%; align-items: stretch; }
.modal-actions button {
  /* Two-line min height so labels like "Promo empty (refills 5/21/2026)"
     don't make the row jump size between states. */
  min-height: 42px;
  line-height: 1.2;
  white-space: normal;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 13px;
}
.modal-actions button:hover { background: #f3f3f1; }
.modal-actions button.primary {
  background: #2d5016;
  border-color: #2d5016;
  color: white;
}
.modal-actions button.primary:hover { background: #1f3a0d; }

.modal-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.form-label { font-size: 12px; color: #555; font-weight: 500; }
.modal-form input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  font-family: ui-monospace, Menlo, monospace;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.modal-form input[type="text"]:focus { outline: none; border-color: #2d5016; }
.form-hint { font-size: 12px; color: #888; margin: 0 0 4px; }
.form-hint code { background: #f3f3f1; padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.form-hint.warn { color: #b14216; }
.modal-section { padding: 8px 14px 14px; }
.form-checkbox { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; font-size: 12px; color: #444; cursor: pointer; }
.form-checkbox input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.form-checkbox a { color: #1f3a0d; }

.me .label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#me-address {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  display: block;
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  padding: 12px 12px 4px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-add {
  background: transparent;
  border: 1px solid #ccc;
  color: #666;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  padding: 0 8px;
  height: 20px;
  cursor: pointer;
}
.section-add:hover { background: #e0e0dc; color: #222; }

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Row stretches full width; the action button is overlaid absolutely on the
   right so the link's clickable area runs edge-to-edge. */
.peer-row {
  display: flex;
  align-items: stretch;
  position: relative;
}
.peer-row a.peer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: inherit;
  text-decoration: none;
  border-left: 3px solid transparent;
  flex: 1;
  min-width: 0;
}
.peer-row a.peer:hover { background: #ebebe9; }
.peer-row.active a.peer { background: #e0e8e0; border-left-color: #2d5016; }
.peer-row.unread .peer-addr,
.peer-row.unread .peer-sub { font-weight: 700; color: #1a1a1a; }

/* Trash button: same look as the section [+] but hover-revealed and floated
   over the row's right edge so the link keeps the full row width. On touch
   devices (no hover) it's always visible so users can find it. */
.row-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid #ccc;
  color: #666;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  padding: 0 6px;
  height: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 2;
}
.peer-row:hover .row-action,
.peer-row .row-action:focus { opacity: 1; }
.row-action:hover { background: #e0e0dc; color: #222; }
@media (hover: none) {
  .row-action { opacity: 1; }
}
.avatar-sm { width: 28px; height: 28px; border-radius: 4px; flex-shrink: 0; border: 1px solid #ccc}
.peer-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.peer-addr { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.peer-sub {
  font-size: 11px; color: #888;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge {
  background: #b14216; color: white;
  font-size: 10px; padding: 2px 6px; border-radius: 10px;
}

.credits-pill {
  margin: 0 12px 8px;
  padding: 6px 10px;
  background: #1a1f12;
  border: 1px solid #2d5016;
  border-radius: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}
.credits-label { color: #8a9479; }
.credits-value { color: #c8d7a8; font-weight: 600; flex: 1; }
.credits-chain { color: #6f7d5e; font-size: 10px; }

.identity-mint {
  background: #2d5016; color: white; border: none; border-radius: 3px;
  font-size: 11px; padding: 3px 8px; cursor: pointer;
}
.identity-mint:hover { background: #1f3a0d; }
.identity-mint:disabled { opacity: 0.5; cursor: wait; }

.connect-btn {
  padding: 6px 12px;
  background: #2d5016;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}
.connect-btn:hover { background: #1f3a0d; }

.connect-card { max-width: 360px; width: 90vw; align-items: stretch; }
.connect-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.connect-head h2 { margin: 0; }
.connect-self { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.connect-self .label {
  font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.05em;
  align-self: flex-start;
}
.connect-boxes {
  display: flex;
  gap: 12px;
  align-items: stretch;
  width: 100%;
}
.connect-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.box-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.06em;
  text-align: center;
}
.qr-target {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
}
.qr-target svg {
  width: 100%;
  height: 100%;
  display: block;
}
.qr-target-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2ea043;
  color: white;
  font-size: 36px;
  line-height: 64px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  user-select: none;
}
.qr-target-msg.display {
  opacity: 1;
}

.scan-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f3f1;
  border: 1px dashed #ccc;
  border-radius: 4px;
  overflow: hidden;
}
.scan-trigger {
  background: transparent;
  border: none;
  width: 100%;
  height: 100%;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
  cursor: pointer;
  text-align: center;
  padding: 8px;
}
.scan-trigger:hover { background: #ebebe9; color: #222; }
.scan-video[hidden] { display: none; }
.scan-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.scan-stop[hidden] { display: none; }
.scan-stop {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px; height: 24px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.scan-stop:hover { background: rgba(0,0,0,0.8); }
.scan-status {
  font-size: 12px; color: #555;
  text-align: center;
}

.follow-form {
  display: flex; gap: 4px;
}
.follow-form input {
  flex: 1; padding: 6px 8px; font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
  border: 1px solid #ccc; border-radius: 4px;
}
.follow-form button {
  padding: 6px 12px; font-size: 13px;
  border: 1px solid #ccc; background: white; border-radius: 4px; cursor: pointer;
}
.follow-form button:hover { background: #f3f3f1; }

main { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1; }

header.main-head {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  background: white;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#peer-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

/* Hamburger is hidden on desktop; the sidebar is always visible there. */
.hamburger {
  display: none;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #444;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}
.drawer-backdrop[hidden] { display: none; }

#error {
  display: none;
  background: #fde6e6; color: #7a1f1f;
  padding: 8px 12px; border-bottom: 1px solid #f5c6cb;
  font-size: 13px;
}

#success {
  display: none;
  background: #e6f6e6; color: #1f5a1f;
  padding: 8px 12px; border-bottom: 1px solid #c6e6c8;
  font-size: 13px;
}

.fido-banner[hidden] { display: none; }
.fido-banner {
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  color: #78350f;
  padding: 10px 16px;
  font-size: 13px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.fido-banner-text { flex: 1; min-width: 240px; }
.fido-banner-actions { display: flex; gap: 6px; }
.fido-banner-actions button {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #ca8a04;
  border-radius: 4px;
  background: white;
  color: #78350f;
  cursor: pointer;
}
.fido-banner-actions button:hover { background: #fef9c3; }
.fido-banner-actions button.ghost {
  background: transparent;
  border-color: transparent;
}

#messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.empty { color: #888; text-align: center; padding: 32px; }

.msg { display: flex; gap: 8px; padding: 4px 0; }
.msg .avatar { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; border: 1px solid #ccc }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.msg-from { font-family: ui-monospace, Menlo, monospace; color: #555; }
.msg-time { color: #999; font-size: 11px; }
.msg-source { font-size: 11px; color: #888; }
.msg-chain { font-size: 11px; color: #2d5016; cursor: help; }
.msg-crypto { font-size: 11px; cursor: help; opacity: 0.85; }
.msg-crypto.plain { opacity: 0.5; }
.msg.pending { opacity: 0.65; }
.send-pol-amount { display: flex; gap: 8px; align-items: center; }
.send-pol-amount input { flex: 1; }
.form-hint.warn { color: #b00020; }
.composer-hint { font-size: 11px; padding: 2px 12px; height: 18px}
.composer-hint.on-chain { color: #2d5016; }
.composer-hint.local    { color: #888; }
/* .avatar-sm already sets 28×28 + border-radius + flex-shrink; .peer-icon
   adds the centered glyph and a subtle background so the visual weight
   matches the colored avatar tiles. */
.peer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: #555;
  background: #e0e0dc;
}
.msg-text {
  font-size: 14px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.msg-text p { margin: 2px 0; }
.msg-text code { background: #eee; padding: 0 4px; border-radius: 3px; }

.msg-image {
  display: block;
  margin-top: 8px;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 6px;
  background: #f3f3f1;
  cursor: zoom-in;
}
.mode-board .msg-image {
  max-height: 480px;
  margin-top: 10px;
}

/* Board mode (feeds): post-style cards, newest-first, more breathing room.
   Same .msg markup, different presentation. */
#messages.mode-board {
  background: #efefec;
  padding: 16px;
  gap: 12px;
}
.mode-board .msg {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mode-board .msg .avatar { width: 40px; height: 40px; }
.mode-board .msg-from { font-weight: 600; font-size: 14px; color: #222; }
.mode-board .msg-time { font-size: 12px; }
.mode-board .msg-text { font-size: 15px; line-height: 1.6; margin-top: 6px; }

.sidebar-empty {
  padding: 8px 12px;
  font-size: 11px;
  color: #aaa;
  font-style: italic;
}

.composer[hidden] { display: none; }
.composer {
  border-top: 1px solid #ddd;
  background: white;
  padding: 8px 12px;
  display: flex; gap: 8px;
  align-items: center;
}
.image-attach {
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0;
  width: 40px;
  height: 40px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  flex-shrink: 0;
}
.image-attach:hover { background: #f3f3f1; color: #222; }
#input {
  flex: 1; resize: none; padding: 8px; min-height: 40px; max-height: 200px;
  border: 1px solid #ccc; border-radius: 4px;
  font-family: inherit; font-size: 14px;
}
#send {
  padding: 8px 16px; background: #2d5016; color: white; border: none; border-radius: 4px;
  cursor: pointer; font-weight: 500;
}
#send:disabled { background: #888; cursor: not-allowed; }

/* Attachment preview sits between the message list and the composer so the
   user can see what they're about to send. The ✕ overlays the thumbnail. */
.image-preview[hidden] { display: none; }
.image-preview {
  position: relative;
  align-self: flex-start;
  margin: 0 12px 4px;
  display: inline-block;
}
.image-preview img {
  max-width: 200px;
  max-height: 140px;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: block;
}
.image-preview button {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid #b14216;
  background: white;
  color: #b14216;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.image-preview button:hover { background: #b14216; color: white; }

@media (max-width: 720px) {
  .hamburger { display: flex; z-index: 100 }

  /* Drawer slides in from the right. Use transform so it animates and so the
     element stays measurable for screen readers when closed. */
  aside {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 50;
    border-right: none;
    border-left: 1px solid #ddd;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    background-color: #f3f3f1;
    padding-top: 46px;
  }
  aside.open { transform: translateX(0); }

  /* Composer needs a bit more breathing room on phones. */
  #messages { padding: 12px; }
  .composer { padding: 8px; }
}

.section-divider {
  width: 100%;
  height: 12px;
  background-image: linear-gradient(to top, white, transparent);
  border-bottom: 1px solid #eee;
}

#menu-header {
  height: 42px;
}

/* Scrollbars — thin solid bar, no arrows */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--page-border) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--page-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-color-quiet);
}
::-webkit-scrollbar-button {
  display: none;
}

/* ============================================================
   epistery.app additions — sidebar sessions + plugin mount
   ============================================================ */

.main-mount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0;
}

.home-pane {
  padding: 32px 24px;
  color: #444;
  max-width: 640px;
  margin: 0 auto;
}
.home-pane h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 12px;
  color: #2d5016;
}
.home-pane p { font-size: 14px; line-height: 1.5; }

.sidebar-list .sidebar-row {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  text-decoration: none;
  color: #222;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: #f3f3f1; }
.sidebar-row.is-active .sidebar-link {
  background: #ecefe5;
  border-left-color: #2d5016;
  font-weight: 600;
}
.kind-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.sess-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav-title { margin-top: 12px; }
.sidebar-nav li {
  list-style: none;
  padding: 0;
}
.sidebar-nav a {
  display: block;
  padding: 4px 12px;
  text-decoration: none;
  color: #2d5016;
  font-size: 13px;
}
.sidebar-nav a:hover { text-decoration: underline; }

.sidebar-pending {
  list-style: none;
  padding: 6px 12px;
  font-size: 12px;
  color: #b14216;
  font-style: italic;
}

.form-label-hint {
  color: #888;
  font-weight: 400;
  font-size: 11px;
}
.form-params { display: flex; flex-direction: column; gap: 8px; }

.modal-form select,
.modal-form textarea {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
}
.modal-form select:focus,
.modal-form textarea:focus { outline: none; border-color: #2d5016; }
.modal-form textarea { resize: vertical; min-height: 40px; }

/* ---- plugin: message-board ---- */
.plugin-message-board {
  display: flex;
  flex-direction: column;
}
.mb-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.mb-list {
  list-style: none;
  margin: 0;
  padding: 16px;
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mb-post {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: #fafaf6;
  border: 1px solid #e8e7df;
  border-radius: 6px;
}
.mb-from {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: #2d5016;
  font-weight: 600;
}
.mb-when { font-size: 11px; color: #888; margin-left: 6px; }
.mb-text { font-size: 14px; line-height: 1.45; color: #222; margin-top: 4px; white-space: pre-wrap; }

.mb-composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e8e7df;
  background: white;
}
.mb-composer textarea {
  flex: 1;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}
.mb-composer button {
  padding: 6px 16px;
  background: #2d5016;
  color: white;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.mb-composer button:hover { background: #1f3a0d; }

.mb-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}

/* ============================================================
   plugin: wiki
   ============================================================ */
.wiki-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
/* Wiki tree lives in the session's sidebar expansion now — no aside in the
   main pane. Tree-head sits inside .session-expansion. */
.wiki-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 6px;
}
.wiki-new-doc {
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
}
.wiki-new-doc:hover { background: #ecefe5; }
.wiki-tree-list { list-style: none; padding: 6px 0; margin: 0; }
.wiki-tree-children { list-style: none; padding-left: 16px; margin: 0; }
.wiki-tree-node { padding: 0; }
.wiki-tree-link {
  display: block;
  padding: 3px 12px;
  color: #2d5016;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
}
.wiki-tree-link:hover { background: #f3f3f1; }
.wiki-tree-node.is-active > .wiki-tree-link {
  background: #ecefe5;
  border-left-color: #2d5016;
  font-weight: 600;
}
.wiki-tree-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.wiki-doc {
  flex: 1 1 auto;
  padding: 18px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Header bar: [lock] [meta...]  <- stretch ->  [new] [edit] [delete] */
.wiki-doc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e7df;
}
.wiki-doc-badge { font-size: 14px; flex-shrink: 0; }
.wiki-doc-meta {
  font-size: 12px;
  color: #888;
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.wiki-doc-meta > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wiki-doc-new { color: #b14216; font-style: italic; }

.wiki-doc-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.wiki-doc-actions button {
  font: inherit;
  padding: 4px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}
.wiki-doc-actions button:hover { background: #f3f3f1; }
.wiki-new { font-size: 16px; line-height: 1; padding: 2px 10px !important; }
.wiki-save { background: #2d5016 !important; color: white !important; border-color: #2d5016 !important; }
.wiki-save:hover { background: #1f3a0d !important; }
.wiki-delete { color: #b14216; }

.wiki-doc-render {
  font-size: 15px;
  line-height: 1.55;
  color: #222;
}
.wiki-doc-render h1 { font-size: 24px; margin-top: 0; }
.wiki-doc-render h2 { font-size: 20px; margin-top: 1em; }
.wiki-doc-render h3 { font-size: 17px; }
.wiki-doc-render pre {
  background: #f3f3f1;
  padding: 10px 12px;
  border-radius: 4px;
  overflow-x: auto;
}
.wiki-doc-render code {
  background: #f3f3f1;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
}
.wiki-doc-render pre code { background: transparent; padding: 0; }
.wiki-doc-render a { color: #2d5016; }
.wiki-doc-render a:hover { text-decoration: underline; }

.wiki-doc-edit {
  flex: 1 1 auto;
  min-height: 300px;
  font: 14px/1.5 ui-monospace, Menlo, monospace;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}
.wiki-doc-edit:focus { outline: none; border-color: #2d5016; }

/* ---- breadcrumb ---- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
}
.crumb {
  color: #2d5016;
  text-decoration: none;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}
a.crumb:hover { text-decoration: underline; }
.crumb-current {
  color: #222;
  font-weight: 600;
}
.crumb-sep {
  color: #aaa;
  font-size: 14px;
  flex-shrink: 0;
}
.crumbs > .crumb:first-child {
  letter-spacing: 0.06em;
}


/* ---- sidebar: per-session expansion (owned by the mounted plugin) ---- */
.session-expansion {
  display: none;
  font-size: 13px;
}
/* Empty expansions (plugin opted out — e.g. message-board has no internal
   nav) stay hidden so they don't show as dead boxes on the active row. */
.sidebar-row.is-active .session-expansion:not(:empty) {
  display: block;
  padding: 4px 0 8px;
  border-left: 3px solid #2d5016;
  background: #fafaf6;
}
/* Tree items now nested under .session-expansion — tighten paddings so they
   sit comfortably inside the sidebar column. */
.session-expansion .wiki-tree-list { padding: 2px 0 0; }
.session-expansion .wiki-tree-link {
  padding: 3px 12px 3px 24px;
  font-size: 13px;
}
.session-expansion .wiki-tree-children { padding-left: 12px; }

/* ---- message-board: additions for v0 full features ---- */
/* Body wrapper (replaces the bare .mb-text from the proof-of-mount) */
.mb-body {
  font-size: 14px;
  line-height: 1.5;
  color: #222;
  margin-top: 6px;
}
.mb-body p:first-child { margin-top: 0; }
.mb-body p:last-child { margin-bottom: 0; }
.mb-body pre {
  background: #f3f3f1;
  padding: 8px 10px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13px;
}
.mb-body code {
  background: #f3f3f1;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
}
.mb-body pre code { background: transparent; padding: 0; }

.mb-badge { font-size: 12px; flex-shrink: 0; }
.mb-edited { font-size: 11px; color: #888; font-style: italic; }
.mb-post-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}
.mb-post:hover .mb-post-actions { opacity: 1; }
.mb-post-actions button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #777;
}
.mb-post-actions button:hover { background: #ecefe5; border-color: #c9d2bd; color: #222; }
.mb-post-actions .mb-del:hover { color: #b14216; border-color: #e5b5a5; }

/* Inline edit-area */
.mb-edit-area {
  width: 100%;
  min-height: 80px;
  font: inherit;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}
.mb-edit-controls {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.mb-edit-controls button {
  font: inherit;
  padding: 3px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}
.mb-edit-save {
  background: #2d5016 !important;
  color: white !important;
  border-color: #2d5016 !important;
}

/* Comments */
.mb-comments {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-left: 2px solid #e8e7df;
  margin-left: 12px;
}
.mb-comment {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 13px;
  position: relative;
}
.mb-comment:hover { background: rgba(0, 0, 0, 0.02); }
.mb-comment-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}
.mb-comment-from {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: #2d5016;
  font-weight: 600;
}
.mb-comment-badge { font-size: 10px; }
.mb-comment-when { font-size: 10px; color: #888; }
.mb-comment-text { flex: 1; color: #222; white-space: pre-wrap; }
.mb-comment-del {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 6px;
  font-size: 12px;
  cursor: pointer;
  color: #777;
  opacity: 0;
}
.mb-comment:hover .mb-comment-del { opacity: 1; }
.mb-comment-del:hover { background: #ecefe5; color: #b14216; border-color: #e5b5a5; }

.mb-comment-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-left: 12px;
}
.mb-comment-form input {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.mb-comment-form input:focus { outline: none; border-color: #2d5016; }
.mb-comment-form button {
  padding: 4px 12px;
  font-size: 13px;
  background: white;
  color: #2d5016;
  border: 1px solid #c9d2bd;
  border-radius: 4px;
  cursor: pointer;
}
.mb-comment-form button:hover { background: #ecefe5; }

/* Composer hint (encryption status) */
.mb-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}
.mb-composer-hint { font-size: 11px; color: #888; }

/* ---- mode-specific layout ---- */
/* Chat mode keeps the existing compact look (list above, composer below). */
.mb-mode-chat .mb-post { padding: 8px 12px; }

/* Post mode: composer at top, cards bigger + airier, comments expanded. */
.mb-mode-post .mb-composer { order: -1; border-top: none; border-bottom: 1px solid #e8e7df; }
.mb-mode-post .mb-list { padding: 20px 24px; gap: 20px; }
.mb-mode-post .mb-post {
  padding: 16px 18px;
  background: white;
  border: 1px solid #e0dfd7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-radius: 8px;
}
.mb-mode-post .mb-avatar { width: 36px; height: 36px; }
.mb-mode-post .mb-from { font-size: 13px; }
.mb-mode-post .mb-body { font-size: 15px; }

/* ============================================================
   plugin: files
   ============================================================ */
.plugin-files {
  display: flex;
  flex-direction: column;
}
.files-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 0;
}
.files-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #e8e7df;
  background: #fafaf6;
  flex-shrink: 0;
}
.files-back {
  font: inherit;
  padding: 4px 10px;
  border: 1px solid #c9d2bd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}
.files-back:hover { background: #ecefe5; }
.files-badge { font-size: 14px; flex-shrink: 0; }
.files-status {
  flex: 1 1 auto;
  font-size: 12px;
  color: #666;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-status.is-error { color: #b14216; }
.files-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.files-actions button {
  font: inherit;
  padding: 4px 10px;
  border: 1px solid #c9d2bd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}
.files-actions button:hover { background: #ecefe5; }

.files-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  flex: 1 1 auto;
  overflow-y: auto;
}
.files-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 14px;
  color: #222;
  border-bottom: 1px solid #f1efe8;
}
.files-row:hover { background: #fafaf6; }
.files-icon { font-size: 18px; flex-shrink: 0; }
.files-name {
  color: #2d5016;
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-name:hover { text-decoration: underline; }
.files-row-folder .files-name { color: #1f3a0d; font-weight: 600; }
.files-meta {
  flex: 1 1 auto;
  font-size: 12px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, Menlo, monospace;
}
.files-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}
.files-row:hover .files-row-actions { opacity: 1; }
.files-row-actions button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 6px;
  font-size: 12px;
  cursor: pointer;
  color: #777;
}
.files-row-actions button:hover { background: #ecefe5; border-color: #c9d2bd; color: #222; }
.files-row-actions .files-del:hover { color: #b14216; border-color: #e5b5a5; }

.files-empty {
  padding: 40px 16px;
  text-align: center;
  font-size: 14px;
  color: #888;
  font-style: italic;
}

/* ---- message-board: top bar (badge + settings) ---- */
.mb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #e8e7df;
  background: #fafaf6;
  flex-shrink: 0;
  font-size: 12px;
  color: #555;
}
.mb-bar-badge { font-size: 14px; flex-shrink: 0; }
.mb-bar-status { font-weight: 500; }
.mb-bar-mode { color: #888; }
.mb-bar-actions { margin-left: auto; display: flex; gap: 6px; }

/* In post mode the composer is order:-1 (top). The bar still sits ABOVE
   that — flip the bar's order too so it stays first. */
.mb-mode-post .mb-bar { order: -2; }

/* The composer hint moved out of the form; if any legacy hint slips back in
   it stays neutral. */
.mb-composer-hint { display: none; }

/* ---- gear button shared across plugins ---- */
.mb-settings,
.wiki-settings,
.files-settings {
  background: transparent;
  border: 1px solid #c9d2bd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
}
.mb-settings:hover,
.wiki-settings:hover,
.files-settings:hover { background: #ecefe5; color: #1a2f0a; }

/* ---- session-settings modal ---- */
#session-settings-modal .modal-card { min-width: 320px; max-width: 480px; }
#session-settings-body { min-height: 40px; }
#session-settings-modal .modal-actions button.danger {
  background: #b14216;
  color: white;
  border-color: #b14216;
}
#session-settings-modal .modal-actions button.danger:hover {
  background: #8a3210;
  border-color: #8a3210;
}

/* Plugin-supplied settings rows */
.plugin-settings { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.plugin-settings .settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plugin-settings .settings-label { font-size: 12px; color: #555; min-width: 60px; }
.plugin-settings select {
  font: inherit;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  flex: 1;
}
.plugin-settings .settings-save {
  padding: 4px 14px;
  background: #2d5016;
  color: white;
  border: 1px solid #2d5016;
  border-radius: 4px;
  cursor: pointer;
}
.plugin-settings .settings-save:hover { background: #1f3a0d; }
.plugin-settings .settings-save:disabled { opacity: 0.6; cursor: wait; }
.plugin-settings .settings-status { font-size: 12px; color: #666; }

/* ---- message-board: attachments ---- */
.mb-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;       /* don't steal vertical space from the post list */
}
.mb-composer-row { display: flex; gap: 8px; align-items: flex-start; }
.mb-composer-row textarea {
  flex: 1;
  min-height: 38px;     /* one comfortable line */
  max-height: 160px;    /* user can resize within this range */
  resize: vertical;
}
.mb-attach {
  background: transparent;
  border: 1px solid #c9d2bd;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 16px;
  cursor: pointer;
  color: #555;
}
.mb-attach:hover { background: #ecefe5; color: #1a2f0a; }
.mb-attach:disabled { opacity: 0.5; cursor: wait; }

.mb-attach-preview[hidden] { display: none; }
.mb-attach-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #f4f4ef;
  border: 1px solid #e0dfd7;
  border-radius: 4px;
}
.mb-attach-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
}
.mb-attach-meta { flex: 1; font-size: 12px; color: #555; }
.mb-attach-remove {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 13px;
  cursor: pointer;
  color: #777;
}
.mb-attach-remove:hover { background: #ecefe5; color: #b14216; border-color: #e5b5a5; }

/* Inline image on a post */
.mb-post-image-link {
  display: block;
  margin-top: 8px;
  max-width: 400px;
}
.mb-post-image {
  max-width: 100%;
  max-height: 360px;
  border-radius: 6px;
  border: 1px solid #e0dfd7;
  display: block;
}
.mb-mode-post .mb-post-image-link { max-width: 600px; }
.mb-mode-post .mb-post-image { max-height: 480px; }

/* ---- files: folder tree in the sidebar subnav ---- */
.session-expansion .files-tree {
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
}
.session-expansion .files-tree-children {
  list-style: none;
  margin: 0;
  padding-left: 14px;
}
.session-expansion .files-tree-node { padding: 0; }
.session-expansion .files-tree-link {
  display: block;
  padding: 3px 12px 3px 24px;
  color: #2d5016;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid transparent;
  margin-left: -3px;
}
.session-expansion .files-tree-link:hover { background: #f3f3f1; }
.session-expansion .files-tree-node.is-active > .files-tree-link {
  background: #ecefe5;
  border-left-color: #2d5016;
  font-weight: 600;
}

/* ---- message-board: send icon + reply pip ---- */
.mb-send {
  font-size: 18px;
  line-height: 1;
  padding: 4px 14px;
}
/* Reply button shares the post-action look but stays neutral (not red) */
.mb-post-actions .mb-reply:hover { color: #2d5016; border-color: #c9d2bd; }
