/* 見た目は UI キャンバス「給与明細ポータル UI」（claude.ai/artifact/9GsfFVRGgEtDskaNHmit65）に合わせる */
:root {
  --navy: #1B2A4A;
  --navy-hover: #0F1A30;
  --gold: #D9B66A;           /* 濃紺の上のボタン・バッジ */
  --gold-ink: #B08D3E;       /* 白地のアイコン */
  --ink: #1B2A4A;
  --sub: #5A6375;
  --sub-2: #4A5366;
  --on-navy-sub: #C9D1E0;
  --line: #E6E2D8;           /* カードの枠 */
  --line-2: #EFEBE2;         /* カード内の区切り */
  --line-3: #CFC9BB;         /* 入力欄の枠 */
  --seg: #EAE6DC;            /* セグメントの地 */
  --head: #F3F0E8;           /* 支給・控除の見出し帯 */
  --off: #D8D3C7;            /* 押せないボタン */
  --unread: #C2410C;         /* 一覧の未確認ドット */
  --bg: #F6F4EF;
  --card: #FFFFFF;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Zen Kaku Gothic New', "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-text-size-adjust: 100%;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 32px; }
#app.has-dock { padding-bottom: calc(96px + var(--safe-b)); }
button, input { font: inherit; color: inherit; }
a { color: var(--ink); }
.num { font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif; font-variant-numeric: tabular-nums; }
.press { transition: transform .08s; }
.press:active { transform: scale(0.985); }
svg { flex-shrink: 0; }
.demo { background: var(--gold); color: var(--navy); text-align: center; font-size: 12px; font-weight: 700; padding: 4px; }

/* ---- ヘッダー ---- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.top .who { display: flex; flex-direction: column; gap: 2px; }
.top .app-name { font-size: 12px; color: var(--sub); letter-spacing: .04em; }
.top .nm { font-size: 18px; font-weight: 700; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); padding: 0;
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px; }
.nav h1 { margin: 0; font-size: 16px; font-weight: 700; }
.nav .spacer { width: 72px; }
.back {
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 12px 0 8px; border: 0; background: none;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav .label { font-size: 16px; font-weight: 700; min-width: 112px; text-align: center; }
.month-nav button { width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.month-nav button:disabled { color: #B9BEC8; cursor: default; }

/* ---- 濃紺のカード（主役の金額） ---- */
.hero { margin: 4px 16px 0; background: var(--navy); color: #fff; border-radius: 24px; padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 16px; }
.hero.sm { margin-top: 16px; border-radius: 22px; padding: 20px; gap: 14px; }
.hero .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero .ttl { font-size: 15px; font-weight: 700; }
.hero .cap { font-size: 13px; color: var(--on-navy-sub); }
.hero .amt-box { display: flex; flex-direction: column; gap: 4px; }
.amt { display: flex; align-items: baseline; gap: 4px; }
.amt .y { font-size: 22px; font-weight: 600; }
.amt .v { font-size: 44px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.amt.md .y { font-size: 20px; }
.amt.md .v { font-size: 40px; }
.badge { font-size: 12px; font-weight: 700; background: var(--gold); color: var(--navy); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.hero .cos { display: flex; flex-direction: column; background: rgba(255,255,255,.08); border-radius: 16px; }
.hero .co {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 14px 14px 14px 16px;
  background: none; border: 0; color: #fff; cursor: pointer; text-align: left; font-size: 15px;
}
.hero .co + .co { border-top: 1px solid rgba(255,255,255,.12); }
.hero .co .r { display: flex; align-items: center; gap: 6px; }
.hero .co .r .num { font-size: 17px; font-weight: 600; }
.gold-btn {
  display: flex; align-items: center; justify-content: center; height: 52px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--gold); color: var(--navy); font-size: 16px; font-weight: 700;
}
.hero .foot { font-size: 12px; color: var(--on-navy-sub); text-align: center; margin-top: -4px; }
.hero .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero .pair > div { background: rgba(255,255,255,.08); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.hero .pair .k { font-size: 12px; color: var(--on-navy-sub); }
.hero .pair .num { font-size: 17px; font-weight: 600; }
.hero.year { margin-top: 14px; border-radius: 20px; padding: 18px 20px; flex-direction: row; justify-content: space-between; align-items: flex-end; }
.hero.year .num { font-size: 30px; font-weight: 700; }

/* ---- 白いカード ---- */
.sect { margin: 28px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.sect.tight { margin-top: 20px; }
.sect-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.sect-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.sect-head.sm h2 { font-size: 15px; }
.link { font-size: 14px; font-weight: 500; padding: 10px 0; background: none; border: 0; cursor: pointer; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.box.pad { margin: 14px 16px 0; }
.lrow {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 14px 0 18px; width: 100%;
  background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink);
}
.lrow + .lrow { border-top: 1px solid var(--line-2); }
.lrow .t { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.lrow .t b { font-size: 15px; font-weight: 500; }
.lrow .t small { font-size: 12px; color: var(--sub); }
.lrow .num { font-size: 17px; font-weight: 600; }
.lrow .chev { color: var(--sub); }
.lrow.dotted { padding-left: 16px; }
.udot { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; background: transparent; }
.udot.on { background: var(--unread); }

.tiles { margin: 16px 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-height: 84px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer;
}
.tile .nm { font-size: 14px; font-weight: 700; }
.tile small { display: block; font-size: 12px; color: var(--sub); font-weight: 400; }

.note { margin: 16px 16px 0; background: var(--head); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }
.fine { margin: 16px 24px 0; font-size: 12px; line-height: 1.7; color: var(--sub); }
.fine.center { margin-top: 24px; text-align: center; }

/* ---- セグメント（会社・種類） ---- */
.seg { margin: 8px 16px 0; background: var(--seg); border-radius: 14px; padding: 4px; display: grid; gap: 4px; }
.seg button {
  height: 44px; border: 0; border-radius: 11px; font-size: 14px; cursor: pointer; background: transparent;
  color: var(--sub-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px;
}
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(27,42,74,.12); }
.chips { margin: 14px 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  height: 40px; padding: 0 18px; border-radius: 20px; font-size: 14px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--off); font-weight: 500;
}
.chips button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }

/* ---- 月の明細 ---- */
.cocard {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; width: 100%;
}
.cocard .r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cocard .r1 b { font-size: 15px; font-weight: 700; }
.cocard .r1 .num { font-size: 18px; font-weight: 700; }
.cocard .bar { display: block; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.cocard .bar i { display: block; height: 100%; border-radius: 4px; background: var(--navy); }
.cocard .r3 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sub); }
.netcard { margin: 16px 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.netcard .cap { font-size: 13px; color: var(--sub); }
.netcard .cap .num { font-weight: 600; color: var(--ink); }
.items { margin: 12px 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.items .hd { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--head); }
.items .hd h3 { margin: 0; font-size: 14px; font-weight: 700; }
.items .hd .num { font-size: 16px; font-weight: 700; }
.items .it { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border-top: 1px solid var(--line-2); font-size: 14px; }
.items .it .num { font-size: 15px; font-weight: 500; }
.items .it.strong { font-weight: 700; background: var(--head); }
.items .it.strong .num { font-weight: 700; font-size: 16px; }
.items.plain { padding: 4px 18px; }
.items.plain .it { padding: 0; border-top: 0; color: var(--sub); }
.items.plain .it .num { color: var(--ink); font-weight: 400; }

/* ---- 下部固定ボタン ---- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px calc(16px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.dock .inner { max-width: 448px; margin: 0 auto; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--navy); color: #fff; font-size: 16px; font-weight: 700; text-decoration: none;
}
.dock .btn { height: 54px; }
.btn:disabled { background: var(--off); color: var(--sub-2); cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); height: 52px; font-size: 15px; }
.after-items { margin: 14px 16px 0; }
.btn.text { height: 48px; background: none; color: var(--ink); font-size: 15px; font-weight: 400; text-decoration: underline; }

/* ---- 初回登録 ---- */
.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 28px 20px calc(32px + var(--safe-b)); }
.ob-top { display: flex; align-items: center; justify-content: space-between; }
.ob-top .app-name { font-size: 13px; color: var(--sub); letter-spacing: .04em; }
.steps { display: flex; gap: 6px; }
.steps i { display: block; height: 6px; width: 6px; border-radius: 3px; background: var(--line-3); }
.steps i.on { width: 22px; background: var(--navy); }
.ob-head { display: flex; flex-direction: column; gap: 14px; margin-top: 56px; }
.ob-head.sm { gap: 10px; margin-top: 40px; }
.ob-head h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.4; }
.ob-head.sm h1 { font-size: 24px; }
.ob-head p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--sub); }
.field { display: flex; flex-direction: column; gap: 8px; margin-top: 32px; }
.field label { font-size: 13px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--sub); }
.codein {
  height: 60px; border-radius: 14px; border: 1.5px solid var(--line-3); background: var(--card); padding: 0 18px;
  font-size: 24px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink); width: 100%;
}
.codein:focus { outline: none; border-color: var(--navy); }
.codein::placeholder { color: #A9A496; letter-spacing: .1em; font-size: 18px; }
.err { color: #B3261E; font-size: 13px; margin: 0; }
.grow { flex-grow: 1; min-height: 24px; }
.ob-actions { display: flex; flex-direction: column; gap: 10px; }
.idcard { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.idcard .nm { font-size: 24px; font-weight: 700; }
.idcard .meta { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--sub); }
dl.terms { margin: 20px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px 18px; display: flex; flex-direction: column; }
dl.terms > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; }
dl.terms > div + div { border-top: 1px solid var(--line-2); }
dl.terms dt { font-size: 12px; color: var(--sub); }
dl.terms dd { margin: 0; font-size: 14px; line-height: 1.6; }
.check { margin-top: 18px; display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); margin: 0; flex: 0 0 auto; }

/* ---- 状態表示 ---- */
.center-box { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.center-box h1, .center-box h2 { margin: 0; font-size: 22px; font-weight: 700; }
.center-box p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--sub); }
.medal { width: 72px; height: 72px; border-radius: 36px; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.medal.light { background: var(--card); border: 1px solid var(--line); color: var(--gold-ink); }
.loading { text-align: center; padding: 120px 24px; color: var(--sub); }
.spinner { width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: rgba(27,42,74,.94); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; z-index: 9; max-width: 90%; }
