/* Dayplo — iOS 느낌의 깔끔한 화면
   원칙: 회색 바탕 위에 흰 카드(모서리 둥글게), 가는 구분선, 파란 강조색 하나, 그림자는 거의 없음, 다크 모드 지원 */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #8e8e93;
  --line: rgba(60, 60, 67, 0.16);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --primary: #007aff;
  --primary-soft: rgba(0, 122, 255, 0.12);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.12);
  --warn: #ff9500;
  --warn-soft: rgba(255, 149, 0, 0.14);
  --ok: #34c759;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --new-bg: #fffbe8;
  --bar: #f7f7fa;
  --radius: 14px;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 4px 14px rgba(0, 0, 0, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f2f2f7;
    --muted: #8e8e93;
    --line: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --primary: #0a84ff;
    --primary-soft: rgba(10, 132, 255, 0.2);
    --danger: #ff453a;
    --danger-soft: rgba(255, 69, 58, 0.2);
    --warn: #ff9f0a;
    --warn-soft: rgba(255, 159, 10, 0.2);
    --ok: #30d158;
    --ok-soft: rgba(48, 209, 88, 0.2);
    --new-bg: #2a2716;
    --bar: #151517;
    --shadow: none;
    color-scheme: dark;
  }
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-x pan-y; /* 두 손가락 확대·두 번 눌러 확대 막기 */
}
button { font: inherit; color: inherit; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.side { display: none; } /* PC 왼쪽 메뉴: 넓은 화면에서만 (아래 @media) */
.booting { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- 상단: 큰 제목 */
header.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
}
header.top .team { font-weight: 800; font-size: 30px; letter-spacing: -0.5px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top .user { font-size: 13px; font-weight: 600; color: var(--muted); }
.head-row { display: flex; align-items: center; gap: 6px; }
.head-text { min-width: 0; }
.daynav-row .head-text { flex: 0 1 auto; }
header.top .daynav-row .team { font-size: 24px; }
.daynav-row .spacer { flex: 1; min-width: 4px; }
.daybtn { border: none; background: var(--fill); color: var(--primary); width: 34px; height: 34px; border-radius: 10px; font-size: 24px; line-height: 1; font-weight: 500; cursor: pointer; flex: none; padding: 0; }
.daybtn.today { width: auto; padding: 0 11px; font-size: 13px; font-weight: 600; background: var(--primary); color: #fff; }
.daybtn:active { opacity: 0.7; }
@media (max-width: 400px) { header.top .daynav-row .team { font-size: 21px; } }
.day-hint { margin: 10px 16px 0; font-size: 12.5px; color: var(--muted); }

main#content {
  flex: 1;
  padding: 6px 16px calc(104px + env(safe-area-inset-bottom));
}

/* ---------- 묶음 제목 */
h2.section {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin: 22px 16px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
h2.section .count {
  background: var(--fill);
  color: var(--muted);
  border-radius: 10px;
  padding: 0 7px;
  font-size: 12px;
  line-height: 19px;
  font-weight: 600;
}
h2.section .sub { font-weight: 500; color: var(--muted); margin-left: 2px; opacity: 0.85; }
h2.section.done-head { cursor: pointer; user-select: none; }
h2.section .chev { margin-left: auto; font-size: 13px; opacity: 0.8; }

/* ---------- 목록 (iOS 의 둥근 묶음 목록) */
ul.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
li.task {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  align-items: flex-start;
  transition: background 0.2s;
}
li.task:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 52px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}
li.task.urgent { box-shadow: inset 3px 0 0 var(--danger); }
li.task.new { background: var(--new-bg); }
li.task:active { background: var(--fill); }

.check {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.6px solid rgba(142, 142, 147, 0.7);
  background: transparent;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.check:active { transform: scale(0.9); }
.check::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.4px 2.4px 0;
  transform: rotate(45deg);
  opacity: 0;
}
li.done .check { background: var(--primary); border-color: var(--primary); }
li.done .check::after { opacity: 1; }

.body { flex: 1; min-width: 0; cursor: pointer; }
.title { font-size: 16.5px; font-weight: 500; word-break: break-word; line-height: 1.35; letter-spacing: -0.2px; }
li.done .title { color: var(--muted); text-decoration: line-through; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  align-items: center;
}
.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 12px;
  background: var(--fill);
  color: var(--muted);
}
.chip.urgent { background: var(--danger-soft); color: var(--danger); }
.chip.important { background: var(--warn-soft); color: var(--warn); }
.chip.due.overdue { background: var(--danger-soft); color: var(--danger); }
.chip.due.today { background: var(--warn-soft); color: var(--warn); }
.chip.due.soon { background: var(--primary-soft); color: var(--primary); }
.chip.private { background: var(--fill); color: var(--muted); }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.6;
}
.empty.slim { padding: 16px; font-size: 14px; }

/* 우선순위 고르기: 보통 · 중요 · 긴급 (iOS 세그먼트) */
.seg3 { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin-top: 6px; }
.seg3 label { flex: 1; margin: 0; }
.seg3 input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg3 span { display: block; text-align: center; padding: 7px 0; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background 0.15s; }
.seg3 input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg3 input:checked + span.p1 { color: var(--warn); }
.seg3 input:checked + span.p2 { color: var(--danger); }
.seg3 input:disabled + span { opacity: 0.6; }
.freq-only .two { margin-top: 4px; }
.ok { margin: 8px 0 0; color: var(--ok); font-weight: 600; }

/* 팀원 필터 칩 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none;
  border: none;
  background: var(--fill);
  color: var(--text);
  border-radius: 16px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chips button.active { background: var(--primary); color: #fff; }

/* ---------- 하단 탭 */
nav.tabs {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: var(--bar);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
}
nav.tabs button {
  flex: 1;
  border: none;
  background: none;
  padding: 7px 2px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
}
nav.tabs button svg { width: 25px; height: 25px; }
nav.tabs button.active { color: var(--primary); }
nav.tabs .dot {
  position: absolute;
  top: 3px;
  left: calc(50% + 6px);
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
  min-width: 18px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 18px;
  font-weight: 700;
}

.fab {
  position: fixed;
  right: max(18px, calc(50vw - 280px + 18px));
  bottom: calc(74px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.35);
  cursor: pointer;
  z-index: 6;
  transition: transform 0.1s;
}
.fab:active { transform: scale(0.94); }

/* ---------- 입력 공통 */
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border: none;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
input[type='date'], input[type='time'] { min-height: 46px; }
input[type='checkbox'], input[type='radio'] { -webkit-appearance: auto; appearance: auto; width: auto; padding: 0; background: none; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--primary-soft); }
input[readonly] { color: var(--muted); }
textarea { resize: vertical; min-height: 72px; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 14px; }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; }
label.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
label.switch input { width: auto; margin: 0; transform: scale(1.25); accent-color: var(--primary); background: none; }
.two { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.two label.switch { margin-bottom: 11px; }
.fixed { margin-top: 6px; padding: 11px 13px; background: var(--fill); border-radius: 10px; font-weight: 500; color: var(--text); }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 10px 0 0; text-align: center; }

.btn {
  font: inherit;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 12px;
  border: none;
  background: var(--fill);
  color: var(--primary);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.big { width: 100%; padding: 14px; font-size: 16.5px; margin-top: 14px; }
.btn.kakao { background: #fee500; color: #191919; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* 안내 상자 (설정 화면) */
.notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--warn-soft);
  color: var(--warn);
  word-break: break-word;
}
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.err { background: var(--danger-soft); color: var(--danger); }
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  vertical-align: 1px;
}
.hint a { color: var(--primary); text-decoration: none; }
.hint b { color: var(--text); }
.port-input { width: 96px; }

/* 반복되는 일 · 캘린더 일정 줄 */
.two.even { grid-template-columns: 1fr 1fr; align-items: start; }
li.task.rule .rule-ico { flex: none; width: 24px; text-align: center; font-size: 17px; line-height: 26px; }
li.task.rule.off { opacity: 0.5; }
li.task.rule.upcoming { background: var(--primary-soft); }
li.task.rule.upcoming .title { color: var(--primary); }
li.task.event .when { flex: none; width: 58px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); line-height: 1.4; padding-top: 2px; }
li.task.event .when b { color: var(--text); font-size: 13px; }
li.task.event.today .when b { color: var(--primary); }
li.task.event .body { cursor: default; }
li.task.event .title { font-size: 15.5px; }
li.task.event .title a { color: inherit; text-decoration: none; }
li.task.event .title a:hover { text-decoration: underline; }
li.task.event.holiday .when span, li.task.event.holiday .title { color: var(--danger); }
li.task.event.holiday .title { font-weight: 600; }
li.task.event .src { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--fill); border-radius: 6px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
details.guide { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
details.guide summary { cursor: pointer; font-weight: 600; color: var(--primary); list-style: none; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary::before { content: '›'; display: inline-block; margin-right: 6px; transition: transform 0.15s; font-weight: 700; }
details.guide[open] summary::before { transform: rotate(90deg); }
details.guide ol { margin: 8px 0 0; padding-left: 20px; }
details.guide li { margin-bottom: 6px; }
details.guide a { color: var(--primary); }
details.guide b { color: var(--text); }
details.guide p { margin: 8px 0 0; }
details.guide.how { margin-top: 12px; }
.uri-box { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; background: var(--fill); border-radius: 10px; }
.uri-box code { flex: 1; min-width: 0; font-size: 12px; word-break: break-all; color: var(--text); }
ol.steps { margin: 12px 0 0; padding-left: 22px; font-size: 14px; line-height: 1.65; color: var(--text); }
ol.steps li { margin-bottom: 6px; }
ol.steps a { color: var(--primary); font-weight: 600; }
ol.steps .btn.small { margin-left: 4px; vertical-align: 1px; }
.hint.tip { margin-top: 14px; padding: 10px 12px; background: var(--primary-soft); border-radius: 10px; color: var(--text); }
.cal-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.cal-add-row.single { grid-template-columns: 1fr; }
a.btn.cal-add { display: block; text-align: center; text-decoration: none; font-size: 14px; padding: 11px 6px; color: var(--primary); background: var(--primary-soft); }
ul.sources { list-style: none; margin: 10px 0 0; padding: 0; }
ul.sources li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; }
ul.sources li span { flex: 1; }

/* 담당자 고르기 */
.assignees { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--fill);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  cursor: pointer;
}
.chip-check input { width: auto; margin: 0; accent-color: var(--primary); background: none; }
.chip-check:has(input:checked) { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- 사진 (할 일에 붙이기) */
.photos { margin-top: 14px; }
.ph-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ph-head .count { background: var(--fill); border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 19px; }
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.ph { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.ph.pending { outline: 2px dashed var(--primary-soft); }
.ph-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.ph-actions { display: flex; gap: 8px; margin-top: 8px; }
.ph-actions .btn { flex: 1; text-align: center; cursor: pointer; margin: 0; }
#lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; cursor: zoom-out; }
#lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
#lightbox .lb-x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

/* ---------- 운영자 화면 */
.admin-head { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.admin-head b { font-size: 17px; }
.admin-head .spacer { flex: 1; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.stat { background: var(--fill); border-radius: 12px; padding: 10px 12px; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.stat .l span { font-size: 11px; }
.admin-search { display: flex; gap: 8px; margin: 0 0 8px; }
.admin-search input { flex: 1; }
.admin-search .btn { flex: none; }
li.task.admin-user { flex-wrap: wrap; }
li.task.admin-user .title .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.admin-actions { display: flex; gap: 6px; width: 100%; padding-left: 0; margin-top: 6px; }
.admin-actions .btn.danger { margin-left: auto; }
.notice-card { background: var(--warn-soft); }
.notice-card .btn { background: var(--card); color: var(--text); }

/* ---------- 바텀 시트 (할 일 추가/수정) */
#sheet { position: fixed; inset: 0; z-index: 10; }
#sheet .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
#sheet .panel {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 92dvh;
  overflow: auto;
  animation: up 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes up { from { transform: translate(-50%, 48px); } to { transform: translate(-50%, 0); } }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); margin: 0 auto 10px; }
.panel h3 { margin: 6px 0 2px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.actions .spacer { flex: 1; }

/* ---------- 설정 */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); gap: 10px; }
.kv > span:first-child { color: var(--muted); font-size: 14px; flex: none; }
.kv b { font-weight: 500; text-align: right; }
.kv .right { display: flex; align-items: center; gap: 8px; }
.code { font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: 3px; font-size: 20px; color: var(--primary); }
ul.members { list-style: none; margin: 0; padding: 0; }
ul.members li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
ul.members .name { flex: 1; font-weight: 500; }
ul.members .role { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--fill); color: var(--muted); }
ul.members .role.leader { background: var(--primary-soft); color: var(--primary); }
.version { text-align: center; color: var(--muted); font-size: 12px; margin: 24px 0; word-break: break-all; }
#profileForm .actions { margin-top: 8px; }
#profileForm .kv { margin-top: 8px; }
details.guide.advanced { margin: 12px 0 0; padding: 14px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
details.guide.advanced summary { font-size: 15px; color: var(--text); }
details.guide.advanced .card { box-shadow: none; padding: 12px 0 0; margin: 10px 0 0; border-top: 1px solid var(--line); border-radius: 0; }
details.guide.owner, details.guide.other { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0 10px; }
.tip-card { margin: 8px 0 4px; padding: 12px 14px; background: var(--primary-soft); border-radius: var(--radius); font-size: 14px; line-height: 1.5; color: var(--text); }
.tip-card .actions { margin-top: 10px; justify-content: flex-end; }
.tip-card .btn { background: var(--card); }
.tip-card .btn.primary { background: var(--primary); }
.inline-form { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.inline-form label.switch { margin: 0; flex: 1; }
.code-box { width: 100%; min-height: 120px; font: 12px/1.5 ui-monospace, "SF Mono", Consolas, monospace; white-space: pre; overflow: auto; background: var(--fill); border: none; border-radius: 10px; padding: 10px; margin-top: 8px; color: var(--text); }
.linkish { display: block; width: 100%; margin-top: 14px; border: none; background: none; font: inherit; font-size: 14px; color: var(--primary); cursor: pointer; }

/* ---------- 로그인/가입 */
.auth { padding: 56px 24px 40px; position: relative; }
.lang-pick { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.lang-pick select { width: auto; padding: 6px 28px 6px 10px; font-size: 14px; background-color: var(--card); border-radius: 9px; box-shadow: var(--shadow); }
.logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: linear-gradient(160deg, #3d9bff, #007aff);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.3);
}
.logo svg { width: 46px; height: 46px; }
.auth h1 { text-align: center; margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.auth .sub { text-align: center; color: var(--muted); margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.auth form input { margin-top: 10px; background: var(--card); box-shadow: var(--shadow); }
.auth form input:focus { box-shadow: 0 0 0 3px var(--primary-soft); }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 24px 0 6px; }
.seg.small { margin: 14px 0 0; }
.seg button {
  flex: 1;
  border: none;
  background: none;
  padding: 8px;
  border-radius: 7px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg.small button { font-size: 14px; }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ---------- 토스트 알림 */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  background: rgba(28, 28, 30, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 20;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (prefers-color-scheme: dark) {
  #toast { background: rgba(58, 58, 60, 0.95); }
}

/* ---------- 달력 탭 */
.cal-nav { display: flex; align-items: center; gap: 8px; margin: 8px 2px 10px; }
.cal-nav b { flex: 1; text-align: center; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.cal-nav .cal-title { flex: 1; border: none; background: none; font: inherit; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); cursor: pointer; padding: 6px 4px; border-radius: 10px; }
.cal-nav .cal-title:active { background: var(--fill); }
.cal-nav .cal-title .chev { font-size: 12px; color: var(--muted); margin-left: 2px; }
.year-nav { margin: 4px 0 12px; }
.year-nav b { font-size: 20px; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.month-grid .month { border: none; background: var(--fill); border-radius: 12px; padding: 13px 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; }
.month-grid .month.now { color: var(--primary); }
.month-grid .month.on { background: var(--primary); color: #fff; }
.month-grid .month:active { opacity: 0.7; }
.cal-nav .btn.small { min-width: 40px; font-size: 20px; line-height: 1; padding: 5px 10px; }
.cal-nav .btn.small[data-act=calToday] { font-size: 13px; padding: 7px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--card); border-radius: var(--radius); padding: 10px 6px 8px; box-shadow: var(--shadow); }
.cal-grid .wd { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 2px 0 8px; }
.cal-grid .wd.sun { color: var(--danger); }
.cal-grid .wd.sat { color: var(--primary); }
.cal-grid .day { border: none; background: none; border-radius: 10px; padding: 3px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; cursor: pointer; min-height: 56px; min-width: 0; overflow: hidden; }
.cal-grid .day:hover { background: var(--fill); }
.cal-grid .day .num { font-size: 15px; font-weight: 500; line-height: 1; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.cal-grid .day.sun .num, .cal-grid .day.holiday .num { color: var(--danger); }
.cal-grid .day.sat .num { color: var(--primary); }
.cal-grid .day.other { opacity: 0.3; }
.cal-grid .day.today .num { color: var(--primary); font-weight: 800; }
.cal-grid .day.today.sun .num, .cal-grid .day.today.holiday .num { color: var(--danger); }
.cal-grid .day.selected .num { background: var(--primary); color: #fff !important; font-weight: 700; }
.cal-grid .day.selected.sun .num, .cal-grid .day.selected.holiday .num { background: var(--danger); }
.cal-grid .day .hol { font-size: 9px; line-height: 1.1; color: var(--danger); font-weight: 600; width: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; text-align: center; box-sizing: border-box; }
.cal-grid .dots { display: flex; align-items: center; gap: 2px; height: 8px; }
.cal-grid .more { font-size: 9px; color: var(--muted); line-height: 1; }
.cdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.cdot.urgent { background: var(--danger); }
.cdot.done { background: var(--fill-strong); }
.cdot.event { background: var(--ok); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; color: var(--muted); margin: 8px 6px 0; }
.cal-legend .cdot { margin-right: 4px; vertical-align: 1px; }
.cal-legend .hol-key { color: var(--danger); font-weight: 600; }
h2.section .add-event { margin-left: auto; font-size: 13px; padding: 5px 10px; color: var(--primary); background: var(--primary-soft); }

/* ==========================================================================
   PC 화면 (900px 이상): 왼쪽에 메뉴, 오른쪽에 내용. 휴대폰에서는 위의 모습(아래 탭·+ 버튼) 그대로.
   ========================================================================== */
@media (min-width: 900px) {
  #app.has-side {
    max-width: none;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    align-items: stretch;
  }
  .side {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 22px 14px 18px;
    background: var(--bar);
    border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-size: 21px; font-weight: 800; letter-spacing: -0.4px; }
  .brand .logo-sm { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(160deg, #3d9bff, #007aff); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0, 122, 255, 0.25); }
  .brand .logo-sm svg { width: 18px; height: 18px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }
  .side-nav button svg { width: 20px; height: 20px; color: var(--muted); }
  .side-nav button:hover { background: var(--fill); }
  .side-nav button.active { background: var(--primary-soft); color: var(--primary); }
  .side-nav button.active svg { color: var(--primary); }
  .side-nav .dot { margin-left: auto; background: var(--danger); color: #fff; border-radius: 9px; min-width: 18px; padding: 0 6px; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }
  .side .new-btn { margin: 14px 0 6px; width: 100%; padding: 12px; font-size: 15px; }
  .side-foot { margin-top: auto; padding: 8px 10px 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; word-break: break-all; }
  .side-foot b { color: var(--text); font-weight: 600; }

  header.top { padding: 26px 36px 12px; }
  header.top .team { font-size: 30px; }
  header.top .daynav-row .team { font-size: 28px; }
  main#content { max-width: 820px; padding: 8px 36px 60px; }
  .day-hint { margin-left: 36px; }
  nav.tabs { display: none; }
  .fab { display: none; }
  #toast { bottom: 32px; left: calc(50% + 118px); }

  /* 할 일 창: 아래에서 올라오는 시트 대신 가운데 창 */
  #sheet .panel {
    top: 50%;
    bottom: auto;
    left: 50%;
    width: min(600px, 92vw);
    max-height: 88vh;
    border-radius: 18px;
    padding: 14px 24px 22px;
    transform: translate(-50%, -50%);
    animation: pop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  }
  .grab { display: none; }
  @keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }

  /* 달력을 좀 더 여유 있게 */
  .cal-grid { gap: 4px; padding: 12px 10px 10px; }
  .cal-grid .day { min-height: 82px; }
  .cal-grid .day .hol { font-size: 10.5px; }
  .cal-grid .day .num { font-size: 16px; }
  .cal-nav b { font-size: 20px; }

  /* 로그인 화면 */
  .auth { max-width: 440px; margin: 0 auto; padding-top: 12vh; }
  #lightbox img { max-width: 92vw; max-height: 92vh; }
}
@media (min-width: 900px) and (hover: hover) {
  li.task .body:hover .title { color: var(--primary); }
  .check:hover { border-color: var(--primary); }
  .btn:hover { filter: brightness(0.96); }
  .btn.primary:hover { filter: brightness(1.08); }
}
@media (min-width: 1400px) {
  #app.has-side { grid-template-columns: 260px minmax(0, 1fr); }
  main#content { max-width: 900px; }
}

/* ---------- + 눌렀을 때 고르기 · 나라 고르기 · 달 고르기 */
.panel.choose, .panel.picker { padding-top: 8px; }
.panel.choose h3, .panel.picker h3 { margin-bottom: 10px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: none; background: var(--fill); border-radius: 14px; padding: 14px 16px; margin-top: 10px; font: inherit; color: var(--text); cursor: pointer; }
.choice:active { opacity: 0.75; }
.choice .ico { font-size: 26px; flex: none; }
.choice b { display: block; font-size: 16.5px; }
.choice small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.choice.dim b { color: var(--muted); }
.pick-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 6px; padding: 11px 13px; border: none; border-radius: 10px; background: var(--fill); color: var(--text); font: inherit; font-size: 16px; font-weight: 400; text-align: left; cursor: pointer; }
.pick-btn .chev { color: var(--muted); font-size: 13px; }
.panel.picker input[type='search'] { margin: 4px 0 10px; }
.country-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
.country-list li.none { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.country-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 6px; border: none; border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: 16px; color: var(--text); text-align: left; cursor: pointer; }
.country-list button .flag { font-size: 22px; width: 30px; text-align: center; flex: none; }
.country-list button small { display: block; font-size: 12.5px; color: var(--muted); }
.country-list button.on { color: var(--primary); font-weight: 600; }
.country-list button.on::after { content: '✓'; margin-left: auto; font-weight: 700; }
.country-list button:active { background: var(--fill); }
@media (min-width: 900px) { .country-list { max-height: 50vh; } }

/* ---------- 할 일·반복 창: 휴대폰에서는 전체 화면 (위쪽 막대: ✕ · 제목 · 저장) */
#sheet .panel.full {
  top: 0;
  bottom: 0;
  max-height: none;
  height: 100dvh;
  border-radius: 0;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  animation: slide-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide-up { from { transform: translate(-50%, 40px); opacity: 0.6; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -20px 4px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.sheet-bar h3 { flex: 1; margin: 0; font-size: 17px; text-align: center; }
.bar-btn { border: none; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--primary); padding: 8px 10px; border-radius: 10px; cursor: pointer; min-width: 44px; }
.bar-btn.primary { color: var(--primary); font-weight: 700; }
.bar-btn:active { background: var(--fill); }
.panel.full > label:first-of-type { margin-top: 10px; }
.gcal-row { margin-top: 14px; }
.gcal-row.off { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 500; color: var(--muted); }
@media (min-width: 900px) {
  #sheet .panel.full {
    top: 50%;
    bottom: auto;
    height: auto;
    max-height: 88vh;
    border-radius: 18px;
    padding: 0 24px 22px;
    animation: pop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .sheet-bar { margin: 0 -24px 4px; padding: 12px 14px 10px; border-radius: 18px 18px 0 0; }
}

/* + 창 맨 위: 새 할 일 / 스케줄 고르기 */
.seg.kind-seg { margin: 10px 0 2px; }
.seg.kind-seg button { padding: 9px; font-size: 15px; }
.country-list button { gap: 0; }

/* 앱 스케줄 줄은 눌러서 고칠 수 있다 */
li.task.event.app .body { cursor: pointer; }
li.task.event.app .title { color: var(--text); }

/* ---------- 첫 화면(로그인 전) 앱 소개 */
.static-landing { max-width: 560px; margin: 0 auto; padding: 48px 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.static-landing h1 { color: var(--text); font-size: 26px; margin: 0 0 8px; }
.static-landing a { color: var(--primary); }
.features { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.features li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.features li b { display: block; color: var(--text); margin-bottom: 2px; }
.features li span { color: var(--muted); }
.google-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--fill); font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.google-note b { color: var(--text); display: block; margin-bottom: 4px; }
.google-note p { margin: 0 0 6px; }
.google-note a { color: var(--primary); font-weight: 600; }
.landing-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 28px 0 0; }
.landing-foot a { color: var(--muted); }
