/* Independent history navigation; scope and private-content checks remain server-owned. */
body{margin:0;background:#f4f6fa;color:#172033}
body[data-phase=night]{background:#000030;color:snow}
.history-page{min-height:100vh}
.history-page .history-main{width:100%;max-width:1180px;margin:0 auto;min-height:0;padding:18px 16px 40px}
.history-panel{margin:0;padding:20px;min-width:0}
.history-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.history-heading h1{margin:0;font-size:24px;line-height:1.4;overflow-wrap:anywhere}
.history-eyebrow{margin:0 0 4px;font-size:12px;opacity:.7}
.history-types{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.history-nav-btn{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 16px;border:1px solid #b9c7db;border-radius:10px;background:#f5f8fd;color:#243c64;text-decoration:none;font-size:14px;font-weight:700;white-space:nowrap}
.history-nav-btn:hover{background:#e7effc;border-color:#6587bb}
.history-nav-btn.is-active{background:#2563eb;color:white;border-color:#2563eb}
.history-nav-btn:focus-visible,.history-scope-btn:focus-visible{outline:3px solid #d89627;outline-offset:3px}
.history-return{min-height:32px;padding:0 12px}
.history-page .history-scope-buttons{flex-wrap:wrap;overflow:visible;gap:6px;padding:10px 0 14px;border-bottom:1px solid #b9c7db66}
.history-page .history-scope-btn{min-height:32px}
.history-selection{margin:14px 0;font-size:15px;font-weight:800}
.history-page .history-talk-log{height:auto;max-height:none;margin:0;padding:0;overflow:visible}
.history-page .empty-state{padding:30px 12px;text-align:center;opacity:.75}
body[data-phase=night] .history-nav-btn{background:#18243b;border-color:#485c7c;color:#eef4ff}
body[data-phase=night] .history-nav-btn.is-active{background:#85b9ff;color:#0f223b;border-color:#b3d3ff}
.history-page .deadline-warning .system-pill{border:2px solid #c52222;background:#fff0e8;color:#a31313;font-size:18px;font-weight:900;line-height:1.6;padding:10px 18px;border-radius:8px;box-shadow:0 2px 10px #a3131322}
.history-page .deadline-warning .system-text{color:inherit;font:inherit}
.history-page .deadline-warning .system-text *{color:inherit!important}
body[data-phase=night] .history-page .deadline-warning .system-pill{background:#601b24;color:#fff2d9;border-color:#ff8a80}
/* 1.0 keeps its serif, flat cells and dashed conversation rows. */
.history-mode-1{font-family:"PMingLiU","新細明體",serif;background:floralwhite}
.history-mode-1 .history-page,.history-mode-1 .history-panel{background:transparent;color:inherit;box-shadow:none;border-radius:0;border:0}
.history-mode-1 .history-page[data-phase] .history-panel{background:transparent;box-shadow:none}
.history-mode-1 .history-main{max-width:1400px;padding:10px}
.history-mode-1 .history-heading{border-bottom:1px solid silver;padding-bottom:10px}
.history-mode-1 .history-nav-btn,.history-mode-1 .history-scope-btn{border-radius:2px;font-family:inherit;box-shadow:none}
.history-mode-1 .history-talk-log>.talk-row{position:relative;display:block;min-height:42px;padding:6px 8px 6px 280px;border-bottom:1px dashed silver;margin:0;background:transparent}
.history-mode-1 .talk-row .talk-avatar-wrap{position:absolute;left:76px;top:8px;width:30px;min-width:30px}
.history-mode-1 .talk-row .talk-avatar{max-width:30px;max-height:30px;object-fit:contain;border-radius:0}
.history-mode-1 .talk-row .talk-bubble{display:contents}
.history-mode-1 .talk-row .talk-head{position:absolute;left:115px;top:8px;width:155px;margin:0}
.history-mode-1 .talk-row .talk-name{font-size:16px;font-weight:400;display:block}
.history-mode-1 .talk-row .talk-time{position:absolute;left:-113px;top:0;width:72px;font-size:12px;white-space:nowrap}
.history-mode-1 .talk-row .talk-body{font-size:16px;line-height:1.5;color:inherit}
.history-mode-1 .talk-row .talk-body.font-strong{font-size:26.67px;font-weight:bold}
.history-mode-1 .talk-row .talk-body.font-weak{font-size:10.67px}
.history-mode-1 .system-row:not(.deadline-warning){display:block;margin:0;border-top:1px dashed silver}
.history-mode-1 .system-row:not(.deadline-warning) .system-pill{max-width:none;border:0;border-radius:0;box-shadow:none;background:#efefef;color:black;text-align:left;padding:6px 12px;font-size:16px}
.history-mode-1 .system-night-wolf-hint:not(.deadline-warning) .system-pill,.history-mode-1 .system-night-common-hint:not(.deadline-warning) .system-pill{background:transparent;color:inherit;font-weight:400;opacity:1}
.history-mode-1 .system-night-common-hint:not(.deadline-warning) .system-pill{font-size:10.67px}
.history-mode-1 .event-block,.history-mode-1 .lastword-line{border-radius:0;box-shadow:none}
/* 2.0 retains the light raised chat bubbles, including during a dark night. */
.history-mode-2{font-family:"Microsoft JhengHei","微軟正黑體",sans-serif;background:floralwhite}
.history-mode-2 .history-page,.history-mode-2 .history-panel{background:transparent;color:inherit;box-shadow:none;border:0}
.history-mode-2 .history-page[data-phase] .history-panel{background:transparent;box-shadow:none}
.history-mode-2 .history-main{max-width:1180px}
.history-mode-2 .talk-row .talk-bubble{border-radius:6px;background:#fff;color:#333;border:1px solid #d6d6d6;box-shadow:0 2px 5px #0002;padding:10px 14px}
.history-mode-2 .talk-row.is-self .talk-bubble{background:#eaf6ff}
.history-mode-2 .talk-row .talk-head,.history-mode-2 .talk-row .talk-name{color:#555;font-size:12px}
.history-mode-2 .talk-row .talk-body{font-size:16px;line-height:1.5}
.history-mode-2 .talk-row .talk-body.font-strong{font-size:26px;font-weight:bold}
.history-mode-2 .talk-row .talk-body.font-weak{font-size:10px}
.history-mode-2 .system-night-wolf-hint .system-pill,.history-mode-2 .system-night-common-hint .system-pill{background:#eea948;color:white;border:0;font-size:12px;opacity:1;box-shadow:inset 0 1px 0 #ffffff57,0 2px 8px #0f172a1f}
.history-mode-2 .history-page[data-phase=night] .system-night-wolf-hint .system-pill{background:#eea948;color:white;border:0}
.history-mode-2 .system-night-wolf-hint .system-text{font-size:16px;color:red}
body:is(.history-mode-1,.history-mode-2)[data-phase=night]{background:#000030;color:snow}
@media(max-width:620px){
 .history-page .history-main{padding:8px 6px 24px}.history-panel{padding:12px 8px}.history-heading{align-items:flex-start;gap:8px}.history-heading h1{font-size:20px}.history-nav-btn{padding:0 12px}.history-return{padding:0 8px;font-size:12px}
 .history-mode-1 .history-talk-log>.talk-row{padding-left:0;padding-top:56px}.history-mode-1 .talk-row .talk-head{left:42px;top:5px;width:calc(100% - 48px)}.history-mode-1 .talk-row .talk-time{position:static;margin-left:5px}.history-mode-1 .talk-row .talk-avatar-wrap{left:0;top:5px}
}
