:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: #202a24;
  background: #f7f6ef;
  --paper: #fcfbf7;
  --border: #dedfd5;
  --muted: #536257;
  --forest: #1b3028;
  --green: #295b44;
  --serif: "PT Serif", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #578b69; }
button {
  min-height: 39px; padding: 8px 13px; color: inherit; border: 1px solid var(--border);
  border-radius: 8px; background: var(--paper); font-size: .9rem; font-weight: 600;
}
button:hover { border-color: #799783; }
button.primary { color: white; background: var(--green); border-color: var(--green); }
button.primary:hover { background: #1e4835; }
button.quiet { border-color: transparent; background: transparent; }
button.danger { color: #a03b38; }
.app { display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; align-items: stretch; gap: 9px;
  background: var(--forest); color: #f5f3e9; padding: 24px 17px 20px;
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; margin-bottom: 33px; font: 1.35rem var(--serif); white-space: nowrap; }
.mark {
  display: grid; place-items: center; width: 37px; height: 39px;
  border-radius: 8px 9px 9px 8px; background: #e4d8aa; color: #233d30;
  border-left: 4px solid #c0b28b; font-size: 1.35rem;
}
.side-label { margin: 0 9px 4px; text-transform: uppercase; font-size: .69rem; letter-spacing: .11em; font-weight: 700; color: #bed0c3; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar button { text-align: left; color: #f5f3e9; background: transparent; border-color: transparent; font-weight: 500; }
.sidebar button:hover { border-color: #587865; }
.sidebar button[aria-current="true"] { background: #385949; border-color: #557963; }
.sidebar .chapter { display: flex; justify-content: space-between; gap: 9px; align-items: center; text-wrap: pretty; }
.chapter b { color: #caddcc; font-size: .75rem; }
.sidebar .new-chapter { align-self: start; color: #e0eadf; border-color: #5d7668; margin: 10px 0 0; }
.side-footer { margin: auto 4px 0; padding-top: 28px; color: #c8dacd; font-size: .73rem; display: flex; align-items: center; gap: 7px; }
.side-footer span { width: 7px; height: 7px; border-radius: 50%; background: #8cb795; flex: none; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 75px; padding: 14px clamp(16px, 3.3vw, 48px); border-bottom: 1px solid var(--border); background: var(--paper);
}
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding-left: 11px; max-width: 360px; width: 100%; }
.search span { width: 12px; height: 12px; border: 1.6px solid #5b6f60; border-radius: 50%; position: relative; flex: none; }
.search span::after { content: ""; width: 5px; height: 1.5px; background: #5b6f60; position: absolute; right: -4px; bottom: -2px; transform: rotate(45deg); }
.search input { width: 100%; min-width: 0; height: 38px; border: 0; background: transparent; color: inherit; border-radius: 7px; font-size: .9rem; padding: 6px 8px 6px 2px; }
.actions, .modal-actions { display: flex; align-items: center; gap: 8px; }
.actions { white-space: nowrap; }
.workspace { padding: 31px clamp(16px, 3.3vw, 48px) 56px; max-width: 1540px; margin: 0 auto; }
.workspace-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.eyebrow { color: var(--green); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .075em; margin: 0 0 9px; overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
h1 { font: clamp(2.05rem, 3.5vw, 3.2rem)/1.05 var(--serif); letter-spacing: -.038em; }
.switch { display: flex; border: 1px solid var(--border); border-radius: 9px; padding: 3px; background: #ebede4; flex: none; }
.switch button { min-height: 31px; padding: 4px 12px; border-color: transparent; border-radius: 6px; background: transparent; }
.switch [aria-pressed="true"] { border-color: #dbded4; background: var(--paper); box-shadow: 0 1px 2px #202a2410; }
.counts { color: var(--muted); font-size: .88rem; margin: 15px 0 25px; }
.board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; align-items: stretch; }
.lane { min-height: 372px; padding: 15px 13px; border: 1px solid var(--border); border-radius: 13px; background: #efefe6; }
.lane[data-stage="review"] { background: #f3efe0; border-color: #e6dfca; }
.lane[data-stage="ready"] { background: #e9efe4; border-color: #dce4d7; }
.lane-header { display: flex; gap: 8px; align-items: center; margin: 0 1px 14px; }
.lane-header h2 { font-size: .95rem; flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #75867b; flex: none; }
[data-stage="review"] .dot { background: #a67929; }
[data-stage="ready"] .dot { background: #44765a; }
.badge { color: #445347; padding: 2px 7px; border-radius: 99px; background: #fcfbf4; border: 1px solid #dadcd1; font-size: .72rem; font-weight: 700; }
.lane-list { display: grid; gap: 10px; }
.card {
  padding: 15px 14px 11px; background: var(--paper); border: 1px solid #dbdfd4;
  border-radius: 9px; box-shadow: 0 3px 10px #28372a08; min-width: 0;
}
.card:hover { border-color: #97ac9b; }
.card .eyebrow { font-size: .66rem; margin-bottom: 7px; }
.card-title { display: block; width: 100%; padding: 0; min-height: 0; border: 0; border-radius: 2px; text-align: left; font: 1.25rem/1.16 var(--serif); overflow-wrap: anywhere; }
.card-title:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.excerpt { margin: 8px 0 13px; font-size: .84rem; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; flex-wrap: wrap; border-top: 1px solid #e8e9e0; padding-top: 8px; font-size: .73rem; color: var(--muted); }
.card-footer select { max-width: 100%; padding: 3px 4px; font-size: .75rem; background: #f5f5ee; }
.add-to-lane { width: 100%; text-align: left; border-color: transparent; background: transparent; color: #3f5748; margin-top: 8px; font-size: .82rem; }
.empty { color: var(--muted); padding: 14px 3px; font-size: .84rem; }
.book-chapter { margin-bottom: 24px; }
.book-chapter h2 { font: 1.55rem var(--serif); margin-bottom: 10px; }
.book-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr)); }
dialog {
  width: min(860px, calc(100% - 28px)); max-height: calc(100dvh - 40px);
  color: inherit; background: var(--paper); border: 1px solid #bfcbbf;
  border-radius: 15px; padding: 0; box-shadow: 0 22px 90px #14261b48;
}
dialog::backdrop { background: #15251dcc; }
dialog.compact { width: min(500px, calc(100% - 28px)); }
.dialog-head { padding: 19px clamp(16px, 4vw, 28px); display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font: 1.55rem var(--serif); overflow-wrap: anywhere; }
.dialog-head .close { font-size: 1.3rem; min-height: 32px; padding: 0 9px; }
.dialog-body { padding: 23px clamp(16px, 4vw, 28px); }
.reading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, 215px); gap: 23px; }
.reading article { min-width: 0; overflow-wrap: anywhere; }
.reading .definition { font: 1.18rem/1.5 var(--serif); padding: 13px 15px; background: #edf0e3; border-left: 3px solid #72966f; border-radius: 4px; margin-bottom: 17px; }
.notes { font-size: .94rem; line-height: 1.58; }
.notes h3 { font: 1.26rem var(--serif); margin: 18px 0 7px; }
.notes p { margin-bottom: 12px; white-space: pre-line; }
.notes a { color: var(--green); }
.related { padding: 13px; border: 1px solid var(--border); border-radius: 9px; background: #f1f3eb; align-self: start; }
.related h3 { font: 1.22rem var(--serif); margin-bottom: 10px; }
.related .relation { padding: 10px 0; border-top: 1px solid #d9e0d5; }
.relation button { min-height: 0; text-align: left; padding: 0; border: 0; color: var(--green); text-decoration: underline; background: none; overflow-wrap: anywhere; }
.relation p { font-size: .8rem; color: var(--muted); margin: 5px 0; overflow-wrap: anywhere; white-space: pre-line; }
.related .edit-link { font-size: .73rem; color: #526257; }
.modal-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 19px; }
form label { display: grid; gap: 6px; font-size: .84rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
form input, textarea, select { color: #202a24; border: 1px solid #cfd7cc; border-radius: 7px; background: white; padding: 8px; min-width: 0; }
form textarea { width: 100%; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.chapter-settings { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#toast { position: fixed; bottom: 16px; right: 16px; z-index: 20; background: #263f33; color: white; border-radius: 9px; padding: 10px 14px; max-width: calc(100% - 32px); font-size: .9rem; box-shadow: 0 5px 22px #24342a27; }
@media (max-width: 1000px) {
  .app { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { font-size: 1.17rem; }
  .board { gap: 9px; }
  .lane { padding: 12px 9px; }
  .card { padding-inline: 10px; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { padding: 12px 16px; gap: 7px; }
  .brand { margin: 0; }
  .side-label, .side-footer { display: none; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav button { font-size: .76rem; padding: 5px 7px; min-height: 30px; }
  .sidebar .new-chapter { margin-top: 0; padding: 4px 8px; min-height: 28px; font-size: .76rem; }
  .toolbar { min-height: 62px; gap: 7px; padding: 9px 12px; }
  .toolbar button { padding-inline: 8px; font-size: .8rem; }
  .workspace { padding-top: 23px; }
  .board { grid-template-columns: 1fr; }
  .lane { min-height: 0; padding: 13px; }
  .reading { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .workspace-title { align-items: flex-start; flex-direction: column; }
}
