/* Compact right-hand panel. The list stays on the page.
   Visual only: no data, permission, or business-rule changes. */

body.diam-split-open { --diam-split-w: min(400px, 46vw); }

.diam-split {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  width: var(--diam-split-w, min(400px, 46vw));
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  color: var(--ink, #1B2420);
  border-left: 1px solid var(--line, #E6E0D3);
  box-shadow: -12px 0 30px -18px rgba(27, 36, 32, .35);
  font-family: var(--sans, 'IBM Plex Sans', system-ui, sans-serif);
}
body:has(.top) .diam-split { top: 64px; }
.diam-split[hidden] { display: none !important; }

.diam-split-hd {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 12px;
  background: var(--oasis, #0D3B34);
  color: #fff;
}
.diam-split-hd h2 {
  margin: 0;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}
.diam-split-meta {
  margin-top: 4px;
  font-size: .84rem;
  color: #D9C08A;
  line-height: 1.35;
}
.diam-split-x {
  margin-left: auto;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.diam-split-x:hover { background: rgba(255, 255, 255, .24); }
.diam-split-bd {
  flex: 1;
  overflow: auto;
  padding: 14px 14px 28px;
  font-size: .92rem;
  line-height: 1.45;
}

body.diam-split-open .body { padding-right: calc(var(--diam-split-w) + 8px); }
body.diam-split-open .wrap {
  width: min(560px, calc(100vw - var(--diam-split-w) - 24px));
  margin-right: calc(var(--diam-split-w) + 12px);
  margin-left: auto;
}

tr[data-split-on], [data-split-on].qcard, [data-split-kind] { cursor: pointer; }
tr.split-on td { background: var(--teal-soft, #EEF3EF) !important; }
tr.split-on td:first-child { box-shadow: inset 3px 0 0 var(--oasis, #0D3B34); }
.qcard.split-on, .jobopt.split-on, .doc.split-on, li.split-on {
  box-shadow: inset 3px 0 0 var(--oasis, #0D3B34);
  background: var(--teal-soft, #EEF3EF);
}

.sp-k {
  margin: 12px 0 2px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-ink, #7A5E22);
}
.sp-v { color: var(--ink, #1B2420); }
.sp-ul { margin: 4px 0 0; padding-left: 18px; }
.sp-ul li { margin: 2px 0; }
.sp-note { margin: 8px 0; color: var(--ink-soft, #535F5A); }
.sp-acts, .sp-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.sp-lines { margin-top: 8px; }
.sp-lines dt { font-weight: 700; margin-top: 8px; }
.sp-lines dd { margin: 0; }

.diam-why {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line, #E6E0D3);
  background: #fff;
  color: var(--oasis, #0D3B34);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.diam-pop {
  position: fixed;
  z-index: 70;
  max-width: 280px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink, #1B2420);
  border: 1px solid var(--line, #E6E0D3);
  border-radius: 12px;
  box-shadow: 0 12px 30px -12px rgba(27, 36, 32, .4);
  font-size: .88rem;
  line-height: 1.45;
}
.diam-pop[hidden] { display: none !important; }
.diam-pop p { margin: 0; }

@media (max-width: 700px) {
  /* A side column at this width crushes the list. The panel sits on the bottom
     and leaves the top of the file or the list readable. */
  body.diam-split-open { --diam-split-w: 100%; }
  body.diam-split-open .body { padding-right: 16px; }
  body:has(.top) .diam-split {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(42vh, 380px);
    border-left: 0;
    border-top: 1px solid var(--line, #E6E0D3);
    border-radius: 16px 16px 0 0;
  }
  body.hasbnav .diam-split { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  body.hasbnav.m-actbar .diam-split { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
  .diam-split-x { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .diam-split { transition: none; }
}
@media print {
  .diam-split, .diam-pop { display: none !important; }
  body.diam-split-open .body { padding-right: 0 !important; }
  body.diam-split-open .wrap { width: auto; margin-right: 0; }
}
