/* 家族OS の画面
   見た目は「オンチェーン金融動向DB」のトーン&マナー(Apple 風: 薄いグレーの地・枠線のない白いカード・丸いボタン)、
   サイドメニューは経営OS にならって濃い色。色はすべて下の変数から使う。 */

:root {
  color-scheme: light;
  --bg: #f5f5f7; --layer: #ffffff; --layer2: #f5f5f7; --layer3: #f2f2f5;
  --border: #ededf0; --border2: #d2d2d7;
  --text: #1d1d1f; --text2: #6e6e73; --body: #424245;
  --btn: #0071e3; --btn-hover: #0077ed; --link: #0066cc; --focus: #0071e3;
  --pos: #1d7a3a; --neg: #d70015;
  --await-bg: #fdf3d7; --await: #8a6100;
  --ok-bg: #e3f5e8; --ok: #1d7a3a; --info-bg: #e5efff; --info: #0058c7; --ended-bg: #f2f2f5; --ended: #6e6e73;
  --seg-on: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  /* サイドメニュー(経営OS 風の濃い色) */
  --nav-bg: #1d1d1f; --nav-text: #f5f5f7; --nav-text2: #a1a1a6; --nav-on: rgba(255, 255, 255, 0.12); --nav-hover: rgba(255, 255, 255, 0.07); --nav-rule: rgba(255, 255, 255, 0.12);
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --bar-h: 56px; --nav-w: 232px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --layer: #1c1c1e; --layer2: #2c2c2e; --layer3: #2c2c2e;
  --border: #38383a; --border2: #48484a;
  --text: #f5f5f7; --text2: #a1a1a6; --body: #d1d1d6;
  --link: #2997ff; --focus: #2997ff; --pos: #30d158; --neg: #ff453a;
  --await-bg: #3d3000; --await: #f5d77a; --ok-bg: #0f3a1d; --ok: #7ee2a0; --info-bg: #0c2c55; --info: #9cc8ff; --ended-bg: #2c2c2e; --ended: #a1a1a6;
  --seg-on: #636366; --glass: rgba(28, 28, 30, 0.72); --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --nav-bg: #111113; --nav-rule: rgba(255, 255, 255, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"], :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #000000; --layer: #1c1c1e; --layer2: #2c2c2e; --layer3: #2c2c2e;
    --border: #38383a; --border2: #48484a;
    --text: #f5f5f7; --text2: #a1a1a6; --body: #d1d1d6;
    --link: #2997ff; --focus: #2997ff; --pos: #30d158; --neg: #ff453a;
    --await-bg: #3d3000; --await: #f5d77a; --ok-bg: #0f3a1d; --ok: #7ee2a0; --info-bg: #0c2c55; --info: #9cc8ff; --ended-bg: #2c2c2e; --ended: #a1a1a6;
    --seg-on: #636366; --glass: rgba(28, 28, 30, 0.72); --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --nav-bg: #111113; --nav-rule: rgba(255, 255, 255, 0.1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.7;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; word-break: normal; overflow-wrap: anywhere;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ───────── 上の帯 ───────── */
.fos-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
  height: var(--bar-h); padding: 0 16px 0 10px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.fos-topbar__spacer { flex: 1; }
.fos-iconbtn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px;
  background: none; color: var(--text); cursor: pointer;
}
.fos-iconbtn:hover { background: var(--layer3); }
.fos-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; padding: 0 6px; }
.fos-brand:hover { text-decoration: none; }
.fos-brand img { border-radius: 7px; }
.fos-brand__name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.fos-brand__tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px;
  background: var(--layer3); color: var(--text2); font-size: 11px; font-weight: 600;
}
.fos-account { position: relative; }
.fos-account__btn { color: var(--link); }
.fos-account__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; border-radius: 14px;
  background: var(--layer); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--border);
}
.fos-account__name { padding: 9px 12px 6px; color: var(--text2); font-size: 12px; font-weight: 600; }
.fos-account__menu form { margin: 0; }
.fos-account__item { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 13px; cursor: pointer; }
.fos-account__item:hover { background: var(--layer3); }
a.fos-account__item { color: var(--text); text-decoration: none; }
.fos-account__note { padding: 2px 12px 8px; color: var(--text2); font-size: 11px; line-height: 1.5; }
/* デモモード(管理者がダミーデータで見せているとき) */
.fos-demo-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 980px;
  background: var(--await-bg); color: var(--await); font-size: 12px; font-weight: 700; white-space: nowrap;
}
:root[data-demo="on"] .fos-topbar { border-bottom: 2px solid var(--await); }

/* ───────── サイドメニュー(経営OS 風) ───────── */
.fos-nav {
  position: fixed; top: var(--bar-h); bottom: 0; left: 0; z-index: 30; width: var(--nav-w);
  padding: 14px 0 28px; overflow-y: auto; background: var(--nav-bg); color: var(--nav-text);
  transition: transform 0.18s, visibility 0.18s;
}
.fos-nav__item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; margin: 2px 10px; padding: 0 12px;
  border-radius: 10px; color: var(--nav-text); font-size: 14px; font-weight: 600; text-decoration: none;
}
.fos-nav__item svg { width: 17px; height: 17px; color: var(--nav-text2); }
.fos-nav__item:hover { background: var(--nav-hover); text-decoration: none; }
.fos-nav__item.is-active { background: var(--nav-on); }
.fos-nav__item.is-active svg { color: var(--nav-text); }
.fos-nav__item.is-active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-text);
}
.fos-nav__chev { margin-left: auto; width: 14px !important; height: 14px !important; opacity: 0.7; }
.fos-nav__rule { margin: 10px 14px; border: 0; border-top: 1px solid var(--nav-rule); }
:root[data-nav="closed"] .fos-nav { transform: translateX(-100%); visibility: hidden; }
.fos-scrim { position: fixed; inset: var(--bar-h) 0 0 0; z-index: 25; background: rgba(0, 0, 0, 0.35); }

/* ───────── 本文 ───────── */
.fos-main { margin-left: var(--nav-w); padding: 36px 48px 80px; max-width: calc(1240px + var(--nav-w)); transition: margin 0.18s; }
.fos-main:focus { outline: none; }
:root[data-nav="closed"] .fos-main { margin-left: 0; margin-inline: auto; }
.fos-loading { padding: 24px; color: var(--text2); }
.fos-pagehead { margin-bottom: 24px; }
.fos-pagehead__row { display: flex; align-items: center; gap: 16px; }
.fos-pagehead--dept .fos-avatar { width: 56px; height: 56px; }
.fos-pagehead--dept .fos-avatar svg { width: 26px; height: 26px; }
.fos-eyebrow { margin: 0 0 4px; color: var(--text2); font-size: 12px; font-weight: 600; }
.fos-h1 { margin: 0; font-size: 34px; font-weight: 720; line-height: 1.22; letter-spacing: -0.04em; }
.fos-h2 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -0.035em; }
.fos-h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.fos-sub { margin: 4px 0 0; color: var(--text2); font-size: 14px; }
.fos-muted { color: var(--text2); font-size: 13px; }

.fos-card { background: var(--layer); border-radius: 22px; overflow: hidden; margin-bottom: 16px; }
.fos-card--pad { padding: 24px 28px; }
.fos-empty { padding: 18px 24px; color: var(--text2); }
.fos-card--pad .fos-empty { padding: 8px 0; }
.fos-notice { padding: 14px 20px; border-radius: 14px; background: var(--await-bg); color: var(--await); }
.fos-notice--error { background: color-mix(in srgb, var(--neg) 12%, var(--layer)); color: var(--neg); }

/* ボタン */
.fos-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 980px; background: transparent; color: var(--link);
  font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.fos-btn svg { width: 15px; height: 15px; }
.fos-btn--primary { background: var(--btn); color: #fff; }
.fos-btn--primary:hover { background: var(--btn-hover); }
.fos-btn--ghost { border-color: var(--border2); background: var(--layer); }
.fos-btn--ghost:hover { background: var(--layer2); }
.fos-btn--sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.fos-btn:disabled { opacity: 0.5; cursor: default; }
.fos-btnrow { display: flex; gap: 6px; flex: none; }

/* タグ・バッジ・色の点 */
.fos-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); flex: none; }
.fos-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.fos-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 4px;
  background: var(--layer2); color: var(--text); font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
}
.fos-badge--done, .fos-badge--approved { background: var(--ok-bg); color: var(--ok); }
.fos-badge--pending { background: var(--await-bg); color: var(--await); }
.fos-badge--rejected, .fos-badge--withdrawn { background: var(--ended-bg); color: var(--ended); }
.fos-late { margin-left: 6px; color: var(--neg); font-size: 11.5px; font-weight: 600; }
.is-late { color: var(--neg) !important; }

/* チップ・セグメント */
.fos-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fos-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--border2); border-radius: 980px;
  background: var(--layer); color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none;
}
.fos-chip:hover { background: var(--layer2); text-decoration: none; }
.fos-chip.is-active { border-color: var(--text); background: var(--text); color: var(--layer); }
.fos-chip__n { color: var(--text2); font-size: 12px; }
.fos-chip.is-active .fos-chip__n { color: var(--layer); }
.fos-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 10px; background: var(--layer3); }
.fos-seg > button { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; }
.fos-seg > button.is-active { background: var(--seg-on); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* フォーム */
.fos-search { width: 100%; max-width: 420px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--layer3); color: var(--text); font-size: 14px; }
.fos-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fos-form--inline { display: flex; gap: 10px; margin: 0; }
.fos-form--inline input { flex: 1; }
.fos-field { display: grid; gap: 4px; font-size: 13px; }
.fos-field > span { font-weight: 600; color: var(--text2); font-size: 12px; }
.fos-field--wide { grid-column: span 2; }
.fos-form input, .fos-form select {
  width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--layer2); color: var(--text); font-size: 15px;
}
.fos-form__actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.fos-disclosure { margin-top: 16px; }
.fos-disclosure > summary { display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
.fos-disclosure > summary::-webkit-details-marker { display: none; }
.fos-disclosure > summary svg { width: 15px; height: 15px; }

/* フィルタ */
.fos-filter { display: grid; gap: 12px; }
.fos-filter__top { display: flex; align-items: center; gap: 16px; }
.fos-count { color: var(--text2); white-space: nowrap; }
.fos-count strong { color: var(--text); font-size: 17px; }
.fos-filter__row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 12px; }
.fos-filter__label { color: var(--text2); font-size: 13px; }

/* 表 */
.fos-table { font-size: 13px; }
.fos-table__head, .fos-table__row { display: grid; grid-template-columns: 44px 96px minmax(0, 1fr) 140px 96px; align-items: start; }
.fos-table--docs .fos-table__head, .fos-table--docs .fos-table__row { grid-template-columns: minmax(0, 1fr) 140px 100px 110px; }
.fos-table__head > * { display: flex; align-items: center; height: 44px; padding: 0 16px; color: var(--text2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.fos-table__head { border-bottom: 1px solid var(--border); }
.fos-table__row > * { padding: 12px 16px; }
.fos-table__row { border-bottom: 1px solid var(--border); }
.fos-table__row:last-child { border-bottom: 0; }
.fos-table__row:hover { background: var(--layer2); }
.fos-table__row.is-done .fos-table__title { color: var(--text2); text-decoration: line-through; }
.fos-table__date { color: var(--text2); white-space: nowrap; }
.fos-table__title { font-weight: 600; line-height: 1.5; }
.fos-table__note { display: block; margin-top: 2px; color: var(--text2); font-weight: 400; font-size: 12px; }
.fos-table__who { color: var(--text2); }
.fos-check {
  display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; padding: 0; border: 1.5px solid var(--border2); border-radius: 50%;
  background: var(--layer); color: transparent; cursor: pointer;
}
.fos-check svg { width: 13px; height: 13px; stroke-width: 2.2; }
.fos-check:hover { border-color: var(--btn); color: var(--btn); }
.fos-check.is-on { border-color: var(--pos); background: var(--pos); color: #fff; }

/* ───────── ホーム(タイムライン) ───────── */
.fos-home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.fos-feed { margin-bottom: 0; }
.fos-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.fos-tab {
  position: relative; height: 52px; padding: 0 12px; border: 0; background: none; color: var(--text2);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.fos-tab:hover { color: var(--text); }
.fos-tab.is-active { color: var(--text); }
.fos-tab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--btn); }
.fos-post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.fos-post:hover { background: color-mix(in srgb, var(--layer2) 50%, var(--layer)); }
.fos-avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--av) 14%, var(--layer)); color: var(--av);
}
.fos-avatar svg { width: 21px; height: 21px; }
.fos-post__meta { display: flex; flex-wrap: wrap; gap: 4px; color: var(--text2); font-size: 13px; }
.fos-post__meta strong { color: var(--text); font-weight: 700; }
.fos-post__src { color: var(--text2); }
.fos-post__verb { margin-top: 1px; color: var(--text2); font-size: 12.5px; }
.fos-post__title { margin: 2px 0 0; font-size: 15.5px; font-weight: 600; line-height: 1.55; letter-spacing: -0.01em; }
.fos-post__quote { margin-top: 10px; padding: 10px 14px; border: 1px solid var(--border2); border-radius: 14px; color: var(--body); font-size: 13px; }
.fos-post__actions { margin-top: 10px; }
.fos-feed__more { display: flex; justify-content: center; padding: 16px; }

.fos-aside { position: sticky; top: calc(var(--bar-h) + 20px); }
.fos-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fos-metric { display: grid; padding: 14px 16px; border-radius: 16px; background: var(--layer2); color: var(--text); text-decoration: none; }
.fos-metric:hover { text-decoration: none; background: var(--layer3); }
.fos-metric__num { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.035em; }
.fos-metric__label { color: var(--text2); font-size: 12px; font-weight: 600; }
.fos-minilist { margin: 12px 0 0; padding: 0; list-style: none; }
.fos-minilist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.fos-minilist__time { min-width: 3em; color: var(--text2); }
.fos-deptlist { margin: 0 -12px; padding: 0; list-style: none; }
.fos-deptlist a {
  display: grid; grid-template-columns: 8px 68px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 12px; color: var(--text); text-decoration: none;
}
.fos-deptlist a:hover { background: var(--layer2); text-decoration: none; }
.fos-deptlist__name { font-weight: 700; font-size: 14px; }
.fos-deptlist__scope { color: var(--text2); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fos-deptlist__num { color: var(--text2); font-size: 12px; }

/* ───────── カレンダー ───────── */
.fos-cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.fos-cal__nav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.fos-cal__nav .fos-h2 { min-width: 8em; text-align: center; }
.fos-cal__nav .fos-btn { margin-left: auto; }
.fos-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.fos-cal__wd { padding: 4px 0; color: var(--text2); font-size: 12px; font-weight: 600; text-align: center; }
.fos-cal__wd.is-sun { color: var(--neg); }
.fos-cal__wd.is-sat { color: var(--link); }
.fos-cal__day {
  display: flex; flex-direction: column; gap: 2px; min-height: 92px; padding: 6px; border: 0; border-radius: 12px;
  background: var(--layer2); text-align: left; cursor: pointer; overflow: hidden;
}
.fos-cal__day:hover { background: var(--layer3); }
.fos-cal__day.is-out { opacity: 0.45; }
.fos-cal__day.is-selected { box-shadow: inset 0 0 0 2px var(--btn); }
.fos-cal__num { font-size: 13px; font-weight: 600; }
.fos-cal__day.is-today .fos-cal__num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--btn); color: #fff; }
.fos-cal__ev {
  display: block; padding: 1px 6px; border-radius: 4px;
  background: var(--ev, #5b6b82); color: #fff; font-weight: 600; font-size: 11px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fos-cal__more { color: var(--text2); font-size: 11px; }
.fos-eventlist { margin: 0; padding: 0; list-style: none; }
.fos-eventlist li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.fos-eventlist li:first-child { border-top: 0; }
.fos-eventlist__time { color: var(--text2); font-size: 13px; }
.fos-eventlist__title { font-weight: 600; line-height: 1.5; }
.fos-eventlist__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; color: var(--text2); font-size: 12px; }

/* ───────── 一覧 ───────── */
.fos-plainlist { margin: 0; padding: 0; list-style: none; }
.fos-plainlist li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.fos-plainlist li:first-child { border-top: 0; }
.fos-plainlist p { margin: 4px 0 0; }
.fos-plainlist__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fos-plainlist__meta .fos-badge { margin-left: 0; }
.fos-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fos-rule { padding: 22px 24px; border-radius: 22px; background: var(--layer); }
.fos-card .fos-rule { padding: 14px 0; border-radius: 0; border-top: 1px solid var(--border); }
.fos-card .fos-rule:first-of-type { border-top: 0; }
.fos-rule__head { display: flex; align-items: center; gap: 8px; }
.fos-rule__head .fos-badge { margin-left: 0; }
.fos-rule__title { margin: 8px 0 4px; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.fos-rule__body { margin: 0; color: var(--body); white-space: pre-wrap; }

/* ───────── メール ───────── */
.fos-mail { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.fos-mail:last-child { border-bottom: 0; }
.fos-mail .fos-badge { margin-left: 4px; }
.fos-mail__subject { display: block; margin: 2px 0 0; padding: 0; border: 0; background: none; color: var(--text); font-size: 15.5px; font-weight: 600; line-height: 1.55; text-align: left; cursor: pointer; }
.fos-mail__subject:hover { color: var(--link); }
.fos-mail__snippet { margin: 2px 0 0; color: var(--text2); font-size: 13px; }
.fos-mail__body { margin-top: 10px; padding: 14px 16px; border-radius: 14px; background: var(--layer2); }
.fos-mail__body pre { margin: 6px 0 0; font-family: var(--sans); font-size: 13px; line-height: 1.7; white-space: pre-wrap; max-height: 480px; overflow: auto; }
.fos-post__verb .fos-badge { margin-left: 6px; }

/* ───────── お知らせ・ルーティン・家族・コンテキスト ───────── */
.fos-sechead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin: 32px 0 12px; }
.fos-sechead:first-of-type { margin-top: 8px; }
.fos-insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.fos-insight { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px 18px; border-radius: 22px; background: var(--layer); }
.fos-insight__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text2); font-size: 12px; }
.fos-insight__meta .fos-badge { margin-left: 0; }
.fos-insight__title { margin: 2px 0 0; font-size: 17px; font-weight: 700; line-height: 1.4; letter-spacing: -0.02em; }
.fos-insight__summary { margin: 0; color: var(--body); }
.fos-insight__more { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.fos-insight__more > summary { color: var(--link); font-size: 13px; cursor: pointer; }
.fos-insight__body { margin-top: 8px; color: var(--body); font-size: 13px; white-space: pre-wrap; }
.fos-insight__links { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.fos-routines { margin: 0; padding: 0; list-style: none; }
.fos-routines li { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.fos-routines li:first-child { border-top: 0; padding-top: 0; }
.fos-routines li.is-off { opacity: 0.55; }
.fos-routines .fos-badge { margin-left: 0; }
.fos-routines p { margin: 4px 0 0; }
.fos-routines__when { color: var(--text2); font-size: 12px; }
.fos-routines .fos-btnrow { flex-wrap: wrap; justify-content: flex-end; max-width: 300px; }
.fos-field--full { grid-column: 1 / -1; }
.fos-field--check { display: flex; align-items: center; gap: 8px; align-self: end; height: 42px; }
.fos-field--check input { width: 18px; height: 18px; }
.fos-field--check span { color: var(--text); font-size: 13px; font-weight: 500; }
.fos-form textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--layer2); color: var(--text); font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; }
.fos-table--members .fos-table__head, .fos-table--members .fos-table__row { grid-template-columns: minmax(120px, 1.2fr) 90px 120px 120px 90px 100px 110px; }
.fos-levels dl { display: grid; grid-template-columns: 72px 1fr; gap: 8px 12px; margin: 0; }
.fos-levels dt { font-weight: 700; }
.fos-levels dd { margin: 0; color: var(--body); }
dialog.fos-modal { width: min(560px, calc(100% - 32px)); padding: 28px 32px; border: 0; border-radius: 24px; background: var(--layer); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
dialog.fos-modal::backdrop { background: rgba(10, 16, 22, 0.55); }
.fos-form--modal { grid-template-columns: 1fr 1fr; margin: 0; }
.fos-form--modal .fos-form__actions { gap: 8px; }

/* ───────── 部門ごとの中身(第2段階) ───────── */
.fos-h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.fos-cardhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.fos-cardhead .fos-h3 .fos-muted { font-weight: 400; }
.fos-badge--late { background: color-mix(in srgb, var(--neg) 14%, var(--layer)); color: var(--neg); }
.fos-badge--info { background: var(--info-bg); color: var(--info); }
.fos-plainlist li.is-off, .fos-insight.is-off { opacity: 0.55; }
.fos-insight .fos-btnrow { margin-top: auto; padding-top: 8px; }
.fos-fitchart { min-width: 0; }
.fos-lchart { min-height: 180px; }
.fos-lchart .fos-chart circle { transition: r 0.12s; }
.fos-lchart .fos-chart circle:hover { r: 6; }
.fos-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0 4px; }
.fos-chart { width: 100%; height: auto; display: block; stroke: none; }
.fos-chart--empty { display: grid; place-items: center; height: 120px; border-radius: 14px; background: var(--layer2); color: var(--text2); font-size: 13px; }
.fos-chart__grid { stroke: var(--border); stroke-width: 1; }
.fos-chart__axis { fill: var(--text2); font-size: 11px; font-family: var(--sans); }
.fos-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.fos-goals .fos-plainlist li { padding: 10px 0; }
.fos-linkbtn { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--link); font-size: 13px; cursor: pointer; }
.fos-minutes__body { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--layer2); }
.fos-minutes > div { flex: 1; }
.fos-table--contacts .fos-table__head, .fos-table--contacts .fos-table__row { grid-template-columns: minmax(120px, 1fr) 110px 70px 110px 90px minmax(120px, 1.4fr); }
.fos-minilist a { color: var(--text); flex: 1; }
.fos-minilist__date { margin-left: auto; color: var(--text2); font-size: 12px; white-space: nowrap; }
.fos-minilist .fos-late { margin-left: auto; white-space: nowrap; }

/* ───────── 余暇・カレンダー連携 ───────── */
.fos-cal__day.is-holiday .fos-cal__num { color: var(--neg); }
.fos-cal__hol { color: var(--neg); font-size: 10px; line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fos-cal__ev.is-busy { opacity: 0.78; }
.fos-steps { margin: 0 0 12px; padding-left: 20px; color: var(--body); }
.fos-steps li { margin: 4px 0; }

/* ───────── 家計 ───────── */
.fos-nav__sub { display: none; margin: 0 0 4px; }
.fos-nav__sub.is-open { display: block; }
.fos-nav__item--sub { height: 34px; padding-left: 42px; font-size: 13px; font-weight: 500; color: var(--nav-text2); }
.fos-nav__item--sub.is-active { color: var(--nav-text); background: var(--nav-on); }
.fos-nav__item--sub.is-active::before { display: none; }
.fos-nav__item.is-expanded .fos-nav__chev { transform: rotate(90deg); }
.fos-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.fos-kpis--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fos-kpi { padding: 22px 24px 20px; border-radius: 20px; background: var(--layer); }
.fos-kpi__label { color: var(--text2); font-size: 13px; font-weight: 600; }
.fos-kpi__label .fos-muted { font-weight: 400; font-size: 11px; margin-left: 4px; }
.fos-kpi__value { margin-top: 6px; font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.035em; }
.fos-kpi__value small { margin-left: 2px; color: var(--text2); font-size: 14px; font-weight: 500; }
.fos-kpi__bar { display: flex; gap: 3px; height: 6px; margin: 12px 0 8px; border-radius: 3px; overflow: hidden; background: var(--layer3); }
.fos-kpi__bar span { display: block; height: 100%; }
.fos-kpi__note { margin-top: 2px; color: var(--text2); font-size: 12px; }
.is-neg { color: var(--neg) !important; }
.is-pos { color: var(--pos); }
.fos-unit { margin-left: 8px; font-size: 12px; font-weight: 600; }
.fos-fintable-wrap { overflow-x: auto; padding: 8px 0; }
.fos-fintable { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fos-fintable th, .fos-fintable td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); }
.fos-fintable thead th { vertical-align: bottom; color: var(--text2); font-size: 12px; font-weight: 600; }
.fos-fintable thead small { display: block; font-weight: 400; }
.fos-fintable tbody th { position: sticky; left: 0; background: var(--layer); text-align: left; font-weight: 500; color: var(--text2); }
.fos-fintable tr.is-bold td, .fos-fintable tr.is-bold th { font-weight: 700; color: var(--text); }
.fos-fintable .is-split { border-left: 1px solid var(--border2); }
.fos-fintable__group { display: block; margin-bottom: 4px; text-align: left; color: var(--text2); font-size: 11px; }
.fos-fintable tbody tr:last-child td, .fos-fintable tbody tr:last-child th { border-bottom: 0; }
.fos-finbal { display: flex; align-items: center; gap: 12px; }
.fos-barlist { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.fos-barlist li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 150px; align-items: center; gap: 12px; }
.fos-barlist__name { font-weight: 600; font-size: 13px; }
.fos-barlist__name small { display: block; color: var(--text2); font-weight: 400; font-size: 11px; }
.fos-barlist__bar { position: relative; height: 10px; border-radius: 5px; background: var(--layer3); }
.fos-barlist__bar i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: #3d5a99; }
.fos-barlist__bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text2); opacity: 0.6; }
.fos-barlist__val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fos-barlist__val small { display: block; color: var(--text2); font-size: 11px; font-weight: 500; }
.fos-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fos-txlist { margin: 0; padding: 0; list-style: none; }
.fos-txrow { display: grid; grid-template-columns: 90px minmax(0, 1fr) 150px 120px auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.fos-txrow:first-child { border-top: 0; }
.fos-txrow.is-off { opacity: 0.5; }
.fos-txrow .fos-badge { margin-left: 0; }
.fos-txrow select { height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--layer2); color: var(--text); font-size: 13px; }
.fos-txrow__amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fos-form__actions label.fos-btn { cursor: pointer; margin-right: auto; }
@media (max-width: 1100px) { .fos-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fos-two { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .fos-kpis, .fos-kpis--2 { grid-template-columns: 1fr; }
  .fos-txrow { grid-template-columns: 70px minmax(0, 1fr) auto; }
  .fos-txrow > :nth-child(3), .fos-txrow > :nth-child(5) { grid-column: 2 / -1; }
  .fos-barlist li { grid-template-columns: 90px minmax(0, 1fr) 110px; }
}

/* ───────── 育児記録 ───────── */
.fos-babyhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fos-tabs--page { margin: 0 0 16px; padding: 0 4px; }
.fos-daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fos-daynav__label { display: grid; min-width: 12em; text-align: center; }
.fos-daynav__label strong { font-size: 19px; letter-spacing: -0.02em; }
.fos-daynav__label span { color: var(--text2); font-size: 12px; }
.fos-iconbtn:disabled { opacity: 0.3; cursor: default; }
.fos-bchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fos-bchip { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 14px; background: var(--layer); }
.fos-bchip::before { content: ''; flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.fos-bchip span { color: var(--text2); font-size: 12px; }
.fos-bchip strong { font-size: 15px; letter-spacing: -0.01em; }
.fos-babynow { margin: 0 0 12px; color: var(--body); font-size: 13px; }
.fos-babygrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.fos-babyday { display: grid; grid-template-columns: 44px minmax(0, 1fr); min-height: 560px; }
.fos-rail { position: relative; background: var(--layer2); border-right: 1px solid var(--border); }
.fos-rail > span { position: absolute; left: 6px; transform: translateY(2px); color: var(--text2); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.fos-rail__sleep { position: absolute; left: 26px; width: 8px; border-radius: 4px; background: #6b5fd6; opacity: 0.85; }
.fos-rail__mark { position: absolute; right: 3px; width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: #d98a1c; }
.fos-rail__mark.is-poop { border-radius: 2px; background: #8a6a3a; right: 12px; }
.fos-blist { margin: 0; padding: 0; list-style: none; }
.fos-blist li { border-bottom: 1px solid var(--border); }
.fos-bicon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); flex: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 70%, #000 30%); }
.fos-bicon svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2; }
.fos-bicon.is-lg { width: 40px; height: 40px; }
.fos-bicon.is-lg svg { width: 23px; height: 23px; }
.fos-blist__row { display: grid; grid-template-columns: 52px 30px auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; padding: 12px 18px; border: 0; background: none; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.fos-blist__row:hover:not(:disabled) { background: var(--layer2); }
.fos-blist__row:disabled { cursor: default; }
.fos-blist__row time { color: var(--text2); font-variant-numeric: tabular-nums; }
.fos-blist__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.fos-blist__label { font-weight: 600; white-space: nowrap; }
.fos-blist__detail { color: #c0558b; font-size: 13px; }
:root[data-theme="dark"] .fos-blist__detail { color: #ef9cbd; }
.fos-babyside { display: grid; gap: 16px; position: sticky; top: calc(var(--bar-h) + 16px); }
.fos-babyside .fos-card { margin-bottom: 0; }
.fos-quick__group { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.fos-quick__group:first-of-type { border-top: 0; }
.fos-quick__name { padding-top: 6px; color: var(--text2); font-size: 11px; font-weight: 600; }
.fos-quick__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.fos-quick__btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.fos-qbtn { display: grid; justify-items: center; gap: 4px; padding: 8px 2px 6px; border: 0; border-radius: 12px; background: none; color: var(--text); font-size: 11.5px; line-height: 1.2; cursor: pointer; }
.fos-qbtn:hover { background: color-mix(in srgb, var(--c) 14%, var(--layer)); }
.fos-qbtn:hover .fos-bicon { transform: scale(1.06); }
.fos-qbtn span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fos-quick__add { margin-top: 10px; }
.fos-quick__add input { height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--layer2); color: var(--text); font-size: 13px; }
#b-diary textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--layer2); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
#b-diary .fos-btnrow { justify-content: flex-end; margin-top: 8px; }
#b-diary label.fos-btn { cursor: pointer; }
.fos-diaryphoto { display: block; width: 100%; max-height: 260px; object-fit: cover; margin-bottom: 10px; border-radius: 14px; }
.fos-sumchart { margin-top: 16px; }
.fos-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text2); font-size: 12px; }
.fos-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
/* 家計の月別の推移の内訳の色(分類の色。明るい表示と暗い表示で、それぞれの面に合わせて検証した段) */
:root { --fin-s1: #2a78d6; --fin-s2: #eb6834; --fin-s3: #1baf7a; --fin-s4: #eda100; --fin-s5: #e87ba4; --fin-s6: #008300; --fin-other: #a3a3a8; }
:root[data-theme="dark"] { --fin-s1: #3987e5; --fin-s2: #d95926; --fin-s3: #199e70; --fin-s4: #c98500; --fin-s5: #d55181; --fin-s6: #0ca30c; --fin-other: #6e6e73; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"], :root:not([data-theme]) { --fin-s1: #3987e5; --fin-s2: #d95926; --fin-s3: #199e70; --fin-s4: #c98500; --fin-s5: #d55181; --fin-s6: #0ca30c; --fin-other: #6e6e73; }
}
.fos-legend__hatch { background: repeating-linear-gradient(45deg, var(--text2) 0 1.5px, transparent 1.5px 4px); opacity: 0.6; box-shadow: inset 0 0 0 1px var(--text2); }
.fos-legend--note { margin-top: 4px; font-size: 11.5px; }
.fos-sumchart .fos-legend { margin: 6px 0 12px; }
.fos-chart__val { fill: var(--text); font-size: 11px; font-weight: 600; font-family: var(--sans); }
.fos-chart__track { fill: var(--layer2); }
.fos-chart__axis.is-today { fill: var(--link); font-weight: 600; }
.fos-table--week .fos-table__head, .fos-table--week .fos-table__row { grid-template-columns: 64px repeat(7, minmax(0, 1fr)); }
.fos-table--week .fos-table__head > *, .fos-table--week .fos-table__row > * { padding: 8px 6px; text-align: center; }
.fos-seg--sm > button { height: 26px; padding: 0 10px; font-size: 12px; }
@media (max-width: 1180px) {
  .fos-babygrid { grid-template-columns: minmax(0, 1fr); }
  .fos-babyside { position: static; order: -1; }
}
/* 下の記録バー(スマホ・タブレット)。1行で横にすべらせる。右端の「一覧」は固定 */
.fos-bbar { display: none; }
.fos-sheet .fos-cardhead { display: flex; align-items: center; justify-content: space-between; }
.fos-sheet__hint { margin: 0 0 4px; font-size: 12px; }
@media (max-width: 900px) {
  .fos-babyside { order: 0; }
  .fos-babyside .fos-quick { display: none; }
  .fos-main:has(.fos-bbar) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body:has(.fos-bbar) .fos-toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .fos-bbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--layer) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .fos-bbar__row {
    flex: 1; min-width: 0; display: flex; gap: 2px; padding: 6px 6px 4px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .fos-bbar__row::-webkit-scrollbar { display: none; }
  .fos-bbar .fos-qbtn { flex: none; width: 58px; padding: 4px 0; font-size: 11px; scroll-snap-align: start; -webkit-tap-highlight-color: transparent; }
  .fos-bbar .fos-qbtn:active { background: color-mix(in srgb, var(--c) 18%, var(--layer)); }
  .fos-bbar .fos-bicon.is-lg { width: 38px; height: 38px; }
  .fos-bbar__more {
    flex: none; display: grid; justify-items: center; align-content: center; gap: 4px; width: 56px; padding: 4px 0;
    border: 0; border-left: 1px solid var(--border); background: none; color: var(--text2); font-size: 11px; cursor: pointer;
  }
  .fos-bbar__more svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 3; stroke-linecap: round; fill: none; }
  /* 上の見出し・日付・合計は小さく詰めて、タイムラインを主役にする */
  .fos-main:has(.fos-babyhead) { padding-top: 10px; }
  .fos-babyhead { flex-wrap: nowrap; align-items: center; gap: 8px; margin-bottom: 2px; }
  .fos-babyhead .fos-eyebrow { display: none; }
  .fos-babyhead .fos-h1 { font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
  .fos-babyhead .fos-seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fos-babyhead .fos-seg > button { height: 26px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
  .fos-babyhead + .fos-tabs--page { margin-bottom: 6px; }
  .fos-babyhead + .fos-tabs--page .fos-tab { height: 36px; font-size: 13px; }
  .fos-babyhead + .fos-tabs--page .fos-tab.is-active::after { height: 2px; }
  .fos-daynav { gap: 2px; margin-bottom: 4px; }
  .fos-daynav .fos-iconbtn { width: 32px; height: 32px; }
  .fos-daynav__label { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .fos-daynav__label strong { font-size: 15px; }
  .fos-daynav__label span { font-size: 11.5px; }
  .fos-bchips { flex-wrap: nowrap; gap: 6px; margin: 0 -16px 6px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .fos-bchips::-webkit-scrollbar { display: none; }
  .fos-bchip { flex: none; gap: 5px; padding: 3px 9px; border-radius: 8px; }
  .fos-bchip span { font-size: 11px; }
  .fos-bchip strong { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
  .fos-babynow { margin-bottom: 6px; font-size: 12px; }
  .fos-babyday { grid-template-columns: 30px minmax(0, 1fr); }
  .fos-rail > span { left: 3px; font-size: 9.5px; }
  .fos-rail__sleep { left: 17px; width: 6px; }
  .fos-rail__mark { right: 2px; width: 6px; height: 6px; }
  .fos-rail__mark.is-poop { right: 8px; }
  .fos-blist__row { grid-template-columns: 38px 22px auto minmax(0, 1fr); gap: 7px; padding: 5px 10px; font-size: 13px; line-height: 1.3; }
  .fos-blist__row time { font-size: 12px; }
  .fos-blist__row .fos-bicon { width: 22px; height: 22px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, #000 30%); }
  .fos-blist__row .fos-bicon svg { width: 13px; height: 13px; }
  .fos-blist__detail { font-size: 11.5px; }
  dialog.fos-sheet {
    width: 100%; max-width: 100%; max-height: 80vh; margin: auto 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0; overflow-y: auto;
  }
}
@media (max-width: 900px) {
  .fos-table--week .fos-table__head { display: grid; }
  .fos-table--week .fos-table__row { grid-template-columns: 64px repeat(7, minmax(0, 1fr)); }
  .fos-table--week .fos-table__row > :first-child { grid-row: auto; padding-top: 8px; }
}

/* ───────── アルバム ───────── */
.fos-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.fos-albumcard { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 22px; background: var(--layer3); color: #fff; overflow: hidden; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.fos-albumcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
/* カードは正方形。中は 2×2 の4枚(足りないところは空き) */
.fos-albumcard__grid { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.fos-albumcard__grid img, .fos-albumcard__grid > span { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: var(--layer2); }
.fos-albumcard__empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--text2); }
.fos-albumcard__empty svg { width: 40px; height: 40px; stroke-width: 1.2; }
.fos-albumcard__meta { position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 36px 14px 12px; background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0)); }
.fos-albumcard__meta strong { font-size: 14px; letter-spacing: -0.01em; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fos-albumcard__meta span { color: rgba(255, 255, 255, 0.82); font-size: 12px; }
.fos-albumhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.fos-albumhead label.fos-btn { cursor: pointer; }
.fos-griddate { margin: 24px 0 8px; color: var(--text2); font-size: 13px; font-weight: 600; }
.fos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; border-radius: 16px; overflow: hidden; }
.fos-tile { position: relative; display: block; aspect-ratio: 1; padding: 0; border: 0; background: var(--layer3); cursor: pointer; overflow: hidden; }
.fos-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.fos-tile:hover img { transform: scale(1.03); }
.fos-tile__ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text2); }
.fos-tile__ph svg { width: 32px; height: 32px; }
.fos-tile__video { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.fos-tile__video svg { width: 13px; height: 13px; fill: #fff; stroke: none; }
.fos-tile__likes { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.fos-main.is-drop { outline: 3px dashed var(--btn); outline-offset: -12px; border-radius: 24px; }
.fos-upload__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.fos-progress { height: 6px; border-radius: 3px; background: var(--layer3); overflow: hidden; }
.fos-progress span { display: block; height: 100%; width: 0; background: var(--btn); transition: width 0.2s; }

/* タイムラインの写真(X のように最大4枚) */
.fos-postgrid { display: grid; gap: 3px; margin-top: 10px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); max-width: 520px; }
.fos-postgrid span { position: relative; display: block; background: var(--layer3); aspect-ratio: 1; }
.fos-postgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fos-postgrid em { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 22px; font-weight: 700; font-style: normal; }
.fos-postgrid--1 { grid-template-columns: 1fr; }
.fos-postgrid--1 span { aspect-ratio: 16 / 10; }
.fos-postgrid--2 { grid-template-columns: 1fr 1fr; }
.fos-postgrid--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.fos-postgrid--3 span:first-child { grid-row: span 2; aspect-ratio: auto; }
.fos-postgrid--4 { grid-template-columns: 1fr 1fr; }
.fos-post__title a { color: var(--text); }

/* 拡大表示 */
.fos-viewer { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: rgba(0, 0, 0, 0.94); color: #f5f5f7; }
.fos-viewer .fos-iconbtn { color: #f5f5f7; }
.fos-viewer .fos-iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.fos-viewer__top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 20px; font-size: 13px; color: #a1a1a6; }
.fos-viewer__tools { display: flex; gap: 4px; }
.fos-viewer__stage { position: relative; min-height: 0; overflow: hidden; }
.fos-viewer__stage img, .fos-viewer__stage video { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0 64px; object-fit: contain; }
.fos-viewer__nav { z-index: 1; }
.fos-viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; }
.fos-viewer__nav:hover { background: rgba(255, 255, 255, 0.22); }
.fos-viewer__nav--prev { left: 12px; }
.fos-viewer__nav--next { right: 12px; }
.fos-viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; }
.fos-viewer__info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.fos-viewer__info span { color: #a1a1a6; }
.fos-viewer__info p { flex-basis: 100%; margin: 2px 0 0; }
.fos-viewer__acts { display: flex; gap: 8px; }
.fos-viewer__like { height: 34px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 980px; background: none; color: #f5f5f7; font-size: 13px; cursor: pointer; }
.fos-viewer__like.is-on { border-color: #ff375f; color: #ff375f; }
.fos-viewer__comments { max-height: 34vh; overflow: auto; padding: 0 20px 16px; }
.fos-viewer__comments ul { margin: 0 0 10px; padding: 0; list-style: none; font-size: 13px; }
.fos-viewer__comments li { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.fos-viewer__comments input { flex: 1; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 14px; }
@media (max-width: 700px) {
  .fos-viewer__stage img, .fos-viewer__stage video { padding: 0; }
  .fos-viewer__nav { display: none; }
  .fos-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; border-radius: 10px; }
}

/* ───────── ログイン・お知らせ ───────── */
.fos-signin { max-width: 520px; margin: 48px auto; padding: 40px; text-align: center; }
.fos-signin img { border-radius: 12px; }
.fos-signin .fos-h2 { margin: 16px 0 12px; }
.fos-plain { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.fos-plain__card { width: min(440px, 100%); padding: 36px 32px; border-radius: 24px; background: var(--layer); text-align: center; }
.fos-plain__card form { margin: 20px 0; }
.fos-title { margin: 0 0 12px; font-size: 24px; font-weight: 700; letter-spacing: -0.035em; }
.fos-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 980px; background: var(--text); color: var(--layer); font-size: 13px; box-shadow: var(--shadow);
}
.fos-toast--error { background: var(--neg); color: #fff; }
body.is-signed-out .fos-nav, body.is-signed-out #nav-btn, body.is-signed-out .fos-account { display: none; }
body.is-signed-out .fos-main { margin-left: 0; }

/* ───────── 狭い画面 ───────── */
@media (max-width: 1180px) {
  .fos-home, .fos-cal-layout { grid-template-columns: minmax(0, 1fr); }
  .fos-aside { position: static; }
}
@media (max-width: 900px) {
  .fos-nav { transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow); }
  :root[data-nav-mobile="open"] .fos-nav { transform: none; visibility: visible; }
  .fos-main, :root[data-nav="closed"] .fos-main { margin-left: 0; padding: 20px 16px 56px; }
  .fos-h1 { font-size: 28px; }
  .fos-form { grid-template-columns: 1fr 1fr; }
  .fos-table__head { display: none; }
  .fos-table__row { grid-template-columns: 40px minmax(0, 1fr); }
  .fos-table__row > * { padding: 4px 12px; }
  .fos-table__row > :first-child { grid-row: span 4; padding-top: 12px; }
  .fos-table__row > :nth-child(2) { padding-top: 12px; }
  .fos-table__row > :last-child { padding-bottom: 12px; }
  .fos-table--docs .fos-table__row { grid-template-columns: 1fr; }
  .fos-table--docs .fos-table__row > :first-child { grid-row: auto; }
  .fos-post { padding: 16px; }
  .fos-cal__day { min-height: 64px; }
  .fos-cal__ev { font-size: 0; padding: 0; height: 6px; background: var(--ev, #5b6b82); }
  .fos-search, .fos-form input, .fos-form select { font-size: 16px; }
}
@media (max-width: 560px) {
  .fos-brand__tag { display: none; }
  .fos-form { grid-template-columns: 1fr; }
  .fos-field--wide { grid-column: auto; }
  .fos-filter__row { grid-template-columns: 1fr; gap: 6px; }
  .fos-card--pad { padding: 20px; }
}

/* 成長曲線 */
.fos-growth__now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 14px 0 6px; }
.fos-growth__now strong { font-size: 22px; letter-spacing: -0.01em; }

/* ───────── 部門のページ(左: 部門ごとの中身 / 右: タスク・予定・お知らせ・ルール) ───────── */
.fos-deptpage { margin-bottom: 8px; }
.fos-deptpage__main > [data-block]:first-child > .fos-sechead:first-child { margin-top: 0; }
.fos-deptpage__side { position: static; display: flex; flex-direction: column; gap: 0; }
.fos-deptpage__side .fos-card { margin-bottom: 16px; }
.fos-deptpage__side .fos-cardhead { margin-bottom: 4px; }
.fos-link { color: var(--link); font-size: 13px; text-decoration: none; }
.fos-link:hover { text-decoration: underline; }

.fos-sidelist { margin: 8px 0 4px; padding: 0; list-style: none; }
.fos-sidelist li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.fos-sidelist li:first-child { border-top: 0; }
.fos-sidelist .fos-check { width: 22px; height: 22px; margin-top: 1px; }
.fos-sidelist__title { font-size: 14px; line-height: 1.45; }
.fos-sidelist__meta { display: flex; gap: 10px; margin-top: 2px; color: var(--text2); font-size: 12px; }
.fos-sidelist__meta .is-late { color: var(--neg); font-weight: 600; }
.fos-sidelist li.is-done .fos-sidelist__title { color: var(--text2); text-decoration: line-through; }
.fos-deptpage__side .fos-disclosure { margin-top: 8px; }
.fos-deptpage__side .fos-form { grid-template-columns: 1fr; }

.fos-sidedetail { border-top: 1px solid var(--border); }
.fos-sidedetail:first-of-type { border-top: 0; }
.fos-sidedetail > summary { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; cursor: pointer; list-style: none; }
.fos-sidedetail > summary::-webkit-details-marker { display: none; }
.fos-sidedetail__meta { color: var(--text2); font-size: 12px; }
.fos-sidedetail__title { font-size: 14px; font-weight: 600; line-height: 1.45; }
.fos-sidedetail[open] > summary .fos-sidedetail__title { color: var(--link); }
.fos-sidedetail > p, .fos-sidedetail > .fos-insight__body, .fos-sidedetail > ul { margin: 0 0 12px; font-size: 13px; color: var(--body); }
.fos-sidemore { border-top: 1px solid var(--border); }
.fos-sidemore > summary { padding: 10px 0 2px; color: var(--link); font-size: 13px; cursor: pointer; }
.fos-sidemore--wide { border-top: 0; margin: -4px 0 16px; }
.fos-sidemore--wide > summary { padding: 0 0 12px; }

.fos-notice--link { display: block; margin-bottom: 16px; color: var(--await); text-decoration: none; font-weight: 600; }
.fos-notice--link:hover { text-decoration: underline; }
.fos-finmore { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 16px; }

.fos-babytoday { display: block; color: inherit; text-decoration: none; }
.fos-babytoday:hover { box-shadow: inset 0 0 0 1px var(--border); }
.fos-babystats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fos-babystat { display: flex; align-items: center; gap: 10px; }
.fos-babystat > div > span { display: block; color: var(--text2); font-size: 12px; }
.fos-babystat > div { min-width: 0; line-height: 1.35; }
.fos-babytoday, .fos-babytoday:hover { color: var(--text); text-decoration: none; }
.fos-babystat strong { font-size: 15px; white-space: nowrap; }
@media (max-width: 700px) { .fos-babystats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* スマホではアルバムを2列に */
@media (max-width: 700px) {
  .fos-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fos-albumcard { border-radius: 16px; }
  .fos-albumcard__meta { padding: 28px 10px 9px; }
  .fos-albumcard__meta strong { font-size: 13px; }
}

/* パスキー */
.fos-signin__or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--text2); font-size: 12px; }
.fos-signin__or::before, .fos-signin__or::after { content: ''; flex: 1; border-top: 1px solid var(--border, rgba(0, 0, 0, 0.1)); }
.fos-signin .fos-btn--primary { min-width: 220px; }
.fos-signin__err { margin-top: 12px; color: var(--danger, #c2414b); font-size: 13px; }
.fos-passkey-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 20px; }
.fos-passkey-prompt p { flex: 1; min-width: 220px; margin: 0; }

/* ───────── 暮らし ───────── */
.fos-residence { margin-bottom: 8px; }
.fos-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin: 10px 0 0; }
.fos-dl dt { color: var(--text2); font-size: 12px; font-weight: 600; }
.fos-dl dd { margin: 2px 0 0; font-size: 14px; word-break: break-word; }
.fos-residence__docs { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.fos-residence__doc { grid-template-columns: minmax(0, 1fr) !important; }
.fos-residence__note { margin-top: 4px; font-size: 12px; white-space: pre-wrap; }
.fos-living { margin-bottom: 16px; }
.fos-living > .fos-card { margin-bottom: 0; }
.fos-quickadd { display: flex; gap: 8px; margin: 12px 0 4px; }
.fos-quickadd input { flex: 1; min-width: 0; }
.fos-shoplist li { grid-template-columns: 28px minmax(0, 1fr) auto; }
.fos-iconbtn--sm { width: 28px; height: 28px; }
.fos-iconbtn--sm svg { width: 16px; height: 16px; }
.fos-meals { margin: 10px 0 0; padding: 0; list-style: none; }
.fos-meals li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); }
.fos-meals li:first-child { border-top: 0; }
.fos-meals li.is-today .fos-meals__day { color: var(--link); font-weight: 700; }
.fos-meals li.is-editing { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.fos-meals__day { color: var(--text2); font-size: 13px; white-space: nowrap; }
.fos-meals__menu { font-size: 14px; line-height: 1.5; }
.fos-meals__menu .fos-muted { font-size: 12px; }
.fos-meals__form { display: grid; gap: 8px; }
.fos-homelist li { align-items: center; }
.fos-homelist .fos-btnrow { align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
.fos-homelist .fos-btnrow .fos-linkbtn { margin-top: 0; }
#home-kind { margin-bottom: 6px; flex-wrap: wrap; }

/* 子どもの貯金 */
.fos-pots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 12px; }
.fos-pot { padding: 20px 22px 16px; border-radius: 20px; background: var(--layer); }
.fos-pot.is-off { opacity: 0.55; }
.fos-pot__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; }
.fos-pot__bal { margin: 8px 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.fos-pot__bal small { margin-left: 2px; color: var(--text2); font-size: 13px; font-weight: 500; }
.fos-pot .fos-linkbtn { margin-top: 8px; }
#kid-who { margin-bottom: 14px; }
@media (max-width: 900px) { .fos-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 数字は折り返さない。1枚だけのとき(資金繰りの残高など)は横いっぱいに。スマホでは2列に収まる大きさにする */
.fos-kpi__value { white-space: nowrap; }
@media (max-width: 900px) { .fos-kpi:only-child { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .fos-kpis { gap: 10px; }
  .fos-kpi { min-width: 0; padding: 14px 14px 12px; border-radius: 16px; }
  .fos-kpi__value { font-size: clamp(16px, 5.6vw, 21px); letter-spacing: -0.03em; }
  .fos-kpi__value small { font-size: 12px; }
  .fos-kpi:only-child .fos-kpi__value { font-size: 28px; }
  .fos-kpi__note { font-size: 11px; }
}
.fos-select--sm { height: 30px; padding: 0 8px; border: 1px solid var(--border, rgba(0, 0, 0, 0.12)); border-radius: 8px; background: var(--layer); color: var(--text); font-size: 12px; }
/* タイムラインの「いいね」「コメント」の写真(1枚・小さめ) */
.fos-postgrid--photo { max-width: 240px; }
.fos-postgrid--photo span { position: relative; aspect-ratio: 1 / 1; }
.fos-postgrid .fos-postgrid__heart { position: absolute; inset: auto 8px 8px auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); }
.fos-postgrid .fos-postgrid__heart svg { width: 17px; height: 17px; fill: #ff5a7a; stroke: none; }
/* アルバムの見出し: 長い名前やボタンが横にはみ出さないように折り返す */
.fos-albumhead > div { min-width: 0; }
.fos-albumhead .fos-h1 { overflow-wrap: anywhere; }
.fos-albumhead .fos-btnrow { flex: 0 1 auto; flex-wrap: wrap; }
@media (max-width: 700px) {
  .fos-albumhead .fos-btnrow { width: 100%; }
  .fos-albumhead .fos-btnrow > * { flex: 1 1 calc(50% - 6px); justify-content: center; text-align: center; }
}
/* アルバム: 上げた人で絞る・まとめてダウンロード */
.fos-albumtools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 16px; }
.fos-albumtools .fos-btn svg { width: 15px; height: 15px; margin-right: 4px; }
.fos-pagehead .fos-albumtools { margin: 16px 0 0; }
.fos-dlpanel { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; width: min(340px, calc(100vw - 40px)); padding: 16px 18px; border-radius: 16px; background: var(--layer); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.fos-dlpanel > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.fos-dlpanel .fos-kpi__bar { margin: 0; }
.fos-dlpanel button { justify-self: end; }
/* タイムライン: コメントはツイートのように本文で、写真の下にアルバム名 */
.fos-post__tweet { margin: 4px 0 0; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.fos-postphoto { margin: 10px 0 0; }
.fos-postphoto .fos-postgrid { margin-top: 0; }
.fos-postphoto figcaption { margin-top: 6px; font-size: 12.5px; }
.fos-postphoto figcaption a { display: inline-flex; align-items: center; gap: 5px; color: var(--text2); }
.fos-postphoto figcaption svg { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
/* ルールブック: タップで全文。本文は見出し・箇条書き・表を整えて出す */
.fos-rule > summary { list-style: none; cursor: pointer; }
.fos-rule > summary::-webkit-details-marker { display: none; }
.fos-rule__lead { margin: 0; color: var(--text2); font-size: 13px; }
.fos-rule__more { display: inline-block; margin-top: 8px; color: var(--link); font-size: 12.5px; }
.fos-rule[open] { grid-column: 1 / -1; }
.fos-rule[open] .fos-rule__lead { display: none; }
.fos-rule[open] .fos-rule__more::before { content: '閉じる'; }
.fos-rule[open] .fos-rule__more { font-size: 0; }
.fos-rule[open] .fos-rule__more::before { font-size: 12.5px; }
.fos-rule .fos-rule__body { margin-top: 14px; white-space: normal; }
.fos-md { font-size: 14px; line-height: 1.75; }
.fos-md p { margin: 0 0 10px; }
.fos-md h3 { margin: 22px 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.fos-md h4 { margin: 16px 0 6px; font-size: 15px; font-weight: 700; }
.fos-md ul, .fos-md ol { margin: 0 0 12px; padding-left: 1.4em; }
.fos-md li { margin: 3px 0; }
.fos-md .fos-md__check { list-style: none; padding-left: 0; }
.fos-md .fos-md__check input { margin-right: 6px; vertical-align: -1px; }
.fos-md code { padding: 1px 5px; border-radius: 4px; background: var(--layer3); font-size: 0.92em; }
.fos-md a { overflow-wrap: anywhere; }
.fos-md__table { overflow-x: auto; margin: 0 0 14px; -webkit-overflow-scrolling: touch; }
.fos-md table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.6; }
.fos-md th, .fos-md td { padding: 8px 10px; border-bottom: 1px solid var(--border2, rgba(0, 0, 0, 0.08)); text-align: left; vertical-align: top; }
.fos-md th { color: var(--text2); font-weight: 600; white-space: nowrap; }
.fos-pre { white-space: pre-wrap; margin: 4px 0 0; }
.fos-fr__resp { margin: 6px 0 0; font-size: 13px; }
/* タスク: 状態の切り替えと、右から開く詳しい表示 */
.fos-table--tasks .fos-table__head, .fos-table--tasks .fos-table__row { grid-template-columns: 44px 96px minmax(0, 1fr) 130px 90px 116px; }
.fos-table--tasks .fos-table__row { cursor: pointer; }
.fos-table__state { padding-top: 9px !important; padding-bottom: 9px !important; }
.fos-table__cmt { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--text2); font-size: 11.5px; font-weight: 500; }
.fos-table__cmt svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.fos-tstate { height: 28px; padding: 0 22px 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--layer2); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.fos-tstate--doing { background: color-mix(in srgb, #d99a1c 16%, var(--layer)); border-color: color-mix(in srgb, #d99a1c 45%, transparent); }
.fos-tstate--done { background: color-mix(in srgb, #1f7a5c 14%, var(--layer)); border-color: color-mix(in srgb, #1f7a5c 40%, transparent); }
.fos-tstate--someday, .fos-tstate--cancelled { color: var(--text2); }
.fos-panel-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.28); opacity: 0; transition: opacity 0.2s; }
.fos-panel-scrim.is-open { opacity: 1; }
.fos-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(620px, 100vw); overflow-y: auto; padding: 18px 28px 40px; background: var(--bg, var(--layer)); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16); transform: translateX(100%); transition: transform 0.2s ease; }
.fos-panel.is-open { transform: none; }
.fos-panel__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fos-panel__title { width: 100%; margin: 0 0 12px; padding: 4px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 20px; font-weight: 700; line-height: 1.4; letter-spacing: -0.02em; resize: none; overflow: hidden; }
.fos-panel__title:focus { outline: none; box-shadow: inset 0 -2px 0 var(--link); }
.fos-panel__props { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.fos-panel__due { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.fos-panel__due input { height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--layer); color: var(--text); font: inherit; font-size: 12px; }
.fos-panel__h { margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 700; }
.fos-panel__notes, .fos-panel__cform textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--layer); color: var(--text); font: inherit; font-size: 14px; line-height: 1.6; resize: vertical; }
.fos-panel__comments, .fos-panel__activity { margin: 0 0 12px; padding: 0; list-style: none; }
.fos-panel__comments li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.6; }
.fos-panel__cmeta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; font-size: 13px; }
.fos-panel__activity li { padding: 6px 0; font-size: 13px; }
@media (max-width: 700px) {
  .fos-table--tasks .fos-table__head { display: none; }
  .fos-table--tasks .fos-table__row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: 'chk title state' 'chk meta meta'; }
  .fos-table--tasks .fos-table__row > :nth-child(1) { grid-area: chk; }
  .fos-table--tasks .fos-table__row > :nth-child(3) { grid-area: title; }
  .fos-table--tasks .fos-table__row > :nth-child(6) { grid-area: state; }
  .fos-table--tasks .fos-table__row > :nth-child(2) { grid-area: meta; padding-top: 0 !important; font-size: 12px; }
  .fos-table--tasks .fos-table__row > :nth-child(4), .fos-table--tasks .fos-table__row > :nth-child(5) { display: none; }
  .fos-table--tasks .fos-table__row > :nth-child(3), .fos-table--tasks .fos-table__row > :nth-child(6) { padding-top: 12px; }
  .fos-panel { padding: 14px 18px 40px; }
}

/* カレンダー: 家族ごとの色の見本 */
.fos-callegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; color: var(--text2); font-size: 12px; }
.fos-callegend span { display: inline-flex; align-items: center; gap: 5px; }
.fos-evsw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--ev, #5b6b82); vertical-align: -1px; }
.fos-callegend .fos-evsw { margin-right: 0; }
.fos-evsw--hol { background: var(--neg, #c2414b); }
/* お知らせ: 画像付きのカード */
.fos-icard { display: block; margin-top: 8px; max-width: 520px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; color: var(--text); text-decoration: none; background: var(--layer); }
.fos-icard:hover { text-decoration: none; background: var(--layer2); }
.fos-icard__img { aspect-ratio: 1.91 / 1; background: var(--layer3); overflow: hidden; }
.fos-icard__img img, .fos-insight__img img, .fos-sidedetail__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fos-icard__body { padding: 12px 14px 14px; }
.fos-icard__body strong { display: block; font-size: 15px; line-height: 1.45; letter-spacing: -0.01em; }
.fos-icard__body p { margin: 4px 0 0; color: var(--text2); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fos-insight__img { margin: -22px -24px 14px; aspect-ratio: 1.91 / 1; overflow: hidden; background: var(--layer3); border-radius: 22px 22px 0 0; }
.fos-sidedetail__img { aspect-ratio: 1.91 / 1; margin-bottom: 8px; border-radius: 10px; overflow: hidden; background: var(--layer3); }
/* お知らせのアクションと詳しいページ */
.fos-iabar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fos-iabtn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--layer); color: var(--text2); font-size: 12px; font-weight: 600; cursor: pointer; }
.fos-iabtn:hover { color: var(--text); background: var(--layer2); }
.fos-iabtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fos-iabtn.is-on { color: var(--link); border-color: color-mix(in srgb, var(--link) 45%, transparent); background: color-mix(in srgb, var(--link) 8%, var(--layer)); }
.fos-iabtn[data-ia="save"].is-on svg, .fos-iabtn[data-ia="unsave"] svg { fill: currentColor; }
.fos-iabtn:disabled { cursor: default; }
.fos-insightpage { max-width: 760px; }
.fos-insightpage__img { aspect-ratio: 1.91 / 1; margin: 10px 0 16px; border-radius: 20px; overflow: hidden; background: var(--layer3); }
.fos-insightpage__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fos-insightpage__title { margin: 8px 0 10px; font-size: 28px; }
.fos-insightpage__lead { margin: 0 0 16px; font-size: 16px; line-height: 1.7; }
.fos-insightpage__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.fos-insightpage__actions .fos-iabar { margin-top: 0; }
.fos-insightpage__actions .fos-btn svg { width: 15px; height: 15px; margin-left: 4px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fos-insightpage__body { margin-bottom: 22px; }
.fos-insight__title a { color: var(--text); }
.fos-insight__imglink { display: block; }
.fos-savedlist { margin-bottom: 16px; }
.fos-savedlist li { display: flex; justify-content: space-between; gap: 10px; }
/* タスクの一覧: 状態の切り替えは欄の幅に収める */
.fos-table--tasks .fos-table__state { padding-left: 8px !important; padding-right: 14px !important; min-width: 0; }
.fos-table--tasks .fos-tstate { width: 100%; min-width: 0; max-width: 100%; }
.fos-table--tasks { overflow: hidden; }
/* タイムライン: お知らせから作ったタスク・議題に付ける小さなカード */
.fos-imini { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 10px; color: var(--text2); font-size: 12px; text-decoration: none; }
.fos-imini:hover { text-decoration: none; background: var(--layer2); }
.fos-imini__img { width: 56px; height: 30px; border-radius: 6px; overflow: hidden; background: var(--layer3); }
.fos-imini__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* スマホ: 一覧の中のボタンや切り替えは折り返す。家族の一覧は1人ずつ折り返して並べる */
@media (max-width: 700px) {
  .fos-plainlist li { flex-wrap: wrap; }
  .fos-plainlist li > div:first-child { flex: 1 1 220px; min-width: 0; }
  .fos-plainlist .fos-btnrow { flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; }
  .fos-table--members .fos-table__head { display: none; }
  .fos-table--members .fos-table__row { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 12px 14px; }
  .fos-table--members .fos-table__row > * { padding: 0 !important; grid-row: auto !important; }
  .fos-table--members .fos-table__row > :first-child { flex: 1 1 100%; font-weight: 600; }
}

/* はい・いいえのダイアログの文 */
.fos-askmsg { margin: 0 0 4px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
/* デモ: 誰として見るかの切り替え */
.fos-account__item.is-current { font-weight: 700; color: var(--link); }
.fos-account__rule { margin: 6px 0; border: 0; border-top: 1px solid var(--border); }
.fos-topic { display: flex; flex-direction: column; gap: 4px; }
.fos-topic .fos-imini { margin-top: 4px; align-self: flex-start; }
#m-topics .fos-form--inline { margin-top: 12px; }
.fos-signin__logo { border-radius: 12px; }
