:root {
  --blue: #3182f6;
  --blue-dark: #1b64da;
  --blue-50: #e8f3ff;
  --blue-100: #c9e2ff;
  --grey-50: #f9fafb;
  --grey-100: #f2f4f6;
  --grey-200: #e5e8eb;
  --grey-300: #d1d6db;
  --grey-500: #8b95a1;
  --grey-600: #6b7684;
  --grey-700: #4e5968;
  --grey-800: #333d4b;
  --grey-900: #191f28;
  --red: #f04452;
  --green: #03b26c;
  --green-50: #e8f8f0;
  --yellow-50: #fff8e1;
  --bg: #f2f4f6;
  --card: #ffffff;
  --sidebar-w: 240px;
  --top-h: 56px;
  --tabbar-space: 0px;
  --radius: 16px;
  --tap: 48px;
  --shadow: 0 4px 16px rgba(0, 0, 0, .04);
  --bs-primary: #3182f6;
  --bs-primary-rgb: 49, 130, 246;
  --bs-body-font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --bs-body-bg: #f2f4f6;
  --bs-body-color: #191f28;
  --bs-border-radius: 16px;
  --bs-border-radius-lg: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--grey-900);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -.02em;
}

a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell { min-height: 100%; }
.shell.has-nav { padding-left: 0; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(86vw, var(--sidebar-w));
  background: #fff;
  border-right: 1px solid var(--grey-200);
  z-index: 50;
  transform: translateX(-105%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
}
.sidebar.open { transform: none; }
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 18px;
  color: var(--grey-900);
  font-weight: 800;
  font-size: 1.05rem;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 800; flex: 0 0 auto;
}
.nav-group { margin-top: 8px; }
.nav-label {
  font-size: .72rem; font-weight: 700; color: var(--grey-500);
  padding: 8px 12px 4px; letter-spacing: .04em;
}
.sidebar a.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--grey-700); font-weight: 600;
}
.sidebar a.nav-item:hover { background: var(--grey-50); }
.sidebar a.nav-item.on {
  background: var(--blue-50); color: var(--blue);
}
.sidebar a.nav-item .nav-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-100); color: var(--grey-700);
  font-size: .72rem; font-weight: 800; flex: 0 0 auto;
}
.sidebar a.nav-item.on .nav-ico { background: var(--blue); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .side-foot {
  padding: 12px 10px 0; border-top: 1px solid var(--grey-200); margin-top: 12px;
}
.sidebar .side-foot .name { font-weight: 700; }
.sidebar .side-foot .muted { color: var(--grey-500); font-size: .85rem; }

.backdrop {
  display: none; position: fixed; inset: 0; background: rgba(25, 31, 40, .4);
  z-index: 40;
}
.backdrop.show { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 8px 0;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grey-200);
  display: flex; align-items: center; gap: 8px;
}
.icon-btn {
  width: 44px; height: 44px; border: 0; background: transparent;
  border-radius: 12px; cursor: pointer; color: var(--grey-800);
  display: inline-flex; align-items: center; justify-content: center;
}
.top-title { font-weight: 800; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-page .top-title { font-weight: 700; letter-spacing: -.03em; }
.who {
  color: var(--grey-700); font-weight: 700; padding: 0 12px; font-size: .92rem;
}
.who-wrap { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.who-pc { font-weight: 700; color: var(--grey-700); font-size: .92rem; }
@media (max-width: 959px) {
  .who-pc { display: none; }
}

.reminder {
  margin: 12px 16px 0;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--blue-50); color: var(--grey-900);
  border-radius: 16px; padding: 14px 16px;
  border-left: 5px solid var(--blue);
}
.reminder.tone-midweek { background: #eaf1ff; border-left-color: #3b6fd8; }
.reminder.tone-midweek .reminder-kicker { color: #2f5bb8; }
.reminder.tone-weekend { background: #fff6e4; border-left-color: #c9a227; }
.reminder.tone-weekend .reminder-kicker { color: #9a7b2f; }
.reminder.tone-ministry { background: #e8f7ef; border-left-color: #1f9d63; }
.reminder.tone-ministry .reminder-kicker { color: #0f7a4a; }
.reminder.tone-cart { background: #fff0e6; border-left-color: #e07a3d; }
.reminder.tone-cart .reminder-kicker { color: #c05621; }
.reminder.tone-duty { background: #eef1f5; border-left-color: #5b6b80; }
.reminder.tone-duty .reminder-kicker { color: #445266; }
.reminder-kicker { font-size: .75rem; font-weight: 700; color: var(--blue); }
.reminder strong { font-size: 1rem; }
.reminder span { color: var(--grey-700); font-size: .92rem; }

.flash {
  margin: 12px 16px 0; background: var(--green-50); color: var(--green);
  padding: 12px 16px; border-radius: 14px; font-weight: 700;
}

.push-banner {
  display: none;
  margin: 12px 16px 0;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.push-banner.show { display: block; }
.push-banner p { margin: 6px 0 0; color: var(--grey-600); font-size: .92rem; }

.home-page .reminder { display: none; }

.hero {
  background: linear-gradient(160deg, #3182f6 0%, #1b64da 58%, #0f3e8c 100%);
  color: #fff; border-radius: 24px; padding: 22px 20px 20px; margin-bottom: 22px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -24px; top: -28px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.hero-hi { margin: 0; font-size: .88rem; opacity: .85; font-weight: 600; }
.hero h1 { color: #fff; margin: 4px 0 6px; font-size: 1.55rem; }
.hero p { margin: 0; opacity: .9; }

.home-block { margin-bottom: 8px; }
.block-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 8px 2px 10px;
}
.block-head h2 { margin: 0; font-size: 1.08rem; }
.block-head h2 .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--blue); color: #fff;
  font-size: .75rem; font-weight: 800; vertical-align: middle;
}
.block-head a { font-size: .88rem; font-weight: 700; }

.notice-card {
  display: block; background: #fff; border-radius: 18px; padding: 16px;
  margin-bottom: 10px; color: inherit; box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  transition: transform .15s ease, box-shadow .15s ease;
}
.notice-card:hover, .assign-card:hover, .tile:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(25,31,40,.08); }
.notice-card.pinned { border-left-color: #f5a524; background: #fffdf7; }
.notice-badge {
  display: inline-block; font-size: .72rem; font-weight: 800;
  color: var(--blue); background: var(--blue-50);
  border-radius: 999px; padding: 2px 8px; margin-bottom: 6px;
}
.notice-card.pinned .notice-badge { color: #c67c00; background: #fff3d6; }
.notice-card strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.notice-card p { margin: 0 0 8px; color: var(--grey-700); }
.notice-card .meta { color: var(--grey-500); font-size: .82rem; }

.assign-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 18px; padding: 14px 16px;
  margin-bottom: 10px; color: inherit; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.assign-when {
  flex: 0 0 auto; min-width: 88px; font-weight: 800; color: var(--blue);
  font-size: .92rem;
}
.assign-body { flex: 1; min-width: 0; }
.assign-body strong { display: block; margin-top: 4px; }
.assign-card .chev { color: var(--grey-300); font-size: 1.4rem; }

.assign-list {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 8px;
}
.assign-day + .assign-day { border-top: 8px solid var(--grey-50); }
.assign-day-label {
  padding: 10px 14px 0;
  font-size: .78rem; font-weight: 800; color: var(--blue);
}
.assign-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px;
  color: inherit;
}
.assign-row + .assign-row { border-top: 1px solid var(--grey-100); }
.assign-kind {
  flex: 0 0 auto;
  font-size: .72rem; font-weight: 800; color: var(--blue);
  background: var(--blue-50); border-radius: 999px; padding: 3px 8px;
}
.assign-row strong {
  flex: 1; min-width: 0;
  font-size: .95rem; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.assign-row .chev { color: var(--grey-300); font-size: 1.15rem; flex: 0 0 auto; }
.assign-list .assign-row:active { background: var(--grey-50); }

.assign-list.tight { border-radius: 14px; }
.assign-list.tight .assign-row {
  min-height: 36px; padding: 5px 12px; gap: 6px;
}
.assign-list.tight .assign-row:has(.assign-when:not(:empty)) {
  border-top-color: var(--grey-200);
}
.assign-list.tight .assign-row:first-child { border-top: 0; }
.assign-list.tight .assign-when {
  min-width: 68px; font-size: .78rem; font-weight: 800;
  color: var(--blue);
}
.assign-list.tight .assign-kind { font-size: .68rem; padding: 2px 6px; }
.assign-list.tight .assign-row strong { font-size: .88rem; }
.rot-inline {
  display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0;
}
.rot-inline input { flex: 1; min-width: 0; min-height: 36px; }

.empty-card {
  background: #fff; border-radius: 18px; padding: 22px 16px;
  text-align: center; color: var(--grey-500); box-shadow: var(--shadow);
}
.empty-card.compact { padding: 16px 12px; }

.tile .ico {
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: .82rem; font-weight: 800; margin-bottom: 10px; color: #fff;
}
.ico-blue { background: var(--blue); }
.ico-navy { background: #191f28; }
.ico-green { background: var(--green); }
.ico-gold { background: #f5a524; }

.auth-hero { text-align: center; margin: 10vh 0 20px; }
.auth-hero .brand-mark { width: 48px; height: 48px; border-radius: 16px; font-size: 1.1rem; margin: 0 auto 8px; display: flex; }

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
body.home-page .wrap { max-width: 1120px; }

.notice-strip {
  margin: 0 0 16px;
}
.notice-strip details {
  background: #fff;
  border: 1px solid var(--blue-100);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notice-strip.is-pinned details {
  background: linear-gradient(90deg, #fff8e1 0%, #fff 42%);
  border-color: #f5d56a;
}
.notice-strip summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.notice-strip summary::-webkit-details-marker { display: none; }
.notice-strip summary::marker { content: ""; }
.notice-kicker {
  flex: 0 0 auto;
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 9px;
  letter-spacing: .02em;
}
.notice-strip.is-pinned .notice-kicker {
  background: #f5a524;
}
.notice-headline {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: .98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--grey-900);
}
.notice-more {
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 800;
  color: var(--grey-600);
  background: var(--grey-100);
  border-radius: 999px;
  padding: 2px 8px;
}
.notice-caret {
  flex: 0 0 auto;
  color: var(--grey-500);
  font-size: .95rem;
  transition: transform .18s ease;
}
.notice-strip details[open] .notice-caret { transform: rotate(180deg); }
.notice-strip-body {
  border-top: 1px solid var(--grey-200);
  padding: 4px 14px 14px;
  max-height: min(52vh, 420px);
  overflow: auto;
}
.notice-strip.is-pinned .notice-strip-body { border-top-color: #f5d56a; }
.notice-strip-item {
  padding: 12px 0;
}
.notice-strip-item + .notice-strip-item {
  border-top: 1px solid var(--grey-100);
}
.notice-strip-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
}
.notice-strip-item .meta {
  margin: 0 0 8px;
  color: var(--grey-500);
  font-size: .82rem;
}
.notice-strip-item .body {
  margin: 0;
  white-space: pre-wrap;
  color: var(--grey-800);
  font-size: .92rem;
  line-height: 1.55;
}
.notice-all {
  display: inline-block;
  margin-top: 4px;
  font-size: .85rem;
  font-weight: 700;
}

.home-assign-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-assign-card { min-width: 0; }

.home-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.home-shortcuts-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--grey-900);
  font-weight: 700;
  font-size: .92rem;
}
.home-shortcut i { color: var(--blue); font-size: 1.1rem; }
.duty-mine-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.duty-mine-chip {
  background: var(--blue-50); color: var(--blue);
  border-radius: 999px; padding: 4px 10px;
  font-size: .78rem; font-weight: 700;
}
.duty-board-wrap { max-height: 340px; overflow: auto; }
.duty-board { font-size: .82rem; min-width: 520px; }
.duty-board th, .duty-board td { padding: 6px 8px; white-space: nowrap; }
.duty-board tr.is-me td, .duty-board td.mine, .duty-board td.is-me {
  background: var(--blue-50); color: var(--blue); font-weight: 700;
}
.duty-board tr.is-past td { color: var(--grey-500); }
.duty-day-card.is-past { opacity: .72; }

.appoint-board { margin-bottom: 28px; }
.appoint-coord {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: #fff; border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.appoint-coord span { font-size: .78rem; font-weight: 800; color: var(--grey-500); }
.appoint-coord b { font-size: 1.05rem; }
.appoint-coord em { color: var(--grey-600); font-style: normal; font-size: .88rem; }
.appoint-coord.is-me, .appoint-role.is-me {
  background: var(--blue-50);
}
.appoint-coord.is-me b, .appoint-role.is-me b { color: var(--blue); }
.appoint-mobile { display: none; }
.appoint-section h3 { margin: 0 0 8px; font-size: 1rem; }
.appoint-role {
  padding: 10px 0;
}
.appoint-role + .appoint-role { border-top: 1px solid var(--grey-100); }
.appoint-role-title { font-size: .78rem; font-weight: 800; color: var(--grey-500); }
.appoint-role-people { display: flex; flex-direction: column; gap: 2px; }
.appoint-role-people span { color: var(--grey-600); font-size: .88rem; }
.appoint-table th[scope="rowgroup"] {
  background: var(--grey-50); vertical-align: top; white-space: nowrap; width: 7.5em;
}
.program-assign-list { max-height: 340px; overflow: auto; }
.program-assign-list a.tone-midweek { border-left: 4px solid #3b6fd8; }
.program-assign-list a.tone-weekend { border-left: 4px solid #c9a227; }
.program-assign-list a.tone-ministry { border-left: 4px solid #1f9d63; }
.program-assign-list a.tone-cart { border-left: 4px solid #e07a3d; }
.program-assign-list a.tone-duty { border-left: 4px solid #5b6b80; }
.badge.kind-midweek { background: #eaf1ff; color: #2f5bb8; }
.badge.kind-weekend { background: #fff6e4; color: #9a7b2f; }
.badge.kind-ministry { background: #e8f7ef; color: #0f7a4a; }
.badge.kind-cart { background: #fff0e6; color: #c05621; }
.badge.kind-duty { background: #eef1f5; color: #445266; }
.badge.kind-program { background: var(--grey-100); color: var(--grey-700); }
.program-assign-list .badge { border: 0; }
.kind-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--grey-100);
}
.kind-chip {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.3;
  background: var(--grey-100);
  color: var(--grey-700);
}
.kind-chip.kind-midweek { background: #eaf1ff; color: #2f5bb8; }
.kind-chip.kind-weekend { background: #fff6e4; color: #9a7b2f; }
.kind-chip.kind-ministry { background: #e8f7ef; color: #0f7a4a; }
.kind-chip.kind-cart { background: #fff0e6; color: #c05621; }
.kind-chip.kind-duty { background: #eef1f5; color: #445266; }
.kind-chip.on { box-shadow: inset 0 0 0 2px currentColor; }
.kind-chip[data-kind=""].on { background: #2f5bb8; color: #fff; box-shadow: none; }
.editor-inline { display: inline-block; }
.editor-inline summary { list-style: none; cursor: pointer; }
.editor-inline form { margin-top: 12px; }
.data-table tr.is-wait td { background: #fff8e8; }
.admin-shell .wrap { max-width: 1280px; padding: 24px 28px 72px; }
.admin-shell .wrap.container-xxl { max-width: 1280px; }

h1 { font-size: 1.5rem; margin: 0 0 6px; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.05rem; margin: 28px 0 12px; font-weight: 800; }
h2.h5, h2.h6 { margin: 0; font-size: 1.15rem; }
.lead { color: var(--grey-600); margin: 0 0 20px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid.one { grid-template-columns: 1fr; }
.tile {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 96px; background: var(--card); border-radius: var(--radius);
  padding: 16px; color: inherit; box-shadow: var(--shadow);
  position: relative; transition: transform .15s ease, box-shadow .15s ease;
}
.tile strong { font-size: 1.02rem; }
.tile span { color: var(--grey-500); font-size: .85rem; margin-top: 4px; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card.h-100, .card.shadow-sm {
  padding: 0;
  margin-bottom: 0;
}
.card h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 800; }
.card.mine { background: var(--blue-50); }
.list-card { display: block; color: inherit; }
.list-card .meta { color: var(--grey-500); font-size: .88rem; }

.btn:not([class*="btn-"]), button.btn:not([class*="btn-"]), input[type=submit]:not([class*="btn-"]) {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); background: var(--blue); color: #fff; border: 0;
  border-radius: 14px; padding: 12px 16px; font-weight: 700; cursor: pointer;
}
.btn:not([class*="btn-"]):hover { background: var(--blue-dark); }
.btn.gold, .btn.primary { background: var(--blue); }
.btn.ghost { background: var(--grey-100); color: var(--grey-800); }
.btn.ghost:hover { background: var(--grey-200); }
.btn.warn { background: var(--red); }
.btn.wide { width: 100%; }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: .92rem; }

label { display: block; font-weight: 700; margin: 14px 0 6px; color: var(--grey-800); }
label.btn { display: flex; margin: 0; font-weight: 700; color: inherit; }
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], select, textarea {
  width: 100%; min-height: var(--tap); padding: 12px 14px;
  border: 1px solid var(--grey-200); border-radius: 12px;
  background: var(--grey-50); font-size: 16px;
}
input.form-control, select.form-control, textarea.form-control {
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue-100); border-color: var(--blue); background: #fff;
}

.upload-drop {
  position: relative;
  margin-top: 4px;
}
.upload-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.upload-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 188px;
  margin: 0;
  padding: 18px 16px 16px;
  text-align: center;
  background: var(--grey-50);
  border: 1.5px dashed var(--grey-300);
  border-radius: 16px;
  color: var(--grey-700);
  font-weight: 600;
}
.upload-drop-zone i { font-size: 1.6rem; color: var(--blue); }
.upload-drop-zone strong { font-size: 1rem; color: var(--grey-900); }
.upload-drop-zone span { font-size: .85rem; font-weight: 600; color: var(--grey-500); max-width: 36em; }
.upload-paste {
  width: min(100%, 420px);
  min-height: 76px;
  padding: 14px 12px;
  background: #fff;
  border: 1.5px solid var(--grey-300);
  border-radius: 12px;
  text-align: left;
  cursor: text;
  font-size: .92rem;
  font-weight: 600;
  color: var(--grey-900);
  outline: none;
}
.upload-paste:empty::before {
  content: "여기를 클릭한 뒤 Ctrl+V";
  color: var(--grey-500);
}
.upload-paste:focus,
.upload-drop.is-ready .upload-paste {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.upload-drop-zone kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--grey-300);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--grey-800);
  font-size: .78em;
  font-weight: 800;
}
.upload-drop.is-over .upload-drop-zone,
.upload-drop.is-ready .upload-drop-zone {
  background: var(--blue-50);
  border-color: var(--blue);
  color: var(--blue);
}
.upload-drop-status {
  margin: 8px 0 0;
  font-size: .85rem;
  font-weight: 700;
  color: var(--green);
}
.upload-drop-status.is-error { color: var(--red); }
.upload-drop-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.upload-drop-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 12px;
}
.upload-drop-list img,
.upload-drop-file {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--grey-100);
  flex: 0 0 auto;
}
.upload-drop-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: var(--grey-700);
}
.upload-drop-name {
  flex: 1;
  min-width: 0;
  font-size: .82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-drop-remove {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--grey-100);
  color: var(--grey-700);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
textarea { min-height: 140px; }
.row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.row.g-1, .row.g-2, .row.g-3, .row.g-4 {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-.5 * var(--bs-gutter-x));
  margin-left: calc(-.5 * var(--bs-gutter-x));
}
.list-group-item-action { color: var(--grey-900) !important; }
.list-group-item-action:hover { background: var(--blue-50); }
.alert { border-radius: 12px; }

.pill {
  display: inline-flex; align-items: center;
  background: var(--grey-100); color: var(--grey-700);
  border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700;
}
.pill.wait { background: #fff1f0; color: var(--red); }
.pill.ok { background: var(--green-50); color: var(--green); }
.pill.me { background: var(--blue-50); color: var(--blue); }
h1 .pill { vertical-align: middle; font-size: .72rem; margin-left: 8px; }

.auth-page .topbar, .auth-page .sidebar, .auth-page .backdrop { display: none; }
.auth-box { max-width: 400px; margin: 0 auto 40px; }
.auth-box h1 { font-size: 1.7rem; }

.map { width: 100%; height: 48vh; min-height: 260px; border-radius: 16px; }

body.chat-page .wrap { padding-bottom: 88px; }
.chat-log {
  background: #fff; border-radius: 16px; height: calc(100dvh - 240px);
  min-height: 280px; overflow-y: auto; padding: 12px; box-shadow: var(--shadow);
}
.bubble { margin: 10px 0; }
.bubble .who { font-size: .75rem; color: var(--grey-500); margin-bottom: 4px; }
.bubble.me { text-align: right; }
.bubble .txt {
  display: inline-block; background: var(--grey-100); padding: 10px 12px;
  border-radius: 18px 18px 18px 6px; max-width: 82%; text-align: left; word-break: break-word;
}
.bubble.me .txt { background: var(--blue); color: #fff; border-radius: 18px 18px 6px 18px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; position: sticky; bottom: 12px; }
.chat-form input { flex: 1; background: #fff; }
.chat-form .btn { min-width: 72px; }

.subnav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin: 0 0 14px; }
.subnav a { flex: 0 0 auto; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.slot {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--grey-100);
}
.slot:last-child { border-bottom: 0; }
.slot.mine { margin: 0 -8px; padding: 12px 8px; border-radius: 10px; background: var(--blue-50); }
.slot b { min-width: 96px; color: var(--grey-600); font-weight: 600; }

.search-bar { display: flex; gap: 8px; align-items: end; margin-bottom: 16px; }
.search-bar > div { flex: 1; }
.search-bar .btn { flex: 0 0 76px; }

.empty { text-align: center; color: var(--grey-500); padding: 40px 10px; }

details.editor { margin: 0 0 12px; }
details.editor > summary {
  list-style: none; min-height: var(--tap); display: flex; align-items: center;
  font-weight: 700; cursor: pointer; color: var(--blue);
}
details.editor > summary::-webkit-details-marker { display: none; }

label input[type=checkbox] { width: 20px; height: 20px; margin-right: 8px; vertical-align: middle; accent-color: var(--blue); }

.week-nav {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.week-nav .chip {
  flex: 1; text-align: center; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #fff; color: var(--grey-700);
  font-weight: 700; box-shadow: var(--shadow);
}
.week-nav .chip.on { background: var(--blue); color: #fff; }
.week-nav .chip.off { color: var(--grey-300); box-shadow: none; background: var(--grey-100); }
.week-switch {
  display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px;
}
.section-h {
  font-size: .82rem; color: var(--grey-500); font-weight: 800;
  margin: 22px 0 10px; letter-spacing: .04em;
}
.program-card .program-title {
  font-size: 1.05rem; font-weight: 800; line-height: 1.4; margin-bottom: 6px;
}
.program-card .assignee { margin-top: 10px; font-size: 1.05rem; font-weight: 800; color: var(--grey-900); }
.program-card .assignee.is-me, .assignees .is-me {
  color: var(--blue);
}
.assignees {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
}
.assignees > div {
  background: var(--grey-50); border-radius: 12px; padding: 10px 12px;
}
.assignees .k { display: block; font-size: .75rem; color: var(--grey-500); font-weight: 700; }
.assignees .is-me { background: var(--blue-50); }
.week-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 16px 16px 10px;
}
.week-head h3 { margin: 0; }
.my-strip {
  margin: 0 16px 12px; padding: 12px; border-radius: 12px; background: var(--blue-50);
}
.my-strip .k { font-size: .75rem; font-weight: 700; color: var(--blue); }
.status-label {
  font-size: .78rem; font-weight: 700; color: var(--grey-500);
  padding: 0 16px 8px;
}
.status-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--grey-100);
}
.status-cell {
  padding: 12px 16px; border-bottom: 1px solid var(--grey-100);
  border-right: 1px solid var(--grey-100);
}
.status-cell:nth-child(2n) { border-right: 0; }
.status-cell .k { display: block; font-size: .75rem; color: var(--grey-500); font-weight: 600; }
.status-cell .v { font-weight: 700; }
.status-cell.is-me { background: var(--blue-50); }
.status-cell.is-empty .v { color: var(--grey-300); font-weight: 500; }
.week-foot { padding: 12px 16px 16px; }

.board-wrap { overflow-x: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.board-wrap table { width: max-content; min-width: 100%; border-collapse: collapse; }
.board-wrap th, .board-wrap td {
  padding: 10px 12px; border-bottom: 1px solid var(--grey-100);
  text-align: left; white-space: nowrap; font-size: .88rem;
}
.board-wrap th { background: var(--grey-50); color: var(--grey-600); font-weight: 700; position: sticky; top: 0; }
.board-wrap td.is-me { background: var(--blue-50); color: var(--blue); font-weight: 700; }

.hub-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 4px; border-bottom: 1px solid var(--grey-100); color: inherit;
}
.hub-list a:last-child { border-bottom: 0; }
.hub-list strong { display: block; }
.hub-list span { color: var(--grey-500); font-size: .85rem; }

@media (min-width: 960px) {
  .home-shortcuts { grid-template-columns: 1fr 1fr; }
  .home-shortcuts-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shell.has-nav { padding-left: var(--sidebar-w); }
  .sidebar { transform: none; width: var(--sidebar-w); }
  .menu-btn { display: none; }
  .backdrop { display: none !important; }
  .row { grid-template-columns: 1fr 1fr; }
  .row.g-1, .row.g-2, .row.g-3, .row.g-4 { grid-template-columns: unset; }
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .status-cell:nth-child(2n) { border-right: 1px solid var(--grey-100); }
  .status-cell:nth-child(3n) { border-right: 0; }
  .wrap {
    max-width: 980px;
    padding: 24px 28px 48px;
  }
  body.home-page .wrap { max-width: 1120px; }
  .home-assign-grid {
    display: grid;
    grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr);
    gap: 16px;
    align-items: stretch;
  }
  .home-assign-grid > .home-assign-card:only-child {
    grid-column: 1 / -1;
  }
  .program-assign-list,
  .duty-board-wrap { max-height: 420px; }
  .notice-strip { margin-bottom: 20px; }
  .notice-strip summary { min-height: 52px; padding: 12px 18px; }
  .notice-headline { font-size: 1.02rem; }
}

.admin-shell .sidebar { background: #191f28; border-right: 0; color: #fff; }
.admin-shell .sidebar .brand { color: #fff; }
.admin-shell .nav-label { color: #8b95a1; }
.admin-shell .sidebar a.nav-item { color: #d1d6db; }
.admin-shell .sidebar a.nav-item:hover { background: rgba(255,255,255,.06); }
.admin-shell .sidebar a.nav-item.on { background: rgba(49,130,246,.18); color: #fff; }
.admin-shell .sidebar a.nav-item .nav-ico { background: #333d4b; color: #d1d6db; }
.admin-shell .sidebar a.nav-item.on .nav-ico { background: var(--blue); color: #fff; }
.admin-shell .sidebar .side-foot { border-top-color: #333d4b; }
.admin-shell .sidebar .side-foot .name { color: #fff; }
.admin-shell .brand-mark { background: var(--blue); }
.admin-shell .topbar { background: #fff; border-bottom: 1px solid var(--grey-200); }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 8px;
}
.page-head h1 { margin-bottom: 4px; }

.dash-section h2 { margin: 8px 0 12px; }
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.dash-card {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border-radius: 16px; padding: 18px 16px;
  color: inherit; box-shadow: var(--shadow); min-height: 120px;
}
.dash-card:hover { box-shadow: 0 8px 20px rgba(25,31,40,.08); }
.dash-card strong { font-size: 1.05rem; }
.dash-card span { color: var(--grey-500); font-size: .88rem; }

.admin-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
  background: #fff; border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.toolbar-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.toolbar-form label { margin: 0; font-size: .78rem; }
.toolbar-form input { min-height: 40px; width: 200px; }

.form-grid {
  display: grid; grid-template-columns: 1fr; gap: 4px 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid label { margin: 10px 0 6px; }

.table-wrap {
  overflow: auto; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--grey-100);
  text-align: left; font-size: .9rem; vertical-align: middle;
}
.data-table th {
  background: var(--grey-50); color: var(--grey-600); font-weight: 700;
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.data-table tr.is-me td { background: var(--blue-50); }
.data-table tr.is-off td { opacity: .55; }
.data-table td.empty { text-align: center; color: var(--grey-500); padding: 28px; }
.data-table .name-cell strong { display: block; }
.name-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 160px;
}
.name-edit input {
  width: 8.5em;
  min-height: 36px;
  padding: 6px 10px;
  font-weight: 700;
}
.data-table .check-cell { text-align: center; width: 72px; }
.data-table .check-cell input { width: 18px; height: 18px; margin: 0; }
.data-table select.preset {
  min-height: 36px; width: 118px; background: #fff; padding: 6px 8px;
}
.data-table .row-actions { white-space: nowrap; }
.data-table .row-actions form, .data-table .row-actions button { display: inline-flex; }
.data-table input.cell-input,
.data-table select.cell-input {
  width: 100%;
  min-width: 6em;
  min-height: 36px;
  padding: 6px 8px;
  background: #fff;
}
.data-table input[type=date].cell-input { min-width: 9.8em; }

.table-tools {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: center; margin-bottom: 10px;
}
.table-tools input[type=search] { max-width: 280px; min-height: 40px; }
.table-note { margin: 8px 0 20px; }
.sticky-save {
  position: sticky; bottom: 12px; display: flex; justify-content: flex-end;
  padding-top: 8px;
}

.check-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px;
}
.check-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--grey-50); border: 1px solid var(--grey-200);
  border-radius: 999px; padding: 6px 12px; font-size: .86rem; margin: 0;
}
.check-pill input { width: 16px; height: 16px; margin: 0; }
.check-grid.compact { margin: 0; }
.preset-card h2, .preset-card h3 { margin: 12px 0 6px; font-size: 1rem; }
.preset-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.data-table td.view-summary { min-width: 280px; }

.assign-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: end;
  margin: 0 0 16px;
}
.assign-toolbar .toolbar-form input[type=number] {
  width: 88px; min-height: 40px;
}
.program-card select, .assignee-select { margin-top: 10px; width: 100%; }
.assignees select { margin-top: 6px; }

@media (min-width: 900px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { --sidebar-w: 252px; }
}

@media (min-width: 1200px) {
  .form-grid { grid-template-columns: 1fr 1fr 1fr; }
  .admin-shell .wrap { max-width: 1440px; }
}

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px;
}
.cal-nav strong { font-size: 1.05rem; }
.cal {
  background: #fff; border-radius: 18px; padding: 10px 8px 12px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.cal-weekdays, .cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.cal-weekdays span {
  text-align: center; font-size: .72rem; font-weight: 800;
  color: var(--grey-500); padding: 6px 0 8px;
}
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 52px; border-radius: 12px; color: inherit; position: relative;
  padding: 4px 2px; gap: 2px;
}
.cal-day .num { font-weight: 700; font-size: .92rem; }
.cal-day .who {
  display: block;
  max-width: 100%;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-day.is-on .who { color: #fff; }
.cal-day .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--blue); margin-top: 2px;
}
.cal-day.is-empty { pointer-events: none; }
.cal-day.is-today { background: var(--grey-100); }
.cal-day.has-shift { font-weight: 800; }
.cal-day.is-on { background: var(--blue); color: #fff; }
.cal-day.is-on .dot { background: #fff; }
.cal-day:active { background: var(--blue-50); }

.cart-shift-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.cart-shift-head h3 { margin: 0 0 2px; }
.cart-people { margin: 8px 0; }
.attend {
  width: 100%; min-height: 48px; border: 0; border-radius: 14px;
  background: var(--blue-50); color: var(--blue); font-weight: 800; cursor: pointer;
}
.attend.on { background: var(--green-50); color: var(--green); }

.weekend-row {
  padding: 12px 14px; border-bottom: 1px solid var(--grey-100);
}
.weekend-row:last-child { border-bottom: 0; }
.weekend-row.mine { background: var(--blue-50); }
.weekend-talk { margin: 4px 0 2px; }
.weekend-roles { margin: 4px 0 0; font-size: .92rem; color: var(--grey-700); }
.empty.compact { padding: 24px 10px; }

label.type-card,
.btn.type-card {
  min-height: 108px;
  white-space: normal !important;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  text-align: left;
}
.type-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.type-card-hint {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--grey-600);
  line-height: 1.35;
  white-space: normal;
}
.btn-check:checked + .btn.type-card,
.btn-check:checked + .btn-outline-secondary.type-card {
  color: #fff !important;
  background: var(--blue) !important;
  border-color: var(--blue) !important;
}
.btn-check:checked + .type-card .type-card-hint {
  color: rgba(255, 255, 255, .88) !important;
}

html.menu-open,
html.menu-open body { overflow: hidden; }

.tabbar { display: none; }
.duty-board-cards,
.duty-mobile-list { display: none; }
.home-stack { display: flex; flex-direction: column; }

.duty-day-card { padding: 12px 14px; margin-bottom: 10px; }
.duty-board-cards .duty-day-card { margin-left: 12px; margin-right: 12px; }
.duty-board-cards .duty-day-card:first-child { margin-top: 10px; }
.duty-day-card.is-me { background: var(--blue-50); }
.duty-day-card .duty-day-label {
  font-size: .8rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 8px;
}
.duty-day-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.duty-day-slots > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.duty-day-slots span {
  font-size: .7rem;
  font-weight: 700;
  color: var(--grey-500);
}
.duty-day-slots b {
  font-size: .92rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.duty-day-slots .mine b { color: var(--blue); }
.duty-more {
  display: block;
  text-align: center;
  font-weight: 700;
  padding: 4px 12px 14px;
}

@media (max-width: 959px) {
  :root { --tabbar-space: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-bottom: var(--tabbar-space); }
  .wrap,
  body.home-page .wrap {
    max-width: 100%;
    padding: 12px 12px calc(var(--tabbar-space) + 28px);
  }
  body.chat-page .wrap { padding-bottom: calc(var(--tabbar-space) + 88px); }
  h1 { font-size: 1.28rem; }
  .lead { font-size: .92rem; margin-bottom: 14px; }
  .who {
    max-width: 7.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .85rem;
    padding-right: 10px;
  }
  .reminder { margin: 10px 12px 0; padding: 12px 14px; }
  .push-banner { margin: 10px 12px 0; }
  .home-shortcuts { grid-template-columns: 1fr 1fr; }
  .home-shortcut { min-height: 48px; }
  .program-assign-list,
  .duty-board-wrap { max-height: none; }
  .duty-board-cards,
  .duty-mobile-list { display: block; }
  .duty-board-wrap,
  .duty-desktop-table,
  .appoint-desktop { display: none; }
  .appoint-mobile { display: block; }
  .subnav {
    margin: 0 -12px 14px;
    padding: 0 12px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .subnav::-webkit-scrollbar { display: none; }
  .week-nav { gap: 6px; }
  .week-nav .chip { font-size: .85rem; }
  .week-switch .btn { font-size: .82rem; padding: 8px 10px; }
  .assignees { grid-template-columns: 1fr; }
  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    min-height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--grey-200);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    color: var(--grey-500);
    font-size: .68rem;
    font-weight: 800;
  }
  .tabbar a i { font-size: 1.2rem; line-height: 1; }
  .tabbar a.on { color: var(--blue); }
  .duty-board-cards { padding-bottom: 8px; }
  .home-assign-card { margin-bottom: 4px; }
}

