html, body { width: 100%; height: 100%; overflow: hidden; background: #fbfbfa; }

.app-shell {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fbfbfa;
}

.sidebar {
  width: 224px;
  flex-basis: 224px;
  padding: 20px 15px 18px;
  background: #faf9f7;
  border-right: 1px solid #e7e6e2;
}

.app-shell.sidebar-hidden .sidebar { display: none; }

.brand {
  padding: 0 8px 25px;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.logo-dots {
  width: 21px;
  height: 21px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-auto-rows: 4px;
  gap: 2px;
  align-content: center;
  justify-content: center;
  transform: rotate(45deg);
}

.logo-dots i { width: 4px; height: 4px; border-radius: 50%; background: #353536; }
.nav-label { margin: 13px 10px 7px; font-size: .75rem; }
.nav-item { min-height: 38px; padding: 8px 10px; border-radius: 7px; font-size: .875rem; }
.nav-item.active { background: #83df6b; color: #1f321d; }
.save-line { font-size: .75rem; }
.save-dot.error { background: #c95650; }

.topbar {
  height: 65px;
  flex-basis: 65px;
  padding: 0 22px;
  background: #fdfdfc;
  border-bottom: 1px solid #e7e6e2;
}

.title-row h1 { font-size: 1.125rem; font-weight: 560; }
.search { width: 250px; height: 33px; border-color: #deddda; }
.primary-button { background: #363638; }
.avatar-button { width: 35px; min-width: 35px; background: #ef9e73; color: #552d1c; }

.summary {
  min-height: 90px;
  margin: 0 20px;
  border-radius: 0 0 12px 12px;
  border-bottom-color: #dfdedb;
  box-shadow: 0 7px 14px #30302916;
}

.summary article { padding: 14px 16px; }
.summary article + article::before { height: 48px; }
.summary-icon { width: 33px; height: 33px; border-radius: 10px; background: #46474b !important; }
.summary small { font-size: .75rem; }
.summary strong { font-size: 1rem; }
.summary em { font-size: .7rem; background: #daf1ad; }

.controls { padding: 17px 20px 10px; }
.segmented button, .filter-chips button, #filters { font-size: .75rem; padding: 6px 10px; }
.filter-chips { margin-top: 7px; }
#showing-count { font-size: .75rem; }

.filter-panel { margin: 0 20px 11px; padding: 14px 16px; border-radius: 8px; box-shadow: none; }
.filter-panel h2, .filter-panel label, .filter-panel button { font-size: .75rem; }

.board {
  gap: 10px;
  padding: 0 20px 18px;
}

.lane {
  flex-basis: 228px;
  background: #efeeec;
  border-radius: 8px;
}

.lane-head {
  min-height: 42px;
  padding: 9px 10px;
  border-top: 0;
}

.lane-head h2 { font-size: .75rem; }
.lane-count { font-size: .7rem; background: #dfdedb; }
.lane-head .lane-weight { font-size: .7rem; }
.cards { padding: 0 7px 9px; }

.card {
  margin-bottom: 7px;
  padding: 9px 10px 10px;
  border-color: #deddda;
  border-radius: 8px;
  box-shadow: 0 4px 9px #2c2c2612;
}

.card-top { min-height: 22px; margin-bottom: 6px; }
.handle, .card-id, .card-tools button, .move-select { font-size: .75rem; }
.type-dot { width: 19px; height: 19px; font-size: .65rem; }
.card-sentence { font-size: .875rem; line-height: 1.42; }
.card-sentence mark, .drawer-insight mark { background: #f3e7a8; }
.card-footer { margin-top: 8px; }
.weight-pill, .grade-pill { font-size: .7rem; }
.card-tools .details-link { margin: 0; padding: 2px 4px; font-size: .75rem; }

.detail-drawer {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(470px, 100vw);
  border-radius: 0;
}

.hidden-panel {
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 0;
}

@media (min-width: 1800px) {
  .lane { flex-basis: 250px; }
}

@media (max-width: 1050px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .summary, .controls, .filter-panel { margin-left: 14px; margin-right: 14px; }
  .controls { padding-left: 0; padding-right: 0; }
  .board { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 650px) {
  .summary { margin-left: 10px; margin-right: 10px; }
  .controls { margin-left: 10px; margin-right: 10px; }
  .lane { flex-basis: 280px; }
}

/* The consolidated view uses the same working surface and keeps provenance close to each idea. */
.view-tabs{border:1px solid #d9d9d5;border-radius:8px;padding:3px;gap:2px;background:#ececea}
.view-tabs button{font-size:.8rem;padding:7px 10px;border-radius:6px}
.view-tabs button.active{background:#80d46d;color:#20311b}
.view-tabs b{font-weight:500;font-size:.75rem;padding-left:4px}
#type-tabs[hidden],#merge-note[hidden]{display:none}
.control-row{flex-wrap:wrap}
.merge-note{font-size:.78rem;color:#74746f;line-height:1.5;margin:9px 0 0}
.merge-note a{color:#416c39;text-underline-offset:3px;margin-left:8px}
.card-provenance{display:flex;gap:4px;flex-wrap:wrap;align-items:center;margin-top:10px;padding-top:8px;border-top:1px solid #eeeee9}
.card-provenance small{font-size:.75rem;color:#7a7a76;margin-right:2px}
.card-provenance button{font-size:.75rem;line-height:1.5;border:1px solid #dfdfd9;border-radius:4px;padding:1px 5px;background:#f5f5f1;color:#53614e}
.card-provenance button:hover{background:#e2f3dc;border-color:#a9cc9b}
.source-trace{margin:0 0 18px;padding-top:0;border-top:0}
.source-trace details{border:1px solid #dddfd8;border-radius:8px;margin:8px 0;background:#fff;overflow:hidden}
.source-trace summary{display:flex;align-items:center;gap:8px;padding:12px 10px;font-size:.85rem;cursor:pointer;background:#f6f7f3;list-style:none}
.source-trace summary::before{content:'›';font-size:1.1rem;color:#68715f}
.source-trace details[open] summary::before{transform:rotate(90deg)}
.source-trace summary>span:nth-child(2){flex:1}
.source-trace summary .grade-pill{font-size:.75rem}
.source-body{padding:14px}
.source-body .source-sentence{font-size:.94rem;line-height:1.5;color:#30322e}
.source-sentence mark{background:#f7edb8;font-weight:600;color:inherit}
.source-body dl{font-size:.82rem;line-height:1.5;margin-bottom:0}
.source-body dt{font-weight:600;color:#73766d;margin-top:14px}
.source-body dd{margin:4px 0 0;white-space:pre-line;color:#41443d}
.group-link{border:1px solid #d7e2d0;background:#edf6e8;color:#3b6232;border-radius:6px;padding:9px 12px;margin-bottom:18px;font-size:.82rem}
@media(max-width:650px){.view-tabs{width:100%}.view-tabs button{flex:1}.merge-note{font-size:.75rem}.merge-note a{display:block;margin:3px 0}.filter-chips{flex-wrap:wrap}.source-trace summary{gap:6px}}
