:root {
  --bg: #0b0b1e; --win1: #1c2c8e; --win2: #0a1250; --txt: #fff; --accent: #ffd34d; --danger: #ff6b6b; --ok: #7dff8a; --warn: #ffb347; --dim: #b8c0e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--txt); font-family: 'DotGothic16', 'Hiragino Kaku Gothic ProN', monospace; font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: none; overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; padding: 8px; gap: 8px; }
#main { display: flex; gap: 8px; flex: 1; min-height: 0; }
#stage { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: center; width: 768px; max-width: 60vw; height: 100%; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; border: 4px solid #fff; box-shadow: 0 0 0 3px #000, 0 0 0 5px #fff; background: #000; }
#side { flex: 1; min-width: 380px; display: flex; flex-direction: column; min-height: 0; }
#tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
#panel { overflow-y: auto; flex: 1; padding-right: 4px; }
.win {
  background: linear-gradient(var(--win1), var(--win2)); border: 4px double #fff; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000; border-radius: 6px; padding: 8px;
}
#topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-height: 48px; }
.tb-group { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tb-date { color: var(--accent); }
.tb-time { font-size: 20px; }
button {
  font-family: inherit; font-size: 15px; background: #1c2c8e; color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 2px #000; padding: 4px 10px; cursor: pointer; border-radius: 3px; line-height: 1.3;
}
button:hover { background: #3a4ad0; }
button.on, .tab.on { background: var(--accent); color: #000; border-color: #000; }
button.primary { background: #2a7a3a; }
button.primary:hover { background: #3aa04a; }
button:disabled { opacity: 0.4; cursor: default; }
.tab { padding: 3px 8px; font-size: 14px; position: relative; }
.badge { display: none; margin-left: 4px; background: var(--danger); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 12px; }
.badge.on { display: inline-block; }
h2 { margin: 0 0 8px; font-size: 20px; color: var(--accent); }
h3 { margin: 12px 0 4px; font-size: 16px; color: var(--accent); border-bottom: 2px dotted #fff8; padding-bottom: 2px; }
h3:first-child { margin-top: 0; }
p { margin: 4px 0; }
.small { font-size: 13px; }
.dim { color: var(--dim); }
.neg { color: var(--danger); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.tag { display: inline-block; font-size: 12px; padding: 0 6px; border: 1px solid #fff; border-radius: 3px; margin-left: 4px; }
.tag.ok { border-color: var(--ok); color: var(--ok); }
.tag.warn { border-color: var(--warn); color: var(--warn); }
table { border-collapse: collapse; width: 100%; }
table.kv td { padding: 1px 4px; vertical-align: top; }
table.kv td:first-child { color: var(--dim); white-space: nowrap; width: 40%; }
table.grid th, table.grid td { border: 1px solid #fff5; padding: 2px 5px; font-size: 13px; text-align: right; }
table.grid th:first-child, table.grid td:first-child { text-align: left; }
table.grid th { background: #ffffff22; }
table.detail tr.drug td { color: #cfe6ff; }
table.detail tr.sum td { border-top: 2px solid #fff; font-weight: bold; }
.card { border: 2px solid #fff8; border-radius: 4px; padding: 6px 8px; margin: 6px 0; background: #00000033; }
.card.k-ok { border-color: var(--ok); } .card.k-warn { border-color: var(--warn); } .card.k-danger { border-color: var(--danger); background: #ff000022; }
.row { display: flex; justify-content: space-between; gap: 8px; }
.list .row { padding: 2px 4px; cursor: pointer; border-bottom: 1px dotted #fff4; }
.list .row:hover { background: #ffffff22; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.btns.col { flex-direction: column; align-items: center; }
.log div { font-size: 13px; padding: 1px 0; border-bottom: 1px dotted #fff2; }
.log .l-warn { color: var(--warn); } .log .l-money { color: #cfe6ff; } .log .l-ok { color: var(--ok); } .log .l-danger { color: var(--danger); }
.inbox .msg { padding: 4px 6px; cursor: pointer; border-bottom: 1px dotted #fff4; }
.inbox .msg:hover { background: #ffffff22; }
.inbox .msg.read { color: var(--dim); }
.inbox .msg.k-danger:not(.read) { color: var(--danger); } .inbox .msg.k-warn:not(.read) { color: var(--warn); } .inbox .msg.k-ok:not(.read) { color: var(--ok); }
input[type=range] { width: 100%; }
select, input[type=text] { font-family: inherit; font-size: 15px; background: #0a1250; color: #fff; border: 2px solid #fff; padding: 3px 6px; }
/* modal */
#modal-root .modal-bg { position: fixed; inset: 0; background: #00000088; display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: min(760px, 94vw); max-height: 92vh; overflow-y: auto; padding: 14px 16px; }
.modal pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0; }
.letter h2 { color: #fff; }
.letter.k-danger h2 { color: var(--danger); } .letter.k-warn h2 { color: var(--warn); } .letter.k-ok h2 { color: var(--ok); } .letter.k-money h2 { color: #cfe6ff; }
.choices { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.choices button { text-align: left; padding: 8px 12px; }
.two { display: flex; gap: 12px; }
.two table { flex: 1; }
.title { text-align: center; padding: 20px 0; }
.logo { font-size: 44px; color: var(--accent); text-shadow: 4px 4px 0 #000, -2px -2px 0 #000; letter-spacing: 2px; margin-bottom: 6px; }
.sub { font-size: 18px; margin-bottom: 20px; }
.title .btns button { width: 240px; font-size: 18px; padding: 8px; }
/* 処方箋 */
.rx-modal { width: min(900px, 96vw); }
.rx-wrap { display: flex; gap: 12px; }
.paper { flex: 1.3; background: #fbf6ea; color: #14141c; border: 3px solid #14141c; padding: 8px 10px; font-size: 14px; }
.paper .paper-head { display: flex; justify-content: space-between; font-size: 20px; letter-spacing: 6px; border-bottom: 2px solid #14141c; margin-bottom: 6px; }
.paper table.kv td:first-child { color: #555; width: auto; }
.paper .rp { border: 1px solid #14141c; padding: 6px 8px; margin: 6px 0; min-height: 90px; font-size: 14px; }
.paper .warn { color: #c00; }
.side-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.speech { background: #fff; color: #14141c; border-radius: 12px; padding: 6px 10px; position: relative; border: 2px solid #14141c; }
.rx-btns button { font-size: 14px; }
#rx-result .card { margin: 4px 0; }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 60; background: #1c2c8e; border: 3px double #fff; box-shadow: 0 0 0 2px #000; padding: 8px 14px; margin-top: 6px; animation: pop .2s; }
#toast-root { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 60; }
#toast-root .toast { position: static; }
.toast.k-ok { border-color: var(--ok); } .toast.k-warn { border-color: var(--warn); color: var(--warn); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#panel::-webkit-scrollbar, .modal::-webkit-scrollbar { width: 10px; }
#panel::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb { background: #fff8; border: 2px solid #000; }
@media (max-width: 1100px) {
  #main { flex-direction: column; overflow-y: auto; }
  #stage { width: 100%; max-width: 100%; height: auto; }
  #side { min-width: 0; min-height: 400px; }
}

table.pl td:nth-child(2), table.pl td:nth-child(4) { text-align: right; white-space: nowrap; }
table.pl tr.sum td { font-weight: bold; border-top: 2px solid #fff; background: #ffffff11; }

/* カットイン */
.cutin-bg { animation: cutflash .35s; }
@keyframes cutflash { 0% { filter: brightness(3); } 100% { filter: brightness(1); } }
.cutin { position: relative; display: flex; align-items: center; gap: 24px; width: min(760px, 94vw); padding: 24px 28px; border: 6px double #fff; box-shadow: 0 0 0 4px #000; background: linear-gradient(90deg, #00000088, #00000044); overflow: hidden; animation: cutslide .3s ease-out; }
@keyframes cutslide { from { transform: translateX(-80px) skewX(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cutin-stripes { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 18px, #ffffff12 18px 36px); animation: stripes 1.2s linear infinite; pointer-events: none; }
@keyframes stripes { from { background-position: 0 0; } to { background-position: 51px 0; } }
.cutin-face { width: 192px; height: 192px; image-rendering: pixelated; flex: 0 0 auto; border: 4px solid #fff; background: #ffffff22; animation: bounce .6s infinite alternate; }
@keyframes bounce { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
.cutin-body { flex: 1; }
.cutin-name { font-size: 34px; color: var(--accent); text-shadow: 3px 3px 0 #000; letter-spacing: 2px; }
.cutin.good .cutin-name { color: var(--ok); } .cutin.bad .cutin-name { color: var(--danger); }
.cutin-text { font-size: 20px; margin: 10px 0; text-shadow: 2px 2px 0 #000; }
.cutin-effect { font-size: 16px; color: #fff; background: #000000aa; padding: 6px 10px; border-left: 4px solid var(--accent); }

/* 決算画面 */
.fiscal-modal .modal { border-color: var(--accent); box-shadow: 0 0 0 2px #000, 0 0 40px #ffd34d66; background: linear-gradient(#2a1a5e, #0a0a30); }
.fiscal-title { font-size: 30px; color: var(--accent); text-shadow: 3px 3px 0 #000; text-align: center; letter-spacing: 2px; animation: cutslide .4s ease-out; }
.fiscal-sub { text-align: center; color: var(--dim); margin-bottom: 10px; }
.fiscal-table { width: 100%; border-collapse: collapse; }
.fiscal-table td { padding: 3px 8px; border-bottom: 1px dotted #fff4; font-size: 18px; }
.fiscal-table td.num { text-align: right; font-size: 22px; white-space: nowrap; min-width: 200px; }
.fiscal-row { opacity: 0; animation: rowin .3s forwards; }
@keyframes rowin { to { opacity: 1; } }
.fiscal-side { margin: 8px 0; color: var(--dim); }
.fiscal-rank { display: flex; align-items: center; gap: 16px; margin: 10px 0; opacity: 0; animation: rankin .5s forwards; }
@keyframes rankin { 0% { opacity: 0; transform: scale(2.5) rotate(-10deg); } 70% { opacity: 1; transform: scale(0.9); } 100% { opacity: 1; transform: none; } }
.rank { font-size: 64px; width: 96px; height: 96px; display: inline-flex; align-items: center; justify-content: center; border: 5px solid; border-radius: 50%; text-shadow: 3px 3px 0 #000; flex: 0 0 auto; }
.rank-S { color: #ffd34d; border-color: #ffd34d; } .rank-A { color: #7dff8a; border-color: #7dff8a; } .rank-B { color: #82a8f2; border-color: #82a8f2; } .rank-C { color: #ffb347; border-color: #ffb347; } .rank-D { color: #ff6b6b; border-color: #ff6b6b; }
.fiscal-comment { font-size: 18px; }

.bank { margin-top: 6px; color: #cfe6ff; }
.cutin-news { display: flex; align-items: center; justify-content: center; font-size: 96px; }
.rank-inline { display: inline-block; font-weight: bold; padding: 0 8px; border: 2px solid; border-radius: 4px; }
.ending-title { font-size: 40px; text-align: center; color: var(--accent); text-shadow: 3px 3px 0 #000; margin: 10px 0; animation: rankin .6s; }
.ending p { font-size: 18px; text-align: center; }

/* ===== スマホ ===== */
.m-only { display: none; }
@media (max-width: 760px) {
  .m-hide { display: none !important; }
  .m-only { display: inline-block; }
  #app { padding: 4px; gap: 4px; height: 100dvh; }
  #topbar { min-height: 0; padding: 4px 6px; font-size: 13px; gap: 2px 8px; }
  #topbar .tb-group { gap: 6px; }
  .tb-time { font-size: 15px; }
  #topbar button { min-height: 34px; padding: 2px 8px; font-size: 14px; }
  #main { flex-direction: column; overflow: hidden; gap: 4px; }
  #stage { width: 100%; max-width: 100%; height: auto; flex: 0 0 auto; }
  /* 店舗の画面だけを画面幅いっぱいにする。カットインの顔(.cutin-face)も canvas なので、
     ここを canvas 全体に掛けると 128px 指定が !important で上書きされ、顔が 356px に広がって
     カットイン全体(467px)が画面幅(375px)を超える。左に126pxはみ出し、閉じるボタンの左半分が
     画面外に出ていた(文字数が増えればボタンごと画面外に出て、閉じられなくなる) */
  #stage canvas { width: 100% !important; height: auto !important; border-width: 2px; box-shadow: 0 0 0 2px #000; }
  #side { min-width: 0; flex: 1; min-height: 0; padding: 4px 6px; }
  #tabs { order: 2; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); margin: 0; scrollbar-width: none; }
  #tabs::-webkit-scrollbar { display: none; }
  #tabs .tab { flex: 0 0 auto; padding: 10px 12px; font-size: 15px; min-height: 42px; }
  #panel { order: 1; padding-right: 0; }
  button { min-height: 42px; font-size: 16px; padding: 6px 12px; }
  .btns { gap: 8px; }
  .btns button { flex: 1 1 auto; }
  input[type=number], select { min-height: 40px; font-size: 16px; }
  input[type=range] { height: 40px; }
  #modal-root .modal-bg { align-items: stretch; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; border-width: 0 0 4px 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .rx-modal { width: 100vw; }
  .rx-wrap { flex-direction: column; gap: 8px; }
  .paper { font-size: 13px; padding: 6px 8px; }
  .paper .paper-head { font-size: 17px; letter-spacing: 3px; }
  .paper .rp { min-height: 0; font-size: 13px; }
  .rx-btns button { flex: 1 1 45%; font-size: 14px; min-height: 44px; }
  .cutin { flex-direction: column; text-align: center; padding: 14px; gap: 10px; }
  .cutin-face { width: 128px; height: 128px; }
  .cutin-name { font-size: 26px; } .cutin-text { font-size: 17px; }
  .two { flex-direction: column; gap: 4px; }
  .fiscal-title { font-size: 22px; } .fiscal-table td { font-size: 15px; padding: 2px 4px; } .fiscal-table td.num { min-width: 0; font-size: 17px; }
  .rank { font-size: 44px; width: 68px; height: 68px; }
  table.grid th, table.grid td { font-size: 12px; padding: 2px 3px; }
  table.kv td { font-size: 14px; }
  h3 { font-size: 15px; } .log div { font-size: 13px; }
  .logo { font-size: 30px; } .title .btns button { width: 100%; }
  #toast-root { left: 8px; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); }
}

.card.explain { border-color: var(--accent); background: #ffd34d14; }

.ma-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; text-align: left; }
.ma-btn { text-align: left; white-space: normal; line-height: 1.3; }
.title .btns .ma-list button { width: 100%; font-size: 15px; }

.diff-pick { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 6px 0; }
.diff-opt { display: block; border: 2px solid #fff8; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.diff-opt:has(input:checked) { border-color: var(--accent); background: #ffd34d14; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.ach { border: 2px solid #fff4; padding: 4px 6px; font-size: 13px; opacity: 0.55; border-radius: 4px; }
.ach.on { opacity: 1; border-color: var(--accent); background: #ffd34d12; }
.card-modal .modal { max-width: 520px; border-color: var(--accent); background: linear-gradient(#1a2a8a, #0a1250 60%, #2a1a5e); box-shadow: 0 0 0 2px #000, 0 0 30px #ffd34d55; }
.card-screen { text-align: center; padding: 6px; }
.card-title { font-size: 14px; color: var(--dim); letter-spacing: 3px; }
.card-name { font-size: 30px; color: var(--accent); text-shadow: 3px 3px 0 #000; margin: 4px 0; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.card-grid > div { border: 2px solid #fff6; padding: 6px; border-radius: 4px; background: #00000044; }
.card-k { font-size: 12px; color: var(--dim); } .card-v { font-size: 22px; }
.card-titles { margin: 6px 0 10px; }

.news-modal .modal { max-width: 720px; }
.paper.news { background: #f4efe2; color: #14141c; border: 3px solid #14141c; padding: 10px 14px; }
.news-head { display: flex; justify-content: space-between; border-bottom: 3px double #14141c; font-size: 22px; letter-spacing: 4px; margin-bottom: 6px; }
.news-headline { font-size: 24px; font-weight: bold; margin: 6px 0; line-height: 1.3; }
.news-subs { font-size: 14px; border-top: 1px solid #14141c; border-bottom: 1px solid #14141c; padding: 4px 0; margin-bottom: 6px; }
.news-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.news-cols > div { border-top: 1px dotted #14141c; padding-top: 4px; }
@media (max-width: 760px) { .news-cols { grid-template-columns: 1fr; } .news-headline { font-size: 19px; } }

.spot-row { cursor: pointer; } .spot-row:hover td { background: #2a3a8a; }
.memo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.memo { min-height: 56px; font-size: 12px; padding: 4px; white-space: normal; line-height: 1.2; }
.memo.open { background: #2a5aa0; } .memo.done { background: #1f6b3a; opacity: 0.7; }

.bar { height: 8px; background: #0a1250; border: 1px solid #fff; margin: 3px 0 6px; } .bar > div { height: 100%; background: #48b352; } .bar.warn > div { background: #d94040; }

/* 疑義照会の理由選択 */
.pick { margin-top: 6px; }
.pick > b { display: block; margin-bottom: 6px; }
.target-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.target-btns button { min-height: 40px; text-align: left; font-size: .9em; padding: 6px 8px; }
.target-btns button .small { display: block; }
.topic-btns { gap: 4px; }
.topic-btns .counsel-btn { min-height: 44px; }

/* 折りたたみ */
.detail-btn { display: inline-block !important; width: auto !important; min-height: 24px !important; float: right; font-size: .75em; padding: 2px 8px; min-height: 24px; margin-left: 6px; }
.opt-sum { display: inline; }
.opt-desc[hidden] { display: none !important; }
.opt-desc { margin-top: 4px; }
details.acc { border: 1px solid #fff3; border-radius: 4px; margin: 6px 0; padding: 2px 8px; }
details.acc > summary { cursor: pointer; padding: 6px 0; list-style: none; }
details.acc > summary::before { content: '▸ '; }
details.acc[open] > summary::before { content: '▾ '; }

/* 説明文の折りたたみ・見やすさ */
body.nohints p.small.dim, body.nohints .opt-desc, body.nohints .card .desc:not(.open) + .hint-only { display: none; }
.card .desc { cursor: pointer; }
@media (max-width: 760px) {
  .card .desc:not(.open) { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .card .desc:not(.open)::after { content: ''; }
  .card .row > b { font-size: 16px; }
  .small { font-size: 14px; } table.kv td { font-size: 15px; } h3 { font-size: 17px; }
  details.acc > summary { font-size: 17px; padding: 12px 4px; background: #ffffff10; border-radius: 4px; margin: 0 -4px; }
  .diff-opt b { font-size: 17px; }
  .loan-pick select { min-height: 40px; }
}
details.acc > summary { user-select: none; }
.loan-pick { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 4px 0; }

/* 投薬ポップアップ・スキル・シナジー */
.counsel-btns .counsel-btn, .topic-btns .counsel-btn { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; width: 100%; padding: 8px 10px; }
.counsel-btns .counsel-btn span, .topic-btns .counsel-btn span { white-space: normal; }
.tag.skill { background: #2a4a8a; color: #dfe8ff; }
.card-syn { grid-column: 1 / -1; margin-top: 4px; }

/* 経営タブ(かんたん) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 6px 0; }
.tile { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 6px 8px; }
.tile-k { font-size: 11px; opacity: 0.7; } .tile-v { font-size: 15px; margin-top: 2px; }
.move { margin: 3px 0; } .move button { margin-left: 4px; }

/* タイトル: 名前欄 */
.name-box { border: 2px solid #f8d94a; border-radius: 8px; padding: 8px 10px; margin: 8px 0; background: rgba(248,217,74,0.06); }
.name-title { font-weight: bold; color: #f8d94a; margin-bottom: 4px; }
.name-input { font-size: 18px; padding: 8px 10px; width: 100%; box-sizing: border-box; margin: 4px 0; }

/* 快適性: タップ対象を大きく */
#panel input[type=checkbox], #panel input[type=radio] { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }
#panel label { display: inline-block; padding: 5px 0; min-height: 30px; }
@media (max-width: 760px) {
  #panel input[type=checkbox], #panel input[type=radio] { width: 32px; height: 32px; vertical-align: -9px; }
  #panel label { padding: 8px 0; min-height: 40px; }
  #panel select, #panel input[type=number], #panel input[type=text] { min-height: 40px; font-size: 15px; }
}

/* タイトルをコンパクトに */
.title .name-box { border: 2px solid #f8d94a; padding: 6px; }
.title .diff-opt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; }
.title .diff-opt .opt-desc { flex-basis: 100%; }
.title .detail-btn { margin-left: auto; min-width: 28px; padding: 2px 8px; }
.title button.big { font-size: 18px; padding: 10px 24px; }
.title details.t-adv { margin: 8px 0; text-align: left; }
.title details.t-adv > summary { padding: 8px; cursor: pointer; }
.title .ma-btn { display: block; width: 100%; text-align: left; margin: 4px 0; }

/* ===== 設備タブ: 1設備1行の表 ===== */
#panel { container-type: inline-size; container-name: panel; }
.eq-budget { border: 1px solid #fff3; border-radius: 4px; padding: 4px 8px; margin: 4px 0; background: #00000033; }
.eq-advice { margin: 6px 0; }
.eq-advice .move button { margin-left: 4px; font-size: 13px; padding: 2px 8px; min-height: 32px; }
.eq-filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.eq-filters button { font-size: 13px; padding: 3px 10px; min-height: 34px; }
.eq-table { margin: 2px 0 4px; }
/* 既定は2段(狭い幅・スマホ)。横スクロールはさせない */
.eq-head { display: none; }
details.eq { border-bottom: 1px dotted #fff3; border-left: 4px solid transparent; }
details.eq > summary {
  display: grid; grid-template-columns: minmax(7em, 1fr) minmax(0, auto); grid-template-areas: "name price" "tags act";
  gap: 3px 8px; align-items: center; padding: 5px 4px; cursor: pointer; list-style: none; min-height: 44px;
}
details.eq > summary::-webkit-details-marker { display: none; }
details.eq:nth-of-type(even) > summary { background: #ffffff0a; }
details.eq > summary:hover { background: #ffffff1c; }
.eq-name { grid-area: name; min-width: 0; }
.eq-name::before { content: '▸ '; color: var(--dim); }
details.eq[open] .eq-name::before { content: '▾ '; }
.eq-name b { font-size: 15px; }
.eq-tags { grid-area: tags; min-width: 0; }
.eq-tags .tag { margin: 0 4px 0 0; }
.eq-price { grid-area: price; text-align: right; white-space: nowrap; }
.eq-mo { display: inline; font-size: 11px; margin-left: 4px; }
.eq-act { grid-area: act; display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.eq-act button { font-size: 13px; padding: 3px 10px; min-height: 34px; }
.eq-act .tag { margin-left: 0; white-space: normal; }
.eq-act { max-width: 100%; }
details.eq.st-own { border-left-color: var(--ok); }
details.eq.st-buy { border-left-color: #fff9; }
details.eq.st-dim { border-left-color: #fff3; }
details.eq.st-dim .eq-name b, details.eq.st-dim .eq-tags { color: var(--dim); }
details.eq.st-bad { border-left-color: var(--danger); background: #ff000014; }
details.eq.st-warn { border-left-color: var(--warn); }
.eq-body { padding: 4px 6px 8px 14px; background: #0000002e; }
.eq-body .eq-next { margin-top: 5px; }
/* パネルが広いときだけ4列(見出しつき) */
@container panel (min-width: 430px) {
  .eq-head, details.eq > summary {
    display: grid; grid-template-columns: minmax(6em, 1.7fr) minmax(4em, 1.4fr) 104px minmax(0, auto);
    grid-template-areas: "name tags price act"; gap: 2px 10px; align-items: center;
  }
  .eq-head { padding: 2px 4px 2px 8px; border-bottom: 1px solid #fff4; }
  .eq-head span:nth-child(1) { grid-area: name; } .eq-head span:nth-child(2) { grid-area: tags; }
  .eq-head span:nth-child(3) { grid-area: price; text-align: right; } .eq-head span:nth-child(4) { grid-area: act; text-align: right; }
  details.eq > summary { min-height: 38px; }
  .eq-mo { display: block; margin-left: 0; }
}
@media (max-width: 760px) {
  .eq-filters button { min-height: 38px; font-size: 14px; }
  .eq-advice .move button { min-height: 36px; }
  .eq-act button { min-height: 38px; font-size: 14px; }
  .eq-name b { font-size: 16px; }
}

/* UI整理: 折りたたみ・ログ・スタッフカード */
.desc-fold > summary { cursor: pointer; list-style: none; }
.desc-fold > summary::-webkit-details-marker { display: none; }
.desc-fold > summary .more { color: #8ab4f8; }
.staff-more > summary { cursor: pointer; padding: 6px 0; min-height: 36px; }
.card.staff { padding-bottom: 6px; }
.log-day { margin: 8px 0 2px; padding: 2px 6px; background: rgba(255,255,255,0.07); border-radius: 4px; font-weight: bold; }
#panel input[type=number] { width: 110px; max-width: 46%; }
@media (max-width: 760px) { #panel input[type=number] { width: 96px; } }

/* タイトルの DX */
.title .logo .dx{
  font-size:.58em; vertical-align:.32em; margin-left:.12em; letter-spacing:.04em;
  color:#f8d94a; text-shadow:0 2px 0 #a06010;
}

/* 週替わりシード・図鑑率(タイトル) */
.seed-row{display:flex;flex-direction:column;gap:4px;margin:8px 0 4px}
.seed-opt{display:flex;gap:6px;align-items:baseline;font-size:12px;cursor:pointer}
.zukan-rate{margin:2px 0 6px;letter-spacing:.04em}
/* 倒産画面のニアミスと遺産 */
.nearmiss{margin:8px 0;padding:8px 10px;border-left:3px solid #f2912e;background:rgba(242,145,46,.08);font-size:13px;line-height:1.7}
.legacy{margin:8px 0;padding:8px 10px;border:1px solid #f8d94a;background:rgba(248,217,74,.08);font-size:13px;line-height:1.6}
/* 鑑査コンボ(トップバー) */
.combo{font-weight:bold;margin-right:6px;color:#f2912e}
.combo.c1{color:#f8d94a}.combo.c2{color:#f2912e;text-shadow:0 0 6px rgba(242,145,46,.6)}.combo.c3{color:#ff5a5a;text-shadow:0 0 8px rgba(255,90,90,.8)}
/* 図鑑のレア度とヒント */
.rar{font-size:9px;margin-left:5px;padding:0 4px;border-radius:2px;vertical-align:1px;color:#fff;background:#6a7488}
.rar.R{background:#3a8f5f}.rar.SR{background:#8256c9}.rar.SSR{background:#d94040}
.ach .hint{margin-top:2px;font-size:10.5px;line-height:1.4}
.confirm-modal .confirm-msg{font-size:13.5px;line-height:1.7;margin:0 0 12px}

/* おまかせの見える化 */
.auto-chip { font-size: 12px; padding: 0 6px; min-height: 26px; border-color: var(--ok); color: var(--ok); background: transparent; }
.badge.auto { background: transparent; border: 1px solid var(--ok); color: var(--ok); }
.auto-card { border-color: var(--ok); }
.auto-list { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; font-size: 13px; }
.auto-list .ok, .auto-list .warn { display: inline-block; min-width: 4.5em; }
.auto-card details { margin-top: 6px; } .auto-card summary { cursor: pointer; opacity: 0.8; }
.intro-steps { padding-left: 1.4em; margin: 8px 0; } .intro-steps li { margin: 6px 0; }
@media (max-width: 760px) { .auto-chip { min-height: 34px; font-size: 13px; } }
.auto-card .row > .small { white-space: nowrap; }
/* LINE ログイン(任意、2026-09-29) */
.line-box { margin: 8px 0; padding: 6px 8px; border: 2px dashed rgba(255,255,255,.35); }
.line-box a, .panel a { color: #9fd0ff; }
button.line-btn { background: #06C755; color: #fff; border-color: #fff; }
.rank-table td:first-child { white-space: nowrap; }
.acct-note { color: #c9cfee; }
a.btn-link.line-btn { display: inline-block; padding: 6px 14px; background: #06C755; color: #fff; border: 2px solid #fff; text-decoration: none; }
