/* MONOFORCE デモ 共通スタイル
   構成は原価管理・在庫管理の実システムと同じ (上部ヘッダー + タブ / AIボード / 予測セル)。
   見せ場は各製品の最初の画面の「AI予兆」帯だけ。ほかは静かに、数字が読みやすいことを優先する。
   色: ロゴの藍 (#15124B) を地に、製品ごとの色 (製造=橙 / 原価=緑 / 在庫=青) を差し色に。
   AI予測は全製品共通で「青の点線 + 予」。
   文字: 本文 BIZ UDPGothic / 数字 Barlow Semi Condensed。 */
:root {
  --font-sans: 'BIZ UDPGothic', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  --font-num: 'Barlow Semi Condensed', 'BIZ UDPGothic', sans-serif;
  --font-mono: 'Barlow Semi Condensed', ui-monospace, Consolas, monospace;
  --indigo: #15124B;
  --indigo-2: #232584;
  --indigo-deep: #0E0C36;
  --paper: #F1F2F6;
  --surface: #FFFFFF;
  --ink: #1B1F2A;
  --ink-2: #5A6172;
  --ink-3: #9AA0AE;
  --line: #E2E5EC;
  --line-2: #EEF0F4;
  --crit: #D23B3B;
  --warn: #E08A1E;
  --watch: #C9A40C;
  --ok: #1E9E6A;
  --pred: #2B6FDB;
  --pred-bg: #EBF2FF;
  --pred-ink: #174EA6;
  --accent: #1667B4;
}
body.p-inventory { --accent: #1667B4; --accent-soft: #E7F0FA; }
body.p-cost { --accent: #16865A; --accent-soft: #E5F3EC; }
body.p-mfg { --accent: #C2561A; --accent-soft: #FBEEE5; }

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html, body { height: 100%; }
body { font-family: var(--font-sans); background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pred); outline-offset: 2px; }
.num, td.num, th.num { text-align: right; }
.num, .tbl td, .kpi .v, .totals b { font-variant-numeric: tabular-nums; }
.tbl td.num, .kpi .v, .totals b, .pred, .mono { font-family: var(--font-num); }
.mono { letter-spacing: .02em; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* ── ヘッダー ─────────────────────────── */
.mf-header { height: 52px; background: var(--indigo-deep); color: #fff; display: flex; align-items: stretch; position: sticky; top: 0; z-index: 20; }
.mf-brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 0 16px; text-decoration: none; flex-shrink: 0; }
.mf-brand img { height: 26px; background: #fff; border-radius: 5px; padding: 4px 5px; }
.mf-brand b { font-family: var(--font-num); font-weight: 700; font-size: 17px; letter-spacing: .06em; }
.mf-brand span { font-size: 14px; font-weight: 700; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.25); }
.mf-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.mf-tabs a { position: relative; display: flex; align-items: center; padding: 0 16px; color: rgba(255,255,255,.62); text-decoration: none; font-size: 13.5px; white-space: nowrap; cursor: pointer; transition: color .15s; }
.mf-tabs a:hover { color: #fff; }
.mf-tabs a.active { color: #fff; font-weight: 700; }
.mf-tabs a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.mf-right { margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 0 16px; font-size: 12px; color: rgba(255,255,255,.6); flex-shrink: 0; }
.mf-switch { display: flex; gap: 2px; background: rgba(255,255,255,.08); padding: 3px; border-radius: 8px; }
.mf-switch a { text-decoration: none; padding: 5px 12px; border-radius: 6px; color: rgba(255,255,255,.7); font-size: 12.5px; }
.mf-switch a:hover { color: #fff; }
.mf-switch a.on { background: #fff; color: var(--indigo); font-weight: 700; }
.mf-demo { border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 2px 8px; border-radius: 4px; }
@media (max-width: 900px) { .mf-right > span:last-child, .mf-brand span { display: none; } }

main.mf-main { padding: 20px 24px 40px; max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.mf-page { display: none; flex-direction: column; gap: 14px; }
.mf-page.on { display: flex; }
/* 予兆帯のある画面は、帯を画面幅いっぱいに */
.mf-page.on > .aihero:first-child { margin: -20px -24px 0; }

/* ── カード ─────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 14.5px; flex-wrap: wrap; }
.card-h .sub { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 12px; }
.card-b { padding: 14px 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-side { grid-template-columns: 300px minmax(0,1fr); }
.g-wide { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: 1fr 1fr; } .g2, .g3, .g-side, .g-wide { grid-template-columns: minmax(0,1fr); } }

/* KPI: 大きな数字が主役。色は左の小さな印だけ */
.kpi { padding: 14px 18px 14px; }
.kpi .k { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .k::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.kpi.crit .k::before { background: var(--crit); }
.kpi.warn .k::before { background: var(--warn); }
.kpi.ok .k::before { background: var(--ok); }
.kpi .v { font-size: 38px; font-weight: 600; line-height: 1.1; margin-top: 6px; letter-spacing: -.01em; }
.kpi .v small { font-family: var(--font-sans); font-size: 13px; font-weight: 400; margin-left: 4px; color: var(--ink-2); }
.kpi .v .pred { font-size: 38px; padding: 0 6px 0 4px; }
.kpi .v .pred .pm { font-size: 11px; }
.kpi .d { font-size: 12px; margin-top: 6px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi .d .pred { font-size: 14px; }
.up { color: var(--crit); } .down { color: var(--ok); }

/* 横一列の集計 (原価 TotalsCard 相当) */
.totals { display: flex; align-items: baseline; gap: 22px; padding: 12px 18px; font-size: 13px; flex-wrap: wrap; }
.totals .lbl { font-size: 12px; color: var(--ink-2); margin-right: 6px; }
.totals b { font-size: 19px; font-weight: 600; }
.totals .pred b { font-size: 19px; }
.totals .sep { display: none; }

/* ── ツールバー ─────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
.toolbar input[type=text] { flex: 1; min-width: 220px; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; background: #F7F8FB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239AA0AE' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 11px center; }
.toolbar input[type=text]:focus { outline: none; border-color: var(--accent); background-color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; gap: 4px; background: var(--paper); padding: 3px; border-radius: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 6px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); user-select: none; border: 0; background: none; }
.chip:hover { color: var(--ink); }
.chip.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(21,18,75,.12); }
.card-h .chip { background: var(--paper); }
.btn { padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 13px; cursor: pointer; }

/* ── 表 ─────────────────────────── */
.tbl-wrap { overflow: auto; border-radius: 0 0 10px 10px; }
.tbl-wrap.h-sm { max-height: 320px; } .tbl-wrap.h-md { max-height: 470px; } .tbl-wrap.h-lg { max-height: 640px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; background: #F7F8FB; color: var(--ink-2); font-weight: 400; font-size: 12px; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td.num { font-size: 14.5px; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #F8F9FC; }
.tbl tr.click td:first-child { box-shadow: inset 3px 0 0 transparent; }
.tbl tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--line); }
.tbl tr.sel td { background: var(--accent-soft) !important; }
.tbl tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent) !important; }
.tbl td.wrap { white-space: normal; min-width: 280px; line-height: 1.6; }
.tbl tfoot td { font-weight: 700; background: #F7F8FB; border-top: 1px solid var(--line); }

/* ── バッジ ─────────────────────────── */
.badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.b-red { background: #FDE8E8; color: #B42323; }
.b-orange { background: #FDF0E0; color: #A85A0C; }
.b-yellow { background: #FBF5D9; color: #7A6300; }
.b-green { background: #E2F5EC; color: #13734C; }
.b-gray { background: #EEF0F4; color: #5A6172; font-weight: 400; }
.b-blue { background: #E6EEFC; color: #1F4FA0; }
.bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar i.crit { background: var(--crit); } .bar i.warn { background: var(--warn); }

/* ── AI 予測表示 (原価管理 forecast/ui.tsx と同じルール: 薄青 + 「予」、確信度「低」は灰色) ── */
.pred { display: inline-flex; align-items: center; gap: 4px; background: var(--pred-bg); color: var(--pred-ink); border-radius: 4px; padding: 0 5px 0 3px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(43,111,219,.18); }
.pred .pm { font-family: var(--font-sans); font-size: 10px; line-height: 1; padding: 3px 3px 2px; border-radius: 3px; background: var(--pred); color: #fff; font-weight: 700; }
.pred.low { color: #8A93A6; background: #F1F3F7; box-shadow: inset 0 0 0 1px #E2E5EC; }
.pred.low .pm { background: #A9B0BE; }
.conf { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.conf.c-高 { background: #E2F5EC; color: #13734C; }
.conf.c-中 { background: var(--pred-bg); color: var(--pred-ink); }
.conf.c-低 { background: #EEF0F4; color: #5A6172; }

/* AI予兆帯 (各製品の最初の画面の見せ場) */
.aihero { background: var(--indigo); color: #fff; position: relative; overflow: hidden; border-bottom: 3px solid var(--accent); }
.aihero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.aihero-in { position: relative; max-width: 1600px; margin: 0 auto; padding: 22px 24px 18px; }
.aihero-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255,255,255,.66); }
.aitag { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); color: #fff; padding: 3px 10px 3px 8px; border-radius: 99px; font-weight: 700; font-size: 12px; }
.aitag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #6FB1FF; box-shadow: 0 0 0 3px rgba(111,177,255,.25); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(111,177,255,0); } }
.aihero-top .t { color: #fff; font-weight: 700; font-size: 14px; }
.aihero-top .acc { margin-left: auto; }
.aihero-top .acc b { font-family: var(--font-num); font-size: 16px; color: #fff; font-weight: 600; margin-left: 4px; }
.aihero-main { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 32px; align-items: end; margin-top: 14px; }
.aihero h1 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.3; font-weight: 700; letter-spacing: .01em; text-wrap: balance; max-width: 30em; }
.aihero p { margin-top: 10px; font-size: 14px; line-height: 1.75; color: rgba(255,255,255,.78); max-width: 62em; }
.aihero-n { display: flex; gap: 8px; }
.aihero-n .n { min-width: 104px; padding: 10px 14px 10px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.aihero-n .n b { display: block; font-family: var(--font-num); font-size: 52px; font-weight: 600; line-height: 1; }
.aihero-n .n span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.75); margin-top: 6px; }
.aihero-n .n span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.aihero-n .red span::before { background: #FF6B6B; } .aihero-n .org span::before { background: #FFB347; } .aihero-n .yel span::before { background: #F3D54E; }
.aihero-n .red b { color: #FF8A8A; }
.aihero-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 6px; margin-top: 18px; }
.hrow { display: grid; grid-template-columns: 10px 15.5em 4.5em minmax(0,1fr); gap: 10px; align-items: baseline; text-align: left; padding: 8px 12px; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid transparent; cursor: pointer; font-size: 13px; color: #fff; }
.hrow:hover:not(:disabled) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); }
.hrow:disabled { cursor: default; opacity: .42; }
.hrow .dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.hrow.lv-red .dot { background: #FF6B6B; } .hrow.lv-org .dot { background: #FFB347; } .hrow.lv-yel .dot { background: #F3D54E; } .hrow.lv-brn .dot { background: #C08A5B; }
.hrow .ti { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .c { font-family: var(--font-num); font-size: 16px; font-weight: 600; white-space: nowrap; text-align: right; }
.hrow .c small { font-family: var(--font-sans); font-size: 11px; font-weight: 400; margin-left: 2px; color: rgba(255,255,255,.7); }
.hrow .ex { color: rgba(255,255,255,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.aihero .ainote { color: rgba(255,255,255,.42); margin-top: 10px; }
@media (max-width: 900px) { .aihero-main { grid-template-columns: 1fr; } .aihero-rows { grid-template-columns: 1fr; } .hrow { grid-template-columns: 10px minmax(0,1fr) auto; } .hrow .ex { grid-column: 2 / -1; } }

/* AIボード (予兆帯のない画面用・原価管理の AlertBoard と同じ構成) */
.aiboard { border: 1px solid #C9D9F5; border-radius: 10px; background: #fff; font-size: 13px; overflow: hidden; }
.aiboard-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: linear-gradient(#F3F7FE, #EEF4FE); border: 0; cursor: pointer; text-align: left; flex-wrap: wrap; }
.aiboard-h:hover { background: #E8F0FD; }
.aiboard-h .t { font-weight: 700; color: var(--indigo); font-size: 14px; }
.aiboard-h .m { font-size: 12px; color: var(--ink-2); }
.aiboard-h .cnt { display: flex; gap: 12px; font-size: 12.5px; font-family: var(--font-num); }
.aiboard-h .tog { margin-left: auto; font-size: 12px; color: var(--ink-2); }
.aiboard-b { padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.aiboard.closed .aiboard-b { display: none; }
.airow { display: grid; grid-template-columns: 20px 15em 6em minmax(0,1fr); align-items: baseline; gap: 8px; font-size: 13px; padding: 3px 0; }
.airow.zero { color: var(--ink-3); }
.airow .ti { font-weight: 700; }
.airow .c { font-family: var(--font-num); font-weight: 600; font-size: 15px; text-align: right; }
.airow .ex { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.airow .ex a { cursor: pointer; text-decoration: none; color: var(--pred-ink); } .airow .ex a:hover { text-decoration: underline; }
.aicomment { margin-top: 8px; background: #F7F9FD; border: 1px solid #E3EAF6; border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.75; }
.ainote { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* ── グラフ ─────────────────────────── */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { stroke: #EBEDF2; } .chart .ax0 { stroke: #C5CAD5; }
.chart text { font-size: 11.5px; fill: #8A91A0; font-family: var(--font-num); }
.chart .fut { animation: reveal 1.1s cubic-bezier(.3,.7,.2,1) .15s both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); padding: 0 2px 8px; }
.legend i { display: inline-block; width: 16px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px) !important; }
.legend i.band { height: 10px; background: #CFE0FB !important; }
.tip { position: fixed; pointer-events: none; background: var(--indigo-deep); color: #fff; font-size: 12px; padding: 8px 11px; border-radius: 6px; z-index: 99; white-space: nowrap; display: none; line-height: 1.6; box-shadow: 0 6px 20px rgba(14,12,54,.3); }
.tip b { font-family: var(--font-num); font-size: 14px; }

/* 製造計画グリッド */
.gantt td.cell { padding: 3px; min-width: 66px; vertical-align: top; }
.gantt .job { font-size: 11.5px; border-radius: 4px; padding: 3px 6px; margin-bottom: 2px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-left: 3px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 124px; }
.gantt .job.late { background: #FDE8E8; color: #A11E1E; font-weight: 700; border-left-color: var(--crit); box-shadow: none; }
.gantt .job.ai { background: var(--pred-bg); border-left: 3px dashed var(--pred); color: var(--pred-ink); box-shadow: inset 0 0 0 1px rgba(43,111,219,.2); }
.gantt th.we, .gantt td.we { background: #F6F7FA; }
.load { font-size: 12px; text-align: center; border-radius: 4px; padding: 2px 0; font-family: var(--font-num); }
.load .pred { font-size: 12px; }

/* 詳細パネル */
.detail-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.detail-h .code { font-family: var(--font-num); color: var(--ink-3); font-weight: 600; }
.detail-h .name { font-size: 18px; font-weight: 700; }
.kv { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-2); } .kv dd { font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 16px; border-radius: 4px; overflow: hidden; gap: 2px; }
.stack i { display: block; height: 100%; }
.empty { padding: 40px; text-align: center; color: var(--ink-2); }

/* ポータル */
.portal-hero { background: var(--indigo); color: #fff; position: relative; overflow: hidden; }
.portal-hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 32px 32px; }
.portal-hero .in { position: relative; max-width: 1160px; margin: 0 auto; padding: 56px 24px 120px; }
.portal-hero .wm { display: flex; align-items: center; gap: 14px; }
.portal-hero .wm img { height: 44px; background: #fff; border-radius: 8px; padding: 7px 9px; }
.portal-hero .wm b { font-family: var(--font-num); font-size: 30px; letter-spacing: .08em; font-weight: 700; }
.portal-hero h1 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.3; margin-top: 28px; font-weight: 700; text-wrap: balance; }
.portal-hero p { margin-top: 14px; color: rgba(255,255,255,.75); font-size: 15px; max-width: 40em; line-height: 1.8; }
.portal { max-width: 1160px; margin: -84px auto 48px; padding: 0 24px; position: relative; }
.pcard { display: flex; flex-direction: column; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: transform .2s, box-shadow .2s; box-shadow: 0 10px 30px rgba(14,12,54,.12); }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(14,12,54,.18); }
.pcard .top { padding: 22px 22px 18px; border-top: 5px solid var(--c); display: flex; align-items: center; gap: 12px; }
.pcard .top img { height: 34px; }
.pcard .top h2 { font-size: 20px; }
.pcard .sig { min-height: 92px; margin: 0 22px; padding: 14px 16px; border-radius: 8px; background: var(--indigo); color: #fff; }
.pcard .sig small { display: block; font-size: 11.5px; color: rgba(255,255,255,.62); }
.pcard .sig b { display: block; font-size: 15px; margin-top: 4px; line-height: 1.5; }
.pcard ul { list-style: none; font-size: 13.5px; color: var(--ink-2); padding: 16px 22px 8px; line-height: 2; }
.pcard ul li::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--c); margin-right: 10px; vertical-align: middle; }
.pcard .go { margin: auto 22px 22px; padding-top: 10px; font-weight: 700; color: var(--c); font-size: 14px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { main.mf-main { padding: 14px 12px 32px; } .mf-page.on > .aihero:first-child { margin: -14px -12px 0; } .kpi .v { font-size: 30px; } .aihero-n .n b { font-size: 40px; } }

/* ── 入力・保存まわり ─────────────────────────── */
.mf-reset { border: 1px solid rgba(255,255,255,.3); background: none; color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: default; }
.mf-reset.dirty { cursor: pointer; background: #FFE9B8; color: #5B3D00; border-color: #FFE9B8; }
.mf-reset.dirty b { font-family: var(--font-num); font-size: 14px; }
.mf-reset.dirty:hover { background: #fff; }
.btn:hover { filter: brightness(1.06); }
.btn.sec { background: #fff; color: var(--accent); }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper); filter: none; }
.btn.danger { background: #fff; color: var(--crit); border-color: #F2C4C4; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn.add::before { content: '＋'; margin-right: 4px; }
.btn:disabled { opacity: .5; cursor: default; }
.mf-modal { position: fixed; inset: 0; z-index: 100; background: rgba(14,12,54,.45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; opacity: 0; transition: opacity .15s; overflow-y: auto; }
.mf-modal.on { opacity: 1; }
.mf-dlg { width: min(560px, 100%); background: #fff; border-radius: 12px; box-shadow: 0 24px 60px rgba(14,12,54,.35); transform: translateY(8px); transition: transform .18s; }
.mf-modal.on .mf-dlg { transform: none; }
.mf-dlg-h { display: flex; align-items: center; padding: 16px 20px 0; }
.mf-dlg-h h2 { font-size: 17px; }
.mf-dlg-h .x { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; width: 36px; height: 36px; border-radius: 6px; }
.mf-dlg-h .x:hover { background: var(--paper); color: var(--ink); }
.mf-dlg-lead { padding: 8px 20px 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.mf-dlg form { padding: 14px 20px 18px; }
.mf-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.fld.wide { grid-column: 1 / -1; }
.fld .in { display: flex; align-items: center; gap: 6px; }
.fld input, .fld select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; }
.fld input[type=number] { font-family: var(--font-num); font-size: 17px; text-align: right; }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld em { font-style: normal; color: var(--ink-2); white-space: nowrap; }
.fld small { color: var(--ink-3); font-size: 11.5px; }
.mf-dlg-aside { margin-top: 14px; padding: 10px 12px; background: var(--pred-bg); color: var(--pred-ink); border-radius: 8px; font-size: 13px; line-height: 1.7; }
.mf-dlg .err { color: var(--crit); font-size: 13px; min-height: 1em; margin-top: 10px; }
.mf-dlg-f { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.mf-dlg-f .sp { flex: 1; }
.mf-dlg-f .btn { padding: 9px 16px; font-size: 14px; }
@media (max-width: 560px) { .mf-fields { grid-template-columns: 1fr; } }
#mf-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--indigo-deep); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgba(14,12,54,.35); max-width: calc(100% - 32px); }
#mf-toast.on { opacity: 1; transform: translate(-50%, 0); }
#mf-toast b { color: #FFD27A; }
.tag-new { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #FFE9B8; color: #5B3D00; margin-left: 4px; vertical-align: 1px; }
.cell-in { width: 92px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--font-num); font-size: 15px; text-align: right; }
.cell-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell-in.changed { background: #FFF6DD; border-color: #F0D28A; }
.tbl select.cell-sel { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12.5px; background: #fff; }
.revise { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; background: var(--paper); border-radius: 8px; font-size: 13px; }
.revise label { font-weight: 700; }
.revise .cell-in { width: 110px; }
@media (max-width: 900px) {
  .mf-header { flex-wrap: wrap; height: auto; }
  .mf-brand { height: 48px; padding-right: 8px; }
  .mf-right { height: 48px; padding: 0 10px; gap: 6px; margin-left: auto; }
  .mf-switch a { padding: 5px 8px; font-size: 12px; }
  .mf-tabs { order: 3; width: 100%; height: 42px; border-top: 1px solid rgba(255,255,255,.08); }
  .mf-tabs a { padding: 0 12px; }
  .mf-page.on > .aihero:first-child { margin-top: -20px; }
}
@media (max-width: 480px) {
  .mf-brand b { display: none; }
  .mf-reset { padding: 4px 6px; }
  .aihero-n .n { min-width: 0; flex: 1; }
}
