:root {
  --bg: #f4f3ee;
  --surface: #ffffff;
  --ink: #1b1b18;
  --muted: #6c6b64;
  --line: #e4e2da;
  --cell: #eeede6;
  --cell-line: #d9d7cd;
  --accent: #157a4f;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe5;
  --mine: #23a26c;
  --hl: #f0a236;
  --danger: #b4441f;
  --sun: #c2463a;
  --sat: #3a64c2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(25, 25, 10, .04), 0 10px 30px -18px rgba(25, 25, 10, .18);
  color-scheme: light;

  /* 구형 WebView(카카오톡 인앱 등)에서도 동작하도록 rgba 재료를 따로 둔다 */
  --accent-rgb: 21, 122, 79;
  --accent-deep: #0f5c3b;
  --mine-rgb: 35, 162, 108;
  --sat-rgb: 58, 100, 194;
  --hl-rgb: 240, 162, 54;
  --danger-rgb: 180, 68, 31;
  --muted-rgb: 108, 107, 100;
  --cell-rgb: 238, 237, 230;
  --cell-line-rgb: 217, 215, 205;
  --surface-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --surface: #1c1c19;
    --ink: #ecebe5;
    --muted: #9d9c94;
    --line: #2f2e2a;
    --cell: #272723;
    --cell-line: #3a3934;
    --accent: #3cbf85;
    --accent-ink: #0f2419;
    --accent-soft: #1d3a2c;
    --mine: #34b37a;
    --sun: #e0766b;
    --sat: #7b9be6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .6);
    color-scheme: dark;

    --accent-rgb: 60, 191, 133;
    --accent-deep: #2a8f63;
    --mine-rgb: 52, 179, 122;
    --sat-rgb: 123, 155, 230;
    --muted-rgb: 157, 156, 148;
    --cell-rgb: 39, 39, 35;
    --cell-line-rgb: 58, 57, 52;
    --surface-rgb: 28, 28, 25;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
code { font-size: .92em; background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 5px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- 상단 ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1440px; margin: 0 auto; padding: 18px 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; text-decoration: none; }
.logo {
  width: 22px; height: 22px; border-radius: 6px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 9px 9px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 13px 13px / 9px 9px no-repeat,
    linear-gradient(rgba(var(--accent-rgb), .35), rgba(var(--accent-rgb), .35)) 13px 0 / 9px 9px no-repeat,
    linear-gradient(rgba(var(--accent-rgb), .35), rgba(var(--accent-rgb), .35)) 0 13px / 9px 9px no-repeat;
}
.topbar-new { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.topbar-new:hover { color: var(--ink); }

.demo-banner {
  max-width: 1384px; margin: 0 auto 8px; padding: 9px 14px;
  border-radius: 10px; font-size: 13px;
  background-color: var(--surface); color: var(--ink);
  background-image: linear-gradient(rgba(var(--hl-rgb), .18), rgba(var(--hl-rgb), .18));
}

/* 좁은 화면에서 어떤 요소도 가로 스크롤을 만들지 않도록 */
.event, .admin, .mine, .create, .panels, .panel, .side, .side-block,
.toolbar, .ev-head, .card, .create-form, .field, .row3, .block, .inline { min-width: 0; }
.field > *, .row3 > *, .inline > * { min-width: 0; }
.ev-head > div, .toolbar > * { min-width: 0; max-width: 100%; }

main {
  max-width: 1440px; margin: 0 auto;
  padding: 8px 28px 64px;
  padding-left: calc(28px + env(safe-area-inset-left));
  padding-right: calc(28px + env(safe-area-inset-right));
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 9px 16px; border-radius: 10px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .6; cursor: default; }

.link-btn { background: none; border: 0; padding: 2px 4px; cursor: pointer; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger:hover { color: var(--danger); }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--cell); }

input, select {
  /* 선택지 문구가 길어도(시간대 목록) 칸을 벌리지 않게 */
  width: 100%; min-width: 0; max-width: 100%;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .22); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px -10px rgba(0,0,0,.35); z-index: 50;
  animation: toast-in .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.empty { max-width: 460px; margin: 60px auto; padding: 36px; text-align: center; }
.empty p { color: var(--muted); }

/* ---------- 만들기 ---------- */

.create { display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: 56px; align-items: start; padding-top: 40px; }
.hero { padding-top: 24px; position: sticky; top: 24px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.12; font-weight: 800; letter-spacing: -0.035em; }
.hero > p { color: var(--muted); font-size: 17px; max-width: 460px; margin: 18px 0 32px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.steps b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--accent-soft); color: var(--accent); }

.create-form { padding: 26px; display: grid; gap: 20px; }
.field { display: grid; gap: 7px; }
.label { font-weight: 600; font-size: 14px; }
.label em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 13px; }
.field small { color: var(--muted); font-size: 12.5px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }

.cal { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; user-select: none; touch-action: none; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-wd.sun { color: var(--sun); } .cal-wd.sat { color: var(--sat); }
.cal-day {
  aspect-ratio: 1 / .82; min-width: 0;
  display: grid; place-items: center; border-radius: 9px;
  font-size: 14px; font-weight: 500; cursor: pointer; background: var(--cell);
  transition: background-color .08s;
}
.cal-day.out { color: var(--muted); background: transparent; }
.cal-day.past { color: rgba(var(--muted-rgb), .5); background: transparent; cursor: default; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-day[data-k]:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.on { background: var(--accent); color: var(--accent-ink); }
.cal-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }

/* ---------- 미팅 페이지 ---------- */

.event { padding-top: 16px; display: grid; gap: 16px; }
.ev-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--accent); font-weight: 600; }
.ev-head h1 { font-size: 30px; font-weight: 800; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.share { display: flex; gap: 8px; flex: 1 1 320px; max-width: 100%; min-width: 0; }
.share input { font-size: 13px; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.tz-pick { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; min-width: 0; }
.tz-pick select { width: auto; max-width: 340px; min-width: 0; padding: 7px 10px; font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.me-chip { display: inline-flex; align-items: center; gap: 7px; }
.me-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--mine); }

.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.panel { padding: 18px 18px 14px; position: relative; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.panel h2 { font-size: 17px; }
.hint { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.save-state { font-size: 12.5px; color: var(--muted); }
.save-state[data-state="saved"] { color: var(--accent); }
.save-state[data-state="error"] { color: var(--danger); }

.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-bar { width: 72px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--cell), var(--accent)); }

.lock {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: var(--radius);
  background: rgba(var(--surface-rgb), .82);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 5;
}
.lock-form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; max-width: 340px; width: 100%; }
.lock-form strong { font-size: 16px; }
.lock-form p { margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.inline { display: flex; gap: 8px; }

/* 그리드 */
.gridwrap {
  overflow: auto; min-height: 220px; overscroll-behavior: contain;
  max-height: calc(100vh - 260px);
  max-height: calc(100dvh - 260px);
  -webkit-overflow-scrolling: touch;
}
.grid {
  display: grid;
  grid-template-columns: 46px repeat(var(--cols), minmax(42px, 1fr));
  column-gap: 3px;
  user-select: none; -webkit-user-select: none;
  min-width: max-content; width: 100%;
}
.gh { background: var(--surface); position: sticky; }
.gh.corner { top: 0; left: 0; z-index: 4; }
.gh.col { top: 0; z-index: 3; text-align: center; padding: 0 0 10px; margin-bottom: 0; font-size: 12px; color: var(--muted); line-height: 1.3; }
.gh.col b { display: block; font-size: 14px; color: var(--ink); font-weight: 700; }
.gh.col.sun b { color: var(--sun); } .gh.col.sat b { color: var(--sat); }
.gh.row {
  left: 0; z-index: 2; font-size: 11px; color: var(--muted);
  text-align: right; padding-right: 6px; line-height: 1; height: var(--rowh);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.gapline { grid-column: 1 / -1; height: 12px; background: repeating-linear-gradient(90deg, var(--cell-line) 0 4px, transparent 4px 8px) center / 100% 1px no-repeat; }

.cell {
  height: var(--rowh); background: var(--cell);
  border-top: 1px solid var(--surface);
  touch-action: none;
}
.cell.hr { border-top-color: rgba(var(--cell-line-rgb), .75); }
.cell.void { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(var(--cell-rgb), .7) 3px 5px); }
.cell[data-k] { cursor: pointer; }

.mine .cell[data-k]:hover { box-shadow: inset 0 0 0 2px rgba(var(--mine-rgb), .6); }
.mine .cell.on { background: var(--mine); border-top-color: rgba(255, 255, 255, .3); }
.mine.dragging .cell[data-k] { cursor: crosshair; }

.heat .cell[data-k] {
  background-color: var(--cell);
  background-image: linear-gradient(rgba(var(--accent-rgb), var(--p, 0)), rgba(var(--accent-rgb), var(--p, 0)));
  transition: background-image .15s;
}
.heat .cell.all { background-color: var(--accent-deep); background-image: none; }
.heat .cell.cur { box-shadow: inset 0 0 0 2px var(--ink); }
.heat .cell.hl {
  box-shadow: inset 0 0 0 2px var(--hl);
  background-image: linear-gradient(rgba(var(--hl-rgb), .45), rgba(var(--hl-rgb), .45)),
                    linear-gradient(rgba(var(--accent-rgb), var(--p, 0)), rgba(var(--accent-rgb), var(--p, 0)));
}
.heat.focus .cell[data-k] {
  background-image: linear-gradient(rgba(var(--sat-rgb), calc(var(--p, 0) * .75)), rgba(var(--sat-rgb), calc(var(--p, 0) * .75)));
}

/* 사이드 */
.side { display: grid; gap: 12px; position: sticky; top: 16px; }
.side-block { padding: 16px; }
.side-block h3 { font-size: 14px; margin-bottom: 8px; }
.side-block h3 .count { color: var(--muted); font-weight: 500; margin-left: 2px; }
#detail h3 { font-size: 15px; }

.tzline { list-style: none; padding: 8px 10px; margin: 0 0 10px; background: var(--cell); border-radius: 9px; display: grid; gap: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tzline li { display: flex; justify-content: space-between; gap: 10px; }
.tzline span { color: var(--muted); }

.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn h4 { font-size: 12.5px; margin-bottom: 4px; }
.yn h4.yes { color: var(--accent); } .yn h4.no { color: var(--muted); }
.yn ul { list-style: none; padding: 0; margin: 0; font-size: 13.5px; display: grid; gap: 2px; }

.best { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.best li { padding: 9px 10px; border-radius: 10px; background: var(--cell); cursor: pointer; transition: background-color .12s; }
.best li:hover { background-color: var(--cell); background-image: linear-gradient(rgba(var(--hl-rgb), .22), rgba(var(--hl-rgb), .22)); }
.best-time { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.best-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tag.soft { background: var(--accent-soft); color: var(--accent); }

.people { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 2px; }
.people li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; cursor: default; }
.people li.active { background-color: var(--surface); background-image: linear-gradient(rgba(var(--sat-rgb), .14), rgba(var(--sat-rgb), .14)); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.pname { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname em { font-style: normal; font-size: 11px; color: var(--mine); margin-left: 4px; }
.ptz { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 반응형 ---------- */

@media (max-width: 1180px) {
  .panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .side { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); position: static; align-items: start; }
}
@media (max-width: 860px) {
  .create { grid-template-columns: 1fr; gap: 28px; padding-top: 8px; }
  .hero { position: static; padding-top: 0; }
  .panels { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
  .gridwrap { max-height: 70vh; }
}
@media (max-width: 560px) {
  .topbar { padding: 14px 16px; }
  main {
    padding-left: calc(14px + env(safe-area-inset-left));
    padding-right: calc(14px + env(safe-area-inset-right));
  }
  .hero h1 { font-size: 30px; }
  .hero > p { font-size: 16px; margin: 14px 0 24px; }
  .ev-head h1 { font-size: 22px; }
  .ev-head { gap: 12px; }
  .share { flex: 1 1 100%; flex-wrap: wrap; }
  .share input { flex: 1 1 100%; }
  .share .btn { flex: 1 1 0; }
  .tz-pick { flex: 1 1 100%; flex-wrap: wrap; }
  .tz-pick select { flex: 1 1 auto; width: 100%; max-width: 100%; }
  .who { min-width: 0; flex-wrap: wrap; }
  .row3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .row3 select { padding: 10px 6px; }
  .create-form { padding: 16px; }
  .panel { padding: 14px 12px 12px; }
  .side-block { padding: 14px; }
  .yn.three { grid-template-columns: 1fr; }
  .cal { padding: 8px; }
  .cal-grid { gap: 3px; }
  .steps { gap: 10px; }
  .lock-form { padding: 18px; }
  .lock-form .inline { flex-wrap: wrap; }
  .lock-form .inline input[name="name"] { flex: 1 1 100%; }
  .admin-people li { grid-template-columns: 1fr auto; row-gap: 4px; }
  .mine-list li { padding: 14px; }
}

/* iOS는 16px 미만 입력창에 포커스하면 화면을 확대해 버린다 */
@media (max-width: 860px) {
  input, select, .btn, button { font-size: 16px; }
  .link-btn { font-size: 14px; }
  .btn.small { font-size: 14px; }
}

/* 손가락으로 쓰는 화면: 버튼과 칸을 키운다 */
@media (pointer: coarse) {
  .grid { grid-template-columns: 52px repeat(var(--cols), minmax(46px, 1fr)); }
  .brush { padding: 9px 14px; }
  .icon-btn { width: 40px; height: 40px; }
  .link-btn { padding: 6px 4px; }
  /* 비율 대신 높이를 직접 준다 — 비율은 너비까지 밀어내 달력이 화면을 넘긴다 */
  .cal-day { aspect-ratio: auto; height: 42px; }
}
@media (max-width: 560px) {
  .cal-day { aspect-ratio: auto; height: 40px; }
}

/* 좁은 화면에서는 '내 시간'과 '모두'를 탭으로 나눠 스크롤을 줄인다 */
.panel-tabs { display: none; }
@media (max-width: 860px) {
  .panel-tabs { display: flex; gap: 6px; }
  .panel-tabs .brush { flex: 1; justify-content: center; }
  .panels.tab-mine #p-group,
  .panels.tab-mine .side,
  .panels.tab-group #p-mine { display: none; }
}

/* ---------- 확정 배너 ---------- */

.confirmed {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-left: 4px solid var(--accent);
}
.confirmed b {
  font-size: 11.5px; letter-spacing: .04em; padding: 2px 9px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink);
}
.confirmed span { font-size: 16px; font-weight: 700; }
.confirmed em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.inline-confirm { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.confirmed b.soft { background: var(--accent-soft); color: var(--accent); }
.confirmed .thin { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.confirm-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.confirm-actions .btn { white-space: nowrap; }
@media (max-width: 560px) {
  .confirmed { gap: 8px; }
  .confirm-actions { margin-left: 0; width: 100%; }
  .confirm-actions .btn { flex: 1 1 0; }
}

/* ---------- 관리 페이지 ---------- */

.admin, .mine { padding-top: 16px; display: grid; gap: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.block { padding: 20px; display: grid; gap: 14px; align-content: start; }
.block h2 { font-size: 16px; }
.block h2 .count { color: var(--muted); font-weight: 500; }
.block .hint { margin: 0; }
.block .btn { justify-self: start; }
.static-val { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.danger-zone { border-color: rgba(var(--danger-rgb), .45); }

.best li.picked { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
#run-list .best li { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: default; }
#run-list .best li:hover { background: var(--cell); }
#run-list .best li.picked:hover { background: var(--accent-soft); }

.admin-people { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.admin-people li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; }
.pname-input { padding: 7px 10px; font-size: 14px; }

/* ---------- 비밀번호 확인 ---------- */

.gate { display: grid; place-items: center; padding: 48px 0; }
.gate-card { padding: 28px; max-width: 420px; width: 100%; display: grid; gap: 10px; }
.gate-card h1 { font-size: 22px; }
.gate-card .inline { margin: 6px 0; }
.gate-card .link-btn { justify-self: start; padding-left: 0; }

/* ---------- 내 미팅 ---------- */

.topbar-nav { display: flex; align-items: center; gap: 16px; }
.topbar-nav a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.topbar-nav a:hover { color: var(--ink); }

.mine-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mine-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
  gap: 14px; padding: 14px 18px;
}
.mine-list li.gone { opacity: .55; }
.mine-title { font-weight: 700; text-decoration: none; }
.mine-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.mine-meta { font-size: 13px; color: var(--muted); }
.mine-actions { display: flex; align-items: center; gap: 10px; }

@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-people li { grid-template-columns: 1fr auto; }
  .mine-list li { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- 체크박스 옵션 / PIN ---------- */

.check { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.check b { display: block; font-size: 14px; font-weight: 600; }
.check small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.pin-input { max-width: 90px; text-align: center; letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.lock-form .form-error { margin-top: 8px; font-size: 13px; }
.save-state[data-state="denied"] { color: var(--danger); }
.admin-people li { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
.pin-on { color: var(--accent); font-weight: 700; font-size: 11px; letter-spacing: .04em; }

/* ---------- 대면 / 온라인 ---------- */

.brushes { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.brush {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 6px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.brush:hover { color: var(--ink); }
.brush.on { border-color: var(--ink); color: var(--ink); background: var(--cell); }
.sw { width: 11px; height: 11px; border-radius: 3px; }
.sw.in { background: var(--mine); }
.sw.online { background: var(--sat); }

/* 내 표: 구분을 쓰는 미팅에서만 대면=초록 / 온라인만=파랑 */
.mine.ask .cell.on { background: var(--sat); border-top-color: rgba(255, 255, 255, .3); }
.mine.ask .cell.on.in { background: var(--mine); border-top-color: rgba(255, 255, 255, .3); }

/* 모두의 표: 대면 기준으로 보면 색을 바꿔 구분 */
.heat.in-basis .cell[data-k] {
  background-image: linear-gradient(rgba(var(--mine-rgb), var(--p, 0)), rgba(var(--mine-rgb), var(--p, 0)));
}

.yn.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.yn h4.online { color: var(--sat); }
.tag.face { background: var(--mine); color: #fff; }
.face-mini { color: var(--mine); font-weight: 700; }

/* 자정을 넘어간 행 표시 */
.gh.row.nextday { color: var(--sat); }
.gh.row i { font-style: normal; font-size: 9px; margin-left: 1px; vertical-align: super; }

/* 추천 시간: 온라인 / 대면 구분 */
.best-group + .best-group { margin-top: 14px; }
.best-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; margin-bottom: 6px; color: var(--muted);
}
.best-head::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--sat); }
.best-head.in::before { background: var(--mine); }
.best-head em { font-style: normal; font-weight: 400; }
/* 추천 시간의 참석 / 불참 명단 */
.best-who { display: grid; gap: 2px; margin-top: 5px; font-size: 12.5px; line-height: 1.45; }
.best-who b { font-weight: 700; margin-right: 4px; }
.best-who .in-list { color: var(--ink); }
.best-who .in-list b { color: var(--accent); }
.best-who .out-list { color: var(--muted); }
.best-meta { flex-wrap: wrap; }

/* 토스트 안의 되돌리기 버튼 */
.toast { display: inline-flex; align-items: center; gap: 12px; max-width: min(92vw, 520px); }
.toast-btn {
  border: 0; background: var(--bg); color: var(--ink);
  padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.toast-btn:hover { background: #fff; }

/* 드래그 중 요약 */
.save-state[data-state="drag"] { color: var(--ink); font-weight: 600; }

/* 날짜 머리글: 눌러서 그 날 지우기 */
.mine .gh.col[data-col] { cursor: pointer; border-radius: 6px; }
.mine .gh.col[data-col]:hover { background: var(--cell); }

/* ---------- 표 가로 이동 ---------- */

/* 칸은 드래그로 칠해야 해서 touch-action:none 이지만,
   시간 라벨·날짜 머리글에서는 손가락으로 표를 밀 수 있게 둔다 */
.gh.row, .gh.col, .gh.corner { touch-action: pan-x pan-y; }

/* 스크롤 막대를 보이게 해서 "옆으로 더 있다"는 걸 알린다 */
.gridwrap { scrollbar-width: thin; scrollbar-color: var(--cell-line) transparent; }
.gridwrap::-webkit-scrollbar { height: 10px; width: 10px; }
.gridwrap::-webkit-scrollbar-track { background: transparent; }
.gridwrap::-webkit-scrollbar-thumb { background: var(--cell-line); border-radius: 99px; }
.gridwrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.scroll-arrows { display: flex; gap: 4px; margin-left: auto; }
.scroll-arrows .icon-btn { width: 34px; height: 30px; font-size: 16px; }
@media (pointer: coarse) { .scroll-arrows .icon-btn { width: 44px; height: 38px; } }

/* 이미 지난 칸: 자리는 남기되 쓸 수 없다는 걸 보인다 */
.cell.past {
  background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(var(--cell-rgb), .85) 4px 7px);
  opacity: .5; cursor: default;
}
