.notebook-page { --book-paper:#f6f6ef; --book-ink:#26392c; --book-green:#28513a; --book-edge:#d6ddce; background:var(--book-paper); color:var(--book-ink); margin:0; font-size:1rem; }
.notebook-page [hidden] { display:none!important; }
.notebook-mast { background:#fffefa; border-bottom:1px solid var(--book-edge); }
.notebook-mast-inner,.notebook-main { width:min(100% - 32px, 920px); margin-inline:auto; }
.notebook-mast-inner { display:flex; align-items:center; gap:18px; min-height:76px; padding-block:8px; }
.notebook-brands { display:flex; align-items:center; gap:8px; }
.notebook-brands img { width:42px; height:42px; object-fit:contain; }
.notebook-mast h1 { margin:0; padding-left:17px; border-left:1px solid var(--book-edge); font:650 1.35rem/1.4 var(--serif); color:var(--book-green); }
#book-home { display:inline-flex; align-items:center; min-height:44px; color:inherit; text-decoration:none; }
#book-home:hover { text-decoration:underline; text-underline-offset:3px; }
#books-open { margin-left:auto; }
.notebook-main { padding-block:clamp(18px,4.5vw,48px) 28px; min-height:69vh; }
.book-page-title,.book-active-top,.book-start,.book-line { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.book-page-title,.book-active-top { margin-bottom:20px; }
.book-page-title h2,.book-active-top h2 { margin:0; font:680 clamp(1.45rem,4vw,1.9rem)/1.4 var(--serif); }
.book-active-top p { margin:4px 0 0; color:#586a58; font-size:.9rem; }
.book-setup-grid { display:grid; grid-template-columns:.95fr 1.05fr; gap:18px; align-items:start; }
.book-panel,.book-summary,.book-list-item { background:#fffefa; border:1px solid var(--book-edge); border-radius:12px; }
.book-panel { min-width:0; padding:clamp(17px,3vw,26px); }
.book-panel h3 { margin:0; font-size:1.08rem; }
.book-switch { display:flex; margin:18px 0 12px; padding:3px; gap:3px; background:#eef1e8; border-radius:9px; }
.book-switch button { flex:1; padding:5px 7px; background:transparent; border:0; color:#51634f; min-height:44px; border-radius:7px; font-size:.9rem; }
.book-switch button[aria-pressed=true] { background:#fffefa; color:#234831; font-weight:700; box-shadow:0 1px 3px #21331924; }
.book-line,.book-field,#book-missing-wrap { font-weight:600; font-size:.94rem; }
.book-field { display:block; margin:16px 0 6px; }
.book-panel textarea,.book-panel select,.book-seat input,#book-custom-role-name { border:1px solid #b8c6b0; border-radius:7px; background:#fffefa; color:var(--book-ink); font:inherit; font-size:1rem; }
.book-panel select { min-height:44px; padding:5px 7px; }
#book-count { min-width:88px; }
.book-names { margin-top:12px; }
.book-names summary { min-height:44px; align-content:center; cursor:pointer; font-size:.94rem; font-weight:600; }
#book-seats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px; }
.book-seat { display:grid; grid-template-columns:2ch minmax(0,1fr); gap:5px; align-items:center; }
.book-seat span { color:#596954; font-size:.8rem; font-variant-numeric:tabular-nums; }
.book-seat input { box-sizing:border-box; min-width:0; width:100%; min-height:44px; padding:6px; }
.book-seat input::placeholder { color:#687463; }
#book-roster { display:block; width:100%; padding:10px 12px; resize:vertical; line-height:1.6; }
#book-roster::placeholder { color:#7a8578; }
.book-help { color:#586853; font-size:.84rem; line-height:1.6; margin:8px 0 0; }
#book-total { color:#476347; font-size:.88rem; font-variant-numeric:tabular-nums; }
#book-missing-wrap { display:flex; gap:6px; align-items:center; width:fit-content; min-height:44px; color:#536550; font-size:.88rem; }
#book-missing { width:17px; height:17px; accent-color:var(--book-green); }
#book-role-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:3px 13px; }
.book-role { display:grid; grid-template-columns:24px minmax(0,1fr) auto; align-items:center; gap:5px; min-height:51px; border-bottom:1px solid #e4e8dd; font-size:.92rem; font-weight:600; }
.book-role img { border-radius:50%; }
.book-role select { width:64px; }
.book-custom-role { display:grid; grid-template-columns:minmax(0,1fr) 64px auto; align-items:center; gap:8px; min-height:51px; border-bottom:1px solid #e4e8dd; font-size:.92rem; }
.book-custom-role strong { overflow-wrap:anywhere; }
.book-custom-role-add { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
.book-fill-villagers { margin-top:12px; }
.book-fill-villagers:disabled { opacity:.5; }
#book-custom-role-name { box-sizing:border-box; width:100%; min-width:0; min-height:44px; padding:7px 9px; }
#book-custom-role-name[aria-invalid=true] { border-color:#874039; color:#874039; }
#book-custom-role-status { margin:5px 0 0; color:#546a57; font-size:.84rem; }
.book-start { align-items:center; margin-top:20px; padding:16px 0; border-top:1px solid var(--book-edge); }
.book-primary,.book-quiet { min-height:44px; padding:7px 12px; font:600 .9rem var(--sans); border-radius:7px; }
.book-primary { background:var(--book-green); color:white; border:1px solid var(--book-green); padding-inline:18px; }
.book-quiet { background:transparent; color:var(--book-green); border:1px solid #b7c6b3; }
#book-validation,#book-storage-status { color:#97422e; font-size:.92rem; margin:4px 0; }
.book-view-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }
.book-view-actions a { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.book-view-actions .book-quiet:hover { background:#eef1e8; }
.book-view-actions .book-primary:hover { background:#1c3d2a; }
.book-stream-note { display:inline-flex; gap:6px; align-items:center; min-height:44px; margin-left:auto; color:#4c644f; font-size:.86rem; }
.book-stream-note input { width:17px; height:17px; accent-color:var(--book-green); }
.book-own-role { margin-bottom:12px; padding:9px 15px; }
#book-own-role { max-width:65%; min-width:min(140px,55%); }
#book-wolf-partners { min-width:0; padding:0; border:0; margin:12px 0 5px; }
#book-wolf-partners legend { font-weight:650; font-size:.92rem; color:var(--book-green); padding:0; }
#book-wolf-partners .book-help { margin:4px 0 8px; }
.book-partner-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(124px,100%),1fr)); gap:5px; }
.book-partner-grid label { display:flex; gap:7px; align-items:center; min-height:44px; padding:5px 8px; border:1px solid var(--book-edge); border-radius:7px; cursor:pointer; overflow-wrap:anywhere; }
.book-partner-grid label:has(input:checked) { background:#e7efe3; border-color:#7d9e7d; }
.book-partner-grid label:has(input:disabled) { color:#5e6e5f; cursor:default; }
.book-partner-grid input { flex:none; margin:0; width:17px; height:17px; accent-color:var(--book-green); }
.book-partner-grid small { color:#546a57; font-variant-numeric:tabular-nums; }
.book-summary { padding:0 15px; margin-bottom:18px; }
.book-summary summary { min-height:46px; align-content:center; font-weight:650; cursor:pointer; }
.book-summary ol { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); list-style:none; gap:4px 8px; margin:0; padding:5px 0; font-size:.94rem; }
.book-summary li { overflow-wrap:anywhere; }
.book-summary li span { font-variant-numeric:tabular-nums; color:#5c6b57; font-size:.82rem; }
.book-deck { display:flex; flex-wrap:wrap; gap:6px; padding:10px 0 16px; }
.book-deck span { min-width:0; border:1px solid var(--book-edge); border-radius:5px; padding:3px 7px; font-size:.84rem; overflow-wrap:anywhere; }
.notebook-page .memo-extra-claims li > strong { min-width:0; overflow-wrap:anywhere; }
.book-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:10px; }
.book-list-item { display:flex; align-items:center; padding-right:10px; min-width:0; }
.book-list-open { display:grid; flex:1; min-width:0; gap:5px; padding:17px; text-align:left; overflow-wrap:anywhere; border:0; border-radius:12px; background:transparent; }
.book-list-open strong { font-size:1rem; color:var(--book-green); }
.book-list-open small,.book-history-status { color:#5a6755; }
.book-delete { flex:none; min-height:44px; min-width:44px; padding:7px 10px; border:1px solid transparent; border-radius:7px; background:transparent; color:#874039; font:600 .85rem var(--sans); }
.book-delete:hover { background:#f5ece6; }
.book-delete-dialog { width:min(calc(100% - 32px), 420px); max-height:calc(100% - 32px); padding:22px; border:1px solid var(--book-edge); border-radius:12px; color:var(--book-ink); background:#fffefa; }
.book-delete-dialog::backdrop { background:#18291c66; }
.book-delete-dialog h2 { margin:0; font-size:1.2rem; }
.book-delete-dialog p { margin:10px 0; overflow-wrap:anywhere; }
#book-delete-error { color:#874039; }
.book-delete-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:18px; }
.book-delete-actions .book-delete { border-color:#874039; }
.notebook-footer { padding:20px 10px max(24px,env(safe-area-inset-bottom)); text-align:center; color:#5a6755; font-size:.75rem; }
@media(max-width:700px) { .book-setup-grid { grid-template-columns:minmax(0,1fr); gap:12px; } }
@media(max-width:440px) {
  .notebook-mast-inner { min-height:60px; gap:10px; }
  .notebook-mast h1 { padding-left:10px; font-size:1.15rem; }
  .notebook-brands { gap:4px; }
  .notebook-brands img { width:32px; height:32px; }
  .notebook-mast .book-quiet { font-size:.82rem; }
  .book-role { grid-template-columns:20px minmax(0,1fr) auto; gap:3px; }
  .book-role img { width:20px; height:20px; }
  #book-role-grid { grid-template-columns:repeat(auto-fit,minmax(min(130px,100%),1fr)); }
  .book-stream-note { margin-left:0; }
}

.notebook-stream { background:#f0f3eb; }
.notebook-stream :is(.notebook-mast,.notebook-footer) { display:none; }
.notebook-stream .notebook-main { width:100%; min-height:0; margin:0; padding:0; }
.memo-stream {
  --stream-pad:clamp(7px,.9vw,16px);
  --stream-line:#d4dfd0;
  color:#203b2b;
  font-size:clamp(13px,1.2vw,19px);
  line-height:1.35;
  font-weight:500;
}
.memo-stream-main { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:stretch; min-height:100vh; }
.memo-stream-claims,.memo-stream-side { min-width:0; border-top:3px solid #3d694b; padding:var(--stream-pad); background:#f8faf5; }
.memo-stream-side { border-left:1px solid #bdcbbb; background:#eef3e9; }
.memo-stream-group { display:grid; grid-template-columns:5em minmax(0,1fr); gap:.55em; padding:.25em 0; align-items:baseline; }
.memo-stream-group + .memo-stream-group { border-top:1px solid var(--stream-line); }
.memo-stream-label { margin:0; width:fit-content; max-width:100%; border-radius:4px; padding:.12em .42em; background:#e1ebdc; color:#234b33; font-size:.86em; line-height:1.45; font-weight:750; overflow-wrap:anywhere; }
.memo-stream-medium .memo-stream-label { background:#e7e6ee; color:#4f476b; }
.memo-stream-guard .memo-stream-label { background:#dfebf0; color:#31596b; }
.memo-stream-events .memo-stream-label { background:#dce7d8; }
.memo-stream-list { display:grid; gap:.18em; min-width:0; margin:0; padding:0; list-style:none; }
.memo-stream-line { min-width:0; overflow-wrap:anywhere; }
.memo-stream-person { color:#162f22; }
.memo-stream-report { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; gap:.5em; }
.memo-stream-report .memo-stream-person { max-width:7em; }
.memo-stream-results { display:flex; flex-wrap:wrap; gap:.18em .6em; min-width:0; }
.memo-stream-result { max-width:100%; }
.memo-stream-day { margin-right:.18em; color:#52695a; font-size:max(9px,.68em); white-space:nowrap; font-variant-numeric:tabular-nums; }
.memo-stream-empty { color:#52695a; }
.memo-stream-events .memo-stream-list { display:flex; flex-wrap:wrap; gap:.2em .7em; }
.memo-stream-events .memo-stream-line { max-width:100%; }
.memo-own-role-line { margin:0; overflow-wrap:anywhere; }
.memo-own-role-wolf { color:#8e3d3c; }
.memo-own-role-partners { margin-inline-start:.35em; }
.memo-stream-own-role .memo-stream-label { padding-inline:.3em; font-size:.82em; }
.memo-stream-note p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.memo-stream .memo-storage-status,.book-stream-status { margin:12px; }
@media(max-height:300px) and (min-width:540px) {
  .memo-stream { --stream-pad:clamp(4px,3.5vh,9px) clamp(8px,.9vw,16px); font-size:clamp(12px,min(1.2vw,8.9vh),18px); line-height:1.3; }
  .memo-stream-main { height:100vh; }
  .memo-stream-claims,.memo-stream-side { min-height:0; overflow:auto; scrollbar-width:thin; }
  .memo-stream-group { padding:.22em 0; }
}
@media(max-width:539px) {
  .memo-stream-main { grid-template-columns:minmax(0,1fr); min-height:0; }
  .memo-stream-side { border:0; border-top:1px solid #bdcbbb; }
}
