/* AIBUILDERZ for Clients ─ ai-builderz.com（v8）と同じ系統で組んだ SaaS の画面
   色と書体: 02_business/aibuilderz/rules/色と書体.md の「サイト」
   使わない表現: 02_business/aibuilderz/rules/デザインで使わない表現.md
     ・ロゴはサイトと同じ「AIBUILDERZ」（Noto Sans JP 900・字間 .16em・点を付けない）＋ AY マーク
     ・地は白〜グレーの金属調（v8 の --surface）と影の段階（--e1〜e3）で立体を出す。塗った札・帯・ピルは作らない
     ・青はデータ（棒・線・リング）と現在地だけに使う。文字は墨とグレー
     ・状態は点＋文字 */

:root {
  --c-brand: #096FC8;
  --c-brand-deep: #0556A0;
  --c-brand-2: #76B7ED;
  --c-brand-3: #CFE3F6;
  --c-accent: #FF7669;
  --c-text: #111111;
  --c-text-sub: #2B3442;
  --c-text-3: #5F6773;
  --c-nav: #2C3646;
  --c-mute: #9A9A9A;
  --c-line: #E6E8EC;
  --c-line-soft: #EEF0F3;
  --c-hover: #F6F8FB;
  --c-track: #E9EDF2;
  --c-surface: #FFFFFF;

  --g-black:
    radial-gradient(64% 116% at 16% 10%, rgba(74,83,94,.92) 0%, rgba(74,83,94,0) 56%),
    radial-gradient(52% 96%  at 72% 26%, rgba(52,60,70,.85) 0%, rgba(52,60,70,0) 62%),
    radial-gradient(86% 130% at 66% 98%, rgba(3,5,9,.95) 0%, rgba(3,5,9,0) 58%),
    linear-gradient(150deg, #1A1F26 0%, #0D1116 48%, #151A20 100%);
  --surface: linear-gradient(158deg, #FFFFFF 0%, #FAFBFD 44%, #F1F4F7 76%, #E9EDF2 100%);
  --e1: 0 10px 20px -12px rgba(14,26,44,.22), 0 2px 5px -3px rgba(14,26,44,.10), inset 0 1px 0 rgba(255,255,255,.9);
  --e2: 0 22px 32px -16px rgba(14,26,44,.32), 0 6px 13px -6px rgba(14,26,44,.16), inset 0 2px 2px rgba(255,255,255,.94);
  --e3: 0 34px 50px -22px rgba(14,26,44,.44), 0 10px 20px -10px rgba(14,26,44,.22), inset 0 2px 2px rgba(255,255,255,.96);

  --f: "Noto Sans JP", system-ui, sans-serif;
  --f-en: "Plus Jakarta Sans", "Noto Sans JP", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side-w: 256px;
  --gap: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--c-text);
  background: #F4F5F7 linear-gradient(180deg, #E9ECEF 0, #F2F3F5 420px, #F6F7F8 1000px) no-repeat;
  font-family: var(--f); font-size: 14.5px; font-weight: 500; line-height: 1.75; letter-spacing: .04em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.5; letter-spacing: .05em; }
h1 { font-size: 26px; line-height: 1.4; }
h2 { font-size: 15.5px; }
h3 { font-size: 13.5px; margin: 22px 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--c-text-sub); text-decoration: none; }
a:hover { color: var(--c-brand); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid rgba(9,111,200,.45); outline-offset: 3px; }

.muted { color: var(--c-text-3); }
.small { font-size: 12.5px; }
.num { font-family: var(--f-en); font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.empty { padding: 32px 8px; text-align: center; color: var(--c-text-3); }
.loading { padding: 40px 0; color: var(--c-text-3); }
.eyebrow { margin: 0 0 8px; font-family: var(--f-en); font-size: 10.5px; font-weight: 800; line-height: 1; letter-spacing: .26em; text-transform: uppercase; color: var(--c-mute); }
.lead { margin: 6px 0 0; font-size: 13.5px; color: var(--c-text-3); }
.hint { color: var(--c-text-3); font-size: 12.5px; margin: 6px 0 0; line-height: 1.7; }
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* 状態（点＋文字） */
.st { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--c-text-sub); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; box-shadow: inset 0 0 0 1.5px #C4CAD3; }
.dot.s-trial { background: var(--c-brand-2); box-shadow: none; }
.dot.s-adopted { background: var(--c-brand); box-shadow: none; }
.dot.r-open { background: var(--c-accent); box-shadow: none; }
.dot.r-doing { background: var(--c-brand); box-shadow: none; }
.dot.r-waiting { background: var(--c-brand-2); box-shadow: none; }

/* ───── サイドバー ───── */
.side {
  position: fixed; left: 14px; top: 14px; bottom: 14px; z-index: 40; width: var(--side-w);
  display: flex; flex-direction: column; padding: 22px 14px 14px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  -webkit-backdrop-filter: saturate(1.2) blur(16px); backdrop-filter: saturate(1.2) blur(16px);
  box-shadow: 0 16px 34px -18px rgba(14,26,44,.30), 0 2px 6px -3px rgba(14,26,44,.12), inset 0 1px 0 rgba(255,255,255,.92);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 0; color: #111; }
.brand:hover { color: #111; }
.brand img { width: 30px; height: auto; flex: none; }
.brand-word { font-size: 16px; font-weight: 900; letter-spacing: .16em; line-height: 1; }
.brand-sub { display: block; margin: 10px 10px 0 50px; font-family: var(--f-en); font-size: 9.5px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--c-mute); line-height: 1; }

.org-card { margin: 22px 0 14px; padding: 12px 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--e1); display: flex; align-items: center; gap: 10px; position: relative; }
.org-card img { width: 34px; height: 34px; flex: none; }
.org-card .org-meta { min-width: 0; flex: 1; }
.org-card .org-label { display: block; font-size: 10.5px; font-weight: 700; color: var(--c-mute); letter-spacing: .08em; line-height: 1.3; }
.org-card .org-name { display: block; font-size: 13px; font-weight: 700; color: var(--c-text); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-card select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.org-card .chev-ud { color: var(--c-mute); }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; margin: 0 -2px; padding: 2px; }
.nav-sec { margin: 16px 12px 6px; font-family: var(--f-en); font-size: 10px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: var(--c-mute); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; letter-spacing: .06em; color: var(--c-nav); transition: background .2s, color .2s, box-shadow .25s; }
.nav a .ic { width: 18px; height: 18px; color: #7A8290; }
.nav a:hover { background: rgba(255,255,255,.8); color: var(--c-text); }
.nav a.active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--e1); }
.nav a.active .ic { color: var(--c-brand); }
.nav a .badge-n { margin-left: auto; font-family: var(--f-en); font-size: 11.5px; font-weight: 800; color: var(--c-accent); }

.side-foot { padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--c-line-soft); position: relative; }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.me-btn:hover { background: rgba(255,255,255,.8); }
.me-btn .me-meta { min-width: 0; flex: 1; }
.me-btn .me-name { display: block; font-size: 13px; font-weight: 700; color: var(--c-text); line-height: 1.4; }
.me-btn .me-role { display: block; font-size: 11px; color: var(--c-text-3); line-height: 1.3; }

/* ───── 上の帯（ページの位置・お知らせ） ───── */
.main { margin-left: calc(var(--side-w) + 28px); padding: 14px 32px 80px 8px; min-width: 0; }
.topbar { position: sticky; top: 14px; z-index: 30; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 12px 0 24px; margin-bottom: 30px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.76));
  -webkit-backdrop-filter: saturate(1.2) blur(14px); backdrop-filter: saturate(1.2) blur(14px);
  box-shadow: 0 16px 34px -18px rgba(14,26,44,.28), 0 2px 6px -3px rgba(14,26,44,.12), inset 0 1px 0 rgba(255,255,255,.92); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--c-text-3); white-space: nowrap; overflow: hidden; }
.crumb b { color: var(--c-text); overflow: hidden; text-overflow: ellipsis; }
.crumb .ic { width: 13px; height: 13px; color: var(--c-mute); }
.top-act { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.period { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 38px; border-radius: 999px; background: var(--surface); box-shadow: var(--e1); font-size: 12.5px; font-weight: 700; color: var(--c-text-sub); white-space: nowrap; }
.period .ic { width: 15px; height: 15px; color: var(--c-text-3); }
.icon-btn { position: relative; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--c-nav); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(255,255,255,.9); box-shadow: var(--e1); color: var(--c-text); }
.icon-btn .ic { width: 19px; height: 19px; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 2px #fff; }
.menu-btn { display: none; }

.pop { position: absolute; z-index: 45; min-width: 220px; padding: 10px 20px; border-radius: 18px; background: var(--c-surface); box-shadow: var(--e3); }
.pop a, .pop button { display: block; width: 100%; padding: 8px 0; border: 0; background: none; text-align: left; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--c-text-sub); }
.pop a:hover, .pop button:hover { color: var(--c-brand); }
.pop .pop-meta { padding: 6px 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--c-line-soft); font-size: 12px; color: var(--c-text-3); line-height: 1.6; }
.notif-pop { top: calc(100% + 12px); right: 0; width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 16px 22px; }
.notif-pop .pop-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.user-pop { bottom: calc(100% + 10px); left: 0; right: 0; }
.notif-item { display: block; padding: 11px 0; border-bottom: 1px solid var(--c-line-soft); font-size: 13px; line-height: 1.6; color: var(--c-text); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { font-weight: 700; }
.notif-item .muted { display: block; font-weight: 500; font-size: 11.5px; margin-top: 2px; }

/* ───── ページ ───── */
.container { max-width: 1320px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .hgroup { min-width: 0; }
.card { position: relative; background: var(--c-surface); border-radius: 22px; box-shadow: var(--e1); padding: 26px; min-width: 0; }
.card.metal { background: var(--surface); box-shadow: var(--e2); }
.card + .card { margin-top: var(--gap); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head .ic-h { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); box-shadow: var(--e1); color: var(--c-text-sub); }
.card-head .ic-h .ic { width: 16px; height: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap); align-items: start; margin-top: var(--gap); }
.grid-2 > .card + .card, .stack > .card + .card, .dash > .card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* ───── ボタン（v8 と同じ） ───── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 24px; border: 0; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; cursor: pointer; color: var(--c-nav);
  background: linear-gradient(180deg, #FFFFFF 0%, #F3F5F8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(17,17,17,.14), 0 1px 2px rgba(14,26,44,.10), 0 8px 18px -8px rgba(14,26,44,.30);
  transition: transform .3s var(--ease), box-shadow .3s ease, opacity .2s;
}
.btn:hover { color: var(--c-nav); transform: translateY(-1px); }
.btn .ic { width: 15px; height: 15px; }
.btn-primary { color: #F6F6F6; background: var(--g-black); box-shadow: var(--e1); }
.btn-primary:hover { color: #F6F6F6; box-shadow: var(--e2); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.btn-text { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 2px; border: 0; background: none; cursor: pointer; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--c-text-sub); white-space: nowrap; }
.btn-text:hover { color: var(--c-brand); }
.btn-text .ic { width: 14px; height: 14px; }
.btn-text.is-danger:hover { color: #C23B2E; }
.btn-row { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: center; }

/* 切り替え（文字だけ。現在地は白い面を持ち上げる） */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--c-track); }
.seg button { border: 0; background: none; padding: 5px 14px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--c-text-3); }
.seg button.active { background: #fff; color: var(--c-text); box-shadow: 0 1px 2px rgba(14,26,44,.12), 0 4px 10px -4px rgba(14,26,44,.2); }

/* ───── 入力 ───── */
.field { margin-bottom: 20px; min-width: 0; }
.field > label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--c-text-sub); margin-bottom: 2px; }
.req { margin-left: 6px; font-size: 11px; color: var(--c-accent); }
.input { display: block; width: 100%; min-width: 0; padding: 9px 0 8px; border: 0; border-bottom: 2px solid var(--c-line); border-radius: 0; background: transparent; font-size: 14.5px; font-weight: 600; line-height: 1.6; color: var(--c-text); transition: border-color .2s; }
.input:focus { outline: none; border-bottom-color: var(--c-brand); }
.input::placeholder { color: #B3B8BF; font-weight: 500; }
.input:disabled { color: var(--c-text-3); }
select.input { -webkit-appearance: none; appearance: none; padding-right: 26px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%232B3442' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") right 2px center / 14px no-repeat; }
textarea.input { padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 14px; background: #fff; font-weight: 500; line-height: 1.8; resize: vertical; min-height: 96px; }
textarea.input:focus { border-color: var(--c-brand); }
input[type="checkbox"] { accent-color: var(--c-brand); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.form-error { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 14px; font-size: 13.5px; color: #B3261E; }
.form-error:empty { display: none; }
.calc-line { display: flex; flex-wrap: wrap; gap: 4px 22px; padding: 14px 0 4px; margin: 4px 0 18px; border-top: 1px solid var(--c-line-soft); font-size: 13px; color: var(--c-text-3); }
.calc-line .num { color: var(--c-text); font-size: 15px; margin: 0 2px; }
.calc-line .is-main .num { color: var(--c-brand); }

.tabs { display: flex; gap: 0 24px; flex-wrap: wrap; border-bottom: 1px solid var(--c-line); margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 10px 0 12px; cursor: pointer; font-size: 13.5px; font-weight: 700; letter-spacing: .06em; color: var(--c-mute); display: inline-flex; gap: 7px; align-items: baseline; box-shadow: inset 0 -2px 0 transparent; }
.tab:hover { color: var(--c-text-sub); }
.tab.active { color: var(--c-text); box-shadow: inset 0 -2px 0 var(--c-text); }
.tab .num { font-size: 12px; }
.filter-row { display: flex; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-row .input { width: auto; min-width: 150px; }
.filter-row .grow { flex: 1 1 240px; max-width: 340px; }

/* ───── 数字 ───── */
.big { font-family: var(--f-en); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.unit { margin-left: 4px; font-family: var(--f); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--c-text-3); }
.up { color: var(--c-brand); }
.down { color: var(--c-text-3); }

/* ───── ダッシュボード ───── */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; } .span-12 { grid-column: 1 / -1; }

/* 主役：取り戻した時間 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: stretch; padding: 30px 32px; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 340px; height: 340px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(118,183,237,.22), rgba(118,183,237,0)); }
.hero-main { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.hero-label { font-size: 13px; font-weight: 700; color: var(--c-text-sub); }
.hero-num { margin: 14px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.hero-num .big { font-size: 84px; letter-spacing: -.045em; color: var(--c-text); }
.hero-num .unit { font-size: 16px; color: var(--c-text-sub); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--c-text-3); }
.hero-facts b { font-family: var(--f-en); font-size: 15px; color: var(--c-text); margin: 0 3px; }
.hero-compare { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding-left: 32px; border-left: 1px solid var(--c-line); min-width: 0; }
.cmp-row .cmp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--c-text-3); }
.cmp-row .cmp-top .num { font-size: 18px; color: var(--c-text); }
.cmp-bar { height: 14px; border-radius: 5px; background: var(--c-track); overflow: hidden; }
.cmp-bar > span { display: block; height: 100%; border-radius: 5px; transform-origin: left; animation: grow .9s var(--ease) both; }
.cmp-bar .b-before { background: linear-gradient(90deg, #AEB6C2, #C6CCD5); }
.cmp-bar .b-after { background: linear-gradient(90deg, var(--c-brand), #2E8BE0); }
.cmp-delta { display: flex; align-items: baseline; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--c-line); }
.cmp-delta .big { font-size: 30px; color: var(--c-brand); }
.cmp-delta .muted { font-size: 12.5px; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 金額 */
.money-num { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 4px; }
.money-num .big { font-size: 42px; letter-spacing: -.03em; }
.money-sub { font-size: 12.5px; color: var(--c-text-3); }
.money-sub .num { color: var(--c-text); }
.wf { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.wf-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 7em; align-items: center; gap: 12px; font-size: 12.5px; }
.wf-row .wf-l { color: var(--c-text-3); font-weight: 700; }
.wf-row .wf-v { text-align: right; font-family: var(--f-en); font-weight: 800; font-size: 13.5px; }
.wf-track { position: relative; height: 12px; }
.wf-track > span { position: absolute; top: 0; height: 100%; border-radius: 4px; animation: grow .9s var(--ease) both; }
.wf .w-labor { background: var(--c-brand-2); }
.wf .w-tool { background: #C6CCD5; }
.wf .w-net { background: var(--c-brand); }
.wf-row.is-net { padding-top: 12px; border-top: 1px solid var(--c-line-soft); }
.wf-row.is-net .wf-l { color: var(--c-text); }

/* 小さい数字 */
.tile { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px 18px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-label { font-size: 12px; font-weight: 700; color: var(--c-text-3); }
.tile .ic-h { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); box-shadow: var(--e1); color: var(--c-text-sub); }
.tile .big { font-size: 28px; margin-top: 6px; }
.tile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 11.5px; color: var(--c-text-3); min-height: 30px; }
.tile-foot .spark { width: 96px; height: 30px; flex: none; }
.ring { width: 44px; height: 44px; flex: none; }

/* グラフ */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--c-text-3); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-brand { background: var(--c-brand); }
.sw-brand2 { background: var(--c-brand-2); }
.sw-track { background: var(--c-track); box-shadow: inset 0 0 0 1px #DCE1E7; }
.donut-wrap { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; align-items: center; }
.donut { position: relative; width: 170px; height: 170px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center .big { font-size: 34px; }
.donut-center small { font-size: 11px; font-weight: 700; color: var(--c-text-3); }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--c-line-soft); font-size: 13px; }
.st-list li:last-child { border-bottom: 0; }
.st-list .num { font-size: 15px; }
.potential { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--c-hover); box-shadow: inset 0 0 0 1px var(--c-line-soft); font-size: 12.5px; color: var(--c-text-3); }
.potential .num { font-size: 18px; color: var(--c-text); margin-right: 2px; }

/* 年間の効果 */
.yr { display: flex; flex-direction: column; }
.yr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--c-line-soft); }
.yr-l { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--c-text-sub); }
.yr-l .ic { width: 17px; height: 17px; color: var(--c-text-3); }
.yr-v .num { font-size: 18px; }
.yr-row.is-net { border-bottom: 0; padding-top: 16px; }
.yr-row.is-net .yr-l { color: var(--c-text); }
.yr-row.is-net .num { font-size: 28px; color: var(--c-brand); font-weight: 800; }

/* 部署のカード */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.dept { padding: 18px 20px; border-radius: 18px; background: var(--surface); box-shadow: var(--e1); transition: transform .35s var(--ease), box-shadow .35s; }
.dept:hover { transform: translateY(-2px); box-shadow: var(--e2); }
.dept-name { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 700; }
.dept-name .muted { font-size: 11.5px; font-weight: 500; }
.dept .big { font-size: 26px; margin: 10px 0 2px; }
.dept-rate { font-size: 12px; color: var(--c-text-3); }
.dept-rate .num { color: var(--c-brand); }
.mini-cmp { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.mini-cmp .cmp-bar { height: 6px; border-radius: 3px; }
.mini-cmp .cmp-bar > span { border-radius: 3px; }

/* 業務ごとの前後 */
.tlist { display: flex; flex-direction: column; }
.titem { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.1fr) 88px; gap: 14px; align-items: center; padding: 13px 6px; border-bottom: 1px solid var(--c-line-soft); color: var(--c-text); border-radius: 10px; }
.titem.nomoney { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.1fr); }
.titem:last-child { border-bottom: 0; }
.titem:hover { background: var(--c-hover); color: var(--c-text); }
.titem:hover .t-name { color: var(--c-brand); }
.rank-n { font-family: var(--f-en); font-weight: 800; color: var(--c-mute); font-size: 13px; }
.t-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; line-height: 1.5; }
.t-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--c-text-3); }
.t-bars { display: flex; flex-direction: column; gap: 4px; }
.t-bars .cmp-bar { height: 7px; border-radius: 3px; }
.t-bars .cmp-bar > span { border-radius: 3px; }
.t-bars .t-cap { display: flex; justify-content: space-between; font-size: 11px; color: var(--c-text-3); }
.t-bars .t-cap b { font-family: var(--f-en); color: var(--c-text); }
.t-val { text-align: right; }
.t-val .num { font-size: 14.5px; }
.t-val small { font-size: 11px; color: var(--c-text-3); margin-left: 2px; }

/* ───── 一覧（行） ───── */
.rows { border-top: 1px solid var(--c-line); }
.row { display: grid; gap: 14px; align-items: center; padding: 13px 10px; border-bottom: 1px solid var(--c-line-soft); color: var(--c-text); }
.row.head { padding: 9px 10px; border-bottom: 1px solid var(--c-line); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--c-mute); }
a.row:hover, .row.click:hover { background: var(--c-hover); color: var(--c-text); cursor: pointer; }
a.row:hover .r-name { color: var(--c-brand); }
.r-name { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.r-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--c-text-3); overflow-wrap: anywhere; }
.row .num { font-size: 13.5px; }
.cols-task { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 96px 70px 90px minmax(120px, 1.1fr) 104px 40px; }
.cols-task.nomoney { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 96px 70px 90px minmax(120px, 1.1fr) 40px; }
.cols-rank { grid-template-columns: 28px minmax(0, 1fr) 90px 110px; }
.cols-req { grid-template-columns: minmax(0, 2.4fr) 110px minmax(0, 1fr) 100px 100px 40px; }
.cols-user { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) 110px minmax(0, 1fr) 120px 80px; }
.cols-port { grid-template-columns: minmax(0, 1.8fr) 150px 130px 120px minmax(0, 1fr) 110px 90px; }
.cols-set { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 110px 80px; }
.cols-staff { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 90px minmax(0, 2fr) 120px; }
.cmt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-text-3); }
.cmt .ic { width: 14px; height: 14px; }
.spark { display: block; width: 100%; height: 30px; }
.total-row { font-weight: 700; background: var(--c-hover); }
.cell-bar { display: flex; flex-direction: column; gap: 3px; }
.cell-bar .cmp-bar { height: 6px; border-radius: 3px; }
.cell-bar .cmp-bar > span { border-radius: 3px; animation: none; }

/* 当社側の一覧 */
.port-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.pc { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; border-radius: 22px; background: var(--c-surface); box-shadow: var(--e1); color: var(--c-text); transition: transform .35s var(--ease), box-shadow .35s; }
.pc:hover { color: var(--c-text); transform: translateY(-3px); box-shadow: var(--e2); }
.pc-head { display: flex; align-items: center; gap: 12px; }
.pc-head img { width: 38px; height: 38px; }
.pc-name { font-size: 15px; font-weight: 700; line-height: 1.4; }
.pc-fd { display: block; font-size: 11.5px; color: var(--c-text-3); font-weight: 500; }
.pc-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid var(--c-line-soft); border-bottom: 1px solid var(--c-line-soft); }
.pc-nums .big { font-size: 22px; }
.pc-nums .lbl { display: block; font-size: 11px; font-weight: 700; color: var(--c-text-3); }
.pc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--c-text-3); gap: 10px; }

/* ───── 活動・コメント ───── */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 10px 0; font-size: 13px; position: relative; }
.feed li:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 40px; bottom: -6px; width: 1px; background: var(--c-line); }
.feed .who { font-weight: 700; }
.feed .when { display: block; font-size: 11px; color: var(--c-text-3); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: 11px; font-weight: 700; color: var(--c-text-sub); background: var(--surface); box-shadow: var(--e1); }
.avatar.is-in { color: var(--c-brand); }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.thread { display: flex; flex-direction: column; gap: 16px; margin: 6px 0 18px; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.msg .avatar { width: 30px; height: 30px; }
.msg-head { font-size: 12px; color: var(--c-text-3); }
.msg-head b { color: var(--c-text); margin-right: 8px; }
.msg-body { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--c-text-3); font-size: 12.5px; padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.hist li { padding: 7px 0; border-bottom: 1px solid var(--c-line-soft); color: var(--c-text-sub); }
.hist .chg { display: block; color: var(--c-text-3); }

/* ───── ダイアログ ───── */
.modal-overlay { position: fixed; inset: 0; z-index: 60; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px; background: rgba(10,15,28,.30); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { width: 100%; max-width: 600px; background: var(--c-surface); border-radius: 26px; box-shadow: var(--e3); }
.modal.wide { max-width: 1000px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 28px 32px 6px; }
.modal-head h2 { font-size: 19px; overflow-wrap: anywhere; }
.modal-x { flex: none; width: 40px; height: 40px; margin: -6px -10px 0 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--c-text-sub); cursor: pointer; }
.modal-x:hover { background: #F3F5F8; }
.modal-body { padding: 12px 32px 6px; font-size: 13.5px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px 14px; padding: 18px 32px 28px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.task-detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; }
.copy-box { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.copy-box .input { font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }

/* ───── ログイン ───── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth { width: 100%; max-width: 420px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-brand .brand-wrap { display: flex; flex-direction: column; align-items: center; }
.auth-brand .brand-sub { margin: 10px 0 0; }
.auth h1 { font-size: 22px; margin: 0 0 4px; }
.auth .card { padding: 36px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; padding: 12px 22px; border-radius: 16px; background: var(--c-surface); box-shadow: var(--e3); font-size: 13.5px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.toast .ic { color: var(--c-brand); }

/* ───── 報告書 ───── */
.report { max-width: 920px; }
.report-sheet { background: #fff; border-radius: 22px; box-shadow: var(--e1); padding: 48px 56px; }
.report-cover { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--c-text); margin-bottom: 30px; }
.report-cover h1 { font-size: 24px; }
.report-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: .16em; color: #111; }
.report-brand img { width: 24px; }
.report h2 { font-size: 15.5px; margin: 34px 0 14px; }
.report .rkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report .rkpi { padding: 2px 20px; border-left: 1px solid var(--c-line-soft); }
.report .rkpi:first-child { padding-left: 0; border-left: 0; }
.report .rkpi .big { font-size: 26px; margin-top: 6px; }
.report .rkpi.is-hero .big { font-size: 34px; }
.report-text { font-size: 14px; line-height: 2; white-space: pre-wrap; }
.report-edit { margin-top: 20px; }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.formula { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-line-soft); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 12.5px; color: var(--c-text-3); }
.formula .num { font-size: 15px; color: var(--c-text); }
.formula .op { font-family: var(--f-en); font-weight: 700; color: var(--c-mute); }
.formula .is-main .num { color: var(--c-brand); }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .side, .topbar, .no-print, .toast { display: none !important; }
  .main { margin: 0; padding: 0; }
  .report-sheet { box-shadow: none; padding: 0; border-radius: 0; }
  .report h2 { break-after: avoid; }
  .chart-box { height: 220px; }
  .row, .titem { break-inside: avoid; }
}

/* ───── 幅ごとの組み替え ───── */
@media (max-width: 1280px) {
  .span-8, .span-4, .span-7, .span-5, .span-6 { grid-column: 1 / -1; }
  .span-3 { grid-column: span 6; }
  .cols-port .c-trend { display: none; }
}
@media (max-width: 1100px) {
  .grid-2, .task-detail { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-compare { padding-left: 0; border-left: 0; padding-top: 22px; border-top: 1px solid var(--c-line); }
}
@media (max-width: 960px) {
  .side { transform: translateX(calc(-100% - 20px)); transition: transform .35s var(--ease); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(10,15,28,.25); }
  .main { margin-left: 0; padding: 10px 14px 60px; }
  .topbar { top: 10px; padding: 0 8px 0 8px; margin-bottom: 22px; }
  .menu-btn { display: flex; }
  .period { display: none; }
}
@media (max-width: 760px) {
  .span-3 { grid-column: span 12; }
  .card { padding: 20px 18px; border-radius: 20px; }
  .hero { padding: 24px 20px; }
  .hero-num .big { font-size: 60px; }
  .money-num .big { font-size: 34px; }
  .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .donut-wrap .st-list { width: 100%; }
  .titem { grid-template-columns: 22px minmax(0, 1fr) 80px; }
  .titem .t-bars { grid-column: 2 / -1; grid-row: 2; }
  .titem.nomoney { grid-template-columns: 22px minmax(0, 1fr); }
  .form-grid, .form-grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .row.head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto !important; gap: 4px 12px; padding: 12px 2px; }
  .row > .hide-sm { display: none; }
  .row > .r-main { grid-column: 1; }
  .row > .r-key { grid-column: 2; grid-row: 1; text-align: right; }
  .row > .r-line2 { grid-column: 1 / -1; }
  .modal-head, .modal-body, .modal-foot { padding-left: 20px; padding-right: 20px; }
  .report-sheet { padding: 26px 18px; }
  .report .rkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .report .rkpi:nth-child(3) { padding-left: 0; border-left: 0; }
  .chart-box { height: 230px; }
  h1 { font-size: 22px; }
  .auth .card { padding: 28px 22px; }
}
@media (min-width: 761px) { .r-line2 { display: none; } }
