.hakem{box-sizing:border-box;max-width:1000px;width:100%;margin:auto;padding:clamp(16px,4vw,42px);color:#09204d;line-height:1.65}.hakem *{box-sizing:border-box;min-width:0}.hk-heading{display:flex;align-items:center;gap:18px}.hk-icon{display:grid;place-items:center;background:#09204d;color:#e1ba66;font-size:38px;width:72px;min-width:72px;height:72px;border-radius:18px}.hakem h1{font-size:clamp(28px,5vw,44px);line-height:1.2;margin:.4em 0}.hakem h2{font-size:1.35rem}.hakem h3{font-size:1.1rem}.hk-heading p{margin:.3em 0}.hk-note{border-inline-start:4px solid #bd9343;background:#fcf8ee;padding:14px}.hk-links,.hk-actions,.hk-suggestions{display:flex;flex-wrap:wrap;gap:10px;margin-block:14px}.hakem button{font:inherit;min-height:44px;border:1px solid #aab5c6;border-radius:9px;padding:9px 14px;cursor:pointer;background:white;color:#09204d;white-space:normal;text-align:start}.hakem .hk-primary{background:#09204d;color:#fff;border-color:#09204d}.hakem button:disabled{opacity:.65;cursor:wait}.hakem a{color:#123b6c;text-decoration:underline}.hakem small{display:block;font-size:.85rem;line-height:1.65}.hakem textarea,.hakem input,.hakem select{font:inherit;color:#09204d;background:#fff;width:100%;max-width:100%;border:1px solid #9baac0;padding:10px;border-radius:8px}.hakem textarea{resize:vertical}.hakem label{display:block;font-weight:600;margin-block:12px 5px}.hakem :focus-visible{outline:3px solid #c09a4f;outline-offset:3px}#hk-chat{margin-top:16px;border:1px solid #ccd5df;border-radius:14px;padding:clamp(12px,3vw,24px);background:#fff}#hk-log{max-height:520px;overflow-y:auto;overscroll-behavior:contain;padding:4px}#hk-error{color:#9d241c;min-height:1.6em}.hk-message{padding:14px;margin-block:12px;background:#f3f6fb;border-radius:10px;border-inline-start:3px solid #b58b3d;overflow-wrap:break-word}.hk-message.user{background:#fff8e9;border-color:#0b2b55}.hk-answer{unicode-bidi:plaintext}.hk-answer p{margin-block:.5em}.hk-refs{font-size:.85rem;padding-inline-start:20px}.hk-answer table{display:block;max-width:100%;overflow:auto}.hk-days{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.hk-days article{padding:16px;border:1px solid #ccd5df;border-radius:10px}.hakem details{border:1px solid #ccd5df;border-radius:10px;padding:14px;margin-block:22px;overflow-wrap:break-word}.hakem summary{font-weight:700;cursor:pointer}.hk-admin-list{display:grid;gap:12px}.hk-admin-row{padding:14px;border:1px solid #ccd5df;border-radius:10px}.hk-fact{padding:14px;border:1px solid #d2d9e2;margin-block:12px;border-radius:8px}.hk-status{font-weight:700}.hk-admin-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px}.hk-audit{max-height:300px;overflow:auto}.hakem [hidden]{display:none!important}@media(max-width:650px){.hk-days,.hk-admin-columns{grid-template-columns:minmax(0,1fr)}.hk-heading{align-items:flex-start;gap:12px}.hk-icon{width:50px;min-width:50px;height:50px;font-size:28px}#hk-log{max-height:55vh}.hk-actions button{flex:1 1 125px}.hk-heading p{font-size:.85rem}}
.hk-character{display:block;width:180px;max-width:34%;height:auto;object-fit:contain;border-radius:12px;flex-shrink:0}.hk-chat-avatar{display:inline-block;vertical-align:middle;object-fit:contain;margin-inline-end:8px;border-radius:4px}#hk-toggle{display:inline-flex;align-items:center}@media(max-width:650px){.hk-character{width:120px;max-width:36%}}@media(max-width:359px){.hk-heading{flex-direction:column}.hk-character{width:120px;max-width:100%}}

/* V80: keep mixed-direction messages inside the chat, never crop their text. */
#hk-chat{min-width:0;max-width:100%;overflow-wrap:anywhere}
#hk-log{width:100%;min-width:0;max-width:100%;scrollbar-gutter:stable}
#hk-chat .hk-message{min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:normal;text-align:start}
#hk-chat .hk-answer{min-width:0;max-width:100%;unicode-bidi:isolate;text-align:start;white-space:normal}
#hk-chat .hk-answer :is(p,li,h1,h2,h3,h4,blockquote){max-width:100%;overflow-wrap:anywhere;white-space:normal;unicode-bidi:plaintext;text-align:start}
#hk-chat .hk-answer :is(ul,ol),#hk-chat .hk-refs{padding-inline-start:1.4em;padding-inline-end:0}
#hk-chat .hk-refs{max-width:100%;margin-block:.75rem 0;overflow-wrap:anywhere;text-align:start}
#hk-chat .hk-refs :is(li,a,small){overflow-wrap:anywhere;white-space:normal;word-break:normal}
#hk-chat .hk-refs small{unicode-bidi:isolate;text-align:start}
#hk-chat :is(a,button){max-width:100%;overflow-wrap:anywhere}
#hk-chat :is(pre,code){white-space:pre-wrap;overflow-wrap:anywhere}
#hk-chat .ai-table-scroll{max-width:100%;overflow-x:auto}
#hk-chat .hk-answer table{display:table;width:100%;border-collapse:collapse}
#hk-chat .hk-answer :is(th,td){white-space:normal;overflow-wrap:anywhere;text-align:start;padding:.4em}
#hk-input{font-size:16px;unicode-bidi:plaintext;text-align:start;scroll-margin-block:100px 24px}
#hk-chat .hk-actions{min-width:0;max-width:100%}
@media(max-width:650px){
 #hk-chat{padding:12px}
 #hk-log{max-height:none;overflow:visible;scrollbar-gutter:auto}
 #hk-chat .hk-message{padding:12px;font-size:1rem;line-height:1.8}
 #hk-chat .hk-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
 #hk-chat .hk-actions button{width:100%;min-width:0;min-height:44px}
 #hk-chat .hk-suggestions button{flex:1 1 100%;width:100%}
}
