/* 平和堂 AIエージェント（OS）の画面。prototype/os.css（4巡の UAT 済み）を写したもの。
   色と形は晩期君・グロサリーの配色 peak（client_heiwado_grocery/locked/design-tokens.css・2026-11-19 凍結）をそのまま使う。
   OS で足したのはアプリごとの色（--app-*）だけ。色は var() でだけ使う。 */
:root {
  --ct-radius-xs: 4px; --ct-radius-sm: 6px; --ct-radius-md: 8px; --ct-radius-lg: 12px; --ct-radius-pill: 999px;
  --ct-shadow-card: 0 0 0 1px rgba(16,24,40,.03), 0 1px 2px rgba(16,24,40,.04);
  --ct-shadow-pop: 0 0 0 1px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.10);
  --ct-shadow-modal: 0 0 0 1px rgba(16,24,40,.04), 0 16px 40px rgba(16,24,40,.16);
  --ct-font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic Medium", Meiryo, sans-serif;
  --ct-font-num: "SF Mono", "Menlo", "Consolas", "BIZ UDGothic", monospace;
  --ct-fs-xs: 11.5px; --ct-fs-sm: 12.5px; --ct-fs-md: 13.5px; --ct-fs-base: 14px; --ct-fs-lg: 15px; --ct-fs-xl: 18px; --ct-fs-2xl: 21px;
  --ct-side-w: 232px; --ct-content-max: 1280px;
  --ct-brand: #1B3C59; --ct-brand-hover: #274D6E; --ct-on-brand: #FFFFFF; --ct-brand-weak: #E6EAEF;
  --ct-page: #F6F8FA; --ct-surface: #FFFFFF; --ct-surface-2: #F6F8FA; --ct-surface-3: #EFF2F5;
  --ct-line: #D1D9E0; --ct-line-strong: #818B98;
  --ct-text: #1F2328; --ct-text-2: #59636E; --ct-text-3: #818B98;
  --ct-link: #0969DA; --ct-focus: #0969DA;
  --ct-success: #1A7F37; --ct-success-bg: #DAFBE1;
  --ct-warn: #BC4C00; --ct-warn-bg: #FFF1E5; --ct-warn-line: #FB8F44;
  --ct-danger: #D1242F; --ct-danger-bg: #FFEBE9;
  --ct-info: #0969DA; --ct-info-bg: #DDF4FF;
  --ct-disabled-bg: #EFF2F5; --ct-disabled-text: #59636E;
  --ct-overlay: rgba(31,35,40,.5);
  /* アプリの色（OS で足した分）。白い線の絵が 4.5:1 を超える濃さ。どれも彩度を抑え、主の紺と並べて喧嘩しない明るさにそろえた */
  --app-peak: #1B3C59; --app-banki: #7B3F61; --app-seika: #2E6B3F; --app-grocery: #8A5A14; --app-sengyo: #1E6670; --app-settings: #59636E;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--ct-font); font-size: var(--ct-fs-base); color: var(--ct-text); background: var(--ct-page); line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--ct-link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ct-focus); outline-offset: 2px; }
.ic { flex: none; display: block; }
.num { font-family: var(--ct-font-num); font-variant-numeric: tabular-nums; }
.dim { color: var(--ct-text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- アプリのアイコン（ホーム・メニュー・表の見出しで同じもの） ---------- */
.appic { display: inline-flex; align-items: center; justify-content: center; background: var(--c); color: #fff; flex: none; border-radius: 22%; overflow: hidden; }
.appic img { width: 100%; height: 100%; display: block; }
.appic.soon { filter: grayscale(1); opacity: .45; }

/* ---------- ボタン・札・入力 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--ct-radius-md); border: 1px solid var(--ct-line); background: var(--ct-surface); font-size: var(--ct-fs-md); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--ct-surface-2); }
.btn.primary { background: var(--ct-brand); border-color: var(--ct-brand); color: var(--ct-on-brand); }
.btn.primary:hover { background: var(--ct-brand-hover); }
.btn.danger { background: var(--ct-danger); border-color: var(--ct-danger); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ct-text-2); }
.btn.quiet:hover { background: var(--ct-surface-3); color: var(--ct-text); }
.btn[disabled] { background: var(--ct-disabled-bg); border-color: var(--ct-line); color: var(--ct-disabled-text); cursor: not-allowed; }
.iconbtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--ct-radius-sm); background: none; color: var(--ct-text-2); cursor: pointer; }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--ct-surface-3); color: var(--ct-text); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--ct-radius-xs); background: var(--ct-surface-3); color: var(--ct-text-2); font-size: var(--ct-fs-xs); font-weight: 600; white-space: nowrap; }
.tag.brand { background: var(--ct-brand-weak); color: var(--ct-brand); }
.tag.warn { background: var(--ct-warn-bg); color: var(--ct-warn); }
input.txt, select.sel { height: 34px; border: 1px solid var(--ct-line); border-radius: var(--ct-radius-sm); background: var(--ct-surface); padding: 0 10px; font-size: var(--ct-fs-md); }
input.txt { width: 100%; }
input.txt:focus, select.sel:focus { outline: 2px solid var(--ct-focus); outline-offset: -1px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span:first-child { display: block; font-size: var(--ct-fs-sm); font-weight: 700; margin-bottom: 4px; }
.help { font-size: var(--ct-fs-sm); color: var(--ct-text-2); margin-top: 3px; }

/* ---------- ログイン ---------- */
.bare { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; position: relative; }
.bare > * { position: relative; }
.osmark { display: flex; align-items: center; gap: 12px; }
.osmark .grid4 { width: 40px; height: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.osmark .grid4 i { border-radius: 4px; }
.osmark b { display: block; font-size: 20px; letter-spacing: .02em; }
.osmark small { display: block; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.logincard { width: 360px; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-radius-lg); box-shadow: var(--ct-shadow-card); padding: 24px 24px 18px; }
.logincard .btn.primary { width: 100%; justify-content: center; height: 38px; margin-top: 4px; }
.logincard .note { font-size: var(--ct-fs-sm); color: var(--ct-text-2); margin-top: 14px; }
.foot { font-size: var(--ct-fs-xs); color: var(--ct-text-3); }

/* ---------- ホーム（CarPlay のように左の帯＋アプリの格子） ---------- */
.home { display: grid; grid-template-columns: 88px 1fr; min-height: 100vh; }
.rail { background: var(--ct-surface); border-right: 1px solid var(--ct-line); display: flex; flex-direction: column; align-items: center; padding: 18px 0 14px; gap: 6px; position: sticky; top: 0; height: 100vh; }
.rail .clock { text-align: center; margin-bottom: 14px; }
.rail .clock b { display: block; font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.rail .clock small { display: block; font-size: var(--ct-fs-xs); color: var(--ct-text-2); }
.rail .rbtn { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; border-radius: var(--ct-radius-md); color: var(--ct-text-2); font-size: var(--ct-fs-xs); font-weight: 600; text-decoration: none; background: none; border: none; cursor: pointer; }
.rail .rbtn:hover { background: var(--ct-surface-3); color: var(--ct-text); text-decoration: none; }
.rail .rbtn.on { background: var(--ct-brand-weak); color: var(--ct-brand); }
.rail .sep { width: 40px; height: 1px; background: var(--ct-line); margin: 6px 0; }
.rail .rlabel { font-size: var(--ct-fs-xs); color: var(--ct-text-2); font-weight: 700; margin-top: 2px; }
.rail .bottom { margin-top: auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ct-brand); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.homemain { padding: 28px 48px 48px; display: flex; flex-direction: column; min-width: 0; }
.homehead { display: flex; align-items: baseline; gap: 14px; }
.homehead h1 { font-size: var(--ct-fs-2xl); font-weight: 800; letter-spacing: .01em; }
.homehead .who { font-size: var(--ct-fs-md); color: var(--ct-text-2); }
.launch { list-style: none; display: grid; grid-template-columns: repeat(4, 184px); gap: 32px 36px; justify-content: center; margin: 6vh auto 0; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 14px 6px 12px; border-radius: 16px; color: var(--ct-text); text-decoration: none; border: 1px solid transparent; }
.tile:hover { background: var(--ct-surface); border-color: var(--ct-line); text-decoration: none; }
.tile:hover .appic { transform: translateY(-1px); }
.tile .appic { width: 92px; height: 92px; box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 6px 16px rgba(16,24,40,.10); transition: transform .12s; }
.tile b { font-size: var(--ct-fs-lg); font-weight: 700; line-height: 1.35; }
.tile small { font-size: var(--ct-fs-sm); color: var(--ct-text-2); line-height: 1.45; min-height: 2.9em; }
.tile.soon { cursor: default; }
.tile.soon:hover { background: none; border-color: transparent; }
.tile.soon:hover .appic { transform: none; }
.tile .state { margin-top: -4px; }
.notice { margin: 14px 0 0; width: min(760px, 100%); }
.notice h2 { font-size: var(--ct-fs-sm); color: var(--ct-text-2); font-weight: 700; margin-bottom: 6px; }
.notice ul { list-style: none; }
.notice li { display: flex; gap: 12px; padding: 4px 0; font-size: var(--ct-fs-md); color: var(--ct-text-2); }
.notice li .d { color: var(--ct-text); font-weight: 700; flex: none; }
.notice li.stop .d { color: var(--ct-warn); }

/* ---------- アプリのシェル（設定・各アプリ） ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--ct-side-w); flex: none; background: var(--ct-surface); border-right: 1px solid var(--ct-line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .homerow { display: flex; align-items: center; gap: 4px; padding: 10px 10px 0; }
.side .homelink { flex: 1; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: var(--ct-radius-sm); color: var(--ct-text-2); font-size: var(--ct-fs-sm); font-weight: 700; text-decoration: none; }
.side .homelink:hover { background: var(--ct-surface-3); color: var(--ct-text); text-decoration: none; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px; border-bottom: 1px solid var(--ct-line); }
.side .brand img.logo { height: 38px; width: auto; display: block; }
.side .brand b { font-size: var(--ct-fs-lg); }
.side nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side nav .sec { font-size: var(--ct-fs-xs); color: var(--ct-text-2); font-weight: 700; padding: 12px 12px 4px; }
.side nav .sec:first-child { padding-top: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--ct-radius-md); color: var(--ct-text-2); font-size: var(--ct-fs-md); font-weight: 600; text-decoration: none; }
.side nav a:hover { background: var(--ct-surface-2); color: var(--ct-text); }
.side nav a.on { background: var(--ct-brand-weak); color: var(--ct-brand); }
.side nav a .nl { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side nav a .nl small { font-size: var(--ct-fs-xs); color: var(--ct-text-2); font-weight: 600; }
.side .bottom { margin-top: auto; border-top: 1px solid var(--ct-line); padding: 10px; }
.userchip { display: flex; width: 100%; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; background: none; text-align: left; }
.userchip:hover, .userchip[aria-expanded="true"] { border-color: var(--ct-line); background: var(--ct-surface-2); }
.userchip .avatar { width: 30px; height: 30px; font-size: 12px; }
.userchip .ut { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.userchip .uname { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip .role { font-size: var(--ct-fs-xs); color: var(--ct-text-2); }
.wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 32px 0; width: 100%; max-width: var(--ct-content-max); margin: 0 auto; }
.pagehead .ttl { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pagehead h1 { font-size: var(--ct-fs-2xl); font-weight: 800; line-height: 1.3; }
.pagehead .sub { font-size: var(--ct-fs-md); color: var(--ct-text-2); margin-top: 2px; }
.pagehead .actions { display: flex; gap: 8px; align-items: center; flex: none; padding-top: 2px; }
.content { width: 100%; max-width: var(--ct-content-max); margin: 0 auto; padding: 16px 32px 40px; }
.panel { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-radius-lg); margin-bottom: 14px; }
.panel .ptop { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ct-line); flex-wrap: wrap; }
.panel .ptop h2 { font-size: var(--ct-fs-lg); font-weight: 700; }
.panel .ptop .grow { flex: 1; }
.panel .ptop .cnt { font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.panel .pbody { padding: 14px 16px; }
.search { position: relative; width: 260px; }
.search .ic { position: absolute; left: 9px; top: 9px; color: var(--ct-text-3); }
.search input { padding-left: 32px; }
.inline-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--ct-fs-md); color: var(--ct-text-2); padding: 10px 16px; border-bottom: 1px solid var(--ct-line); }
.inline-note .ic { margin-top: 3px; }

/* 表 */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-size: var(--ct-fs-sm); color: var(--ct-text-2); font-weight: 700; background: var(--ct-surface-2); padding: 8px 12px; border-bottom: 1px solid var(--ct-line); white-space: nowrap; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--ct-line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr.stopped td { color: var(--ct-text-2); background: var(--ct-surface-2); }
table.grid tr.stopped td .uname { color: var(--ct-text-2); }
table.grid td.gear, table.grid th.gear { width: 44px; text-align: right; padding-right: 8px; }
table.grid th.app { text-align: center; white-space: normal; width: 92px; line-height: 1.3; }
table.grid th.app span { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
table.grid td.role { text-align: center; white-space: nowrap; }
table.grid td.role.none { color: var(--ct-text-2); }
table.grid td.role.admin { color: var(--ct-brand); font-weight: 700; }
table.grid .uname { font-weight: 700; }
table.grid .uline { display: flex; align-items: center; gap: 8px; }
table.grid .sub2 { font-size: var(--ct-fs-xs); color: var(--ct-text-2); }

/* 浮くメニュー・ダイアログ・トースト */
.menu { position: fixed; z-index: 50; min-width: 220px; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-radius-md); box-shadow: var(--ct-shadow-pop); padding: 5px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 7px 10px; border: none; background: none; border-radius: var(--ct-radius-sm); font-size: var(--ct-fs-md); text-align: left; cursor: pointer; }
.menu button:hover:not([disabled]), .menu button:focus-visible { background: var(--ct-surface-3); outline: none; }
.menu button.red { color: var(--ct-danger); }
.menu button[disabled] { color: var(--ct-text-3); cursor: not-allowed; }
.menu .why { font-size: var(--ct-fs-xs); color: var(--ct-text-2); padding: 0 10px 6px 37px; line-height: 1.4; }
.menu hr { border: none; border-top: 1px solid var(--ct-line); margin: 5px 0; }
.menu .mh { font-size: var(--ct-fs-xs); color: var(--ct-text-2); font-weight: 700; padding: 6px 10px 4px; }
.backdrop { position: fixed; inset: 0; background: var(--ct-overlay); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.dialog { width: 560px; max-width: calc(100vw - 32px); max-height: 84vh; display: flex; flex-direction: column; background: var(--ct-surface); border-radius: var(--ct-radius-lg); box-shadow: var(--ct-shadow-modal); }
.dialog h2 { font-size: var(--ct-fs-xl); padding: 18px 22px 4px; }
.dialog .dsub { font-size: var(--ct-fs-md); color: var(--ct-text-2); padding: 0 22px; }
.dialog .dbody { padding: 16px 22px 6px; overflow-y: auto; }
.dialog .dfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--ct-line); margin-top: 8px; }
.dialog .grp { font-size: var(--ct-fs-sm); font-weight: 700; margin: 6px 0 6px; }
.approws { border: 1px solid var(--ct-line); border-radius: var(--ct-radius-md); margin-bottom: 14px; }
.approw { display: grid; grid-template-columns: 1fr 170px; gap: 4px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--ct-line); }
.approw:last-child { border-bottom: none; }
.approw .an { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.approw .ah { grid-column: 1 / -1; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.approw .sel { width: 100%; }
.radios { display: flex; flex-direction: column; gap: 6px; }
.radios label { display: flex; gap: 8px; align-items: flex-start; font-size: var(--ct-fs-md); }
.radios label input { margin-top: 5px; }
.radios label small { display: block; color: var(--ct-text-2); font-size: var(--ct-fs-sm); }
.radios label.off { color: var(--ct-text-3); }
.pwbox { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ct-line); border-radius: var(--ct-radius-md); padding: 12px 14px; background: var(--ct-surface-2); margin: 6px 0 12px; }
.pwbox code { font-family: var(--ct-font-num); font-size: 20px; letter-spacing: .08em; flex: 1; }
.toastzone { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; }
.toast { background: var(--ct-text); color: #fff; padding: 10px 16px; border-radius: var(--ct-radius-md); font-size: var(--ct-fs-md); box-shadow: var(--ct-shadow-pop); display: flex; gap: 8px; align-items: center; }

/* 設定 > アプリ */
.rolelist { display: grid; grid-template-columns: 140px 1fr; }
.rolelist div { padding: 9px 16px; border-bottom: 1px solid var(--ct-line); font-size: var(--ct-fs-md); }
.rolelist div:nth-last-child(-n+2) { border-bottom: none; }
.rolelist .rn { font-weight: 700; }
.linkrows a:hover { background: var(--ct-surface-2); text-decoration: none; }
.cols2 { display: grid; grid-template-columns: 1fr 360px; gap: 14px; align-items: start; }

/* 切り替え（アプリのシェルの左上） */
.switcher { position: fixed; z-index: 50; width: 300px; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-radius-lg); box-shadow: var(--ct-shadow-pop); padding: 12px; }
.switcher .sh { font-size: var(--ct-fs-xs); color: var(--ct-text-2); font-weight: 700; padding: 0 4px 8px; }
.switcher ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.switcher a, .switcher span.off { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: var(--ct-radius-md); color: var(--ct-text); font-size: var(--ct-fs-sm); font-weight: 600; text-align: center; line-height: 1.3; }
.switcher a:hover { background: var(--ct-surface-2); text-decoration: none; }
.switcher a.cur { background: var(--ct-brand-weak); }
.switcher span.off { color: var(--ct-text-3); }

/* ---------- 1巡目のレビューで足した分 ---------- */
fieldset { border: none; }
.menu button span { display: flex; flex-direction: column; line-height: 1.35; }
.menu button small { font-size: var(--ct-fs-xs); color: var(--ct-text-2); }
.menu button[aria-disabled="true"] { color: var(--ct-text-2); cursor: not-allowed; }
.menu button[aria-disabled="true"]:hover { background: none; }
.menu .mwhy { display: flex; gap: 7px; align-items: flex-start; font-size: var(--ct-fs-sm); color: var(--ct-text-2); background: var(--ct-surface-2); border-radius: var(--ct-radius-sm); padding: 7px 9px; margin: 2px 2px 5px; line-height: 1.45; max-width: 300px; }
.menu .mwhy .ic { margin-top: 2px; }
.menu .mfoot { font-size: var(--ct-fs-xs); color: var(--ct-text-2); border-top: 1px solid var(--ct-line); margin-top: 5px; padding: 7px 10px 3px; }
.toast .tbtn { margin-left: 8px; background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: var(--ct-radius-sm); padding: 2px 8px; font-size: var(--ct-fs-sm); font-weight: 700; cursor: pointer; }
.err { font-size: var(--ct-fs-sm); color: var(--ct-danger); margin-top: 4px; font-weight: 600; }
input.txt.bad, select.sel.bad { border-color: var(--ct-danger); }
.okline { display: flex; gap: 8px; align-items: flex-start; background: var(--ct-success-bg); color: var(--ct-success); border-radius: var(--ct-radius-md); padding: 8px 12px; font-size: var(--ct-fs-md); margin-bottom: 14px; }
.okline .ic { margin-top: 3px; }
.warnline { display: flex; gap: 8px; align-items: center; background: var(--ct-warn-bg); color: var(--ct-warn); border-radius: var(--ct-radius-md); padding: 8px 12px; font-size: var(--ct-fs-md); margin-top: 12px; width: min(760px, 100%); }
.linkbtn { background: none; border: none; padding: 0; cursor: pointer; text-align: left; color: var(--ct-text); }
.linkbtn:hover { text-decoration: underline; color: var(--ct-link); }
.appsbtn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--ct-line); border-radius: var(--ct-radius-sm); background: var(--ct-surface); color: var(--ct-text-2); font-size: var(--ct-fs-sm); font-weight: 700; cursor: pointer; }
.appsbtn:hover, .appsbtn[aria-expanded="true"] { background: var(--ct-surface-3); color: var(--ct-text); }
.switcher em { display: block; font-style: normal; font-size: var(--ct-fs-xs); }
.tscroll { overflow-x: auto; }
table.grid.users td:first-child { min-width: 180px; }
.attrs { display: flex; flex-direction: column; gap: 3px; }
.attr { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
a.attr { color: var(--ct-link); }
.thnote { font-weight: 400; margin-left: 4px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px dashed var(--ct-line-strong); border-radius: var(--ct-radius-md); padding: 26px; margin-bottom: 10px; color: var(--ct-text-2); }
.ownerline { display: flex; align-items: center; gap: 8px; font-size: var(--ct-fs-md); color: var(--ct-text-2); margin-bottom: 8px; }
.field .flabel { display: block; font-size: var(--ct-fs-sm); font-weight: 700; margin-bottom: 4px; }
.field .ro { font-size: var(--ct-fs-md); padding: 6px 0; }
.approw .an > span { display: flex; flex-direction: column; line-height: 1.3; }
.approw .an small { font-size: var(--ct-fs-xs); color: var(--ct-text-2); font-weight: 600; }
.roledesc { grid-column: 1 / -1; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.roledesc summary { cursor: pointer; color: var(--ct-link); width: max-content; }
.roledesc dl { display: grid; grid-template-columns: 80px 1fr; gap: 3px 10px; margin-top: 6px; }
.roledesc dt { font-weight: 700; color: var(--ct-text); }
.search.wide { width: 100%; margin-bottom: 10px; }
.sel.full { width: 100%; }
.panel.narrow { max-width: 520px; }
.radios .help { display: flex; gap: 6px; align-items: center; }
.linkrows a, .linkrows .li-off { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--ct-line); color: var(--ct-text); }
.linkrows > :last-child { border-bottom: none; }
.linkrows .li { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.linkrows .li .ic { margin-top: 3px; color: var(--ct-text-2); }
.linkrows .li b { display: block; font-size: var(--ct-fs-md); white-space: nowrap; }
.linkrows .li small { display: block; font-size: var(--ct-fs-sm); color: var(--ct-text-2); font-weight: 400; margin: 0; }
.linkrows .go { display: inline-flex; align-items: center; gap: 4px; color: var(--ct-link); font-size: var(--ct-fs-sm); font-weight: 700; white-space: nowrap; }
.linkrows .li-off { color: var(--ct-text-2); }
.thlock { display: inline-block; vertical-align: -1px; margin-right: 4px; color: var(--ct-text-3); }

/* ---------- 2巡目のレビューで足した分 ---------- */
.skip { position: absolute; left: 8px; top: -48px; z-index: 70; background: var(--ct-brand); color: #fff; border: none; border-radius: var(--ct-radius-sm); padding: 8px 12px; font-weight: 700; cursor: pointer; }
.skip:focus { top: 8px; }
h1:focus { outline: none; }
h1:focus-visible { outline: 2px solid var(--ct-focus); outline-offset: 4px; border-radius: 2px; }
.toast.warn { background: #6A2C00; }
.backdrop.over { background: rgba(31,35,40,.35); padding-top: 18vh; z-index: 45; }
.dialog.small { width: 460px; }
.warnline.inline { width: auto; margin: 10px 0 0; align-items: flex-start; }
.warnline.inline .ic { margin-top: 3px; }
.radios.oneline { margin-bottom: 12px; }
.radios.oneline label { align-items: flex-start; }
td.nowrap, th.nowrap, .nowrap { white-space: nowrap; }
table.grid.tfixed { table-layout: fixed; }
table.grid.tfixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid.log td:nth-child(5) { min-width: 260px; }
.emptyhome { grid-column: 1 / -1; color: var(--ct-text-2); text-align: center; padding: 30px; }
.switcher span.off { color: var(--ct-text-2); }

/* ---------- 3巡目のレビューで足した分 ---------- */
.content > .warnline { width: 100%; margin: 0 0 14px; }
.lockline { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
select.sel[disabled] { background: var(--ct-disabled-bg); color: var(--ct-disabled-text); cursor: not-allowed; }

/* ---------- 4巡目のレビューで足した分 ---------- */
.tag.ghost { visibility: hidden; }
.panel { overflow: hidden; }
.pagehead .sub { margin-top: 6px; }
h1:focus-visible { outline-offset: 2px; }
dl.grantlist { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin-top: 8px; font-size: var(--ct-fs-md); }
dl.grantlist dt { font-weight: 700; }

/* ---------- 本実装で足した分（API から取る形にしたため） ---------- */
.noscript { padding: 24px; }
.loadmain { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--ct-text-2); font-size: var(--ct-fs-md); }
.loadpanel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ngline { display: flex; gap: 8px; align-items: flex-start; background: var(--ct-danger-bg); color: var(--ct-danger); border-radius: var(--ct-radius-md); padding: 8px 12px; font-size: var(--ct-fs-md); margin-bottom: 14px; }
.ngline .ic { margin-top: 3px; }
.toast.err { background: var(--ct-danger); }
.derr { margin-top: 4px; }
.menu { max-height: min(70vh, 520px); overflow-y: auto; }
.menu .mempty { font-size: var(--ct-fs-sm); color: var(--ct-text-2); padding: 6px 10px 8px; }
.notice li small { display: block; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.drop.over { border-color: var(--ct-focus); background: var(--ct-info-bg); }
.drop .dropst { font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.impsum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.impsec { margin-bottom: 14px; }
.impsec .grp { margin-top: 0; }
.impsec table.grid { border: 1px solid var(--ct-line); border-radius: var(--ct-radius-md); }
.pmore { display: flex; justify-content: center; padding: 12px 16px; border-top: 1px solid var(--ct-line); }
.memberwhy { grid-column: 1 / -1; display: flex; gap: 6px; align-items: flex-start; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.memberwhy .ic { margin-top: 3px; }

/* ---------- 本実装の UAT 1巡目で足した分 ---------- */
/* ホーム: 4列までを幅に合わせて詰める（固定の4列は幅 800 で4つ目が画面の外に出た） */
.launch { width: 100%; max-width: calc(4 * 184px + 3 * 36px); grid-template-columns: repeat(auto-fill, 184px); }
/* 表: .sr-only（position:absolute）の広がりを表の枠の中に閉じる。歯車の列は右に留め、横に動かさなくても押せるように */
.tscroll { position: relative; }
table.grid th.gear, table.grid td.gear { position: sticky; right: 0; background: var(--ct-surface); }
table.grid thead th.gear { background: var(--ct-surface-2); }
table.grid tr.stopped td.gear { background: var(--ct-surface-2); }
/* 和文の禁則（長音・小書きの仮名を行頭に置かない）。名前と所属は語の途中で折らず、札は名前の下へ回す */
table.grid { line-break: strict; }
table.grid .uline { flex-wrap: wrap; gap: 2px 8px; }
table.grid .uname { white-space: nowrap; }
table.grid td.dept { white-space: nowrap; }
.tile small { line-break: strict; }
.tile .state { margin-top: 0; }
/* 追加した直後の人の行（次に一覧を描き直すまで） */
table.grid tr.fresh td, table.grid tr.fresh td.gear { background: var(--ct-info-bg); }
/* パスワードの変更待ち: ホーム・アプリの切り替えの代わりに出す一文 */
.side .forceline { display: flex; gap: 6px; align-items: flex-start; padding: 12px 18px 0; font-size: var(--ct-fs-sm); color: var(--ct-text-2); line-height: 1.45; }
.side .forceline .ic { margin-top: 3px; }
.logincard .warnline { width: auto; margin: 0 0 14px; align-items: flex-start; }
.logincard .warnline .ic { margin-top: 3px; }
@media (max-width: 1100px) {
  .cols2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .homemain { padding: 24px 24px 40px; }
  .pagehead { padding: 20px 20px 0; }
  .content { padding: 14px 20px 32px; }
  .search { width: 220px; }
}

/* ---------- 本実装の UAT 2巡目で足した分 ---------- */
/* ログインの画面の見出し（見た目は .osmark b と同じ） */
.osmark h1.osname { display: block; font-size: 20px; letter-spacing: .02em; font-weight: 700; line-height: 1.6; }
/* お知らせ: 日付の幅をそろえ、本文の書き出しを同じ位置にする */
.notice li .d { min-width: 9em; }
/* 語の途中で折らない（「グロサ／リーの／按分」「ホー／ム」「ケー／ス数」）。文節で折る（対応しないブラウザはこれまでどおり） */
.tile small, .side .forceline, table.grid th.app .an { word-break: auto-phrase; }
/* 見出しの下の説明と欄の補足も文節で折る（幅 800 で「センタ／ー」「パスワー／ド）」に割れた。UAT 5巡目） */
.pagehead .sub, .help { word-break: auto-phrase; }
table.grid th.app { padding-left: 6px; padding-right: 6px; vertical-align: top; }   /* 2行に折れる名前があっても、アイコンを同じ高さにそろえる */
/* ユーザーの一覧: 札は名前の下の行にまとめる。ロック中・変更待ちは最終ログインの下に */
table.grid .utags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
table.grid .ustate { color: var(--ct-warn); font-family: var(--ct-font); white-space: nowrap; }
table.grid .login-sub { display: none; }
/* 表が枠より広いとき: 表示名の列は左に、歯車の列は右に留め、その先に列があることを影で示す */
table.grid.users th.uname-col, table.grid.users td.uname-col { position: sticky; left: 0; z-index: 1; background: var(--ct-surface); box-shadow: 6px 0 6px -6px rgba(16,24,40,.14); }
table.grid.users thead th.uname-col { background: var(--ct-surface-2); }
table.grid.users tr.stopped td.uname-col { background: var(--ct-surface-2); }
table.grid.users tr.fresh td.uname-col { background: var(--ct-info-bg); }
table.grid th.gear, table.grid td.gear { box-shadow: -6px 0 6px -6px rgba(16,24,40,.14); }
.tscroll[tabindex]:focus-visible { outline-offset: -2px; }
/* ユーザー管理者が開いたときの「設定アプリの権限」（押せない選択肢の代わりの1行） */
.osrline { align-items: flex-start; }
.osrline .ic { margin-top: 4px; }
.osrline b { color: var(--ct-text); margin-right: 2px; }
/* 幅が狭いときは、ログインID を表示名の下に回して列を減らす（大事な列が表の中の横スクロールの先に隠れた） */
@media (max-width: 1360px) {
  table.grid.users .login-col { display: none; }
  table.grid.users .login-sub { display: block; }
}
/* さらに狭いときはログインID を出さない（検索とユーザーの変更の画面で見られる）。表示名の列を細くし、役割の列を見えるところに残す */
@media (max-width: 1100px) {
  table.grid.users .login-sub { display: none; }
}
/* 操作の記録: 幅が狭いときはアプリと IP の列を隠す（アプリは操作の下に出す。IP は CSV にある）。対象の列を見えるところに残す */
table.grid.log .app-sub { display: none; }
@media (max-width: 1100px) {
  table.grid.log .app-col, table.grid.log .ip-col { display: none; }
  table.grid.log .app-sub { display: block; }
  table.grid.log td.target { min-width: 10em; }
}
table.grid .anywrap { overflow-wrap: anywhere; }   /* 長いログインID が列を広げないように */
table.grid th.attrs-col { white-space: normal; min-width: 10em; }   /* 見出しの補足（区分の画面へのリンク）で列を広げない */

/* ---------- 本実装の UAT 3巡目で足した分 ---------- */
/* ユーザーの一覧: ロック中・パスワード未変更は札で。橙はロック中だけ（「変更待ち」の橙が多くの行に並び、警告に見えた） */
table.grid .ustate { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; color: inherit; font-family: var(--ct-font); }
table.grid .ustate-n { display: none; }
/* 幅が狭いときは最終ログインの列が横の先に隠れるので、札を名前の下の行に回す */
@media (max-width: 1100px) {
  table.grid.users .ustate-n { display: contents; }
  table.grid.users td .ustate { display: none; }
}
/* 設定 › 店舗: 幅が狭いときは区分を店名の下に回す（区分の列が歯車の下で切れた。ピーク君の店舗の区分と同じ形） */
table.grid.stores .attrs-sub { display: none; }
@media (max-width: 1100px) {
  table.grid.stores .attrs-col { display: none; }
  table.grid.stores td .attrs-sub { display: flex; margin-top: 3px; }
  table.grid.stores th .attrs-sub { display: inline; }
  table.grid.stores th.name-col { white-space: normal; word-break: auto-phrase; }
  table.grid.stores th .attrs-sub.thnote { margin-left: 0; }
}
/* 押せない項目は字を淡くして、押せる項目と見分ける（WCAG 1.4.3 は押せない部品の字を除く。理由の文は濃いまま） */
.menu button[aria-disabled="true"] { color: var(--ct-text-3); }
/* 店舗の取り込み: 変更なしの店（ふだんはたたむ） */
.impsame summary { cursor: pointer; font-size: var(--ct-fs-sm); font-weight: 700; width: max-content; }
.impsame .help { margin-top: 6px; }

/* ---------- 本実装の UAT 4巡目で足した分 ---------- */
/* 設定 › 店舗: 店名の無い店番が0件のときは押せない字（押すと項目の無いメニューが開いた） */
.quietline { font-size: var(--ct-fs-sm); color: var(--ct-text-2); padding: 0 6px; white-space: nowrap; }
/* 取り込めない理由: 鍵の印と文を同じ行に（印だけが1行目に残った） */
.help.whyline { display: flex; gap: 6px; align-items: flex-start; }
.help.whyline .ic { margin-top: 3px; flex: none; }
/* ユーザーの一覧: 停止中の人の役割は「停止前」と添えて静かに出す（まだ使えるように読めた） */
table.grid tr.stopped td.role.was { font-weight: 400; color: var(--ct-text-2); line-height: 1.3; }
table.grid td.role.was small { display: block; font-size: var(--ct-fs-xs); }
/* 設定 › アプリ: 中の設定を見出しのすぐ下に（1段のとき、使う人の表の後ろで見つからなかった）。2段のときは右の列 */
.cols2.appcols { grid-template-areas: "users inner" "users roles"; grid-template-rows: auto 1fr; }
.appcols .ap-inner { grid-area: inner; }
.appcols .ap-users { grid-area: users; }
.appcols .ap-roles { grid-area: roles; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ct-fs-sm); color: var(--ct-text-2); cursor: pointer; }
@media (max-width: 1100px) {
  .cols2.appcols { grid-template-areas: "inner" "users" "roles"; grid-template-rows: auto; }
}
/* 操作の記録: 幅が狭いときは絞り込みを2列の格子にそろえる（検索と期間・アプリ・人の3段に崩れた） */
@media (max-width: 1100px) {
  .ptop.logtools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ptop.logtools .search { width: auto; }
  .ptop.logtools .sel { width: 100%; min-width: 0; }
  .ptop.logtools .grow { display: none; }
  .ptop.logtools .cnt { grid-column: 1 / -1; }
}
