/* 「대표의 책상」 — 녹색 커팅매트 위에 사업 서류가 놓인 책상.
   패널은 실제 서류 양식을 하나씩 맡는다: 사업자등록증, 통장, 수사 기록, 수첩, 첨부 사진, 서류철, 영수증, 서류함, 결재 요청서.
   한 가지 세계(밤의 사무실 책상)로 고정한 디자인이라 라이트/다크를 나누지 않고 모든 색을 명시한다. */
:root {
  color-scheme: light;
  /* 책상 */
  --mat: #1e3a31;
  --mat-deep: #142a23;
  --mat-line: rgba(186, 224, 205, 0.09);
  --mat-line-bold: rgba(186, 224, 205, 0.16);
  --night: #0f1d19;
  --night-2: #19302a;
  --on-night: #e6efe9;
  --on-night-2: #9fb8ad;
  /* 종이 */
  --paper: #f3f4ef;
  --paper-2: #e6e9e1;
  --paper-3: #d8ddd3;
  --receipt: #fcfcf8;
  --manila: #e2c27a;
  --manila-2: #cfa95a;
  --rule: #c3c9be;
  --rule-soft: #dde1d7;
  /* 잉크 */
  --ink: #1b2023;
  --ink-2: #47515a;
  --ink-3: #5d666c;
  --pen: #2341b0;        /* 모나미 볼펜 파랑: 주 강조 */
  --pen-soft: #dfe5fb;
  --seal: #c42f28;       /* 인주 빨강: 도장, 적자, 위험 */
  --seal-soft: #f6dcd9;
  --marker: #f4e34f;     /* 형광펜 */
  --gain: #17784a;       /* 흑자 */
  --gain-soft: #d7efe1;
  --warn: #b76a08;
  /* 글꼴 */
  --display: "Black Han Sans", "Gothic A1", "Malgun Gothic", sans-serif;
  --doc: "Nanum Myeongjo", "Batang", "AppleMyungjo", serif;
  --body: "Gothic A1", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "Nanum Gothic Coding", "D2Coding", ui-monospace, Consolas, monospace;
  /* 크기 */
  --fs-xs: 12px; --fs-s: 12.5px; --fs-m: 14px; --fs-l: 16px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 40px;
  --paper-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 14px 26px -16px rgba(0, 0, 0, 0.7);
  --r: 3px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: var(--fs-m)/1.6 var(--body);
  color: var(--ink);
  background-color: var(--mat);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    linear-gradient(var(--mat-line-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line-bold) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: auto, 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
body { word-break: keep-all; overflow-wrap: anywhere; }
time, .mtag, .kpi b, .pb-row dd, .sv-main small, #tDate { white-space: nowrap; }
button { word-break: keep-all; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; max-width: 100%; }
img.px.missing { visibility: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
em { font-style: normal; color: var(--seal); }
.mono, time, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hint, .tiny { color: var(--ink-3); font-size: var(--fs-s); }
.pos { color: var(--gain); } .neg { color: var(--seal); } .warnc { color: var(--warn); }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

/* ───────── 버튼: 종이 위의 인쇄된 버튼 ───────── */
button {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  padding: 5px 11px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.06s, box-shadow 0.06s, background 0.12s;
  line-height: 1.35;
}
/* hover는 마우스가 있을 때만: 터치에서는 누른 자리에 hover가 남아 다음 카드까지 칠해진다 */
@media (hover: hover) { button:hover:not(:disabled) { background: var(--pen-soft); } }
button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
button[aria-pressed="true"], button.on { background: var(--ink); color: var(--paper); }
button.ghost { box-shadow: none; border-color: var(--rule); background: transparent; }
@media (hover: hover) { button.ghost:hover:not(:disabled) { background: var(--paper-2); } }
button.big { padding: 10px 18px; font-weight: 800; font-size: var(--fs-l); }
.stamp-btn, button.primary {
  background: var(--seal); color: #fff8f6; border-color: #7d1a15; box-shadow: 2px 2px 0 #7d1a15;
  font-weight: 800; letter-spacing: 0.02em;
}
@media (hover: hover) { .stamp-btn:hover:not(:disabled), button.primary:hover:not(:disabled) { background: #d8392f; } }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
select, input {
  background: var(--receipt); border: 1px solid var(--rule); border-bottom: 2px solid var(--ink-2);
  border-radius: 2px; padding: 7px 9px; width: 100%; min-width: 0;
}
select:focus, input:focus { border-bottom-color: var(--pen); outline: none; background: #fff; }
input[type=checkbox], input[type=radio] { width: auto; min-width: 0; padding: 0; vertical-align: middle; accent-color: var(--pen); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
.dialog:focus, .dialog:focus-visible { outline: none; }

/* ───────── 종이 공통 ───────── */
.paper { background: var(--paper); border-radius: 2px; box-shadow: var(--paper-shadow); padding: 16px; position: relative; }
.form-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.form-head h2 { font-family: var(--doc); font-weight: 800; font-size: var(--fs-xl); letter-spacing: 0.08em; }
.form-no { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.04em; }
.warn { color: var(--ink-2); font-size: var(--fs-s); border-left: 3px solid var(--seal); padding-left: 10px; margin: 14px 0 0; }

/* 첨부 사진: 흰 테두리 + 테이프 */
.photo { margin: 0; background: #fff; padding: 8px 8px 0; box-shadow: var(--paper-shadow); position: relative; }
.photo::before, .photo::after {
  content: ""; position: absolute; top: -9px; width: 70px; height: 20px; background: rgba(244, 227, 79, 0.62);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); z-index: 2;
}
.photo::before { left: 18px; transform: rotate(-4deg); }
.photo::after { right: 18px; transform: rotate(3deg); }
.photo figcaption { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); padding: 6px 2px 8px; }

/* ───────── 상단: 밤의 책상 시계 ───────── */
#top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--night); color: var(--on-night); border-bottom: 3px solid #0a1310; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--night); }
.top-in { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 1500px; margin: 0 auto; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand-seal {
  display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--seal); border-radius: 50%;
  color: var(--seal); font-family: var(--doc); font-weight: 800; font-size: 11px; line-height: 1; transform: rotate(-8deg);
  background: rgba(196, 47, 40, 0.08);
}
.brand-name { font-family: var(--display); font-size: var(--fs-xl); letter-spacing: 0.01em; }
.brand-name em { color: #ff7a6e; }
.clock { display: flex; align-items: baseline; gap: 10px; padding: 2px 12px; border-left: 1px solid var(--night-2); border-right: 1px solid var(--night-2); }
.clock b { font-family: var(--mono); font-size: 24px; color: #b9f3d2; letter-spacing: 0.02em; }
.clock span { color: var(--on-night-2); font-size: var(--fs-s); font-family: var(--mono); }
#top button { background: var(--night-2); color: var(--on-night); border: 1px solid #2c4a40; box-shadow: none; font-size: var(--fs-s); }
@media (hover: hover) { #top button:hover:not(:disabled) { background: #24413a; } }
#top button[aria-pressed="true"] { background: #b9f3d2; color: var(--night); border-color: #b9f3d2; font-weight: 800; }
.speed { display: flex; gap: 0; }
.speed button { border-radius: 0; font-family: var(--mono); padding: 4px 9px; margin-left: -1px; }
.speed button:first-child { border-radius: 3px 0 0 3px; }
.speed button.ff { border-radius: 0 3px 3px 0; font-family: var(--body); }
.topright { margin-left: auto; display: flex; gap: 6px; }
#top button.ghost { background: transparent; }
/* 모바일 전용(▶ 표시 · ⋯ 메뉴)은 넓은 화면에서 숨긴다 */
.sp-m, .m-speeds, .top-more, .top-more-chk { display: none; }

/* ───────── 화면 공통 ───────── */
.screen { max-width: 1500px; margin: 0 auto; padding-block: 22px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ───────── 표지(타이틀) ───────── */
#title { display: grid; gap: 26px; }
.cover { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 34px; align-items: center; padding-top: 10px; }
.cover-photo { transform: rotate(-1.2deg); }
.heroimg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--paper-3); }
.cover-text { color: var(--on-night); display: grid; gap: 16px; }
.doc-kicker { font-family: var(--mono); font-size: var(--fs-s); color: var(--on-night-2); margin: 0; letter-spacing: 0.06em; }
.title-mark { font-family: var(--display); font-weight: 400; font-size: clamp(42px, 6.2vw, 92px); line-height: 1.02; letter-spacing: -0.01em; color: #f4f6f1; }
.title-mark em { color: #ff6f61; display: inline-block; transform: rotate(-3deg); }
.cover-text .lead { color: #c9dcd2; font-size: var(--fs-l); margin: 0; max-width: 62ch; }
.cover-facts { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.cover-facts li { display: grid; }
.cover-facts b { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--marker); line-height: 1; }
.cover-facts span { font-size: var(--fs-s); color: var(--on-night-2); }

/* 신청서 */
.form { max-width: 980px; margin-inline: auto; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.field { display: grid; gap: 4px; padding: 8px 10px 10px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--receipt); }
.field > span { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; }
.field select, .field input { border: none; border-bottom: 1px dashed var(--rule); background: transparent; padding: 4px 0; }
.spawn .hint { margin: 12px 0; min-height: 1.6em; }

/* 대장(명예의 전당) */
.ledger { max-width: 980px; margin-inline: auto; width: 100%; }
.hall-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; font-size: var(--fs-s); counter-reset: hall; }
.hall-list li { counter-increment: hall; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.hall-list li::before { content: counter(hall, decimal-leading-zero); font-family: var(--mono); color: var(--ink-3); }
.hall-list li.hint::before { content: ""; }
.hall-list b { color: var(--ink); }
/* 홈 화면 '이어하기' 저장 목록 */
.save-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.save-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.sv-main { min-width: 0; flex: 1 1 260px; font-size: var(--fs-m); color: var(--ink-2); }
.sv-main b { color: var(--ink); font-size: var(--fs-l); }
.sv-main small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--mono); }
.sv-btns { display: flex; gap: 6px; flex: none; }
.sv-btns button { padding: 6px 12px; }
button.danger, button.ghost.danger { background: var(--seal); border-color: var(--seal); color: #fff; }

/* ───────── 게임 책상 ───────── */
#game { display: grid; grid-template-columns: 296px minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; align-content: start; }

/* 사업자등록증 */
.cert { padding: 0; border: 1px solid var(--rule); }
.cert::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.cert-head { display: grid; justify-items: center; gap: 2px; padding: 14px 14px 10px; border-bottom: 1px solid var(--rule); background: repeating-linear-gradient(135deg, var(--paper) 0 6px, var(--paper-2) 6px 7px); }
.cert-title { font-family: var(--doc); font-weight: 800; font-size: var(--fs-l); letter-spacing: 0.35em; padding-left: 0.35em; }
.cert-sub { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }
.cert-body { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 14px 14px 6px; position: relative; }
.cert-photo { margin: 0; border: 1px solid var(--rule); background: var(--paper-2); padding: 3px; align-self: start; }
.portrait { width: 100%; aspect-ratio: 1; background: #dfe4dc; }
.cert-fields { min-width: 0; }
.idname { font-family: var(--doc); font-weight: 800; font-size: clamp(18px, 2vw, var(--fs-2xl)); line-height: 1.15; padding-right: 60px; }
.idmeta { font-size: var(--fs-s); }
.cert-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; margin: 6px 0 0; }
.cert-dl dt { color: var(--ink-3); white-space: nowrap; }
.cert-dl dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perk { margin: 8px 14px 0; font-size: var(--fs-xs); color: var(--ink-2); background: var(--marker); background: linear-gradient(transparent 55%, rgba(244, 227, 79, 0.7) 55%); display: inline; }
.seal-stamp {
  position: absolute; right: 12px; top: 6px; width: 54px; height: 54px; border: 2.5px solid var(--seal); border-radius: 50%;
  display: grid; place-items: center; color: var(--seal); font-family: var(--doc); font-weight: 800; font-size: 12px; line-height: 1.05;
  text-align: center; transform: rotate(-12deg); opacity: 0.82; mix-blend-mode: multiply; pointer-events: none;
}
.status-tag { display: inline-block; font-size: var(--fs-xs); font-weight: 800; padding: 1px 7px; border: 1.5px solid currentColor; border-radius: 2px; margin-top: 6px; }
.status-tag.jail { color: var(--seal); } .status-tag.flee { color: var(--warn); }

/* 상태 막대: 눈금이 있는 자 */
.bars { display: grid; gap: 7px; padding: 12px 14px 12px; }
.bars.small { padding: 8px 0 2px; }
.bar { display: grid; grid-template-columns: 58px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: var(--fs-s); }
.bar > span:first-child { color: var(--ink-2); font-weight: 700; }
.bar .track {
  height: 9px; position: relative; overflow: hidden; background: var(--paper-2); border: 1px solid var(--ink-2); border-radius: 1px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(27, 32, 35, 0.22) calc(10% - 1px) 10%);
}
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--ink-2); }
.bar .num { text-align: right; color: var(--ink); font-size: var(--fs-s); }
.bar.center .fill { left: 50%; }
.bar.center .track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink); }
.heatbar .fill { background: repeating-linear-gradient(45deg, var(--seal) 0 4px, #e0534a 4px 8px) !important; }
.skills { padding: 0 14px 14px; font-size: var(--fs-s); color: var(--ink-2); }
.skills summary { cursor: pointer; font-weight: 700; }

/* 통장 */
.passbook { padding: 0; overflow: hidden; }
.pb-head { background: var(--pen); color: #eef1ff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pb-head b { font-weight: 800; }
.pb-head span { font-family: var(--mono); font-size: var(--fs-xs); opacity: 0.85; }
.pb-rows { display: grid; padding: 4px 14px 10px; background-image: repeating-linear-gradient(var(--paper) 0 27px, var(--rule-soft) 27px 28px); }
.pb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; min-height: 28px; font-size: var(--fs-s); }
.pb-row dt { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-row dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.pb-row.total { border-top: 2px solid var(--ink); margin-top: 4px; font-weight: 700; }
.pb-row.total dd { font-size: var(--fs-l); }
.pb-row.sub dt { padding-left: 12px; color: var(--ink-3); }
.pb-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 14px 4px; border-top: 1px dashed var(--rule); font-size: var(--fs-s); }
.pb-sec b { font-weight: 800; color: var(--pen); }
.pb-sec span { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }
.nw-how { border-top: 1px dashed var(--rule); }
.nw-how summary { cursor: pointer; padding: 8px 14px; font-size: var(--fs-s); font-weight: 700; color: var(--pen); }
.pb-note { padding: 0 14px 10px; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }

/* 수사 기록 */
.dossier { border-left: 6px solid var(--manila-2); }
.doc-title { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--doc); font-weight: 800; font-size: var(--fs-l); margin-bottom: 8px; }
.doc-title small { font-family: var(--mono); font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); }
.case { font-size: var(--fs-s); padding: 6px 9px; border: 1.5px solid var(--seal); color: var(--seal); font-weight: 700; margin-top: 6px; background: var(--seal-soft); }
.stamp-mark {
  position: absolute; right: 12px; top: 10px; color: var(--seal); border: 2px solid var(--seal); padding: 0 6px;
  font-family: var(--display); font-size: var(--fs-l); transform: rotate(8deg); opacity: 0.85; mix-blend-mode: multiply;
}
.evidence { margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--fs-s); color: var(--ink-2); display: grid; gap: 2px; }
.evidence li { display: flex; justify-content: space-between; gap: 6px; }
.evidence li span:last-child { font-family: var(--mono); color: var(--seal); }

/* 수첩 */
.planner { background-image: linear-gradient(90deg, transparent 30px, rgba(196, 47, 40, 0.35) 30px 31px, transparent 31px), repeating-linear-gradient(var(--paper) 0 25px, #c9d6e8 25px 26px); padding-left: 40px; }
.planner .kv { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; font-size: var(--fs-s); line-height: 26px; margin: 0; }
.planner .kv dt { color: var(--ink-3); }
.planner .kv dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner .doc-title { line-height: 26px; margin: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; font-size: var(--fs-s); margin: 0; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; text-align: right; font-family: var(--mono); }

/* 장면 사진 */
.scene { transform: rotate(0.35deg); }
.sceneimg { width: 100%; max-height: 220px; aspect-ratio: 192 / 108; object-fit: cover; background: var(--paper-3); }
/* 생존 줄: 회사 런웨이 · 개인 월 수지 · 개인 현금으로 버틸 달 수 */
.survival { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 12px 0 0; border: 2px solid var(--ink); background: var(--receipt); }
.survival div { padding: 8px 10px; border-right: 1px solid var(--rule); min-width: 0; }
.survival div:last-child { border-right: none; }
.survival small { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.survival b { display: block; font-family: var(--mono); font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.survival .neg { color: var(--seal); } .survival .pos { color: var(--gain); } .survival .warnc { color: var(--warn); }
.spark-cap { font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--mono); margin-top: 8px; }
.scenecap { display: flex !important; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.scenecap #sceneCap { font-family: var(--body); color: var(--ink-2); font-size: var(--fs-s); }
.macro { font-family: var(--mono); color: var(--pen); white-space: nowrap; }

/* 서류철(사업체) */
.folder { background: var(--manila); padding: 0 0 4px; box-shadow: var(--paper-shadow); }
.vtabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 12px 0; }
.vtabs button {
  border: 1px solid var(--manila-2); border-bottom: none; border-radius: 6px 6px 0 0; box-shadow: none; background: var(--manila-2);
  font-size: var(--fs-s); padding: 5px 12px 6px; color: #3b2d0b; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vtabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 800; border-color: var(--paper); }
.vtabs button.dead { text-decoration: line-through; opacity: 0.7; }
.vtabs .new { background: transparent; border: 1px dashed #8b6b26; color: #4a3810; }
.vbody { background: var(--paper); margin: 0 8px; padding: 16px; min-height: 120px; border-radius: 0 0 2px 2px; }
.vhead { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.vimg { width: 132px; aspect-ratio: 192 / 108; object-fit: cover; border: 4px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); background: var(--paper-3); }
.vtitle { font-family: var(--display); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.1; }
.badge { display: inline-block; font-family: var(--body); font-size: var(--fs-xs); font-weight: 800; padding: 1px 6px; border: 1.5px solid; border-radius: 2px; margin-left: 8px; vertical-align: 4px; }
.badge.l0 { color: var(--gain); } .badge.l1 { color: var(--warn); } .badge.l2 { color: var(--seal); background: var(--seal-soft); }
.badge.meta { color: var(--ink-2); border-color: var(--rule); font-weight: 700; }
.ap0 { font-size: var(--fs-xs); color: var(--ink-3); border: 1px solid var(--rule); padding: 0 5px; letter-spacing: 0; }
.choice .why { color: #8a4f00; font-weight: 600; }
.lean-row { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 4.5em; align-items: center; gap: 10px; margin: 12px 0; padding: 8px 10px; border: 1px solid var(--rule); background: var(--receipt); font-weight: 700; }
.lean-row span:last-child { text-align: right; }
.lean-row input[type=range] { padding: 0; border: none; background: transparent; accent-color: var(--pen); }
/* 재무제표: 표 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0 6px; border-top: 2px solid var(--ink); border-left: 1px solid var(--rule); }
.kpi { padding: 7px 9px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--receipt); }
.kpi small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.kpi b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-m); }
.spark { width: 100%; height: 50px; display: block; margin: 6px 0 4px; }
.setting-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; font-size: var(--fs-xs); }
.setting-chip { border: 1px solid var(--pen); color: var(--pen); padding: 1px 7px; border-radius: 10px; background: var(--pen-soft); }
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--rule); }
.sliders label { font-size: var(--fs-s); color: var(--ink-2); display: grid; gap: 2px; }
.sliders b { font-family: var(--mono); color: var(--ink); }
.sliders .price-hint { font-size: var(--fs-xs); min-height: 1.2em; }
.sliders input[type=range] { padding: 0; accent-color: var(--pen); border: none; background: transparent; }
.vsel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; font-size: var(--fs-s); color: var(--ink-2); }
.vsel label { display: grid; gap: 3px; }
.dark-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.perk-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.perk-flags span { font-size: var(--fs-xs); color: var(--pen); border: 1.5px solid var(--pen); padding: 0 6px; font-weight: 800; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rec-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; padding: 8px; }
.rec-card .px { width: 64px; height: 64px; object-fit: cover; }
.rec-card b { display: block; font-size: var(--fs-m); }
.rec-card small { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.rec-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rec-why i { font-style: normal; font-size: 10px; font-weight: 700; color: var(--pen); border: 1px solid currentColor; padding: 0 4px; }
.home-row.here { outline: 2px solid var(--pen); outline-offset: -2px; }
.buy-box { grid-column: 1 / -1; margin-top: 8px; padding: 10px; background: var(--paper-2); border-left: 3px solid var(--pen); }
.buy-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.buy-opt { display: grid; gap: 2px; text-align: left; padding: 8px 10px; }
.buy-opt b { font-size: var(--fs-m); }
.buy-opt small { font-size: var(--fs-xs); color: var(--ink-2); }
.buy-opt small i { font-style: normal; color: var(--ink-3); }
.buy-opt em { font-style: normal; font-size: var(--fs-xs); font-weight: 700; color: var(--seal); }
.pet-cards { display: grid; gap: 6px; padding: 10px 12px; border-bottom: 1px dashed var(--rule); }
.pet-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; }
.pet-card .px { width: 64px; aspect-ratio: 192 / 108; object-fit: cover; }
.pet-card small { color: var(--ink-3); font-size: var(--fs-xs); }
.pet-bar { display: grid; grid-template-columns: 3.5em minmax(0, 1fr); gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.pet-bar i { font-style: normal; }
.pet-bar b { display: block; height: 6px; background: var(--gain); }
.pet-bar b.neg { background: var(--seal); }
.adopt-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.adopt-kind { display: grid; gap: 4px; padding: 8px; border: 1.5px solid var(--rule); cursor: pointer; }
.adopt-kind:has(input:checked) { border-color: var(--pen); background: var(--pen-soft); }
.adopt-kind input { position: absolute; opacity: 0; }
.adopt-kind .px { width: 100%; aspect-ratio: 192 / 108; object-fit: cover; }
.adopt-kind small { color: var(--ink-3); font-size: var(--fs-xs); }
.home-dir { font-size: var(--fs-xs); font-weight: 700; color: var(--pen); }
.dark-flags span { font-size: var(--fs-xs); color: var(--seal); border: 1.5px solid var(--seal); padding: 0 6px; font-weight: 800; transform: rotate(-2deg); }

/* 영수증(인생 기록) */
.receipt {
  background: var(--receipt); padding: 16px 16px 22px; position: relative; box-shadow: var(--paper-shadow);
  font-family: var(--mono); max-height: 460px; display: flex; flex-direction: column;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x;
          mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x;
}
.feedhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px dashed var(--ink-3); padding-bottom: 8px; margin-bottom: 4px; }
.feedhead h3 { font-family: var(--body); font-weight: 800; font-size: var(--fs-l); }
.feedhead small { font-family: var(--mono); font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); margin-left: 6px; }
#feed { list-style: none; margin: 0; padding: 0; overflow: auto; font-size: var(--fs-s); overflow-anchor: none; } /* 읽던 줄은 ui.js가 직접 붙잡는다 (브라우저 앵커와 겹치면 두 번 밀린다) */
#feed li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px dotted var(--rule); font-family: var(--body); }
#feed li time { color: var(--ink-3); font-size: var(--fs-xs); padding-top: 2px; }
#feed li.big { font-weight: 800; background: linear-gradient(transparent 60%, rgba(244, 227, 79, 0.75) 60%); }
#feed li.bad { color: var(--seal); } #feed li.good { color: var(--gain); } #feed li.dark { color: #8f1f19; }
#feed li.macro { color: var(--pen); } #feed li.choice { color: var(--ink-2); } #feed li.hidden { display: none; }
#feed li.money { color: var(--ink-3); font-family: var(--mono); font-size: var(--fs-xs); }

/* 서류함(행동) */
.cabinet { background: var(--paper); box-shadow: var(--paper-shadow); padding: 0; }
.col.right { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); align-self: start; }
.aphead { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 8px; border-bottom: 2px solid var(--ink); }
.aphead h3 { font-family: var(--doc); font-weight: 800; font-size: var(--fs-l); letter-spacing: 0.06em; }
.ap { font-family: var(--mono); color: var(--seal); letter-spacing: 3px; font-size: var(--fs-l); }
.acats { display: flex; gap: 3px; flex-wrap: wrap; padding: 10px 10px 0; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.acats button { border-radius: 5px 5px 0 0; border: 1px solid var(--rule); border-bottom: none; box-shadow: none; font-size: var(--fs-s); padding: 5px 10px; background: var(--paper-3); }
.acats button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 800; border-color: var(--rule); position: relative; top: 1px; }
.alist { display: grid; gap: 0; max-height: calc(100vh - 230px); overflow: auto; }
.act {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left;
  padding: 10px 14px; border: none; border-bottom: 1px solid var(--rule-soft); border-radius: 0; box-shadow: none; background: transparent;
}
@media (hover: hover) { .act:hover:not(:disabled) { background: var(--pen-soft); } }
.act:active:not(:disabled) { transform: none; }
.act .ic { font-size: 19px; text-align: center; }
.act .nm { font-size: var(--fs-m); font-weight: 700; min-width: 0; }
.act .ds { display: block; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; }
.act .fx { display: block; margin-top: 2px; font-size: var(--fs-xs); line-height: 1.45; }
.act .fx .pay, .act .fx .get { display: block; }
.act .fx .pay, .combo-help .pay { color: var(--seal); }
.act .fx .get, .combo-help .get { color: var(--gain); font-weight: 600; }
.combo-help { padding: 10px 12px; border-bottom: 1px dashed var(--rule); font-size: var(--fs-s); line-height: 1.5; color: var(--ink-2); }
.combo-help b { color: var(--ink); }
.combo-help .pay, .combo-help .get { white-space: nowrap; margin-left: 4px; }
.act .why { display: block; font-size: var(--fs-xs); color: #8a4f00; font-weight: 600; }
.act .ap { font-size: var(--fs-xs); letter-spacing: 1px; white-space: nowrap; }
.act .ap small { font-size: 10px; letter-spacing: 0; color: var(--ink-3); }
.act.l1 .nm::after, .act.l2 .nm::after { content: "회색"; font-size: 10px; font-weight: 800; color: var(--warn); border: 1px solid currentColor; padding: 0 4px; margin-left: 6px; vertical-align: 2px; }
.act.l2 .nm::after { content: "불법"; color: var(--seal); }
.act.toggled { background: var(--seal-soft); }
.act:disabled { opacity: 1; color: var(--ink-3); background: var(--paper-2); }
.act:disabled .ic, .act:disabled .ap, .act:disabled .fx, .act:disabled .ds { opacity: 0.55; }
.buy-opt:disabled { opacity: 1; color: var(--ink-3); background: var(--paper-2); }
/* 결정 대기 중 예약한 행동 */
.act.held { background: var(--seal-soft); box-shadow: inset 4px 0 0 var(--seal); }
.resv-tag { font-style: normal; font-size: 10px; font-weight: 800; color: var(--seal); border: 1px solid currentColor; padding: 0 4px; margin-left: 6px; vertical-align: 2px; }
.act .why.ok { color: var(--seal); }
.resv-note { padding: 10px 12px; border-bottom: 1px dashed var(--seal); background: var(--seal-soft); font-size: var(--fs-s); line-height: 1.5; color: var(--ink); }
.resv-note > b { color: var(--seal); }
.resv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.resv-chips .chip { font-size: var(--fs-xs); padding: 4px 8px; border: 1px solid var(--seal); background: var(--paper); color: var(--ink); box-shadow: none; min-height: 0; }
.resv-chips .chip b { color: var(--seal); margin-left: 2px; }
/* 파산 위험 경보 (통장 맨 위) */
.risk-box { margin: 8px 0 10px; border: 2px solid var(--seal); background: var(--seal-soft); padding: 8px 10px; }
.risk-box.mild { border-width: 1px; border-color: var(--warn); }
.risk-box > b { color: var(--seal); font-size: var(--fs-s); letter-spacing: 0.04em; }
.risk-box.mild > b { color: var(--warn); }
.risk-box ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.risk-box li { display: grid; gap: 2px; font-size: var(--fs-s); color: var(--ink); line-height: 1.45; padding-left: 8px; border-left: 3px solid var(--warn); }
.risk-box li.danger { border-left-color: var(--seal); }
.risk-box li.danger span { font-weight: 800; }
.risk-box small { color: var(--ink-2); font-size: var(--fs-xs); }
.toast.danger { background: var(--seal); color: #fff; }
.warn-line { color: var(--seal); font-weight: 700; }
/* 불법·회색 경고 */
.ill-warn { display: block; margin-top: 4px; padding: 3px 6px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; color: var(--seal); background: var(--seal-soft); border-left: 3px solid var(--seal); }
.ill-warn.l1 { color: var(--warn); border-left-color: var(--warn); background: transparent; }
.ill-banner { margin: 8px 0 10px; padding: 10px 12px; border: 2px solid var(--seal); background: var(--seal-soft); color: var(--ink); font-size: var(--fs-s); line-height: 1.5; }
.ill-banner > b { color: var(--seal); }
.ill-banner p { margin: 4px 0; }
.ill-banner small { display: block; color: var(--ink-2); font-size: var(--fs-xs); margin-top: 4px; }
.ill-banner.big > b { font-size: var(--fs-l); }
.ill-banner.gray { border-color: var(--warn); border-width: 1px; }
.ill-banner.gray > b { color: var(--warn); }
.choice.illegal { box-shadow: inset 4px 0 0 var(--seal); }
.ask-off { display: block; margin-top: 10px; }
.ask-off input { width: auto; }
/* 빚 장부·통화 선택 */
.debt-book .debt-log { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.debt-log li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; font-size: var(--fs-s); padding-left: 8px; border-left: 3px solid var(--seal); }
.debt-log li.down { border-left-color: var(--gain); }
.debt-log time { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }
.debt-log b { font-family: var(--mono); white-space: nowrap; }
.debt-log li.up b { color: var(--seal); } .debt-log li.down b { color: var(--gain); }
.debt-log span { grid-column: 1 / -1; color: var(--ink-2); }
.pb-head .cur-btn { margin-left: auto; font-size: var(--fs-xs); padding: 2px 8px; min-height: 28px; }
.cur-opts { display: grid; gap: 8px; margin: 12px 0; }
.cur-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); background: var(--receipt); cursor: pointer; }
.cur-opt span { display: grid; gap: 4px; min-width: 0; flex: 1; }
.cur-opt small { color: var(--ink-3); }
.cur-opt select { max-width: 100%; }
/* 게임 모드 고르기·조건 접기 (타이틀) */
.mode-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--rule); background: var(--receipt); cursor: pointer; }
.mode-opt:has(input:checked) { border-color: var(--seal); background: var(--seal-soft); }
.mode-opt input { width: auto; margin-top: 3px; accent-color: var(--seal); }
.mode-opt span { display: grid; gap: 3px; } .mode-opt b { font-size: var(--fs-l); } .mode-opt small { color: var(--ink-2); }
.spawn-more, .more-inds, .setup-more { margin-top: 14px; border-top: 1px dashed var(--rule); padding-top: 10px; }
.spawn-more-h, .more-inds-h { margin: 18px 0 8px; font-size: var(--fs-l); }
.spawn-more-h small { font-weight: 400; color: var(--ink-3); font-size: var(--fs-s); margin-left: 6px; }
.spawn-more > summary, .more-inds > summary, .setup-more > summary { cursor: pointer; font-weight: 800; color: var(--pen); min-height: 44px; display: flex; align-items: center; }
.setup-default { margin: 10px 0 0; padding: 8px 10px; background: var(--paper-2); border-left: 3px solid var(--pen); font-size: var(--fs-s); }
.setup-name { display: block; margin-top: 8px; }
.mode-badge { margin-left: 8px; font-size: var(--fs-xs); padding: 1px 6px; border: 1px solid var(--marker); color: var(--marker); white-space: nowrap; }
/* 비서 메모 */
.secretary { padding: 0; background: #fffbe6; border: 1px solid #e8d98a; box-shadow: var(--paper-shadow); }
.secretary .sec > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; min-height: 44px; border-bottom: 1px dashed #e0cf73; }
.secretary .sec > summary span { font-size: var(--fs-s); color: var(--ink-2); font-weight: 700; } .secretary .sec > summary span.neg { color: var(--seal); }
.sec-fb { margin: 0; padding: 8px 14px 0; font-size: var(--fs-s); color: var(--ink-2); }
.sec-list { list-style: none; margin: 0; padding: 8px 10px 10px; display: grid; gap: 6px; }
.sec-list li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; background: rgba(255, 255, 255, 0.6); border-left: 3px solid var(--rule); }
.sec-list li.p0 { border-left-color: var(--seal); } .sec-list li.p1 { border-left-color: var(--warn); } .sec-list li.p2 { border-left-color: var(--pen); }
.sec-list .tx { display: grid; gap: 2px; min-width: 0; } .sec-list .tx small { color: var(--ink-2); font-size: var(--fs-xs); }
.sec-go { font-size: var(--fs-xs); padding: 4px 10px; min-height: 36px; white-space: nowrap; }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--marker); } 100% { box-shadow: none; } }
/* 점진 공개 */
.reveal-all { margin-left: auto; margin-right: 10px; font-size: var(--fs-xs); color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.new-dot { font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: var(--seal); padding: 0 4px; margin-left: 4px; border-radius: 2px; vertical-align: 1px; }
/* 새로 열린 것: 처음 한 번 빛나고 NEW */
.act.fresh { box-shadow: inset 5px 0 0 var(--marker); background: #fffbe0; }
.new-tag { font-style: normal; font-size: 11px; font-weight: 800; color: #1b2023; background: var(--marker); padding: 0 5px; margin-left: 6px; vertical-align: 2px; border-radius: 2px; letter-spacing: 0.04em; }
.fresh-ui { position: relative; outline: 2px dashed #d9c32a; outline-offset: 2px; }
.fresh-ui::after { content: "NEW"; position: absolute; top: -9px; right: -4px; font: 800 10px/1 var(--body); background: var(--marker); color: #1b2023; padding: 2px 5px; border-radius: 2px; z-index: 2; pointer-events: none; }
.pop { animation: freshpop 1.1s ease-out 2; }
@keyframes freshpop { 0% { box-shadow: 0 0 0 0 rgba(244, 227, 79, 0.95); } 70% { box-shadow: 0 0 0 14px rgba(244, 227, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 227, 79, 0); } }
.act.fresh.pop { animation: freshpop 1.1s ease-out 2; }
.toast.unlock { background: var(--pen); color: #fff; font-size: var(--fs-l); padding: 14px 20px; border: 2px solid var(--marker); }
.unlock-next { margin: 0; padding: 10px 14px; font-size: var(--fs-s); color: var(--ink-3); border-top: 1px dashed var(--rule); }
#feed li.unlock { color: var(--pen); font-weight: 700; }
.warn-list { margin: 10px 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--ink); font-weight: 700; }
.confirm-row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.confirm-row button { min-height: 44px; min-width: 120px; }
.resv-line { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--seal); background: var(--seal-soft); font-size: var(--fs-s); color: var(--ink); }

/* ───────── 결재 요청서(결정) ───────── */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(8, 18, 14, 0.72); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.dialog { background: var(--paper); border-radius: 2px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8); width: min(780px, 100%); max-height: calc(100vh - 32px); overflow: auto; position: relative; }
.approval { animation: slidein 0.22s ease-out; }
@keyframes slidein { from { transform: translateY(14px) rotate(-0.6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ap-head { display: flex; justify-content: space-between; align-items: stretch; gap: 14px; padding: 14px 18px 12px; border-bottom: 2px solid var(--ink); }
.ap-title { display: grid; align-content: center; gap: 4px; min-width: 0; }
.ap-kind { font-family: var(--doc); font-weight: 800; font-size: var(--fs-xl); letter-spacing: 0.3em; }
.mtag { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }
.signbox { border-collapse: collapse; font-size: var(--fs-xs); flex: none; }
.signbox th { border: 1px solid var(--ink); padding: 1px 10px; font-weight: 700; background: var(--paper-2); }
.signbox td { border: 1px solid var(--ink); width: 52px; height: 46px; text-align: center; position: relative; }
.sign { font-family: var(--doc); color: var(--pen); font-size: 18px; font-weight: 800; transform: rotate(-8deg); display: inline-block; }
.seal-slot { position: absolute; inset: 0; display: grid; place-items: center; }
.seal-slot.stamped::after {
  content: attr(data-name); width: 40px; height: 40px; border: 2.5px solid var(--seal); border-radius: 50%; display: grid; place-items: center;
  color: var(--seal); font-family: var(--doc); font-weight: 800; font-size: 11px; line-height: 1; transform: rotate(-14deg);
  animation: stamp 0.28s cubic-bezier(.2, 1.6, .4, 1) both; mix-blend-mode: multiply;
}
@keyframes stamp { from { transform: scale(2.6) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1) rotate(-14deg); opacity: 0.9; } }
.mart { position: relative; padding: 14px 18px 0; }
.mart.noimg { display: none; }
.mimg { width: 100%; max-height: min(30vh, 240px); aspect-ratio: 192 / 86; object-fit: cover; border: 6px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transform: rotate(-0.5deg); background: var(--paper-3); }
.mnpc { position: absolute; right: 30px; bottom: -34px; width: 92px; height: 92px; border: 5px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); background: #dfe4dc; transform: rotate(3deg); }
.mbody { padding: 16px 18px 20px; }
.mhead { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.mbody h2 { font-family: var(--display); font-weight: 400; font-size: var(--fs-2xl); padding-right: 96px; line-height: 1.15; }
.mbody > p { color: var(--ink-2); margin: 10px 0; max-width: 65ch; }
.ap-bar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px 6px 18px; background: var(--paper-2); border-bottom: 1px solid var(--line, var(--ink-3)); font-size: var(--fs-xs); color: var(--ink-3); }
.ap-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mhide { font-size: var(--fs-s); padding: 6px 12px; min-height: 36px; white-space: nowrap; flex: none; }
/* 결재 결과: 도장을 찍은 서류 아래에 무엇이 일어났는지 적고 '확인'을 기다린다 */
.result { margin-top: 12px; border-top: 1px solid var(--ink); padding-top: 12px; display: grid; gap: 10px; animation: slidein 0.2s ease-out; }
.result .res-h { font-size: var(--fs-s); color: var(--ink-3); margin: 0; }
.result .res-h b { color: var(--ink); font-size: var(--fs-m, 15px); }
.result ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result li { padding: 8px 10px; background: var(--paper-2); border-left: 3px solid var(--pen); line-height: 1.5; color: var(--ink); }
.result li.bad { border-left-color: var(--seal); }
.result li.dark { border-left-color: var(--ink); }
.result .res-money { display: block; margin-top: 4px; font-family: var(--mono); font-size: var(--fs-s); color: var(--ink-2); }
.result .res-resv { font-size: var(--fs-s); padding: 8px 10px; border-left: 3px solid var(--seal); background: var(--seal-soft); color: var(--ink); }
.result .res-resv p { margin: 0; }
.result .res-ok { justify-self: end; min-width: 160px; min-height: 44px; font-size: var(--fs-l); }
.fact { font-size: var(--fs-s); font-family: var(--mono); background: var(--gain-soft); border-left: 3px solid var(--gain); padding: 8px 10px; color: #1d4a35 !important; }
.choices { display: grid; gap: 0; margin-top: 12px; border-top: 1px solid var(--ink); }
.choice {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; text-align: left; padding: 11px 6px 11px 4px;
  border: none; border-bottom: 1px solid var(--rule); border-radius: 0; box-shadow: none; background: transparent;
}
.choice .n {
  width: 22px; height: 22px; border: 1.5px solid var(--ink); display: grid; place-items: center;
  font-family: var(--mono); font-size: var(--fs-s); color: var(--ink); align-self: start; margin-top: 1px;
}
.choice b { display: block; font-size: var(--fs-l); }
.choice small { color: var(--ink-3); font-size: var(--fs-s); }
.choice .rec { font-style: normal; font-family: var(--sans, inherit); font-size: 10px; font-weight: 800; color: var(--pen); border: 1px solid currentColor; padding: 0 4px; margin-left: 6px; vertical-align: 3px; white-space: nowrap; }
.choice .rec.lead { color: var(--warn); }
/* 결재 요청서의 담당·팀장 의견 */
.advice { display: grid; gap: 6px; margin-top: 12px; padding: 10px 12px; background: var(--paper-2); border-left: 3px solid var(--ink-3); }
.adv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: var(--fs-s); line-height: 1.5; }
.adv .who { font-weight: 800; font-size: var(--fs-xs); padding: 1px 6px; border: 1.5px solid var(--pen); color: var(--pen); letter-spacing: 0.1em; }
.adv.lead .who { border-color: var(--warn); color: var(--warn); }
.adv p { margin: 0; color: var(--ink-2); }
@media (hover: hover) {
  .choice:hover:not(:disabled) { background: var(--pen-soft); }
  .choice:hover:not(:disabled) .n { border-color: var(--pen); color: var(--pen); }
}
.choice:active:not(:disabled) { transform: none; }
.choice.on .n { background: var(--marker); }
.choice.pick .n { background: var(--pen); color: #fff; border-color: var(--pen); }
.choice.pick .n::before { content: "✓"; }
.choice.pick .n { font-size: 0; } .choice.pick .n::before { font-size: 13px; }
.autobar { margin-top: 12px; height: 5px; background: var(--paper-2); position: relative; overflow: hidden; }
.autobar i { position: absolute; inset: 0 auto 0 0; background: var(--pen); width: 0; }
.autobar span { display: none; }
/* 결재함: 새 결재는 화면을 덮지 않고 오른쪽 아래 알림으로 먼저 온다 */
.decpeek {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45;
  display: flex; align-items: center; gap: 12px; background: var(--seal); color: #fff; border: 3px solid #fff; outline: 3px solid var(--seal);
  padding: 12px 12px 12px 14px; box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.7); max-width: min(460px, calc(100% - 32px));
  animation: peekpulse 1.6s ease-out infinite; /* 결재할 때까지 맥박처럼 빛난다 */
}
@media (min-width: 761px) { .decpeek { min-width: 360px; } }
@keyframes peekpulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 47, 40, 0.65), 0 14px 30px -8px rgba(0, 0, 0, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(196, 47, 40, 0), 0 14px 30px -8px rgba(0, 0, 0, 0.7); }
  100% { box-shadow: 0 0 0 0 rgba(196, 47, 40, 0), 0 14px 30px -8px rgba(0, 0, 0, 0.7); }
}
.decpeek .peek-txt { display: grid; gap: 2px; min-width: 0; }
.decpeek small { font-size: var(--fs-xs); color: #ffe3df; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decpeek .kicker { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; color: var(--marker); }
.decpeek.arrive { animation: peekin 0.3s ease-out, peekpulse 1.6s ease-out 0.3s infinite; }
@keyframes peekin { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes peekring { 50% { box-shadow: 0 0 0 6px var(--seal-soft), 0 10px 24px -8px rgba(0, 0, 0, 0.6); } }
body.has-peek .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.in-game.has-peek { padding-bottom: 90px; }
/* 서류가 펼쳐진 직후 잠깐: 연타가 선택지로 새지 않게 */
.choices.arming { pointer-events: none; opacity: 0.7; }
.ap-opt { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; color: var(--ink-2); cursor: pointer; }
.ap-opt input { width: auto; margin: 0; }
.feed-filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.decpeek .dot { width: auto; height: auto; border-radius: 0; background: none; font-size: 28px; line-height: 1; flex: none; animation: peekwiggle 2.4s ease-in-out infinite; }
.decpeek .dot::before { content: "📋"; }
@keyframes peekwiggle { 0%, 78%, 100% { transform: rotate(0); } 84% { transform: rotate(-14deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-5deg); } }
#decPeekT { font-weight: 800; font-size: var(--fs-l); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: #fff; }
.decpeek button { white-space: nowrap; }
.decpeek #decOpen { background: #fff; color: var(--seal); border-color: #fff; font-size: var(--fs-l); font-weight: 800; min-height: 44px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.decpeek #decOpen:hover:not(:disabled) { background: #fff3c4; }
@keyframes blink { 50% { opacity: 0.25; } }

.abroad-line { margin: 8px 0 0; padding: 8px 10px; background: var(--paper-2); border-left: 3px solid var(--pen); font-size: var(--fs-s); color: var(--ink-2); }
/* 시트(창업·이사·성향·기록) */
.sheetbox { width: min(980px, 100%); padding: 20px; }
.sheetbox .x { position: sticky; top: 0; z-index: 6; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 0 -44px auto; background: var(--paper); border-color: var(--rule); }
#sheetBody > h2:first-child { position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 8px 52px 8px 0; margin-top: 0; border-bottom: 1px solid var(--rule-soft); }
.sheetbox h2 { font-family: var(--doc); font-weight: 800; font-size: var(--fs-xl); letter-spacing: 0.05em; padding-right: 40px; }
.sheetbox h3 { font-size: var(--fs-l); margin-top: 14px; }
.vfilter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.vlegals { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vlegals button { font-size: var(--fs-s); padding: 6px 12px; box-shadow: none; border-color: var(--rule); font-weight: 700; }
.vlegals button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vcats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.vcats button { font-size: var(--fs-xs); padding: 3px 8px; box-shadow: none; border-color: var(--rule); }
.vcats button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; margin-top: 12px; }
.vcard { text-align: left; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--rule); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); border-radius: 2px; }
@media (hover: hover) { .vcard:hover:not(:disabled) { background: #fff; border-color: var(--pen); box-shadow: 0 0 0 2px var(--pen-soft); } }
.vcard:active:not(:disabled) { transform: translateY(1px); }
.vcard img { width: 100%; aspect-ratio: 192 / 108; object-fit: cover; background: var(--paper-3); }
.vcard div { padding: 0 2px; display: grid; gap: 2px; }
.vcard b { font-size: var(--fs-m); }
.vcard small { color: var(--ink-3); display: block; font-size: var(--fs-xs); }
.vcard[hidden] { display: none !important; }
.setup-groups { display: grid; gap: 12px; margin-top: 12px; }
.setup-group { border: 1px solid var(--rule); padding: 10px 12px; background: var(--receipt); }
.setup-group legend { font-weight: 800; padding: 0 6px; }
.setup-group p { margin: 0 0 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.setup-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.setup-opt { display: grid; gap: 1px; text-align: left; padding: 7px 9px; box-shadow: none; border-color: var(--rule); background: #fff; }
.setup-opt small { color: var(--ink-3); font-size: var(--fs-xs); }
.setup-opt[aria-pressed="true"] { background: var(--pen-soft); color: var(--ink); border-color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen); }
.home-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-bottom: 1px solid var(--rule-soft); }
.home-row img { width: 100px; aspect-ratio: 192 / 108; object-fit: cover; }
.home-row small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.toast { position: fixed; left: 16px; right: 16px; margin-inline: auto; width: fit-content; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: rotate(-1deg); background: var(--marker); color: var(--ink); padding: 10px 16px; font-weight: 800; z-index: 60; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.6); max-width: calc(100% - 32px); }

/* ───────── 인생 결산서 ───────── */
.endcard { max-width: 920px; margin: 0 auto; padding: 22px; display: grid; gap: 14px; }
.endphoto { transform: rotate(-0.6deg); }
.endimg { width: 100%; aspect-ratio: 192 / 108; object-fit: cover; background: var(--paper-3); }
.end-name { font-family: var(--display); font-weight: 400; font-size: var(--fs-3xl); line-height: 1.05; }
.endcard .lead { color: var(--ink-2); font-size: var(--fs-l); margin: 0; max-width: 65ch; }
.endgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); border-top: 2px solid var(--ink); border-left: 1px solid var(--rule); }
.endgrid .kpi { background: var(--receipt); }
.chartbox { margin: 0; }
.chartbox figcaption { font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--mono); margin-bottom: 4px; }
.chart { width: 100%; height: 140px; background: var(--receipt); border: 1px solid var(--rule); display: block; }
.chart-empty { font-size: var(--fs-s); color: var(--ink-3); padding: 12px; border: 1px dashed var(--rule); background: var(--receipt); }
.endcard h3 { font-family: var(--doc); font-weight: 800; }
.epitaphs { font-size: var(--fs-s); color: var(--ink-2); padding-left: 20px; margin: 0; }
.epitaphs li { margin: 3px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───────── 반응형 ───────── */
@media (max-width: 1220px) {
  #game { grid-template-columns: 280px minmax(0, 1fr); }
  .col.right { grid-column: 1 / -1; position: static; }
  .alist { max-height: none; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 860px) {
  .cover { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  #game { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sliders, .vsel { grid-template-columns: minmax(0, 1fr); }
  .vfilter { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .top-in { gap: 8px; }
  .brand-name { display: none; }
  .clock { border: none; padding: 0; }
  .clock b { font-size: 19px; }
  .topright { margin-left: 0; }
  #top button { padding: 3px 7px; font-size: var(--fs-xs); }
  .vhead { grid-template-columns: 96px minmax(0, 1fr); }
  .vimg { width: 96px; }
  .mbody h2 { padding-right: 0; font-size: var(--fs-xl); }
  .mnpc { width: 64px; height: 64px; bottom: -22px; right: 22px; }
  .mhide { min-height: 44px; }
  .result .res-ok { justify-self: stretch; }
  .ap-head { flex-direction: column; }
  .signbox td { height: 38px; }
  .cert-body { grid-template-columns: 70px minmax(0, 1fr); }
  .title-mark { font-size: 40px; }
  /* 생존 줄: 세 칸이면 숫자가 잘려서 한 줄에 하나씩 (이름 왼쪽 · 숫자 오른쪽) */
  .survival { grid-template-columns: minmax(0, 1fr); }
  .survival div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 10px; border-right: none; border-bottom: 1px solid var(--rule); }
  .survival div:last-child { border-bottom: none; }
  .survival small { font-size: var(--fs-s); }
  .survival b { font-size: 18px; }
}

/* ───────── 모바일: 아래 탭 바로 한 묶음씩 ───────── */
button, a, select, input, label, summary { touch-action: manipulation; }
.mnav { display: none; }
/* 폰(세로 · 가로로 눕힌 폰): 상단 바 한 줄, 누르는 것은 44px 이상 */
@media (max-width: 760px), (max-height: 500px) and (orientation: landscape) {
  /* ⋯ 메뉴가 없는 옛 화면이면 가로로 밀어서 보기 */
  .top-in { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; padding-block: 6px; }
  .top-in::-webkit-scrollbar { display: none; }
  .top-in > * { flex: none; }
  .speed button { min-height: 44px; min-width: 44px; }
  #top button { min-height: 44px; }
  /* ⋯ 메뉴가 있으면 바에는 ❚❚ ▶ » ⋯ 만 두고, 2×~16×·자동 결정·성향·저장은 ⋯ 아래로 */
  .top-in:has(> .top-more) { overflow: visible; position: relative; gap: 6px; padding-block: 4px; }
  .top-in:has(> .top-more) > .clock { display: grid; gap: 0; flex: 0 1 auto; min-width: 0; line-height: 1.15; }
  .top-in:has(> .top-more) .clock b { font-size: 17px; }
  .top-in:has(> .top-more) .clock span { overflow: hidden; text-overflow: ellipsis; }
  .tname, .sp-d, .ff-t { display: none; }
  .sp-m { display: inline; }
  .top-in:has(> .top-more) > .speed { margin-left: auto; }
  .top-in:has(> .top-more) .speed > [data-speed]:not([data-speed="1"]), .top-in:has(> .top-more) > .topright { display: none; }
  .speed [data-speed="1"] { font-size: 16px; }
  .speed .ff { font-size: 20px; line-height: 1; }
  .top-more-chk { display: block; position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
  .top-more {
    display: grid; place-items: center; align-content: center; min-width: 44px; min-height: 44px; padding: 0 6px; border: 1px solid #2c4a40; border-radius: 3px;
    background: var(--night-2); color: var(--on-night); font-size: 20px; line-height: 1; cursor: pointer; user-select: none; -webkit-user-select: none;
  }
  .top-more[data-spd]:not([data-spd=""])::after { content: attr(data-spd); font: 700 12px/1 var(--mono); color: #b9f3d2; } /* 메뉴에서 고른 배속 */
  .top-more-chk:checked + .top-more { background: #b9f3d2; color: var(--night); border-color: #b9f3d2; }
  .top-more-chk:checked + .top-more::after { color: var(--night); }
  .top-more-chk:focus-visible + .top-more { outline: 3px solid #b9f3d2; outline-offset: 2px; }
  .top-in > .top-more-chk:checked ~ .topright {
    display: flex; flex-wrap: wrap; gap: 8px; position: absolute; top: calc(100% + 3px); right: 0; width: min(100%, 440px); z-index: 2; margin: 0;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
    background: var(--night); border-bottom: 3px solid #0a1310; box-shadow: 0 14px 22px -12px rgba(0, 0, 0, 0.8);
  }
  .m-speeds { display: flex; flex: 1 1 100%; }
  .m-speeds button { flex: 1 1 0; border-radius: 0; margin-left: -1px; font-family: var(--mono); }
  .m-speeds button:first-child { margin-left: 0; border-radius: 3px 0 0 3px; }
  .m-speeds button:last-child { border-radius: 0 3px 3px 0; }
  .topright > button { flex: 1 1 auto; }
  /* 터치 목표 44px */
  .vtabs button, .vsel select, .field select, .field input, #openSettings, .ap-opt, .decpeek button, .mhide, .acats button,
  .sheetbox button, .sheetbox input:not([type=checkbox], [type=radio], [type=range]), .sv-btns button, .resv-chips .chip, .confirm-row button { min-height: 44px; }
  .sliders input[type=range], .lean-row input[type=range] { height: 44px; }
  .skills summary { padding-block: 12px; }
  .nw-how summary { padding-block: 12px; }
  .feed-filters label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
  /* 12px보다 작은 글씨 */
  .choice .rec, .ap0, .resv-tag, .act .ap small, .rec-why i, .act.l1 .nm::after, .act.l2 .nm::after { font-size: 12px; }
  .adv small { font-size: var(--fs-xs); }
}
/* 가로로 눕힌 폰: 결재 요청서를 화면 높이에 꽉 채우고 그림을 줄여 선택지를 끌어올린다 */
@media (max-height: 500px) and (orientation: landscape) {
  #modal.scrim { padding-block: 0; }
  #modal .dialog { max-height: 100dvh; }
  .ap-head { padding: 8px 18px 6px; }
  .signbox td { height: 32px; }
  .mimg { max-height: 24vh; }
  .mnpc { width: 64px; height: 64px; bottom: -22px; }
}
@media (max-width: 760px) {
  body.in-game { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.in-game.has-peek { padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
  .vcats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .vcats button { flex: none; }
  .endgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --fs-xs: 13px; }
  .mnav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--night); border-top: 3px solid #0a1310;
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
  }
  .mnav[hidden] { display: none !important; }
  .mnav button {
    background: transparent; border: none; box-shadow: none; color: var(--on-night-2); display: grid; justify-items: center; gap: 1px;
    font-size: var(--fs-xs); padding: 4px 0; min-height: 50px; position: relative; border-radius: 6px;
  }
  .mnav button .mi { font-family: var(--doc); font-weight: 800; font-size: 18px; line-height: 1.1; }
  .mnav button[aria-pressed="true"] { color: var(--night); background: #b9f3d2; }
  .mbadge { position: absolute; top: 2px; right: 18%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--seal); color: #fff; font: 700 10px/16px var(--mono); }
  .mbadge:empty { display: none; }
  /* 한 번에 한 묶음만 */
  #game > .col { display: contents; }
  #game { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #game [data-pane] { display: none; }
  body[data-pane="status"] #game [data-pane="status"],
  body[data-pane="act"] #game [data-pane="act"] { display: grid; gap: 14px; }
  body[data-pane="biz"] #game [data-pane="biz"],
  body[data-pane="log"] #game [data-pane="log"] { display: block; }
  body[data-pane="log"] .receipt { max-height: none; }
  .cabinet { position: static; }
  .alist { max-height: none; grid-template-columns: minmax(0, 1fr); }
  .act { min-height: 56px; padding: 12px; }
  .acats { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 52px); z-index: 5; flex-wrap: wrap; } /* 탭이 화면 밖으로 숨지 않게 줄바꿈 */
  .acats button { flex: none; min-height: 44px; }
  .mbadge { min-width: 18px; height: 18px; border-radius: 9px; font-size: 12px; line-height: 18px; }
  /* 긴 줄은 접어서: 저장 목록 · 결재 문서번호 (한 줄로 두면 화면이 옆으로 넓어지거나 결재란 밑으로 들어간다) */
  .sv-main small, .mtag { white-space: normal; }
  /* 결재 요청서: 화면 전체 시트 */
  #modal.scrim { padding: 0; place-items: end stretch; }
  #modal .dialog { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ap-head { flex-direction: row; align-items: center; padding: 10px 14px; }
  .ap-bar { padding-top: max(6px, env(safe-area-inset-top, 0px)); } /* 맨 위 막대가 노치·상태 표시줄 밑으로 들어가지 않게 */
  .ap-kind { font-size: var(--fs-l); letter-spacing: 0.15em; }
  .signbox th { padding: 1px 6px; }
  .signbox td { width: 40px; height: 36px; }
  .seal-slot.stamped::after { width: 32px; height: 32px; font-size: 9px; }
  .mart { padding: 10px 14px 0; }
  .mbody { padding: 12px 14px 18px; }
  .choice { min-height: 56px; padding: 12px 6px 12px 2px; }
  .choice b { font-size: var(--fs-m); }
  .sheetbox { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: max(16px, env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  #sheet.scrim { padding: 0; place-items: stretch; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .setup-opts { grid-template-columns: minmax(0, 1fr); }
  .setup-opt { min-height: 48px; }
  .decpeek { left: 12px; right: 12px; max-width: none; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body.has-peek .toast { bottom: calc(146px + env(safe-area-inset-bottom, 0px)); }
  .ap-bar > span { display: none; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .scene { transform: none; }
  .home-row { grid-template-columns: 76px minmax(0, 1fr); }
  .home-row img { width: 76px; }
  .home-row > div:last-child { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
  .cover-photo { transform: rotate(-0.6deg); }
}
@media (max-width: 340px) {
  .top-in:has(> .top-more) > .brand { display: none; } /* 아주 좁은 폰: 도장 로고보다 시간 조절 버튼이 먼저 */
}
@media (max-width: 380px) {
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .vcard small + small { display: none; } /* 초기 자본 줄은 남기고 설명만 숨긴다 */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ───────── 아이돌 로스터 (기획사 서류철 안의 아티스트 카드) ───────── */
.idol-roster { display: grid; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--ink); }
.idol-pool { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-s); color: var(--ink-2); background: var(--paper-2); padding: 8px 10px; }
.idol-pool b { color: var(--ink); }
.idol-pool .idol-btns { margin-left: auto; }
.idol-card { background: #fff; border: 1px solid var(--rule); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); padding: 10px 12px; display: grid; gap: 6px; }
.idol-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.idol-head b { font-family: var(--display); font-weight: 400; font-size: var(--fs-xl); letter-spacing: 0.02em; }
.idol-stage { font-size: var(--fs-xs); font-weight: 800; padding: 1px 8px; border: 1.5px solid currentColor; border-radius: 10px; white-space: nowrap; color: var(--ink-2); }
.idol-stage.s-trainee, .idol-stage.s-prep { color: var(--ink-3); }
.idol-stage.s-rookie { color: var(--pen); }
.idol-stage.s-hot { color: var(--gain); background: var(--gain-soft); }
.idol-stage.s-top { color: #8a5a00; background: #fbefc7; }
.idol-stage.s-legend { color: #fff; background: var(--seal); border-color: var(--seal); }
.idol-stage.s-hiatus, .idol-stage.s-disbanded { color: var(--ink-3); text-decoration: line-through; }
.idol-meta { font-size: var(--fs-s); color: var(--ink-2); }
.idol-meta em { color: var(--seal); font-style: normal; font-weight: 700; }
.idol-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 4px 12px; }
.idol-member { display: grid; grid-template-columns: minmax(0, 72px) minmax(0, 1fr); gap: 6px; align-items: center; font-size: var(--fs-xs); padding: 3px 0; border-bottom: 1px dotted var(--rule-soft); }
.idol-member span:first-child { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idol-member small { display: block; color: var(--ink-3); font-weight: 400; }
.idol-member.away { opacity: 0.5; }
.idol-stats { display: grid; gap: 2px; }
.idol-stat { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px; align-items: center; font-size: 10px; color: var(--ink-3); }
.idol-stat i { font-style: normal; }
.idol-stat b { display: block; height: 5px; background: var(--pen); border-radius: 1px; box-shadow: 0 0 0 1px var(--pen-soft); }
.idol-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.idol-btns button { font-size: var(--fs-xs); padding: 3px 9px; box-shadow: 1px 1px 0 var(--ink); }
.idol-btns button small { color: var(--seal); margin-left: 4px; letter-spacing: 1px; }
@media (max-width: 760px) {
  .idol-pool .idol-btns { margin-left: 0; }
  .idol-btns button { min-height: 44px; }
  .idol-stat { font-size: 12px; }
}

/* 긴 제목: 상단 로고는 넓을 때만 전체, 좁으면 도장만 */
.brand-name { font-size: var(--fs-l); white-space: nowrap; }
@media (max-width: 1100px) { .brand-name { display: none; } }
@media (max-width: 560px) {
  .cover-facts { gap: 12px; }
  .cover-facts b { font-size: 22px; }
  .cover-facts span { font-size: var(--fs-xs); }
}

/* ───────── ⚙ 설정 시트 · 빠른 음소거 (audio.js) ───────── */
.topright .snd-t { display: none; } /* 넓은 화면 상단 바의 음소거는 아이콘만 */
#top button.snd-tg { min-width: 36px; font-size: 15px; line-height: 1.2; padding-inline: 8px; }
#top button.set-btn { white-space: nowrap; }
/* 소리 켜짐이 기본이라 '눌린' 색으로 칠하지 않는다 · 꺼지면 붉은 테두리 */
#top button[data-snd="mute"][aria-pressed="true"], .snd-fab button[aria-pressed="true"] { background: var(--night-2); color: var(--on-night); border-color: #2c4a40; font-weight: inherit; }
#top button[data-snd="mute"][aria-pressed="false"], .snd-fab button[aria-pressed="false"] { color: #ffb4ab; border-color: #8a3a33; }
.snd-fab { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: max(12px, env(safe-area-inset-right, 0px)); z-index: 35; display: flex; }
body.in-game .snd-fab { display: none; }
.snd-fab button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px; background: var(--night-2); color: var(--on-night); border: 1px solid #2c4a40; border-radius: 0; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.7); font-size: 18px; line-height: 1; }
.snd-fab button:first-child { border-radius: 3px 0 0 3px; }
.snd-fab button:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }
@media (hover: hover) { .snd-fab button:hover:not(:disabled) { background: #24413a; } }
.set-group { display: grid; gap: 2px; margin: 14px 0 6px; }
.set-group h3 { font-family: var(--doc); font-weight: 800; font-size: var(--fs-l); border-bottom: 2px solid var(--ink); padding-bottom: 4px; margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 0; border-bottom: 1px solid var(--rule-soft); }
.set-row > span { display: grid; min-width: 0; }
.set-row small { color: var(--ink-3); font-size: var(--fs-xs); }
.set-row button { flex: none; min-height: 44px; }
/* 켜기 스위치: 체크박스를 알약 모양으로 */
.set-sw { cursor: pointer; }
.set-sw input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: 30px; margin: 0; padding: 0; border: 2px solid var(--ink-2); border-radius: 15px; background: var(--paper-3); cursor: pointer; transition: background 0.15s; }
.set-sw input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.set-sw input[type=checkbox]:checked { background: var(--gain); border-color: var(--gain); }
.set-sw input[type=checkbox]:checked::after { transform: translateX(22px); }
.set-vol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 2fr) 34px; padding-left: 14px; }
.set-vol > span { font-size: var(--fs-s); color: var(--ink-2); }
.set-vol input[type=range] { height: 44px; padding: 0; margin: 0; border: none; background: none; accent-color: var(--pen); }
.set-vol output { font-family: var(--mono); text-align: right; color: var(--ink-2); }
.set-vol.off { opacity: 0.5; }
@media (max-width: 760px), (max-height: 500px) and (orientation: landscape) {
  .top-in:has(> .top-more) .topright .snd-t { display: inline; } /* ⋯ 메뉴 안에서는 글자도 */
  .topright > .set-btn { flex: 1 1 100%; } /* ⋯ 메뉴 맨 위 한 줄 */
}

/* 경쟁사 칸 (rivals.js rivalHTML) */
.rival-box { margin: 12px 0 0; padding: 8px 10px; background: var(--paper-2); border-left: 3px solid var(--seal); font-size: var(--fs-s); color: var(--ink-2); }
.rival-box .rv-head { display: grid; gap: 2px; }
.rival-box .rv-head small { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.rival-box .rv-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.rival-box .rv-item { display: grid; gap: 3px; min-width: 0; padding-top: 6px; border-top: 1px solid var(--rule-soft); }
.rival-box .rv-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0; }
.rival-box .rv-top .badge { margin-left: 0; vertical-align: baseline; }
.rival-box .rv-name { color: var(--ink); overflow-wrap: anywhere; }
.rival-box .rv-str { margin-left: auto; font-family: var(--mono); color: var(--ink); }
.rival-box .rv-bar .track { display: block; height: 9px; position: relative; overflow: hidden; background: var(--paper); border: 1px solid var(--ink-2); border-radius: 1px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(27, 32, 35, 0.22) calc(10% - 1px) 10%); }
.rival-box .rv-bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--seal); }
.rival-box .rv-item small { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.rival-box .rv-scout { color: var(--pen); }

/* 아이돌 매달 계약 수입 (idol_deals.js dealsLine) */
.idol-deals { overflow-wrap: anywhere; color: var(--pen); }
/* ===== 도감 + 엔딩 공유 카드 (dex-share) ===== */
.form-head .dex-btn { margin-left: auto; padding: 4px 12px; font-size: var(--fs-s); }
.dex-line { color: var(--pen); }
.dex-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.dex-list { display: grid; gap: 6px; max-height: 62vh; overflow: auto; }
.dex-cat { border: 1px solid var(--rule); background: var(--paper); }
.dex-cat > summary { cursor: pointer; padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 8px; align-items: center; font-weight: 700; font-size: var(--fs-m); list-style: none; }
.dex-cat > summary::-webkit-details-marker { display: none; }
.dex-cname, .dex-iname { overflow-wrap: anywhere; min-width: 0; }
.dex-num { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); text-align: right; white-space: nowrap; }
.dex-bar { display: block; height: 8px; border: 1px solid var(--ink-2); background: var(--paper-2); position: relative; overflow: hidden; }
.dex-bar i { position: absolute; inset: 0 auto 0 0; background: var(--gain); }
.dex-h .dex-bar { display: inline-block; width: 90px; vertical-align: middle; margin-left: 8px; }
.dex-inds { list-style: none; margin: 0; padding: 0 6px 6px; display: grid; gap: 2px; }
.dex-ind { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 5px 6px; border: 0; background: transparent; box-shadow: none; font-size: var(--fs-s); color: var(--ink-3); }
.dex-ind.on { color: var(--ink); }
@media (hover: hover) { .dex-ind:hover { background: var(--paper-2); } }
.dex-cards, .dex-ends { margin: 6px 0 12px; padding-left: 22px; font-size: var(--fs-s); display: grid; gap: 3px; }
.dex-ends { list-style: none; padding-left: 0; }
.dex-cards li.blank, .dex-ends li.blank { color: var(--ink-3); letter-spacing: 0.2em; }
.dex-cards li.seen, .dex-ends li.seen { color: var(--ink); overflow-wrap: anywhere; }
.dex-back { margin-bottom: 8px; padding: 4px 10px; font-size: var(--fs-s); }
.share-box { margin-top: 10px; }
.share-msg { margin: 6px 0 0; min-height: 1.3em; font-size: var(--fs-s); color: var(--ink-2); }
.share-text { width: 100%; margin-top: 6px; font-family: var(--mono); font-size: var(--fs-s); }
@media (max-width: 480px) {
  .dex-cat > summary, .dex-ind { grid-template-columns: minmax(0, 1fr) 48px auto; }
  .share-row button { flex: 1 1 100%; }
}
/* 오늘의 도전 (daily.js · ui.js beginDailyGame) */
.daily-card { margin-top: 18px; border-left: 4px solid var(--marker); }
.dc-lead { margin: 0 0 10px; color: var(--ink-2); font-size: var(--fs-s); }
.dc-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 10px; }
.dc-grid dt { color: var(--ink-3); white-space: nowrap; }
.dc-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dc-grid dd small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.dc-rec { margin: 0 0 12px; padding: 6px 10px; background: var(--paper-2); font-size: var(--fs-s); overflow-wrap: anywhere; }
.dc-rec small { color: var(--ink-3); }
.daily-badge { overflow: hidden; text-overflow: ellipsis; }
.daily-pick .rec-card { box-shadow: inset 4px 0 0 var(--marker); background: #fffbe0; }
.daily-note { margin: 0 0 6px; padding: 4px 8px; background: #fffbe0; border-left: 3px solid var(--marker); color: var(--ink-2); }
.daily-end { margin: 8px 0 0; padding: 6px 10px; background: #fffbe0; border-left: 3px solid var(--marker); color: var(--ink); font-weight: 700; font-size: var(--fs-s); overflow-wrap: anywhere; }
@media (max-width: 760px) { .daily-badge { max-width: 9em; } }
/* ───── 핵심 인력 칸 (crew.js crewHTML) ───── */
.crew-box { margin: 12px 0 0; padding: 8px 10px; background: var(--paper-2); border-left: 3px solid var(--pen); font-size: var(--fs-s); color: var(--ink-2); }
.crew-box .cw-head { display: grid; gap: 2px; }
.crew-box .cw-head small { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.crew-box .cw-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.crew-box .cw-item { display: grid; gap: 3px; min-width: 0; padding-top: 6px; border-top: 1px solid var(--rule-soft); }
.crew-box .cw-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0; }
.crew-box .cw-top .badge { margin-left: 0; vertical-align: baseline; }
.crew-box .cw-name { color: var(--ink); overflow-wrap: anywhere; }
.crew-box .cw-eff { margin-left: auto; font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); }
.crew-box .cw-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.crew-box .cw-bars label { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 4px 6px; font-size: var(--fs-xs); color: var(--ink-3); min-width: 0; }
.crew-box .cw-bars b { font-family: var(--mono); color: var(--ink); }
.crew-box .cw-bars b.neg { color: var(--seal); }
.crew-box .cw-bar .track { display: block; height: 9px; position: relative; overflow: hidden; background: var(--paper); border: 1px solid var(--ink-2); border-radius: 1px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(27, 32, 35, 0.22) calc(10% - 1px) 10%); }
.crew-box .cw-bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--pen); }
.crew-box .cw-bar .fill.loy { background: var(--ink-2); }
.crew-box .cw-bar .fill.loy.low { background: var(--seal); }
.crew-box .cw-item small, .crew-box .cw-gone { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.crew-box .cw-gone { display: block; margin-top: 6px; }
@media (max-width: 480px) { .crew-box .cw-bars { grid-template-columns: minmax(0, 1fr); } .crew-box .cw-eff { margin-left: 0; width: 100%; } }
/* ───── 클럽 운영 칸 (club.js clubHTML) ───── */
.club-box { margin: 12px 0 0; padding: 8px 10px; background: var(--paper-2); border-left: 3px solid var(--marker); font-size: var(--fs-s); color: var(--ink-2); display: grid; gap: 6px; }
.club-box .cl-head { display: grid; gap: 2px; }
.club-box .cl-head small { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.club-box .cl-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
.club-box .cl-bars.cl-risk { grid-template-columns: minmax(0, 1fr); }
.club-box .cl-bars label { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 4px 6px; font-size: var(--fs-xs); color: var(--ink-3); min-width: 0; }
.club-box .cl-bars b { font-family: var(--mono); color: var(--ink); }
.club-box .cl-bars b.neg { color: var(--seal); }
.club-box .cl-bar .track { display: block; height: 9px; position: relative; overflow: hidden; background: var(--paper); border: 1px solid var(--ink-2); border-radius: 1px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(27, 32, 35, 0.22) calc(10% - 1px) 10%); }
.club-box .cl-bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--pen); }
.club-box .cl-bar .fill.low, .club-box .cl-bar .fill.hot { background: var(--seal); }
.club-box .cl-bar .fill.warm { background: var(--marker); }
.club-box .cl-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.club-box .cl-chips .badge { margin-left: 0; vertical-align: baseline; overflow-wrap: anywhere; }
.club-box .cl-line, .club-box .cl-warn { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.club-box .cl-warn { color: var(--seal); font-weight: 700; }
@media (max-width: 480px) { .club-box .cl-bars { grid-template-columns: minmax(0, 1fr); } }
/* 엔딩 조건 창 */
.end-guide-btn { margin-left: 6px; padding: 1px 10px; font-size: var(--fs-xs); vertical-align: baseline; }
.eg-sig { margin: 6px 0; padding: 6px 10px; background: var(--paper-2); border-left: 3px solid var(--rule); color: var(--ink-2); font-size: var(--fs-s); overflow-wrap: anywhere; }
.eg-sig.me { border-left-color: var(--pen); color: var(--ink); font-weight: 700; }
.eg-nowline { margin: 6px 0; padding: 6px 10px; background: var(--paper-2); border-left: 3px solid var(--marker); font-size: var(--fs-s); color: var(--ink); overflow-wrap: anywhere; }
.eg-nowline small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.eg-h { margin: 14px 0 6px; font-size: var(--fs-m); }
.eg-count { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; }
.eg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eg-card { display: grid; gap: 4px; min-width: 0; padding: 8px 10px; border: 1px solid var(--rule); background: var(--paper); }
.eg-card.now { border-color: var(--pen); background: var(--pen-soft); box-shadow: inset 3px 0 0 var(--pen); }
.eg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.eg-top .badge { margin-left: 0; vertical-align: baseline; }
.eg-thumb { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--rule); }
.eg-name { font-weight: 800; font-size: var(--fs-m); overflow-wrap: anywhere; min-width: 0; }
.eg-tone.good { color: var(--gain); }
.eg-tone.bad { color: var(--seal); }
.eg-tone.neutral { color: var(--ink-2); }
.eg-now { color: var(--ink); background: var(--marker); border-color: var(--ink-2); }
.eg-cond, .eg-types, .eg-rule { margin: 0; font-size: var(--fs-s); color: var(--ink-2); overflow-wrap: anywhere; }
.eg-types, .eg-rule { color: var(--ink-3); font-size: var(--fs-xs); }
.eg-checks { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; }
.eg-checks li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 6px; font-size: var(--fs-xs); color: var(--ink-2); min-width: 0; }
.eg-checks .eg-label, .eg-checks .eg-val { overflow-wrap: anywhere; min-width: 0; }
.eg-checks .eg-val { grid-column: 2; color: var(--ink-3); font-family: var(--mono); }
.eg-checks li.ok .eg-label { color: var(--gain); font-weight: 700; }
details.eg-more { margin-top: 12px; border: 1px solid var(--rule); background: var(--paper); }
details.eg-more > summary { cursor: pointer; padding: 8px 10px; font-weight: 700; font-size: var(--fs-m); }
details.eg-more > .eg-list { padding: 0 8px 8px; }

/* ───────── 사업 엔딩 ───────── */
.biz-end { display: grid; gap: 10px; min-width: 0; }
.be-kicker { margin: 0; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; color: var(--ink-3); }
.biz-end .endphoto { margin: 0; }
.be-name { font-family: var(--display); font-weight: 400; font-size: var(--fs-2xl, var(--fs-xl)); line-height: 1.1; padding-right: 0; overflow-wrap: anywhere; }
.biz-end.good .be-name { color: var(--gain); }
.biz-end.bad .be-name { color: var(--seal); }
.be-sub { margin: 0; font-weight: 800; color: var(--ink-2); overflow-wrap: anywhere; }
.be-text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.be-count { margin: 0; }
.be-ask { margin: 4px 0 0; font-family: var(--doc); font-weight: 800; font-size: var(--fs-l); }
.biz-end .btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.biz-end .btnrow .big { flex: 1 1 200px; min-width: 0; }
.end-biz { display: grid; gap: 6px; }
.end-biz h3 { margin: 0; }
.be-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.be-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--rule); background: var(--receipt); }
.be-row.good { box-shadow: inset 3px 0 0 var(--gain); }
.be-row.bad { box-shadow: inset 3px 0 0 var(--seal); }
.be-thumb { width: 64px; aspect-ratio: 192 / 108; object-fit: cover; background: var(--paper-3); border: 1px solid var(--rule); }
.be-row div { min-width: 0; }
.be-row b { display: block; overflow-wrap: anywhere; }
.be-row small { display: block; color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.end-note { margin: 0; }
.eg-top .eg-here { color: var(--ink); background: var(--pen-soft); border-color: var(--pen); }
