:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1d2433;
  --sub: #6b7385;
  --line: #e6e8ee;
  --accent: #4f7cff;
  --warn: #fff3b0;
  --bad: #e5484d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .col 의 display:flex 가 hidden 을 덮어써 빈 칸이 처음부터 보였다(10-18 정식 녹화에서 잡음) */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 15px;
}
.top { padding: 18px 20px 6px; }
.top h1 { margin: 0; font-size: 22px; }
.sub { margin: 4px 0 0; color: var(--sub); font-size: 13px; }
.tabs { display: flex; gap: 6px; padding: 10px 20px 0; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  padding: 8px 14px; border-radius: 999px; font: inherit; cursor: pointer;
}
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
main { padding: 12px 20px 40px; }
.tab { display: none; }
.tab.on { display: block; }
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.bar h2 { margin: 0; font-size: 20px; min-width: 130px; text-align: center; }
.nav { border: 1px solid var(--line); background: var(--card); width: 36px; height: 36px; border-radius: 10px; font-size: 20px; cursor: pointer; }
.who { margin-left: auto; color: var(--sub); }
select, input, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; color: var(--ink);
}
.dow { display: grid; grid-template-columns: repeat(7, 1fr); color: var(--sub); font-size: 13px; padding: 0 0 6px; }
.dow span { text-align: center; }
.dow span:first-child { color: var(--bad); }
#grid { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.week:last-child { border-bottom: 0; }
.day { border-right: 1px solid var(--line); position: relative; z-index: 0; min-height: 100%; }
.day:nth-child(7) { border-right: 0; }
.day .num { display: inline-block; margin: 6px 0 0 8px; font-size: 13px; }
.day:first-child .num { color: var(--bad); }
.day.out { background: #fafbfd; }
.day.out .num { opacity: 0.4; }
.day.today .num { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.ev {
  position: relative; z-index: 1; margin: 2px 4px; height: 20px; min-width: 0;
  border: 0; border-left: 3px solid var(--c); border-radius: 6px;
  background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--ink);
  font: inherit; font-size: 12px; text-align: left; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.ev.multi { background: var(--c); color: #fff; border-left: 0; font-weight: 600; }
.ev.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ev.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.detail {
  position: fixed; right: 20px; bottom: 20px; width: min(340px, calc(100vw - 40px)); z-index: 10;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(29, 36, 51, 0.16);
}
.detail h3 { margin: 0 0 6px; }
.detail p { margin: 4px 0; color: var(--sub); }
.detail .x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--sub); }
.mail { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.col label { display: flex; flex-direction: column; gap: 4px; color: var(--sub); font-size: 13px; }
.col label.big { font-size: 15px; color: var(--ink); font-weight: 600; }
textarea { resize: vertical; line-height: 1.6; min-height: 260px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { display: flex; gap: 8px; }
.row button, .primary {
  font: inherit; border-radius: 10px; padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.primary, .row button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.note { margin: 0; color: var(--sub); font-size: 13px; }
input.auto, textarea.auto { background: var(--warn); border-color: #f0d264; }
.swatch { display: inline-block; width: 12px; height: 12px; background: var(--warn); border: 1px solid #f0d264; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.warnbox { background: #fff1f1; border: 1px solid #f5b5b7; color: #9b1c1f; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.warnbox p { margin: 4px 0; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--sub); }
.chip input { display: none; }
.chip.on { background: #eaf0ff; border-color: var(--accent); color: var(--ink); font-weight: 600; }
.lines { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px 12px; margin-bottom: 12px; }
.line { display: grid; grid-template-columns: 70px 1fr; align-items: center; height: 40px; }
.line b { font-weight: 600; }
.line.head { height: 26px; }
.track { position: relative; height: 28px; background: repeating-linear-gradient(90deg, #f1f3f8 0 1px, transparent 1px calc(100% / 9)); border-radius: 6px; }
.line.head .track { background: none; }
.line.head span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--sub); top: 4px; white-space: nowrap; }
.line.head span:last-child { transform: translateX(-100%); }
.blk { position: absolute; top: 3px; height: 22px; border-radius: 6px; background: #dfe3ec; color: var(--ink); font-size: 12px; font-style: normal; padding: 0 6px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.me { background: color-mix(in srgb, var(--accent) 25%, transparent); border: 2px dashed var(--accent); top: 1px; height: 26px; line-height: 22px; }
.blk.hit { background: #ffd4d6; color: #9b1c1f; }
.slots { margin-top: 12px; }
#slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.slot { font: inherit; border: 1px solid #9fdcbf; background: #e7f8ef; color: #12663f; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.h { margin: 0; font-size: 17px; }
.link { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0 0 0 4px; }
.foot { padding: 18px 20px 30px; color: var(--sub); font-size: 13px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }
.foot a { color: var(--accent); }
.monmail { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fbfcfe; }
.monmail .subj { margin: 0 0 6px; font-weight: 700; }
.monmail h4 { margin: 10px 0 4px; font-size: 14px; }
.monmail ul { margin: 0; padding-left: 18px; }
.monmail li { margin: 2px 0; font-size: 14px; }
@media (max-width: 640px) {
  .mail, .two { grid-template-columns: 1fr; }
  .line { grid-template-columns: 52px 1fr; }
  main, .top, .tabs { padding-left: 12px; padding-right: 12px; }
  .ev { font-size: 10.5px; padding: 0 3px; margin: 2px 1px; }
  .day .num { margin-left: 4px; font-size: 12px; }
  .who { margin-left: 0; }
}
