/* WOS 3655 SVS 준비전
   기존 설문 디자인(초록 #253325 + 선택색 #ff5c35, 흰 배경)을 그대로 따른다.
   모바일 우선, PC 에서는 430px 중앙 정렬 */

:root {
  --w: 430px;

  --green:   #253325;   /* 주색: 버튼, 강조 텍스트 */
  --green-2: #323631;   /* 호버 / 부제목 */
  --gray:    #697167;   /* 본문 보조 */
  --gray-2:  #9ca3af;   /* 더 옅은 보조 */

  --pick:    rgb(255, 92, 53);      /* 선택된 항목 */
  --partial: rgb(248, 203, 173);    /* 진행바 지나온 칸 */

  --bg:      #fff;
  --bg-2:    #f8f9fa;   /* 옅은 면 */
  --bg-3:    #f0f0f0;   /* 호버 */
  --line:    #e8e8e8;
  --line-2:  #d8d8d8;

  --danger:    #dc3545;
  --danger-bg: #fff5f5;

  --radius: 12px;
  --vh: 1vh;
}

* { box-sizing: border-box; }

/* .modal 과 .step-intro / .step-done 은 display:flex 를 쓴다. 그대로 두면 작성자
   스타일이 브라우저 기본 [hidden] 규칙을 이겨서 숨겨야 할 것이 계속 보인다. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg-2);
  color: var(--green-2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
               "Noto Sans TC", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 셸 ---------- */

.wos {
  max-width: var(--w);
  width: 100%;
  margin: 0 auto;
  /* min-height 로 두면 내용이 길 때 셸이 같이 늘어나서 페이지 전체가 스크롤되고
     하단 버튼이 화면 밖으로 밀린다. 높이를 화면에 고정해 본문만 스크롤시킨다. */
  height: calc(var(--vh, 1vh) * 100);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 480px) {
  body { padding: 24px 0; }
  .wos {
    height: calc(var(--vh, 1vh) * 100 - 48px);
    border-radius: 18px;
    box-shadow: 0 6px 28px rgba(37, 51, 37, .10);
  }
}

/* ---------- 헤더 ---------- */

.wos-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 54px;
  padding: 0 6px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

/* 좌우 버튼 폭이 다르다(뒤로 36px vs "Español" 같은 긴 언어명). 흐름에 두면
   타이틀이 한쪽으로 밀리므로 화면 기준으로 정중앙에 못박는다. */
.head-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: calc(100% - 190px);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--green);
  pointer-events: none;
}

.ico-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 36px;
  max-width: 46vw;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--gray);
  font-size: 12px;
  justify-content: center;
}
.ico-btn:hover { background: var(--bg-3); color: var(--green); }

.wos[data-step="intro"] .back,
.wos[data-step="done"]  .back { visibility: hidden; }

/* 언어 선택 */
.lang-picker { position: relative; }
.lang-menu {
  position: absolute;
  right: 0; top: 40px;
  margin: 0; padding: 5px;
  list-style: none;
  min-width: 130px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(37, 51, 37, .14);
  z-index: 40;
  display: none;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  color: var(--gray);
}
.lang-menu button:hover { background: var(--bg-2); color: var(--green); }
.lang-menu button[aria-current="true"] { color: var(--pick); font-weight: 700; }

/* ---------- 진행바 ---------- */

.wos-progress {
  display: flex;
  gap: 4px;
  /* 아래 여백과 배경이 없으면 스크롤되는 본문이 진행바에 바짝 붙어 겹쳐 보인다. */
  padding: 14px 20px 12px;
  background: var(--bg);
  flex: 0 0 auto;
}
.wos-progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background .25s ease;
}
.wos-progress span.done { background: var(--partial); }
.wos-progress span.now  { background: var(--pick); }

.wos[data-step="intro"] .wos-progress,
.wos[data-step="done"]  .wos-progress { visibility: hidden; }

/* ---------- 본문 ---------- */

.wos-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 20px 28px;
}
/* 인트로는 화면 전체를 채워서 시작 버튼이 아래에 붙게 한다. */
.wos[data-step="intro"] .wos-body { padding: 0; display: flex; flex-direction: column; }

.step { animation: rise .28s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 인트로 ---------- */

.step-intro { display: flex; flex-direction: column; flex: 1 1 auto; }

.intro-hero {
  position: relative;
  padding: 34px 24px 28px;
  background: var(--green);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  width: 240px; height: 240px;
  right: -80px; top: -100px;
  background: radial-gradient(circle, rgba(255,92,53,.30), transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  padding: 4px 11px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  position: relative;
}
.hero-title {
  margin: 12px 0 5px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.6px;
  line-height: 1.25;
  color: #fff;
  position: relative;
}
.hero-round {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 600;
  position: relative;
}

.intro-main { padding: 20px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.intro-desc { margin: 0 0 16px; color: var(--gray); font-size: 14.5px; line-height: 1.6; }

/* 일정표 */
.sched {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.sched-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--gray);
}
.utc-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  color: var(--gray); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 1px 5px;
}
.sched-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.sched-row:first-of-type { border-top: 0; }
.sched-name { font-weight: 700; color: var(--green); }
.sched-date { color: var(--gray); font-variant-numeric: tabular-nums; }
.sched-dl   { font-size: 11.5px; font-weight: 700; color: var(--pick); white-space: nowrap; }
.sched-dl.closed { color: var(--gray-2); font-weight: 600; }
.sched-row.is-closed { opacity: .5; }

.utc-note { margin: 10px 2px 0; font-size: 11.5px; color: var(--gray-2); }
.intro-main .btn-start { margin-top: auto; }
.intro-main .made-by { margin-bottom: 18px; }

/* 제작자 표기 */
.made-by {
  margin: 6px 2px 0;
  padding: 0;
  text-align: left;
  font-size: 11.5px;
  color: var(--gray-2);
}
.made-by a { color: var(--gray); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.made-by a:hover { color: var(--pick); }
.made-by sup { font-size: 8.5px; letter-spacing: .5px; vertical-align: super; }

/* 대기 카드 */
.wait-card {
  text-align: center;
  padding: 40px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.wait-icon { font-size: 40px; color: var(--green); }
.wait-card h3 { margin: 14px 0 8px; font-size: 19px; color: var(--green); }
.wait-card p  { margin: 0; color: var(--gray); font-size: 14px; line-height: 1.6; }
.wait-dates { margin: 22px 0 0; display: grid; gap: 8px; }
.wait-dates > div {
  display: flex; justify-content: space-between;
  padding: 11px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 13px;
}
.wait-dates dt { color: var(--gray); margin: 0; }
.wait-dates dd { margin: 0; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

/* ---------- 폼 ---------- */

.field { margin-bottom: 24px; }
.lbl {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.inp {
  width: 100%;
  max-width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--green-2);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.inp::placeholder { color: var(--gray-2); }
.inp:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37,51,37,.08); }
.inp.invalid { border-color: var(--danger); background: var(--danger-bg); }
.inp.ta { height: auto; padding: 13px 14px; line-height: 1.65; resize: none; }
.inp.num { font-variant-numeric: tabular-nums; padding-right: 52px; }

.inp-unit { position: relative; }
.inp-unit .unit {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-2); font-size: 13px; pointer-events: none;
}

.help-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 9px; padding: 0;
  border: 0; background: transparent;
  color: var(--gray); font-size: 12.5px;
  text-decoration: underline; text-underline-offset: 3px;
}
.help-link:hover { color: var(--pick); }

.field > .hint { margin: 7px 0 0; }
.hint { margin: 0 0 12px; font-size: 12px; line-height: 1.6; color: var(--gray-2); }

/* 라벨 옆 물음표 + 말풍선. 긴 설명은 여기 넣고 본문은 한 줄로 짧게 둔다. */
.lbl-row { display: flex; align-items: center; gap: 6px; }
.lbl-row .lbl { margin-bottom: 0; }
.field .lbl-row { margin-bottom: 8px; }
.tip-wrap { position: relative; display: inline-flex; align-items: center; line-height: 0; }
.tip-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--gray-2); cursor: pointer;
}
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--pick); background: var(--bg-3); }
/* 자리는 JS 가 잡는다. 화면 폭이 좁으면 카드 안으로 밀어 넣고, 꼬리(--arrow)만
   물음표 아래에 그대로 남긴다. */
.tip-pop {
  position: absolute; z-index: 60;
  left: 0; top: 28px;
  width: max-content; max-width: min(260px, 72vw);
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--green); color: #fff;
  font-size: 12.5px; line-height: 1.6; font-weight: 500;
  white-space: pre-line; word-break: keep-all; overflow-wrap: break-word;
  box-shadow: 0 10px 24px rgba(37, 51, 37, .25);
  animation: tipIn .16s ease both;
}
.tip-pop::before {
  content: ""; position: absolute;
  left: var(--arrow, 18px); top: -5px; margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--green);
}


/* 일차 헤더 */
.day-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.day-date { font-size: 13px; color: var(--gray); font-variant-numeric: tabular-nums; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.closed { background: var(--bg-3); color: var(--gray); }
.readonly-note {
  margin: -8px 0 20px; padding: 11px 13px;
  border-radius: 10px; background: var(--bg-2);
  font-size: 12.5px; color: var(--gray); line-height: 1.55;
}

/* ---------- 시간 슬롯 ---------- */

.times-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.times-head .lbl { display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
.times-count {
  font-size: 12.5px; font-weight: 700; color: var(--gray-2);
  font-variant-numeric: tabular-nums;
}
.times-count.full { color: var(--pick); }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (min-width: 400px) { .slot-grid { grid-template-columns: repeat(5, 1fr); } }

.slot {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--gray);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: background .12s, border-color .12s, color .12s;
}
.slot:not(.on):hover:not(:disabled) { background: var(--bg-2); border-color: var(--line-2); color: var(--green); }
.slot.on {
  background: var(--pick);
  border-color: var(--pick);
  color: #fff;
  font-weight: 700;
}
.slot:disabled { opacity: .4; cursor: default; }

/* 읽기 전용 일차 */
.step-day[data-open="0"] .inp,
.step-day[data-open="0"] .slot { pointer-events: none; }
.step-day[data-open="0"] .inp { background: var(--bg-2); color: var(--gray); }
.step-day[data-open="0"] .slot:not(.on) { opacity: .45; }
.step-day[data-open="0"] .slot.on { background: var(--gray); border-color: var(--gray); }

/* ---------- 하단 ---------- */

.wos-foot {
  flex: 0 0 auto;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.btn {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.2px;
  transition: background .2s, box-shadow .2s, opacity .15s;
}
.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 51, 37, .2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--green-2);
  box-shadow: 0 6px 20px rgba(37, 51, 37, .3);
}
.btn-primary:disabled { opacity: .3; box-shadow: none; cursor: default; }
.btn-ghost { background: var(--bg-3); color: var(--green-2); }
.btn-ghost:hover { background: var(--line); }

.err-msg {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--danger-bg);
  border: 1px solid rgba(220, 53, 69, .25);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- 완료 ---------- */

.step-done { display: flex; align-items: center; justify-content: center; min-height: 62vh; }
.done-wrap { text-align: center; padding: 20px; }

.spinner { width: 52px; height: 52px; margin: 0 auto 22px; position: relative; }
.spinner span {
  position: absolute; inset: 0;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.done-check { color: var(--pick); margin: 0 auto 22px; animation: pop .4s cubic-bezier(.2,1.3,.4,1) both; }
.done-check path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .4s .18s ease forwards; }
@keyframes pop  { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.done-title { margin: 0 0 10px; font-size: 22px; font-weight: 700; color: var(--green); letter-spacing: -.4px; }
.done-desc  { margin: 0 0 22px; color: var(--gray); font-size: 14px; line-height: 1.6; }
#retryBtn { max-width: 220px; margin: 0 auto; }

/* ---------- 모달 ---------- */

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-back { position: absolute; inset: 0; background: rgba(37, 51, 37, .55); }
.modal-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 22px 20px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 20px 50px rgba(37, 51, 37, .28);
  animation: pop .22s cubic-bezier(.2,1.1,.4,1) both;
}
.modal-box h4 { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: var(--green); }
.modal-box p  {
  margin: 0 0 20px;
  color: var(--gray); font-size: 14px; line-height: 1.7;
  white-space: pre-line;          /* 번역문 안의 줄바꿈을 그대로 살린다 */
  word-break: keep-all;           /* 한국어·중국어가 낱말 가운데서 잘리지 않게 */
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.modal-box h4 { word-break: keep-all; text-wrap: balance; }
.modal-box > .btn { width: 100%; height: 48px; font-size: 15px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions .btn { height: 48px; font-size: 15px; }

.modal-img img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 18px;
}
.modal-x {
  position: absolute; right: 12px; top: 10px;
  width: 32px; height: 32px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--gray-2);
  font-size: 24px; line-height: 1;
}
.modal-x:hover { background: var(--bg-3); color: var(--green); }

/* 좁은 화면에서 언어 이름까지 두면 가운데 타이틀이 잘린다. 지구본만 남긴다. */
@media (max-width: 359px) {
  #langLabel { display: none; }
  .head-title { max-width: calc(100% - 110px); }
}

/* ---------- 일차 건너뛰기 ---------- */
.skip-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin: -6px 0 22px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2); cursor: pointer;
}
.skip-row input {
  width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto;
  accent-color: var(--pick); cursor: pointer;
}
.skip-row b  { display: block; font-size: 13.5px; font-weight: 700; color: var(--green-2); }
.skip-row em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: var(--gray-2); }

/* 건너뛴 일차는 입력을 덮어 둔다. 값이 남아 있는 것처럼 보이면 안 된다. */
.step-day.skipped .field { opacity: .35; pointer-events: none; }
.step-day.skipped .skip-row { opacity: 1; pointer-events: auto; }
.step-day.skipped .skip-row {
  border-color: var(--pick); background: rgba(255,92,53,.08);
}
.step-day.skipped .skip-row b { color: var(--pick); }

/* ---------- 언어 변경 안내 (첫 방문에만) ---------- */
.lang-tip {
  position: absolute;
  right: 4px;
  top: 44px;
  z-index: 45;
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--pick);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(255, 92, 53, .34);
  cursor: pointer;
  animation: tipIn .3s .5s cubic-bezier(.2,1.2,.4,1) both, tipBob 1.9s 1s ease-in-out infinite;
}
/* 말풍선 꼬리 */
.lang-tip::before {
  content: '';
  position: absolute;
  right: 22px; top: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--pick);
}
@keyframes tipIn  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tipBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* 언어 버튼 자체도 한 번 눈에 띄게 */
.ico-btn.pulse { position: relative; color: var(--pick); }
.ico-btn.pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 11px;
  border: 2px solid var(--pick);
  animation: ringPulse 1.9s ease-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%   { opacity: .9; transform: scale(1); }
  70%  { opacity: 0;  transform: scale(1.22); }
  100% { opacity: 0;  transform: scale(1.22); }
}

@media (prefers-reduced-motion: reduce) {
  .lang-tip { animation: tipIn .3s .5s ease both; }
  .ico-btn.pulse::after { animation: none; opacity: .9; }
}

/* ---------- 언어 메뉴 (16개라 넘친다) ---------- */
.lang-menu {
  max-height: min(62vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 156px;
}
.lang-menu button { padding: 8px 11px; font-size: 13px; }

/* ---------- 추가 자원 (1일차 조각 / 2일차 수정) ---------- */
.extra-field { margin-bottom: 24px; }
.mini-check {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--gray); cursor: pointer;
}
.mini-check input {
  width: 17px; height: 17px; margin: 0; flex: 0 0 auto;
  accent-color: var(--pick); cursor: pointer;
}
.mini-check input:checked + span { color: var(--green); font-weight: 700; }
.extra-input { margin-top: 12px; animation: rise .2s ease both; }

/* ---------- 아랍어(RTL) ---------- */
[dir="rtl"] .wos-head .back svg { transform: scaleX(-1); }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .lang-tip  { right: auto; left: 4px; }
[dir="rtl"] .lang-tip::before { right: auto; left: 22px; }
[dir="rtl"] .inp-unit .unit { right: auto; left: 14px; }
[dir="rtl"] .inp.num { padding-right: 14px; padding-left: 52px; }
[dir="rtl"] .made-by { text-align: right; }
[dir="rtl"] .utc-note { text-align: right; }
/* 시간표는 숫자라 방향을 뒤집지 않는다. 00:00 이 왼쪽에 있어야 읽힌다. */
[dir="rtl"] .slot-grid, [dir="rtl"] .sched { direction: ltr; }
[dir="rtl"] .sched-name, [dir="rtl"] .sched-head { direction: rtl; }

/* ---------- 배정 현황 ---------- */

.btn-board { width: 100%; margin-top: 10px; }

/* 일정 줄 끝에 붙는 작은 현황 버튼. 16개 언어가 지나가므로 글자 길이에 기댈 수
   없다. 최대 폭을 두고 넘치면 줄인다. */
.sched-board {
  flex: 0 0 auto;
  max-width: 7.5em;
  height: 26px; padding: 0 9px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg); color: var(--green);
  font-size: 11.5px; font-weight: 600; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sched-board:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* 표가 길어 모달 안이 세로로 스크롤된다. 머리글·탭은 위에 붙여 둔다. */
.board-modal { padding: 0; }
.board-box {
  display: flex;
  flex-direction: column;
  max-width: var(--w);
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 0;
  border-radius: 0;
  overflow: hidden;                /* 스크롤은 .board-body 가 맡는다 */
}

.board-top {
  flex: 0 0 auto;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.board-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.board-title-row h4 { margin: 0; }
.board-box .modal-x { position: static; flex: 0 0 auto; }
.board-sub {
  margin: 4px 0 12px !important;
  font-size: 13px; line-height: 1.5;
}

.board-tabs { display: flex; gap: 6px; }
.board-tab {
  flex: 1 1 0;
  min-height: 46px;                /* 손가락으로 누르는 것이라 넉넉히 */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  padding: 6px 4px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg); color: var(--gray);
  font-size: 13px; line-height: 1.2;
}
.board-tab .bt-name { font-weight: 600; }
.board-tab .bt-date { font-size: 11px; color: var(--gray-2); }
.board-tab.on {
  border-color: var(--green); background: var(--green); color: #fff;
}
.board-tab.on .bt-date { color: rgba(255,255,255,.75); }
/* 오늘 진행 중인 일차. 고르지 않았을 때도 눈에 띄어야 한다. */
.board-tab.today:not(.on) { border-color: var(--pick); color: var(--green); }

.board-find { display: flex; gap: 8px; margin-top: 10px; }
/* .btn 은 폼에서 width:100% 로 쓰이는 자리가 있다. 여기서는 글자만큼만 차지해야
   입력칸이 남은 폭을 가져간다. */
.board-find .inp { flex: 1 1 auto; width: auto; min-width: 0; height: 44px; }
.board-find .btn { flex: 0 0 auto; width: auto; height: 44px; padding: 0 16px; font-size: 14px; }
.board-found {
  margin: 8px 0 0 !important;
  font-size: 13px; font-weight: 600; color: var(--green);
}
.board-found.miss { color: var(--danger); font-weight: 500; }

.board-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.board-load { margin: 24px 0 !important; text-align: center; }

.board-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.board-tbl th {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--gray);
  font-size: 12px; font-weight: 600; text-align: left;
  white-space: nowrap;
}
.board-tbl td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.board-tbl .c-time { width: 4.5em; font-variant-numeric: tabular-nums; color: var(--gray); white-space: nowrap; }
.board-tbl .c-alli { width: 6em; color: var(--gray); }
.board-tbl .c-nick { font-weight: 600; color: var(--green-2); word-break: break-word; }

/* 배정이 없는 시간. 눈이 미끄러지도록 옅게 깔고 글자를 죽인다. */
.board-tbl tr.is-empty { background: var(--bg-2); }
.board-tbl tr.is-empty td { color: var(--gray-2); }
.board-tbl tr.is-empty .c-nick { font-weight: 400; }
/* 한 시간대에 두 명 이상일 때 이어지는 줄. 위 칸과 한 덩어리로 보이게 한다. */
.board-tbl tr.is-cont td { border-top: 0; }
.board-tbl tr.is-cont .c-time { border-right: 0; }

.board-tbl tr.hit { background: rgba(255, 92, 53, .12); }
.board-tbl tr.hit .c-nick { color: var(--pick); }

.board-note {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 12px !important; line-height: 1.6;
}

/* 모달이 떠 있는 동안 뒤 화면이 같이 밀리지 않게 */
body.modal-open { overflow: hidden; }

/* PC 에서는 폼과 같은 폭으로 가운데에 카드처럼 띄운다. */
@media (min-width: 480px) {
  .board-modal { padding: 20px; }
  .board-box { height: auto; max-height: 88vh; border-radius: 18px; }
  .board-note { padding-bottom: 12px; }
}

@media (max-width: 359px) {
  .board-tbl { font-size: 12.5px; }
  .board-tbl td { padding: 8px 7px; }
}
