/* Rutas（ルタス）— コーポレートカラー第3版 */
:root {
  --night: #0e1f17;
  --shadow: #13281f;
  --mint: #92d5a9;
  --cream: #eeebe2;
  --sage: #e2ece1;
  --deep: #24704a;
  --gray: #4b5a51;
  --lgray: #a9b6ad;
  --line: #c7dac7;
  --card: #eef3ec;
  --paper: #fafbf8;
  --warn: #b5651d;
  --warn-bg: #f6eadb;
  --danger: #a63d32;
  --danger-bg: #f5e1de;
  --ok-bg: #dcefe1;
  --radius: 10px;
  --font: 'Noto Sans JP', system-ui, -apple-system, 'Hiragino Sans', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--sage); color: var(--night); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--deep); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--gray); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* レイアウト */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--night); color: var(--cream); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-logo { height: 34px; width: auto; flex: none; }
.brand b { display: block; font-size: 15px; letter-spacing: .04em; }
.brand span { font-size: 10px; letter-spacing: .18em; color: var(--mint); }
.nav-group { font-size: 10px; letter-spacing: .16em; color: var(--lgray); padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--cream); text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: var(--shadow); }
.nav a.on { background: var(--mint); color: var(--night); font-weight: 600; }
.nav a .count { margin-left: auto; background: var(--mint); color: var(--night); border-radius: 99px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.nav a.on .count { background: var(--night); color: var(--mint); }
.nav svg { width: 17px; height: 17px; flex: none; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--shadow); font-size: 12px; }
.side-foot b { display: block; font-size: 13px; }
.side-foot button { background: none; border: 1px solid var(--gray); color: var(--cream); border-radius: 6px; padding: 3px 10px; margin-top: 8px; cursor: pointer; font-size: 12px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.top h1 { font-size: 20px; margin: 0; letter-spacing: .03em; }
.top .sub { color: var(--gray); font-size: 12px; }
.top .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 12px 28px 48px; }
.top .menu-btn { display: none; }

/* 部品 */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h2 { font-size: 14px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .en { font-size: 10px; letter-spacing: .16em; color: var(--deep); font-weight: 600; }
.card h2 .right { margin-left: auto; font-weight: 400; font-size: 12px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g1 { grid-template-columns: 1fr; }
.tasks li { align-items: flex-start; }
.tasks li.done .tt { text-decoration: line-through; color: var(--gray); }
.tasks li.late .lt { color: #a3341f; }
.tasks .chk { padding-top: 2px; }
.tasks .chk input { width: 18px; height: 18px; accent-color: var(--deep); }
.mtg + .mtg { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.pre { white-space: pre-wrap; font-size: 13px; }
.files-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.folders li { padding: 5px 0; }
.folders li a { text-decoration: none; color: inherit; flex: 1; }
.folders li.on a { font-weight: 700; color: var(--deep); }
.kmonths { display: grid; grid-template-columns: 190px minmax(0, 1fr) 230px; gap: 14px; align-items: start; padding: 6px 0; }
.kmonths .kname { font-size: 13px; line-height: 1.6; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; }
.kgrid .btn { justify-content: center; font-variant-numeric: tabular-nums; }
.know { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.setform .srow { display: grid; grid-template-columns: 300px minmax(0, 480px); gap: 12px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.setform .srow label { font-size: 13px; }
.mfile li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mfile li a { text-decoration: none; }
.notes-f { flex-wrap: wrap; gap: 8px; align-items: center; }
.notes-f .chip { cursor: pointer; border: 1px solid var(--line); background: var(--paper); }
.notes-f .chip.on { background: var(--night); color: var(--cream); border-color: var(--night); }
.nlist { display: grid; gap: 10px; }
.ncard.open { box-shadow: inset 4px 0 0 #c0503a; }
.nhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.nhead .right { margin-left: auto; }
.ntitle { font-weight: 700; margin: 2px 0 4px; }
.nfoot { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.ncal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ncal-w { text-align: center; font-size: 12px; font-weight: 700; color: var(--gray); }
.ncal-w.sun, .ncal-d .n.sun { color: #b4452f; }
.ncal-w.sat, .ncal-d .n.sat { color: #2f5f9a; }
.ncal-d { min-height: 82px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 4px; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; font: inherit; color: inherit; overflow: hidden; }
.ncal-d.empty { border: 0; background: none; cursor: default; }
.ncal-d.today { border-color: var(--deep); }
.ncal-d.sel { outline: 2px solid var(--deep); }
.ncal-d .n { font-size: 12px; font-weight: 700; }
.ncal-i { font-size: 10.5px; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--card); }
.ncal-i.open { outline: 1.5px solid #c0503a; }
.k-trouble.ncal-i, .ncal-dot.k-trouble { background: #f5e1de; }
.k-handover.ncal-i, .ncal-dot.k-handover { background: #d9efe1; }
.k-interview.ncal-i, .ncal-dot.k-interview { background: #dcefe1; border-left: 3px solid var(--deep); }
.k-contact.ncal-i, .ncal-dot.k-contact { background: #f6ead6; }
.k-other.ncal-i, .ncal-dot.k-other { background: var(--card); }
.ncal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.dnotes li, .daynotes li { gap: 8px; align-items: flex-start; }
.dnotes li.open { background: #fbf0ee; border-radius: 6px; padding-left: 6px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }
.section-title .right { float: right; letter-spacing: 0; font-weight: 400; }
.kpi .foot .meter { display: block; margin-top: 5px; }
table.t tr.hl td { background: var(--card); font-weight: 600; }
.span2 { grid-column: span 2; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
.kpi .label { font-size: 11.5px; color: var(--gray); }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 12px; font-weight: 500; margin-left: 2px; }
.kpi .foot { font-size: 11px; color: var(--gray); }
.kpi.alert { border-color: var(--mint); box-shadow: inset 4px 0 0 var(--mint); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--night); }
.btn:hover { border-color: var(--deep); }
.btn.primary { background: var(--night); color: var(--cream); border-color: var(--night); }
.btn.primary:hover { background: var(--shadow); }
.btn.mint { background: var(--mint); border-color: var(--mint); color: var(--night); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.b-ok { background: var(--ok-bg); border-color: #b5dcc0; color: var(--deep); }
.b-warn { background: var(--warn-bg); border-color: #e7cba9; color: var(--warn); }
.b-danger { background: var(--danger-bg); border-color: #e6bdb7; color: var(--danger); }
.b-dark { background: var(--night); border-color: var(--night); color: var(--cream); }
.b-mint { background: var(--mint); border-color: var(--mint); color: var(--night); }
.tag.acc { background: var(--night); color: var(--mint); }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 4px; background: var(--sage); color: var(--deep); margin: 1px 2px 1px 0; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; color: var(--gray); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 8px; border-bottom: 1px solid #dfe8de; vertical-align: top; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--card); }
.t td.r, .t th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--gray); padding: 28px 0; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: none; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--night); color: var(--cream); }

label.f { display: block; font-size: 12px; color: var(--gray); margin-bottom: 10px; }
label.f > span { display: block; margin-bottom: 3px; }
input.i, select.i, textarea.i { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 10px; font-size: 14px; color: var(--night); }
input.i:focus, select.i:focus, textarea.i:focus { outline: 2px solid var(--mint); border-color: var(--deep); }
textarea.i { min-height: 90px; resize: vertical; }
.filters input.i, .filters select.i { width: auto; min-width: 140px; padding: 5px 10px; font-size: 13px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--deep); }

/* ドロワー・モーダル */
.overlay { position: fixed; inset: 0; background: rgba(14, 31, 23, .38); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--paper); z-index: 41; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(14, 31, 23, .18); }
/* 小さな画面（modal）は flex と vh を使わない。新しいChromeで高さが0になり、暗い幕だけが出ていたため（2026-10-26） */
.modal { position: fixed; left: 50%; top: 5%; transform: translateX(-50%); width: min(620px, calc(100% - 32px)); height: auto; max-height: 90%; overflow-y: auto; background: var(--paper); z-index: 41; display: block; border-radius: 14px; box-shadow: 0 20px 50px rgba(14, 31, 23, .25); }
.modal .d-head { position: sticky; top: 0; background: var(--paper); z-index: 1; border-radius: 14px 14px 0 0; }
.modal .d-foot { position: sticky; bottom: 0; background: var(--paper); border-radius: 0 0 14px 14px; }
.modal.wide { width: min(940px, calc(100% - 32px)); }
.d-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.d-head h3 { margin: 0; font-size: 16px; }
.d-head .x { margin-left: auto; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--gray); line-height: 1; }
.d-body { padding: 16px 20px; }
.drawer .d-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.drawer .d-head, .drawer .d-foot { flex: none; }
.d-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; margin: 0 0 14px; }
.dl dt { color: var(--gray); }
.dl dd { margin: 0; word-break: break-all; }
.section-title { font-size: 11px; letter-spacing: .14em; color: var(--deep); font-weight: 700; margin: 18px 0 8px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--night); color: var(--cream); padding: 10px 18px; border-radius: 10px; z-index: 60; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); }
.note { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--gray); }
.note.warn { background: var(--warn-bg); border-color: #e7cba9; color: #6d4419; }
.note b { color: var(--night); }

/* メーター・グラフ */
.meter { height: 8px; background: var(--card); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--deep); }
.meter.hot > i { background: var(--warn); }
.chart svg { width: 100%; height: auto; display: block; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #e3ebe2; font-size: 13px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .when { font-variant-numeric: tabular-nums; color: var(--gray); font-size: 12px; min-width: 88px; }

/* 権限表 */
.perm { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm th, .perm td { padding: 6px 8px; border-bottom: 1px solid #e3ebe2; }
.perm td.c { text-align: center; }
.perm input { accent-color: var(--deep); width: 16px; height: 16px; }
.role-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.role-card h4 { margin: 0 0 2px; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font-size: 11px; border-radius: 4px; padding: 0 6px; background: var(--card); border: 1px solid var(--line); }
.chip.edit { background: var(--ok-bg); color: var(--deep); border-color: #b5dcc0; }
code.k { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; display: block; font-size: 12px; word-break: break-all; white-space: pre-wrap; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.copy-row code.k { flex: 1; }

/* ログイン */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--night); padding: 16px; }
.auth-logo { height: 64px; width: auto; }
.auth-card { width: min(400px, 100%); background: var(--paper); border-radius: 16px; padding: 28px; }
.auth-card h1 { font-size: 18px; margin: 10px 0 2px; }
.auth-card .en { font-size: 10px; letter-spacing: .2em; color: var(--deep); font-weight: 700; }

@media (max-width: 1100px) {
  .g6, .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 14px 16px 4px; flex-wrap: wrap; }
  .content { padding: 10px 16px 40px; }
  .g2, .g3, .g4, .files-wrap, .kmonths, .setform .srow { grid-template-columns: 1fr; }
  .g6, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: auto; }
  .row { flex-direction: column; gap: 0; }
}


/* 事業所の切り替え */
.office-sel { background: var(--shadow); color: var(--cream); border-color: var(--gray); margin: 0 4px 10px; width: calc(100% - 8px); }
.office-one { color: var(--mint); font-size: 13px; padding: 0 12px 10px; }

/* 集計の帯 */
.sum { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.sum > div { display: flex; flex-direction: column; min-width: 64px; }
.sum span { font-size: 11px; color: var(--gray); }
.sum b { font-size: 18px; }
.sum b small { font-size: 11px; font-weight: 500; margin-left: 2px; }

/* 支援記録の行 */
.recs { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rec { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.rec.saved { border-color: #b5dcc0; box-shadow: inset 4px 0 0 var(--deep); }
.rec.saved.st-absent_support { box-shadow: inset 4px 0 0 var(--warn); }
.rec.saved.st-absent { box-shadow: inset 4px 0 0 var(--lgray); }
.rec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.rec-name { min-width: 150px; display: flex; flex-direction: column; }
.rec-name b { font-size: 14.5px; }
.rec-name .tag { align-self: flex-start; }
.rec-time { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rec-time .small { width: 100%; }
input.i.t { width: 108px; padding: 5px 6px; }
input.i.n { width: 64px; padding: 5px 6px; margin: 0 4px; }
.rec-brk { font-size: 12.5px; color: var(--gray); display: flex; align-items: center; }
.rec-act { margin-left: auto; display: flex; gap: 6px; }
.rec-body { display: none; border-top: 1px solid var(--line); padding: 12px 14px; }
.rec.open .rec-body { display: block; }
.rec:not(.st-present) .p-only, .rec:not(.st-present) .p-only-b { display: none; }
.rec:not(.st-absent_support) .a-only { display: none; }
/* 欠席時対応の行も「詳しく／閉じる」で開け閉めする（欠席時対応を選んだときは開く） */
.rec-sub { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.recs.readonly .save { display: none; }
.in-modal .rec { border: 0; box-shadow: none; }
.in-modal .rec-body { display: block; }
.in-modal .toggle { display: none; }
.seg.st button { padding: 4px 10px; }
.seg.st button[data-st="absent_support"].on { background: var(--warn); }
.seg.st button[data-st="absent"].on { background: var(--gray); }
.lbl { font-size: 12px; color: var(--gray); margin: 6px 0 3px; display: flex; align-items: center; gap: 8px; }
select.i.tpl { width: auto; padding: 1px 6px; font-size: 12px; max-width: 220px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 7px; font-size: 12.5px; background: #fff; cursor: pointer; white-space: nowrap; }
.pill input { accent-color: var(--deep); width: 15px; height: 15px; margin: 0; }
.pill:has(input:checked) { background: var(--ok-bg); border-color: #b5dcc0; color: var(--deep); }
.hist-item { border-bottom: 1px solid var(--line); padding: 8px 0; }
.dl-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; }

/* 月の表 */
.month-t tr.sun td:first-child { color: var(--danger); }
.month-t tr.sat td:first-child { color: #2f5f8a; }
.month-t td { padding: 6px 8px; }
.clamp { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.dragging td { background: var(--ok-bg); }

/* タイムカード */
.tc-wrap.kiosk { min-height: 100vh; padding: 18px 22px; }
.tc-top { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.tc-clock { font-size: 15px; }
.tc-clock b { font-size: 30px; margin-left: 10px; font-variant-numeric: tabular-nums; }
.tc-office { font-weight: 600; display: flex; align-items: center; }
.tc-top .btn { margin-left: auto; }
.tc-title { font-size: 12px; letter-spacing: .12em; color: var(--deep); font-weight: 700; margin: 16px 0 8px; }
.tc-title span { color: var(--gray); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tc { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 14px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 72px; }
.tc b { font-size: 16px; }
.tc small { color: var(--gray); font-size: 12px; }
.tc.in { background: var(--night); color: var(--cream); border-color: var(--night); }
.tc.in small { color: var(--mint); }
.tc.out { background: var(--card); }
.tc.absent { opacity: .55; }
.tc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn.big { font-size: 20px; padding: 22px 0; justify-content: center; border-radius: 12px; }

@media (max-width: 820px) {
  .rec-act { margin-left: 0; width: 100%; }
  .rec-act .btn { flex: 1; justify-content: center; }
  .dl-list { grid-template-columns: 1fr; }
  .tc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 支援計画のお知らせ（日別の記録） */
details.alerts { background: var(--danger-bg); border: 1px solid #e6bdb7; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
details.alerts summary { cursor: pointer; font-weight: 600; color: var(--danger); }
details.alerts ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
details.alerts li.warn { color: #6d4419; }
details.alerts li.danger { color: var(--danger); }

/* 個別支援計画 */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.stepper div { padding: 8px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); font-size: 12.5px; color: var(--gray); }
.stepper .done { background: var(--ok-bg); color: var(--deep); border-color: #b5dcc0; }
.stepper .now { background: var(--night); color: var(--cream); border-color: var(--night); font-weight: 600; }
.plan-sec { margin-top: 12px; }
.plan-sec.later { opacity: .55; }
.plan-sec .step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 12px; }
.plan-sec .step.done { background: var(--deep); color: #fff; border-color: var(--deep); }
.goals td { min-width: 90px; }
.goals td:nth-child(1), .goals td:nth-child(2) { min-width: 240px; }
.goals textarea.i { min-height: 54px; }
.plan-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.mon-goal { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }

/* 利用・欠席予約 */
.sched table { font-size: 12px; }
.sched th, .sched td { padding: 4px 3px; text-align: center; border-right: 1px solid #e7eee6; }
.sched th.nm { text-align: left; position: sticky; left: 0; background: var(--paper); z-index: 1; min-width: 120px; padding-left: 8px; }
.sched th.sun { color: var(--danger); }
.sched th.sat { color: #2f5f8a; }
.sched td.sc { cursor: pointer; min-width: 26px; font-weight: 600; }
.sched td.sc:hover { background: var(--card); }
.sched td.use { background: var(--ok-bg); color: var(--deep); }
.sched td.absent { background: var(--warn-bg); color: var(--warn); }
.sched td.rec { background: var(--night); color: var(--mint); }
.sched td.out { background: repeating-linear-gradient(45deg, #f3f6f1, #f3f6f1 4px, #e8eee6 4px, #e8eee6 8px); cursor: default; }
.sched tr.tot td { font-weight: 600; }
td.warn { color: var(--warn); }
td.over, .over { color: var(--danger); font-weight: 700; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--deep); cursor: pointer; font: inherit; font-weight: 600; text-align: left; }

/* 集計 */
.daybars { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-bottom: 18px; }
.daybars .db { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.daybars .db i { display: block; width: 100%; background: var(--deep); border-radius: 3px 3px 0 0; min-height: 1px; }
.daybars .db.over i { background: var(--danger); }
.daybars .db span { position: absolute; bottom: -17px; font-size: 10px; color: var(--gray); }
.daybars .capline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--warn); margin-bottom: 18px; }
.daybars .capline span { position: absolute; right: 0; top: -16px; font-size: 10.5px; color: var(--warn); }

@media (max-width: 820px) {
  .stepper { grid-template-columns: 1fr 1fr; }
}
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--gray); margin: 4px 2px 10px; align-items: center; }

/* ポチパスから移行 */
.seg.tabs { flex-wrap: wrap; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }
b.req { font-size: 10.5px; color: var(--danger); font-weight: 700; margin-left: 4px; }
details.res { border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-size: 12.5px; }
details.res.err { background: var(--danger-bg); color: var(--danger); }
details.res.warn { background: var(--warn-bg); color: #6d4419; }
details.res summary { cursor: pointer; font-weight: 600; }
details.res ul { margin: 6px 0 0; padding-left: 18px; max-height: 260px; overflow-y: auto; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 26px 16px; text-align: center; background: #fff; }
.drop.on { border-color: var(--deep); background: var(--ok-bg); }

/* AIで入力・かんたん作成 */
.rec-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.btn.ai-btn { background: var(--shadow); color: var(--mint); border-color: var(--shadow); }
.btn.ai-btn:hover { background: var(--night); }
.gen-note { width: 100%; font-size: 12.5px; background: var(--danger-bg, #fbe9e7); color: #8a2c1d; border-radius: 6px; padding: 6px 10px; }
.gen-note.ok { background: var(--ok-bg, #e2ece1); color: var(--deep, #24704A); }
textarea.need-edit { outline: 2px solid #e0a39a; outline-offset: -1px; }
.ai-note { width: 100%; font-size: 12.5px; background: var(--warn-bg); color: #6d4419; border-radius: 6px; padding: 6px 10px; }
.ai-masked { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; max-height: 260px; overflow-y: auto; }
.rec.draft { border-color: var(--mint); box-shadow: inset 4px 0 0 var(--mint); }
.rec.draft .save { background: var(--deep); border-color: var(--deep); }
.draftbar { position: sticky; top: 8px; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--night); color: var(--cream); border-radius: 10px; padding: 8px 14px; margin-top: 12px; font-size: 13px; }
form.writer .field { display: block; font-size: 12px; color: var(--gray); margin-bottom: 8px; }
form.writer .field span { display: block; margin-bottom: 3px; }
form.writer select, form.writer input, form.writer textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 10px; font-size: 14px; color: var(--night); font-family: inherit; }

/* よく使う文 */
.phr { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; align-items: center; }
.phr:empty { display: none; }
.phl { font-size: 10.5px; color: var(--gray); margin-right: 2px; }
.phl:not(:first-child) { margin-left: 8px; }
.phc { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--night); text-align: left; }
.phc.mine { background: var(--ok-bg); border-color: #b5dcc0; color: var(--deep); }
.phc:hover { border-color: var(--deep); }
.phc.combo { background: #fffaf0; border-color: #ead9b5; }
.phc.combo b { font-size: 10.5px; color: #9a6b12; margin-right: 6px; font-weight: 600; }
.phs { border: none; background: none; color: var(--deep); font-size: 12px; cursor: pointer; padding: 2px 6px; }
.phs:hover { text-decoration: underline; }

details.sec { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 0 0 10px; background: #fff; }
details.sec summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--deep); padding: 2px 0; }
details.sec[open] summary { margin-bottom: 8px; }

/* 利用者シフト */
.sched td.sc { position: relative; min-width: 30px; height: 30px; }
.sched td.use.p-full { background: #f2b8b5; color: #7a1f1a; }
.sched td.use.p-am { background: #f7e08c; color: #6d5410; }
.sched td.use.p-pm { background: #bcd7ea; color: #1f4f73; }
.sched td.use.p-home { background: #f9d4d2; color: #8a3a35; }
.sched td.absent { background: #e6e6e6; color: #666; }
.sched td.closed, .sched th.closed { background: #f0f0f0; color: #aaa; }
.sched th.sun, .sched td.sun.dn { color: var(--danger); }
.sched th.sat { color: #2f5f8a; }
.sched td.sc small { display: block; font-size: 9px; color: var(--danger); font-weight: 400; line-height: 1.1; white-space: nowrap; }
.sched td.sc i.done { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--night); }
.sched tr.dnote td { font-size: 10px; color: var(--deep); height: 22px; white-space: nowrap; cursor: pointer; }
.sched tr.need td, .sched tr.need th { color: var(--gray); font-size: 11px; }
.sched th.dh { cursor: pointer; }
.sched td.tot1 { font-weight: 700; }

.goals td.gm { min-width: 150px; }

/* ダッシュボード */
a.kpi { cursor: pointer; }
a.kpi:hover { border-color: var(--deep); }
.kpi.t-ok { box-shadow: inset 4px 0 0 var(--deep); }
.kpi.t-warn { box-shadow: inset 4px 0 0 var(--warn); border-color: #e7cba9; }
.kpi.t-danger { box-shadow: inset 4px 0 0 var(--danger); border-color: #e6bdb7; }
.kpi .value .badge { font-size: 13px; vertical-align: middle; }
.alerts-list li { align-items: baseline; flex-wrap: nowrap; gap: 6px; padding: 3px 0; }
.alerts-list li > .small { flex: 1; min-width: 0; font-size: 12px; line-height: 1.5; }
.alerts-list .lvl { flex: none; }
.lvbtn { cursor: pointer; border: 1px solid transparent; font: inherit; }
.lvbtn:hover, .lvbtn.on { border-color: currentColor; }
.lvbtn.on { box-shadow: 0 0 0 2px var(--line); }
.alerts-list .lvl { font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 0 6px; }
.alerts-list li.danger .lvl { background: var(--danger-bg); color: var(--danger); }
.alerts-list li.warn .lvl { background: var(--warn-bg); color: var(--warn); }
.dbars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; }
.dbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 18px; position: relative; cursor: default; }
.dbar i { display: block; width: 100%; max-width: 22px; background: var(--deep); border-radius: 4px 4px 0 0; min-height: 0; }
.dbar:hover i { background: var(--night); }
.dbar span { position: absolute; bottom: 0; font-size: 10px; color: var(--gray); }
.dbar span.sun { color: var(--danger); }
.dbar span.sat { color: #2f5f8a; }
.dline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--gray); pointer-events: none; }
.dline span { position: absolute; right: 0; top: -15px; font-size: 10.5px; color: var(--gray); background: var(--paper); padding: 0 4px; }
details.tbl { margin-top: 8px; font-size: 12px; }
details.tbl summary { cursor: pointer; color: var(--deep); }
.ctip { position: fixed; z-index: 70; background: var(--night); color: var(--cream); font-size: 12px; padding: 4px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.meter-s { display: flex; align-items: center; gap: 6px; min-width: 110px; }
.meter-s .meter { flex: 1; }
td.sun { color: var(--danger); }
td.sat { color: #2f5f8a; }

.t.insp td { vertical-align: middle; }

.duebar { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; }
.duebar b { font-size: 15px; margin-left: 4px; }
.plist td, .plist th { white-space: nowrap; }
.plist td.al { white-space: normal; min-width: 260px; }
.plist td.al .badge { white-space: normal; display: inline-block; margin: 1px 0; line-height: 1.4; }

/* アップデートのお知らせ */
.upd { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; width: min(440px, calc(100% - 32px)); background: var(--night); color: var(--cream); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.upd-t { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.upd-t::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 8px; vertical-align: 2px; }
.upd-m { font-size: 12.5px; line-height: 1.6; color: var(--cream); opacity: .92; }
.upd-b { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.upd-b .btn:not(.primary) { background: transparent; color: var(--cream); border-color: rgba(238, 235, 226, .4); }
.upd-b .btn.primary { background: var(--mint); color: var(--night); border-color: var(--mint); }
.upd-c { font-size: 12px; margin-right: auto; opacity: .85; }

/* 目標工賃向上計画 */
.wp-eff { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.wp-eff label { font-size: 13px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); cursor: pointer; }
.wp-eff label:has(input:checked) { background: var(--ok-bg); border-color: var(--deep); color: var(--deep); font-weight: 600; }

/* 国保連請求 */
.note.err { background: var(--danger-bg); border-color: #e6bdb7; color: var(--danger); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* 支援記録（日別）：時間のまとめ */
details.times-card { margin-top: 12px; }
details.times-card > summary { cursor: pointer; padding: 2px 0; }
details.times-card[open] > summary { margin-bottom: 8px; }
.tb-times td, .tb-times th { white-space: nowrap; }
.danger-t { color: var(--danger); font-weight: 700; }

/* 支援記録（日別）：出勤した人 */
.rec.in-now { border-left: 4px solid var(--mint, #7fb89a); }

/* 支援記録（日別）：入力した人・予定の人・予定なしの見出しと、予定の人の印 */
.rec-grp { display: flex; align-items: baseline; gap: 10px; margin: 18px 2px 8px; font-size: 13px; color: var(--deep); }
.rec-grp:first-child { margin-top: 4px; }
.rec-grp span { color: var(--gray); font-size: 12px; }
.rec-grp.g0 b { color: #2f7a4f; }
.rec-grp.g1 b { color: #b5651d; }
.rec.planned { border-left: 4px dashed var(--warn, #b5651d); background: #fffaf3; }

/* 支援記録：手当・天引きのテンプレ */
.items-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 8px; }
.items-list .chip { margin: 0; }
.chip.minus, b.minus { color: var(--danger); }
.items-pick { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 10px; margin-bottom: 10px; background: #fff; }
.ig-panel { display: flex; flex-direction: column; gap: 4px; }
.ig-item b { margin-left: 4px; font-weight: 600; }
.ig-row { display: flex; align-items: center; gap: 8px; }
.ig-editbox { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.ms { display: inline-flex; gap: 4px; align-items: center; }
.ms select.i { width: auto; padding-right: 22px; }
.vit-list li { display: flex; gap: 8px; align-items: baseline; padding: 0; font-size: 12.5px; line-height: 1.6; }
.vit-list li a { min-width: 10em; }
.vit h2 { margin-bottom: 6px; }
.vit .lbl { font-size: 11.5px; margin-bottom: 2px; }
.vit .chips .chip { padding: 1px 8px; font-size: 12px; }
.vit-more ul { max-height: 220px; overflow: auto; }
.cycle td { vertical-align: top; }
.cycle tr.on td { background: var(--ok-bg); }
.cycle td a { text-decoration: none; }
.plan-form .phr { margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
