/* ==========================================================================
   팀 영업일지 (journal.html) — 휴대폰 먼저, 넓은 화면은 두 칸
   ========================================================================== */
:root {
  --navy: #0D1B2E;
  --head: #243F58;
  --sheet: #3F4B6A;      /* 원래 엑셀 양식의 머리글 색 */
  --ink: #111C2B;
  --slate: #56657A;
  --muted: #6B7889;
  --line: #D9E0E8;
  --mist: #F1F4F7;
  --soft: #F8FAFC;
  --gold: #B08D57;
  --gold-ink: #7A5F33;
  --gold-bg: #FBF8F2;
  --ok: #047857;
  --ok-bg: #ECFDF5;
  --bad: #B91C1C;
  --bad-bg: #FEF2F2;
  --sat: #1D4ED8;
  --sun: #B91C1C;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jr-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.jr-skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 0.6rem 1rem; border-radius: 10px; background: #fff; color: var(--navy); font-weight: 700; }
.jr-skip:focus { top: 12px; }

/* 맨 위 */
.jr-top { background: var(--navy); color: #fff; }
.jr-top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.jr-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; margin: 0; }
.jr-brand strong { font-size: 1.12rem; }
.jr-brand span { font-size: 0.88rem; color: rgba(255, 255, 255, 0.75); }
.jr-me { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.jr-who { font-size: 0.92rem; font-weight: 700; }
.jr-who em { font-style: normal; margin-left: 0.35rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--gold); color: #fff; font-size: 0.78rem; }
.jr-top-btn { min-height: 40px; padding: 0 0.8rem; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 10px; background: transparent; color: #fff; font-size: 0.88rem; font-weight: 600; }
.jr-top-btn:hover { background: rgba(255, 255, 255, 0.1); }
.jr-top-xlsx { border-color: rgba(253, 230, 138, 0.6); color: #FDE68A; }
.jr-top-btn:disabled { opacity: 0.6; cursor: default; }

.jr-boot { padding: 3rem 16px; text-align: center; color: var(--slate); }

/* 공통 */
.jr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 24px -22px rgba(13, 27, 46, 0.45); min-width: 0; }
.jr-h1 { margin: 0 0 0.3rem; font-size: 1.35rem; color: var(--navy); }
.jr-h2 { margin: 0 0 0.8rem; font-size: 1.1rem; color: var(--navy); line-height: 1.4; }
.jr-h2-sub { margin-left: 0.3rem; font-size: 0.92rem; font-weight: 700; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.jr-lead { margin: 0 0 1rem; color: var(--slate); }
.jr-hint { margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--slate); }
.jr-hint b { color: var(--ink); }
.jr-gap-b { margin: -0.3rem 0 1rem; }
.jr-err { margin: 0.4rem 0 0; color: var(--bad); font-size: 0.92rem; font-weight: 600; }
.jr-err:empty { display: none; }
.jr-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.9rem; }
.jr-card-head .jr-h2 { margin: 0; }
.jr-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.jr-field { display: grid; gap: 6px; margin: 0 0 14px; }
.jr-field > span { font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.jr-field small { font-weight: 500; color: var(--slate); }
.jr-input {
  width: 100%; min-height: 46px; padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px;
}
textarea.jr-input { resize: vertical; line-height: 1.55; }
.jr-input:hover { border-color: #BAC6D3; }
.jr-input:focus { outline: none; border-color: var(--head); box-shadow: 0 0 0 3px rgba(36, 63, 88, 0.15); }
.jr-input:disabled, .jr-input[readonly] { background: var(--soft); color: var(--slate); }
.jr-select-sm { min-height: 40px; width: auto; padding: 0.35rem 0.6rem; font-size: 0.92rem; }
.jr-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 700; color: var(--slate); }
.jr-num { text-align: right; font-variant-numeric: tabular-nums; }

.jr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 46px; padding: 0 1.1rem; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--navy); font-weight: 700; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.jr-btn:hover { border-color: var(--head); }
.jr-btn:disabled { opacity: 0.45; cursor: default; }
.jr-btn-main { border-color: var(--navy); background: var(--navy); color: #fff; }
.jr-btn-main:hover { background: var(--head); border-color: var(--head); }
.jr-btn-sm { min-height: 40px; padding: 0 0.85rem; font-size: 0.9rem; border-radius: 10px; }
.jr-btn-danger { color: var(--bad); }
.jr-btn-danger:hover { border-color: var(--bad); }
.jr-btn-block { width: 100%; }
.jr-row-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 0.4rem; }
.jr-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); }
.jr-icon-btn:hover { border-color: var(--head); }
.jr-icon-btn:disabled { opacity: 0.35; cursor: default; }
.jr-icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.jr-link-btn { min-height: 40px; padding: 0 0.5rem; border: 0; background: none; color: var(--gold-ink); font-size: 0.9rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* 이름 고르기 (로그인 없음) */
.jr-auth { display: grid; place-items: start center; padding: 32px 16px 60px; }
.jr-pick-card { width: 100%; max-width: 580px; padding: 24px; }
.jr-pick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 8px; }
.jr-pick-btn { display: grid; justify-items: start; align-content: center; gap: 2px; min-height: 64px; padding: 0.7rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--soft); color: var(--navy); text-align: left; transition: border-color 0.15s, background-color 0.15s; }
.jr-pick-btn strong { font-size: 1.12rem; overflow-wrap: anywhere; }
.jr-pick-btn span { font-size: 0.8rem; font-weight: 700; color: var(--gold-ink); }
.jr-pick-btn:hover { border-color: var(--navy); background: #fff; }
.jr-pick-btn:disabled { opacity: 0.5; cursor: default; }
.jr-pick-note { padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--gold-bg); color: var(--gold-ink); }
.jr-pick-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 10px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.jr-pick-add .jr-btn { margin-bottom: 14px; }
.jr-pick-manage { margin: 0 0 12px; }
.jr-pick-manage summary { display: flex; align-items: center; gap: 0.55rem; min-height: 44px; cursor: pointer; list-style: none; font-size: 0.92rem; font-weight: 700; color: var(--slate); }
.jr-pick-manage summary::-webkit-details-marker { display: none; }
.jr-pick-manage summary::before { content: ''; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.jr-pick-manage[open] summary { color: var(--navy); }
.jr-pick-manage[open] summary::before { transform: rotate(45deg); }
.jr-pick-manage .jr-mlist { margin-top: 4px; }
.jr-backup-btns { justify-content: flex-start; margin: 0; }
/* 관리자 비밀번호 4자리 */
.jr-pin { margin: 8px 0 4px; padding: 14px; border: 1.5px solid var(--gold); border-radius: 14px; background: var(--gold-bg); }
.jr-pin .jr-field { margin-bottom: 6px; }
.jr-pin-input { max-width: 12rem; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.6em; text-align: center; }
.jr-mi-lock { margin: 0; font-size: 0.85rem; }
@media (min-width: 640px) {
  .jr-pick-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .jr-pick-add { grid-template-columns: minmax(0, 1fr) auto; }
}

/* 달 · 메뉴 */
.jr-bar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px -14px rgba(13, 27, 46, 0.35); }
.jr-viewing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 8px 0 0; padding: 0.55rem 0.8rem; border: 1px solid #E9D8B8; border-radius: 12px; background: var(--gold-bg); }
.jr-viewing p { margin: 0; font-size: 0.92rem; }
.jr-viewing strong { color: var(--navy); }
.jr-viewing span { color: var(--gold-ink); font-weight: 600; }
.jr-bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding-top: 8px; }
.jr-month { display: flex; align-items: center; gap: 6px; }
.jr-month-label { margin: 0 0.2rem; min-width: 7.2em; text-align: center; font-size: 1.15rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.jr-save { margin: 0 0 0 auto; font-size: 0.85rem; font-weight: 600; color: var(--slate); white-space: nowrap; }
.jr-save.is-ok { color: var(--ok); }
.jr-save.is-bad { color: var(--bad); }
.jr-save button { margin-left: 0.3rem; min-height: 36px; padding: 0 0.6rem; border: 1.5px solid var(--bad); border-radius: 8px; background: #fff; color: var(--bad); font-size: 0.85rem; font-weight: 700; }
.jr-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 0; }
.jr-tabs::-webkit-scrollbar { display: none; }
.jr-tabs button { flex: 0 0 auto; min-height: 44px; padding: 0 1rem; border: 1.5px solid transparent; border-radius: 999px; background: transparent; color: var(--slate); font-size: 0.95rem; font-weight: 700; white-space: nowrap; }
.jr-tabs button:hover { color: var(--navy); background: var(--mist); }
.jr-tabs button[aria-selected="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
/* 메뉴가 옆으로 더 있으면 끝을 흐리게 해서 밀어 볼 수 있다는 걸 알려요 */
.jr-tabs.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.jr-tabs.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); }
.jr-tabs.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); }

.jr-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 18px; padding-bottom: 64px; outline: none; }
.jr-main[aria-busy="true"] .jr-panel { opacity: 0.55; pointer-events: none; }
.jr-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.jr-load-err p { margin: 0 0 0.8rem; color: var(--bad); font-weight: 600; }

/* 숫자 요약 */
.jr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.jr-stats-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.jr-stats-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.jr-stat { display: grid; gap: 1px; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.jr-stat span { font-size: 0.8rem; font-weight: 700; color: var(--slate); }
.jr-stat strong { font-size: 1.2rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.jr-stat small { font-size: 0.76rem; color: var(--muted); }
.jr-stat.is-key { border-color: var(--gold); background: var(--gold-bg); }
.jr-stat.is-key strong { color: var(--gold-ink); }

/* 보기 바꾸기 */
.jr-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #fff; justify-self: start; max-width: 100%; }
.jr-seg button { min-height: 40px; padding: 0 0.95rem; border: 0; border-radius: 10px; background: transparent; color: var(--slate); font-size: 0.92rem; font-weight: 700; }
.jr-seg button:hover { color: var(--navy); background: var(--mist); }
.jr-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.jr-seg-sm button { min-height: 36px; padding: 0 0.75rem; font-size: 0.86rem; }

/* 일 마감 — 달력 + 입력 */
.jr-day-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.jr-cal-card { padding: 14px; }
.jr-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.jr-cal-wd { padding: 0.2rem 0 0.35rem; text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--slate); }
.jr-cal-wd.is-sat { color: var(--sat); }
.jr-cal-wd.is-sun { color: var(--sun); }
.jr-cal-d {
  position: relative; display: grid; align-content: start; justify-items: center; gap: 0;
  min-height: 52px; padding: 5px 2px 4px; border: 1.5px solid transparent; border-radius: 10px;
  background: var(--soft); color: var(--ink); font-variant-numeric: tabular-nums;
}
.jr-cal-d:hover { border-color: #BAC6D3; }
.jr-cal-d .n { font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.jr-cal-d .w { font-size: 0.72rem; font-weight: 700; color: var(--gold-ink); line-height: 1.3; }
.jr-cal-d .dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--gold); }
.jr-cal-d[aria-pressed="true"] .dot { background: #fff; }
.jr-cal-d.is-sat .n { color: var(--sat); }
.jr-cal-d.is-sun .n { color: var(--sun); }
.jr-cal-d.has { background: #fff; border-color: var(--line); }
.jr-cal-d.is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.jr-cal-d[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); }
.jr-cal-d[aria-pressed="true"] .n, .jr-cal-d[aria-pressed="true"] .w { color: #fff; }
.jr-cal-d .ok { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); }
.jr-cal-d .ok::after { content: ''; position: absolute; left: 4.5px; top: 2px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.jr-cal-d .wait { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.jr-cal-legend { font-size: 0.82rem; }
.jr-ok-mark { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; color: var(--ok); }
.jr-ok-mark::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); }
.jr-wait-mark { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 700; color: var(--gold-ink); }
.jr-wait-mark::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

.jr-ed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.jr-ed-head .jr-h2 { margin: 0; flex: 1; text-align: center; outline: none; }
.jr-fs { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.jr-fs legend { padding: 0 0.35rem; font-size: 0.92rem; font-weight: 700; }
.jr-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.jr-step { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jr-step-l { display: flex; align-items: baseline; gap: 0.45rem; font-weight: 600; min-width: 0; }
.jr-step-l b { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 8px; background: var(--sheet); color: #fff; font-size: 0.9rem; }
.jr-step-c { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.jr-step-c button { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font-size: 1.3rem; font-weight: 700; line-height: 1; }
.jr-step-c button:hover:not(:disabled) { border-color: var(--head); }
.jr-step-c button:active:not(:disabled) { background: var(--mist); }
.jr-step-c button:disabled { opacity: 0.35; cursor: default; }
.jr-step-c input { width: 60px; min-height: 44px; padding: 0 0.3rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.jr-step-c input::-webkit-outer-spin-button, .jr-step-c input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.jr-step-v { min-width: 3rem; text-align: right; font-size: 1.05rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.jr-step-auto { font-size: 0.72rem; font-weight: 700; color: var(--muted); padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 999px; }
.jr-walk { display: flex; align-items: baseline; justify-content: flex-end; gap: 0.4rem; margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 700; }
.jr-walk small { color: var(--slate); font-weight: 500; }
.jr-walk strong { font-size: 1.3rem; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.jr-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.jr-check, .jr-radio { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.jr-check input, .jr-radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.jr-check:has(input:checked), .jr-radio:has(input:checked) { border-color: var(--navy); background: #EEF2F7; }
.jr-check:has(input:disabled) { cursor: default; opacity: 0.75; }

/* 일 마감 관리자 확인 (관리자만 체크) */
.jr-mgr-check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; padding: 10px 12px; border: 1px solid #EDE1CA; border-radius: 12px; background: var(--gold-bg); }
.jr-mgr-check .jr-check { background: #fff; }
.jr-mgr-check .jr-check:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.jr-mgr-check .jr-check input { accent-color: var(--ok); }
.jr-mgr-check .jr-hint { margin: 0; font-size: 0.85rem; }
/* 주 마감 관리자 확인 (관리자만 체크) */
.jr-wk-check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
.jr-wk-check .jr-check { background: #fff; }
.jr-wk-check .jr-check:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.jr-wk-check .jr-check input { accent-color: var(--ok); }
.jr-wk-check .jr-hint { margin: 0; font-size: 0.85rem; }
.jr-chips button { position: relative; }
.jr-chips button .ok { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); }
.jr-chips button .ok::after { content: ''; position: absolute; left: 4.5px; top: 2px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.jr-table tbody tr.t-mgr th, .jr-table tbody tr.t-mgr th.t-sticky { background: var(--gold-bg); }
.jr-table .t-fbedit { padding: 4px; vertical-align: top; }
.jr-tfb { min-width: 11rem; min-height: 5.5rem; padding: 0.4rem 0.5rem; font-size: 0.88rem; line-height: 1.45; }
.jr-table .t-check { padding: 0; }
.jr-tcheck { display: grid; place-items: center; min-width: 44px; min-height: 40px; cursor: pointer; }
.jr-tcheck input { width: 20px; height: 20px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.jr-tcheck input:disabled { cursor: default; }
.jr-mgr { margin-top: 4px; padding: 12px; border-radius: 12px; background: var(--gold-bg); border: 1px solid #EDE1CA; }
.jr-mgr-t { margin: 0 0 8px; font-size: 0.92rem; font-weight: 800; color: var(--gold-ink); }
.jr-mgr .jr-field { margin: 8px 0 0; }
.jr-mgr-view { margin: 0; white-space: pre-wrap; font-size: 0.95rem; }
.jr-mgr-view:empty { display: none; }
.jr-mgr-view .none { color: var(--slate); }

/* 표 */
.jr-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.jr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.jr-table th, .jr-table td { padding: 0.5rem 0.55rem; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; white-space: nowrap; }
.jr-table thead th { position: sticky; top: 0; background: var(--sheet); color: #fff; font-weight: 700; font-size: 0.84rem; }
.jr-table tbody tr:nth-child(even) td, .jr-table tbody tr:nth-child(even) th { background: #FAFBFD; }
.jr-table tfoot th, .jr-table tfoot td { background: #EEF1F6; font-weight: 800; color: var(--navy); border-bottom: 0; }
.jr-table .t-l { text-align: left; }
.jr-table .t-wrap { white-space: normal; min-width: 12rem; max-width: 22rem; text-align: left; }
.jr-table .t-sticky { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line); }
.jr-table thead .t-sticky { z-index: 2; background: var(--sheet); }
.jr-table tfoot .t-sticky { background: #EEF1F6; }
.jr-table tbody tr:nth-child(even) .t-sticky { background: #FAFBFD; }
.jr-table .t-key { color: var(--gold-ink); font-weight: 800; }
.jr-table .is-sat { color: var(--sat); }
.jr-table .is-sun { color: var(--sun); }
.jr-table .t-dim { color: #9AA6B5; }
.jr-table .t-yes { color: var(--ok); font-weight: 700; }
.jr-rowbtn { min-height: 36px; padding: 0 0.5rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font-weight: 700; white-space: nowrap; }
.jr-rowbtn:hover { border-color: var(--head); }
.jr-rowbtn.is-sat { color: var(--sat); }
.jr-rowbtn.is-sun { color: var(--sun); }

/* 주 마감 */
.jr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jr-chips button { display: grid; justify-items: center; min-height: 48px; min-width: 76px; padding: 0.3rem 0.8rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font-weight: 800; line-height: 1.3; }
.jr-chips button small { font-size: 0.74rem; font-weight: 600; color: var(--slate); }
.jr-chips button:hover { border-color: var(--head); }
.jr-chips button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.jr-chips button[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.8); }
.jr-week-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.jr-week-rows .jr-step { min-height: 46px; border-bottom: 1px solid var(--mist); }
.jr-week-rows .jr-step:last-child { border-bottom: 0; }
.jr-week-rows .jr-step-l { font-size: 0.95rem; }
.jr-week-tbl th:first-child { text-align: left; }
.jr-week-tbl .t-fb td { white-space: normal; min-width: 9rem; text-align: left; font-size: 0.85rem; vertical-align: top; }

/* 가로 막대 (주 마감 통계) */
.jr-hbars { display: grid; gap: 8px; }
.jr-hbar { display: grid; grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr); align-items: center; gap: 10px; }
.jr-hbar-l { font-size: 0.88rem; font-weight: 600; color: var(--ink); text-align: right; }
.jr-hbar-t { position: relative; display: flex; align-items: center; gap: 8px; min-height: 26px; }
.jr-hbar-t i { display: block; height: 18px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--head); }
.jr-hbar-t i.is-zero { background: var(--line); }
.jr-hbar-t b { font-size: 0.86rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.jr-empty { margin: 0; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--slate); font-size: 0.92rem; }

/* 세로 막대 (누적 통계) */
.jr-year { display: flex; align-items: center; gap: 6px; }
.jr-year .jr-h2 { margin: 0 0.2rem; min-width: 4.5em; text-align: center; }
.jr-vbars { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; height: 200px; margin: 6px 0 16px; padding: 22px 2px 0; border-bottom: 1.5px solid #BAC6D3;
  background: repeating-linear-gradient(to top, transparent 0, transparent 44px, #EEF1F5 44px, #EEF1F5 45px); }
.jr-vbar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; border: 0; padding: 0; background: none; cursor: pointer; }
.jr-vbar i { display: block; width: min(70%, 34px); min-height: 0; border-radius: 4px 4px 0 0; background: var(--head); }
.jr-vbar.is-cur i { background: var(--gold); }
.jr-vbar b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 0.72rem; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.jr-vbar .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 0.3rem 0.55rem; border-radius: 8px; background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.jr-vbar:hover .tip, .jr-vbar:focus-visible .tip { opacity: 1; }
.jr-vbar-x { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin: -12px 0 14px; padding: 0 2px; text-align: center; font-size: 0.75rem; color: var(--slate); }

/* 월납 계산기 */
.jr-cform { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.jr-kind { display: flex; flex-wrap: wrap; gap: 8px; }
.jr-kind legend { margin-bottom: 4px; }
.jr-cform-btns { grid-column: 1 / -1; }
.jr-cform-err { grid-column: 1 / -1; }
#jr-cform-card.is-editing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.18); }
.jr-money-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.jr-clist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.jr-citem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.jr-citem-main { display: grid; gap: 1px; min-width: 0; }
.jr-citem-main strong { font-size: 0.98rem; overflow-wrap: anywhere; }
.jr-citem-main span { font-size: 0.86rem; color: var(--slate); overflow-wrap: anywhere; }
.jr-citem-amt { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; text-align: right; }
.jr-citem-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }

/* 팀 현황 */
.jr-team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.jr-tm { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.jr-tm.is-off { opacity: 0.6; }
.jr-tm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jr-tm-name { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.2rem; border: 0; background: none; color: var(--navy); font-size: 1.05rem; font-weight: 800; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.jr-tm-name:hover { text-decoration-color: var(--navy); }
.jr-tm-name em { font-style: normal; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--gold); color: #fff; font-size: 0.72rem; }
.jr-tm-walk { font-size: 1.25rem; font-weight: 800; color: var(--gold-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jr-tm-walk small { font-size: 0.78rem; font-weight: 700; color: var(--slate); }
#jr-day-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.jr-tm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; text-align: center; }
.jr-tm-grid span { display: grid; padding: 0.25rem 0; border-radius: 8px; background: #fff; font-size: 0.75rem; color: var(--slate); font-weight: 700; }
.jr-tm-grid span b { font-size: 0.98rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.jr-tm-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.84rem; color: var(--slate); }
.jr-tm-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.jr-tm-foot .is-wait b { color: var(--gold-ink); }

/* 팀원 관리 */
.jr-mform { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; align-items: end; }
.jr-mform .jr-btn { margin-bottom: 14px; }
.jr-temp { margin-top: 14px; padding: 14px; border: 1.5px solid var(--gold); border-radius: 12px; background: var(--gold-bg); }
.jr-temp p { margin: 0 0 0.5rem; }
.jr-temp dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 0.7rem; }
.jr-temp dt { color: var(--slate); font-weight: 700; }
.jr-temp dd { margin: 0; font-weight: 800; font-size: 1.1rem; color: var(--navy); letter-spacing: 0.02em; overflow-wrap: anywhere; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.jr-mlist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.jr-mi { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.jr-mi-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.jr-mi-info strong { font-size: 1.02rem; }
.jr-mi-info code { font-size: 0.9rem; color: var(--slate); }
.jr-badge { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.jr-badge.is-admin { background: var(--gold); color: #fff; }
.jr-badge.is-on { background: var(--ok-bg); color: var(--ok); }
.jr-badge.is-off { background: var(--bad-bg); color: var(--bad); }
.jr-badge.is-new { background: #EEF2F7; color: var(--head); }
.jr-mi-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* 넓은 화면 */
@media (min-width: 640px) {
  .jr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
  .jr-cform { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jr-mform { grid-template-columns: minmax(0, 1fr) auto; }
  .jr-mi { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.jr-editor, #jr-cform-card { scroll-margin-top: calc(var(--bar-h, 130px) + 12px); }
@media (min-width: 960px) {
  .jr-day-grid { grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); }
  .jr-cal-card { position: sticky; top: calc(var(--bar-h, 130px) + 12px); }
  .jr-money-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jr-cform { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .jr-bar-row { padding-top: 6px; gap: 4px 8px; }
  .jr-month { gap: 4px; }
  .jr-month .jr-icon-btn { width: 40px; height: 40px; }
  .jr-month-label { min-width: 6.4em; font-size: 1.05rem; }
  .jr-link-btn { padding: 0 0.3rem; }
  .jr-tabs { padding: 6px 0; }
  .jr-tabs button { min-height: 42px; padding: 0 0.85rem; }
  .jr-top-btn { min-height: 38px; padding: 0 0.65rem; font-size: 0.84rem; }
}
@media (max-width: 380px) {
  .jr-card { padding: 14px; }
  .jr-cal { gap: 3px; }
  .jr-cal-d { min-height: 48px; }
  .jr-month-label { min-width: 6.4em; font-size: 1.05rem; }
  .jr-step-c input { width: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
