/* Traveller's journal. Scoped to these windows, including the phone sheet layout. */
html body .cj-modal{--cj-paper:#f1e4c4;--cj-paper2:#e8d8b3;--cj-ink:#3c3022;--cj-muted:#71634f;--cj-line:#c7b488;--cj-green:#285b4d;align-items:center;justify-content:center;padding:18px;box-sizing:border-box;color-scheme:light}
html body .cj-modal *{box-sizing:border-box}
html body .cj-modal [hidden]{display:none!important}
html body .cj-modal>.cj-window{display:flex;flex-direction:column;width:min(1040px,96vw)!important;height:min(760px,92dvh);max-width:96vw!important;max-height:94dvh!important;min-height:0;padding:0!important;overflow:hidden!important;background:var(--cj-paper)!important;color:var(--cj-ink)!important;border:1px solid var(--cj-line)!important;border-radius:18px!important;box-shadow:0 24px 90px #0008!important;text-align:left;font:14px/1.5 Arial,sans-serif}
html body #settings-modal>.cj-window{width:min(740px,96vw)!important}
.cj-modal h2,.cj-modal h3,.cj-modal h4{color:inherit!important;font-family:Georgia,serif!important;letter-spacing:0;margin:0}
.cj-modal h3{font-size:21px;line-height:1.3}
.cj-modal p{margin:8px 0;line-height:1.6}
html body .cj-modal button{font:600 13px/1.35 Arial,sans-serif;color:var(--cj-ink);background:#e8d7ae;border:1px solid #c4aa77;border-radius:8px;min-height:40px;padding:8px 13px;box-shadow:none;cursor:pointer;white-space:normal;transition:background .16s,border-color .16s;letter-spacing:0;text-transform:none}
html body .cj-modal button:hover{background:#e1cca0;border-color:#9a7e47}
html body .cj-modal button:disabled{opacity:.55;cursor:wait}
html body .cj-modal .cj-primary{background:linear-gradient(135deg,#346957,#214e40);color:#fff6de;border-color:#285745}
html body .cj-modal .cj-primary:hover{background:#38735d}
html body .cj-modal input:not([type=checkbox]),html body .cj-modal textarea,html body .cj-modal select{display:block;width:100%;min-width:0;font:14px/1.45 Arial,sans-serif!important;letter-spacing:0;color:var(--cj-ink)!important;background:#faf0d8!important;border:1px solid #c7b488!important;border-radius:8px!important;min-height:42px;padding:9px 12px;margin:0;box-shadow:inset 0 1px 3px #55350b09}
.cj-modal input::placeholder,.cj-modal textarea::placeholder{color:#7e705b;opacity:1}
.cj-modal :is(button,input,textarea,select):focus-visible{outline:3px solid #3b8c79!important;outline-offset:2px}
.cj-modal .cj-head{display:flex;align-items:center;gap:16px;padding:21px 24px;flex:none;color:#f4e8c9;background:linear-gradient(125deg,#153f35,#285b4d);border-bottom:3px solid #b18a44}
.cj-head>.cj-icon{width:54px;height:54px;flex:none;object-fit:contain;filter:drop-shadow(0 3px 5px #0005)}
.cj-head small{display:block;font-size:10px;letter-spacing:2px;color:#d3c699;margin-bottom:4px}
.cj-head h2{font-size:29px;line-height:1.2}
.cj-head p{margin:5px 0 0;font-size:12px;color:#d6dcca}
html body .cj-head>.cj-close{margin-left:auto;align-self:flex-start;flex:none;width:36px;height:36px;min-height:36px;padding:0;border:1px solid #b4b69b70;background:#ffffff09;color:#f4e8c9;font-size:0}
.cj-close span{display:none}.cj-close:after{content:'×';font:24px/1 Arial}
.cj-icon{width:36px;height:36px;object-fit:contain;flex:none}
.cj-full{width:100%}
.cj-mail-body{display:grid;grid-template-columns:270px minmax(0,1fr);flex:1;min-height:0}
.cj-inbox{display:flex;flex-direction:column;min-height:0;background:var(--cj-paper2);border-right:1px solid var(--cj-line)}
.cj-inbox-tools{padding:17px 14px 9px;display:grid;gap:12px;flex:none}
.cj-filters{display:flex;gap:6px}
html body .cj-filters button{flex:1;padding:7px 8px;font-size:12px;min-height:35px;background:transparent;border-color:transparent}
html body .cj-filters button[aria-pressed=true]{background:#d7c396;border-color:#bda675}
.cj-peers{flex:1;min-height:0;overflow:auto;padding:4px 9px 12px;overscroll-behavior:contain}
html body .cj-modal .cj-peer{display:flex;align-items:center;width:100%;gap:10px;padding:12px 9px;background:transparent;border:1px solid transparent;border-bottom-color:#c7b48880;border-radius:9px;min-height:82px;text-align:left;position:relative}
html body .cj-modal .cj-peer:hover{background:#efe2c2}
html body .cj-modal .cj-peer.is-selected{background:#fbf0d6;border-color:#bda16d;box-shadow:inset 3px 0 #31634f}
.cj-peer-copy{min-width:0;flex:1}.cj-peer-top{display:flex;gap:5px;flex-wrap:wrap;align-items:baseline;justify-content:space-between;font-family:Georgia,serif;font-size:15px}
.cj-peer-top time{font:10px Arial;color:var(--cj-muted);white-space:nowrap}
.cj-peer-top .trainer-nickname{max-width:100%;overflow-wrap:anywhere}
.cj-snippet{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--cj-muted);font-size:12px;font-weight:400;margin-top:5px}
.cj-avatar,.cj-initial{width:43px;height:51px;object-fit:contain;flex:none;border:1px solid #c5ae7c;border-radius:9px;background:#ddcda4;padding:3px}
.cj-initial{display:grid;place-items:center;font:23px Georgia}
.cj-unread{position:absolute;right:8px;bottom:5px;min-width:17px;height:17px;border-radius:10px;background:#2c664f;color:#fff5d9;font:10px/17px Arial;text-align:center;padding:0 4px}
.cj-thread{display:flex;flex-direction:column;min-width:0;min-height:0;background:radial-gradient(ellipse at top right,#fff7df80,transparent 70%),var(--cj-paper)}
.cj-thread-head{padding:16px 21px;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--cj-line);flex:none;min-width:0}
.cj-thread-person{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.cj-thread-person h3{font-size:21px;overflow-wrap:anywhere}
.cj-thread-person small{font-size:11px;color:var(--cj-muted)}
.cj-modal .cj-back{display:none}
.cj-recipient{display:block;padding:13px 21px;font-size:12px;font-weight:600;border-bottom:1px solid #c7b48880}.cj-recipient input{margin-top:6px!important}
.cj-history{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:22px;scrollbar-gutter:stable}
.cj-letter{width:fit-content;max-width:88%;padding:12px 16px;background:#faf0d8;border:1px solid #cdbb91;border-radius:3px 15px 15px;margin:0 auto 14px 0;box-shadow:0 3px 8px #573b1310;overflow-wrap:anywhere}
.cj-letter p{font:14px/1.65 Arial;margin:0;white-space:pre-wrap;color:inherit}.cj-letter time{display:block;text-align:right;font:10px/1.3 Arial;margin-top:8px;color:#7f705b}
.cj-letter.is-mine{margin-left:auto;margin-right:0;background:#2c5949;color:#f9eed3;border-color:#234a3d;border-radius:15px 3px 15px 15px}.cj-letter.is-mine time{color:#c6d5bd}
.cj-compose{padding:16px 21px 12px;border-top:1px solid var(--cj-line);background:#eadcbb;flex:none}
html body .cj-compose textarea{resize:none;min-height:76px;max-height:110px;overflow:auto}
.cj-compose-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}.cj-compose-bottom small{font-size:11px;color:var(--cj-muted)}
.cj-status{font:12px/1.5 Arial;color:#286044;min-height:18px;margin-top:6px;overflow-wrap:anywhere}.cj-status.cj-error{color:#a13c31}
.cj-inbox>.cj-status{padding:0 15px}.cj-inbox>.cj-refresh{margin:5px 14px 12px;font-size:12px;min-height:32px}
.cj-empty{text-align:center;color:var(--cj-muted);padding:32px 18px}.cj-empty>.cj-icon{width:48px;height:48px;opacity:.8}.cj-empty h3{margin-top:14px}.cj-welcome{margin:auto;max-width:370px}
.cj-tabs{display:flex;flex:none;gap:4px;padding:12px 17px 0;border-bottom:1px solid var(--cj-line);background:var(--cj-paper2)}
html body .cj-tabs button{flex:1;min-width:0;border:1px solid transparent;border-bottom:0;background:transparent;border-radius:9px 9px 0 0;padding:12px 8px}
html body .cj-tabs button[aria-selected=true]{background:var(--cj-paper);border-color:var(--cj-line);box-shadow:0 1px var(--cj-paper);color:#24583f}
.cj-settings-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:22px;scrollbar-gutter:stable}
.cj-setting-card{padding:20px;border:1px solid var(--cj-line);border-radius:12px;background:#fff6df60;margin-bottom:16px;box-shadow:0 2px 8px #563b1108}
.cj-setting-card:last-child{margin-bottom:0}.cj-setting-card>h3{font-size:21px;margin-bottom:12px}.cj-setting-card p{color:var(--cj-muted);font-size:13px;line-height:1.6;margin:9px 0 14px}
.cj-email-summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px;overflow-wrap:anywhere}.cj-email-summary strong{font-size:15px}
.cj-pill{display:inline-flex;align-items:center;gap:5px;border-radius:20px;background:#e6d6b2;color:#86622f;font-size:11px;padding:3px 9px;border:1px solid #cbb17c}.cj-pill.is-ok{background:#dbe8ce;color:#2a6040;border-color:#9bb388}.cj-pill.is-ok:before{content:'✓'}
.cj-field{display:block;margin-bottom:13px;font-size:12px;font-weight:600}.cj-field>span{display:block;margin-bottom:6px}
.cj-question{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:10px;align-items:end}.cj-question>label{font-size:12px;font-weight:600;margin-bottom:13px}.cj-question select{margin-top:6px!important}
.cj-code-form{border-top:1px dashed var(--cj-line);padding-top:16px;margin-top:17px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:0 10px}.cj-code-form>button{margin-bottom:13px}.cj-code-form>.cj-status{grid-column:1/-1}
html body .cj-code-form input{letter-spacing:5px;font-weight:700}
.cj-seal-row{display:flex;align-items:center;gap:15px}.cj-seal-row>div{flex:1;min-width:0}.cj-seal-row p{margin-bottom:0}.cj-seal-row h3{font-size:21px}.cj-seal-row>.wax-medallion{width:62px;height:62px;flex:none;background:radial-gradient(circle at 32% 25%,#cf7b5e,#9f4837);color:#ffdfbd;border:3px double #de9c7d;box-shadow:0 3px 9px #71341d33;border-radius:50%;display:grid;place-items:center;font-style:normal}.cj-seal-row>.wax-medallion svg{width:80%;height:80%}
.cj-switch-row{display:flex;gap:12px;align-items:center;min-height:65px;border-top:1px solid #c7b48880;position:relative;cursor:pointer}.cj-switch-row>span{flex:1;font-size:14px;padding-right:4px}.cj-switch-row input{position:absolute;width:44px;height:26px;right:0;opacity:0;cursor:pointer;margin:0}.cj-switch-row>i{width:44px;height:26px;flex:none;background:#c5b795;border-radius:20px;border:1px solid #b1a17c;position:relative;pointer-events:none;transition:background .2s}.cj-switch-row>i:after{content:'';width:18px;height:18px;border-radius:50%;position:absolute;left:3px;top:3px;background:#fff4d7;box-shadow:0 1px 3px #0003;transition:transform .2s}.cj-switch-row input:checked+i{background:#32644e;border-color:#32644e}.cj-switch-row input:checked+i:after{transform:translateX(18px)}.cj-switch-row input:focus-visible+i{outline:3px solid #3b8c79;outline-offset:3px}.cj-switch-row input:disabled+i{opacity:.5}
.cj-settings-footer{display:flex;justify-content:space-between;gap:10px;border-top:1px solid var(--cj-line);padding:12px 22px;flex:none;background:var(--cj-paper2)}
html body .cj-modal button.cj-danger{color:#974737;background:transparent;border-color:#bc9b7d}
.cj-modal ::-webkit-scrollbar{width:7px;height:7px}.cj-modal ::-webkit-scrollbar-track{background:transparent}.cj-modal ::-webkit-scrollbar-thumb{background:#b69d6a;border:1px solid #e7d9b8;border-radius:10px}
.cj-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:700px){
 html body .cj-modal{padding:0!important;align-items:flex-end!important}
 html body .cj-modal>.cj-window,html.ms-phone body .cj-modal>.cj-window{width:100vw!important;max-width:100vw!important;height:94dvh;max-height:94dvh!important;border-radius:20px 20px 0 0!important}
 .cj-modal .cj-head{padding:15px 16px;gap:11px}.cj-head>.cj-icon{width:42px;height:42px}.cj-head h2{font-size:24px}.cj-head small{font-size:9px;letter-spacing:1.3px}.cj-head p{font-size:11px}
 .cj-mail-body{display:flex}.cj-inbox{width:100%;border:0}.cj-thread{display:none;width:100%}.cj-thread-open .cj-inbox{display:none}.cj-thread-open .cj-thread{display:flex}
 .cj-modal .cj-back{display:block;font-size:11px;min-height:38px;padding:7px}.cj-thread-head{padding:11px;gap:8px;flex-wrap:wrap}.cj-thread-person{gap:8px}.cj-thread-person h3{font-size:18px}.cj-thread-head .cj-avatar,.cj-thread-head .cj-initial{width:32px;height:39px}.cj-card-button{font-size:10px!important;padding:6px 8px!important;min-height:35px!important}
 .cj-history{padding:16px 12px}.cj-letter{max-width:93%}.cj-compose{padding:12px 12px max(12px,env(safe-area-inset-bottom))}.cj-keyhint{display:none}.cj-compose textarea{min-height:68px!important}
 .cj-tabs{padding:8px 8px 0;gap:0}html body .cj-tabs button{font-size:12px;padding:11px 4px;overflow-wrap:anywhere}
 .cj-settings-scroll{padding:14px 12px}.cj-setting-card{padding:16px 14px}.cj-seal-row{flex-wrap:wrap;gap:10px}.cj-seal-row>.wax-medallion{width:51px;height:51px}.cj-seal-row h3{font-size:20px}.cj-seal-row>div{min-width:150px}
 .cj-settings-footer{padding:11px 12px max(11px,env(safe-area-inset-bottom))}.cj-question{grid-template-columns:1fr;gap:0}.cj-code-form{grid-template-columns:1fr}.cj-code-form>button{justify-self:start}
}
@media(max-height:520px){.cj-modal .cj-head{padding:9px 14px}.cj-head>.cj-icon{width:35px;height:35px}.cj-head h2{font-size:22px}.cj-head p,.cj-head small{display:none}.cj-thread-head{padding:7px 12px}.cj-compose{padding:7px 12px}.cj-compose textarea{min-height:46px!important;height:46px!important}.cj-compose-bottom{margin-top:5px}.cj-compose .cj-status:empty{display:none}.cj-settings-scroll{padding:12px}.cj-tabs{padding-top:3px}}
@media(prefers-reduced-motion:reduce){.cj-modal *{transition:none!important}}
.cj-letter.cj-clan-letter{width:100%;max-width:100%;padding:22px;border:1px solid #b49a60;border-radius:12px;background:radial-gradient(ellipse at top right,#f5df9b70,transparent 65%),#faf0d8;color:#493b25}
.cj-clan-letter>header{display:flex;align-items:center;gap:14px;border-bottom:1px solid #cbb583;padding-bottom:16px;margin-bottom:17px}
.cj-clan-letter>header .cj-clan-emblem{width:60px;height:60px;object-fit:contain;background:#315546;border:1px solid #baa268;border-radius:14px;padding:5px}
.cj-clan-letter small{font:10px Arial;letter-spacing:1.2px;text-transform:uppercase;color:#887047}
.cj-clan-letter h3{font:25px/1.25 Georgia;margin:5px 0 0;color:#493b25!important}
.cj-clan-letter h4{font:21px/1.3 Georgia;margin:0 0 12px;color:#493b25!important}
.cj-clan-letter .cj-inviter{margin-top:15px;font-size:12px;color:#796340}
.cj-invite-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}
.cj-modal .cj-invite-actions button{min-height:44px;flex:1;padding:10px 14px;font:600 13px/1.3 Arial}
.cj-invite-outcome{display:block;margin-top:18px;padding:12px 14px;background:#dde8cf;border:1px solid #a7bb8f;border-radius:8px;color:#2f6044;font:600 14px Arial}
.cj-invite-result{font:12px/1.5 Arial;color:#8e4333;margin-top:10px}.cj-invite-result:empty{display:none}
.cj-clan-emblem{object-fit:contain!important}
@media(max-width:700px){.cj-letter.cj-clan-letter{padding:17px}.cj-clan-letter h3{font-size:22px}.cj-invite-actions{flex-direction:column}.cj-clan-letter>header .cj-clan-emblem{width:51px;height:51px}}
