:root {
  color-scheme: light;
  --ink: #1f2d3d;
  --subtle: #586c7f;
  --line: #e2e9f1;
  --page: #eef3f9;
  --paper: #fff;
  --surface: #f6f8fb;
  --rail: #f4f8fc;
  --chat: #edf4fb;
  --own-message: #dbeaf9;
  --primary: #2e67a1;
  --primary-hover: #255987;
  --primary-ink: #213d55;
  --soft: #eaf3fc;
  --accent-ink: #285c8d;
  --accent-border: #a2bfdf;
  --avatar: #ecf1f7;
  --progress-track: #d6e3ed;
  --progress-fill: #547b9c;
  --notice: #30485e;
  --shadow: #243e5b1c;
  --danger: #8e3b47;
  --green: #42725f;
  --gaji-banner-height: 72px;
  font: 16px/1.55 "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, input, select { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; background: var(--paper); }
button, summary, input, select { transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease; }
button { cursor: pointer; }
button[disabled] { cursor: default; opacity: .52; }
button:hover:not([disabled]) { border-color: var(--accent-border); }
button.primary { background: var(--primary); color: #fff; border-color: transparent; font-weight: 650; }
button.primary:hover:not([disabled]) { background: var(--primary-hover); border-color: transparent; }
button.delete-action { color: var(--danger); }
button.primary.delete-action, button.primary.delete-action:hover:not([disabled]) { color: #fff; background: var(--danger); }
button.quiet { background: var(--surface); }
button.small { min-height: 32px; font-size: .86rem; padding: 4px 9px; }
button.on { background: var(--soft); border-color: var(--accent-border); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
input, select { min-width: 0; width: 100%; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 48%,var(--subtle) 50%),linear-gradient(135deg,var(--subtle) 50%,transparent 52%); background-position: calc(100% - 14px) center,calc(100% - 9px) center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 23px; }
input[type="checkbox"] { width: auto; min-height: 0; }
label { display: grid; gap: 5px; font-size: .9rem; color: var(--subtle); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.12rem; }
h2 { font-size: 1.06rem; }
h3 { font-size: .98rem; }
canvas { image-rendering: pixelated; display: block; }
small, .subtle { color: var(--subtle); font-size: .82rem; }
.boot { margin: 12vh auto; text-align: center; }
#app { max-width: 890px; margin: 20px auto; padding: 0 12px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 14px 40px var(--shadow); overflow: hidden; }
.auth { max-width: 452px; margin: clamp(12px, 8vh, 80px) auto 0; }
.auth-brand { display: flex; align-items: center; gap: 11px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: var(--paper); font-weight: 750; }
.auth-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 12px; background: var(--primary); color: white; }
.auth-content { padding: 26px 28px 25px; }
.auth-content h1 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -.025em; }
.auth-description { margin-top: 7px; color: var(--subtle); font-size: .9rem; }
.auth form { display: grid; gap: 15px; margin-top: 22px; }
.auth label { font-weight: 600; }
.auth label input { font-weight: normal; }
.auth-field { display: grid; gap: 5px; }
.handle-input { position: relative; }
.handle-input input { padding-right: 38px; }
.handle-icon { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--subtle); font-size: 1.35rem; font-weight: 750; line-height: 1; }
#handle-help[data-state="available"], .handle-icon[data-state="available"] { color: #19764b; }
#handle-help[data-state="taken"], #handle-help[data-state="invalid"],
.handle-icon[data-state="taken"], .handle-icon[data-state="invalid"] { color: #a52b3d; }
.auth-hint { margin-top: -8px; }
.auth-input-row { display: flex; align-items: stretch; gap: 6px; }
.auth-input-row button { flex-shrink: 0; font-size: .85rem; }
.auth-submit { min-height: 44px; margin-top: 3px; }
.auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 15px; margin-top: 13px; }
.auth-links a { color: var(--accent-ink); font-size: .9rem; padding: 4px 0; text-underline-offset: 3px; }
.auth-links .auth-secondary { font-weight: 700; }
.policy-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .83rem; }
.policy-links a, .policy-document a, .policy-choice a { color: var(--accent-ink); text-underline-offset: 3px; }
.auth-policy-links { justify-content: center; margin-top: 8px; }
.profile-policy-links { margin-top: 18px; padding-block: 10px; border-top: 1px solid var(--line); }
.policy-agreement { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 8px 11px 11px; border: 1px solid var(--line); border-radius: 10px; }
.policy-agreement legend { padding-inline: 5px; font-size: .86rem; font-weight: 700; }
.policy-choice { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.policy-choice label { display: flex; align-items: baseline; gap: 6px; color: var(--ink); font-size: .83rem; }
.policy-choice span, .policy-agreement small { word-break: keep-all; overflow-wrap: anywhere; }
.policy-choice input { flex: none; margin: 0; accent-color: var(--primary); }
.policy-choice a { flex: none; font-size: .78rem; }
.policy-agreement small { font-size: .75rem; }
.policy-document { max-width: 740px; margin: 20px auto; padding: clamp(18px,5vw,33px); overflow-wrap: anywhere; }
.policy-document h1 { margin-top: 16px; font-size: 1.45rem; }
.policy-document h2 { margin: 22px 0 5px; }
.policy-document p, .policy-document ul { margin-block: 6px; }
.policy-document li + li { margin-top: 6px; }
.policy-document .policy-contact { display: inline-block; padding-block: 6px; font-weight: 700; }
.policy-document dl div { display: grid; grid-template-columns: minmax(105px,.35fr) 1fr; gap: 5px; }
.policy-document dd { margin: 0; }
.account-notice { color: var(--subtle); font-size: .85rem; }
.account-notice.error { color: var(--danger); }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.between { justify-content: space-between; }
#app:has(.messenger) { max-width: 1390px; margin: 20px auto; padding: 0 18px; }
.messenger {
  --rail-width: 78px;
  --list-width: 286px;
  display: grid;
  grid-template-columns: calc(var(--rail-width) + var(--list-width)) minmax(0,1fr);
  height: min(970px, calc(100dvh - 40px));
  min-height: 480px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
}
.messenger-side { display: grid; grid-template-columns: var(--rail-width) minmax(0,1fr); border-right: 1px solid var(--line); min-height: 0; }
.nav-rail { display: flex; flex-direction: column; align-items: center; padding: 17px 5px 11px; gap: 17px; background: var(--paper); border-inline-end: 1px solid var(--line); }
.profile-control { display: grid; grid-template-columns: minmax(0,1fr); place-items: center; gap: 2px; width: 100%; min-height: 44px; padding: 2px 3px 4px; flex: none; border-radius: 15px; border-color: var(--line); background: var(--paper); }
.profile-control[aria-current] { border-color: var(--accent-border); }
.my-avatar { width: 38px; height: 38px; }
.profile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; font-size: .74rem; font-weight: 700; line-height: 1.15; }
.profile-level { max-width: 100%; color: var(--accent-ink); font-size: .65rem; font-weight: 750; line-height: 1.15; }
.mobile-avatar { display: none; }
.rail-menu { display: grid; width: 100%; gap: 3px; }
.rail-button { display: grid; position: relative; justify-items: center; align-content: center; gap: 3px; min-width: 0; min-height: 55px; width: 100%; padding: 3px 0; color: #526577; font-size: .71rem; line-height: 1.25; font-weight: 600; border: 0; border-radius: 10px; background: transparent; }
.rail-label { white-space: nowrap; letter-spacing: -.015em; }
.rail-icon { display: grid; position: relative; place-items: center; width: 42px; height: 29px; border-radius: 11px; }
.rail-button[aria-current] { color: var(--accent-ink); font-weight: 750; }
.rail-button[aria-current] .rail-icon { background: #dcecfb; }
.rail-button[aria-current]::before { content: ""; position: absolute; inset-inline-start: -5px; top: calc(50% - 9px); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--primary); }
.rail-button[data-cmd="view-mode"] { margin-top: 7px; }
.rail-button[data-cmd="view-mode"]::before { content: ""; position: absolute; inset-inline: 20%; top: -5px; height: 1px; background: var(--line); }
.rail-button[aria-pressed="true"] { color: var(--accent-ink); }
.rail-button:is([data-new-work],[data-unread-work]) .rail-icon::after { content: ""; position: absolute; top: 1px; right: 5px; width: 8px; height: 8px; background: #c83d4c; border-radius: 50%; box-shadow: 0 0 0 2px var(--paper); }
.menu-icon { display: block; position: relative; width: 24px; height: 24px; }
.menu-icon i, .menu-icon::before, .menu-icon::after, .menu-icon i::before, .menu-icon i::after { position: absolute; }
.icon-chat::before { content: ""; inset: 3px 2px 4px; border: 1.75px solid; border-radius: 8px 8px 8px 3px; }
.icon-chat::after { content: ""; left: 4px; bottom: 2px; width: 5px; height: 5px; background: currentColor; clip-path: polygon(0 0, 100% 0, 0 100%); }
.icon-chat i { width: 2.5px; height: 2.5px; top: 10px; left: 7px; border-radius: 50%; background: currentColor; box-shadow: 4px 0, 8px 0; }
.icon-people::before, .icon-people i::before { content: ""; border: 1.75px solid; border-radius: 50%; }
.icon-people::before { top: 3px; left: 5px; width: 8px; height: 8px; }
.icon-people::after, .icon-people i::after { content: ""; border: 1.75px solid; border-radius: 8px 8px 3px 3px; }
.icon-people::after { left: 1px; bottom: 3px; width: 16px; height: 9px; }
.icon-people i { inset: 0; }
.icon-people i::before { top: 5px; left: 15px; width: 6px; height: 6px; }
.icon-people i::after { right: 1px; bottom: 4px; width: 6px; height: 8px; border-left: 0; border-radius: 0 6px 2px 0; }
.icon-briefcase::before { content: ""; top: 3px; left: 8px; width: 8px; height: 5px; border: 1.75px solid; border-bottom: 0; border-radius: 3px 3px 0 0; }
.icon-briefcase i { inset: 7px 2px 3px; border: 1.75px solid; border-radius: 4px; }
.icon-briefcase i::before { content: ""; inset: 4px 0 auto; border-top: 1.5px solid; }
.icon-briefcase i::after { content: ""; top: 3px; left: calc(50% - 2px); width: 4px; height: 5px; border-radius: 1px; background: currentColor; }
.icon-clipboard::before { content: ""; inset: 4px 4px 2px; border: 1.75px solid; border-radius: 3px; }
.icon-clipboard i { width: 9px; height: 5px; top: 2px; left: 7.5px; background: currentColor; border-radius: 3px; }
.icon-clipboard::after { content: ""; top: 9px; left: 7px; width: 10px; height: 10px; border: 1.5px solid; border-radius: 50%; }
.icon-clipboard i::after { content: ""; top: 9px; left: 3.5px; width: 3px; height: 4px; border-left: 1.5px solid; border-bottom: 1.5px solid; }
.icon-switch i { inset: 6px 0; border: 1.75px solid; border-radius: 7px; }
.icon-switch i::before { content: ""; top: 50%; left: 2px; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: currentColor; transition: transform 140ms ease; }
.rail-button[aria-pressed="true"] .icon-switch i { background: var(--primary); border-color: var(--primary); }
.rail-button[aria-pressed="true"] .icon-switch i::before { background: var(--paper); transform: translateX(10px); }
@media (hover: hover) {
  .rail-button:hover { background: var(--surface); color: var(--accent-ink); }
}
.rail-logout { margin-top: auto; min-height: 47px; font-size: .6rem; white-space: nowrap; }
.nav-glyph { display: inline-block; position: relative; width: 20px; height: 20px; color: currentColor; }
.nav-glyph::before, .nav-glyph::after { position: absolute; content: ""; box-sizing: border-box; }
.glyph-chat::before { inset: 2px 1px 4px; border: 1.65px solid currentColor; border-radius: 4px; }
.glyph-chat::after { width: 4px; height: 4px; left: 5px; bottom: 2px; border-left: 1.65px solid; border-bottom: 1.65px solid; }
.glyph-people::before { width: 7px; height: 7px; top: 1px; left: 4px; border: 1.6px solid; border-radius: 50%; box-shadow: 6px 1px 0 -1px currentColor; }
.glyph-people::after { width: 17px; height: 7px; left: 1px; bottom: 2px; border: 1.6px solid; border-bottom: 0; border-radius: 8px 8px 0 0; }
.glyph-exit::before { border: 1.5px solid; border-right: 0; border-radius: 3px 0 0 3px; width: 9px; height: 15px; top: 2px; left: 2px; }
.glyph-exit::after { width: 11px; height: 11px; top: 4px; right: 1px; background: currentColor; clip-path: polygon(0 43%,63% 43%,47% 27%,57% 17%,92% 50%,57% 83%,47% 73%,63% 57%,0 57%); }
.side-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.side-header { display: flex; align-items: center; gap: 10px; padding: 16px 17px 13px; border-bottom: 1px solid var(--line); }
.side-heading { min-width: 0; flex: 1; }
.mobile-chat-actions { display: none; }
.sidebar-brand { color: var(--subtle); font-size: .76rem; font-weight: 720; }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 2px; }
.side-title h1 { font-size: 1.52rem; line-height: 1.25; letter-spacing: -.03em; }
.new-chat-menu summary { width: 37px; min-height: 37px; border: 1px solid var(--line); border-radius: 12px; font-size: 1.26rem; color: var(--accent-ink); background: var(--soft); }
.new-chat-menu summary:hover, .new-chat-menu[open] summary { border-color: var(--accent-border); background: var(--soft); }
.new-chat-menu .popup-items button { display: block; width: 100%; text-align: start; white-space: nowrap; }
.side-scroll { min-height: 0; flex: 1; overflow: auto; padding: 8px 9px 12px; scrollbar-width: thin; }
.conversation-list { display: grid; gap: 4px; }
.list-label { font-size: .72rem; color: var(--subtle); padding: 7px 8px 5px; font-weight: 650; }
.list-empty { padding: 19px 9px; font-size: .82rem; color: var(--subtle); }
.list-row { display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 9px; min-height: 62px; width: 100%; min-width: 0; border: 1px solid transparent; background: transparent; text-align: left; border-radius: 12px; color: var(--ink); }
.list-row:hover:not([disabled]), .friend-choice:hover { background: var(--surface); border-color: transparent; }
.list-row[aria-current], .friend-record:has(:checked) { background: var(--soft); border-color: var(--line); }
.friend-record { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; border-radius: 12px; }
.friend-record .friend-person { grid-template-columns: 43px minmax(0,1fr); }
.friend-choice { cursor: pointer; display: grid; place-items: center; min-width: 30px; padding: 2px 3px; border-radius: 8px; }
.friend-choice input { accent-color: var(--accent-ink); margin: 3px; }
.list-row-copy { min-width: 0; display: grid; gap: 2px; }
.list-row-copy strong, .list-row-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-row-copy strong { font-size: .92rem; font-weight: 680; }
.list-row-copy small, .list-row-end small, .friend-pending { font-size: .72rem; }
.room-status[data-state="active"] { color: #2b7559; font-weight: 700; }
.room-status[data-state="waiting"] { color: #875b31; font-weight: 650; }
.list-row-end { align-self: stretch; display: grid; align-content: center; justify-items: end; gap: 5px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #448b72; }
.avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--avatar); }
.avatar canvas { width: 38px; height: 38px; }
.avatar-friend { background: var(--surface); }
.avatar-invite { background: var(--soft); }
.friend-form { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 3px 9px; }
.friend-form input { flex: 1 1 105px; min-width: 0; width: auto; min-height: 34px; font-size: .8rem; }
.friend-form button { flex: none; min-height: 34px; }
.friend-method { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 3px 6px; }
.friend-method button { padding-inline: 3px; background: var(--surface); }
.friend-method button[aria-pressed="true"] { background: var(--soft); border-color: var(--accent-border); color: var(--accent-ink); font-weight: 680; }
.friend-phone-note { margin: -3px 4px 7px; font-size: .73rem; color: var(--subtle); }
.friend-request { border-radius: 9px; background: var(--surface); }
.friend-request-action { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; padding: 0 7px 6px; }
.friend-request-action small { font-size: .69rem; }
.safety-actions { margin-top: 10px; }
.blocked-list { margin: 12px 3px 0; padding: 8px; border-top: 1px solid var(--line); font-size: .82rem; }
.blocked-list summary { color: var(--subtle); cursor: pointer; }
.blocked-list .row { padding-top: 5px; }
.quest-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; margin: 0 2px 6px; }
.quest-tabs button { padding-inline: 5px; white-space: nowrap; }
.quest-tabs button[aria-pressed="true"] { background: var(--soft); color: var(--accent-ink); }
.quest-issue { width: 100%; margin-bottom: 6px; }
.quest-row { display: grid; gap: 2px; min-width: 0; min-height: 56px; padding: 8px; text-align: left; background: transparent; border-color: transparent; }
.quest-row:hover, .quest-row[aria-current] { background: var(--soft); border-color: var(--line); }
.quest-row-title { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-width: 0; }
.quest-row strong { font-size: .88rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.quest-row small { font-size: .74rem; overflow-wrap: anywhere; }
.quest-row-meta { display: flex; flex-wrap: wrap; gap: 0 8px; }
.work-unread-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #c63742; }
.quest-content { flex: 1; min-height: 0; overflow: auto; }
.quest-form { display: grid; gap: 8px; max-width: 535px; }
.quest-assignee { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 6px; }
.quest-assignee-options { display: grid; gap: 3px; max-height: 180px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.quest-assignee-options button { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; text-align: start; }
.quest-assignee-options small, .quest-assignee-selection { color: var(--accent-ink); }
.quest-form textarea { width: 100%; min-height: 98px; padding: 7px 10px; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; resize: vertical; }
.quest-error { color: var(--danger); font-size: .86rem; }
.quest-meta { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 6px 14px; margin: 0 0 15px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; }
.quest-meta dt { color: var(--subtle); }
.quest-meta dd { margin: 0; overflow-wrap: anywhere; }
.quest-body { margin: 4px 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.quest-brief { flex: none; padding: 8px 15px; border-bottom: 1px solid var(--line); background: var(--paper); }
.quest-brief-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.quest-pending-files { color: var(--danger); font-weight: 650; }
.quest-brief summary { font-size: .84rem; color: var(--accent-ink); cursor: pointer; }
.quest-brief p { max-height: min(130px,20dvh); overflow: auto; margin: 3px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; }
.materials-editor, .device-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.materials-editor summary, .material-list summary { color: var(--accent-ink); cursor: pointer; font-size: .9rem; }
.materials-editor .row { margin: 8px 0; flex-wrap: wrap; }
.material-list ul { list-style: none; padding: 0 4px; margin: 5px 0; max-height: 16dvh; overflow-y: auto; }
.material-list li { font-size: .85rem; overflow-wrap: anywhere; }
.material-list label { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--ink); }
.material-state, .device-card small { color: var(--subtle); font-size: .8rem; }
#quest-complete-notice { white-space: pre-line; overflow-wrap: anywhere; max-height: 44dvh; overflow: auto; }
.device-card { display: grid; gap: 8px; margin-bottom: 12px; max-width: 540px; }
.device-card p, .history-results p { font-size: .86rem; color: var(--subtle); }
.device-card h4 { margin: 6px 0 0; }
.device-card button { justify-self: start; }
.device-card form, .email-code, .device-card ul, .history-results { display: grid; gap: 8px; }
.device-card ul { margin: 0; padding: 0; list-style: none; }
.device-card li { padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.device-card li small, .history-results small { display: block; }
.device-card li .row { flex-wrap: wrap; margin-top: 5px; }
#pc-inbox-link { padding: 4px 10px; }
#friend-history:not(:empty) { display: grid; gap: 9px; margin-top: 16px; }
#friend-search { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; }
#friend-search label { flex: 1 1 125px; min-width: 0; }
.history-results button { text-align: left; }
.history-excerpt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.history-hit .bubble { outline: 2px solid var(--accent-border); outline-offset: 2px; }
.friend-detail { flex: 1; overflow: auto; }
.friend-meta { display: grid; grid-template-columns: minmax(65px,.3fr) minmax(0,1fr); gap: 9px 13px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.friend-meta dt { color: var(--subtle); font-size: .84rem; }
.friend-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.friend-share { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.side-controls { display: grid; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.ad-slot { flex: none; padding: 7px 10px 9px; border-top: 1px solid var(--line); background: var(--paper); }
.gaji-banner {
  --gaji-brand: #6b3f78;
  --gaji-dark: #321b38;
  --gaji-soft: #f1e7f4;
  --gaji-mist: #fbf8fc;
  display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 8px; align-items: center;
  min-height: var(--gaji-banner-height); padding-inline: 6px 10px; border: 1px solid #d6c2dc; border-radius: 12px;
  background: linear-gradient(105deg, #ebdbee, var(--gaji-soft) 68%); color: var(--gaji-dark); text-decoration: none;
}
.gaji-banner:hover { border-color: #b18cbd; background: linear-gradient(105deg, #e4cfe9, var(--gaji-soft) 68%); }
.gaji-banner:focus-visible { outline-color: var(--gaji-brand); }
.gaji-mascot { display: block; width: 100%; height: calc(var(--gaji-banner-height) - 2px); object-fit: cover; }
.gaji-copy { min-width: 0; display: grid; gap: 4px; line-height: 1.24; word-break: keep-all; overflow-wrap: anywhere; }
.gaji-copy strong { font-size: .91rem; font-weight: 750; }
.gaji-copy small { font-size: .75rem; color: var(--gaji-brand); }
.gaji-meta { display: grid; justify-items: end; gap: 5px; }
.ad-label { padding: 0 4px; border: 1px solid #cab4d1; border-radius: 4px; background: var(--gaji-mist); color: var(--gaji-brand); font-size: .66rem; font-weight: 650; }
.gaji-arrow { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gaji-brand); color: #fff; font-size: .88rem; line-height: 1; }
.gaji-banner:hover .gaji-arrow { background: var(--gaji-dark); }
.side-action { min-height: 33px; font-size: .8rem; padding: 5px; }
.hud { display: flex; flex-wrap: wrap; align-items: center; column-gap: 9px; font-size: .79rem; }
.hud span { color: var(--subtle); }
.workspace { min-width: 0; min-height: 0; overflow: hidden; background: var(--paper); }
.detail-view { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.empty-view { height: 100%; min-height: 0; flex: 1; display: grid; align-content: center; justify-items: center; gap: 11px; padding: 20px; text-align: center; overflow: auto; }
.empty-view h2 { font-size: 1.18rem; }
.empty-view p { color: var(--subtle); font-size: .9rem; max-width: 32ch; }
.empty-view .row { justify-content: center; }
.empty-mark { display: grid; place-items: center; width: 59px; height: 59px; border-radius: 16px; color: var(--accent-ink); background: var(--soft); }
.empty-mark .nav-glyph { transform: scale(1.55); }
.invite-avatar { width: 66px; height: 66px; border-radius: 16px; }
.invite-avatar canvas { width: 62px; height: 62px; }
.party-selection { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.party-chip { display: inline-flex; gap: 3px; align-items: center; padding: 3px 9px 3px 3px; border-radius: 8px; background: var(--surface); font-size: .8rem; }
.party-chip .avatar, .party-chip canvas { width: 25px; height: 25px; }
.detail-header { min-height: 70px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 22px; border-bottom: 1px solid var(--line); }
.detail-header small { display: block; font-size: .78rem; }
.detail-hud { margin-left: auto; }
.profile-logout-mobile { display: none; }
.mobile-back { display: none; min-height: 34px; width: 34px; padding: 0; place-items: center; border: 0; border-radius: 8px; background: var(--surface); color: var(--accent-ink); }
.mobile-back span { width: 10px; height: 10px; border-left: 1.7px solid; border-bottom: 1.7px solid; transform: rotate(45deg); margin-left: 3px; }
.content { padding: 20px 22px; }
.profile-content { min-height: 0; flex: 1; overflow: auto; }
.device-notifications { max-width: 420px; }
.device-notifications fieldset { margin: 12px 0 8px; padding: 0; border: 0; }
.device-notifications label { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.device-notifications input { width: 18px; height: 18px; margin: 0; }
.profile-nav { display: grid; gap: 4px; }
.profile-nav-item { display: block; width: 100%; text-align: left; padding: 10px; border-color: transparent; border-radius: 8px; font-size: .88rem; background: transparent; }
.profile-nav-item.on { background: var(--soft); color: var(--accent-ink); border-color: var(--line); font-weight: 700; }
.profile-tabs-mobile { display: none; margin-bottom: 12px; }
.block + .block { margin-top: 16px; }
.block h2, .block h3 { margin-bottom: 7px; }
.list { display: grid; gap: 4px; margin: 8px 0 12px; }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.entry > div { min-width: 0; overflow-wrap: anywhere; }
.no-result { color: var(--subtle); font-size: .9rem; padding: 8px 0; }
.profile { display: grid; grid-template-columns: minmax(155px,.7fr) minmax(0,1.3fr); gap: 19px; align-items: start; }
.portrait { display: grid; justify-items: center; align-content: center; min-height: 210px; padding: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 16px; }
.portrait canvas { width: 192px; height: 192px; max-width: 100%; object-fit: contain; }
@media (min-width: 741px) {
  .profile:has(.look-form) .portrait { position: sticky; top: 0; }
}
.look-form { display: grid; gap: 13px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.rename-form { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; margin-bottom: 14px; }
.rename-form label { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 7px; }
.rename-form small { white-space: nowrap; }
.rename-form .form-error { grid-column: 1 / -1; color: var(--danger); font-size: .85rem; }
.look-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.look-group legend { margin-bottom: 4px; padding: 0; font-size: .88rem; font-weight: 700; }
.look-options { display: flex; flex-wrap: wrap; gap: 6px; }
.look-option { position: relative; display: inline-flex; cursor: pointer; font-size: .77rem; }
.look-option input { position: absolute; width: 1px; min-height: 0; height: 1px; padding: 0; margin: 0; clip-path: inset(50%); }
.look-card { min-width: 56px; display: grid; place-items: center; align-content: start; gap: 2px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.look-card canvas { width: 48px; height: 48px; }
.look-card small { font-size: .66rem; }
.look-option input:checked + .look-card { border-color: var(--accent-ink); color: var(--primary-ink); background: var(--soft); }
.look-option input:focus-visible + .look-card { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.cosmetic-shop { display: grid; gap: 14px; container: outfit-shop / inline-size; }
.cosmetic-shop h3 { margin-bottom: 5px; font-size: .9rem; }
.shop-look { min-width: 85px; font-size: .8rem; }
.outfit-catalog { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 388px; gap: 8px; margin-top: 8px; }
.outfit-catalog .shop-look { min-width: 0; padding: 8px 4px; gap: 4px; }
.outfit-catalog canvas { width: min(128px,100%); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.look-card canvas[data-look-field="special"] { width: 64px; height: 64px; }
@container outfit-shop (min-width: 520px) {
  .outfit-catalog { grid-template-columns: repeat(4,minmax(0,1fr)); max-width: 760px; }
}
.profile-sheet { min-width: 0; }
.profile-sheet > .row { margin-bottom: 9px; }
.details { color: var(--subtle); font-size: .83rem; }
.profile.skill-profile, .profile.gear-profile { grid-template-columns: minmax(0,1fr); }
.profile.skill-profile { container: skills / inline-size; }
.equipment-sheet { display: grid; gap: 12px; max-width: 860px; margin: 0 auto; container: equipment / inline-size; }
.gear-quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,max-content)); gap: 7px; }
.gear-quick-actions button { min-width: 0; word-break: keep-all; }
.gear-board { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.45fr) minmax(0,1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--rail); }
.gear-column { display: grid; grid-template-rows: repeat(3,minmax(64px,1fr)); gap: 8px; min-width: 0; }
.gear-slot { min-width: 0; display: grid; grid-template-columns: 41px minmax(0,1fr); align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.gear-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 9px; background: var(--soft); }
.gear-icon canvas { width: 32px; height: 32px; }
.gear-slot-copy { min-width: 0; }
.gear-slot-copy small { display: block; font-size: .72rem; }
.gear-slot-copy strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; word-break: keep-all; font-size: .82rem; line-height: 1.35; }
.gear-slot[data-filled="false"] { border-style: dashed; background: transparent; }
.gear-slot[data-filled="false"] .gear-icon { background: var(--surface); }
.gear-slot[data-filled="false"] canvas { opacity: .38; filter: grayscale(.65); }
.gear-slot[data-filled="false"] strong { color: var(--subtle); font-weight: 500; }
.gear-portrait { display: grid; place-items: center; position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: radial-gradient(ellipse at 50% 36%,var(--paper),var(--soft) 84%); }
.gear-figure { position: relative; width: min(100%,224px); }
.gear-figure::before { content: ""; position: absolute; inset: auto 13% 1% 13%; height: 14%; border-radius: 50%; background: radial-gradient(ellipse,#b4c9de88,transparent 70%); }
.gear-figure canvas { position: relative; width: 100%; height: auto; aspect-ratio: 1; }
.gear-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-align: center; }
.gear-stats div { min-width: 0; padding: 6px 4px; }
.gear-stats div + div { border-inline-start: 1px solid var(--line); }
.gear-stats dt { color: var(--subtle); font-size: .72rem; }
.gear-stats dd { margin: 0; font-size: 1.02rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gear-bag { min-width: 0; margin-top: 5px; }
.gear-bag-heading { padding-bottom: 8px; }
.gear-items { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.gear-item { display: grid; grid-template-rows: 1fr auto auto; min-width: 0; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.gear-item[data-equipped="true"] { border-color: var(--accent-border); background: var(--rail); }
.gear-item-heading { display: grid; grid-template-columns: 41px minmax(0,1fr); align-items: center; gap: 8px; }
.gear-item h4 { margin: 0 0 2px; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; word-break: keep-all; }
.gear-item-copy small { display: block; font-size: .7rem; line-height: 1.3; }
.gear-item-stat { font-size: .74rem; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.gear-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.gear-actions button.small { min-width: 0; padding-inline: 2px; font-size: .76rem; font-variant-numeric: tabular-nums; }
.gear-item-empty { min-height: 88px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); }
@container equipment (max-width: 530px) {
  .gear-quick-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gear-quick-actions button.small { padding-inline: 4px; font-size: .78rem; }
  .gear-board { padding: 8px; gap: 8px; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr); }
  .gear-slot { grid-template-columns: minmax(0,1fr); justify-items: center; text-align: center; gap: 2px; padding-block: 4px; }
  .gear-slot-copy { max-width: 100%; }
  .gear-slot-copy small, .gear-slot-copy strong { font-size: .68rem; }
  .gear-slot .gear-icon { width: 30px; height: 30px; border-radius: 7px; }
  .gear-slot .gear-icon canvas { width: 25px; height: 25px; }
  .gear-item-heading { grid-template-columns: minmax(0,1fr); justify-items: start; gap: 4px; }
  .gear-actions { grid-template-columns: minmax(0,1fr); }
}
@container equipment (max-width: 370px) {
  .gear-board, .gear-column, .gear-items { gap: 5px; }
  .gear-item { padding: 6px; gap: 5px; }
  .gear-item h4 { font-size: .81rem; }
  .gear-item-stat { font-size: .67rem; }
}
.skill-auto { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--rail); }
.auto-skill-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.skill-auto-slot { display: grid; min-width: 0; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 7px; padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.skill-auto-slot label { min-width: 0; gap: 2px; font-size: .73rem; }
.skill-auto-slot select, .skill-filters select { min-height: 34px; padding: 4px 22px 4px 7px; font-size: .82rem; }
.skill-auto-slot[data-filled="false"] .skill-tile-icon { border: 1px dashed var(--accent-border); background: var(--surface); }
.skill-auto-slot .skill-tile-icon { width: 40px; height: 40px; }
.skill-reset-offer { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; margin: 12px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.skill-reset-offer strong { font-size: .9rem; }
.confirm-dialog { width: min(405px,calc(100% - 32px)); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.confirm-dialog::backdrop { background: #23314080; }
.confirm-dialog form { display: grid; gap: 10px; }
.confirm-dialog .row { justify-content: flex-end; }
.confirm-dialog p { word-break: keep-all; overflow-wrap: anywhere; }
.confirm-dialog [role="alert"] { color: var(--danger); font-size: .85rem; }
.safety-dialog .safety-target { font-weight: 700; }
.safety-dialog textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; resize: vertical; }
#skill-reset-quote { font-weight: 700; }
.skill-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 9px; }
.skill-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-bottom: 10px; }
.skill-filters label { font-size: .78rem; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(108px,1fr)); gap: 7px; }
.skill-grid .no-result { grid-column: 1 / -1; }
.skill-tile { display: grid; align-content: start; justify-items: center; grid-template-rows: auto 1fr auto; gap: 4px; min-width: 0; min-height: 120px; position: relative; padding: 10px 5px 7px; border-radius: 11px; line-height: 1.3; }
.skill-tile:hover:not([disabled]) { background: var(--surface); }
.skill-tile-icon { display: grid; place-items: center; width: 59px; height: 56px; border-radius: 10px; background: color-mix(in srgb,var(--skill-color,transparent) 23%,var(--surface)); }
.skill-tile .skill-tile-icon canvas { width: 48px; height: 48px; }
.skill-tile strong { font-size: .85rem; word-break: keep-all; overflow-wrap: anywhere; align-self: center; }
.skill-tile small { font-size: .71rem; font-variant-numeric: tabular-nums; }
.skill-tile-rank { position: absolute; top: 5px; right: 5px; border-radius: 5px; background: var(--soft); color: var(--accent-ink); padding: 1px 4px; font-size: .63rem; font-weight: 700; }
.skill-detail-dialog { width: min(435px,calc(100% - 24px)); }
.skill-detail-heading { display: flex; align-items: center; gap: 11px; }
.skill-detail-heading .skill-tile-icon { flex: none; width: 69px; height: 69px; }
.skill-detail-heading canvas { width: 64px; height: 64px; }
.skill-detail-heading small { word-break: keep-all; }
.skill-detail-heading h3 { font-size: 1.15rem; overflow-wrap: anywhere; }
.skill-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; padding: 10px 12px; margin: 12px 0 9px; background: var(--surface); border-radius: 8px; }
.skill-facts dt { color: var(--subtle); font-size: .73rem; }
.skill-facts dd { margin: 0; font-size: .85rem; word-break: keep-all; overflow-wrap: anywhere; }
.skill-effects { display: grid; gap: 4px; padding-left: 18px; margin: 6px 0; font-size: .88rem; }
.skill-effect-upgrade { color: var(--accent-ink); font-weight: 700; }
.skill-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; }
@container skills (max-width: 500px) {
  .skill-auto { padding: 8px; }
  .skill-auto-slot { grid-template-columns: minmax(0,1fr); justify-items: center; padding: 5px 4px; gap: 4px; }
  .skill-auto-slot label { width: 100%; }
  .skill-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .skill-grid { grid-template-columns: repeat(auto-fill,minmax(86px,1fr)); }
}
.room { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.room-title { position: relative; min-height: 70px; flex: none; display: flex; align-items: center; gap: 9px; padding: 9px 19px; border-bottom: 1px solid var(--line); background: var(--paper); }
.room-heading { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.room-heading-copy { min-width: 0; }
.room-name-line { display: flex; align-items: center; gap: 5px; }
.room-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-title .subtle { display: block; margin-top: 1px; font-size: .76rem; }
.room-menu, .new-chat-menu { flex: none; }
.new-chat-menu { position: relative; }
.room-menu summary, .new-chat-menu summary { list-style: none; display: grid; place-items: center; line-height: 1; cursor: pointer; }
.room-menu summary { width: 34px; height: 34px; border: 1px solid transparent; border-radius: 9px; color: var(--subtle); font-weight: 750; }
.room-menu summary::-webkit-details-marker, .new-chat-menu summary::-webkit-details-marker { display: none; }
.room-menu[open] summary, .room-menu summary:hover { border-color: var(--line); background: var(--surface); }
.popup-items { position: absolute; top: calc(100% + 4px); right: 0; z-index: 3; width: max-content; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 5px 15px var(--shadow); }
.popup-items button { border-color: transparent; }
.popup-items button:hover:not([disabled]) { border-color: transparent; background: var(--surface); }
.room-menu .popup-items { top: calc(100% - 3px); right: 10px; z-index: 4; width: min(220px,calc(100% - 20px)); }
.room-safety-peer { padding: 5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.room-safety-peer small { overflow-wrap: anywhere; }
.room-safety-peer .row { margin-top: 3px; }
.room-delete-wait { display: block; padding: 0 8px 5px; color: var(--subtle); }
.room-blocked-notice { flex: none; margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--subtle); font-size: .81rem; }
#room-buttons { flex: none; }
.arena { flex: none; margin: 10px 15px 0; padding: 7px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.arena-heading { font-size: .8rem; }
.arena-heading small { font-size: .74rem; }
#field { width: min(100%, 492px); height: clamp(70px, 10vw, 104px); margin: 0 auto; object-fit: contain; }
.status-row { display: flex; flex-wrap: wrap; gap: 2px 9px; font-size: .76rem; align-items: center; }
.poison-stacks { color: #645077; font-size: inherit; }
.status-row > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-row .subtle { font-size: .72rem; }
.status-row strong { font-weight: 650; }
.hp { vertical-align: middle; width: 40px; height: 8px; accent-color: var(--green); }
.warning { display: flex; align-items: center; gap: 6px; margin-top: 5px; padding: 3px 7px; color: var(--danger); background: #fff5f3; border: 1px solid #efd9d5; border-radius: 7px; font-weight: 650; font-size: .78rem; word-break: keep-all; overflow-wrap: anywhere; }
.warning canvas { width: 24px; height: 24px; flex: none; }
.combat-timers { flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 6px; margin: 6px 15px 0; }
.combat-timer { display: grid; grid-template-rows: auto 3px 1.15em; align-content: center; min-width: 0; gap: 3px; padding: 4px 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; font-size: .74rem; }
.combat-timer strong { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combat-timer-progress { appearance: none; display: block; justify-self: center; width: min(100%, 110px); height: 3px; border: 0; border-radius: 6px; overflow: hidden; background: var(--progress-track); }
.combat-timer-progress::-webkit-progress-bar { border-radius: 6px; background: var(--progress-track); }
.combat-timer-progress::-webkit-progress-value { border-radius: 6px; background: var(--progress-fill); }
.combat-timer-progress::-moz-progress-bar { border-radius: 6px; background: var(--progress-fill); }
.combat-timer-seconds { text-align: center; color: var(--subtle); font-size: .92em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.battle-log { flex: none; padding: 7px 15px 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.battle-log h3 { color: var(--subtle); font-size: .73rem; }
.battle-log ol { list-style: none; padding: 0; margin: 2px 0 0; height: 5.4em; font-size: .76rem; line-height: 1.35; overflow: hidden; }
.battle-log li { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.battle-log .combat-result { display: flex; align-items: baseline; }
.combat-result-skill { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.combat-result-value { flex: none; white-space: pre; font-weight: 650; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.archived-log ol { height: auto; max-height: 5.4em; }
.archive-entries { margin: 0; padding: 0; list-style: none; }
.archive-entries li { display: grid; grid-template-columns: 3.2em minmax(0,1fr); gap: 7px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: .83rem; }
.archive-entries time { color: var(--subtle); font-size: .75rem; }
.archive-entries span { overflow-wrap: anywhere; }
.transcript { min-height: 0; flex: 1; padding: 16px 20px 19px; display: flex; flex-direction: column; gap: 12px; overflow: auto; background: var(--chat); scrollbar-width: thin; }
.transcript > * { flex-shrink: 0; }
.transcript > button { align-self: center; }
.transcript > .message:first-of-type { margin-top: auto; }
.chat-empty { color: var(--subtle); text-align: center; font-size: .84rem; margin: auto 0; }
.message { --message-avatar-size: 42px; display: flex; gap: 8px; align-items: flex-start; max-width: min(92%, 640px); align-self: flex-start; }
.message.own { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { width: var(--message-avatar-size); height: var(--message-avatar-size); border-radius: 12px; flex: none; border: 1px solid var(--line); background: var(--paper); }
.message-continued { margin-top: -7px; }
.message-continued::before { content: ""; flex: 0 0 var(--message-avatar-size); }
.message-continued .sender { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.message-body { min-width: 0; display: grid; justify-items: start; gap: 2px; }
.own .message-body { justify-items: end; }
.sender { color: var(--subtle); font-size: .73rem; }
.message-line { min-width: 0; max-width: 100%; display: flex; align-items: flex-end; gap: 6px; }
.own .message-line { flex-direction: row-reverse; }
.message-time { color: var(--subtle); font-size: .68rem; font-variant-numeric: tabular-nums; white-space: nowrap; padding-bottom: 1px; }
.message-report { flex: none; min-height: 25px; min-width: 25px; border-color: transparent; padding: 0 3px; color: var(--subtle); background: transparent; line-height: 1; }
@media (hover: hover) {
  .message-report { opacity: 0; }
  .message:hover .message-report, .message:focus-within .message-report { opacity: 1; }
}
.bubble { min-width: 0; background: var(--paper); border: 1px solid var(--line); padding: 8px 11px; border-radius: 5px 14px 14px 14px; box-shadow: 0 1px 2px #243e5b0d; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .9rem; }
.own .bubble { background: var(--own-message); border-color: #d3e4f6; border-radius: 14px 5px 14px 14px; }
.spell-message-name { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.messenger[data-chat-only="true"] .spell-message-name { display: inline; font-weight: inherit; }
.messenger[data-chat-only="true"] .spell-message-name .skill-icon,
.messenger[data-chat-only="true"] .chat-cast-status { display: none; }
.skill-icon { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.chat-cast-status { display: block; margin-top: 4px; color: var(--subtle); font-size: .72rem; font-variant-numeric: tabular-nums; }
.chat-hit-count { display: block; margin-bottom: 2px; color: #833e28; font-weight: 700; }
.chat-cast-status[data-phase="cooldown"] { color: var(--accent-ink); font-weight: 650; }
.chat-cast-progress { display: block; appearance: none; border: 0; border-radius: 3px; background: var(--progress-track); width: 100%; height: 3px; margin-top: 3px; overflow: hidden; }
.chat-cast-progress::-webkit-progress-bar { background: var(--progress-track); }
.chat-cast-progress::-webkit-progress-value { background: var(--progress-fill); }
.chat-cast-progress::-moz-progress-bar { background: var(--progress-fill); }
.file-card { display: grid; gap: 5px; }
.file-card img { display: block; width: auto; height: auto; max-width: 170px; max-height: 112px; border-radius: 4px; }
.file-card a { color: var(--accent-ink); font-size: .9rem; }
.file-card button { justify-self: start; }
.compose { position: relative; flex: none; display: flex; align-items: center; gap: 8px; background: var(--paper); padding: 11px 14px; border-top: 1px solid var(--line); }
.compose-input { display: flex; flex: 1; align-items: center; gap: 1px; min-width: 0; padding-inline: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.compose-input:focus-within { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--soft); }
.compose-input input[name="message"] { flex: 1 1 auto; width: 0; border: 0; outline: 0; padding-inline: 7px; background: transparent; }
.compose button { flex: none; }
.compose-send { min-width: 62px; min-height: 42px; }
.compose-tool { width: 38px; padding: 0; display: grid; place-items: center; color: var(--accent-ink); border-color: transparent; background: transparent; }
.compose-tool:hover:not([disabled]), .compose-tool[aria-expanded="true"] { border-color: transparent; background: var(--own-message); }
.attachment-button { font-size: 1.34rem; }
.smile-icon { position: relative; width: 19px; height: 19px; border: 1.5px solid currentColor; border-radius: 50%; }
.smile-icon::before { content: ""; position: absolute; top: 4px; left: 4px; width: 2px; height: 2.5px; border-radius: 50%; background: currentColor; box-shadow: 6px 0 currentColor; }
.smile-icon::after { content: ""; position: absolute; top: 8px; left: 4px; width: 8px; height: 4px; border-bottom: 1.5px solid currentColor; border-radius: 0 0 7px 7px; }
.skill-picker { position: absolute; z-index: 4; left: 14px; bottom: calc(100% + 6px); width: min(495px,calc(100% - 28px)); max-height: min(296px,44dvh); display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 5px 16px var(--shadow); }
.skill-picker [role="tablist"] { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.skill-picker [role="tab"] { min-height: 36px; padding: 3px 9px; font-size: .81rem; background: transparent; color: var(--subtle); border: 1px solid transparent; border-radius: 7px; }
.skill-picker [role="tab"][aria-selected="true"] { background: var(--soft); color: var(--accent-ink); font-weight: 650; }
.skill-choices { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; display: grid; grid-template-columns: repeat(auto-fill,minmax(65px,1fr)); gap: 5px; padding: 6px 2px 2px; }
.skill-choices > p { grid-column: 1 / -1; margin: 4px; }
.skill-choice { min-width: 0; min-height: 60px; padding: 5px 3px; display: grid; gap: 3px; justify-items: center; grid-template-rows: 32px 1fr; background: var(--surface); position: relative; align-items: center; }
.skill-choice-name { font-size: .72rem; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.skill-choice-time { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); padding: 1px 3px; border-radius: 3px; background: var(--notice); color: white; font-size: .61rem; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.skill-choice-time:empty { display: none; }
.skill-choice[aria-disabled="true"] { cursor: default; }
.skill-choice[aria-disabled="true"] .skill-icon { opacity: .59; }
.summary { flex: none; display: grid; gap: 7px; padding: 10px 15px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.summary-heading { gap: 4px 10px; }
.summary-heading small { font-size: .74rem; }
.summary-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0; }
.summary-stats div { padding: 5px 9px; border-radius: 8px; background: var(--surface); }
.summary-stats dt { color: var(--subtle); font-size: .72rem; }
.summary-stats dd { margin: 0; font-size: .88rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.summary p.summary-gear { max-height: 4.6em; margin: 0; overflow: auto; overflow-wrap: anywhere; font-size: .8rem; }
.summary-actions { flex-wrap: wrap; justify-content: end; }
.drop-highlight { outline: 2px dashed var(--accent-ink); outline-offset: -3px; }
#toast { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); z-index: 5; padding: 7px 12px; border-radius: 8px; background: var(--notice); color: white; text-align: center; font-size: .9rem; }
body:has(.messenger) #toast { bottom: 76px; pointer-events: none; }
body:has(#summary:not([hidden])) #toast { top: 64px; bottom: auto; }
@media (min-width: 541px) {
  body:has(.room #arena:not([hidden])) #toast { top: 64px; bottom: auto; }
}
@media (max-width: 930px) {
  .messenger { --rail-width: 72px; --list-width: 240px; }
}
@media (min-width: 541px) and (max-width: 930px) {
  .nav-rail { padding-inline: 3px; }
  .rail-button[aria-current]::before { inset-inline-start: -3px; }
}
@media (max-width: 740px) {
  #app:has(.messenger) { margin: 9px auto; padding-inline: 7px; }
  .messenger { --rail-width: 68px; --list-width: 174px; height: calc(100dvh - 18px); }
  .side-header { padding-inline: 9px; }
  .side-scroll { padding-inline: 4px; }
  .list-row { grid-template-columns: 29px minmax(0,1fr) auto; gap: 5px; padding-inline: 4px; }
  .friend-record .friend-person { grid-template-columns: 29px minmax(0,1fr); }
  .list-row .avatar { width: 28px; height: 28px; }
  .list-row .avatar canvas { width: 27px; height: 27px; }
  .list-row-end small { font-size: .63rem; }
  .list-row-copy strong { font-size: .8rem; }
  .list-row-copy small { font-size: .68rem; }
  .profile { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .portrait { min-height: 132px; }
  .portrait canvas { width: 128px; height: 128px; }
  .room-title, .detail-header { padding-inline: 10px; }
  .rail-label { font-size: .67rem; }
  .content { padding-inline: 10px; }
}
@media (min-width: 541px) and (max-width: 740px) {
  #sidebar-ad { padding-inline: 6px; }
  #sidebar-ad .gaji-banner { grid-template-columns: 40px minmax(0,1fr) auto; padding-inline: 2px 5px; gap: 4px; }
  #sidebar-ad .gaji-copy strong { font-size: .8rem; }
}
@media (max-width: 540px) {
  #app { padding: 0 6px; margin: 7px auto; }
  .auth-brand, .auth-content { padding-inline: 19px; }
  #app:has(.messenger) { margin: 0; padding: 0; }
  .messenger { display: block; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
  .messenger-side { display: flex; flex-direction: column; height: 100%; border: 0; }
  .nav-rail { flex: none; order: 2; flex-direction: row; gap: 2px; padding: 2px 4px max(4px, env(safe-area-inset-bottom)); border-inline-end: 0; border-top: 1px solid var(--line); }
  .rail-avatar { display: none; }
  .mobile-avatar { display: grid; width: fit-content; min-width: 52px; max-width: 108px; }
  .mobile-avatar .profile-name { -webkit-line-clamp: unset; }
  .rail-menu { grid-template-columns: 1fr 1fr 1fr minmax(max-content,1.15fr) 1fr; width: auto; flex: 1; gap: 1px; }
  .rail-button { min-height: 50px; gap: 1px; }
  .rail-button[aria-current]::before { inset: -3px auto auto calc(50% - 8px); width: 16px; height: 2px; border-radius: 0 0 2px 2px; }
  .rail-button[data-cmd="view-mode"] { margin-top: 0; }
  .rail-button[data-cmd="view-mode"]::before { display: none; }
  .rail-logout { flex: none; align-self: stretch; width: 44px; margin-top: 0; }
  .side-pane { min-height: 0; flex: 1; }
  .side-header { padding: 15px 16px 10px; }
  .new-chat-menu summary { width: 44px; min-height: 44px; }
  .mobile-chat-actions { display: flex; padding: 10px 16px; }
  .mobile-chat-actions button { flex: 1; }
  .side-scroll { padding-inline: 8px; }
  .side-controls { display: flex; }
  .side-controls button { flex: 1; }
  .list-row { grid-template-columns: 40px minmax(0,1fr) auto; gap: 9px; padding-inline: 7px; }
  .friend-record .friend-person { grid-template-columns: 40px minmax(0,1fr); }
  .list-row .avatar { width: 38px; height: 38px; }
  .list-row .avatar canvas { width: 35px; height: 35px; }
  .list-row-copy strong { font-size: .9rem; }
  .list-row-copy small, .list-row-end small { font-size: .74rem; }
  .workspace { display: none; height: 100%; }
  .messenger[data-detail="true"] .workspace { display: block; }
  .messenger[data-detail="true"] .messenger-side { display: none; }
  .mobile-back { display: grid; flex: none; }
  .profile-logout-mobile { display: block; }
  .profile-tabs-mobile { display: flex; }
  .arena { margin-inline: 8px; }
  .room-title { min-height: 62px; }
  .combat-timers { margin-inline: 8px; gap: 4px; }
  .combat-timer { font-size: .69rem; padding-inline: 5px; }
  .battle-log { padding-inline: 10px; }
  .transcript { padding-inline: 9px; }
  .message { --message-avatar-size: 36px; }
  .summary { padding-inline: 10px; }
  .compose { padding: 8px 9px max(8px, env(safe-area-inset-bottom)); }
  .compose-input input[name="message"] { font-size: 16px; }
  body:has(.messenger) #toast { bottom: max(65px, calc(env(safe-area-inset-bottom) + 55px)); }
  body:has(.messenger[data-detail="true"] .room #arena:not([hidden])) #toast { top: 64px; bottom: auto; }
  .entry { flex-wrap: wrap; }
}
@media (max-width: 540px) and (max-height: 600px) {
  :root { --gaji-banner-height: 64px; }
  .room-title { padding-block: 5px; }
  .arena { margin-top: 5px; padding-block: 4px; }
  #battle-log { padding-block: 3px; }
  #logs { height: 4.05em; }
  #logs li:nth-last-child(n + 4) { display: none; }
  .room .transcript { padding-block: 8px; }
}
@media (pointer: coarse) {
  input, select, button { min-height: 44px; }
  button.small { min-height: 38px; }
  .compose-tool { width: 44px; }
  .room-menu summary { width: 44px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  button, summary, input, select, .icon-switch i::before { transition: none; }
}
@media (forced-colors: active) {
  .rail-button[aria-current] .rail-icon, .rail-button[aria-pressed="true"] .rail-icon { outline: 2px solid Highlight; }
  .menu-icon, .rail-button:is([data-new-work],[data-unread-work]) .rail-icon::after { forced-color-adjust: none; color: ButtonText; }
  .rail-button:is([data-new-work],[data-unread-work]) .rail-icon::after { background: Highlight; box-shadow: 0 0 0 2px Canvas; }
}
