/* 素の CSS。ビルド手順を持ち込まない方針なので、変数と素直なセレクタだけで組む。
   配置と色は、現場が今使っている GroupSession に寄せてある
   （上の青いバー → アイコンの並び → 見出し → 青ヘッダのパネル）。 */

:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f5f8fb;
  --text: #16202a;
  --muted: #64748b;
  --line: #cdd8e3;
  --accent: #2c6ca8;
  --accent-text: #ffffff;
  --top-1: #6aa0d0;
  --top-2: #4a7fb4;
  --head: #7aa9d6;
  --head-text: #ffffff;
  --danger: #c0392b;
  --warn-bg: #fff5e0;
  --warn-line: #e6b800;
  --radius: 5px;
  --shadow: 0 1px 2px rgba(16, 30, 45, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151b;
    --panel: #1a212a;
    --panel-2: #222b36;
    --text: #e6edf3;
    --muted: #93a3b5;
    --line: #2e3946;
    --accent: #5a9bd8;
    --top-1: #2b4d72;
    --top-2: #1f3a58;
    --head: #2f5a86;
    --danger: #ff7b6b;
    --warn-bg: #3a3216;
    --warn-line: #b89400;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

/* hidden 属性は UA の display:none だが、クラス側で display を指定すると打ち消される。
   ログイン画面（display:grid）が hidden なのに残り続けた事故があったので、明示的に潰す。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  /* iPad の Safari で本文が勝手に拡大されるのを止める */
  -webkit-text-size-adjust: 100%;
}

button, input, textarea, select { font: inherit; color: inherit; }

/* 指で押す前提なので、どのボタンも 40px を下回らせない（ツールバーなど一部は例外） */
button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(#ffffff, #f1f5f9);
  cursor: pointer;
  padding: 0 14px;
}
@media (prefers-color-scheme: dark) {
  button { background: linear-gradient(#28313d, #1f2731); }
}
button:hover { filter: brightness(1.04); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 700; }
button.ghost { background: transparent; border-color: transparent; color: var(--accent); }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button.tiny { min-height: 26px; padding: 0 8px; font-size: 12px; }

input, textarea, select {
  width: 100%;
  padding: 8px 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
label { display: block; margin: 12px 0; font-weight: 700; font-size: 13px; }
label input, label textarea, label select { margin-top: 5px; font-weight: 400; font-size: 15px; }
label.inline { display: flex; align-items: center; gap: 10px; font-weight: 500; }
label.inline input { width: 20px; height: 20px; min-height: auto; margin: 0; }

.error { color: var(--danger); font-size: 13px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }

/* ---- ログイン ----
   見た目は KDSステップのログイン画面（kds-line-kiban の app/login/login.module.css）にそろえる（2026-09-25 相馬さんの指示）。
   色・寸法はあちらと同じ値。ログイン画面だけは明るい配色で固定する（KDSステップと同じ）。 */
.login-screen {
  position: fixed; inset: 0; z-index: 100; overflow: auto; min-height: 100dvh;
  display: grid; grid-template-columns: 1.08fr .92fr; align-items: stretch;
  background: #fff; color: #17212a; color-scheme: light;
  font-family: "DM Sans", "Noto Sans JP", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.login-screen[hidden] { display: none; }
.login-screen *, .login-screen *::before, .login-screen *::after { box-sizing: border-box; }
.lg-visual { position: relative; min-height: 100dvh; padding: 9vw; display: flex; align-items: center; overflow: hidden; color: #fff; background: #132330; }
.lg-copy { position: relative; z-index: 2; }
.lg-eyebrow { margin: 0; color: #f79561; font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.lg-copy h1 { margin: 22px 0 24px; color: #fff; font-size: clamp(34px, 4.2vw, 64px); font-weight: 700; line-height: 1.27; letter-spacing: -.05em; }
.lg-description { margin: 1em 0; color: #aebdc6; font-size: 15px; line-height: 2; }
.lg-pills { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 9px; }
.lg-pills span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; color: #c7d1d7; background: rgba(255,255,255,.04); font-size: 13px; }
.lg-panel { padding: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fbfcfc; }
.lg-card { width: min(420px, 100%); }
.lg-brand { display: flex; align-items: center; gap: 12px; }
.lg-brand img { width: 40px; height: 40px; flex: 0 0 40px; }
.lg-brand-copy { display: flex; flex-direction: column; line-height: 1.08; }
.lg-brand-copy strong { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.lg-brand-copy small { margin-top: 6px; color: #87939b; font-size: 11px; line-height: 1.55; letter-spacing: .05em; }
.login-card { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; width: 100%; }
.lg-heading { margin: 57px 0 29px; }
.lg-secure { display: flex; align-items: center; gap: 6px; color: #24956a; font-size: 13px; font-weight: 700; }
.lg-secure.outside { color: #b9501b; }
.lg-heading h2 { margin: 13px 0 7px; font-size: 28px; font-weight: 700; line-height: 1.55; color: #17212a; }
.lg-heading p { margin: 0; color: #71808c; font-size: 15px; }
.lg-form { display: grid; gap: 20px; margin: 0; }
.lg-form label { display: grid; gap: 8px; color: #40515d; font-size: 14px; font-weight: 700; }
.lg-form input[type=text], .lg-form input[type=password], .lg-form input[type=search] {
  width: 100%; height: 48px; margin: 0; padding: 0 14px; border: 1px solid #d8e0e4; border-radius: 10px; outline: 0;
  color: #17212a; background: #fff; font: inherit; font-size: 15px; transition: .16s ease;
}
.lg-form input:focus { border-color: #e38758; box-shadow: 0 0 0 3px rgba(233,109,47,.09); }
.lg-password { position: relative; display: block; }
.lg-password > svg { position: absolute; left: 14px; top: 15px; color: #85939c; }
.lg-form .lg-password input { padding-left: 42px; padding-right: 45px; }
.lg-password button { position: absolute; right: 7px; top: 6px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; color: #7f8e98; background: transparent; cursor: pointer; }
.lg-submit {
  height: 50px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 0; border-radius: 10px; color: #fff; background: #e96d2f; font: inherit; font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 25px rgba(233,109,47,.2); cursor: pointer; width: 100%;
}
.lg-submit:hover { background: #dd6427; }
.lg-submit:disabled { opacity: .65; cursor: wait; }
.lg-secondary {
  height: 50px; padding: 0 17px; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  border: 1px solid #d8e0e4; border-radius: 10px; color: #17212a; background: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.lg-back { justify-self: start; padding: 0; border: 0; background: none; color: #71808c; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.lg-error { margin: -8px 0 0; color: #bf3e31; font-size: 13px; }
.lg-error[hidden] { display: none; }
/* 自動ログアウトの理由。ログイン画面の配色（明るい固定）の中で、注意の色だけ足す */
.lg-notice { margin: 14px 0 0 !important; padding: 10px 14px; border: 1px solid #f0c9a8; border-radius: 10px; background: #fff6ee; color: #9a4a1c !important; font-size: 14px !important; font-weight: 700; }
.lg-chosen { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8eb; border-radius: 10px; background: #f6f8f9; }
.lg-chosen b { font-size: 17px; }
.lg-chosen span { color: #71808c; font-size: 13px; }
.choice-list { display: grid; gap: 8px; max-height: 46dvh; overflow-y: auto; margin: 0; padding: 2px; }
.login-screen .choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px;
  padding: 10px 14px; border: 1px solid #d8e0e4; border-radius: 10px; background: #fff; color: #17212a;
  font: inherit; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; transition: .16s ease;
}
.login-screen .choice:hover { border-color: #e38758; box-shadow: 0 0 0 3px rgba(233,109,47,.09); }
/* 事業部名は長いので折り返してよいが、人数は折り返させない */
.login-screen .choice > span:last-child { flex: none; white-space: nowrap; color: #71808c; font-size: 13px; font-weight: 400; }
.lg-note { margin-top: 26px; padding: 14px; display: flex; flex-direction: column; gap: 4px; border: 1px solid #e2e8eb; border-radius: 10px; background: #f6f8f9; }
.lg-note strong { font-size: 14px; font-weight: 700; }
.lg-note span { color: #71808c; font-size: 13px; }
.lg-footer { margin: 48px 0 0; color: #9aa4ab; font-size: 12px; }
.login-screen button:focus-visible, .login-screen input:focus-visible { outline: 3px solid rgba(233,109,47,.35); outline-offset: 3px; }
/* 幅の狭い画面（iPad の縦・スマホ）では、紹介の面を上に小さくまとめる */
@media (max-width: 900px) {
  /* 縦に積むときはグリッドにしない（行が縮んで紹介の面が切れるため） */
  .login-screen { display: block; }
  .lg-visual { min-height: auto; padding: 36px 24px 30px; }
  .lg-copy h1 { margin: 12px 0 10px; font-size: 30px; }
  .lg-description { margin: 0; font-size: 13.5px; line-height: 1.9; }
  .lg-pills { margin-top: 16px; }
  .lg-panel { padding: 32px 20px 40px; justify-content: flex-start; }
  .lg-heading { margin: 32px 0 22px; }
}

/* ---- 上の青いバー ---- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.gs-top {
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  height: calc(46px + env(safe-area-inset-top));
  background: linear-gradient(var(--top-1), var(--top-2));
  color: #fff;
  flex: none;
}
.gs-logo {
  background: #fff; color: var(--accent);
  font-weight: 800; font-size: 15px;
  padding: 3px 11px; border-radius: 4px;
  white-space: nowrap;
  /* 社名が長いので、狭い画面では縮めて省略する */
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
@media (max-width: 900px) { .gs-logo { font-size: 13px; padding: 3px 8px; } }
@media (max-width: 600px) { .gs-logo { font-size: 12px; max-width: 46vw; } }
.gs-who { font-size: 13px; opacity: .95; white-space: nowrap; }
.gs-top-link { background: transparent; border: none; color: #fff; min-height: 30px; padding: 0 8px; font-size: 13px; }
.gs-top-link:hover { background: rgba(255, 255, 255, .16); }
.gs-logout {
  background: #fff; color: var(--accent); border: none;
  min-height: 28px; padding: 0 12px; font-size: 12px; font-weight: 700;
}

/* ---- アイコンの並び ---- */
.gs-toolbar {
  display: flex; gap: 2px;
  padding: 7px 10px 5px;
  background: var(--panel);
  border-bottom: 2px solid var(--head);
  overflow-x: auto;
  flex: none;
}
.gs-tool {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 84px; min-height: auto;
  border: none; background: transparent;
  font-size: 12px; padding: 5px 4px 4px;
  border-radius: 6px;
  position: relative;
  white-space: nowrap;
}
.gs-tool:hover { background: var(--panel-2); }
.gs-tool.active { background: #e3eefa; font-weight: 700; color: var(--accent); }
@media (prefers-color-scheme: dark) { .gs-tool.active { background: #24344a; } }
.gs-icon svg { width: 36px; height: 36px; display: block; }
.gs-tool .badge { position: absolute; top: 2px; right: 12px; }

/* ---- 中身 ---- */
.gs-main { flex: 1; padding: 14px; min-width: 0; }
.page { max-width: 900px; margin: 0 auto; }
.page.wide { max-width: 1180px; }

.page-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.page-title h2 { margin: 0; font-size: 19px; }
.page-title .gs-icon svg { width: 30px; height: 30px; }

.gs-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gs-panel-head {
  display: flex; align-items: center; gap: 10px;
  background: var(--head); color: var(--head-text);
  padding: 5px 12px;
  font-weight: 700;
}
.gs-panel-head .spacer { flex: 1; }
.gs-panel-head button { min-height: 26px; padding: 0 10px; font-size: 12px; }
.gs-panel-body { padding: 10px 12px; }
.gs-panel-body.flush { padding: 0; }

/* メイン（ポータル） */
.portal { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
@media (max-width: 900px) { .portal { grid-template-columns: minmax(0, 1fr); } }

.info-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.info-row:last-child { border-bottom: none; }
.info-row:hover { background: var(--panel-2); }
.info-tag {
  background: #ffd45e; color: #6b4b00;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 3px;
  white-space: nowrap;
}
.info-tag.ack { background: var(--danger); color: #fff; }
.info-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }

/* ---- 一覧のカード ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--accent); }
.card.unread { border-left: 4px solid var(--accent); }
.card.needs-ack { background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
.card h3 { margin: 0 0 5px; font-size: 16px; }
.card h4 { margin: 16px 0 4px; font-size: 13px; color: var(--muted); }
.card-meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-excerpt {
  margin: 6px 0 0; color: var(--muted); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tag {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted);
}
.tag.ack { border-color: var(--warn-line); color: #9a7b00; font-weight: 700; }
.tag.pin { border-color: var(--accent); color: var(--accent); }
.tag.ext { border-color: var(--accent); color: var(--accent); }
@media (prefers-color-scheme: dark) { .tag.ack { color: var(--warn-line); } }

.badge {
  background: var(--danger); color: #fff;
  border-radius: 999px; padding: 0 7px;
  font-size: 11px; font-weight: 700; line-height: 18px;
  display: inline-block; min-width: 18px; text-align: center;
}

.detail-body { white-space: pre-wrap; word-break: break-word; margin: 14px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 12px; background: var(--panel-2); }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.pill-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.pill-list label {
  margin: 0; display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; background: var(--panel);
  font-weight: 400; font-size: 13px; cursor: pointer;
}
.pill-list input { width: 17px; height: 17px; min-height: auto; margin: 0; }
.pill-group { margin-top: 8px; }
.pill-group > b { font-size: 12px; color: var(--muted); }

.grant-form { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 8px 0; }
.grant-form select { width: auto; min-width: 150px; flex: 1 1 150px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #16202a; color: #fff;
  padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  z-index: 100; max-width: 90vw;
}
.toast.error { background: var(--danger); }

/* ---- 自動ログアウト ----
   知らせの小窓は画面のほかの部分と同じ「青ヘッダのパネル」で出す（GroupSession の並びに合わせる） */
.session-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 16px;
  background: rgba(16, 30, 45, .45);
}
.session-dialog { width: min(420px, 100%); margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.session-dialog p { margin: 0 0 6px; }
.session-count { font-size: 22px; font-weight: 700; color: var(--accent); }
.draft-list { margin: 8px 0 0; padding-left: 18px; max-height: 40dvh; overflow: auto; }
.draft-list li { overflow-wrap: anywhere; }
/* 戻す内容の小窓。画面を移っても残るように本文の外（body 直下）に置く */
.draft-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 250;
  width: min(380px, calc(100vw - 32px)); max-height: 70dvh; margin: 0;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.draft-panel .gs-panel-body { overflow: auto; }
.draft-panel .gs-panel-body > p { margin: 0 0 8px; font-size: 12px; }
.draft-items { display: grid; gap: 12px; }
.draft-item { display: grid; gap: 4px; }
.draft-value { width: 100%; min-height: 0; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; resize: vertical; }

/* ---- ショートメール（GroupSession の sml と同じ並び：左にメールボックスと宛先選び、右に一覧・作成・表示） ---- */
.sml { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) {
  .sml { grid-template-columns: minmax(0, 1fr); }
  .sml-side { order: 2; }
}
.sml-side .gs-panel-body { padding: 6px 8px; }
.sml-side .gs-panel { margin-bottom: 10px; }
.small { font-size: 12px; }
.sml-account { font-weight: 700; }
.sml-folders { display: flex; flex-direction: column; }
.sml-folder {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; border-radius: 4px; cursor: pointer; font-size: 13px;
}
.sml-folder:hover { background: var(--panel-2); }
.sml-folder.on { background: #e3eefa; font-weight: 700; color: var(--accent); }
@media (prefers-color-scheme: dark) { .sml-folder.on { background: #24344a; } }
.sml-folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sml-folder .tag { padding: 0 6px; }
.sml-count { font-size: 12px; color: var(--danger); }
.sml-empty { font-size: 12px; margin-left: auto; color: var(--accent); }
.sml-more { margin-left: auto; min-height: 22px !important; padding: 0 6px !important; }
/* 箱の印（色付きの四角）。画像を持ち込まずに箱の見分けを付ける */
.sml-folder-icon { width: 14px; height: 11px; border-radius: 2px; flex: none; border: 1px solid rgba(0, 0, 0, .15); }
.f-inbox { background: #5b9bd5; }
.f-sent { background: #6ab187; }
.f-draft { background: #f6c445; }
.f-trash { background: #a0a9b3; }
.f-label { background: #e8a33a; border-radius: 7px 2px 2px 7px; }
.sml-disk { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }

.sml-context {
  position: fixed; z-index: 400; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); min-width: 150px; padding: 3px;
}
.sml-context button { min-height: 32px; border: none; background: none; text-align: left; font-size: 13px; }
.sml-context button:hover { background: var(--panel-2); }

.sml-group { min-height: 32px; padding: 4px 6px; font-size: 13px; }
.sml-kind-buttons { display: flex; gap: 5px; margin: 6px 0; }
.sml-kind-buttons button { flex: 1; min-height: 30px; padding: 0 4px; font-size: 12px; }
label.sml-all { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 12px; font-weight: 400; color: var(--accent); cursor: pointer; }
.sml-people { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); }
label.sml-person { display: flex; align-items: center; gap: 6px; margin: 0; padding: 3px 2px; font-weight: 400; font-size: 13px; cursor: pointer; }
label.sml-person:hover { background: var(--panel-2); }
.sml-all input, .sml-person input, .sml-radio input, .c-check input { width: 16px; height: 16px; min-height: auto; margin: 0; flex: none; }
.sml-person .avatar, .sml-person .avatar-none { font-size: 11px; }

.sml-list .gs-panel-body, .sml-view, .sml-compose { padding-bottom: 6px; }
.sml-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px 0; border-bottom: 2px solid var(--head); }
.sml-tab { background: var(--head); color: var(--head-text); font-weight: 700; padding: 3px 14px; border-radius: 5px 5px 0 0; font-size: 13px; }
.sml-quick { width: 180px; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.sml-tabs button { min-height: 30px; }
.sml-menu { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.sml-menu button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.sml-paging { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 12px; }
.sml-page { width: auto; min-height: 28px; padding: 2px 6px; font-size: 12px; }

.sml-table { table-layout: fixed; }
.sml-table th, .sml-table td { padding: 6px 8px; }
.sml-table .c-check { width: 34px; text-align: center; }
.sml-table .c-person { width: 22%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sml-table .c-mark { width: 62px; text-align: center; }
.sml-table .c-when { width: 132px; white-space: nowrap; }
.sml-table .c-title { overflow: hidden; }
.sml-title-cell { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sml-table th.sortable { cursor: pointer; user-select: none; }
.sml-table th.sortable.on { color: var(--accent); }
.sml-table tr.clickable { cursor: pointer; }
.sml-table tr.clickable:hover td { background: var(--panel-2); }
.sml-table tr.unread td { font-weight: 700; }
.sml-table tr.unread .sml-title { color: var(--accent); }
.sml-title { min-width: 0; overflow-wrap: anywhere; }
.sml-clip { font-size: 12px; }
.sml-mark { font-size: 15px; line-height: 1; }
.tag.label { border-color: #e8a33a; color: #a86200; background: #fff4e0; }
.tag.recalled { border-color: var(--danger); color: var(--danger); }
@media (prefers-color-scheme: dark) { .tag.label { background: transparent; color: #f0b560; } }
.portal-table tr.unread td { font-weight: 700; }

.sml-form { margin: 0; }
.sml-form th { width: 150px; vertical-align: top; padding-top: 11px; white-space: nowrap; }
.sml-form td { vertical-align: top; }
.sml-form .req { color: var(--danger); margin-left: 3px; }
.sml-form td.c-actions { width: 1%; white-space: nowrap; text-align: right; }
.sml-radios { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
label.sml-radio { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 400; font-size: 13px; cursor: pointer; }
.sml-small { width: auto; min-height: 32px; padding: 3px 6px; }
.sml-mid { max-width: 360px; }
.sml-keyword { max-width: 420px; margin-bottom: 6px; }
.sml-sortkey { width: auto; min-height: 30px; padding: 2px 6px; margin: 0 4px; }
.sml-search { margin-bottom: 12px; }
.sml-search-actions { justify-content: center; margin: 8px 0 10px; }
.sml-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #e3eefa; color: var(--text); border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 13px;
}
@media (prefers-color-scheme: dark) { .chip { background: #24344a; } }
.chip-x { min-height: 20px !important; height: 20px; width: 20px; padding: 0 !important; border: none; background: none !important; color: var(--muted); border-radius: 999px; }
.chip-x:hover { color: var(--danger); }
.sml-recipients { gap: 8px; min-height: 36px; }
.sml-recipients > button { flex: none; }
.sml-title-input { font-size: 15px; }
.sml-body-input { min-height: 320px; font-size: 14px; }
.sml-dest { gap: 8px; margin: 4px 0; }
.sml-settings-head { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: var(--panel); }
.sml-sub { margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.sml-notice { margin: 8px; padding: 8px 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--radius); font-size: 13px; }

.sml-view-head { display: flex; gap: 14px; padding: 12px 14px 4px; align-items: flex-start; }
.sml-view-meta { flex: 1; min-width: 0; }
.sml-view-title { margin: 0 0 6px; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.sml-headers { width: auto; }
.sml-headers th, .sml-headers td { padding: 2px 8px 2px 0; border: none; background: none; font-size: 13px; vertical-align: top; }
.sml-headers th { color: var(--muted); white-space: nowrap; }
.sml-headers th::after { content: ' :'; }
.sml-body { margin: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-height: 120px; }
.sml-view-foot { display: flex; gap: 18px; justify-content: flex-end; padding: 0 14px 8px; font-size: 13px; }
.sml-opened td.unopened { color: var(--danger); }

.sml-modal-box { width: min(460px, 100%); }
.sml-modal-box .sml-people { max-height: 50dvh; }

.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 9px; background: var(--panel);
  color: var(--text); text-decoration: none; font-size: 13px;
}
.attach:hover { border-color: var(--accent); }
.attach-size { font-size: 11px; opacity: .75; }
.attach-thumb { max-width: min(280px, 100%); max-height: 200px; border-radius: 6px; display: block; }
.staged { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.staged .attach { padding-right: 4px; }

/* PDF 出力はブラウザの印刷（「PDF に保存」）。印刷のあいだだけ、メールの中身以外を隠す */
#print-area { display: none; }
@media print {
  body { background: #fff !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; background: #fff; }
  .print-mail { page-break-after: always; font-size: 11pt; }
  .print-mail:last-child { page-break-after: auto; }
  .print-mail h2 { font-size: 15pt; margin: 0 0 8pt; }
  .print-mail table { width: 100%; border-collapse: collapse; margin-bottom: 10pt; }
  .print-mail th, .print-mail td { border: 1px solid #999; padding: 3pt 6pt; text-align: left; font-size: 10pt; color: #000; background: #fff; }
  .print-mail th { width: 20%; background: #eee; }
  .print-body { white-space: pre-wrap; word-break: break-word; }
}

/* ---- スケジュール ---- */
.sched-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.sched-bar select { width: auto; min-width: 130px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: none; border-radius: 0; min-height: 34px; padding: 0 14px; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 12px;
}
.cal-head { background: var(--panel-2); text-align: center; padding: 6px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-head.sun, .cal-cell.sun .cal-date { color: #c0392b; }
.cal-head.sat, .cal-cell.sat .cal-date { color: var(--accent); }
.cal-cell {
  background: var(--panel); min-height: 100px; padding: 5px 5px 7px;
  cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.cal-cell:hover { background: var(--panel-2); }
.cal-cell.other-month { opacity: .45; }
.cal-cell.today .cal-date {
  background: var(--accent); color: #fff; border-radius: 999px;
  width: 24px; height: 24px; display: grid; place-items: center;
}
.cal-cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-date { font-size: 12px; font-weight: 700; line-height: 24px; height: 24px; }
.cal-chip {
  font-size: 11px; line-height: 1.5; padding: 1px 6px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid currentColor;
}
.cal-chip.personal { border-left-style: dotted; }
.cal-more { font-size: 11px; color: var(--muted); }

/* 週間（人 × 曜日） */
.week-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
.week { border-collapse: collapse; width: 100%; min-width: 860px; }
.week th, .week td { border: 1px solid var(--line); vertical-align: top; padding: 5px 6px; }
.week thead th { background: var(--panel-2); text-align: center; font-size: 12px; padding: 6px 4px; }
.week thead th.sun { color: #c0392b; }
.week thead th.sat { color: var(--accent); }
.week thead th.today { background: #e3eefa; }
@media (prefers-color-scheme: dark) { .week thead th.today { background: #24344a; } }
.week th.who-col { width: 150px; text-align: left; background: var(--panel-2); font-size: 13px; }
.week td { min-width: 100px; }
.week td.today { background: rgba(44, 108, 168, .06); }
.week-chip {
  font-size: 11px; line-height: 1.5; padding: 1px 6px; border-radius: 4px;
  margin-bottom: 3px; cursor: pointer;
  border-left: 3px solid currentColor;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 事業部名は長いので1行に収めて省略する。2行に折り返すと行の高さが揃わない */
.who-org {
  display: block; font-size: 11px; color: var(--muted); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.week th.who-col { max-width: 150px; }

.day-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 4px; border-bottom: 1px solid var(--line);
}
.day-row:last-child { border-bottom: none; }
.day-row.clickable { cursor: pointer; }
.day-row.clickable:hover { background: var(--panel-2); }
.day-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 58px; }
.day-title { font-weight: 700; }
.dot { width: 11px; height: 11px; border-radius: 999px; flex: none; }
/* 色クラス（.c-orange など）が薄い背景を敷くので、丸だけは塗りつぶしに上書きする */
span.dot { background-color: currentColor; }

.c-blue   { color: #1f6feb; background: color-mix(in srgb, #1f6feb 14%, transparent); }
.c-teal   { color: #0d9488; background: color-mix(in srgb, #0d9488 14%, transparent); }
.c-green  { color: #15803d; background: color-mix(in srgb, #15803d 14%, transparent); }
.c-yellow { color: #a16207; background: color-mix(in srgb, #a16207 16%, transparent); }
.c-orange { color: #c2410c; background: color-mix(in srgb, #c2410c 14%, transparent); }
.c-red    { color: #c0392b; background: color-mix(in srgb, #c0392b 14%, transparent); }
.c-pink   { color: #db2777; background: color-mix(in srgb, #db2777 14%, transparent); }
.c-purple { color: #7c3aed; background: color-mix(in srgb, #7c3aed 14%, transparent); }
.c-brown  { color: #92400e; background: color-mix(in srgb, #92400e 14%, transparent); }
.c-gray   { color: #64748b; background: color-mix(in srgb, #64748b 16%, transparent); }

@media (prefers-color-scheme: dark) {
  .c-blue   { color: #6ea8ff; }
  .c-teal   { color: #4fd1c5; }
  .c-green  { color: #6ee7a0; }
  .c-yellow { color: #e3c04a; }
  .c-orange { color: #ff9f5a; }
  .c-red    { color: #ff8b7b; }
  .c-pink   { color: #ff8ac0; }
  .c-purple { color: #b794ff; }
  .c-brown  { color: #d3a06a; }
  .c-gray   { color: #a3b1c2; }
  .cal-head.sun, .cal-cell.sun .cal-date, .week thead th.sun { color: #ff8b7b; }
  .cal-head.sat, .cal-cell.sat .cal-date, .week thead th.sat { color: #6ea8ff; }
}

/* ---- 狭い画面（iPad 縦・iPhone） ---- */
@media (max-width: 780px) {
  .gs-main { padding: 10px; }
  .gs-tool { min-width: 68px; font-size: 11px; }
  .gs-icon svg { width: 30px; height: 30px; }
  .gs-who { display: none; }
  /* 狭い画面では月表示のセルを詰める。予定は下の一覧で読む。
     隠すのは月表示のセルの中だけ（メインの週一覧でも同じクラスを使っているため） */
  .cal-cell { min-height: 58px; }
  .cal-cell .cal-chip, .cal-cell .cal-more { display: none; }
  .cal-cell.has-events .cal-date::after {
    content: ''; display: block; width: 5px; height: 5px;
    border-radius: 999px; background: var(--accent); margin: -3px auto 0;
  }
  .thread { max-height: 42dvh; }
}

/* ---- 掲示板 ---- */
.boards-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .boards-layout { grid-template-columns: minmax(0, 1fr); } }

.board-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: none; border-radius: var(--radius);
  background: transparent; min-height: 38px;
  padding: 0 10px;
}
.board-item:hover { background: var(--panel-2); }
.board-item.on { background: #e3eefa; font-weight: 700; color: var(--accent); }
@media (prefers-color-scheme: dark) { .board-item.on { background: #24344a; } }
.board-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 4px 10px;
}
.board-head h3 { margin: 0; font-size: 17px; }

.comment { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.comment:last-child { border-bottom: none; }
.comment .detail-body { margin: 4px 0 6px; }
.comment.removed { opacity: .7; }

/* ---- 施設予約（1日の帯） ---- */
.rv-board { padding: 12px 14px 6px; }
.rv-row { display: flex; align-items: stretch; gap: 8px; margin-bottom: 6px; }
.rv-row.rv-head { margin-bottom: 2px; }
.rv-name {
  width: 170px; flex: none; font-size: 13px; font-weight: 700;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.rv-scale { position: relative; flex: 1; height: 18px; }
.rv-tick { position: absolute; top: 0; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.rv-lane {
  position: relative; flex: 1; height: 38px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; overflow: hidden;
}
.rv-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.rv-block {
  position: absolute; top: 3px; bottom: 3px;
  border: none; border-left: 3px solid currentColor; border-radius: 3px;
  min-height: auto; padding: 0 6px;
  font-size: 11px; font-weight: 700; text-align: left;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
@media (max-width: 780px) {
  .rv-name { width: 96px; font-size: 12px; }
  .rv-lane { height: 32px; }
}

/* ---- アンケート ---- */
.question { margin-bottom: 14px; }
.question .row { margin-bottom: 6px; }
.question input[type="radio"], .question input[type="checkbox"] { width: 17px; height: 17px; min-height: auto; margin: 0; }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.bar-label { width: 140px; flex: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { flex: 1; height: 16px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-n { width: 54px; flex: none; text-align: right; font-size: 12px; color: var(--muted); }

/* 名簿の行 */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }

/* 移行元の入力画面に合わせた小物 */
.char-count { font-size: 12px; margin: 4px 0 0; text-align: right; }
.char-count.over { color: var(--danger); font-weight: 700; }
.radio-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-weight: 400; }
.radio-row input[type="radio"] { width: 17px; height: 17px; min-height: auto; margin: 0; }
.static-value { margin: 5px 0 0; font-weight: 400; font-size: 15px; }
.important-mark { color: var(--danger); }

/* ---- ユーザ情報 ---- */
.profile-head { display: flex; gap: 16px; align-items: flex-start; }
.profile-head table { flex: 1; }
.profile-head th { width: 4.5em; white-space: nowrap; }
.avatar { border: 1px solid var(--line); border-radius: 4px; object-fit: cover; flex: none; background: var(--panel-2); }
.avatar-none {
  display: grid; place-items: center; color: var(--muted);
  font-weight: 700; font-size: 1.2em;
}
@media (max-width: 600px) { .profile-head { flex-direction: column-reverse; align-items: center; } }

/* ---- 月間表示（移行元に合わせて、日付は右・終日は週ごとの帯） ---- */
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
.cal-month { border-collapse: collapse; table-layout: fixed; width: 100%; min-width: 760px; }
.cal-month th {
  background: var(--panel-2); text-align: center; padding: 6px 0;
  font-size: 12px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line);
}
.cal-month th.sun { color: #c0392b; }
.cal-month th.sat { color: var(--accent); }
.cal-month td {
  border: 1px solid var(--line); vertical-align: top;
  height: 84px; padding: 3px 4px 5px; cursor: pointer; position: relative;
}
.cal-month td:hover { background: var(--panel-2); }
.cal-month td.other-month { background: var(--panel-2); opacity: .55; }
.cal-month td.today { background: #fdf6dd; }
@media (prefers-color-scheme: dark) { .cal-month td.today { background: #3a3520; } }
.cal-month td.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-month .cal-date {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; margin-bottom: 2px;
}
.cal-add {
  padding: 0; width: 16px; height: 16px; line-height: 1;
  border: none; background: none; color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; opacity: .45;
}
.cal-add:hover { opacity: 1; color: var(--accent); background: none; }
.cal-month td.sun .cal-date { color: #c0392b; }
.cal-month td.sat .cal-date { color: var(--accent); }

/* 終日の帯 */
.cal-month tr.cal-allday td { height: auto; padding: 0; border-top: none; }
.allday-band {
  background: #dff0e6; color: #1d6b3f;
  font-size: 11px; text-align: center; padding: 2px 4px; margin: 0 0 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (prefers-color-scheme: dark) { .allday-band { background: #1e3a2a; color: #8fe0ac; } }

/* メインの今週のスケジュール（横並び） */
.week-portal { min-width: 700px; }
.week-portal td { height: 54px; }
.week-portal tr.allday td { background: #f2f8f4; height: auto; }
@media (prefers-color-scheme: dark) { .week-portal tr.allday td { background: #1a2a20; } }
.week-portal { table-layout: fixed; }
.week-portal tr.allday .week-chip { text-align: center; border-left: none; }

/* グループ表示のとき、予定に添える職員名 */
.chip-who {
  display: block;
  background: rgba(0, 0, 0, .07);
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  padding: 0 4px; border-radius: 3px;
  margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (prefers-color-scheme: dark) { .chip-who { background: rgba(255, 255, 255, .12); } }
.cal-month td { height: 100px; }
.cal-chip { white-space: normal; }

/* ---- 職員登録（移行元のユーザマネージャーに合わせた表組み） ---- */
.contact-table th {
  width: 190px; text-align: left; vertical-align: middle;
  background: var(--panel-2); font-weight: 700; font-size: 13px;
}
.contact-table td { vertical-align: middle; }
.contact-table .row > input[type="text"], .contact-table .row > input[type="email"] { width: auto; flex: 1 1 140px; min-width: 90px; }
.pub-cell { width: 230px; white-space: nowrap; }
.pub-cell .inline { display: inline-flex; margin: 0 10px 0 0; }
.group-tree { display: flex; flex-direction: column; gap: 10px; }
.group-org > b { font-size: 12px; color: var(--muted); }
@media (max-width: 780px) {
  .contact-table th, .pub-cell { width: auto; }
  .contact-table, .contact-table tbody, .contact-table tr, .contact-table th, .contact-table td { display: block; }
  .contact-table th { border-bottom: none; }
}

/* ---- メインの一覧（掲示板・ショートメール） ---- */
.portal-table th {
  background: var(--panel-2); text-align: left; font-size: 12px; color: var(--muted);
  padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.portal-table td {
  padding: 5px 8px; border-bottom: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0;
}
.portal-table tr:last-child td { border-bottom: none; }
.portal-table .c-forum { width: 22%; }
.portal-table .c-who { width: 16%; }
.portal-table .c-when { width: 130px; }
.portal-table tr.clickable:hover { background: var(--panel-2); cursor: pointer; }
.new-badge {
  display: inline-block; margin-right: 5px; padding: 0 4px; border-radius: 3px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px;
}
.info-row.col { flex-direction: column; align-items: stretch; gap: 2px; }
.info-row.col > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-row.col .muted { font-size: 11px; }
.last-login { margin: 0; font-size: 15px; font-weight: 700; }
.portal-month td { height: 62px; font-size: 11px; vertical-align: top; }
.portal-month .week-chip { font-size: 11px; }

/* ---- 日時の入力と時計 ---- */
.dt-field { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dt-field .dt-date { width: auto; flex: 0 1 165px; }
.dt-time-box {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding-right: 2px;
}
.dt-time-box:focus-within { border-color: var(--accent); }
.dt-time {
  width: 4.5em; border: none; background: none; padding: 6px 8px;
  font-size: 14px; text-align: center;
}
.dt-time:focus { outline: none; }
.clock-open {
  padding: 0 6px; border: none; background: none; font-size: 15px;
  line-height: 1; cursor: pointer; filter: grayscale(1); opacity: .6;
}
.clock-open:hover { filter: none; opacity: 1; background: none; }

.clock-pop {
  position: absolute; z-index: 60; width: 272px; padding: 10px 16px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.clock-head { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: 1px; }
.clock-part { cursor: pointer; color: var(--muted); padding: 0 2px; }
.clock-part.on { color: var(--accent); }
.clock-colon { color: var(--muted); }
.clock-face {
  position: relative; width: 240px; height: 240px; margin-top: 6px;
  border-radius: 50%; background: var(--panel-2); cursor: pointer;
}
.clock-hand { position: absolute; inset: 0; width: 240px; height: 240px; pointer-events: none; }
.clock-hand line { stroke: var(--accent); stroke-width: 1.5; }
.clock-hand circle { fill: var(--accent); }
.clock-num {
  position: absolute; transform: translate(-50%, -50%);
  width: 30px; height: 30px; line-height: 30px; border-radius: 50%;
  text-align: center; font-size: 14px; color: var(--text); pointer-events: none;
}
.clock-num.on { background: rgba(44, 108, 168, .18); font-weight: 700; color: var(--accent); }

/* 週間は、その日の欄（白い枠）の中に「＋」を置く */
.cell-add { display: flex; margin-bottom: 2px; }
.week td { vertical-align: top; }

/* 文字数の表示 */
.char-count { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.char-count.over { color: var(--danger); font-weight: 700; }

/* ---- 並び替え ---- */
.sort-list { display: flex; flex-direction: column; }
.sort-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-bottom: 1px solid var(--line);
}
.sort-row:last-child { border-bottom: none; }
.sort-no {
  flex: none; width: 26px; text-align: right;
  font-size: 12px; color: var(--muted);
}
.sort-name { font-weight: 700; white-space: pre; }
.sort-row button {
  flex: none; width: 30px; padding: 3px 0; font-size: 12px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
}
.sort-row button:disabled { opacity: .3; cursor: default; }

/* ---- 別システムから借りてきた数字 ---- */
.kpi-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.kpi {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2);
}
.kpi-group { font-size: 10px; color: var(--muted); }
.kpi-name { font-size: 12px; font-weight: 700; }
.kpi-value { display: flex; align-items: baseline; gap: 3px; }
.kpi-value b { font-size: 22px; line-height: 1.2; }
.kpi-unit { font-size: 11px; color: var(--muted); }
.kpi-diff { font-size: 11px; }
.kpi-diff.up { color: #1d6b3f; }
.kpi-diff.down { color: var(--danger); }
@media (prefers-color-scheme: dark) { .kpi-diff.up { color: #8fe0ac; } }

.kpi-prev { font-size: 11px; color: var(--muted); }
.kpi-diff b { font-weight: 700; }
.kpi-note { margin: 8px 0 0; font-size: 11px; }
/* 青い見出しの中に置く札。白地に濃い字でないと読めない */
.gs-panel-head .seg { margin: 0; border-color: rgba(255, 255, 255, .55); }
.gs-panel-head .seg button {
  min-height: 24px; padding: 0 12px; font-size: 12px;
  background: var(--panel); color: var(--text); font-weight: 700;
}
.gs-panel-head .seg button.on { background: var(--accent); color: #fff; }
.gs-panel-head .seg button + button { border-left-color: rgba(255, 255, 255, .55); }

.gs-panel-head .kpi-arrow {
  min-height: 24px; padding: 0 8px; font-size: 11px;
  background: transparent; color: var(--head-text); border: 1px solid rgba(255, 255, 255, .55);
}
.gs-panel-head .kpi-arrow:disabled { opacity: .35; }
.kpi-period { font-size: 13px; }

/* KDS のシェアの枠に添える他校の数字 */
.kpi-subs {
  margin-top: 2px; padding-top: 3px; border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--muted);
}

/* シェアの学校ごとの色。KDS 青・A校 赤・H校 緑。見出しの「全車種／普通車」は黒のまま */
.school-kds { color: var(--accent); }
.kpi-value.school-kds .kpi-unit,
.kpi-value.school-a .kpi-unit,
.kpi-value.school-h .kpi-unit { color: inherit; opacity: .7; }
.school-a { color: #c0392b; }
.school-h { color: #1d6b3f; }
@media (prefers-color-scheme: dark) {
  .school-a { color: #ff8b7b; }
  .school-h { color: #8fe0ac; }
}
/* シェアの見出し「釧路市内シェア 全車種」は黒。他の項目名と同じ太さ・大きさで出す */
.kpi-group.plain { color: var(--text); font-size: 12px; font-weight: 700; }

/* ---- ファイル管理（キャビネット一覧と中身の表） ---- */
.cab-table th, .doc-table th {
  background: var(--head); color: var(--head-text);
  text-align: left; font-size: 12px; padding: 6px 10px;
}
.cab-table td, .doc-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.cab-table tr.clickable:hover td, .doc-table tr.clickable:hover td { background: var(--panel-2); cursor: pointer; }
.cab-name a, .doc-name a { color: var(--accent); font-weight: 700; }
.cab-name .muted { display: block; font-size: 12px; }
.cab-size { width: 140px; white-space: nowrap; }
.cab-detail { width: 70px; text-align: center; }
.doc-icon { margin-right: 5px; }
.doc-size { width: 90px; text-align: right; white-space: nowrap; }
.doc-when { width: 150px; white-space: nowrap; }
.doc-who { width: 110px; white-space: nowrap; }
.doc-path {
  background: var(--head); color: var(--head-text);
  font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 4px 4px 0 0;
}
.doc-path + .doc-table { margin-top: 0; }

/* ログイン画面の版表示。自動更新が届いたかをここで目視する */
.login-build { margin: 8px 0 0; text-align: center; font-size: 11px; color: #9aa4ab; }

/* ---- 予定表のスマホ幅（780px 以下） ----
   横スクロールをやめて 7日分を画面の幅に収める。PC・iPad（横）の見た目は変えない。
   ここより前にある .week-portal / .cal-month の指定を上書きするため、ファイルの最後に置く。
   PC 用とスマホ用の文字（時刻・日付・名前）を両方描いておき、ここで出し分ける */
.t-short, .wd-short, .who-short, .chip-more, .cal-more-m { display: none; }

/* スマホで枠を押したときの小窓（その日の予定・人の情報） */
.pop-panel { width: min(440px, 100%); }
.pop-panel .gs-panel-head { gap: 6px; }
.pop-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-panel .gs-panel-head .pop-close {
  min-height: 30px; min-width: 36px; padding: 0 8px; font-size: 18px; line-height: 1;
  background: transparent; color: var(--head-text); border: 1px solid rgba(255, 255, 255, .55);
}
.pop-list { max-height: 55dvh; overflow-y: auto; }
.pop-list .day-row { min-height: 44px; flex-wrap: nowrap; }
.pop-list .day-time { flex: none; }
.pop-list .day-title { min-width: 0; overflow-wrap: anywhere; }
.pop-list .muted { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pop-person th { width: 5em; white-space: nowrap; text-align: left; color: var(--muted); font-weight: 400; }
.pop-panel .actions button { min-height: 40px; }

@media (max-width: 780px) {
  /* 施設予約も .who-org を使っているので、予定表の中だけに絞る */
  .t-long, .wd-long, .week .who-name, .week .who-org, .chip-who .who-name { display: none; }
  .t-short, .wd-short, .week .who-short, .chip-who .who-short { display: inline; }

  /* 週間（人 × 曜日）とメインの週の欄 */
  .week, .week-portal { min-width: 0; table-layout: fixed; }
  .week th, .week td { padding: 2px; }
  .week td { min-width: 0; height: 44px; cursor: pointer; }
  .week thead th { font-size: 10px; line-height: 1.3; padding: 3px 0; }
  .week thead th .wd-day { display: block; }
  .week th.who-col {
    width: 58px; max-width: 58px; padding: 2px 3px; font-size: 11px; line-height: 1.3;
    vertical-align: middle; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .week .cell-add { display: none; }
  .week-chip {
    font-size: 10px; line-height: 1.4; padding: 0 2px; margin-bottom: 2px;
    border-left-width: 2px; border-radius: 3px;
  }
  .week-chip .t-short { display: block; font-size: 9px; line-height: 1.25; font-variant-numeric: tabular-nums; }
  .week-chip .chip-title { display: block; overflow: hidden; text-overflow: ellipsis; }
  .week-chip.chip-extra { display: none; }
  .chip-more { display: block; font-size: 10px; line-height: 1.3; color: var(--muted); text-align: center; }
  .week-portal td { height: 48px; }
  .week-portal tr.allday td { height: 22px; }
  .week-portal tr.allday .week-chip { padding: 0 1px; }

  /* 月間。予定は小さな文字で 2件（画面が高ければ 3件）まで出し、残りは「+2」 */
  .cal-month { min-width: 0; }
  .cal-month td { height: 58px; padding: 1px 2px 2px; }
  .cal-month .cal-date { justify-content: flex-end; font-size: 11px; line-height: 16px; margin-bottom: 1px; }
  .cal-month .cal-add { display: none; }
  .cal-month .cal-chip {
    font-size: 10px; line-height: 1.35; padding: 0 2px; margin-bottom: 1px;
    border-left-width: 2px; border-radius: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cal-month .cal-chip .t-short { display: none; }
  .cal-month .chip-who { display: inline; padding: 0 2px; margin: 0 2px 0 0; font-size: 9px; }
  .cal-month .cal-chip.chip-n3, .cal-month .cal-chip.chip-n4, .cal-month .cal-more { display: none; }
  .cal-more-m { font-size: 10px; line-height: 1.3; color: var(--muted); text-align: right; padding-right: 2px; }
  .cal-more-m.m2 { display: block; }
  .allday-band { font-size: 10px; padding: 0 2px; }
}
/* 縦に余裕のあるスマホ（iPhone の多く）は 3件目まで出す */
@media (max-width: 780px) and (min-height: 640px) {
  .cal-month td { height: 68px; }
  .cal-month .cal-chip.chip-n3 { display: block; }
  .cal-more-m.m2 { display: none; }
  .cal-more-m.m3 { display: block; }
}
