/* 配置・コンポーネントは Lightning（SLDS）を真似、配色はノーチラメントのトンマナ（紺が主・金は要所） */
:root { --navy: #1b2a4a; --navy-2: #243a66; --gold: #c9a84c; --gold-2: #b8973f; --brand: var(--navy); --brand-dark: var(--navy-2); --brand-navy: var(--navy); --bg: #f3f3f3; --card: #fff; --line: #e5e5e5; --line-2: #c9c9c9; --text: #181818; --muted: #747474; --ok: #2e844a; --warn: #dd7a01; --err: #ba0517; --link: #243a66; --radius: 4px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Salesforce Sans", "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ===== グローバルヘッダー（白） ===== */
.ghdr { background: #fff; border-bottom: 1px solid var(--line); border-top: 3px solid var(--navy); display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 50px; position: relative; }
.ghdr .brand { font-weight: 700; color: var(--brand-navy); display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.ghdr .brand:hover { text-decoration: none; }
.ghdr .search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.ghdr .search .sicon { position: absolute; left: 10px; color: var(--muted); font-size: 16px; }
.ghdr .search input { width: 100%; height: 32px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; padding: 0 12px 0 30px; }
.ghdr .search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 3px var(--gold); }
.ghdr .search .results { position: absolute; top: 36px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,.16); z-index: 30; max-height: 360px; overflow: auto; }
.ghdr .search .results a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #f3f3f3; color: var(--text); }
.ghdr .search .results a:hover { background: #f3f3f3; text-decoration: none; }
.ghdr .me { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; } .avatar:hover { text-decoration: none; background: var(--brand-dark); }
.linkbtn { background: transparent; border: 0; color: var(--link); cursor: pointer; padding: 4px; } .linkbtn:hover { text-decoration: underline; }

/* ===== アプリナビ ===== */
.nav { background: #fff; border-bottom: 3px solid var(--navy); display: flex; align-items: stretch; padding: 0 8px; height: 40px; overflow: visible; }
.nav .appname { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 400; color: var(--text); padding: 0 16px 0 8px; margin-right: 8px; white-space: nowrap; }
.nav .waffle { color: var(--muted); font-size: 12px; letter-spacing: -2px; writing-mode: vertical-rl; transform: rotate(90deg); background: transparent; border: 0; cursor: pointer; padding: 4px; } .nav .waffle:hover { color: var(--navy); }
.appicon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 5px; color: #fff; font-weight: 700; font-size: 12px; } .appicon.lg { width: 44px; height: 44px; font-size: 20px; border-radius: 8px; flex: none; }
dialog.launcher { width: 720px; } .apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.appcard { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; } .appcard:hover { text-decoration: none; background: #f3f3f3; } .appcard.cur { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,168,76,.25); } .appcard-t { font-weight: 700; margin-bottom: 2px; }
.tabwrap { position: relative; display: flex; align-items: stretch; }
.nav .tab { display: flex; align-items: center; padding: 0 10px; color: var(--text); font-size: 13px; border-bottom: 3px solid transparent; margin-bottom: -3px; white-space: nowrap; }
.nav .tab.active { border-color: var(--gold); color: var(--navy); font-weight: 700; }
.nav .tab:hover { text-decoration: none; background: #f3f3f3; }
.nav .chev { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0 8px 0 2px; font-size: 11px; } .nav .chev:hover { color: var(--text); }
.tabmenu { position: absolute; top: 40px; left: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,.16); z-index: 40; padding: 4px 0; }
.tabmenu a { display: block; padding: 7px 14px; color: var(--text); } .tabmenu a:hover { background: #f3f3f3; text-decoration: none; }
.tabmenu-h { padding: 8px 14px 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--line); margin-top: 4px; }
main { padding: 12px 16px; max-width: 1440px; margin: 0 auto; }

/* ===== 共通 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; box-shadow: 0 2px 2px rgba(0,0,0,.05); }
.card h2, .card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--text); } .card h3 { font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.pagehdr { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 12px; } .pagehdr h1 { font-size: 20px; margin: 0; font-weight: 700; color: var(--text); }
.btn { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 16px; height: 32px; line-height: 30px; cursor: pointer; color: var(--brand); white-space: nowrap; display: inline-block; }
.btn:hover { background: #f4f6f9; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--err); } .btn.sm { height: 28px; line-height: 26px; padding: 0 10px; font-size: 12px; } .btn:disabled { opacity: .5; cursor: default; }
.btn.wide { width: 100%; height: 40px; line-height: 38px; font-size: 15px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel], select, textarea { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 12px; height: 32px; background: #fff; width: 100%; }
textarea { height: auto; min-height: 80px; padding: 8px 12px; resize: vertical; } textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; min-height: 240px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 3px var(--gold); }
.banner { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 12px; } .banner.err { background: #fef1ee; color: var(--err); border: 1px solid #f9c5bb; } .banner.ok { background: #ebf7e6; color: var(--ok); border: 1px solid #b7e0a6; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; height: 32px; }
table.grid th { background: #fafaf9; font-weight: 700; color: var(--text); white-space: nowrap; cursor: pointer; user-select: none; font-size: 12px; }
table.grid tr:hover td { background: #f3f3f3; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .rownum { width: 36px; color: var(--muted); text-align: right; cursor: default; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #f3f3f3; font-size: 12px; border: 1px solid var(--line); } .pill.won { background: #ebf7e6; color: var(--ok); border-color: #b7e0a6; } .pill.lost { background: #fef1ee; color: var(--err); border-color: #f9c5bb; } .pill.hot { background: #fef3e2; color: var(--warn); border-color: #f9d9a6; }
.empty { color: var(--muted); padding: 16px; text-align: center; }
.oicon { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; border-radius: 4px; flex: none; } .oicon.sm { width: 20px; height: 20px; font-size: 11px; } .oicon.md { width: 28px; height: 28px; font-size: 13px; border-radius: 5px; } .oicon.lg { width: 40px; height: 40px; font-size: 18px; border-radius: 6px; }

/* ===== ハイライトパネル・パス・タブ ===== */
.hl { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; box-shadow: 0 2px 2px rgba(0,0,0,.05); }
.hl .title { flex: 1 1 320px; } .hl .title .obj { color: var(--muted); font-size: 12px; } .hl .title h1 { margin: 0; font-size: 18px; font-weight: 700; }
.hl .kv { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 10px; } .hl .kv div { min-width: 120px; } .hl .kv .k { color: var(--muted); font-size: 12px; } .hl .kv .v { font-weight: 700; }
.hl .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.path { display: flex; gap: 0; margin: 0 0 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; }
.path span { padding: 6px 18px 6px 22px; background: #ecebea; font-size: 12px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); cursor: pointer; margin-left: -8px; white-space: nowrap; color: var(--text); }
.path span:first-child { margin-left: 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 4px 0 0 4px; }
.path span.done { background: var(--brand); color: #fff; } .path span.cur { background: var(--gold); color: var(--navy); font-weight: 700; } .path span.won { background: var(--ok); color: #fff; } .path span.lost { background: var(--err); color: #fff; }
.rtabs { display: flex; gap: 0; background: #fff; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 0 8px; margin-bottom: 0; }
.rtabs + .card { border-radius: 0 0 var(--radius) var(--radius); }
.rtabs a { padding: 10px 16px; color: var(--text); border-bottom: 3px solid transparent; } .rtabs a.active { border-color: var(--gold); color: var(--navy); font-weight: 700; } .rtabs a:hover { text-decoration: none; background: #f3f3f3; }

/* ===== 詳細・フォーム ===== */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 32px; }
.fld { padding: 7px 0; border-bottom: 1px solid #f3f3f3; } .fld .k { color: var(--muted); font-size: 12px; } .fld .v { min-height: 20px; white-space: pre-wrap; word-break: break-word; }
.fld.wide { grid-column: 1 / -1; }
form .fields .fld { border: 0; } form label.k { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; } .req { color: var(--err); }
.lookup { position: relative; } .lookup .dd { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,.16); max-height: 240px; overflow: auto; }
.lookup .dd div { padding: 6px 10px; cursor: pointer; } .lookup .dd div:hover { background: #f3f3f3; } .lookup .picked { display: flex; gap: 6px; align-items: center; height: 32px; }
.chk { display: flex; align-items: center; gap: 8px; } .chk input { width: auto; height: auto; }

/* ===== ホーム ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; box-shadow: 0 2px 2px rgba(0,0,0,.05); } .kpi .k { color: var(--muted); font-size: 12px; } .kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; color: var(--brand-navy); } .kpi .s { color: var(--muted); font-size: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.bars .bar { display: grid; grid-template-columns: 110px 1fr 120px; gap: 8px; align-items: center; margin: 6px 0; font-size: 12px; }
.bars .bar i { display: block; height: 16px; background: var(--brand); border-radius: 2px; min-width: 2px; } .bars .bar i.gold { background: var(--gold); } .bars .bar i.neg { background: var(--err); }
.list-mini a { display: block; padding: 6px 0; border-bottom: 1px solid #f3f3f3; color: var(--text); } .list-mini a:hover { background: #f3f3f3; text-decoration: none; } .list-mini .d { color: var(--muted); font-size: 12px; margin-left: 6px; }
.list-mini .late { color: var(--err); }
.greet { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; margin-bottom: 12px; box-shadow: 0 2px 2px rgba(0,0,0,.05); }
.greet-t { font-size: 15px; font-weight: 700; color: var(--brand-navy); margin-bottom: 2px; }
.listhdr .row { align-items: center; }

/* ===== ログイン・MFA ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(900px 500px at 20% -10%, #e8edf8, transparent), radial-gradient(700px 400px at 110% 110%, #f7efd9, transparent), var(--bg); }
.login { width: 520px; max-width: 100%; margin: 0; padding: 28px; box-shadow: 0 2px 8px rgba(0,0,0,.12); border-radius: 8px; }
.login-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; } .login-hero h1 { font-size: 18px; margin: 4px 0; } .login-hero p { margin: 0; }
.brand-lg { color: var(--brand-navy); font-weight: 700; } .brand-lg b { color: var(--gold); font-size: 18px; }
.login label { display: block; margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.steps { padding-left: 20px; margin: 0; } .steps li { margin: 10px 0; } .steps input { margin-top: 6px; font-size: 20px; letter-spacing: .2em; height: 44px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 16px; letter-spacing: .08em; background: var(--brand-navy); color: #ffe9a8; padding: 10px 12px; border-radius: var(--radius); margin: 8px 0 4px; user-select: all; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; } .codes code { background: #f3f3f3; padding: 8px 10px; border-radius: var(--radius); font-size: 15px; letter-spacing: .05em; text-align: center; }

/* ===== マスコット ===== */
.mascot-lg { width: 110px; height: auto; filter: drop-shadow(0 8px 14px rgba(3,45,96,.25)); }
.mascot-md { width: 72px; height: auto; filter: drop-shadow(0 6px 10px rgba(3,45,96,.2)); }
.mascot-sm { width: 52px; height: auto; }
.mascot-ico { width: 24px; height: auto; vertical-align: middle; }
.empty-mascot { display: flex; gap: 14px; align-items: center; justify-content: center; padding: 28px; }
.score { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: baseline; justify-content: center; color: #fff; flex: none; } .score b { font-size: 30px; line-height: 84px; } .score span { font-size: 12px; margin-left: 2px; }
.score.good { background: var(--ok); } .score.mid { background: var(--warn); } .score.bad { background: var(--err); }

/* ===== 設定・ダイアログ ===== */
dialog { border: 0; border-radius: 8px; padding: 20px; width: 560px; max-width: 95vw; box-shadow: 0 4px 24px rgba(0,0,0,.3); } dialog::backdrop { background: rgba(8,7,7,.6); }
dialog h3 { margin: 0 0 12px; font-size: 18px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 8px; } .tabs a { padding: 10px 14px; color: var(--text); border-bottom: 3px solid transparent; margin-bottom: -1px; } .tabs a.active { border-color: var(--gold); color: var(--navy); font-weight: 700; } .tabs a:hover { text-decoration: none; background: #f3f3f3; }
pre.code { background: #16325c; color: #e6e9f2; padding: 12px; border-radius: var(--radius); overflow: auto; font-size: 12px; }
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 20px; border-radius: var(--radius); z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
@media (max-width: 720px) { .ghdr .search { display: none; } main { padding: 8px; } .hl .kv { gap: 12px; } .nav .appname { display: none; } }

/* ===== レコードページの 2 カラム（左: 詳細/関連、右: 活動・変更履歴） ===== */
.rec-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.rec-right .card h2 { font-size: 14px; }
.tl-h { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.tl { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f3f3f3; color: var(--text); } .tl:hover { background: #f3f3f3; text-decoration: none; }
.tl-ico { width: 20px; height: 20px; border-radius: 50%; background: #ecebea; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--navy); flex: none; }
.tl.late .tl-ico { background: #fef1ee; color: var(--err); } .tl.late { color: var(--err); }
@media (max-width: 900px) { .rec-grid { grid-template-columns: 1fr; } }

/* ===== MA（ジャーニーのステップ・メールプレビュー） ===== */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f3f3; position: relative; }
.step + .step::before { content: ''; position: absolute; left: 13px; top: -10px; height: 10px; border-left: 2px solid var(--gold); }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; margin-top: 2px; }
.step select { width: auto; min-width: 160px; } .step-body { margin-top: 6px; } .step-body input[type=text] { width: 100%; }
.steps-help { padding-left: 20px; margin: 0 0 10px; } .steps-help li { margin: 4px 0; }
.mailpv { border: 1px solid var(--line); border-radius: var(--radius); background: #fafaf9; } .mailpv-s { padding: 8px 12px; border-bottom: 1px solid var(--line); font-weight: 700; } .mailpv pre { margin: 0; padding: 12px; white-space: pre-wrap; word-break: break-word; font: inherit; }
