/* 巨大フォントはスマホで読み込みが重く白画面の原因になるため、ここでは読まない */
:root {
  --bg: #eef3f0;
  --bg-soft: #f7faf8;
  --surface: #ffffff;
  --ink: #1c2b24;
  --muted: #5b6d64;
  --line: #8fa39a;
  --brand: #1f6f5b;
  --brand-dark: #155445;
  --brand-soft: #d8efe7;
  --accent: #c45c26;
  --ok: #2f7d4a;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(28, 43, 36, 0.08);
  --radius: 18px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  --display: "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 111, 91, 0.12), transparent 40%),
    radial-gradient(circle at bottom right, rgba(196, 92, 38, 0.08), transparent 35%),
    linear-gradient(180deg, #f4f8f6 0%, var(--bg) 100%);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-dark);
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.mobile-shell {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 1rem 1rem 5.5rem;
}

.pc-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-family: "Noto Sans CJK JP", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand-dark);
}

.brand span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.nav a,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary,
.nav a.primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 8px 18px rgba(31, 111, 91, 0.25);
}

.btn-primary:hover,
.nav a.primary:hover {
  background: var(--brand-dark);
  color: white;
  transform: translateY(-1px);
}

.btn-secondary,
.nav a {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover,
.nav a:hover {
  background: var(--brand-soft);
}

.btn-block {
  width: 100%;
}

.card {
  background: var(--surface);
  border: 1.5px solid #7d9288;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.card + .card {
  margin-top: 1rem;
}

.hero {
  padding: 1.4rem;
  background:
    linear-gradient(135deg, rgba(31, 111, 91, 0.95), rgba(21, 84, 69, 0.92)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 50%);
  color: white;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: 1.55rem;
}

.hero p {
  margin: 0;
  opacity: 0.92;
  line-height: 1.6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 1rem 0 1.4rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.stat .label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat .value {
  margin-top: 0.35rem;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.list {
  display: grid;
  gap: 0.75rem;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: inherit;
}

.list-item:hover {
  border-color: #b7d4c8;
  background: var(--bg-soft);
}

.list-item strong {
  display: block;
  font-size: 1.05rem;
}

.list-item small {
  color: var(--muted);
}

a.job-card {
  text-decoration: none;
  align-items: flex-start;
}

.job-preview {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.badge-open {
  background: #f4e6c8;
  color: #7a5410;
}

.job-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  font-weight: 700;
}

.job-date-nav .job-date-step {
  flex: 0 0 auto;
  color: var(--brand-dark);
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  text-decoration: none;
}

.job-date-pick {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.job-date-input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

.job-date-caption {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.job-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin: 0 0 0.85rem;
}

.job-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  padding: 0.4rem 0.1rem 0.35rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid transparent;
}

.job-week-day small {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1;
}

.job-week-day strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.job-week-day i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: transparent;
}

.job-week-day.has-jobs i {
  background: var(--brand);
}

.job-week-day.is-today {
  border-color: var(--line);
}

.job-week-day.is-selected {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.job-today-link {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
}
.job-jump-note {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}
.job-busy-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.job-busy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.job-busy-item {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.job-busy-item.is-selected {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.job-nearby {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}

.job-nearby a {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  text-align: center;
}

.emergency-wrap {
  margin: 1rem 0 0;
}

.job-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  border: 1.5px solid #6f867c;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  background: #fff;
}

.form-control:focus {
  outline: 2px solid rgba(31, 111, 91, 0.25);
  border-color: var(--brand);
}

.form-check {
  width: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.help {
  color: var(--muted);
  font-size: 0.85rem;
}

.wareki-hint {
  margin: 0.35rem 0 0;
  color: var(--brand-dark);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wareki-hint:empty {
  display: none;
}

.wareki-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.wareki-wrap > input.wareki-native-date[type="date"] {
  width: auto;
  max-width: 12rem;
  margin: 0;
}

/* display:none / hidden だと required が効かないため視覚的にだけ隠す */
.wareki-wrap.is-cal-closed > input.wareki-native-date[type="date"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.wareki-cal-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #667);
  font-size: 0.82rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wareki-cal-toggle:hover {
  color: var(--brand-dark, #1a4d3a);
}

.wareki-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.45rem;
  font-size: 0.95rem;
  color: var(--text, #222);
}

.wareki-input .wareki-era {
  width: auto;
  min-width: 5.8rem;
  flex: 0 0 auto;
  padding: 0.45rem 0.55rem;
  font-weight: 600;
}

.wareki-input .wareki-year,
.wareki-input .wareki-month,
.wareki-input .wareki-day {
  width: 3.6rem;
  flex: 0 0 auto;
  padding: 0.45rem 0.3rem;
  text-align: center;
  font-weight: 600;
}

.wareki-input .wareki-sync-note {
  flex: 1 1 100%;
  margin: 0.05rem 0 0;
  color: var(--brand-dark);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wareki-input .wareki-sync-note.is-error {
  color: var(--danger, #b42318);
  font-weight: 600;
}

.wareki-input .wareki-sync-note:empty {
  display: none;
}

.errorlist {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-size: 0.9rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 0.3rem;
  font-family: "Noto Sans CJK JP", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand-dark);
}

.login-card .sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.pc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #163f35 0%, #1f6f5b 100%);
  color: white;
  padding: 1.5rem 1rem;
}

.sidebar .brand {
  color: white;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.sidebar .brand span {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar a.brand-switch {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.sidebar a.brand-switch:hover,
.sidebar a.brand-switch.active {
  background: transparent;
  color: white;
}

.sidebar a.brand-switch img,
.sidebar a.brand-switch .brand-mark {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar a.brand-switch .brand-mark {
  box-sizing: border-box;
  padding: 0.85rem 0.4rem 0.7rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  background: #1a6b7a;
  line-height: 1.2;
}

.sidebar a.brand-switch .brand-mark ruby rt {
  font-size: 0.52em;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #ffcc33;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  padding: 0.05em 0.35em 0.08em;
  text-shadow: none;
}

.sidebar a.brand-switch span {
  display: block;
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sidebar a.brand-switch .brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.15rem 0 0.1rem;
}

.sidebar a.brand-switch .brand-name ruby rt {
  font-size: 0.45em;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.login-card h1.brand-title {
  line-height: 1.35;
}

.login-card h1.brand-title ruby rt {
  font-size: 0.5em;
  color: #c45c16;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: rgba(196, 92, 22, 0.12);
  border-radius: 4px;
  padding: 0.05em 0.3em 0.08em;
}

.mobile-shell .brand ruby rt {
  font-size: 0.5em;
  color: #c45c16;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: rgba(196, 92, 22, 0.12);
  border-radius: 4px;
  padding: 0.05em 0.3em 0.08em;
}

body.app-mode-day .sidebar {
  background: linear-gradient(180deg, #0f3a45 0%, #1a6b7a 100%);
}

.sidebar nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar a {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.85rem 1rem;
  border-radius: 12px;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.pc-main {
  padding: 1.5rem;
}

.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.pc-header h1 {
  margin: 0;
  font-size: 1.7rem;
}

/* 代表取締役の上に KANRI */
.ruby-kanji-box {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  line-height: 1.35;
  font-size: 1rem;
  color: var(--text, #1e293b);
}

.ruby-kanji-box ruby {
  ruby-align: center;
}

.ruby-kanji-box ruby rt {
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #64748b;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #6f867c;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.85rem 0.6rem;
  border: 1px solid #b4c4bc;
  vertical-align: top;
}

table.data th {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  background: #e6eee9;
  border-bottom: 1.5px solid #6f867c;
}

table.data .nowrap {
  white-space: nowrap;
}

.client-table th,
.client-table td {
  vertical-align: middle;
  padding: 0.7rem 0.8rem;
}

.client-name {
  display: inline-block;
  white-space: nowrap;
}

.client-kana {
  margin: 0 0 0.1rem;
  line-height: 1.2;
}

.client-table .help {
  margin-top: 0.15rem;
}

.contract-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.contract-chip {
  display: inline-block;
  background: #eef4f1;
  border: 1px solid #c5d4cc;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.client-notice {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.4;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.toolbar .form-control {
  min-width: 180px;
}

.success-box {
  text-align: center;
  padding: 2rem 1rem;
}

.success-box .mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.8rem;
  font-weight: 800;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.quick-btn {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
  border: 1px solid #c6e4d8;
}

.quick-btn:hover {
  background: #cce9de;
  color: var(--brand-dark);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.quick-row a {
  text-align: center;
  padding: 0.55rem 0.3rem;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.badge-important {
  background: #f7e3cf;
  color: #8a4b16;
}

.badge-urgent {
  background: #f8d4d0;
  color: #8f1f16;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.7rem;
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  z-index: 40;
}

.bottom-nav-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

body.no-bottom-nav .mobile-shell {
  padding-bottom: 1.5rem;
}

.mobile-save-bar {
  position: sticky;
  bottom: 4.8rem;
  z-index: 30;
  margin-top: 1rem;
  padding: 0.75rem 0 0.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 28%);
}

.bottom-nav a {
  text-align: center;
  padding: 0.7rem 0.4rem;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.bottom-nav a.active,
.bottom-nav a:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.8rem;
}

.content-block {
  white-space: pre-wrap;
  line-height: 1.7;
}

.alert-banner {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.alert-banner ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.alert-warning {
  background: #fff3cd;
  color: #664d03;
  border: 1px solid #ffecb5;
}

.alert-expired {
  background: #fdecea;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.row-warning td {
  background: #fff8dc;
}

.row-expired td {
  background: #ffe6e6;
}

.form-section {
  margin: 1.6rem 0 0.8rem;
  font-size: 1.05rem;
  color: var(--brand-dark);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}

.client-form-card {
  max-width: 980px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 1rem;
}

.form-grid .form-group:has(textarea),
.form-grid .form-group:has(#id_address),
.form-grid .form-group:has(#id_medical_notes),
.form-grid .form-group:has(#id_notes) {
  grid-column: 1 / -1;
}

.alert-ok {
  background: #e7f6ed;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.staff-stats {
  grid-template-columns: repeat(4, 1fr);
}

.staff-stats .stat {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.staff-stats .stat:hover,
.staff-stats .stat-active {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.staff-stats .stat-active {
  background: var(--brand-soft);
}

.wage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.wage-chip {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-status-在籍 {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge-status-休職 {
  background: #fff3cd;
  color: #664d03;
}

.badge-status-退職 {
  background: #e9ecef;
  color: #495057;
}

.row-muted td {
  background: #f3f4f6;
  color: #6b7280;
}

.staff-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  white-space: nowrap;
}

button.linkish {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.wage-table {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.wage-head,
.wage-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.5fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.7rem 0.85rem;
}

.wage-head {
  background: var(--bg-soft);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.wage-row + .wage-row {
  border-top: 1px solid var(--line);
}

.wage-row-actions {
  display: flex;
  align-items: center;
  min-height: 42px;
}

@media (max-width: 860px) {
  .staff-stats {
    grid-template-columns: 1fr 1fr;
  }

  .wage-head,
  .wage-row {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 860px) {
  .pc-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 0.5rem;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* アセスメント */
.assess-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.assess-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.assess-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.assess-panel {
  display: none;
}

.assess-panel.active {
  display: block;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.section-sub {
  margin: 1.25rem 0 0.65rem;
  font-size: 1rem;
  color: var(--brand-dark);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* 漢字の上にローマ字読み */
ruby {
  ruby-align: center;
  ruby-position: over;
}

ruby rt {
  font-size: 0.55em;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.02em;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-transform: none;
}

.section-title ruby rt,
.pc-header h1 ruby rt {
  font-size: 0.48em;
  color: #64748b;
}

.btn ruby rt {
  font-size: 0.5em;
  color: inherit;
  opacity: 0.85;
}

.help ruby rt {
  font-size: 0.55em;
}

.field-span2 {
  grid-column: span 2;
}

.req {
  color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
}

.client-snapshot {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.client-snapshot h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.snapshot-grid .help {
  display: block;
  margin-bottom: 0.15rem;
}

.family-block {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.family-block:last-child {
  border-bottom: 0;
}

.family-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.check-row,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.adl-section {
  margin-bottom: 1.25rem;
}

.adl-table-wrap {
  overflow-x: auto;
}

.adl-table th:nth-child(1),
.adl-table td:nth-child(1) {
  width: 8rem;
  white-space: nowrap;
}

.adl-table th:nth-child(2),
.adl-table td:nth-child(2) {
  width: 11rem;
}

.excretion-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 0;
  margin-left: auto;
}

.btn-danger:hover {
  filter: brightness(0.95);
  color: #fff;
}

@media (max-width: 860px) {
  .field-span2 {
    grid-column: span 1;
  }

  .snapshot-grid,
  .excretion-methods {
    grid-template-columns: 1fr;
  }
}

.visit-filter label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 10rem;
}

.visit-duration-box {
  background: #eef4f1;
  border-color: #8fa39a;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  min-height: 2.6rem;
}

.unit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.unit-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 5.5rem;
}

.service-kind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.sk-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sk-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.visit-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.check-section {
  margin-bottom: 0.85rem;
}

.check-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vital-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 960px) {
  .visit-columns,
  .service-kind-grid {
    grid-template-columns: 1fr;
  }
}

.mobile-check-sec {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.mobile-check-sec:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.mobile-check-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.4rem;
}

.mobile-check-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mobile-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.35rem;
  font-size: 0.95rem;
  line-height: 1.35;
  border-radius: 8px;
}

.mobile-check-item:active,
.mobile-check-item:has(input:checked) {
  background: var(--brand-soft);
}

.mobile-check-item input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* 介護記録一覧 */
.visit-count {
  margin: 0.25rem 0 1rem;
}

.visit-filter-bar {
  align-items: flex-end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}
.visit-filter-client {
  flex: 1 1 14rem;
  min-width: 12rem;
}
.visit-filter-client .form-control {
  min-width: 100%;
  font-weight: 600;
}
.visit-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.86rem;
}

.visit-resident-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
  color: #475569;
}
.visit-resident-strip strong {
  color: #0f172a;
  font-size: 1.05rem;
}
.visit-resident-addr {
  color: #64748b;
  font-size: 0.86rem;
}

.visit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 0.35rem;
  color: #334155;
  font-size: 0.98rem;
}
.visit-summary-main {
  font-weight: 700;
  color: #0f172a;
}
.visit-totals {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
}

.visit-table-card {
  padding: 0;
  overflow: hidden;
}
.visit-table-card .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.visit-table-hint {
  margin: 0;
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid var(--line);
}
.visit-empty {
  text-align: center;
  padding: 2rem 1rem;
}
.visit-empty .btn {
  margin: 0.35rem;
}
.visit-pick-client {
  color: #64748b;
}

/* ウリゲン風：日付で区切った一覧表 */
.urigen-wrap {
  max-height: calc(100vh - 280px);
  overflow: auto;
}
.urigen-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.9rem;
}
.urigen-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e3a5f;
  font-weight: 700;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid #16304f;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 1px 0 #16304f;
}
.urigen-table tbody td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  vertical-align: middle;
  color: #222;
  word-break: break-word;
}
/* 日付バンド（交互色） */
.urigen-row.band-0 td {
  background: #ffffff;
}
.urigen-row.band-1 td {
  background: #eef6ff;
}
.urigen-row.is-sat.band-0 td,
.urigen-row.is-sat.band-1 td {
  background: #eff6ff;
}
.urigen-row.is-sun.band-0 td,
.urigen-row.is-sun.band-1 td {
  background: #fff5f5;
}
.urigen-row {
  cursor: pointer;
}
.urigen-row:hover td {
  filter: brightness(0.97);
  outline: none;
  background-image: linear-gradient(rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.08));
}
.urigen-row.day-start td {
  border-top: 2px solid #94a3b8;
}
.urigen-row.is-staff-overlap td,
.urigen-row.is-staff-overlap.is-sat td,
.urigen-row.is-staff-overlap.is-sun td,
.urigen-row.is-staff-overlap.band-0 td,
.urigen-row.is-staff-overlap.band-1 td {
  background: #fee2e2;
}
.urigen-row.is-staff-overlap .col-time,
.urigen-row.is-staff-overlap .col-staff {
  background: #fecaca;
  color: #991b1b;
  font-weight: 700;
}
.urigen-row.is-staff-overlap:hover td {
  background-image: none;
  background: #fecaca;
}
.visit-overlap-count {
  color: #b91c1c;
}
.urigen-table .col-date {
  width: 6.8rem;
  white-space: nowrap;
}
.urigen-table col.col-check,
.urigen-table th.col-check,
.urigen-table td.col-check {
  width: 2.6rem;
  max-width: 2.6rem;
  text-align: center;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}
.urigen-table .col-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.visit-check-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  margin: -0.35rem 0;
  cursor: pointer;
}
.visit-bulk-edit-dates {
  margin: 0;
  line-height: 1.6;
  color: #334155;
}
.visit-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0 0 0.7rem;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.visit-bulk-bar .visit-bulk-count {
  font-size: 0.88rem;
  color: #475569;
}
.visit-bulk-bar .visit-bulk-count strong {
  color: #0f172a;
}
.visit-bulk-bar .btn-danger[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.urigen-table .day-label {
  font-weight: 700;
  color: #0f172a;
}
.urigen-table .day-label.wd-sat {
  color: #1d4ed8;
}
.urigen-table .day-label.wd-sun {
  color: #dc2626;
}
.urigen-table .day-count {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: #334155;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}
.urigen-table .col-seq {
  width: 3.4rem;
  text-align: center;
}
.urigen-table .col-seq.is-multi {
  color: #1d4ed8;
  font-weight: 800;
  background: #dbeafe !important;
  border-radius: 4px;
}
.urigen-table .col-time {
  width: 7.2rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
  color: #0f172a;
}
.urigen-table .col-staff {
  width: 6rem;
}
.urigen-table .col-type {
  width: 6.2rem;
}
.urigen-table col.col-content,
.urigen-table .col-content {
  width: 28%;
}
.urigen-table .col-note {
  width: 9rem;
  color: #94a3b8;
  font-size: 0.86rem;
}
.urigen-table .col-note.has-text {
  color: #334155;
}
.urigen-table .col-note.has-handover {
  color: #9a3412;
  background: #ffedd5 !important;
  font-weight: 600;
}

/* 種別チップ */
.type-chip {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.type-houmon {
  background: #dbeafe;
  color: #1e40af;
}
.type-shogai {
  background: #fce7f3;
  color: #9d174d;
}
.type-ido {
  background: #d1fae5;
  color: #065f46;
}
.type-tsuin {
  background: #ede9fe;
  color: #5b21b6;
}
.type-sogo {
  background: #fef3c7;
  color: #92400e;
}
.type-seikatsu {
  background: #e0e7ff;
  color: #3730a3;
}
.type-other {
  background: #e2e8f0;
  color: #334155;
}

.visit-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  font-size: 0.8rem;
  color: #64748b;
}
.visit-legend .type-chip {
  font-size: 0.72rem;
}
.legend-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.legend-note i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
}
.leg-sat { background: #bfdbfe; }
.leg-sun { background: #fecaca; }
.leg-hand { background: #fdba74; }
.leg-overlap { background: #fecaca; box-shadow: inset 0 0 0 1px #dc2626; }

.visit-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 2rem;
}

.visit-more {
  position: relative;
}
.visit-more > summary {
  list-style: none;
  cursor: pointer;
}
.visit-more > summary::-webkit-details-marker { display: none; }
.visit-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 10rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  padding: 0.35rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.visit-more-menu a {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 0.92rem;
}
.visit-more-menu a:hover {
  background: #f1f5f9;
}
.visit-filter-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  padding-bottom: 0.15rem;
}

.visit-schedule {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 2rem;
}
.visit-day-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.visit-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
}
.visit-day-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--brand-dark);
}
.visit-dow {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.92rem;
  margin-left: 0.15rem;
}
.visit-day-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.visit-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.visit-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.visit-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
  font-size: 0.92rem;
  line-height: 1.4;
}
.visit-table tr:last-child td {
  border-bottom: 0;
}
.visit-tr {
  cursor: pointer;
}
.visit-tr:hover td {
  background: #f8fafc;
}
.visit-table .col-time { width: 7.5rem; }
.visit-table .col-client { width: 7rem; }
.visit-table .col-staff { width: 6.5rem; }
.visit-table .col-cat { width: 9rem; }
.visit-table .col-src { width: 4.2rem; text-align: right; }
.vt-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.vt-seq {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.vt-cat {
  display: inline-block;
  max-width: 100%;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #eef3f8;
  color: #1e3a5f;
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
}
.visit-table .col-act,
.visit-table .col-note {
  color: #334155;
  word-break: break-word;
}
.visit-table .muted {
  color: #94a3b8;
}

.visit-day-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.visit-row-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.visit-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}

.visit-row:last-child {
  border-bottom: 0;
}

.visit-row:hover {
  background: #f8fafc;
  color: inherit;
}

.visit-row-time {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.visit-row-clock {
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.visit-row-main {
  min-width: 0;
}

.visit-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.badge-mobile {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.visit-card-name {
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.visit-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.visit-row-cat {
  color: var(--muted);
}

.visit-card-body {
  font-size: 0.92rem;
  line-height: 1.4;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.visit-card-note {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 旧カード用（他画面互換） */
.visit-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.visit-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  color: inherit;
}

.visit-card:hover {
  border-color: var(--brand);
  color: inherit;
}

.visit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.visit-card-time {
  font-weight: 700;
  font-size: 1.05rem;
}

.visit-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.visit-empty p {
  margin: 0 0 1rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .visit-table .col-note,
  .visit-table th.col-note {
    display: none;
  }
}

@media (max-width: 720px) {
  .visit-table .col-act,
  .visit-table th.col-act,
  .visit-table .col-cat,
  .visit-table th.col-cat {
    display: none;
  }
  .visit-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

/* 介護記録入力（チップ・固定バー） */
.visit-form {
  padding-bottom: 5.5rem;
}

.visit-check-block {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.visit-check-block:last-child {
  border-bottom: 0;
}

.visit-check-head {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.5rem;
}

.visit-check-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.visit-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.visit-check-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visit-check-chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.visit-details {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: var(--bg-soft);
}

.visit-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-dark);
}

.visit-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 24px rgba(28, 43, 36, 0.08);
  backdrop-filter: blur(8px);
}

.visit-sticky-actions .btn-danger {
  margin-left: auto;
}

.pc-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.bulk-month-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.bulk-month-nav label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 6rem;
}

.bulk-day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}

.bulk-calendar {
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem;
  background: var(--bg-soft);
}

.bulk-cal-head,
.bulk-cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.bulk-cal-head {
  margin-bottom: 0.4rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.bulk-weekday-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0;
  border-radius: 8px;
  cursor: pointer;
}

.bulk-weekday-btn:hover,
.bulk-weekday-btn.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.bulk-cal-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.bulk-cal-day input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bulk-cal-day.is-weekend {
  color: var(--accent);
}

.bulk-cal-day:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.bulk-cal-empty {
  min-height: 2.4rem;
}

/* 一括コメント分配 */
.comment-dist-hint {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}
.comment-save-bar {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) minmax(10rem, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.comment-save-bar .field {
  margin: 0;
}
.comment-save-bar label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted, #64748b);
  margin-bottom: 0.25rem;
}
.comment-save-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-bottom: 0.05rem;
}
@media (max-width: 800px) {
  .comment-save-bar {
    grid-template-columns: 1fr;
  }
}
.comment-dist-source {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 12rem;
}
.comment-dist-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.comment-dist-table-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.comment-dist-staff-pick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: 0.15rem;
  font-size: 0.9rem;
  color: #334155;
}
.comment-dist-staff-label {
  font-weight: 600;
  white-space: nowrap;
}
.comment-dist-staff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.comment-dist-staff-chips .chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
}
.comment-dist-staff-chips .chip-check:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e40af;
}
.comment-dist-staff-chips .chip-check input {
  margin: 0;
}
.comment-dist-table td.col-check,
.comment-dist-table th.col-check {
  text-align: center;
  width: 3rem;
}
.comment-dist-table td.col-comment {
  max-width: 28rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-dist-table tr.is-assign {
  background: #dbeafe;
}
.comment-dist-table tr.is-done {
  background: #dcfce7;
}
.comment-dist-table .muted {
  color: #64748b;
}
.comment-dist-table .tag {
  color: #1e40af;
  font-size: 0.85em;
  margin-right: 0.25rem;
}
.comment-dist-table .overwrite {
  color: #b45309;
  font-size: 0.85em;
}
.comment-dist-filters {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}
.comment-dist-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.comment-dist-cats .chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.9rem;
}
.comment-dist-cats .chip-check:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
}
.comment-dist-slot-group {
  margin-top: 1.25rem;
}
.comment-dist-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.comment-dist-slot-title {
  margin: 0;
  font-size: 1.05rem;
  color: #1e3a5f;
}
.comment-dist-table td.col-activity {
  max-width: 16rem;
  font-size: 0.9rem;
  color: #334155;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  margin-top: 1rem;
}

/* 計画書 */
.plan-goal-card,
.plan-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  background: #f8fafc;
}
.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.plan-card-head strong {
  color: #1e3a5f;
  font-size: 1rem;
}
.plan-sec-label {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.95rem;
  color: var(--brand-dark);
}
.plan-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
@media (max-width: 800px) {
  .plan-two-cols { grid-template-columns: 1fr; }
}
.plan-proc-grid {
  grid-template-columns: 1fr 1fr;
}
.plan-min-grid {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  background: #fff;
  font-size: 0.88rem;
  cursor: pointer;
}
.chip-check:has(input:checked) {
  background: #e8f1fb;
  border-color: #93c5fd;
}
.custom-items {
  margin-top: 0.45rem;
}
.custom-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.custom-row .form-control {
  flex: 1;
}
.inline-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.inline-actions .form-control {
  flex: 1;
}

.monthly-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 0.9rem;
  border-bottom: 2px solid var(--line);
}
.monthly-tabs a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem 0.75rem;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  color: #64748b;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
}
.monthly-tabs a em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-style: normal;
  font-size: 0.78rem;
}
.monthly-tabs a span {
  font-weight: 500;
  font-size: 0.78rem;
  color: #94a3b8;
}
.monthly-tabs a.active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}
.monthly-tabs a.active em {
  background: var(--brand);
  color: #fff;
}
.monthly-tabs a.active span { color: var(--brand); }
.monthly-panel { padding: 1rem 1.1rem 1.15rem; }
.monthly-panel .section-title { margin: 0 0 0.2rem; }
.monthly-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.monthly-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.monthly-panel-actions form { margin: 0; }
.monthly-table-wrap {
  overflow-x: auto;
}
.monthly-data {
  width: 100%;
  table-layout: auto;
}
.monthly-data th,
.monthly-data td {
  padding: 0.5rem 0.55rem;
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}
.monthly-data .mcol-kind {
  white-space: nowrap;
}
.monthly-data .mcol-notes {
  width: auto;
  min-width: 16rem;
  max-width: 32rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}
.monthly-data .mcol-check {
  width: 1%;
  text-align: center;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}
.monthly-data .mcol-check input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.monthly-data .mcol-actions {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}
.monthly-data tr.is-cancel td { color: #94a3b8; text-decoration: line-through; }
.row-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.row-actions form { margin: 0; }
.monthly-confirm-row {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}
.monthly-confirm-row form {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.sheet-frame {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.sheet-frame-form { min-height: 980px; }
.sheet-preview {
  position: relative;
  min-height: 980px;
}
.sheet-preview-wait {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sheet-preview.ready .sheet-preview-wait { display: none; }
.sheet-preview .sheet-frame { position: relative; z-index: 2; }
.form-kind-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 0.95rem;
  padding: 4px;
  background: #eef3f0;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.form-kind-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  min-width: 10.5rem;
  padding: 0.55rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  line-height: 1.15;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.form-kind-btn:hover {
  background: #fff;
  color: var(--brand-dark);
}
.form-kind-btn.active,
.form-kind-row a.form-kind-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 111, 91, 0.28);
}
.form-kind-btn.active:hover,
.form-kind-row a.form-kind-btn.active:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
}
.form-kind-name {
  font-size: 0.95rem;
}
.form-kind-note {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.88;
}
.first-visit-box {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.first-visit-details { margin-top: 0.4rem; }
.first-visit-details summary {
  cursor: pointer;
  color: #64748b;
  font-size: 0.85rem;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 600;
}
.check-row input { margin-top: 0.2rem; }
.monthly-empty {
  padding: 2rem 1.2rem;
  text-align: center;
  color: #64748b;
  font-size: 1.02rem;
}

.karte-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem 1.2rem;
}

.karte-facts > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.95rem;
}

.karte-facts .help {
  font-size: 0.78rem;
}

.karte-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.karte-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

