.app-context{margin-left:.35rem;padding-left:.8rem;border-left:1px solid color-mix(in srgb,var(--color-text-on-dark) 38%,transparent);color:var(--color-highlight);font-weight:700}.account-menu a{padding:.72rem 1rem;color:var(--color-text);text-decoration:none;border-radius:8px}.module-layout{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:calc(100vh - 76px)}.module-nav{padding:1.3rem;color:var(--color-text-on-dark);border-right:1px solid var(--color-secondary);background:color-mix(in srgb,var(--color-background-dark) 90%,var(--color-primary))}.module-nav h1{font-size:1.6rem}.module-nav nav{display:grid;gap:.3rem}.module-nav button{width:100%;padding:.72rem;text-align:left;color:var(--color-text-on-dark);border-color:transparent;background:transparent}.module-nav button.active{background:var(--color-primary);border-color:var(--color-highlight)}.module-content{min-width:0;padding:clamp(1rem,3vw,2.5rem);background:var(--color-surface-muted)}.content-head{display:flex;justify-content:space-between;gap:1rem;align-items:center}.content-head h2{font-size:clamp(2rem,5vw,3.5rem)}.dashboard-grid,.entity-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem}.stat-card,.entity-card,.panel{padding:1.1rem;border:1px solid var(--color-border);border-radius:14px;background:var(--color-surface);box-shadow:var(--shadow)}.stat-card strong{display:block;font-size:2rem}.entity-card{display:flex;flex-direction:column;gap:.65rem}.entity-card p{white-space:pre-wrap}.card-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:auto}.card-actions button{padding:.45rem .65rem}.visibility-chip{align-self:flex-start;padding:.2rem .5rem;border-radius:999px;background:var(--color-surface-muted);font-size:.8rem}.relation-list{display:grid;gap:.7rem}.relation-row{display:grid;grid-template-columns:minmax(140px,1fr) auto minmax(140px,1fr) auto;gap:.7rem;align-items:center;padding:.8rem;border:1px solid var(--color-border);border-radius:10px;background:var(--color-surface)}.relation-metrics{font-size:.85rem}.empty-state{padding:2rem;text-align:center;border:2px dashed var(--color-border);border-radius:14px;background:color-mix(in srgb,var(--color-surface) 55%,transparent)}textarea,select,.form input{width:100%;padding:.7rem;border:1px solid var(--color-border);border-radius:7px;color:var(--color-text);background:var(--color-surface)}.toolbar{display:flex;flex-wrap:wrap;gap:.6rem;margin-bottom:1rem}.markdown{white-space:pre-wrap;line-height:1.55}.danger{color:var(--color-error)}@media(max-width:780px){.module-layout{grid-template-columns:1fr}.module-nav{position:static;border-right:0}.module-nav nav{grid-template-columns:repeat(2,minmax(0,1fr))}.module-content{padding:1rem}.relation-row{grid-template-columns:1fr}.app-context{display:none}}

.faction-network-panel{margin:0 0 1rem;overflow:hidden}
.faction-graph-head{display:flex;flex-wrap:wrap;gap:1rem;align-items:flex-start;justify-content:space-between;margin-bottom:.8rem}
.faction-graph-head h3{margin:.1rem 0 .25rem}
.faction-graph-head p{max-width:760px;margin:0;color:var(--color-secondary);line-height:1.45}
.faction-graph-controls{display:flex;flex-wrap:wrap;gap:.55rem;align-items:flex-end}
.faction-graph-controls label{display:grid;gap:.25rem;min-width:170px;font-size:.75rem;font-weight:700}
.faction-graph-controls select{padding:.55rem}
.faction-graph-legend{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;margin:.6rem 0 .85rem;padding:.65rem .75rem;border:1px solid var(--color-border);border-radius:10px;background:var(--color-surface-muted);font-size:.75rem}
.faction-graph-legend span{display:inline-flex;gap:.4rem;align-items:center;white-space:nowrap}
.faction-graph-legend i{display:inline-block;width:34px;height:3px;border:0;background:var(--legend-color)}
.faction-graph-legend .quality-color{background:var(--legend-color)}
.faction-graph-legend .legend-quality-ticks i{height:11px;background:repeating-linear-gradient(90deg,transparent 0 3px,color-mix(in srgb,var(--color-text) 35%,transparent) 3px 4px,transparent 4px 7px)}
.faction-graph-legend .legend-intensity i{height:7px;border:0;border-radius:999px;background:linear-gradient(90deg,var(--color-secondary) 0 30%,transparent 30% 36%,var(--color-secondary) 36%)}
.faction-graph-canvas{position:relative;isolation:isolate;min-height:560px;overflow:hidden;border:1.5px solid var(--color-border);border-radius:12px;background:radial-gradient(circle at 50% 50%,color-mix(in srgb,var(--color-highlight) 8%,transparent),transparent 60%),linear-gradient(color-mix(in srgb,var(--color-border) 12%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--color-border) 12%,transparent) 1px,transparent 1px),var(--color-surface);background-size:auto,28px 28px,28px 28px,auto;touch-action:none}
.faction-graph-canvas:focus-visible{outline:3px solid var(--color-highlight);outline-offset:2px}
.faction-graph-edges,.faction-graph-nodes{position:absolute;inset:0;width:100%;height:100%}
.faction-graph-edges{z-index:1;overflow:visible;pointer-events:none}
.faction-graph-nodes{z-index:2;pointer-events:none}
.faction-relation-halo,.faction-relation-edge{fill:none;stroke-linecap:butt;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.faction-relation-halo{stroke:color-mix(in srgb,var(--color-surface) 94%,white);opacity:.92}
.faction-relation-edge{opacity:.96}
.faction-quality-tick{stroke:color-mix(in srgb,var(--color-surface) 72%,white);stroke-width:1.5;stroke-linecap:round;vector-effect:non-scaling-stroke;pointer-events:none}
.faction-graph-node{position:absolute;display:grid;width:150px;min-height:72px;place-content:center;gap:.2rem;padding:.65rem 1rem;transform:translate(-50%,-50%);pointer-events:auto;user-select:none;touch-action:none;color:var(--color-text-on-dark);border:2px solid var(--color-highlight);background:linear-gradient(145deg,var(--color-primary),var(--color-background-dark));box-shadow:0 7px 18px color-mix(in srgb,var(--color-background-dark) 35%,transparent);text-align:center;cursor:grab}
.faction-graph-node:hover,.faction-graph-node:focus-visible,.faction-graph-node:active{transform:translate(-50%,-50%);filter:none}
.faction-graph-node:active{cursor:grabbing}
.faction-graph-node strong{overflow:hidden;font-size:.9rem;line-height:1.15;text-overflow:ellipsis}
.faction-graph-node small{overflow:hidden;opacity:.82;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}
.faction-graph-node.selected{z-index:3;outline:3px solid var(--color-warning);outline-offset:4px;box-shadow:0 9px 24px color-mix(in srgb,var(--color-background-dark) 48%,transparent)}
.faction-graph-node:focus-visible{outline:3px solid var(--color-warning);outline-offset:4px}
.faction-graph-node.shape-rounded{border-radius:14px}
.faction-graph-node.shape-hexagon{padding-inline:1.25rem;border:0;clip-path:polygon(12% 0,88% 0,100% 50%,88% 100%,12% 100%,0 50%)}
.faction-graph-node.shape-diamond{width:132px;min-height:96px;padding-inline:1.55rem;border:0;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.faction-graph-node.shape-circle{width:132px;min-height:86px;border-radius:50%}
.faction-graph-empty{position:absolute;z-index:3;inset:50% auto auto 50%;margin:0;transform:translate(-50%,-50%);color:var(--color-secondary);text-align:center}
@media(max-width:780px){.faction-graph-canvas{min-height:480px}.faction-graph-node{width:132px;min-height:66px;padding:.5rem .75rem}.faction-graph-head{display:grid}.faction-graph-controls{align-items:stretch}.faction-graph-controls label{flex:1}.faction-graph-legend{align-items:flex-start}.faction-graph-legend span{white-space:normal}}
@media(prefers-reduced-motion:reduce){.faction-graph-node{transition:none}}

[data-campaign-fields]{display:grid;gap:.75rem}
[data-campaign-fields][hidden]{display:none}
.multi-choice{overflow:hidden;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}
.multi-choice summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:center;padding:.7rem;cursor:pointer;list-style:none}
.multi-choice summary::-webkit-details-marker{display:none}
.multi-choice summary::after{grid-column:2;grid-row:1 / span 2;align-self:center;margin-left:.25rem;content:"▾";color:var(--color-primary);font-size:.8rem;transition:transform .15s ease}
.multi-choice[open] summary::after{transform:rotate(180deg)}
.multi-choice summary > span{font-weight:700}
.multi-choice summary > strong{grid-column:1;color:var(--color-secondary);font-size:.78rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.multi-choice-options{display:grid;max-height:230px;overflow:auto;padding:.35rem;border-top:1px solid var(--color-border);background:var(--color-surface-muted)}
.multi-choice-option{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.55rem;align-items:center;padding:.55rem .6rem;border-radius:6px;cursor:pointer}
.multi-choice-option:hover{background:color-mix(in srgb,var(--color-highlight) 18%,var(--color-surface))}
.multi-choice-option.unavailable{color:var(--color-secondary);font-style:italic}
.multi-choice-option input{width:auto;margin:0;accent-color:var(--color-primary)}
.multi-choice-option span{overflow-wrap:anywhere}
.multi-choice-empty{margin:0;padding:.65rem;color:var(--color-secondary);font-size:.85rem}
@media(max-width:560px){.multi-choice summary{grid-template-columns:minmax(0,1fr) auto}}

.campaign-grid{align-items:start}
.campaign-card{gap:.75rem}
.campaign-invites{overflow:hidden;margin-top:.2rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface-muted)}
.campaign-invites summary{padding:.65rem .75rem;font-weight:700;cursor:pointer}
.invite-block{display:grid;gap:.65rem;padding:.75rem;border-top:1px solid var(--color-border);background:color-mix(in srgb,var(--color-surface) 72%,transparent)}
.invite-block h4{margin:0 0 .15rem;font-size:1rem}
.invite-block p{margin:0;color:var(--color-secondary);font-size:.88rem;line-height:1.4}
.invite-block input[readonly]{font-size:.78rem}
.invite-actions{display:flex;flex-wrap:wrap;gap:.45rem}
.invite-actions .button,.invite-block > .button{align-self:start;padding:.52rem .7rem}
.invite-note{margin:.2rem 0;color:var(--color-secondary);font-size:.82rem;line-height:1.4}
.level-range{display:grid;grid-template-columns:1fr 1fr;gap:.45rem;margin-top:.25rem}
.inline-check{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.5rem;align-items:center;font-weight:700}
.inline-check input{width:auto}

.trigger-sheet-view{display:grid;gap:1rem}
.trigger-intro{display:flex;flex-wrap:wrap;gap:1rem;align-items:flex-start;justify-content:space-between}
.trigger-intro h3{margin-bottom:.4rem;font-size:1.5rem}
.trigger-intro p{max-width:760px;line-height:1.55}
.trigger-tools{display:grid;gap:.55rem;justify-items:end}
.trigger-language{display:inline-flex;overflow:hidden;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}
.trigger-language button{display:grid;width:2.45rem;height:2.15rem;place-items:center;padding:0;border:0;border-radius:0;background:transparent}
.trigger-language button.active{color:var(--color-text-on-dark);background:var(--color-primary)}
.trigger-language .flag-icon{font-size:1.25rem;line-height:1}
.trigger-campaign-notice{display:grid;gap:.25rem;padding:.85rem 1rem;border:1px solid var(--color-warning);border-radius:8px;background:color-mix(in srgb,var(--color-warning) 18%,var(--color-surface))}
.trigger-campaign-notice p{margin:0;line-height:1.45}
.trigger-legend{position:sticky;z-index:6;top:76px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:.55rem;align-items:center;padding:.7rem;border:1px solid var(--color-border);border-radius:8px;background:color-mix(in srgb,var(--color-surface) 95%,white);box-shadow:0 8px 22px color-mix(in srgb,var(--color-border) 16%,transparent)}
.trigger-legend span{min-height:2.35rem;padding:.45rem .55rem;border-radius:7px;color:#171110;font-size:.84rem;font-weight:700;line-height:1.25}
.trigger-legend .legend-red{background:#f3b1b8}
.trigger-legend .legend-yellow{background:#f5d777}
.trigger-legend .legend-green{background:#bfe0b9}
.trigger-legend .button{height:2.35rem;padding:.4rem .75rem;white-space:nowrap}
.trigger-list{display:grid;gap:1rem}
.trigger-group{padding:.95rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}
.trigger-group h3{margin-bottom:.75rem;font-size:1.35rem}
.campaign-trigger-group{border-color:var(--color-highlight);background:color-mix(in srgb,var(--color-surface) 86%,var(--color-highlight))}
.trigger-topic{display:grid;gap:.35rem;margin-top:.7rem}
.trigger-topic h4{margin:.2rem 0;font-size:1rem;color:var(--color-primary)}
.trigger-row{display:grid;grid-template-columns:minmax(8rem,fit-content(34rem)) auto;gap:.45rem;justify-content:start;align-items:center;min-height:2.55rem;padding:.35rem 0;border-top:1px solid color-mix(in srgb,var(--color-border) 22%,transparent)}
.trigger-row:first-of-type{border-top:0}
.trigger-row > span{overflow-wrap:anywhere;line-height:1.3}
.campaign-trigger-row > span{display:grid;gap:.1rem}
.campaign-trigger-row small{color:var(--color-secondary);font-size:.78rem}
.shared-trigger-intro,.shared-trigger-card{margin-bottom:1rem}
.shared-trigger-card{display:grid;gap:1rem}
.shared-trigger-card-head{display:flex;flex-wrap:wrap;gap:1rem;justify-content:space-between;align-items:flex-start}
.shared-trigger-card-head h3{margin:.1rem 0 .2rem;font-size:1.45rem}
.shared-participant-list{display:flex;flex-wrap:wrap;gap:.45rem}
.shared-participant-list > span{display:inline-grid;gap:.08rem;padding:.42rem .6rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface-muted);font-size:.86rem;font-weight:700}
.shared-participant-list small{color:var(--color-secondary);font-size:.72rem;font-weight:600}
.shared-trigger-list{gap:.8rem}
.shared-trigger-group{box-shadow:none}
.shared-trigger-row{grid-template-columns:minmax(8rem,fit-content(34rem)) auto}
.shared-trigger-row > span{display:grid;gap:.1rem}
.shared-trigger-row small{color:var(--color-secondary);font-size:.78rem}
.shared-rating-badge{display:inline-grid;min-width:4.7rem;min-height:1.8rem;place-items:center;padding:.25rem .55rem;border-radius:7px;color:#16110f;font-size:.78rem;font-weight:900}
.shared-rating-red{background:#d84b5c;color:#fff}
.shared-rating-yellow{background:#e5b72e}
.shared-rating-green{background:#58a968;color:#fff}
.shared-rating-none{background:color-mix(in srgb,var(--color-border) 26%,var(--color-surface));color:var(--color-secondary)}
.trigger-ratings{display:grid;grid-template-columns:repeat(3,1.65rem);gap:.35rem}
.trigger-rating{position:relative;display:grid;width:1.65rem;height:1.65rem;place-items:center;margin:0;cursor:pointer}
.trigger-rating input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.rating-box{display:grid;width:1.65rem;height:1.65rem;place-items:center;border:2px solid color-mix(in srgb,var(--color-border) 45%,transparent);border-radius:6px;box-shadow:inset 0 0 0 1px color-mix(in srgb,white 34%,transparent)}
.rating-red .rating-box{background:#d84b5c}
.rating-yellow .rating-box{background:#e5b72e}
.rating-green .rating-box{background:#58a968}
.trigger-rating input:checked + .rating-box::after{content:"✓";color:#111;font-weight:900;line-height:1}
.trigger-rating input:focus-visible + .rating-box{outline:3px solid var(--color-warning);outline-offset:2px}
.trigger-extra label{display:grid;gap:.45rem;font-weight:700}
.trigger-extra textarea{width:100%;padding:.75rem;border:1px solid var(--color-border);border-radius:7px;color:var(--color-text);background:var(--color-surface)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

.join-panel{display:grid;gap:.85rem;max-width:820px}
.join-panel h3{font-size:1.55rem}
.join-warning{display:flex;flex-wrap:wrap;gap:.7rem;align-items:center;padding:.75rem;border:1px solid var(--color-warning);border-radius:8px;background:color-mix(in srgb,var(--color-warning) 18%,var(--color-surface))}
.join-character-form{display:grid;gap:.65rem}
.join-character{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.65rem;align-items:start;padding:.75rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}
.join-character.disabled{opacity:.66}
.join-character input{margin-top:.28rem}
.join-character span{display:grid;gap:.16rem}
.join-character small,.join-character em{color:var(--color-secondary);font-size:.82rem}
.join-character em{font-style:normal}
.join-actions{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:.4rem}
@media(max-width:780px){.trigger-legend{grid-template-columns:1fr}.trigger-legend .button{width:100%}.trigger-row{grid-template-columns:1fr}.trigger-ratings{justify-content:start}.trigger-intro{display:grid}.trigger-tools{justify-items:start}.invite-block .form-grid{grid-template-columns:1fr}}

.module-nav.world-closed nav{display:none}
.world-entry,.world-active-head{display:flex;flex-wrap:wrap;gap:1rem;align-items:flex-start;justify-content:space-between;margin-bottom:1rem}
.world-entry > div,.world-active-head > div{max-width:760px}
.join-code-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:.65rem;align-items:end;width:min(100%,560px)}
.world-choice-card .button{align-self:flex-start;margin-top:auto}
.entity-card.read-only{border-style:dashed}
.shared-readonly{color:var(--color-secondary);font-size:.86rem;font-weight:700}
.file-summary{margin:.25rem 0 0;color:var(--color-secondary);font-size:.85rem}
.entity-file-preview{display:grid;gap:.45rem;margin:.15rem 0 .35rem;padding:.65rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface-muted)}
.entity-file-preview.compact{font-size:.85rem}
.entity-file-preview img{width:100%;max-height:260px;object-fit:contain;border-radius:6px;background:var(--color-surface)}
.entity-file-preview figcaption{color:var(--color-secondary);font-size:.78rem}
.entity-file-preview pre{max-height:220px;overflow:auto;margin:0;padding:.6rem;border-radius:6px;background:var(--color-surface);white-space:pre-wrap}
.pdf-file{align-items:start}
@media(max-width:780px){.join-code-form{grid-template-columns:1fr}.world-entry,.world-active-head{display:grid}}
