/* SKYLINE — world screens: relationships, organizations, gifts, shop + wallet, glossary, modal, Theater, title cards, Joint cut-in. */
button.tiny { padding: 1px 6px; font-size: 11px; border-radius: 4px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 3px; background: #1d2a3b; color: #a9c6dd; font-size: 11px; }
.tag.bad { background: #4a1d1d; color: #ffab91; }
.sp { flex: 1; }
.wface { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: #1d3247; color: #cfe9f7; font: 700 14px var(--head); border: 1px solid #2c4660; vertical-align: middle; }
.wface.npc { background: #3a2140; } .wface.org { border-radius: 6px; } .wface.big { width: 64px; height: 64px; font-size: 26px; } .wface.grp { background: #2a3d18; }

/* modal */
#xmodal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; }
#xmodal .xm-back { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
#xmodal .xm-box { position: relative; width: min(560px, 94vw); max-height: 88vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
#xmodal.wide .xm-box { width: min(900px, 96vw); }
#xmodal .xm-x { position: absolute; right: 10px; top: 10px; }
#xmodal textarea, #xmodal input, #xmodal select { margin: 4px 0; }

/* relationships */
.rel-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.rel-tools select, .rel-tools input { width: auto; min-width: 160px; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.rel-card { background: linear-gradient(160deg, #142233, #0f1724); border: 1px solid var(--line); border-left: 4px solid #90a4ae; border-radius: 10px; padding: 12px 14px; }
.rel-card.friendly { border-left-color: #f06292; } .rel-card.hostile { border-left-color: #ef5350; } .rel-card.hid { opacity: .7; border-style: dashed; }
.rel-card header { display: flex; align-items: center; gap: 6px; }
.rel-card header > div { flex: 1; min-width: 0; } .rel-card header b { display: block; font: 600 14px var(--head); }
.rel-card .lbl { color: var(--muted); font-size: 12px; } .rel-card .arr { color: var(--muted); }
.rkname { font: 700 12px var(--head); letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; background: #26323f; }
.rkname.friendly { background: #4a1f36; color: #f8bbd0; } .rkname.hostile { background: #4a1d1d; color: #ff8a80; }
.rk { display: flex; gap: 3px; margin: 10px 0 4px; }
.rk i { flex: 1; height: 8px; background: #1d2938; border-radius: 2px; } .rk i.zero { background: #33465c; flex: .5; }
.rk i.on.friendly { background: #f06292; box-shadow: 0 0 6px #f0629288; } .rk i.on.hostile { background: #ef5350; }
.pb { display: inline-block; width: calc(100% - 50px); height: 4px; background: #1d2938; border-radius: 2px; vertical-align: middle; } .pb i { display: block; height: 100%; background: #4fc3f7; border-radius: 2px; }
.rel-card .notes { margin: 8px 0 4px; white-space: pre-wrap; } .rel-card .gmn { color: #ffd54f; font-size: 12px; margin: 4px 0; }
.rel-card .pn textarea { font-size: 12px; } .rel-card .pn small { color: var(--muted); }
.unl { display: grid; gap: 4px; margin-top: 8px; }
.mem { background: #1a2433; border-radius: 6px; padding: 6px 9px; font-size: 13px; } .mem.locked { color: var(--muted); }
.mem summary { cursor: pointer; color: #f8bbd0; font-weight: 600; } .mem img { max-width: 100%; border-radius: 6px; margin-top: 6px; }
.ev { margin-top: 8px; font-size: 12px; } .ev summary { cursor: pointer; color: var(--muted); }
.ev .e { padding: 3px 0; border-bottom: 1px solid #1d2938; } .ev .e small { color: var(--muted); margin-right: 6px; }
.ev .e.up { color: #a5d6a7; } .ev .e.down { color: #ff8a80; } .ev .e.unlock { color: #f8bbd0; } .ev .e.hid { opacity: .55; }
.gmrow { display: flex; gap: 4px; align-items: center; margin-top: 8px; flex-wrap: wrap; } .gmrow input { width: 70px; } .gmrow input[data-why], .gmrow input[data-log] { flex: 1; min-width: 100px; width: auto; }
.re-u { display: grid; grid-template-columns: 150px 1fr; gap: 4px; background: #101a27; padding: 6px; border-radius: 6px; margin: 4px 0; }
.re-u textarea, .re-u input[data-k=img] { grid-column: 1 / -1; }

/* map */
.rel-map-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 10px; }
#rel-map { width: 100%; height: auto; background: radial-gradient(ellipse at center, #13263a, #0a111a); border: 1px solid var(--line); border-radius: 10px; user-select: none; }
#rel-map .node { cursor: pointer; } #rel-map .ring { fill: #0b1520; stroke: #4fc3f7; stroke-width: 2; } #rel-map .node.npc .ring { stroke: #f06292; }
#rel-map .nm { fill: #e3f6ff; font: 600 13px var(--head); } #rel-map .ini { fill: #cfe9f7; font: 700 24px var(--head); } #rel-map .ini2 { fill: #cfe9f7; font: 700 12px var(--head); }
#rel-map .el { fill: #9fb8c8; font: 11px var(--body); } #rel-map .dim { opacity: .18; }
#rel-map .orgn { cursor: pointer; } #rel-map .orgn .on { fill: #fff; font: 700 15px var(--head); } #rel-map .orgn .oc { fill: #9fb8c8; font: 11px var(--body); } #rel-map .orgn.hid { opacity: .55; }
#rel-side { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; }
.rs-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; } .rs-row { padding: 5px 0; border-bottom: 1px solid #1d2938; }
.rs-row span { float: right; font-weight: 700; } .rs-row.friendly span { color: #f8bbd0; } .rs-row.hostile span { color: #ff8a80; } .rs-row small { display: block; color: var(--muted); }

/* organizations */
.org-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 14px; }
.org-side { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 3px; align-self: start; }
.org-li { display: flex; align-items: center; gap: 6px; text-align: left; background: transparent; border: 0; border-left: 3px solid var(--oc); border-radius: 0; }
.org-li img, .org-li i { width: 20px; height: 20px; object-fit: contain; } .org-li small { margin-left: auto; color: var(--muted); } .org-li.on { background: #12304a; } .org-li.hid { opacity: .55; }
.org-h { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--oc) 30%, transparent), transparent); border: 1px solid var(--line); }
.org-h img { width: 56px; height: 56px; object-fit: contain; } .org-h b { font: 700 22px var(--head); display: block; } .org-h small { color: var(--muted); }
.org-tabs { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.org-desc { white-space: pre-wrap; }
.org-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.om { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; } .om small { display: block; color: var(--muted); }
.om-row { display: flex; gap: 6px; align-items: center; margin: 3px 0; } .om-row input, .om-row select { width: auto; flex: 1; }
.cc { overflow: auto; padding: 10px 0; } .cc ul { display: flex; justify-content: center; gap: 14px; padding-top: 16px; position: relative; list-style: none; margin: 0; padding-left: 0; }
.cc li { display: flex; flex-direction: column; align-items: center; position: relative; padding-top: 14px; }
.cc li::before { content: ""; position: absolute; top: 0; left: 50%; height: 14px; border-left: 2px solid var(--accent); }
.cc > ul > li::before { display: none; }
.cc-n { display: flex; flex-direction: column; align-items: center; background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 10px; min-width: 110px; }
.cc-n small { color: var(--muted); }
.or-row { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #90a4ae; border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.or-row.friendly { border-left-color: #66bb6a; } .or-row.hostile { border-left-color: #ef5350; } .or-row p { margin: 4px 0; }
.att { margin: 0 6px; font-size: 12px; text-transform: uppercase; } .att.friendly { color: #a5d6a7; } .att.hostile { color: #ff8a80; }
.oh { border-left: 2px solid var(--accent); padding: 4px 10px; margin: 6px 0; } .oh.hid { opacity: .6; border-style: dashed; } .oh p { margin: 2px 0; }
.org-form label { margin: 4px 0; }
.gq { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid #1d2938; } .gq input { width: 90px; } .gq input[data-rx] { flex: 1; }
.gq.given b { color: #a5d6a7; } .gq.declined b { color: #ff8a80; }

/* shop + wallet */
.shop-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.shop-h { display: flex; align-items: center; gap: 10px; font: 700 20px var(--head); margin-bottom: 8px; }
.cr { color: #ffd740; font-family: var(--head); }
.shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.si { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.si.out { opacity: .55; } .si.hid { border-style: dashed; }
.si-pic { height: 120px; border-radius: 6px; background: #0d1622 center / cover no-repeat; position: relative; } .si-pic .tag { position: absolute; right: 6px; top: 6px; }
.si p { margin: 0; color: var(--muted); font-size: 12px; flex: 1; }
.si-buy { display: flex; align-items: center; gap: 6px; } .si-buy small { color: var(--muted); flex: 1; } .si-buy input { width: 52px; }
.wallet { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; } .w-bal { font-size: 26px; }
.bag { padding: 3px 0; border-bottom: 1px solid #1d2938; } .wh { font-size: 12px; padding: 2px 0; } .wh.pos { color: #a5d6a7; } .wh.neg { color: #ff8a80; } .wh small { color: var(--muted); }
.shop-gm { margin-top: 16px; } .shop-gm summary { cursor: pointer; font: 600 14px var(--head); color: var(--accent); }

/* glossary */
.gl-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; } .gl-tabs input { width: 240px; margin-left: auto; }
.gl-gm { display: flex; gap: 6px; align-items: center; margin: 10px 0; }
.gl-list { display: grid; gap: 10px; margin-top: 12px; }
.gl-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.gl-card.hid { opacity: .7; border-style: dashed; } .gl-card img { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; }
.gl-card p { margin: 4px 0; white-space: pre-wrap; } .gl-card code { color: var(--muted); font-size: 11px; }
.gl { color: #ffd740; border-bottom: 1px dashed #ffd740; cursor: help; }
#gl-tip { position: fixed; z-index: 95; width: 320px; background: #101a27; border: 1px solid #ffd740; border-radius: 8px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity .15s; font-size: 13px; }
#gl-tip.on { opacity: 1; pointer-events: auto; } #gl-tip b { color: #ffd740; font: 700 15px var(--head); } #gl-tip small { margin-left: 6px; color: var(--muted); }
#gl-tip img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; } #gl-tip p { margin: 6px 0 0; white-space: pre-wrap; }

/* Theater on the stage */
#theater { position: absolute; inset: 0; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .6s; }
#theater.on { opacity: 1; }
#theater .th-img { position: absolute; inset: 0; background: #000 center no-repeat; }
#theater.f-cinema .th-img { top: 9%; bottom: 9%; } #theater.f-cinema { background: #000; }
#theater.f-handout { background: rgba(0,0,0,.55); } #theater.f-handout .th-img { inset: 7% 18%; background-color: #e8dfc9; box-shadow: 0 10px 40px rgba(0,0,0,.7); border: 10px solid #e8dfc9; transform: rotate(-1deg); }
#theater .th-cap { position: absolute; left: 0; right: 0; bottom: 11%; text-align: center; text-shadow: 0 2px 8px #000; padding: 0 10%; }
#theater .th-cap b { display: block; font: 800 30px var(--head); letter-spacing: 4px; color: #fff; } #theater .th-cap span { font-size: 17px; color: #e3f6ff; }
#theater .th-n { position: absolute; right: 12px; top: 10px; font: 600 11px var(--head); color: rgba(255,255,255,.6); }
.th-live { margin-top: 10px; border: 1px solid #ef5350; border-radius: 8px; padding: 8px; }
.th-thumbs { display: flex; gap: 4px; overflow: auto; margin: 6px 0; }
.th-thumb { width: 64px; height: 40px; flex: none; background: #000 center / cover; color: #fff; font-size: 11px; text-shadow: 0 1px 3px #000; }
.th-thumb.on { outline: 2px solid #ffd740; }
.th-cue { background: #1e1a10; border-left: 3px solid #ffd740; padding: 6px 8px; margin-top: 6px; white-space: pre-wrap; }
.the-slides { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin: 8px 0; }
.the-sl { display: grid; grid-template-columns: 120px 1fr; gap: 8px; background: #101a27; border-radius: 6px; padding: 6px; }
.the-pic { height: 80px; background: #000 center / cover; border-radius: 4px; color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: center; }
/* title cards */
#titlecard { position: absolute; inset: 0; z-index: 9; pointer-events: none; display: flex; align-items: center; justify-content: center; opacity: 0; }
#titlecard.on { animation: tcIn .5s ease forwards; }
#titlecard:not(.on) { transition: opacity .8s; opacity: 0; }
@keyframes tcIn { from { opacity: 0; } to { opacity: 1; } }
#titlecard .tc-img { position: absolute; inset: 0; background: center / cover; filter: brightness(.45); }
#titlecard .tc-in { position: relative; text-align: center; }
#titlecard h1 { margin: 0; font: 800 64px var(--head); letter-spacing: 6px; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.9); }
#titlecard small { display: block; font: 700 14px var(--head); letter-spacing: 8px; color: var(--accent); }
#titlecard p { margin: 6px 0 0; font: 500 22px var(--head); letter-spacing: 3px; color: #e3f6ff; }
#titlecard .tc-rule { display: block; height: 2px; width: 0; margin: 14px auto 0; background: var(--accent); animation: tcRule 1s .3s ease forwards; }
@keyframes tcRule { to { width: 60%; } }
#titlecard.st-chapter { background: linear-gradient(transparent 30%, rgba(0,0,0,.75) 50%, transparent 70%); }
#titlecard.st-chapter h1 { animation: tcRise .9s ease both; } @keyframes tcRise { from { transform: translateY(20px); letter-spacing: 20px; opacity: 0; } }
#titlecard.st-mission { background: rgba(4,10,16,.82); } #titlecard.st-mission h1 { font-size: 54px; color: #ffd740; border: 2px solid #ffd740; padding: 6px 28px; }
#titlecard.st-mission small::before { content: "▲ "; }
#titlecard.st-minimal h1 { font-size: 40px; font-weight: 600; letter-spacing: 3px; } #titlecard.st-minimal .tc-rule { display: none; }
#titlecard.st-glitch { background: rgba(0,0,0,.75); } #titlecard.st-glitch h1 { position: relative; animation: glitch .4s steps(2) 4; }
#titlecard.st-glitch h1::before, #titlecard.st-glitch h1::after { content: attr(data-t); position: absolute; inset: 0; mix-blend-mode: screen; }
#titlecard.st-glitch h1::before { color: #f0f; transform: translate(-3px, 0); } #titlecard.st-glitch h1::after { color: #0ff; transform: translate(3px, 1px); }
@keyframes glitch { 50% { transform: translate(4px, -2px) skewX(8deg); } }
/* Joint Attack cut-in */
#cutin.joint .jc-row { position: absolute; left: 0; right: 0; top: 18%; display: flex; justify-content: center; gap: 2%; }
#cutin.joint .jc-actor { width: 18%; max-width: 220px; aspect-ratio: 3 / 4; overflow: hidden; border: 2px solid #ffd740; transform: skewX(-8deg); animation: jcIn .4s calc(var(--i) * .12s) both ease-out; background: #0b1520; }
#cutin.joint .jc-actor > :first-child { width: 100%; height: 100%; object-fit: cover; transform: skewX(8deg) scale(1.2); }
#cutin.joint .jc-actor b { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font: 700 12px var(--head); color: #fff; text-shadow: 0 1px 4px #000; transform: skewX(8deg); }
@keyframes jcIn { from { transform: skewX(-8deg) translateY(40px); opacity: 0; } }
@media (max-width: 900px) { .shop-grid, .org-wrap, .rel-map-wrap { grid-template-columns: 1fr; } }
#cutin.joint .shade { background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.75)); }
#cutin.joint .words, #cutin.joint.foe .words { left: 0; right: 0; top: auto; bottom: 16%; transform: none; text-align: center; padding: 0; }
#cutin.joint .jc-row { top: 15%; height: 52%; } #cutin.joint .jc-actor { height: 100%; width: auto; }
#cutin.joint .rule { width: 40%; margin: 8px auto 0; transform-origin: center; }
/* header room for the phone button */
header { gap: 10px; } header > button.small { padding: 4px 8px; white-space: nowrap; }
#hd-mission { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

/* CDB: Character Database */
.cdb { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.3fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cdb { grid-template-columns: 1fr; } }
.cdb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ccard { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line, #263241); border-radius: 8px; background: rgba(255,255,255,.02); cursor: pointer; }
.ccard:hover { border-color: var(--accent); } .ccard.sel { border-color: var(--accent); background: rgba(79,195,247,.08); } .ccard.hid { opacity: .55; }
.cface { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; object-position: top; flex: none; background: #1b2633; display: grid; place-items: center; font-weight: 700; }
.cdb-h .cface { width: 84px; height: 84px; font-size: 28px; }
.cc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .cc-t small { color: var(--accent); }
.cc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cc-tags .tag, .cdb .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 6px; border: 1px solid #33414f; border-radius: 10px; }
.tag.sq { border-color: #4fc3f7; } .tag.npc { border-color: #f06292; } .tag.buff { border-color: #81c784; } .tag.debuff, .tag.bad { border-color: #ef5350; }
.ti { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.ci { width: 40px; height: 40px; object-fit: contain; flex: none; }
.cdb-one { position: sticky; top: 64px; border: 1px solid var(--line, #263241); border-radius: 10px; padding: 12px; background: rgba(10,14,20,.7); min-height: 200px; }
.cdb-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; } .cdb-h b { font-size: 20px; display: block; } .cdb-h > div > span { color: var(--accent); display: block; }
.cdb-prof label, .cdb-gm label { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.cdb-gm .row label { flex: 1; }
.cfields { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; margin: 10px 0; } .cfields dt { color: #9fb0c2; display: flex; gap: 4px; align-items: center; }
.cf-img { max-width: 220px; max-height: 160px; border-radius: 6px; }
.cc-roles { display: flex; gap: 8px; flex-wrap: wrap; } .crole { display: flex; gap: 8px; padding: 6px 8px; border: 1px solid #33414f; border-radius: 8px; flex: 1; min-width: 180px; }
.crole small { color: #9fb0c2; display: block; } .crole p { margin: 2px 0 0; font-size: 12px; color: #c6d2df; }
.cl-grid { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 3px 10px; margin: 6px 0; font-size: 13px; } .cl-grid span { color: #9fb0c2; }
.clive { border: 1px solid #ef5350; border-radius: 8px; padding: 8px; margin-top: 8px; background: rgba(239,83,80,.06); }
.cbio { white-space: pre-wrap; } .crel { padding: 4px 0; border-bottom: 1px solid #1e2834; }
#chars-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
#chars-tools input, #chars-tools select { height: 30px; padding: 2px 8px; font-size: 13px; width: auto; min-width: 0; max-width: 170px; }
#chars-tools button { height: 30px; }

.cdb-gm .cc-tags label { flex-direction: row; align-items: center; margin: 0 10px 0 0; }

/* NTF-01..04: red dots, bell, notification panel */
.ntf-dot { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: #ed4245;
  color: #fff; font: 700 10px/16px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #0b0d10; pointer-events: none; z-index: 2; }
#app > header > button, .lb-go { position: relative; }
.bell { position: relative; }
.bell .bell-n { position: absolute; top: -5px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: #ed4245;
  color: #fff; font: 700 10px/16px system-ui, sans-serif; }
#bell-float { position: fixed; top: 10px; right: 12px; z-index: 75; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #333;
  background: rgba(10,10,10,.88); color: #eee; font-size: 17px; cursor: pointer; }
#bell-float:hover { border-color: var(--accent); }
#inbox { position: fixed; top: 54px; right: 12px; z-index: 76; width: min(380px, 94vw); max-height: min(70vh, 560px); display: flex; flex-direction: column;
  background: #0d1015; border: 1px solid #2a313a; border-radius: 8px; box-shadow: 0 16px 48px rgba(0,0,0,.6); }
#inbox.hidden { display: none; }
#inbox .ib-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #222a33; }
#inbox .ib-head b { letter-spacing: .12em; font-size: 12px; }
#inbox .ib-list { overflow: auto; }
#inbox .ib-it { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; width: 100%; text-align: left; padding: 9px 12px;
  background: none; border: 0; border-bottom: 1px solid #171c22; border-radius: 0; color: #9aa6b2; cursor: pointer; }
#inbox .ib-it:hover { background: #141a21; }
#inbox .ib-it.new { color: #e9eef3; }
#inbox .ib-it.new .ib-k::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ed4245; margin-right: 6px; }
#inbox .ib-k { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
#inbox .ib-w { font-size: 11px; color: #6c7884; }
#inbox .ib-empty { padding: 26px; text-align: center; color: #6c7884; }
.rel-card .myrow input[data-lbl] { flex: 1 1 100%; width: auto; }

/* SIM-01..04 Simulator */
.sim-panel { position: fixed; top: 96px; right: 384px; z-index: 60; width: 270px; max-height: 70vh; overflow: auto; padding: 10px 12px;
  background: rgba(8, 14, 22, .92); border: 1px solid #2f4b63; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.5); font-size: 13px; }
.sim-panel .sim-hd { display: flex; gap: 6px; align-items: center; font-weight: 800; letter-spacing: .08em; color: #8fd3ff; margin-bottom: 6px; flex-wrap: wrap; }
.sim-panel .sim-hd code { font-size: 10px; color: #b0bec5; letter-spacing: 0; }
.sim-panel .sim-hd button:first-of-type { margin-left: auto; }

.sim-panel select, .sim-panel button.primary { width: 100%; margin: 4px 0; }
.sim-panel .sim-team { display: flex; justify-content: space-between; gap: 6px; margin: 3px 0; }
.sim-panel .sim-team select { width: auto; margin: 0; }
.sim-g { font-family: "Chakra Petch", sans-serif; font-size: 1.1em; }
.sim-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.sim-best, .sim-medal { padding: 3px 8px; border: 1px solid #2f3b46; border-radius: 12px; font-size: 12px; }
.sim-medal { opacity: .4; } .sim-medal.have { opacity: 1; border-color: #ffd740; }
.sim-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; font-size: 12px; }
@media (max-width: 1100px) { .sim-panel { right: 12px; top: 64px; } }
@media (max-width: 700px) { .sim-panel { top: auto; bottom: 70px; right: 6px; left: 6px; width: auto; max-height: 45vh; } }

/* ALTC Sub Char */
.alt-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.alt-row.me b { color: #8fd3ff; }
#spar-pill { position: fixed; left: 50%; transform: translateX(-50%); top: 52px; z-index: 55; background: rgba(8,14,22,.9);
  border: 1px solid #ffb74d; color: #ffcc80; border-radius: 14px; padding: 3px 12px; }

/* MAP-10..14 city / sector map */
#cm-body { padding-top: 6px; }
.cm-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cm-top .cm-name { font-family: var(--head, "Bebas Neue", sans-serif); letter-spacing: .12em; font-size: 20px; color: #ff6b6b; }
.cm-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.cm-tools .on { border-color: #ff6b6b; color: #ffb4b4; }
.cm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.cm-stage { background: #07080b; border: 1px solid #3a1515; border-radius: 6px; overflow: hidden; box-shadow: 0 0 40px rgba(255, 40, 40, .08) inset; }
.cm-svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 170px); user-select: none; }
.cm-sec { fill: var(--c); fill-opacity: var(--f); stroke: var(--c); stroke-width: 2; stroke-opacity: .85; cursor: pointer;
  transition: fill-opacity .18s, stroke-width .18s; }
.cm-sec:hover { fill-opacity: calc(var(--f) + .22); stroke-width: 3.5; stroke-opacity: 1; }
.cm-sec.sel { fill-opacity: calc(var(--f) + .3); stroke-width: 4; stroke: #fff; }
.cm-sec.fog { fill: #333; stroke: #555; fill-opacity: .55; stroke-dasharray: 6 5; }
.cm-sec.hid { stroke-dasharray: 3 6; opacity: .55; }
.cm-lab { pointer-events: none; text-anchor: middle; }
.cm-lab .cm-big { font: 700 34px var(--head, "Bebas Neue", sans-serif); fill: var(--c); paint-order: stroke; stroke: rgba(0,0,0,.65); stroke-width: 3; }
.cm-lab .cm-sub { font: 600 11px "Chakra Petch", sans-serif; letter-spacing: .14em; fill: var(--c); opacity: .85; paint-order: stroke; stroke: rgba(0,0,0,.7); stroke-width: 2.5; }
.cm-lab .cm-st { font: 700 11px "Chakra Petch", sans-serif; paint-order: stroke; stroke: rgba(0,0,0,.8); stroke-width: 2.5; }
.cm-team { pointer-events: none; }
.cm-team .cm-dot { fill: #fff; stroke: #4fc3f7; stroke-width: 3; }
.cm-team .cm-ping { fill: none; stroke: #4fc3f7; stroke-width: 2; animation: cmPing 1.6s ease-out infinite; transform-origin: center; transform-box: fill-box; }
.cm-team text { font: 700 13px "Chakra Petch", sans-serif; fill: #e1f5fe; paint-order: stroke; stroke: #000; stroke-width: 3; }
@keyframes cmPing { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.cm-svg.editing.t-draw { cursor: crosshair; }
.cm-svg.editing.t-draw .cm-sec { cursor: crosshair; }
.cm-v { fill: #fff; stroke: #ff3b3b; stroke-width: 2; cursor: move; }
.cm-draft { fill: rgba(255,255,255,.06); stroke: #fff; stroke-width: 2; stroke-dasharray: 6 4; }
.cm-dv { fill: #fff; } .cm-dv.first { fill: #ff3b3b; stroke: #fff; stroke-width: 2; cursor: pointer; }
.cm-side { background: rgba(10, 6, 8, .92); border: 1px solid #3a1515; border-radius: 6px; padding: 12px; max-height: calc(100vh - 170px); overflow: auto; }
.cm-card { border-left: 3px solid var(--c); padding-left: 10px; }
.cm-card .cm-ic { width: 56px; height: 56px; object-fit: contain; float: right; }
.cm-card .cm-cl { font: 700 44px/1 var(--head, "Bebas Neue", sans-serif); color: var(--c); text-shadow: 0 0 14px var(--c); }
.cm-card .cm-cs { letter-spacing: .16em; font-size: 12px; color: #ffcdd2; text-transform: uppercase; margin-bottom: 6px; }
.cm-card .cm-stat { font-weight: 700; font-size: 13px; margin: 4px 0; }
.cm-card .cm-here { color: #81d4fa; font-size: 13px; margin: 4px 0; }
.cm-card .cm-info { white-space: normal; line-height: 1.55; }
.cm-card .cm-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cm-card .cm-gmn { margin-top: 8px; padding: 6px 8px; border: 1px dashed #5d4037; font-size: 12px; color: #bcaaa4; }
.cm-form { display: flex; flex-direction: column; gap: 6px; }
.cm-form input:not([type]), .cm-form textarea, .cm-form input[type=text] { width: 100%; }
.cm-form .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cm-lnk { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 4px; }
.cm-empty, .cm-hint { padding: 30px 10px; text-align: center; }
@media (max-width: 900px) { .cm-wrap { grid-template-columns: 1fr; } .cm-side { max-height: none; } }
.cm-top select { width: auto; min-width: 180px; }
body[data-route]:not([data-route="room"]) #sim-panel, body[data-route]:not([data-route="room"]) #spar-pill { display: none !important; }
/* GDE-01 guide */
.gd-secs { display: grid; gap: 8px; max-width: 860px; }
.gd-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
.gd-sec summary { cursor: pointer; font-size: 15px; padding: 2px 0; } .gd-sec p { margin: 6px 0; } .gd-sec ul { margin: 4px 0 4px 18px; }
.gd-e { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; max-width: 860px; }
.gd-e textarea { width: 100%; margin-top: 6px; } .gd-e .row input { flex: 1; }
/* SKP-01 starting skills in the new-pilot form */
.cc-skills { margin-top: 10px; }
.cc-sk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 260px; overflow: auto; margin-top: 6px; }
.cc-sk { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.cc-sk small { color: var(--muted); font-size: 11px; } .cc-sk span { font-size: 12px; line-height: 1.3; }
.cc-sk.on { border-color: var(--accent); background: rgba(79,195,247,.14); box-shadow: 0 0 0 1px var(--accent); }
/* FIT-01 picture framing */
.fit-pv { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #0b1320; cursor: grab; touch-action: none; }
.fit-pv img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
/* GDE-02 guide pictures + roll table */
.gd-img { display: block; max-width: 100%; border-radius: 8px; margin: 6px auto; }
.gd-row { display: flex; gap: 12px; align-items: flex-start; } .gd-row .gd-img { flex: 0 0 auto; margin: 6px 0; } .gd-row .gd-text { flex: 1; min-width: 0; }
.gd-row.gd-right { flex-direction: row-reverse; }
@media (max-width: 700px) { .gd-row { flex-direction: column !important; } .gd-row .gd-img { width: 100% !important; } }
.gd-rolls { width: 100%; max-width: 860px; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; }
.gd-rolls th, .gd-rolls td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
.gd-rolls th { color: var(--accent); font-weight: 600; } .gd-notes { margin: 8px 0 6px 18px; max-width: 860px; }
.mk-gsec textarea { min-height: 90px; } .mk-gsec { margin-bottom: 8px; }
.gd-prev { max-height: 70vh; overflow: auto; min-width: min(760px, 90vw); }
.mk-gsec .row select { width: auto; flex: 0 0 auto; } .mk-gsec .row input[type=number] { flex: 0 0 auto; }
