/* ============================================================
   로그 (Goal Tracker) - 전체 스타일
   설계 원칙:
   - 태블릿 우선, 큰 버튼/입력칸, 카드형 레이아웃
   - 차분한 네이비 / 화이트 / 그레이 계열
   - 경고는 빨강 대신 주황, 성공은 초록
   - 다크모드 없음
   ============================================================ */

/* 한글 웹폰트 Pretendard (필요한 글자만 동적으로 로드) */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css");

/* hidden 속성은 항상 우선 (display 지정된 요소도 확실히 숨김) */
[hidden] { display: none !important; }

:root {
  /* 메인 컬러: 검정 & 흰색 (모노크롬) */
  --navy: #111111;
  --navy-700: #222222;
  --primary: #111111;
  --primary-600: #000000;
  --primary-100: #ececec;

  --bg: #f4f4f5;
  --bg-soft: #fafafa;
  --card: #ffffff;
  --text: #141414;
  --muted: #6b6b6b;
  --muted-soft: #9a9a9a;
  --line: #ededed;
  --line-strong: #d6d6d6;

  /* 상태(의미) 컬러 — 완료/경고 구분용으로만 사용 */
  --orange: #f04438;       /* 경고 */
  --orange-strong: #d92d20; /* 강한 경고 */
  --green: #2aa56e;        /* 성공 */
  --green-strong: #1f8d5d;
  --green-bg: #edf6f1;
  --orange-bg: #fdecea;
  --blue-bg: #f0f0f0;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.16);
  --ring: 0 0 0 3px rgba(0, 0, 0, 0.14);
}

* { box-sizing: border-box; }

html { font-size: 14px; } /* 전체 UI 비율 기준 (rem 기반 텍스트 전체 축소) */

html, body {
  margin: 0;
  padding: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

a { text-decoration: none; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

/* 부드러운 등장 애니메이션 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .card, .action, .auth-card { animation: fadeUp 0.18s ease both; }
}

/* ---------------- 로딩 스플래시 (새로고침/최초 진입) ---------------- */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.45s ease;
}
.app-loader.is-hidden { opacity: 0; pointer-events: none; }
.app-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: loader-rise 0.5s ease both;
}
.app-loader__brand {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.app-loader__spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(17, 17, 17, 0.13);
  border-top-color: var(--navy);
  animation: loader-spin 0.7s linear infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .app-loader__spinner { animation-duration: 1.6s; }
  .app-loader__inner { animation: none; }
}

/* ---------------- 레이아웃 공통 ---------------- */
.app-bg { min-height: 100vh; padding-bottom: 56px; }

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #fafafa 0%, var(--bg) 55%);
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px 18px 0;
}
.container--wide { max-width: 1140px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 20px;
  background: rgba(17, 17, 17, 0.94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar__brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.topbar__right { display: flex; align-items: center; gap: 10px; }
.topbar__user { font-size: 0.9rem; opacity: 0.88; }

/* 하위 페이지(← 돌아가기 버튼이 있는 상단바): 제목을 화면 정중앙으로
   1fr · auto · 1fr 그리드 → 좌측 버튼 폭과 무관하게 제목 가운데. (student.html 상단바는 해당 없음) */
.topbar:has(> a.btn), .topbar:has(> .topbar__back) { display: grid; grid-template-columns: 1fr auto 1fr; }
.topbar:has(> a.btn) > a.btn, .topbar:has(> .topbar__back) > .topbar__back { justify-self: start; }
.topbar:has(> a.btn) .topbar__brand, .topbar:has(> .topbar__back) .topbar__brand { justify-self: center; }
.topbar:has(> a.btn) > span, .topbar:has(> .topbar__back) > span { justify-self: end; }
.topbar:has(> a.btn) > .topbar__right, .topbar:has(> .topbar__back) > .topbar__right { justify-self: end; }
.topbar:has(> .topbar__back) .memoedit__status { justify-self: center; }

/* 상단바가 있는 화면은 바가 상태표시줄까지 덮도록 (네이티브 앱과 동일).
   body 의 safe-area 패딩을 걷고 바 자체에 얹는다. */
@supports selector(body:has(*)) {
  body:has(> .topbar) { padding-top: 0; }
  body:has(> .topbar) > .topbar { padding-top: calc(11px + env(safe-area-inset-top, 0px)); }
}

.section-hint { color: var(--muted); font-size: 0.9rem; margin: 6px 2px 12px; }

/* ---------------- 카드 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 13px;
}
.card__title { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; color: var(--navy); }

.muted { color: var(--muted); font-size: 0.92rem; }

/* ---------------- 버튼 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  font-family: inherit;
  letter-spacing: -0.01em;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.20);
}
.btn--primary:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); }
.btn--primary:disabled { background: #bcbcbc; box-shadow: none; cursor: default; }
.btn--ghost { background: rgba(255, 255, 255, 0.14); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.24); }
.btn--block { width: 100%; }
.btn--lg { padding: 16px 22px; font-size: 1.1rem; min-height: 58px; border-radius: 14px; }
.btn--sm { padding: 8px 13px; font-size: 0.88rem; border-radius: 9px; }
.btn--icon { padding: 8px; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.btn--icon svg { display: block; }

/* ---------------- 폼 / 입력 ---------------- */
.form { display: block; }
.form__group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-600);
  text-transform: none;
  letter-spacing: 0.02em;
  margin: 26px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form__group-title::before {
  content: "";
  width: 4px; height: 14px;
  background: var(--primary);
  border-radius: 3px;
}
.form__group-title:first-child { margin-top: 0; }

.field { display: block; margin-bottom: 15px; }
.field__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
}
.field__input {
  width: 100%;
  padding: 14px 15px;
  font-size: 1.05rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field__input::placeholder { color: var(--muted-soft); }
.field__input:hover { border-color: #c4c4c4; }
.field__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.field__input--num { text-align: right; font-variant-numeric: tabular-nums; }
.field__textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
.field__select { appearance: none; cursor: pointer; 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 fill='%2371798c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.field__select--sm { padding: 9px 32px 9px 13px; font-size: 0.95rem; width: auto; }

.field-row { display: flex; flex-wrap: wrap; gap: 0 14px; }
.field--half { flex: 1 1 calc(50% - 7px); min-width: 130px; }

.form__error { color: var(--orange-strong); font-size: 0.9rem; min-height: 1.2em; margin: 4px 0 12px; font-weight: 500; }

.inline-field { font-size: 0.86rem; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }

/* 자기평가 1~5 — 감정 tint 세그먼트 + 표정 (컨디션 슬라이더와 한 몸)
   평소엔 차분한 뉴트럴 칩, 표정은 흐릿. 선택된 값만 점수대 감정색 tint로
   채워지고 inset 강조 링 + 스프링 리프트 + 표정이 또렷해지며 살짝 튄다.
   디자인 토큰을 .cond-slider 와 공유: 감정 tint 채움 + inset 1px 강조 링(=.cond-slider__face),
   라벨 앞 5px 강조점(=.cond-slider__word::before), 흰 띠 + 강조색 포커스 링,
   스프링 cubic-bezier(.34,1.56,.64,1), is-bump 식 pop.
   감정 강조색: 1~2 아쉬움/부족=코랄 #e0664a / 3 보통=앰버 #e3a23e / 4~5 좋음/최고=그린 #26a36b
   계약 유지: 버튼 class "score" / 활성 class "score--active" / data-score 속성 그대로.
   점수별 색·표정은 전부 CSS [data-score] 선택자로만 처리 → JS 변경 불필요. */
.score-picker {
  --score-spring: cubic-bezier(.34, 1.56, .64, 1);
  display: flex;
  gap: 8px;
}
.score {
  /* 버튼별 감정 토큰 기본값(보통=앰버), data-score가 덮어씀.
     --s-deep 은 소형 텍스트 AA를 위해 슬라이더보다 한 단계 더 진하게 보정. */
  --s-accent: #e3a23e;
  --s-deep:   #9a6212;                 /* 흰/틴트 바탕 AA 4.5+ (5.08 / 4.65) */
  --s-tint:   rgba(227, 162, 62, 0.14);
  --s-shadow: rgba(227, 162, 62, 0.26);
  flex: 1 1 0;
  min-width: 0;                        /* 5칩이 가로로 꽉 차며 좁아져도 넘치지 않게 */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 11px 2px 9px;
  min-height: 78px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.18s ease,
    background 0.24s var(--score-spring),
    box-shadow 0.24s ease,
    transform 0.24s var(--score-spring);
}
/* 점수대별 감정 색 (슬라이더와 동일 팔레트) — 선택됐을 때만 드러남 */
.score[data-score="1"],
.score[data-score="2"] {
  --s-accent: #e0664a; --s-deep: #c2462b;
  --s-tint: rgba(224, 102, 74, 0.13); --s-shadow: rgba(224, 102, 74, 0.26);
}
.score[data-score="3"] {
  --s-accent: #e3a23e; --s-deep: #9a6212;
  --s-tint: rgba(227, 162, 62, 0.14); --s-shadow: rgba(227, 162, 62, 0.26);
}
.score[data-score="4"],
.score[data-score="5"] {
  --s-accent: #26a36b; --s-deep: #1a7d52;
  --s-tint: rgba(38, 163, 107, 0.13); --s-shadow: rgba(38, 163, 107, 0.26);
}

/* 표정: 의미 전달용 보조(aria-hidden) — 미선택은 흐리게(슬라이더 face 톤) */
.score__face {
  font-size: 1.45rem;
  line-height: 1;
  filter: grayscale(0.55);
  opacity: 0.45;
  transition:
    opacity 0.24s var(--score-spring),
    filter 0.24s ease,
    transform 0.24s var(--score-spring);
}
.score__num {
  font-size: 1.0rem;
  font-weight: 800;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.score__meaning {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: var(--muted-soft);
  letter-spacing: -0.02em;
  white-space: nowrap;                 /* 2글자 라벨 줄바꿈 방지 */
  transition: color 0.2s ease;
}

/* 호버(미선택): 차분한 뉴트럴 강조 + 표정 살짝 살아남 (색은 선택 시 등장) */
.score:hover {
  border-color: var(--line-strong);
  background: var(--bg-soft);
}
.score:hover .score__face { opacity: 0.8; filter: grayscale(0.2); }
.score:hover .score__num { color: var(--navy); }
.score:hover .score__meaning { color: var(--muted); }

/* 키보드 포커스 링 — 흰 띠 + 감정 강조색 (슬라이더 thumb 와 동일 패턴) */
.score:focus-visible {
  outline: none;
  border-color: var(--s-accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--s-accent);
}

/* ── 선택 상태: 점수대 감정 tint 채움 + inset 강조 링 + 스프링 리프트 ──
   (= .cond-slider__face 의 tint + inset 1px 강조링 언어) */
.score--active {
  border-color: var(--s-accent);
  background: var(--s-tint);
  box-shadow:
    inset 0 0 0 1px var(--s-accent),
    0 6px 16px var(--s-shadow),
    0 2px 6px rgba(17, 17, 17, 0.06);
  transform: translateY(-3px);
}
.score--active .score__face {
  opacity: 1;
  filter: none;
  animation: score-pop 0.34s var(--score-spring);   /* 슬라이더 cond-pop 과 동형 */
}
.score--active .score__num { color: var(--s-deep); }      /* 대형 아님이라도 AA(>=4.6) */
/* 소형 라벨은 강조색 대신 navy(틴트 위 17:1)로 — AA 안전 + 충분히 또렷 */
.score--active .score__meaning { color: var(--navy); }
/* 최소 컬러 포인트: 선택 라벨 앞 5px 강조점 (= .cond-slider__word::before) */
.score--active .score__meaning::before {
  content: "";
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--s-accent);
}
@keyframes score-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* 선택 + 포커스: tint 위에 포커스 링 동시 표현 */
.score--active:focus-visible {
  box-shadow:
    inset 0 0 0 1px var(--s-accent),
    0 0 0 2px #fff,
    0 0 0 4px var(--s-accent);
}

/* 모션 최소화 — 스프링/이동/표정 pop 무력화 (슬라이더와 동일 정책) */
@media (prefers-reduced-motion: reduce) {
  .score, .score__face, .score__num, .score__meaning { transition: none !important; }
  .score--active { transform: none; }
  .score--active .score__face { animation: none; }
}

/* Windows 고대비/강제 색 모드 — tint·그림자가 안 보이므로 시스템 색 보강 */
@media (forced-colors: active) {
  .score { forced-color-adjust: none; border: 1px solid ButtonText; background: ButtonFace; }
  .score__num, .score__meaning { color: ButtonText; }
  .score--active { border: 2px solid Highlight; background: ButtonFace; box-shadow: none; transform: none; }
  .score--active .score__num, .score--active .score__meaning { color: Highlight; }
  .score--active .score__meaning::before { background: Highlight; }
  .score:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; box-shadow: none; }
}

/* 체크박스 항목 */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.check-item:hover { border-color: #c4c4c4; background: var(--bg-soft); }
.check-item:has(input:checked) { border-color: var(--green); background: var(--green-bg); }
.check-item input { width: 23px; height: 23px; accent-color: var(--green); flex: none; }
.check-item--big { margin: 10px 0 20px; background: var(--bg-soft); }

/* ---------------- 알림 / notice / toast ---------------- */
.notice { border-radius: var(--radius-sm); padding: 15px 16px; font-size: 0.95rem; margin-bottom: 14px; line-height: 1.5; }
.notice--info { background: var(--blue-bg); color: var(--primary-600); }
.notice--warn { background: var(--orange-bg); color: var(--orange-strong); }
.notice .btn { margin-top: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 24px);
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast::before { content: ""; }
.toast--show { opacity: 1; transform: translate(-50%, 0); }
.toast--success { background: var(--green-strong); }
.toast--success::before { content: "✓"; font-weight: 800; }
.toast--error { background: var(--orange-strong); }
.toast--error::before { content: "!"; font-weight: 800; }

/* ---------------- 로그인 / 스플래시 ---------------- */
.auth-card {
  width: 100%;
  max-width: 410px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 40px 30px 34px;
  text-align: center;
  border: 1px solid var(--line);
}
.auth-card__logo, .splash__logo { width: 66px; height: 66px; margin: 0 auto 16px; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18)); }
.auth-card__title { font-size: 1.7rem; color: var(--navy); margin-bottom: 10px; font-weight: 800; }
.auth-card__subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; line-height: 1.65; }
.auth-card .form { text-align: left; }

/* 모바일(앱): 흰 카드가 연회색 배경에 묻혀 전부 하얗게 보이는 문제 —
 * 카드 장식을 빼고 풀블리드 네이티브 레이아웃으로 전환 */
@media (max-width: 480px) {
  .center-screen {
    background: var(--card);
    align-items: flex-start;
    padding: max(7vh, calc(env(safe-area-inset-top, 0px) + 24px)) 26px 40px;
  }
  .auth-card {
    max-width: none;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
}

.splash { text-align: center; color: var(--navy); }
.splash__title { font-size: 1.9rem; margin-bottom: 8px; font-weight: 800; }
.splash__tagline { color: var(--muted); margin-bottom: 20px; }
.splash__loading { color: var(--muted-soft); font-size: 0.9rem; }

/* ---------------- 학생 홈 상태 카드 ---------------- */
.status-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2a2a 0%, #000000 130%);
  color: #fff;
  border: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}
.status-card::after {
  content: "";
  position: absolute;
  top: -60px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
  pointer-events: none;
}
.status-card__top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; }
.status-card__hello { margin: 0; opacity: 0.82; font-size: 0.88rem; }
.status-card__name { font-size: 1.35rem; margin-top: 2px; font-weight: 800; }
.status-card__dday { text-align: right; background: rgba(255,255,255,0.12); padding: 6px 12px; border-radius: 12px; }
.status-card__dday-label { display: block; font-size: 0.7rem; opacity: 0.85; }
.status-card__dday-value { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.status-card__date { margin: 10px 0 12px; opacity: 0.9; font-size: 0.9rem; position: relative; }
.status-pills { display: flex; gap: 8px; position: relative; }
.pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill::before { content: "○"; font-size: 0.7rem; opacity: 0.8; }
.pill--done { background: var(--green); }
.pill--done::before { content: "✓"; opacity: 1; }

/* 액션 버튼 그리드 */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.action {
  position: relative;
  background: var(--card);
  border: none;
  border-radius: 14px;
  padding: 15px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action:active { transform: translateY(0); }
.action__emoji {
  font-size: 1.2rem;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-100);
  border-radius: 10px;
  margin-bottom: 2px;
}
.action__icon { width: 42px; height: 42px; object-fit: contain; display: block; margin-bottom: 4px; }
/* 목표 아이콘은 크게 + 살짝 위로. 음수 마진으로 레이아웃 높이는 다른 카드와 동일하게 맞춰 제목 정렬 */
#act-weekly-goal .action__icon { width: 52px; height: 52px; margin-top: -6px; margin-bottom: 0; }

/* 풀폭 가로형 액션 카드 (성적 기록하기) */
.action--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.action--wide .action__emoji { margin-bottom: 0; flex: none; }
.action--wide .action__wide-body { display: flex; flex-direction: column; gap: 2px; }
.action__title { font-weight: 700; font-size: 0.98rem; color: var(--navy); }
.action__desc { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.action--highlight {
  border-color: var(--primary);
  box-shadow: var(--ring), var(--shadow-md);
  background: linear-gradient(180deg, #fbfcff, #fff);
}
.action--highlight .action__emoji { background: var(--primary); }
.action--highlight::after {
  content: "지금 할 일";
  position: absolute;
  top: 14px; right: 14px;
  background: var(--orange);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  animation: pulseBadge 1.8s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 142, 60, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 142, 60, 0); }
}

.footer-quote { text-align: center; color: var(--muted-soft); font-size: 0.86rem; margin: 40px 0 32px; line-height: 1.65; }

/* ---------------- 하단 탭바 (홈 · 기록 · 설정) ---------------- */
.has-tabbar { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 7px;
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.tabbar__item svg { width: 23px; height: 23px; }
.tabbar__item.is-active { color: var(--navy); }

/* ---------------- 설정 페이지 ---------------- */
.settings-profile { display: flex; flex-direction: column; gap: 3px; padding: 22px 20px; margin-bottom: 14px; }
.settings-profile__name { font-size: 1.25rem; font-weight: 800; }
.settings-profile__email { color: var(--muted); font-size: 0.88rem; }
.settings-menu { padding: 4px 6px; margin-bottom: 14px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 15px 14px;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row__chevron { color: var(--muted-soft); font-size: 1.1rem; }
.settings-row--danger { color: var(--orange-strong, #d96f1d); }
.settings-menu__hint { color: var(--muted-soft); font-size: 0.78rem; margin: 0; padding: 0 14px 12px; line-height: 1.6; }
.settings-version { text-align: center; color: var(--muted-soft); font-size: 0.8rem; margin: 24px 0; }

/* 대시보드 좌측 달력 레이아웃 */
.container.home-layout { max-width: 980px; }
.home-side { margin-bottom: 14px; }
.home-main > :first-child { margin-top: 0; }
@media (min-width: 768px) {
  .home-layout { display: grid; grid-template-columns: 248px 1fr; gap: 22px; align-items: start; }
  .home-side { margin-bottom: 0; }
  .home-side .calendar { margin-top: 0; }
}

/* 미니멀 달력 (흑백, 오늘=빨간 점) */
.calendar { background: var(--card); border: none; border-radius: var(--radius); padding: 16px 16px 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06); }
.calendar__title { font-size: 0.98rem; font-weight: 800; color: var(--navy); margin-bottom: 12px; text-align: center; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.calendar__dow { font-size: 0.7rem; font-weight: 700; color: var(--muted-soft); padding: 4px 0; }
.calendar__cell { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; font-size: 0.82rem; line-height: 1; color: var(--text); border-radius: 8px; font-variant-numeric: tabular-nums; }
/* 오늘: 숫자 뒤에 작은 빨간 동그라미 (칸을 꽉 채우지 않음) */
.calendar__cell--today { font-weight: 800; color: #fff; z-index: 0; }
.calendar__cell--today::before {
  content: "";
  position: absolute;
  /* 숫자 글리프(잉크)가 줄 박스 위쪽에 그려져 시각적으로 떠 보임 →
     원을 0.8px 위로(아래 inset 1.6px) 올려 숫자 잉크와 동심원이 되게 보정 */
  inset: 0 0 1.6px 0;
  margin: auto;
  width: 24px; height: 24px;
  background: #e02424;
  border-radius: 50%;
  z-index: -1;
}

/* 오늘의 한마디 (인용구 스타일, 박스 없음) */
.daily-quote { text-align: center; max-width: 540px; margin: 8px auto 20px; }
.daily-quote__mark { display: block; font-size: 2.6rem; line-height: 0.7; color: var(--line-strong); font-weight: 800; }
.daily-quote__text { font-size: 1.05rem; font-weight: 700; color: var(--navy); line-height: 1.6; margin: 6px 0 0; }
.daily-quote__author { display: block; margin-top: 10px; font-size: 0.78rem; color: var(--muted-soft); letter-spacing: 0.08em; }
.daily-quote__author::before { content: "-"; }
.daily-quote__author::after { content: "-"; }

/* 상태 카드 안에 들어간 오늘의 한마디 (다크 카드용) */
.daily-quote--in-card {
  position: relative;
  text-align: center;
  max-width: none;
  margin: 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  /* 카드 잔여 공간을 채우고 명언을 위아래 '균등'하게 중앙 배치.
     padding-top을 두면 위쪽 여백만 커져 비대칭이 되므로 제거하고 중앙정렬에 맡김 */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.daily-quote--in-card .daily-quote__mark {
  font-size: 1.6rem;
  line-height: 0.8;
  color: rgba(255, 255, 255, 0.32);
}
.daily-quote--in-card .daily-quote__text {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.55;
  margin: 2px 0 0;
}
.daily-quote--in-card .daily-quote__author {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.6);
}

/* 명언 자리에 들어가는 '오늘 과제 현황' (포커스형: 핵심과제 1개씩 + 서브 아래로) */
.daily-quote--tasks { justify-content: flex-start; touch-action: pan-y; }
.hero-tasks { width: 100%; max-width: 560px; margin: 0 auto; text-align: left; }
.hero-tasks--focus { margin-top: 18px; }   /* '오늘 과제' 위 여백 */
.hero-tasks__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.hero-tasks__label { font-size: 0.82rem; font-weight: 800; color: rgba(255, 255, 255, 0.92); letter-spacing: 0.01em; }
.hero-tasks__count { font-size: 0.82rem; font-weight: 800; color: #e3a23e; font-variant-numeric: tabular-nums; }
.hero-tasks__bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.hero-tasks__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e3a23e, #f0b35e); transition: width 0.28s ease; }
.hero-tasks__subject { flex: none; font-size: 0.7rem; font-weight: 800; color: #ffd9a0; background: rgba(227, 162, 62, 0.18); padding: 2px 8px; border-radius: 999px; }
/* 포커스: 핵심과제 한 개 + 서브과제 목록 */
.hero-focus { margin-top: 14px; overflow: hidden; }   /* 스와이프 슬라이드 클리핑 */
.hero-focus__main { min-width: 0; will-change: transform, opacity; }
.hero-focus__task { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hero-focus__check { flex: none; width: 24px; height: 24px; border: 1.8px solid rgba(255, 255, 255, 0.42); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 900; color: #1b1b1b; transition: background 0.12s ease, border-color 0.12s ease; }
.hero-focus__task.is-done .hero-focus__check { background: #e3a23e; border-color: #e3a23e; }
.hero-focus__title { flex: 1; min-width: 0; font-size: 1.12rem; font-weight: 800; color: #fff; line-height: 1.35; }
.hero-focus__task.is-done .hero-focus__title { color: rgba(255, 255, 255, 0.5); text-decoration: line-through; }
.hero-focus__subs { list-style: none; margin: 11px 0 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.hero-focus__sub { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.hero-focus__subcheck { flex: none; width: 18px; height: 18px; border: 1.5px solid rgba(255, 255, 255, 0.34); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 900; color: #1b1b1b; transition: background 0.12s ease, border-color 0.12s ease; }
.hero-focus__sub.is-done .hero-focus__subcheck { background: #e3a23e; border-color: #e3a23e; }
.hero-focus__subtext { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 500; color: rgba(255, 255, 255, 0.86); }
.hero-focus__sub.is-done .hero-focus__subtext { color: rgba(255, 255, 255, 0.45); text-decoration: line-through; }
.hero-focus__dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
.hero-focus__dot { width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.28); cursor: pointer; transition: width 0.18s ease, background 0.18s ease, border-radius 0.18s ease; }
.hero-focus__dot.is-active { width: 20px; border-radius: 4px; background: #e3a23e; }

/* ---------------- 달성률 표시 ---------------- */
.rate-display { text-align: center; padding: 20px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 20px 0; }
.rate-display__label { display: block; font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.rate-display__value { display: block; font-size: 2.6rem; font-weight: 800; color: var(--navy); margin: 6px 0; font-variant-numeric: tabular-nums; line-height: 1; }
.rate-display__sub { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.rate-bar { height: 12px; background: #e3e8f1; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.rate-bar__fill { height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }

.rate-good { color: var(--green-strong); }
.rate-mid { color: var(--primary); }
.rate-low { color: var(--orange-strong); }
.rate-bar__fill.rate-good { background: linear-gradient(90deg, #2aa56e, #34c184); }
.rate-bar__fill.rate-mid { background: linear-gradient(90deg, #3a3a3a, #5e5e5e); }
.rate-bar__fill.rate-low { background: linear-gradient(90deg, #ef8e3c, #f0a85f); }

/* ---------------- 통계 / 차트 (간이) ---------------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { text-align: center; }
.stat__label { display: block; font-size: 0.84rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.stat__value { font-size: 2rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }

.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 48px 1fr 50px; align-items: center; gap: 12px; }
.bar-row__label { font-size: 0.9rem; font-weight: 600; }
.bar-row__track { height: 10px; background: #e3e8f1; border-radius: 999px; overflow: hidden; }
.bar-row__fill { height: 100%; background: linear-gradient(90deg, #3a3a3a, #5e5e5e); border-radius: 999px; transition: width 0.45s ease; }
.bar-row__value { font-size: 0.85rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.rank-list__item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--bg-soft); border-radius: var(--radius-sm); }
.rank-list__rank { width: 27px; height: 27px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; border-radius: 50%; font-size: 0.85rem; font-weight: 700; }
.rank-list__item:first-child .rank-list__rank { background: var(--orange); }
.rank-list__name { flex: 1; font-size: 0.95rem; }
.rank-list__count { font-size: 0.85rem; color: var(--orange-strong); font-weight: 700; }

.goal-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.goal-list li { font-size: 0.92rem; padding: 10px 12px; background: var(--bg-soft); border-radius: 10px; }

.kv { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv__key { flex: none; width: 110px; color: var(--muted); font-size: 0.9rem; }
.kv__val { flex: 1; font-size: 0.95rem; }

.review-week { font-size: 0.9rem; color: var(--primary-600); font-weight: 700; margin: 0 0 12px; }

/* ---------------- 관리자 대시보드 ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi { text-align: center; padding: 20px 14px; margin-bottom: 0; transition: transform 0.12s ease, box-shadow 0.18s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi__label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.kpi__value { font-size: 2rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi--warn { background: var(--orange-bg); border-color: #f6dcc1; }
.kpi--warn .kpi__value { color: var(--orange-strong); }
.kpi--alert { background: #fcebda; border-color: #f4cda7; }
.kpi--alert .kpi__value { color: var(--orange-strong); }

.board-title { font-size: 1.2rem; color: var(--navy); margin: 30px 0 4px; font-weight: 800; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }

.list-card { margin-bottom: 0; }
.list-card__title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.badge { background: var(--navy); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 0.76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge--warn { background: var(--orange); }
.badge--alert { background: var(--orange-strong); }

.student-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.student-list__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.student-list__link:hover { background: #fff; border-color: var(--line-strong); transform: translateX(2px); box-shadow: var(--shadow-xs); }
.student-list__name { font-weight: 600; font-size: 0.96rem; }
.student-list__seat { font-size: 0.78rem; color: var(--muted); background: #fff; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line); }
.student-list__extra { margin-left: auto; font-size: 0.86rem; font-weight: 700; color: var(--orange-strong); font-variant-numeric: tabular-nums; }
.student-list__empty { padding: 18px; text-align: center; color: var(--muted-soft); font-size: 0.9rem; }

.state-badge { font-size: 0.72rem; font-weight: 700; padding: 4px 9px; border-radius: 7px; white-space: nowrap; }
.state-badge--on { background: var(--green-bg); color: var(--green-strong); }
.state-badge--off { background: #eef0f5; color: #a3abbb; }
.student-list__link .state-badge:nth-of-type(1) { margin-left: auto; }

/* ---------------- 학생 상세 ---------------- */
.profile-card__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-card__name { font-size: 1.55rem; color: var(--navy); font-weight: 800; }
.profile-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

.tag { display: inline-block; font-size: 0.76rem; font-weight: 700; padding: 4px 10px; border-radius: 7px; background: var(--bg-soft); color: var(--muted); margin-right: 4px; }
.tag--alert { background: var(--orange-bg); color: var(--orange-strong); }
.tag--blue { background: var(--blue-bg); color: var(--primary-600); }

.intervention-form { padding: 18px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 20px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.timeline__item { display: flex; gap: 14px; border-left: 2px solid var(--line-strong); padding: 10px 0 10px 16px; position: relative; }
.timeline__item::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; border: 2px solid #fff; }
.timeline__date { flex: none; width: 96px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.timeline__body { flex: 1; }
.timeline__note { margin: 7px 0 0; font-size: 0.92rem; line-height: 1.55; }
.timeline__followup { margin: 7px 0 0; font-size: 0.82rem; color: var(--orange-strong); font-weight: 600; }

/* ============================================================
   체크인 업그레이드 전용 컴포넌트
   ============================================================ */
.field__input--mt { margin-top: 10px; }

/* 어제 이월 과제 배너 */
.carryover {
  display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap;
  padding: 15px 16px;
  background: var(--orange-bg);
  border: 1px solid #f4cda7;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.carryover__body { flex: 1; min-width: 170px; }
.carryover__label { display: block; font-size: 0.74rem; font-weight: 700; color: var(--orange-strong); letter-spacing: 0.02em; }
.carryover__task { display: block; font-size: 0.98rem; font-weight: 600; color: var(--text); margin-top: 3px; }

/* (1) 총 목표 시간 = 고정 표시 (탭하여 수정) */
.goal-target { text-align: center; background: linear-gradient(135deg, #2a2a2a 0%, #000000 130%); color: #fff; border-radius: var(--radius); padding: 22px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.goal-target__label { display: block; font-size: 0.85rem; opacity: 0.85; margin-bottom: 6px; }
.goal-target__edit { display: inline-flex; align-items: baseline; gap: 7px; }
.goal-target__input { width: 100px; border: none; background: transparent; color: #fff; font-size: 2.6rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 2px dashed rgba(255, 255, 255, 0.45); padding: 0 4px 2px; font-family: inherit; }
.goal-target__input:focus { outline: none; border-bottom-color: #fff; }
.goal-target__input::-webkit-outer-spin-button,
.goal-target__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.goal-target__input { -moz-appearance: textfield; }
.goal-target__unit { font-size: 1.3rem; font-weight: 700; }
.goal-target__hint { display: block; font-size: 0.74rem; opacity: 0.75; margin-top: 9px; }

/* (5) 빠른 배분 프리셋 */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preset { flex: 1 1 auto; padding: 11px 12px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 0.88rem; font-weight: 700; color: var(--primary); cursor: pointer; transition: all 0.14s ease; font-family: inherit; white-space: nowrap; }
.preset:hover { border-color: var(--primary); background: var(--primary-100); }
.preset--active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.preset:disabled { opacity: 0.45; cursor: default; color: var(--muted-soft); }
.preset:disabled:hover { border-color: var(--line-strong); background: #fff; }

/* (2)(4) 과목별 배분 행 — 핵심: 과목명 + 시간. 막대는 보조(비조작) */
.alloc-list { display: flex; flex-direction: column; gap: 16px; }
.alloc-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head stepper" "bar stepper"; align-items: center; column-gap: 16px; row-gap: 9px; }
.alloc-row__head { grid-area: head; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.alloc-row__label { font-size: 1.02rem; font-weight: 700; color: var(--navy); }
.alloc-row__time { font-size: 1.08rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.alloc-row__time--zero { color: var(--muted-soft); font-weight: 600; }
.alloc-row__bar { grid-area: bar; height: 6px; background: #eaedf4; border-radius: 999px; overflow: hidden; }
.alloc-row__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #bdbdbd, #9e9e9e); border-radius: 999px; transition: width 0.3s ease; }
.alloc-stepper { grid-area: stepper; display: flex; gap: 8px; }
.alloc-btn { width: 48px; height: 48px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--primary); font-size: 1.5rem; font-weight: 700; line-height: 1; cursor: pointer; transition: all 0.12s ease; font-family: inherit; }
.alloc-btn:hover { border-color: var(--primary); background: var(--primary-100); }
.alloc-btn:active { background: #e4e4e4; }

/* (3)(6) 현재 배분 / 목표 상태 */
.alloc-status { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 0.92rem; }
.alloc-status__main { color: var(--text); font-weight: 600; }
.alloc-status__main b { font-weight: 800; }
.alloc-status__msg { font-weight: 700; font-size: 0.9rem; }
.alloc-status--ok { background: var(--green-bg); border-color: #bfe6cf; }
.alloc-status--ok .alloc-status__msg { color: var(--green-strong); }
.alloc-status--warn { background: var(--orange-bg); border-color: #f4cda7; }
.alloc-status--warn .alloc-status__msg { color: var(--orange-strong); }

/* 위험 요소 칩 */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 11px 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 0.92rem; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.14s ease;
  font-family: inherit;
}
@media (hover: hover) { .chip:not(.chip--active):hover { border-color: var(--primary); color: var(--primary); } }
.chip--active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }

/* 컨디션 메시지 */
.condition-msg { margin: 12px 0 0; font-size: 0.9rem; color: var(--muted); line-height: 1.55; }
.condition-msg--warn { background: var(--orange-bg); color: var(--orange-strong); padding: 13px 15px; border-radius: var(--radius-sm); font-weight: 600; }

/* 오늘 계획 요약 카드 */
.plan-summary { margin-top: 28px; padding: 18px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.plan-summary__title { font-size: 0.98rem; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.plan-summary__row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.plan-summary__row:last-child { border-bottom: none; }
.plan-summary__label { color: var(--muted); flex: none; }
.plan-summary__value { font-weight: 600; text-align: right; }
.plan-summary__value.is-warn { color: var(--orange-strong); }
.plan-summary__value.is-ok { color: var(--green-strong); }

/* 계획 품질 점수 */
.quality { margin-top: 16px; margin-bottom: 22px; padding: 20px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-xs); }
.quality__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.quality__title { font-size: 0.98rem; font-weight: 700; color: var(--navy); }
.quality__score { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.quality__score small { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.quality__bar { height: 10px; background: #e3e8f1; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.quality__bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.4s ease; }
.quality__grade { margin: 0 0 14px; font-size: 0.9rem; font-weight: 700; }
.quality__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.quality__item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.quality__check { width: 22px; height: 22px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; }
.quality__item--on .quality__check { background: var(--green-bg); color: var(--green-strong); }
.quality__item--off .quality__check { background: #eef0f5; color: var(--muted-soft); }
.quality__item--off { color: var(--muted); }
.quality__pts { margin-left: auto; font-size: 0.82rem; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================
   학생 홈: 오늘의 흐름(플랜→성과) / 다음 블록 / 결과 스트립 / 타임박스
   ============================================================ */

/* 상단 상태카드 - 다음 타임블록 */
.next-block {
  position: relative;
  margin-top: 12px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.next-block b { font-weight: 800; }

/* 상단 상태카드 - 체크아웃 후 결과 요약 */
.result-strip { position: relative; margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.result-strip__item { background: rgba(255, 255, 255, 0.13); border-radius: 13px; padding: 11px 8px; text-align: center; }
.result-strip__label { display: block; font-size: 0.7rem; opacity: 0.85; margin-bottom: 5px; }
.result-strip__value { font-size: 1.18rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* 오늘의 흐름 (STEP1 → STEP2) */
.flow { margin-bottom: 14px; }
.flow__steps { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px; }
.flow-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  background: var(--card);
  border: none;
  border-radius: 14px;
  padding: 16px 16px 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.flow-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.flow-card__badge { align-self: flex-start; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); background: var(--bg-soft); padding: 3px 9px; border-radius: 999px; }
.flow-card__tag { align-self: center; display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 800; padding: 4px 11px; border-radius: 999px; }
.flow-card__tag--am { color: #b25e00; background: #fff1df; }
.flow-card__tag--pm { color: #3f4a86; background: #ebeefb; }
.flow-card__title { font-size: 1.12rem; font-weight: 800; color: var(--navy); }
.flow-card__desc { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.flow-card__meta { font-size: 0.84rem; font-weight: 700; color: var(--muted-soft); }
.flow-card__meta--done { color: var(--primary); }

/* (9) 가장 중요한 카드: 오늘 플랜 입력 강조 */
.flow-card--primary { border-color: #d6d6d6; background: linear-gradient(180deg, #fbfcff, #fff); box-shadow: var(--shadow); }
.flow-card--primary .flow-card__badge { background: var(--primary); color: #fff; }
.flow-card--primary .flow-card__title { font-size: 1.1rem; }

/* 보조 메뉴 그리드 (3열) */
.action-grid--secondary { grid-template-columns: repeat(3, 1fr); }

/* "지금 할 일" 강조 (flow-card / action 공통) */
.is-next { box-shadow: 0 0 0 3.5px rgba(239, 142, 60, 0.95), var(--shadow-md) !important; }
.is-next::after {
  content: "지금 할 일";
  position: absolute;
  top: 14px; right: 14px;
  background: var(--orange);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  animation: pulseBadge 1.8s ease-in-out infinite;
}

/* 타임박스 입력 (checkin) */
.field-help { font-size: 0.84rem; color: var(--muted); margin: -4px 0 12px; }
.tb-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

/* 블록 카드 */
.tb-card { border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 13px 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.tb-card:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.tb-card__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-time { padding: 10px 12px; font-size: 1rem; font-weight: 600; border: 1.5px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--text); font-family: inherit; font-variant-numeric: tabular-nums; }
.tb-time:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.tb-arrow { color: var(--muted-soft); font-weight: 700; }
.tb-dur { margin-left: auto; font-size: 0.86rem; font-weight: 700; color: var(--primary); background: var(--primary-100); padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.tb-dur--warn { color: var(--orange-strong); background: var(--orange-bg); }
.tb-del { width: 38px; height: 38px; flex: none; border: none; background: var(--orange-bg); color: var(--orange-strong); border-radius: 9px; font-size: 0.95rem; font-weight: 800; cursor: pointer; transition: background 0.14s ease; }
.tb-del:hover { background: #f8e0c8; }
.tb-label { font-size: 0.98rem; }

.btn--outline { background: #fff; border: 1.5px dashed var(--line-strong); color: var(--primary); font-weight: 700; }
.btn--outline:hover { border-color: var(--primary); background: var(--bg-soft); }

/* 하루 타임라인 시각화 */
.tb-timeline { margin-top: 14px; }
.tb-tl-track { position: relative; height: 34px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.tb-seg { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; display: flex; align-items: center; padding: 0 7px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0,0.18); }
.tb-seg span { font-size: 0.7rem; font-weight: 700; color: #fff; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.tb-tl-scale { display: flex; justify-content: space-between; margin-top: 5px; font-size: 0.72rem; color: var(--muted-soft); font-weight: 600; }

/* 타임박스 합계 요약 */
.tb-summary { margin-top: 10px; text-align: center; font-size: 0.9rem; font-weight: 700; color: var(--navy); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px; }

/* ============================================================
   체크인 v2 — 3단계 wizard
   ============================================================ */
.wizard { padding-bottom: 8px; }
.wizard__progress { display: flex; gap: 8px; margin: 6px 0 18px; }
.wstep { flex: 1; height: 6px; border-radius: 999px; background: var(--line-strong); transition: background 0.2s ease; }
.wstep.is-active { background: var(--primary); }
.wstep.is-done { background: var(--green); }

.edit-note { background: var(--blue-bg); color: var(--primary-600); font-size: 0.88rem; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }

.wpanel.card { margin-bottom: 14px; }
.wpanel__q { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 8px; line-height: 1.3; }
.wpanel__sub { color: var(--muted); font-size: 0.95rem; margin: 0 0 22px; }

/* Step 1 - 시간 선택 */
.hour-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.hour-opt { position: relative; padding: 24px 12px; font-size: 1.3rem; font-weight: 800; border: 2px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--navy); cursor: pointer; transition: all 0.14s ease; font-family: inherit; }
.hour-opt:hover { border-color: var(--primary); }
.hour-opt--active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.20); }
.hour-opt--custom { color: var(--primary); font-size: 1.05rem; }
.hour-opt--rec::after { content: "추천"; position: absolute; top: 8px; right: 8px; background: var(--green); color: #fff; font-size: 0.64rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.hour-opt--active.hour-opt--rec::after { background: #fff; color: var(--green-strong); }

.hour-custom { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.hour-custom .field__input { font-size: 1.4rem; text-align: center; font-weight: 700; }
.hour-custom__unit { font-size: 1.1rem; font-weight: 700; color: var(--muted); }

.hint-row { text-align: center; color: var(--muted); font-size: 0.9rem; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; }
.hint-row b { color: var(--navy); }

.link-btn { display: inline-block; background: none; border: none; color: var(--primary); font-size: 0.9rem; font-weight: 700; cursor: pointer; padding: 6px 2px; font-family: inherit; }
.adv-alloc { margin-top: 12px; padding: 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* Step 2 - 핵심 과제 */
.carryover--sm { padding: 12px 14px; margin-bottom: 16px; }
.task-card { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.task-card:last-child { border-bottom: none; }
.task-card__no { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.task-card__row { display: grid; grid-template-columns: 112px 1fr; gap: 10px; }

/* 체크아웃 - 과제 완료 3단계 (완료/일부/미완료) */
.task-status-list { display: flex; flex-direction: column; gap: 16px; }
.task-status { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.task-status:last-child { border-bottom: none; }
.task-status__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.task-status__subject { font-size: 0.78rem; font-weight: 700; color: var(--primary); background: var(--primary-100); padding: 3px 9px; border-radius: 999px; }
.task-status__block { font-size: 0.74rem; font-weight: 700; color: var(--muted); background: var(--bg-soft); padding: 3px 9px; border-radius: 999px; }
.task-status__text { font-size: 1rem; font-weight: 600; }
.seg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.seg3-btn { padding: 13px 6px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 0.9rem; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit; transition: all 0.12s ease; }
.seg3-btn:hover { border-color: var(--primary); }
.seg3-btn--done.seg3-btn--active { background: var(--green); border-color: var(--green); color: #fff; }
.seg3-btn--partial.seg3-btn--active { background: var(--orange); border-color: var(--orange); color: #fff; }
.seg3-btn--missed.seg3-btn--active { background: #aeb6c4; border-color: #aeb6c4; color: #fff; }

/* 가변 핵심 과제 행 (과목 입력 없음) */
.task-row { padding: 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); margin-bottom: 12px; background: #fff; }
.task-row__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.task-row__lead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.task-row__grip { flex: none; cursor: grab; color: var(--muted-soft); font-size: 1.05rem; line-height: 1; padding: 2px; border-radius: 6px; letter-spacing: -1px; touch-action: none; user-select: none; transition: color 0.12s ease; }
.task-row__grip:hover { color: var(--muted); }
.task-row__grip:active { cursor: grabbing; }
.task-row--dragging { position: relative; z-index: 6; box-shadow: 0 14px 30px rgba(20, 28, 45, 0.18); }
body.is-reordering { cursor: grabbing; }
body.is-reordering, body.is-reordering * { user-select: none !important; }
.task-row__no { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.task-row__del { border: none; background: var(--bg-soft); color: var(--muted-soft); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 800; transition: all 0.12s ease; }
.task-row__del:hover { background: var(--orange-bg); color: var(--orange-strong); }
.task-row--carryover { border-color: #f4cda7; background: var(--orange-bg); }
.task-row__tag { display: inline-block; font-size: 0.68rem; font-weight: 700; color: #fff; background: var(--orange); padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.task-row__actions { display: flex; align-items: center; gap: 6px; }
.task-row__add-sub {
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--primary);
  height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  font-size: 0.76rem; font-weight: 800; white-space: nowrap; transition: all 0.12s ease;
}
.task-row__add-sub:hover { border-color: var(--primary); background: var(--bg-soft); }
/* 과목 선택 + 과제 입력 한 줄 */
.task-row__main { display: flex; align-items: center; gap: 8px; }
.task-subject { flex: none; min-width: 80px; max-width: 46%; }
.task-row__main .task-text { flex: 1; min-width: 0; }
/* 서브 과제 */
.task-subs { display: flex; flex-direction: column; gap: 6px; }
.task-subs:not(:empty) { margin-top: 8px; }
.task-sub { display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.task-sub__bullet { color: var(--muted-soft); font-size: 0.95rem; flex: none; }
.task-sub__text { flex: 1; min-width: 0; padding-top: 9px; padding-bottom: 9px; font-size: 0.92rem; }
.task-sub__del { border: none; background: var(--bg-soft); color: var(--muted-soft); width: 28px; height: 28px; flex: none; border-radius: 7px; cursor: pointer; font-size: 0.78rem; font-weight: 800; transition: all 0.12s ease; }
.task-sub__del:hover { background: var(--orange-bg); color: var(--orange-strong); }
#add-task { margin-top: 8px; }

/* 체크아웃 — 핵심 과제 아래 서브 과제 목록(읽기 전용) */
.task-status__subs { margin: 0 0 10px; padding-left: 18px; list-style: disc; }
.task-status__subs li { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

/* 컨디션 1~10 슬라이더 — iOS/visionOS 미니멀 + 동적 fill + 정밀 눈금 + 값 pop
   값 구간 강조색: 1~4 낮음=코랄 #e0664a / 5~6 보통=앰버 / 7~10 좋음=그린 #26a36b
   --cond-pct : setConditionUI가 thumb 폭을 보정해 갱신(fill 끝이 thumb 중심에 정렬) */
.cond-slider {
  --cond-accent: #e3a23e;          /* 강조색(트랙 fill·링·눈금·점) */
  --cond-deep:   #b87d1e;          /* 숫자/단어용 진한 톤(대형 텍스트 AA 확보) */
  --cond-tint:   rgba(227, 162, 62, 0.14);
  --cond-pct:    55.55%;
  --cond-track:  #e7e7ea;          /* 미채움 트랙(모노크롬 뉴트럴) */
  --cond-thumb:  28px;
  --cond-cream:  rgba(196, 173, 140, 0.18); /* 타이머 위젯과 톤 연결용 따뜻한 한 방울 */
  --cond-spring: cubic-bezier(.34, 1.56, .64, 1);
  padding: 4px 2px 0;
}
.cond-slider[data-level="low"]  { --cond-accent: #e0664a; --cond-deep: #c2462b; --cond-tint: rgba(224, 102, 74, 0.13); }
.cond-slider[data-level="mid"]  { --cond-accent: #e3a23e; --cond-deep: #b87d1e; --cond-tint: rgba(227, 162, 62, 0.14); }
.cond-slider[data-level="high"] { --cond-accent: #26a36b; --cond-deep: #1f8d5d; --cond-tint: rgba(38, 163, 107, 0.13); }

/* ── 리드아웃: 정밀 타이포 위계 ─────────────────────────── */
.cond-slider__readout {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; padding: 0 2px;
}
.cond-slider__face {
  flex: none;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1;
  background: var(--cond-tint);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--cond-accent);
  transition: background 0.32s var(--cond-spring), box-shadow 0.32s var(--cond-spring);
  transform-origin: center;
}
.cond-slider__readtext {
  display: flex; flex-direction: column; align-items: flex-start;
  line-height: 1; gap: 6px;
}
.cond-slider__valrow { display: flex; align-items: baseline; gap: 5px; }
.cond-slider__val {
  font-size: 2.9rem; font-weight: 800; color: var(--cond-deep);
  font-variant-numeric: tabular-nums; line-height: 0.9; letter-spacing: -0.04em;
  min-width: 1.4ch;            /* 한 자리/두 자리 전환 시 흔들림 방지 */
  transition: color 0.32s var(--cond-spring);
  transform-origin: left center;
}
.cond-slider__unit {
  font-size: 0.92rem; font-weight: 700; color: var(--muted-soft);
  letter-spacing: -0.01em;
}
.cond-slider__word {
  font-size: 0.92rem; font-weight: 700; color: var(--navy);
  letter-spacing: -0.01em;
  transition: color 0.32s var(--cond-spring);
}
.cond-slider__word::before {
  content: ""; display: inline-block;
  width: 5px; height: 5px; margin-right: 7px; vertical-align: middle;
  border-radius: 50%; background: var(--cond-accent);
  transition: background 0.32s var(--cond-spring);
}

/* 값 변경 시 숫자/페이스 살짝 튀어오름 (JS가 is-bump 토글) */
.cond-slider.is-bump .cond-slider__val  { animation: cond-pop 0.34s var(--cond-spring); }
.cond-slider.is-bump .cond-slider__face { animation: cond-pop 0.34s var(--cond-spring); }
@keyframes cond-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ── 트랙: 얇고 깔끔 + 동적 fill ─────────────────────────── */
.cond-slider__track { position: relative; padding: 10px 0 4px; }
.cond-range {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: var(--cond-thumb);
  margin: 0; padding: 0; background: transparent;
  outline: none; cursor: pointer;
}
/* WebKit 트랙 + fill (thumb 폭 보정된 --cond-pct까지 채움) */
.cond-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background:
    linear-gradient(var(--cond-accent), var(--cond-accent)) no-repeat,
    var(--cond-track);
  background-size: var(--cond-pct) 100%;
  transition: background-size 0.28s var(--cond-spring);
}
.cond-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--cond-thumb); height: var(--cond-thumb);
  margin-top: -11px;            /* (6 - 28) / 2 */
  border-radius: 50%; border: none;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(17, 17, 17, 0.06),
    0 0 0 1px var(--cond-cream),     /* 타이머 톤과 연결되는 따뜻한 한 겹 */
    0 0 0 4px var(--cond-tint),
    0 2px 6px rgba(17, 17, 17, 0.16),
    0 4px 14px rgba(17, 17, 17, 0.10);
  cursor: grab;
  transition: transform 0.24s var(--cond-spring), box-shadow 0.24s ease;
}
/* Firefox 트랙 + progress(자동 thumb 정렬) + thumb */
.cond-range::-moz-range-track {
  height: 6px; border-radius: 999px; background: var(--cond-track);
}
.cond-range::-moz-range-progress {
  height: 6px; border-radius: 999px; background: var(--cond-accent);
  transition: background 0.32s var(--cond-spring);
}
.cond-range::-moz-range-thumb {
  width: var(--cond-thumb); height: var(--cond-thumb);
  border-radius: 50%; border: none; background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(17, 17, 17, 0.06),
    0 0 0 1px var(--cond-cream),
    0 0 0 4px var(--cond-tint),
    0 2px 6px rgba(17, 17, 17, 0.16),
    0 4px 14px rgba(17, 17, 17, 0.10);
  cursor: grab;
  transition: transform 0.24s var(--cond-spring), box-shadow 0.24s ease;
}

/* 상호작용: 미세 스프링 */
.cond-range:hover::-webkit-slider-thumb { transform: scale(1.06); }
.cond-range:active::-webkit-slider-thumb { transform: scale(1.14); cursor: grabbing; box-shadow: inset 0 0 0 1px rgba(17,17,17,0.06), 0 0 0 1px var(--cond-cream), 0 0 0 6px var(--cond-tint), 0 4px 14px rgba(17,17,17,0.18); }
.cond-range:hover::-moz-range-thumb { transform: scale(1.06); }
.cond-range:active::-moz-range-thumb { transform: scale(1.14); cursor: grabbing; box-shadow: inset 0 0 0 1px rgba(17,17,17,0.06), 0 0 0 1px var(--cond-cream), 0 0 0 6px var(--cond-tint), 0 4px 14px rgba(17,17,17,0.18); }

/* 키보드 포커스 링 (focus-visible 에서만, 흰 띠 + 강조색) */
.cond-range:focus-visible::-webkit-slider-thumb {
  box-shadow: inset 0 0 0 1px rgba(17,17,17,0.06), 0 0 0 4px #fff, 0 0 0 6px var(--cond-accent), 0 4px 14px rgba(17,17,17,0.14);
}
.cond-range:focus-visible::-moz-range-thumb {
  box-shadow: inset 0 0 0 1px rgba(17,17,17,0.06), 0 0 0 4px #fff, 0 0 0 6px var(--cond-accent), 0 4px 14px rgba(17,17,17,0.14);
}

/* ── 1~10 정밀 눈금 ─────────────────────────────────────── */
.cond-slider__ticks {
  display: grid; grid-template-columns: repeat(10, 1fr);
  margin: 2px 13px 0;           /* thumb 반지름만큼 안쪽 정렬 */
  pointer-events: none;
}
.cond-slider__ticks span {
  width: 2px; height: 5px; justify-self: center; border-radius: 1px;
  background: var(--line-strong);
  transition: background 0.28s ease, height 0.28s var(--cond-spring);
}
.cond-slider__ticks span.is-on  { background: var(--cond-accent); }
.cond-slider__ticks span.is-cur { height: 9px; background: var(--cond-accent); }

.cond-slider__scale {
  display: flex; justify-content: space-between;
  font-size: 0.74rem; color: var(--muted); font-weight: 700;
  margin: 9px 4px 0; letter-spacing: 0.01em;
}

/* Windows 고대비/강제 색 모드 — box-shadow만으로는 안 보이므로 시스템 색 보강 */
@media (forced-colors: active) {
  .cond-range::-webkit-slider-runnable-track,
  .cond-range::-moz-range-track { forced-color-adjust: none; background: Canvas; border: 1px solid CanvasText; }
  .cond-range::-moz-range-progress { background: Highlight; }
  .cond-range::-webkit-slider-thumb,
  .cond-range::-moz-range-thumb { border: 1px solid CanvasText; background: ButtonFace; }
  .cond-range:focus-visible::-webkit-slider-thumb,
  .cond-range:focus-visible::-moz-range-thumb { outline: 2px solid Highlight; outline-offset: 2px; }
  .cond-slider__ticks span.is-on,
  .cond-slider__ticks span.is-cur { background: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  .cond-slider *,
  .cond-range::-webkit-slider-runnable-track,
  .cond-range::-webkit-slider-thumb,
  .cond-range::-moz-range-progress,
  .cond-range::-moz-range-thumb { transition: none !important; }
  .cond-slider.is-bump .cond-slider__val,
  .cond-slider.is-bump .cond-slider__face { animation: none !important; }
}
.field-hint-inline { font-size: 0.78rem; font-weight: 600; color: var(--muted-soft); margin-left: 4px; }

/* 과제별 시간 블록 선택 (오전/점심직후/오후/저녁) */
.block-chips { display: flex; gap: 6px; margin-top: 10px; }
.block-chip { flex: 1; padding: 9px 4px; border: 1.5px solid var(--line-strong); border-radius: 9px; background: #fff; font-size: 0.82rem; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; transition: all 0.12s ease; }
@media (hover: hover) { .block-chip:not(.block-chip--active):hover { border-color: var(--primary); color: var(--primary); } }
.block-chip--active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Step 3 - 컨디션 3단계 */
.cond3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 8px; }
.cond3-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; font-size: 1.7rem; border: 2px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--navy); cursor: pointer; font-family: inherit; transition: all 0.14s ease; }
.cond3-btn span { font-size: 0.9rem; font-weight: 700; }
.cond3-btn:hover { border-color: var(--primary); }
.cond3-btn--active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.20); }
.cond-low-notice { margin-top: 14px; background: var(--orange-bg); color: var(--orange-strong); padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.92rem; font-weight: 600; line-height: 1.5; }

/* 하단 고정 네비 */
.wnav { position: sticky; bottom: 0; display: flex; gap: 12px; padding: 16px 0 12px; margin-top: 26px; background: linear-gradient(to top, var(--bg) 78%, rgba(238, 241, 247, 0)); }
#nav-next { flex: 1; }
#nav-prev { flex: 0 0 auto; min-width: 96px; }

/* 완료 화면 */
.wdone { text-align: center; padding-top: 8px; }
.wdone__check { width: 64px; height: 64px; margin: 12px auto 16px; border-radius: 50%; background: var(--green-bg); color: var(--green-strong); font-size: 2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.wdone__title { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin-bottom: 20px; }
.wdone__summary { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; box-shadow: var(--shadow-xs); margin-bottom: 14px; }
.wdone__row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 0.98rem; }
.wdone__row:last-child { border-bottom: none; }
.wdone__row span { color: var(--muted); }
.wdone__row b { color: var(--navy); font-weight: 700; }
.wdone__advice { background: var(--blue-bg); color: var(--primary-600); padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; line-height: 1.55; margin-bottom: 18px; text-align: left; }
.wdone__tt { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.wdone__tt-q { font-size: 1.02rem; font-weight: 700; color: var(--navy); margin: 0 0 14px; }
.wdone__tt-btns { display: flex; gap: 10px; }
.wdone__tt-btns .btn { flex: 1; }
.wdone__note { color: var(--muted); font-size: 0.9rem; margin: 4px 0 16px; }
.tt-preview { margin-top: 16px; }
.tt-prev-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.tt-prev { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; text-align: left; }
.tt-prev__slot { font-weight: 800; color: var(--primary); font-size: 0.85rem; min-width: 36px; }
.tt-prev__time { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 90px; }
.tt-prev__label { font-weight: 600; flex: 1; }
.tt-editor { margin-top: 16px; text-align: left; }
.btn--ghost-dark { background: #fff; border: 1.5px solid var(--line-strong); color: var(--navy); }
.btn--ghost-dark:hover { border-color: var(--primary); color: var(--primary); }

/* ---------------- 반응형 ---------------- */
@media (max-width: 480px) {
  .action-grid { grid-template-columns: 1fr; }
  .action-grid--secondary { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .profile-card__grid { grid-template-columns: 1fr; }
  .status-card__name { font-size: 1.45rem; }
  .container { padding: 18px 14px 0; }
  .flow__steps { grid-template-columns: 1fr; }
  .result-strip { grid-template-columns: 1fr 1fr; }
  .alloc-btn { width: 44px; height: 44px; }
  .preset { flex: 1 1 calc(50% - 4px); }
}

/* ============================================================
   태블릿 버전 — 전체적으로 더 크고 여유있게 (학원 태블릿 기준)
   ============================================================ */
/* 태블릿: 단일 컬럼(가운데 정렬), 양쪽으로 꽉 채우지 않음 */
@media (min-width: 768px) {
  .container { max-width: 720px; }
  .container--tablet2 { max-width: 720px; }
}

/* ============================================================
   대시보드 위젯 (아이폰식 커스터마이징: 롱프레스 흔들림/삭제/추가)
   ============================================================ */
.widget { position: relative; }
.dash--edit { user-select: none; -webkit-user-select: none; }

/* 메인카드 검정 박스 높이를 달력(2×2 = 2*122 + 12 gap = 256px)과 맞춤 */
.widget--core .status-card { min-height: 256px; box-sizing: border-box; display: flex; flex-direction: column; }

/* 전역 자유 배치 캔버스 — 칸 크기 고정(달력=2×2=원본 크기), 열 수는 JS가 폭에 맞춰 설정 */
.widget-canvas {
  display: grid;
  grid-template-columns: repeat(2, 118px);
  grid-auto-rows: 122px;
  gap: 12px;
  justify-content: center;
  -webkit-touch-callout: none;
  /* JS(renderCanvas)가 격자 배치를 끝내기 전 좁은 기본 격자가 노출돼
     메인카드가 뭉개져 보이는 FOUC 방지 — dash-ready 부여 시 표시 */
  opacity: 0;
}
.dash-ready .widget-canvas { opacity: 1; transition: opacity 0.18s ease; }
/* 넓은 컨테이너 (메인카드 좌우로 위젯 들어갈 공간)
   1760px → 캔버스 ≈ 1724px → 13열(왼쪽 4 + 코어 5 + 오른쪽 4):
   기존 양쪽 2열에서 각 측 2×2 위젯 한 개씩 더 들어갈 공간 확보.
   좁은 화면에선 colsNow()가 폭에 맞춰 열을 줄이므로 안전. */
.container.home-wide { max-width: 100%; }
@media (min-width: 768px) {
  .container.home-wide { max-width: 1760px; }
}

/* ===== 대시보드 좌우 슬라이드 (3페이지 고정) ===== */
.pager {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  overscroll-behavior-x: contain;
}
.pager::-webkit-scrollbar { display: none; }   /* Chrome/Safari */
.page {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-top: 10px;              /* 편집모드 삭제(−) 버튼이 위로 안 잘리게 */
}
.pager-dots { display: flex; justify-content: center; gap: 8px; padding: 4px 0 16px; }
.pager-dot {
  width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%;
  background: rgba(17, 17, 17, 0.2); cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}
.pager-dot.is-active { width: 22px; border-radius: 4px; background: var(--navy); }

/* 삭제(−) 버튼: 편집 모드에서만 표시. core 위젯엔 버튼이 없어 고정 */
.widget__del {
  position: absolute; top: -9px; right: -9px; z-index: 10;
  width: 27px; height: 27px; border-radius: 50%;
  border: 2px solid #fff; background: #1b1b1b; color: #fff;
  font-size: 20px; font-weight: 800; line-height: 1; padding: 0 0 3px;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.dash--edit .widget__del { display: flex; }

/* 위젯 옵션(디자인 변경) 버튼 — 삭제 버튼과 좌우 대칭(좌상단), 편집 모드에서만 노출 */
.widget__opt {
  position: absolute; top: -9px; left: -9px; z-index: 10;
  width: 27px; height: 27px; border-radius: 50%;
  border: 2px solid #fff; background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1; padding: 0;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.dash--edit .widget__opt { display: flex; }

/* 흔들림 (아이폰식). 캔버스 위젯만, core 제외 */
.dash--edit .widget-canvas .widget:not(.widget--core) { animation: dt-jiggle 0.34s infinite ease-in-out; transform-origin: center; will-change: transform; touch-action: none; cursor: grab; }
.dash--edit .widget-canvas .widget:not(.widget--core):nth-child(even) { animation: dt-jiggle-2 0.38s infinite ease-in-out; }
@keyframes dt-jiggle {
  0%   { transform: rotate(-0.6deg) translate(-0.5px, 0); }
  50%  { transform: rotate(0.6deg)  translate(0.5px, 0); }
  100% { transform: rotate(-0.6deg) translate(-0.5px, 0); }
}
@keyframes dt-jiggle-2 {
  0%   { transform: rotate(0.6deg)  translate(0.5px, 0); }
  50%  { transform: rotate(-0.6deg) translate(-0.5px, 0); }
  100% { transform: rotate(0.6deg)  translate(0.5px, 0); }
}

/* 드래그 중 위젯 + 드롭 위치 미리보기 */
.widget.dragging {
  animation: none !important;
  z-index: 50; opacity: 0.97; cursor: grabbing;
  box-shadow: 0 16px 36px rgba(0,0,0,0.28);
}
.drop-ghost {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.04);
  pointer-events: none; z-index: 0;
}

/* 달력 위젯: 칸을 꽉 채움 (X 버튼이 밖으로 나오도록 overflow 자르지 않음) */
.widget--calendar .calendar { height: 100%; margin: 0; }

/* 정사각 타일 (준비중 추가형 위젯) */
.widget--tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-xs);
}
.tile__emoji { font-size: 2.1rem; line-height: 1; }
.tile__title { font-size: 0.92rem; font-weight: 800; color: var(--navy); }
.widget-soon__badge {
  font-size: 0.62rem; font-weight: 800; color: var(--muted);
  background: var(--bg-soft); padding: 2px 7px; border-radius: 999px;
}

/* 타이머 위젯 — 크림 뉴모피즘 (중앙 눈금 다이얼 · 얇은 큰 숫자 · 입체 원형 버튼) */
.widget--timer {
  position: relative;
  display: flex; flex-direction: column;
  padding: 14px 16px 16px;
  border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  background: #f1e8d8;
  color: #4a4036;
  font-family: "Pretendard Variable", system-ui, sans-serif;
}
.timer__label {
  align-self: flex-end;
  font-size: 0.84rem; font-weight: 600; letter-spacing: 1px; color: #c2ad8c;
}
/* 면 전체가 탭/더블탭/롱프레스 영역 */
.timer__face {
  flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
  cursor: pointer; outline: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none;  /* 길게 눌러도 스크롤/확대 안 되게 */
  transition: transform 0.08s ease;
}
.timer__face:active { transform: scale(0.97); }
.timer__dial { position: absolute; width: 150px; height: 150px; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.timer__time {
  position: relative; z-index: 1;
  font-size: 3rem; font-weight: 250; letter-spacing: 1px; line-height: 1;
  color: #4a4036; font-variant-numeric: tabular-nums;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.timer__hint {
  margin: 2px 0 0; text-align: center;
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.2px; color: #c2ad8c;
}
/* 진행 중 — 시각을 앰버로 강조 */
.widget--timer.is-running .timer__time {
  color: #d18f2c; text-shadow: 0 0 12px rgba(227, 162, 62, 0.35);
}
.widget--timer.is-done .timer__time { animation: timer-done 0.7s ease-in-out 3; color: #d18f2c; }
@keyframes timer-done { 50% { opacity: 0.3; } }

/* 시계 위젯 — 깔끔/모던 (밝은 카드 + 큰 시각) */
.widget--clock {
  display: flex; flex-direction: column; padding: 16px 18px;
  background: linear-gradient(165deg, #ffffff 0%, #f3f5fa 100%);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  font-family: ui-rounded, "SF Pro Rounded", "Pretendard Variable", system-ui, sans-serif;
}
.clock__ampm { font-size: 0.84rem; font-weight: 700; color: var(--primary); }
.clock__time {
  flex: 1; display: flex; align-items: center;
  font-size: 3.4rem; font-weight: 800; color: var(--navy);
  letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums;
}
.clock__date { font-size: 0.88rem; font-weight: 600; color: var(--muted); }

/* 시계 위젯 — 아날로그(카시오 MQ-24) 디자인 */
.widget--clock-analog {
  padding: 3px;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #eef1f6 80%);
}
.clock__watch { width: 100%; height: 100%; display: block; }

/* 오늘 과제 위젯 — 포커스형 (지금 할 일 한 개씩 + 완료 체크) */
.widget--tasks {
  display: flex; flex-direction: column; padding: 13px 13px 13px;
  background: linear-gradient(165deg, #ffffff 0%, #f4f6fb 100%);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  font-family: "Pretendard Variable", system-ui, sans-serif; color: var(--navy);
}
.tasksw { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tasksw__top { display: flex; align-items: center; gap: 6px; }
.tasksw__label { flex: 1; font-size: 0.74rem; font-weight: 800; color: var(--muted); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasksw__count { font-size: 0.74rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.tasksw__nav { flex: none; width: 22px; height: 22px; border: none; background: transparent; color: var(--muted-soft); font-size: 1.25rem; line-height: 1; cursor: pointer; border-radius: 6px; padding: 0; }
.tasksw__nav:hover { background: var(--bg-soft); color: var(--muted); }
.tasksw__nav.is-hidden { visibility: hidden; pointer-events: none; }
.tasksw__body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 0; }
.tasksw__subject { align-self: flex-start; font-size: 0.7rem; font-weight: 800; color: var(--primary); background: var(--primary-100, #eef2ff); padding: 3px 9px; border-radius: 999px; }
.tasksw__title { font-size: 1.1rem; font-weight: 800; line-height: 1.3; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tasksw__subs { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; overflow-y: auto; max-height: 92px; }
.tasksw__sub { display: flex; align-items: center; gap: 8px; border: none; background: transparent; padding: 2px 0; cursor: pointer; text-align: left; font-size: 0.85rem; color: var(--text); font-family: inherit; }
.tasksw__check { flex: none; width: 18px; height: 18px; border: 1.6px solid var(--line-strong); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 900; color: #fff; }
.tasksw__sub.is-done .tasksw__check { background: var(--primary); border-color: var(--primary); }
.tasksw__sub.is-done .tasksw__sub-text { color: var(--muted-soft); text-decoration: line-through; }
.tasksw__done { margin-top: 8px; flex: none; border: none; border-radius: 10px; padding: 10px; font-size: 0.92rem; font-weight: 800; cursor: pointer; background: var(--primary); color: #fff; font-family: inherit; transition: filter 0.12s ease, transform 0.06s ease; }
.tasksw__done:active { transform: scale(0.98); }
.tasksw__done.is-done { background: var(--bg-soft); color: var(--muted); font-weight: 700; }
.tasksw.is-done .tasksw__title { color: var(--muted-soft); }
.tasksw--msg { align-items: center; justify-content: center; text-align: center; gap: 9px; }
.tasksw__emoji { font-size: 1.9rem; line-height: 1; }
.tasksw__msg { font-size: 0.9rem; font-weight: 700; color: var(--muted); margin: 0; }
.tasksw__cta { border: none; border-radius: 10px; padding: 9px 14px; font-size: 0.85rem; font-weight: 800; cursor: pointer; background: var(--primary); color: #fff; font-family: inherit; }

/* 날씨 위젯 — iOS 날씨 위젯과 동일 레이아웃 (지역+화살표 / 큰 온도 / 하단 아이콘·상태·최고최저) */
.widget--weather {
  display: flex; flex-direction: column; padding: 16px 18px 18px; color: #fff;
  border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  background: linear-gradient(180deg, #6aa1dc 0%, #4f86c9 100%);
  font-family: ui-rounded, "SF Pro Rounded", "Pretendard Variable", system-ui, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.weather__top { display: flex; align-items: center; gap: 5px; }
.weather__loc { font-size: 1.02rem; font-weight: 700; }
.weather__nav { width: 15px; height: 15px; fill: #fff; flex: none; }
.weather__temp {
  font-size: 3.6rem; font-weight: 500; line-height: 1.05; letter-spacing: -2px;
  font-variant-numeric: tabular-nums; margin-top: 1px;
}
.weather__info { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.weather__icon { display: block; line-height: 0; }
.weather__icon svg, .weather__icon img { width: 32px; height: 32px; display: block; }
.weather__cond { font-size: 1.05rem; font-weight: 800; }
.weather__hilo { font-size: 0.92rem; font-weight: 700; }

/* 메모장 위젯 — 자유 메모 + 폰트 선택 */
/* 메모장 = 포스트잇 노란색 */
.widget--memo {
  display: flex; flex-direction: column;
  padding: 10px 12px 11px;
  background: #fff6b0; border: 1.5px solid #f0e08a;
  border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(120, 100, 20, 0.16);
  /* overflow:hidden 금지 — 삭제(−) 버튼이 모서리 밖(−9px)에 있어 잘림 */
}
.memo__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.memo__title { font-size: 0.78rem; font-weight: 800; color: #9a8829; }
.memo__font {
  font-family: inherit; font-size: 0.72rem; color: #5c5320;
  border: 1.5px solid #e6d885; border-radius: 7px;
  padding: 2px 6px; background: #fffdf0; cursor: pointer; max-width: 88px;
}
.memo__text {
  flex: 1; width: 100%; resize: none; border: none; outline: none; background: transparent;
  font-size: 15px; line-height: 1.45; color: #4a4320;
  font-family: inherit; /* 폰트/크기는 JS(applyMemoFont)가 선택값으로 덮어씀 */
}
.memo__text::placeholder { color: #bcae66; }

/* 한줄 다짐 위젯 — 사용자 지정 폰트(assets/fonts/) 적용 */
@font-face {
  font-family: "MottoFont";
  src: url("/assets/fonts/motto.woff2?v=2") format("woff2"),
       url("/assets/fonts/motto.otf?v=2") format("opentype"),
       url("/assets/fonts/motto.ttf?v=2") format("truetype");
  font-display: swap;
}
.widget--motto {
  display: flex; flex-direction: column;
  padding: 10px 12px 12px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
  /* overflow:hidden 금지 — 삭제(−) 버튼 잘림 방지 */
}
.motto__label {
  flex: none; text-align: center;
  font-size: 0.72rem; font-weight: 800; color: var(--muted); margin-bottom: 4px;
}
.motto__text {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: "MottoFont", "Pretendard Variable", system-ui, sans-serif;
  font-size: 1.5rem; line-height: 1.3; font-weight: 700; color: var(--navy);
  outline: none; overflow-y: auto; word-break: keep-all; cursor: text;
}
.motto__text:empty::before {
  content: attr(data-placeholder);
  font-family: "Pretendard Variable", system-ui, sans-serif;
  font-size: 0.9rem; font-weight: 600; color: var(--muted-soft);
}

/* 편집 바 (하단 고정): + 위젯 추가 / 완료 */
.edit-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 200;
}
.edit-bar__btn {
  border: none; border-radius: 999px; padding: 12px 22px;
  font-size: 0.95rem; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}
.edit-bar__add { background: #fff; color: var(--navy); border: 1.5px solid var(--line-strong); }
.edit-bar__done { background: var(--primary); color: #fff; }

/* 위젯 추가 카탈로그 (바텀시트) */
.catalog-modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.catalog {
  background: var(--card); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; padding: 18px 18px 28px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25); max-height: 80vh; overflow-y: auto;
}
.catalog__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.catalog__title-h { font-size: 1.12rem; font-weight: 800; color: var(--navy); margin: 0; }
.catalog__close {
  border: none; background: var(--bg-soft); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 0.85rem; color: var(--muted);
}
.catalog__list { display: flex; flex-direction: column; gap: 10px; }
.catalog__item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 16px; cursor: pointer; font-family: inherit;
}
.catalog__item:hover { border-color: var(--line-strong); }
.catalog__emoji { font-size: 1.7rem; line-height: 1; }
.catalog__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.catalog__name { font-weight: 800; color: var(--navy); }
.catalog__desc { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.catalog__plus { font-size: 0.88rem; font-weight: 800; color: var(--primary); white-space: nowrap; }
.catalog__empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* 데스크톱: 카탈로그를 가운데 모달로 */
@media (min-width: 768px) {
  .catalog-modal { align-items: center; }
  .catalog { border-radius: 20px; }
}

/* ---------------- 소셜 로그인 / 회원가입 ---------------- */
.form__success { color: var(--primary-600, #2b6cb0); font-size: 0.9rem; min-height: 1.2em; margin: 4px 0 12px; font-weight: 600; }

.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted, #8a93a6); font-size: 0.8rem; margin: 16px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(0, 0, 0, 0.1); }

.btn--social { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.btn--social + .btn--social { margin-top: 8px; }
.btn--social svg { width: 18px; height: 18px; flex: none; }

/* 카카오 브랜드 가이드: 배경 #FEE500, 라벨 검정 85% */
.btn--kakao { background: #fee500; color: rgba(0, 0, 0, 0.85); border: none; }
.btn--kakao:hover { background: #f4dc00; }

.btn--google { background: #fff; color: #3c4043; border: 1px solid #dadce0; }
.btn--google:hover { background: #f7f8f8; }

.btn--apple { background: #000; color: #fff; border: none; }
.btn--apple:hover { background: #1a1a1a; }

.auth-alt { text-align: center; font-size: 0.88rem; color: var(--muted, #8a93a6); margin-top: 18px; }
.auth-alt a { color: var(--primary-600, #2b6cb0); font-weight: 700; }

/* ---------------- iOS 앱(Capacitor) safe area 대응 ----------------
 * viewport-fit=cover 로 노치/홈바 영역까지 웹뷰가 확장되므로
 * 콘텐츠가 가려지지 않게 시스템이 알려주는 안전 영역만큼 패딩을 준다.
 * 일반 브라우저에서는 env() 값이 0이라 아무 영향 없음. */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .toast { bottom: calc(30px + env(safe-area-inset-bottom)); }
  .edit-bar { bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* 캘린더 페이지 */
.calpage { padding: 18px 16px; }
.calpage__hint { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--muted-soft); font-size: 0.8rem; margin: 12px 0 0; }
.calpage__dot, .calendar__cell--rec::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.calendar__cell--rec { position: relative; }
.calendar__cell--rec::after { position: absolute; left: 50%; transform: translateX(-50%); bottom: 1px; }

/* 모바일: 플로팅 필(pill) 탭바 */
@media (max-width: 600px) {
  .tabbar {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding-bottom: 0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  }
  .tabbar__item { padding: 10px 0 9px; }
  .has-tabbar { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------------- 할 일 페이지 ---------------- */
.todo-summary { padding: 16px 18px; margin-bottom: 12px; }
.todo-summary__row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.todo-summary__label { font-weight: 800; }
.todo-summary__count { color: var(--orange-strong); font-weight: 800; font-size: 0.9rem; }
.todo-summary__bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.todo-summary__fill { height: 100%; border-radius: 999px; background: var(--orange); transition: width 0.25s ease; width: 0; }
.todo-item { padding: 6px 10px; margin-bottom: 10px; }
.todo-item__main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 8px; background: none; border: none; cursor: pointer; font: inherit; color: var(--text); text-align: left; -webkit-tap-highlight-color: transparent; }
.todo-item__checkbox { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.todo-item.is-done .todo-item__checkbox { background: var(--green); border-color: var(--green); }
.todo-item__body { display: flex; flex-direction: column; gap: 3px; }
.todo-item__subject { align-self: flex-start; font-size: 0.72rem; font-weight: 800; color: var(--orange-strong); background: var(--orange-bg); border-radius: 6px; padding: 2px 7px; }
.todo-item__title { font-weight: 700; font-size: 1rem; }
.todo-item.is-done .todo-item__title { color: var(--muted-soft); text-decoration: line-through; }
.todo-item__subs { list-style: none; margin: 0; padding: 0 8px 10px 46px; }
.todo-item__sub { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 0; background: none; border: none; cursor: pointer; font: inherit; text-align: left; -webkit-tap-highlight-color: transparent; }
.todo-item__subcheck { flex: none; width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; color: #fff; }
.todo-item__sub.is-done .todo-item__subcheck { background: var(--green); border-color: var(--green); }
.todo-item__subtext { font-size: 0.9rem; color: var(--text); }
.todo-item__sub.is-done .todo-item__subtext { color: var(--muted-soft); text-decoration: line-through; }
.todo-empty { text-align: center; padding: 44px 24px; }
.todo-empty__title { font-size: 1.1rem; font-weight: 800; margin: 0 0 6px; }
.todo-empty__desc { color: var(--muted); margin: 0 0 20px; }

/* ---------------- 풀스크린 캘린더 ---------------- */
body.fcal-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.fcal { flex: 1; display: flex; flex-direction: column; max-width: 900px; width: 100%; margin: 0 auto; padding: 4px 14px 0; box-sizing: border-box; }
.fcal__head { display: flex; align-items: center; justify-content: center; padding: 12px 4px 10px; }
.fcal__title { font-size: 1.15rem; font-weight: 800; margin: 0; }
.fcal__dows { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--muted-soft); padding-bottom: 6px; }
.fcal__dows .is-sun { color: #d05b5b; }
.fcal__dows .is-sat { color: #4a76c7; }
.fcal__grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 3px; min-height: 0; }
.fcal__cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding-top: 6px; background: none; border: none; border-radius: 12px; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; }
.fcal__cell--empty { cursor: default; }
.fcal__num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.fcal__cell.is-today .fcal__num { background: var(--navy); color: #fff; font-weight: 800; }
.fcal__cell.is-selected { background: #ececee; }
.fcal__dots { display: flex; gap: 3px; min-height: 6px; }
.fcal__dot { width: 5px; height: 5px; border-radius: 50%; }
.fcal__dot--rec { background: var(--green); }
.fcal__dot--ev { background: var(--orange); }
.fcal__events { max-height: 30vh; overflow-y: auto; padding: 10px 2px 8px; }
.fcal__events-title { font-size: 0.85rem; font-weight: 800; color: var(--muted); margin: 0 0 8px 4px; }
.fcal__events-empty { color: var(--muted-soft); font-size: 0.85rem; text-align: center; margin: 14px 0; }
.fcal-ev { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; margin-bottom: 7px; }
.fcal-ev__time { flex: none; font-size: 0.78rem; font-weight: 800; color: var(--orange-strong); min-width: 40px; }
.fcal-ev--rec .fcal-ev__time { color: var(--green-strong); }
.fcal-ev__title { font-size: 0.92rem; font-weight: 600; }

/* ---------------- 새 일정 등록 시트 ---------------- */
.evsheet { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; }
.evsheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.evsheet__panel {
  position: relative; width: 100%;
  max-width: 560px;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 82dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
}
/* 태블릿·가로 화면: 바텀시트가 잘리므로 가운데 모달로 */
@media (min-width: 768px), (orientation: landscape) and (min-height: 500px) {
  .evsheet { align-items: center; padding: 20px; box-sizing: border-box; }
  .evsheet__panel {
    border-radius: 22px;
    padding-bottom: 24px;
    max-height: calc(100dvh - 40px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  }
}
.evsheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.evsheet__title { font-weight: 800; font-size: 1.02rem; }
.evsheet__cancel { background: none; border: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 6px; }
.evsheet__save { background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 8px 18px; font: inherit; font-weight: 800; cursor: pointer; }
.evsheet__save:disabled { background: #bcbcbc; }
.evsheet__field { margin-bottom: 6px; }
.evsheet__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; }
.evsheet__row--col { flex-direction: column; align-items: flex-start; gap: 8px; }
.evsheet__dt { display: flex; gap: 8px; width: 100%; }
.evsheet__dt .field__input { flex: 1; }
.evsheet__toggle { width: 22px; height: 22px; accent-color: var(--navy); }
.evsheet__select { max-width: 46%; }
.evsheet__error { color: var(--orange-strong); font-size: 0.85rem; min-height: 1.2em; margin: 10px 0 0; }

/* 할 일 페이지 — 오늘 일정 */
.todo-events { padding: 14px 16px 8px; margin-bottom: 12px; }
.todo-events__title { font-weight: 800; font-size: 0.9rem; color: var(--muted); margin: 0 0 10px 2px; }

/* 일정 행 탭 가능 스타일 + 삭제 버튼 */
.fcal-ev--tap { width: 100%; cursor: pointer; font: inherit; text-align: left; -webkit-tap-highlight-color: transparent; }
.fcal-ev--tap:active { background: var(--bg-soft); }
.fcal-ev__chevron { margin-left: auto; color: var(--muted-soft); font-size: 1.05rem; }
.evsheet__delete {
  display: block; width: 100%; margin-top: 14px;
  background: var(--orange-bg); color: var(--orange-strong);
  border: none; border-radius: 12px; padding: 14px;
  font: inherit; font-weight: 800; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}


/* ============================================================
   모바일 홈 v2 (student-m.html 전용)
   ============================================================ */
.mhead { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin: 12px 2px 16px; }
.mhead__date { font-size: 1.2rem; font-weight: 800; }
.mhead__dday { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 7px 12px; font-size: 0.82rem; color: var(--muted); }
.mhead__dday b { color: var(--navy); font-weight: 800; }

/* 오늘 카드 */
.mtoday { padding: 18px 18px 16px; margin-bottom: 10px; }
.mtoday__loading { color: var(--muted-soft); text-align: center; margin: 10px 0; }
.mtoday__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mtoday__title { font-weight: 800; font-size: 1.02rem; }
.mtoday__count { color: var(--orange-strong); font-weight: 800; font-size: 0.9rem; }
.mtoday__link { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.mtoday__bar { height: 7px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-bottom: 6px; }
.mtoday__fill { height: 100%; border-radius: 999px; background: var(--orange); transition: width 0.25s ease; }
.mtoday__tasks { display: flex; flex-direction: column; }
.mtoday__task { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 2px; background: none; border: none; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--text); text-align: left; -webkit-tap-highlight-color: transparent; }
.mtoday__task:last-child { border-bottom: none; }
.mtoday__check { flex: none; width: 23px; height: 23px; border-radius: 50%; border: 1.8px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 800; color: #fff; }
.mtoday__task.is-done .mtoday__check { background: var(--green); border-color: var(--green); }
.mtoday__task-text { font-size: 0.94rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtoday__task-text b { color: var(--orange-strong); font-weight: 800; }
.mtoday__task.is-done .mtoday__task-text { color: var(--muted-soft); text-decoration: line-through; }
.mtoday__more { display: block; text-align: center; color: var(--muted); font-size: 0.85rem; font-weight: 600; padding: 9px 0 2px; }
.mtoday__cta { margin-top: 13px; }
.mtoday__empty-title { font-size: 1.05rem; font-weight: 800; text-align: center; margin: 8px 0 5px; }
.mtoday__empty-desc { color: var(--muted); font-size: 0.88rem; text-align: center; margin: 0 0 16px; }
.mtoday__rate { font-size: 2.6rem; font-weight: 250; text-align: center; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.mtoday__rate small { font-size: 1.2rem; color: var(--muted); }
.mtoday__rate-label { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0 0 4px; }

/* 스탯 · 섹션 타이틀 · 주간 행 */
.mstat { text-align: center; font-size: 0.86rem; font-weight: 600; color: var(--muted-soft); margin: 0 0 16px; }
.mstat b { color: var(--orange-strong); font-weight: 800; }
.msection-title { font-weight: 800; font-size: 0.9rem; color: var(--muted); margin: 0 2px 8px; }
.mevents { margin-bottom: 14px; }
.mrows { padding: 4px 6px; }
.mrow { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px; font-weight: 600; font-size: 0.95rem; }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mrow__chevron { color: var(--muted-soft); }
.mrow__badge { background: var(--orange-bg); color: var(--orange-strong); font-size: 0.7rem; font-weight: 800; border-radius: 6px; padding: 2px 7px; margin-left: 6px; }

/* ---------------- 기록 페이지 기간 필터 ---------------- */
.period { display: flex; gap: 6px; margin: 4px 0 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.period::-webkit-scrollbar { display: none; }
.period__btn {
  flex: none; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--muted);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.period__btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bar-list__note { font-size: 0.8rem; margin: 0 0 10px; }

/* ============================================================
   메모 (아이폰 메모장 스타일)
   ============================================================ */
.memo-search { width: 100%; box-sizing: border-box; margin-bottom: 12px; }
.memo-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 14px 17px; margin-bottom: 9px; border: 1px solid var(--line); color: var(--text); -webkit-tap-highlight-color: transparent; }
.memo-item__title { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-item__meta { display: flex; gap: 8px; font-size: 0.84rem; overflow: hidden; }
.memo-item__date { flex: none; color: var(--muted); }
.memo-item__body { color: var(--muted-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-empty { text-align: center; padding: 44px 24px; }
.memo-empty__title { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; }
.memo-empty__desc { color: var(--muted); font-size: 0.88rem; margin: 0 0 20px; line-height: 1.7; }

/* 편집기 */
/* 키보드가 올라올 때 WKWebView 가 페이지를 통째로 스크롤해 상단바가 밀리는
   문제 방지: 페이지 높이를 고정하고 본문 영역만 내부 스크롤한다 */
.memoedit-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.memoedit { flex: 1; display: flex; max-width: 820px; width: 100%; margin: 0 auto; padding: 0 18px; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.memoedit__body {
  flex: 1; width: 100%; outline: none; padding: 18px 0 110px;
  font-size: 1rem; line-height: 1.75; color: var(--text); -webkit-user-select: text;
}
.memoedit__body:empty::before { content: attr(data-placeholder); color: var(--muted-soft); }
.memoedit__body h1 { font-size: 1.5rem; font-weight: 800; margin: 4px 0 6px; letter-spacing: -0.02em; }
.memoedit__body h2 { font-size: 1.18rem; font-weight: 800; margin: 14px 0 4px; letter-spacing: -0.02em; }
.memoedit__body ul, .memoedit__body ol { padding-left: 24px; margin: 6px 0; }
.memoedit__body li { margin: 3px 0; }
.memoedit__status { font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); }

/* 체크리스트 줄 */
.memo-check { display: flex; align-items: flex-start; gap: 10px; margin: 5px 0; }
.memo-check__box { flex: none; width: 21px; height: 21px; margin-top: 3px; border-radius: 50%; border: 1.8px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 800; color: #fff; cursor: pointer; }
.memo-check.is-done .memo-check__box { background: var(--orange); border-color: var(--orange); }
.memo-check.is-done .memo-check__box::after { content: "✓"; }
.memo-check.is-done .memo-check__text { color: var(--muted-soft); text-decoration: line-through; }
.memo-check__text { flex: 1; }

/* 서식 툴바 */
.fmtbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: #fff; will-change: transform; }
.fmtbar::-webkit-scrollbar { display: none; }
.fmtbar button { flex: none; min-width: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 0.88rem; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fmtbar button:active { background: var(--bg); }
.fmtbar__sep { flex: none; width: 1px; height: 22px; background: var(--line); margin: 0 2px; }

/* 메모 스와이프 (좌측으로 밀어 고정/삭제) */
.memo-section { font-size: 0.8rem; font-weight: 800; color: var(--muted); margin: 14px 4px 8px; }
.memo-section:first-child { margin-top: 2px; }
.memo-row { position: relative; margin-bottom: 9px; border-radius: var(--radius, 16px); overflow: hidden; }
.memo-row__actions { position: absolute; inset: 0 0 0 auto; display: flex; align-items: stretch; }
.memo-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 75px; border: none; border-radius: 0; font: inherit; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: filter 0.15s ease; }
.memo-act:active { filter: brightness(0.88); }
.memo-act svg { width: 20px; height: 20px; }
.memo-act--pin { background: #ff9f0a; }
.memo-act--del { background: #ff3b30; }
/* .card 의 fadeUp 애니메이션(fill: both)이 인라인 transform 을 덮어써서
   스와이프 이동이 화면에 반영되지 않는다 → 이 카드에서는 애니메이션 해제 */
.memo-row .memo-item { animation: none; position: relative; margin-bottom: 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; transition: transform 0.22s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.memo-item__pin { font-size: 0.82rem; }

/* ---------------- 파일 보관함 ---------------- */
.file-status { text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--orange-strong); margin: 0 0 10px; }
/* memo-item 의 세로(column) 배치를 가로로 되돌리고, 좌측 미리보기 + 우측 정보 */
.file-item { flex-direction: row; align-items: center; gap: 14px; padding: 12px 14px; }
.file-item__thumb { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg); border: 1px solid var(--line); }
.file-item__icon { width: 62px; height: 62px; border-radius: 12px; flex: none; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
.file-item__body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; }
.file-item__name { font-weight: 700; font-size: 0.96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__meta { color: var(--muted-soft); font-size: 0.78rem; }
.file-item__badge { align-self: flex-start; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; text-transform: uppercase; }

/* ---------------- 온보딩 / 사용 유형 ---------------- */
.onb { max-width: 560px; padding-top: 8vh; }
.onb__title { font-size: 1.45rem; font-weight: 800; margin: 0 0 8px; }
.onb__desc { color: var(--muted); font-size: 0.9rem; margin: 0 0 22px; line-height: 1.6; }
.onb__opt { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; padding: 18px 20px; margin-bottom: 12px; border: 2px solid var(--line); cursor: pointer; font: inherit; color: var(--text); -webkit-tap-highlight-color: transparent; }
.onb__opt.is-picked { border-color: var(--orange); }
.onb__opt-title { font-size: 1.05rem; font-weight: 800; }
.onb__opt-desc { color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.onb__goal { padding: 16px 18px 6px; margin-bottom: 14px; }
.onb__goal-title { font-weight: 800; margin: 0 0 12px; }
.onb__goal-opt { color: var(--muted-soft); font-weight: 600; font-size: 0.85rem; }
.onb__hint { color: var(--muted-soft); font-size: 0.8rem; margin: 2px 0 6px; }
.onb__start { margin-top: 6px; }
.settings-row__value { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
/* 일반 사용자: 체크인에서 과목 선택 숨김 */
body.is-general .task-subject { display: none; }

/* ---------------- 일반 사용자 홈 (심플 투두 플래너) ---------------- */
.gtodo { padding: 16px 16px 10px; margin-bottom: 14px; }
.gtodo__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; padding: 0 2px; }
.gtodo__title { font-weight: 800; font-size: 1.02rem; }
.gtodo__count { color: var(--orange-strong); font-weight: 800; font-size: 0.88rem; }
.gtodo__empty { color: var(--muted-soft); font-size: 0.9rem; text-align: center; margin: 18px 0; }
.gtodo__row { margin-bottom: 0; border-radius: 12px; }
.gtodo__item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 4px; background: #fff; border: none; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--text); text-align: left; touch-action: pan-y; -webkit-user-select: none; user-select: none; transition: transform 0.22s cubic-bezier(.22,.61,.36,1); animation: none; }
.gtodo__row:last-of-type .gtodo__item { border-bottom: none; }
.gtodo__check { flex: none; width: 23px; height: 23px; border-radius: 50%; border: 1.8px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 800; color: #fff; }
.gtodo__item.is-done .gtodo__check { background: var(--orange); border-color: var(--orange); }
.gtodo__text { font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtodo__item.is-done .gtodo__text { color: var(--muted-soft); text-decoration: line-through; }
.gtodo__addrow { padding-top: 8px; }
.gtodo__input { width: 100%; box-sizing: border-box; border: none; outline: none; background: none; padding: 10px 4px; font: inherit; font-size: 0.95rem; color: var(--text); }
.gtodo__input::placeholder { color: var(--muted-soft); font-weight: 600; }
.gcarry { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--orange-bg); border-radius: 12px; padding: 12px 15px; margin-bottom: 14px; font-size: 0.86rem; font-weight: 600; color: var(--orange-strong); }
.gcarry__btn { flex: none; background: var(--orange); color: #fff; border: none; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 0.82rem; font-weight: 800; cursor: pointer; }

/* ---------------- 메모 카테고리 (노션식 폴더) ---------------- */
.memo-cats { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.memo-cats::-webkit-scrollbar { display: none; }
.memo-cat { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.memo-cat.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.memo-cat--add { border-style: dashed; color: var(--muted-soft); }
.memoedit__catbar { max-width: 820px; width: 100%; margin: 0 auto; padding: 10px 18px 0; box-sizing: border-box; }
.memoedit__cat { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 6px 12px; font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--muted); max-width: 60%; }

/* 폴더 관리·선택 시트 */
.catmgr__addrow { display: flex; gap: 8px; margin: 4px 0 14px; }
.catmgr__addrow .field__input { flex: 1; }
.catmgr__addbtn { flex: none; background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: 0 18px; font: inherit; font-weight: 800; cursor: pointer; }
.catmgr__row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.catmgr__row:last-child { border-bottom: none; }
.catmgr__name { flex: 1; border: none; outline: none; background: none; font: inherit; font-size: 0.95rem; font-weight: 700; color: var(--text); padding: 6px 2px; }
.catmgr__name:focus { border-bottom: 2px solid var(--orange); }
.catmgr__count { flex: none; color: var(--muted-soft); font-size: 0.82rem; }
.catmgr__del { flex: none; background: none; border: none; color: #d9534f; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; padding: 6px 4px; }
.catmgr__empty { text-align: center; color: var(--muted-soft); font-size: 0.88rem; line-height: 1.7; margin: 22px 0; }
.pickrow { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 6px; background: none; border: none; border-bottom: 1px solid var(--line); font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; }
.pickrow.is-on { font-weight: 800; }
.pickrow__check { color: var(--orange-strong); font-weight: 800; }

/* 스와이프 이동 버튼 · 상단 ＋ 버튼 · 일정 블록 보조 */
.memo-act--move { background: #8e8e93; }
.topbar__plus { font-size: 1.3rem; line-height: 1; padding: 5px 13px; }
.fcal-ev__sub { color: var(--muted-soft); font-weight: 600; font-size: 0.85em; }

/* ============================================================
 * 일반 사용자 태블릿/PC 홈 (general.html)
 * ============================================================ */
.gtab-head { margin-top: 18px; }
.gtab-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }
.gtab-grid > .gtab-col { min-width: 0; }
.gtodo--tab { min-height: 320px; display: flex; flex-direction: column; margin-bottom: 14px; }
.gtodo--tab > #g-list { flex: 1; }
.gtab-events { padding: 16px 16px 12px; }
.gtab-events .fcal-ev { background: var(--bg-soft, #f6f7f9); border: none; }

/* 상시 디스플레이 시계 (일반 태블릿 홈) */
.gtab-head { align-items: flex-start; }
.gtab-clock { font-size: 2.9rem; font-weight: 800; letter-spacing: -1px; line-height: 1.05; margin-bottom: 3px; font-variant-numeric: tabular-nums; }

/* 할 일 작성 시트 · 중요 · 예정 (일반 태블릿 홈) */
.gtodo__addbtn { display: block; width: 100%; padding: 12px 4px; background: none; border: none; text-align: left; font: inherit; font-size: 0.95rem; font-weight: 700; color: var(--muted-soft); cursor: pointer; }
.gtodo__addbtn:active { color: var(--muted); }
.gt-input { width: 100%; box-sizing: border-box; margin: 14px 0 12px; font-size: 1.05rem; }
.gt-chips { display: flex; gap: 8px; margin-bottom: 12px; }
.gt-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.gt-chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
#gt-date { margin-bottom: 12px; }
.gt-imp { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; margin-bottom: 6px; }
.gt-imp__star { font-size: 1.1rem; color: var(--line-strong); }
.gt-imp.is-on { border-color: var(--orange); color: var(--orange-strong); }
.gt-imp.is-on .gt-imp__star { color: var(--orange); }
.gtodo__star { flex: none; color: var(--orange); font-size: 0.95rem; }
.memo-act--imp { background: #ff9f0a; }
.gup-date { flex: none; font-size: 0.78rem; font-weight: 800; color: var(--muted); background: var(--bg-soft, #f2f3f6); border-radius: 8px; padding: 4px 8px; }

/* 스와이프 액션: 아이콘만 (라벨 숨김) */
.memo-act span { display: none; }
.memo-act svg { width: 22px; height: 22px; }

/* 할일 행이 스와이프 액션을 덮도록 — 액션은 밀었을 때만 드러남 */
.gtodo__item { position: relative; }

/* ============================================================
 * 전역 전환 애니메이션 — 달력 월 넘김 · 바텀시트
 * ============================================================ */
@keyframes cal-slide-left { from { transform: translateX(7%); opacity: 0.3; } }
@keyframes cal-slide-right { from { transform: translateX(-7%); opacity: 0.3; } }
.fcal__grid.anim-left { animation: cal-slide-left 0.3s cubic-bezier(.22,.61,.36,1); }
.fcal__grid.anim-right { animation: cal-slide-right 0.3s cubic-bezier(.22,.61,.36,1); }

/* 바텀시트: 열릴 때마다 배경 페이드 + 패널 슬라이드업 */
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(46px); opacity: 0.5; } }
.evsheet__backdrop { animation: sheet-fade 0.22s ease; }
.evsheet__panel { animation: sheet-up 0.32s cubic-bezier(.22,.61,.36,1); }

/* ---------------- 태블릿/PC 로그인·가입: 2단 파티션 ---------------- */
.auth-split { display: contents; }         /* 모바일: 래퍼 없이 기존 레이아웃 */
.auth-brand { display: none; }
@media (min-width: 601px) {
  .center-screen:has(.auth-split) { padding: 0; }
  .auth-split { display: flex; width: 100%; min-height: 100dvh; }
  .auth-brand { position: relative; overflow: hidden; display: flex; flex: 1.08; align-items: center; justify-content: center; background: var(--navy); color: #fff; }
  .auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; border: 54px solid rgba(255, 255, 255, 0.05); }
  .auth-brand::before { width: 560px; height: 560px; right: -160px; bottom: -160px; }
  .auth-brand::after { width: 250px; height: 250px; border-width: 34px; left: -70px; top: -70px; }
  .auth-brand__inner { position: relative; max-width: 400px; padding: 48px; }
  .auth-brand__logo { width: 92px; height: 92px; border-radius: 24px; margin-bottom: 26px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35)); }
  .auth-brand__title { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 14px; }
  .auth-brand__subtitle { font-size: 1.05rem; line-height: 1.7; color: rgba(255, 255, 255, 0.72); margin: 0; }
  .auth-split .auth-card { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; max-width: none; border: none; border-radius: 0; box-shadow: none; padding: 48px 40px; min-height: 100dvh; box-sizing: border-box; animation: none; }
  .auth-split .auth-card > * { width: 100%; max-width: 400px; }
  .auth-split .auth-card__logo { display: none; }
  .auth-split .auth-card--brandled .auth-card__title,
  .auth-split .auth-card--brandled .auth-card__subtitle { display: none; }
}

/* 로그인·가입 뒤로가기 (플로팅, 노치 안전영역 반영) */
.auth-back { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 16px; z-index: 60; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.08); background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.auth-back svg { width: 20px; height: 20px; }
.auth-back:active { transform: scale(0.94); }

/* 로그인(브랜드 헤더 없는 카드): 모바일에서 폼이 뒤로가기 버튼과 겹치지 않게 */
@media (max-width: 480px) {
  .auth-card--brandled { padding-top: max(9vh, 70px); }
  .auth-card--lowered { padding-top: 9vh; }
}

/* 폴더 색상 점 + 키보드 동기 시트 */
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.catmgr__dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65), 0 1px 4px rgba(0, 0, 0, 0.15); }
body[data-kbresize="none"] .evsheet__panel { transform: translateY(calc(-1 * var(--kb, 0px))); transition: transform 0.12s ease-out; will-change: transform; }
body[data-kbresize="none"].kb-open { overflow: hidden; }
body[data-kbresize="none"].kb-open .evsheet__panel { max-height: calc(100dvh - var(--kb, 0px) - 20px); overflow-y: auto; padding-bottom: 14px; }
.evsheet__error:empty { display: none; }
html { background: #f4f4f5; }

/* 캘린더: 여백·3패널 캐러셀 */
.fcal__head { padding-bottom: 26px; }
.fcal__dows { padding-bottom: 10px; }
.fcal__carousel { flex: 0 0 auto; height: 46vh; overflow: hidden; }
.fcal__track { display: flex; width: 300%; height: 100%; transform: translateX(-33.3333%); will-change: transform; }
.fcal__track > .fcal__grid { width: 33.3333%; flex: none; }
.fcal__grid--side { pointer-events: none; opacity: 0.55; }

/* 할일 시트 날짜 입력이 화면 밖으로 넘치지 않게 */
#gt-date { width: 100%; box-sizing: border-box; min-width: 0; }

/* ============================================================
 * 탭 간 페이지 전환 — 크로스 문서 뷰 트랜지션 (iOS 18+ 웹뷰)
 * 이전 화면이 살짝 페이드아웃되며 새 화면이 페이드인.
 * 탭바는 전환 중에도 제자리 고정. 미지원 기기는 기존 즉시 전환.
 * ============================================================ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-fade-out 0.16s ease both; }
::view-transition-new(root) { animation: vt-fade-in 0.22s ease both; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
.tabbar { view-transition-name: dt-tabbar; }

/* 캘린더 세로 중앙 배치 + 플로팅 일정 추가 버튼 */
.fcal { justify-content: center; padding-bottom: 88px; }
.fcal__events { flex: 0 0 auto; }
.fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 88px); z-index: 90; width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--orange); color: #fff; font-size: 1.9rem; font-weight: 500; line-height: 1; box-shadow: 0 8px 20px rgba(240, 68, 56, 0.35); cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.fab:active { transform: scale(0.93); }

/* 지원·문의: 화면 세로 중앙 정렬 */
body.support-page { align-items: center; padding-top: 24px; }

/* 스켈레톤 로딩 (필요할 때만 표시) */
.skel { height: 46px; border-radius: 12px; margin-bottom: 9px; background: linear-gradient(90deg, #ececee 25%, #f7f7f8 50%, #ececee 75%); background-size: 200% 100%; animation: skel-wave 1.1s linear infinite; }
@keyframes skel-wave { to { background-position: -200% 0; } }

/* 키보드 표시 중 탭바 숨김 */
.tabbar { transition: transform 0.2s ease; }
body.kb-up .tabbar { transform: translateY(150%); }

/* 오늘 카드: 플랜 수정 링크 */
.mtoday__edit { font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-left: 10px; margin-right: auto; }

/* 상단바 원형 뒤로가기 — 로그인·지원 페이지 버튼과 통일 */
.topbar__back { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: none; color: #fff; flex: none; }
.topbar__back svg { width: 22px; height: 22px; }
.topbar__back:active { transform: scale(0.94); }
.topbar:has(> .topbar__back) > .topbar__back { justify-self: start; }

/* 플로팅 스피드 다이얼 */
.fab { transition: transform 0.2s ease; }
.fabmenu.is-open .fab { transform: rotate(45deg); }
.fabmenu__backdrop { position: fixed; inset: 0; z-index: 88; background: rgba(0, 0, 0, 0.3); }
.fabmenu__items { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 156px); z-index: 92; display: flex; flex-direction: column; align-items: flex-end; gap: 11px; }
.fabmenu__item { display: flex; align-items: center; gap: 10px; text-decoration: none; animation: fab-in 0.2s ease both; }
.fabmenu__item:nth-child(3) { animation-delay: 0.03s; }
.fabmenu__item:nth-child(2) { animation-delay: 0.06s; }
.fabmenu__item:nth-child(1) { animation-delay: 0.09s; }
@keyframes fab-in { from { opacity: 0; transform: translateY(12px); } }
.fabmenu__item span { background: #fff; border-radius: 11px; padding: 8px 13px; font-size: 0.88rem; font-weight: 700; color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16); }
.fabmenu__item i { font-style: normal; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }

/* 내 기록: 일별 상세 펼침 */
.bar-row--tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dayx { background: var(--bg); border-radius: 12px; padding: 11px 13px; margin: 2px 0 10px; }
.dayx__task { font-size: 0.88rem; font-weight: 600; padding: 3px 0; }
.dayx__meta { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-top: 7px; }
.dayx__risk { color: var(--orange-strong); }
.dayx__note { font-size: 0.85rem; color: var(--muted); margin: 7px 0 0; line-height: 1.5; }

.dayx__sub { font-size: 0.82rem; font-weight: 600; color: var(--muted); padding: 1px 0 1px 24px; }

/* 홈 오늘 카드: 서브 과제 */
.mtoday__subrow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 4px 4px 31px; background: none; border: none; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mtoday__subcheck { flex: none; width: 17px; height: 17px; border-radius: 50%; border: 1.6px solid var(--line-strong); font-size: 0.6rem; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; }
.mtoday__subrow.is-done .mtoday__subcheck { background: var(--orange); border-color: var(--orange); }
.mtoday__sub-text { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.mtoday__subrow.is-done .mtoday__sub-text { text-decoration: line-through; color: var(--muted-soft); }

/* 사용법 페이지 */
.guide { padding-top: 16px; padding-bottom: 40px; }
.guide__sec { margin-bottom: 12px; }
.guide__title { font-size: 1rem; font-weight: 800; margin: 0 0 8px; }
.guide__sec p { font-size: 0.9rem; line-height: 1.65; color: var(--text); margin: 0 0 8px; }
.guide__sec p:last-child { margin-bottom: 0; }
.guide__sec b { font-weight: 800; }
.guide__tip { color: var(--muted); background: var(--bg); border-radius: 10px; padding: 9px 12px; }

/* 타임박스 (수험생 홈 카드 + 편집) */
.tbox { padding: 16px 16px 8px; margin-bottom: 14px; }
.tbox__head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.02rem; margin-bottom: 4px; }
.tbox__head a { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.tbox__row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; background: none; border: none; border-bottom: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
.tbox__row:last-child { border-bottom: none; }
.tbox__time { flex: none; font-size: 0.78rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbox__label { font-size: 0.92rem; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbox__row.is-now { background: var(--orange-bg); }
.tbox__row.is-now .tbox__time { color: var(--orange-strong); }
.tbox__check { flex: none; width: 21px; height: 21px; border-radius: 50%; border: 1.8px solid var(--line-strong); color: #fff; font-size: 0.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tbox__row.is-done .tbox__check { background: var(--orange); border-color: var(--orange); }
.tbox__row.is-done .tbox__label { color: var(--muted-soft); text-decoration: line-through; }
.tbe__hint { font-size: 0.88rem; font-weight: 600; color: var(--muted); margin: 14px 2px 12px; }
.tbe__row { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.tbe__row input[type="time"] { width: 88px; box-sizing: border-box; min-width: 0; padding-left: 8px; padding-right: 8px; }
.tbe__label { flex: 1; min-width: 0; }
.tbe__del { flex: none; background: none; border: none; color: var(--muted-soft); font-size: 1rem; padding: 6px; cursor: pointer; }
.gm__time { flex: none; font-size: 0.72rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.gm__row.now { background: var(--orange-bg); border-radius: 8px; }

/* 타임박스 요일 선택 */
.tbe__item { padding-bottom: 6px; border-bottom: 1px solid var(--bg); margin-bottom: 10px; }
.tbe__item:last-of-type { border-bottom: none; }
.tbe__days { display: flex; gap: 6px; margin: 7px 0 3px 2px; }
.tbe__day { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 0.74rem; font-weight: 700; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tbe__day.is-on { background: var(--orange); border-color: var(--orange); color: #fff; }

/* 타임박스 세로 그리드 (종이 타임박스 스타일) */
.tgrid { position: relative; margin: 10px 2px 4px; }
.tgrid__hour { position: absolute; left: 30px; right: 0; border-top: 1px solid var(--line); }
.tgrid__hour span { position: absolute; top: -7px; left: -30px; width: 26px; text-align: right; font-size: 0.68rem; font-weight: 700; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.tgrid__half { position: absolute; left: 30px; right: 0; border-top: 1px dashed #ececee; }
.tgrid__block { position: absolute; left: 38px; right: 2px; border: none; border-left: 3px solid var(--orange); border-radius: 8px; background: var(--orange-bg); text-align: left; font: inherit; padding: 4px 9px; cursor: pointer; overflow: hidden; z-index: 2; -webkit-tap-highlight-color: transparent; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.tgrid__block--slim { padding: 2px 9px; }
.tgrid__time { font-size: 0.64rem; font-weight: 800; color: var(--orange-strong); font-variant-numeric: tabular-nums; }
.tgrid__label { font-size: 0.82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgrid__block.is-now { background: repeating-linear-gradient(45deg, rgba(240, 68, 56, 0.3) 0 7px, rgba(240, 68, 56, 0.12) 7px 14px); }
.tgrid__block.is-done { background: var(--orange); border-left-color: var(--orange-strong); }
.tgrid__block.is-done .tgrid__label { color: #fff; }
.tgrid__block.is-done .tgrid__time { color: rgba(255, 255, 255, 0.85); }
.tgrid__now { position: absolute; left: 30px; right: 0; border-top: 2px solid #f04438; z-index: 3; pointer-events: none; }
.tgrid__now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: #f04438; }

/* 주간 시간표 (타임박스 페이지) — 에브리타임 스타일 */
#tb-view { padding: 12px 10px 14px; }
.wtb { border: 1px solid #e6e7eb; border-radius: 12px; overflow: hidden; background: #fff; }
.wtb__head { display: flex; background: #fafafb; border-bottom: 1px solid #e6e7eb; }
.wtb__gut { width: 24px; flex: none; }
.wtb__day { flex: 1; text-align: center; font-size: 0.76rem; font-weight: 700; color: var(--muted); padding: 8px 0; }
.wtb__day.is-today { color: var(--orange-strong); font-weight: 800; }
.wtb__body { display: flex; }
.wtb__gutcol { width: 24px; flex: none; position: relative; background: #fafafb; border-right: 1px solid #e6e7eb; }
.wtb__gutcol span { position: absolute; right: 4px; transform: translateY(2px); font-size: 0.62rem; font-weight: 700; color: #b6b8bf; font-variant-numeric: tabular-nums; }
.wtb__col { flex: 1; position: relative; border-left: 1px solid #eff0f3; min-width: 0; }
.wtb__col:nth-child(2) { border-left: none; }
.wtb__col.is-today { background: rgba(240, 68, 56, 0.04); }
.wtb__col i { position: absolute; left: 0; right: 0; border-top: 1px solid #eff0f3; }
.wtb__blk { position: absolute; left: 0.5px; right: 0.5px; border: none; border-radius: 5px; color: #fff; font: inherit; font-size: 0.68rem; font-weight: 700; padding: 5px 5px; text-align: left; cursor: pointer; overflow: hidden; z-index: 2; -webkit-tap-highlight-color: transparent; }
.wtb__blk span { display: block; line-height: 1.3; overflow: hidden; word-break: keep-all; }
.wtb__blk u { display: block; text-decoration: none; font-size: 0.6rem; font-weight: 600; opacity: 0.85; margin-top: 2px; }
.wtb__blk em { position: absolute; right: 5px; top: 4px; font-style: normal; font-size: 0.72rem; }
.wtb__blk.is-done { opacity: 0.38; }
.wtb__blk.is-cur { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8); }
.wtb__now { position: absolute; left: 0; right: 0; border-top: 2px solid #f04438; z-index: 3; pointer-events: none; }
.wtb__now::before { content: ""; position: absolute; left: 0; top: -4px; width: 6px; height: 6px; border-radius: 50%; background: #f04438; }
.wtb__hint { text-align: center; font-size: 0.76rem; font-weight: 600; color: var(--muted-soft); margin: 11px 0 2px; }

/* 타임박스 페이지 요일 선택 */
.tbv__days { justify-content: center; margin: 4px 0 12px; }
.tbv__days .tbe__day { width: 34px; height: 34px; }
.tbv__days .tbv__today:not(.is-on) { border-color: var(--orange); color: var(--orange-strong); }

/* 타임박스 주간 뷰 — 홈 그리드와 같은 디자인 언어 */
.tbv__seg { margin: 2px 0 12px; }
.wk__head { display: flex; margin-bottom: 4px; }
.wk__gut { width: 20px; flex: none; }
.wk__day { flex: 1; text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--muted-soft); padding: 3px 0; }
.wk__day.is-today { color: var(--orange-strong); }
.wk__body { display: flex; }
.wk__gutcol { width: 20px; flex: none; position: relative; }
.wk__gutcol span { position: absolute; right: 4px; transform: translateY(-6px); font-size: 0.6rem; font-weight: 700; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.wk__col { flex: 1; position: relative; border-left: 1px solid #f0f0f2; min-width: 0; }
.wk__col:last-child { border-right: 1px solid #f0f0f2; }

.wk__col.is-today { background: rgba(240, 68, 56, 0.045); }
.wk__col i { position: absolute; left: 0; right: 0; border-top: 1px solid #f2f2f4; }
.wk__blk { position: absolute; left: 1.5px; right: 1.5px; border: none; border-radius: 0; color: #fff; font: inherit; font-size: 0.62rem; font-weight: 700; padding: 4px 4px; text-align: left; cursor: pointer; overflow: hidden; z-index: 2; -webkit-tap-highlight-color: transparent; }
.wk__blk span { display: block; line-height: 1.25; overflow: hidden; word-break: keep-all; }
.wk__blk.is-now { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); }
.wk__blk.is-done { opacity: 0.4; }

/* 타임박스 편집 목록 + 시트 */
.tbr { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 6px; background: none; border: none; border-bottom: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tbr:last-of-type { border-bottom: none; }
.tbr__dot { flex: none; width: 12px; height: 12px; border-radius: 4px; }
.tbr__mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tbr__mid b { font-size: 0.95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbr__mid span { font-size: 0.78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbr__chev { flex: none; color: var(--muted-soft); font-size: 1.05rem; }
.tbs__dayswrap { padding: 12px 2px 4px; }
.tbs__dayswrap > span { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.tbs__dayswrap .tbe__days { margin: 0; }

/* 타임박스 색상 스와치 */
.tbs__colors { display: flex; gap: 8px; flex-wrap: wrap; }
.tbs__c { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tbs__c.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }

/* 타임박스 상단바 뷰 전환 세그먼트 */
.tb-seg { display: flex; background: rgba(255, 255, 255, 0.16); border-radius: 9px; padding: 2px; }
.tb-seg button { border: none; background: none; color: #fff; opacity: 0.75; font: inherit; font-size: 0.78rem; font-weight: 700; padding: 5px 10px; border-radius: 7px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tb-seg button.is-active { background: #fff; color: #17171a; opacity: 1; }

.fab svg { width: 24px; height: 24px; }

.tb-vm { display: flex; align-items: center; justify-content: center; background: none; border: none; color: #fff; padding: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tb-vm:active { transform: scale(0.92); }
.tb-vm svg { width: 22px; height: 22px; display: block; }


/* 타임박스 하루 뷰 — 애플 캘린더 스타일 */
.tgd { position: relative; margin: 12px 0 4px; }
.tgd__hour { position: absolute; left: 0; right: 0; display: flex; align-items: center; transform: translateY(-50%); }
.tgd__hour span { flex: none; width: 58px; padding-right: 9px; text-align: right; font-size: 0.72rem; font-weight: 600; color: var(--muted-soft); white-space: nowrap; }
.tgd__hour i { flex: 1; height: 1px; background: #e9eaee; }
.tgd__block { position: absolute; left: 66px; right: 2px; border-left: 3px solid var(--orange); border-radius: 8px; padding: 5px 10px; overflow: hidden; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.tgd__block--slim { padding: 2px 10px; }
.tgd__time { font-size: 0.66rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.tgd__label { font-size: 0.86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgd__now { position: absolute; left: 0; right: 0; display: flex; align-items: center; transform: translateY(-50%); z-index: 3; pointer-events: none; }
.tgd__now em { flex: none; font-style: normal; background: #f04438; color: #fff; font-size: 0.7rem; font-weight: 800; padding: 2.5px 8px; border-radius: 99px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.tgd__now i { flex: 1; height: 2px; background: #f04438; border-radius: 2px; }

/* 길게 눌러 텍스트 선택 방지 (입력·메모 작성 제외) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], [contenteditable] * { -webkit-user-select: text; user-select: text; }

/* 날짜·시간 입력 폭 정렬 — iOS 기본 폭이 컨테이너를 넘치는 문제 전역 수정 */
input[type="date"].field__input,
input[type="time"].field__input,
input[type="month"].field__input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  /* 빈 값일 때 내용이 없어 납작해지는 것 방지 — 텍스트 입력과 같은 높이 유지 */
  min-height: calc(1.05rem * 1.2 + 28px + 3px);
  display: flex;
  align-items: center;
  -webkit-appearance: none;
  appearance: none;
}
.evsheet__dt { min-width: 0; }
.evsheet__dt .field__input { flex: 1; }

/* ============================================================
   태블릿 레이어 — 노션풍 좌측 콘텐츠 패널 + 배치 정리
   (하단 탭바는 그대로. 메모·파일은 좌측에 폴더 패널을 세로로.
    아이폰 가로모드 제외: min-height 500px 조건)
   ============================================================ */
@media (min-width: 768px) and (min-height: 500px) {
  /* 태블릿: 본문 블록 좌측 정렬 */
  main.container { margin-left: 0; }

  /* 내 기록 요약 4지표: 한 줄 4칸 */
  .stat-grid { grid-template-columns: repeat(4, 1fr); }

  /* 메모·파일: 좌측 폴더 패널 + 우측 콘텐츠 2단 */
  main.container:has(> .memo-cats) {
    display: grid; grid-template-columns: 208px minmax(0, 1fr);
    column-gap: 20px; align-items: start;
    max-width: 1024px;
  }
  main.container:has(> .memo-cats) > * { grid-column: 2; min-width: 0; }
  main.container:has(> .memo-cats) > .memo-cats {
    grid-column: 1; grid-row: 2 / span 5;
    position: sticky; top: calc(env(safe-area-inset-top, 0px) + 74px);
    flex-direction: column; align-items: stretch; gap: 2px;
    overflow: visible; margin-bottom: 0;
    background: #fff; border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 10px;
  }
  main.container:has(> .memo-cats) > .memo-cats::before {
    content: "폴더";
    display: block;
    padding: 0 10px 8px;
    font-size: 0.76rem; font-weight: 800; letter-spacing: 0.02em;
    color: var(--muted-soft);
  }
  main.container:has(> .memo-cats) > .memo-cats .memo-cat {
    display: flex; align-items: center; gap: 8px;
    border: none; background: none; text-align: left;
    border-radius: 8px; padding: 9px 10px;
    font-size: 0.92rem;
  }
  main.container:has(> .memo-cats) > .memo-cats .memo-cat:active { background: rgba(15, 23, 42, 0.08); }
  main.container:has(> .memo-cats) > .memo-cats .memo-cat.is-active {
    background: rgba(240, 68, 56, 0.1); color: var(--primary);
  }
  main.container:has(> .memo-cats) > .memo-cats .memo-cat--add {
    margin-top: 6px; border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px; color: var(--muted-soft);
  }

  /* 메모·파일 목록: 2열 */
  #memo-list, #file-list { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; align-items: start; }
  #memo-list > *, #file-list > * { margin-bottom: 0; }
  #memo-list .memo-empty, #file-list .memo-empty,
  #memo-list .dt-skel, #file-list .dt-skel { grid-column: 1 / -1; }
}
@media (min-width: 768px) and (min-height: 500px) and (hover: hover) {
  main.container:has(> .memo-cats) > .memo-cats .memo-cat:not(.is-active):hover { background: rgba(15, 23, 42, 0.05); color: var(--text); }
}

/* 타임박스 태블릿 좌측 패널 — 지금/다음 · 주간 배분 · 블록 목록 (모바일에선 숨김) */
.tbside { display: none; }
@media (min-width: 768px) and (min-height: 500px) {
  main.container:has(> .tbside) {
    display: grid; grid-template-columns: 224px minmax(0, 1fr);
    column-gap: 20px; align-items: start; max-width: 1024px;
  }
  main.container:has(> .tbside) > * { grid-column: 2; min-width: 0; }
  main.container:has(> .tbside) > .tbside {
    grid-column: 1; grid-row: 1 / span 6;
    display: flex; flex-direction: column; gap: 12px;
    position: sticky; top: calc(env(safe-area-inset-top, 0px) + 74px);
  }
  .tbside__card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
  .tbside__h { margin: 0 0 10px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.02em; color: var(--muted-soft); }
  .tbside__big { display: flex; align-items: center; gap: 8px; font-size: 1.08rem; font-weight: 800; color: var(--navy); }
  .tbside__big i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
  .tbside__big--free { color: var(--muted-soft); font-weight: 700; }
  .tbside__sub { margin: 6px 0 0; font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
  .tbside__next { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.83rem; color: var(--muted); }
  .tbside__row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 0.9rem; }
  .tbside__row i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .tbside__row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .tbside__row b { font-weight: 700; color: var(--navy); font-size: 0.86rem; }
  .tbside__blk { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; text-align: left; padding: 8px 6px; border-radius: 9px; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tbside__blk:active { background: rgba(15, 23, 42, 0.06); }
  .tbside__blk i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .tbside__blk span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .tbside__blk b { font-size: 0.92rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tbside__blk em { font-style: normal; font-size: 0.78rem; color: var(--muted); }
  .tbside__wx { display: flex; align-items: center; gap: 10px; }
  .tbside__wxi { font-size: 1.9rem; line-height: 1; }
  .tbside__wxt { display: flex; flex-direction: column; gap: 1px; }
  .tbside__wxt b { font-size: 1.25rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
  .tbside__wxt em { font-style: normal; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
}

/* ---------------- 앱 알림 설정 (설정 페이지) ---------------- */
.settings-row--static { cursor: default; }
.ntf-right { display: flex; align-items: center; gap: 10px; }
.ntf-time { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font: inherit; font-size: 0.88rem; background: #fff; color: var(--text); }
.dtswitch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.dtswitch input { position: absolute; opacity: 0; width: 0; height: 0; }
.dtswitch i { position: absolute; inset: 0; background: #d9d9de; border-radius: 999px; transition: background 0.18s ease; }
.dtswitch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.18s ease; }
.dtswitch input:checked + i { background: var(--primary); }
.dtswitch input:checked + i::after { transform: translateX(18px); }

/* 상단바 더보기(⋯) 버튼 + 메뉴 시트 행 */
.topbar__more { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: none; border: none; color: #fff; -webkit-tap-highlight-color: transparent; }
.topbar__more svg { width: 22px; height: 22px; }
.topbar__more:active { transform: scale(0.94); }
.mopt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 8px; background: none; border: none; font: inherit; font-size: 0.98rem; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mopt + .mopt { border-top: 1px solid var(--line); }
.mopt svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.mopt__sub { margin-left: auto; color: var(--muted-soft); font-size: 0.85rem; font-weight: 600; }
.mopt:active { background: rgba(15, 23, 42, 0.05); }

/* 키보드 뒤 배경 마스크 — iOS 키보드 상단 라운딩 틈 색상 통일 */
.dt-kbmask { position: fixed; left: 0; right: 0; bottom: 0; height: var(--kb, 0px); background: #fff; z-index: 950; display: none; pointer-events: none; }
body.kb-open .dt-kbmask { display: block; }
.topbar__more[hidden] { display: none; }

/* ---------------- 설정 프로필 링크 + 마이페이지 ---------------- */
.settings-profile--link { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.settings-profile--link .settings-profile__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.settings-profile__avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem; flex: none; }
.mypage__head { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 22px; }
.mypage__avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 2rem; }
.mypage__namewrap { display: flex; gap: 8px; width: 100%; max-width: 320px; }
.mypage__namewrap .field__input { flex: 1; text-align: center; font-weight: 700; }
.mypage__save { flex: none; padding: 0 18px; border-radius: 12px; }
.mypage__save:disabled { opacity: 0.4; }
.mypage__email { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------------- 마이페이지 리뉴얼 ---------------- */
.mp-head { display: flex; align-items: center; gap: 18px; padding: 24px 20px; }
.mp-avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 2rem; flex: none; background-size: cover; background-position: center; }
.mp-avatar.has-img, .settings-profile__avatar.has-img { background-size: cover; background-position: center; }
.mp-head__info { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.mp-head__name { font-size: 1.22rem; font-weight: 800; }
.mp-head__email { color: var(--muted); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mp-head__edit { margin-top: 9px; padding: 8px 16px; font-size: 0.88rem; border-radius: 10px; }
.mp-row__label { display: flex; align-items: center; gap: 12px; }
.mp-row__label svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.mp-row--danger { color: #e5484d; }
.mp-row--danger .mp-row__label svg { color: #e5484d; }
.mpe-avatarwrap { position: relative; width: 108px; margin: 22px auto 20px; }
.mp-avatar--lg { width: 108px; height: 108px; font-size: 2.4rem; cursor: pointer; }
.mpe-cam { position: absolute; right: -2px; bottom: 0; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); cursor: pointer; }
.mpe-cam svg { width: 18px; height: 18px; }
.mpe-form .field + .field { margin-top: 12px; }
.fabmenu__item { border: none; background: none; padding: 0; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ---------------- 할 일 태그 ---------------- */
.gt-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.gt-tag { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; font: inherit; font-size: 0.84rem; font-weight: 700; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gt-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--tagc, #8e8e93); }
.gt-tag.is-on { border-color: var(--tagc); color: var(--tagc); background: color-mix(in srgb, var(--tagc) 10%, #fff); }
.gt-tag--add { border-style: dashed; color: var(--muted-soft); }
#gt-tagadd { margin-top: 10px; }
.gtodo__tag { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; color: var(--tagc, #8e8e93); background: color-mix(in srgb, var(--tagc, #8e8e93) 12%, #fff); }

/* 탭 반응 즉시화 — iOS 더블탭 줌 판정 대기(~300ms 클릭 지연) 제거 */
html { touch-action: manipulation; }

/* ============================================================
   웹(브라우저) 데스크톱 레이아웃 — 좌측 사이드바 + 밝은 헤더
   (html.dt-web 는 utils.js 가 비네이티브에서만 부여 — 앱은 영향 없음)
   ============================================================ */
@media (min-width: 900px) {
  html.dt-web .tabbar {
    top: 0; bottom: 0; right: auto; left: 0;
    width: 232px; box-sizing: border-box;
    flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 22px 12px;
    background: #f7f7f5;
    border-top: none; border-right: 1px solid var(--line);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html.dt-web .tabbar::before {
    content: "핀로그";
    display: block; padding: 4px 10px 18px;
    font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy);
  }
  html.dt-web .tabbar__item {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 11px;
    padding: 10px; border-radius: 9px;
    font-size: 0.93rem; font-weight: 600; color: var(--muted);
  }
  html.dt-web .tabbar__item svg { width: 20px; height: 20px; }
  html.dt-web .tabbar__item:hover { background: rgba(15, 23, 42, 0.05); color: var(--text); }
  html.dt-web .tabbar__item.is-active { background: rgba(15, 23, 42, 0.08); color: var(--navy); font-weight: 700; }
  html.dt-web body.has-tabbar { padding-left: 232px; padding-bottom: 24px; }
  html.dt-web .evsheet, html.dt-web .catalog-modal { left: 232px; }

  /* 상단바: 웹에선 밝은 콘텐츠 헤더 */
  html.dt-web .topbar { background: rgba(255, 255, 255, 0.92); color: var(--navy); box-shadow: none; border-bottom: 1px solid var(--line); }
  html.dt-web .topbar__back, html.dt-web .topbar__more { color: var(--navy); }
  html.dt-web .memoedit__status { color: var(--muted); }
}

/* 웹 캘린더: 좌측 달력 / 우측 선택 날짜 일정 패널 + 달 이동 버튼 */
.fcal__nav { display: none; }
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.fcal-page { padding-bottom: 0; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "head ." "dows ." "cal events";
    column-gap: 26px;
    max-width: none; margin: 0 auto;
    align-items: stretch;
    height: calc(100dvh - 8px);
    padding-bottom: 16px; box-sizing: border-box;
  }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__carousel { height: 100%; overflow: hidden; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__track { height: 100%; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__grid { height: 100%; grid-auto-rows: minmax(0, 1fr); }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__head { grid-area: head; display: flex; align-items: center; justify-content: space-between; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__dows { grid-area: dows; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__carousel { grid-area: cal; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__events {
    grid-area: events;
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    padding: 18px 18px 22px; min-height: 0; overflow-y: auto;
    align-self: stretch;
  }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell { min-height: 0; }
  :is(html.dt-web, html.dt-app) .fcal__nav {
    display: flex; align-items: stretch;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 12px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  :is(html.dt-web, html.dt-app) .fcal__navbtn { width: 38px; height: 34px; border: none; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font: inherit; padding: 0; transition: background 0.12s ease, color 0.12s ease; }
  :is(html.dt-web, html.dt-app) .fcal__navbtn + .fcal__navbtn { border-left: 1px solid var(--line); }
  :is(html.dt-web, html.dt-app) .fcal__navbtn:hover { background: #f6f6f7; color: var(--navy); }
  :is(html.dt-web, html.dt-app) .fcal__navbtn svg { width: 16px; height: 16px; }
  :is(html.dt-web, html.dt-app) .fcal__navbtn--today { width: auto; padding: 0 14px; font-size: 0.85rem; font-weight: 700; color: var(--text); }

  /* 웹 메모 목록: 스와이프 잔상 제거 + 카드 폭 정렬 */
  html.dt-web body.memo-page #memo-list .memo-item { transform: none !important; width: 100%; box-sizing: border-box; }
  html.dt-web body.memo-page #memo-list .memo-row { width: 100%; }
  html.dt-web body.memo-page #memo-list .memo-row__actions { display: none; }
}

/* 웹 데스크톱: 본문을 사이드바 기준 좌측 정렬 (가운데 뜨는 여백 제거) */
@media (min-width: 900px) {
  html.dt-web main.container { margin-left: 0; }
  html.dt-web main.container.home-wide { margin-left: auto; }   /* 수험생 홈 위젯 캔버스는 중앙 유지 */
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal { margin-left: 0; }
}

/* 타임박스 블록: 클릭하면 수정 팝업 */
.wk__blk, .tgd__block { cursor: pointer; }

/* 웹 데스크톱: 모든 플로팅 버튼(FAB) 위치 통일 */
@media (min-width: 900px) {
  html.dt-web .fab {
    right: 72px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  }
}

/* 웹 캘린더: 전체 그리드 선 */
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__grid { background: #fff; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell,
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell--empty { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell { align-items: flex-start; padding: 8px 0 0 8px; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell.is-selected { background: #f2f2f4; }
}

/* 웹 데스크톱 타임박스: 좌측 풀스크린 시간표 + 우측 지금/주간 배분/블록 패널 */
@media (min-width: 1100px) {
  html.dt-web body:has(.tbside) { padding-bottom: 0; }
  html.dt-web main.container:has(> .tbside) {
    grid-template-columns: minmax(0, 1fr) 300px;
    max-width: none;
    height: calc(100dvh - 62px);
    align-items: stretch;
    padding-bottom: 10px; box-sizing: border-box;
  }
  html.dt-web main.container:has(> .tbside) > * { grid-column: 1; }
  html.dt-web main.container:has(> .tbside) > .tbside {
    grid-column: 2; grid-row: 1 / span 6;
    position: static; overflow-y: auto; min-height: 0;
  }
  html.dt-web main.container:has(> .tbside) > #tb-view,
  html.dt-web main.container:has(> .tbside) > #tb-editor {
    overflow-y: auto; min-height: 0; margin: 0;
  }
}

/* 웹 사이드바 "새로 만들기" — 데스크톱에서만 표시 */
.sb-new, .sb-newmenu { display: none; }
@media (min-width: 900px) {
  html.dt-web .sb-new {
    display: block; margin: 16px 10px 0; padding: 12px 14px;
    border: none; border-radius: 11px; background: var(--primary); color: #fff;
    font: inherit; font-size: 0.93rem; font-weight: 800; text-align: center; cursor: pointer;
    box-shadow: 0 6px 16px rgba(240, 68, 56, 0.28);
  }
  html.dt-web .sb-new:hover { filter: brightness(1.05); }
  html.dt-web .sb-newmenu {
    display: block; position: fixed; left: 14px; z-index: 300;
    width: 204px; background: #fff; border: 1px solid var(--line); border-radius: 13px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14); padding: 6px; box-sizing: border-box;
  }
  html.dt-web .sb-newmenu[hidden] { display: none; }
  html.dt-web .sb-newmenu a {
    display: block; padding: 10px 11px; border-radius: 8px;
    font-size: 0.92rem; font-weight: 600; color: var(--text); text-decoration: none;
  }
  html.dt-web .sb-newmenu a:hover { background: rgba(15, 23, 42, 0.05); }
}

/* 웹 홈 커스터마이징 */
.cfg-hidden { display: none !important; }
.homecfg-btn { display: none; }
@media (min-width: 900px) {
  :is(html.dt-web, html.dt-app) .homecfg-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 14px; padding: 7px 13px;
    border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
    font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--muted); cursor: pointer;
  }
  :is(html.dt-web, html.dt-app) .homecfg-btn:hover { background: #f6f6f7; color: var(--text); }
  :is(html.dt-web, html.dt-app) .homecfg-btn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
}

/* 홈 편집 모드 — 수험생 홈식 흔들림·삭제·추가 타일 */
@keyframes gw-wiggle {
  0% { transform: rotate(-0.4deg); }
  50% { transform: rotate(0.4deg); }
  100% { transform: rotate(-0.4deg); }
}
body.home-edit .gtab-grid > .gtab-col > section,
body.home-edit .gtab-grid #gnote {
  animation: gw-wiggle 0.28s ease-in-out infinite;
  position: relative;
  user-select: none;
}
.gw-del {
  position: absolute; top: -9px; left: -9px; z-index: 5;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #3a3a3f; color: #fff;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.gw-addtile {
  border: 1.5px dashed var(--line-strong); border-radius: 16px;
  background: none; color: var(--muted-soft);
  font: inherit; font-weight: 700; padding: 18px; cursor: pointer;
  margin-top: 4px;
}
.gw-addtile:hover { color: var(--text); border-color: var(--muted-soft); }
/* 웹 홈 할 일 호버 액션 (★ 중요 · ✎ 수정 · 🗑 삭제) — 스와이프 대체 (복구) */
.gt-webacts { display: none; }
@media (min-width: 1100px) {
  html.dt-web .gt-webacts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; background: #fff; padding-left: 10px; z-index: 2; }
  html.dt-web .gtodo__row:hover .gt-webacts { opacity: 1; }
  html.dt-web .gt-webacts button { border: none; background: none; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; color: var(--muted-soft); display: flex; align-items: center; justify-content: center; padding: 0; }
  html.dt-web .gt-webacts button:hover { background: rgba(15, 23, 42, 0.06); color: var(--text); }
  html.dt-web .gt-webacts [data-wact="del"]:hover { color: #e5484d; }
  html.dt-web .gt-webacts button svg { width: 16px; height: 16px; }
  html.dt-web .gtodo__row .memo-row__actions { display: none; }
  html.dt-web .gt-editin { flex: 1; min-width: 0; font: inherit; font-weight: 600; color: var(--text); border: none; outline: none; background: none; border-bottom: 1.5px solid var(--primary); padding: 0 0 2px; }
}

/* 웹 캘린더: 좌측 달력 / 우측 선택 날짜 일정 패널 + 달 이동 버튼 */
.fcal__nav { display: none; }
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.fcal-page { padding-bottom: 0; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "head ." "dows ." "cal events";
    column-gap: 26px;
    max-width: none; margin: 0 auto;
    align-items: stretch;
    height: calc(100dvh - 8px);
    padding-bottom: 16px; box-sizing: border-box;
  }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__carousel { height: 100%; overflow: hidden; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__track { height: 100%; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__grid { height: 100%; grid-auto-rows: minmax(0, 1fr); }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__head { grid-area: head; display: flex; align-items: center; justify-content: space-between; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__dows { grid-area: dows; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__carousel { grid-area: cal; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__events {
    grid-area: events;
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    padding: 18px 18px 22px; min-height: 0; overflow-y: auto;
    align-self: stretch;
  }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell { min-height: 0; }
  :is(html.dt-web, html.dt-app) .fcal__nav {
    display: flex; align-items: stretch;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 12px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  :is(html.dt-web, html.dt-app) .fcal__navbtn { width: 38px; height: 34px; border: none; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font: inherit; padding: 0; transition: background 0.12s ease, color 0.12s ease; }
  :is(html.dt-web, html.dt-app) .fcal__navbtn + .fcal__navbtn { border-left: 1px solid var(--line); }
  :is(html.dt-web, html.dt-app) .fcal__navbtn:hover { background: #f6f6f7; color: var(--navy); }
  :is(html.dt-web, html.dt-app) .fcal__navbtn svg { width: 16px; height: 16px; }
  :is(html.dt-web, html.dt-app) .fcal__navbtn--today { width: auto; padding: 0 14px; font-size: 0.85rem; font-weight: 700; color: var(--text); }

  /* 웹 메모 목록: 스와이프 잔상 제거 + 카드 폭 정렬 */
  html.dt-web body.memo-page #memo-list .memo-item { transform: none !important; width: 100%; box-sizing: border-box; }
  html.dt-web body.memo-page #memo-list .memo-row { width: 100%; }
  html.dt-web body.memo-page #memo-list .memo-row__actions { display: none; }
}

/* 웹 데스크톱: 본문을 사이드바 기준 좌측 정렬 (가운데 뜨는 여백 제거) */
@media (min-width: 900px) {
  html.dt-web main.container { margin-left: 0; }
  html.dt-web main.container.home-wide { margin-left: auto; }   /* 수험생 홈 위젯 캔버스는 중앙 유지 */
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal { margin-left: 0; }
}

/* 타임박스 블록: 클릭하면 수정 팝업 */
.wk__blk, .tgd__block { cursor: pointer; }

/* 웹 데스크톱: 모든 플로팅 버튼(FAB) 위치 통일 */
@media (min-width: 900px) {
  html.dt-web .fab {
    right: 72px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  }
}

/* 웹 캘린더: 전체 그리드 선 */
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__grid { background: #fff; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell,
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell--empty { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell { align-items: flex-start; padding: 8px 0 0 8px; }
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__cell.is-selected { background: #f2f2f4; }
}

/* 웹 데스크톱 타임박스: 좌측 풀스크린 시간표 + 우측 지금/주간 배분/블록 패널 */
@media (min-width: 1100px) {
  html.dt-web body:has(.tbside) { padding-bottom: 0; }
  html.dt-web main.container:has(> .tbside) {
    grid-template-columns: minmax(0, 1fr) 300px;
    max-width: none;
    height: calc(100dvh - 62px);
    align-items: stretch;
    padding-bottom: 10px; box-sizing: border-box;
  }
  html.dt-web main.container:has(> .tbside) > * { grid-column: 1; }
  html.dt-web main.container:has(> .tbside) > .tbside {
    grid-column: 2; grid-row: 1 / span 6;
    position: static; overflow-y: auto; min-height: 0;
  }
  html.dt-web main.container:has(> .tbside) > #tb-view,
  html.dt-web main.container:has(> .tbside) > #tb-editor {
    overflow-y: auto; min-height: 0; margin: 0;
  }
}

/* 웹 사이드바 "새로 만들기" — 데스크톱에서만 표시 */
.sb-new, .sb-newmenu { display: none; }
@media (min-width: 900px) {
  html.dt-web .sb-new {
    display: block; margin: 16px 10px 0; padding: 12px 14px;
    border: none; border-radius: 11px; background: var(--primary); color: #fff;
    font: inherit; font-size: 0.93rem; font-weight: 800; text-align: center; cursor: pointer;
    box-shadow: 0 6px 16px rgba(240, 68, 56, 0.28);
  }
  html.dt-web .sb-new:hover { filter: brightness(1.05); }
  html.dt-web .sb-newmenu {
    display: block; position: fixed; left: 14px; z-index: 300;
    width: 204px; background: #fff; border: 1px solid var(--line); border-radius: 13px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14); padding: 6px; box-sizing: border-box;
  }
  html.dt-web .sb-newmenu[hidden] { display: none; }
  html.dt-web .sb-newmenu a {
    display: block; padding: 10px 11px; border-radius: 8px;
    font-size: 0.92rem; font-weight: 600; color: var(--text); text-decoration: none;
  }
  html.dt-web .sb-newmenu a:hover { background: rgba(15, 23, 42, 0.05); }
}

/* 웹 홈 커스터마이징 */
.cfg-hidden { display: none !important; }
.homecfg-btn { display: none; }
@media (min-width: 900px) {
  :is(html.dt-web, html.dt-app) .homecfg-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 14px; padding: 7px 13px;
    border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
    font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--muted); cursor: pointer;
  }
  :is(html.dt-web, html.dt-app) .homecfg-btn:hover { background: #f6f6f7; color: var(--text); }
  :is(html.dt-web, html.dt-app) .homecfg-btn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
}

/* 홈 편집 모드 — 수험생 홈식 흔들림·삭제·추가 타일 */
@keyframes gw-wiggle {
  0% { transform: rotate(-0.4deg); }
  50% { transform: rotate(0.4deg); }
  100% { transform: rotate(-0.4deg); }
}
body.home-edit .gtab-grid > .gtab-col > section,
body.home-edit .gtab-grid #gnote {
  animation: gw-wiggle 0.28s ease-in-out infinite;
  position: relative;
  user-select: none;
}
.gw-del {
  position: absolute; top: -9px; left: -9px; z-index: 5;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #3a3a3f; color: #fff;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.gw-addtile {
  border: 1.5px dashed var(--line-strong); border-radius: 16px;
  background: none; color: var(--muted-soft);
  font: inherit; font-weight: 700; padding: 18px; cursor: pointer;
  margin-top: 4px;
}
.gw-addtile:hover { color: var(--text); border-color: var(--muted-soft); }
/* 웹 홈 할 일 호버 액션 (★ 중요 · ✎ 수정 · 🗑 삭제) — 스와이프 대체 (복구) */
.gt-webacts { display: none; }
@media (min-width: 1100px) {
  html.dt-web .gt-webacts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; background: #fff; padding-left: 10px; z-index: 2; }
  html.dt-web .gtodo__row:hover .gt-webacts { opacity: 1; }
  html.dt-web .gt-webacts button { border: none; background: none; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; color: var(--muted-soft); display: flex; align-items: center; justify-content: center; padding: 0; }
  html.dt-web .gt-webacts button:hover { background: rgba(15, 23, 42, 0.06); color: var(--text); }
  html.dt-web .gt-webacts [data-wact="del"]:hover { color: #e5484d; }
  html.dt-web .gt-webacts button svg { width: 16px; height: 16px; }
  html.dt-web .gtodo__row .memo-row__actions { display: none; }
  html.dt-web .gt-editin { flex: 1; min-width: 0; font: inherit; font-weight: 600; color: var(--text); border: none; outline: none; background: none; border-bottom: 1.5px solid var(--primary); padding: 0 0 2px; }
}

/* 웹 데스크톱 메모 워크스페이스 — 폴더(사이드바 옆) | 중앙 에디터 | 우측 검색+목록 */
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.memo-page { padding-bottom: 0; }
  :is(html.dt-web, html.dt-app) body.memo-page main.container,
  :is(html.dt-web, html.dt-app) body.memo-page main.container:has(> .memo-cats) {
    display: grid;
    grid-template-columns: 232px 330px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "cats search editor" "cats list editor";
    column-gap: 0; row-gap: 0;
    max-width: 1380px; width: auto; margin: 0 auto; padding: 0;
    height: calc(100dvh - 62px - env(safe-area-inset-top, 0px));
    background: #fff;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  }
  :is(html.dt-web, html.dt-app) body.memo-page main.container { margin-left: auto; }
  :is(html.dt-web, html.dt-app) body.memo-page .memo-search { grid-area: search; width: auto; margin: 14px 14px 10px; }
  :is(html.dt-web, html.dt-app) body.memo-page main.container > .memo-cats,
  :is(html.dt-web, html.dt-app) body.memo-page main.container:has(> .memo-cats) > .memo-cats {
    grid-area: cats;
    position: static; border: none; border-right: 1px solid var(--line); border-radius: 0;
    background: #f4f3f1; margin: 0; padding: 16px 10px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 2px; align-items: stretch;
  }
  :is(html.dt-web, html.dt-app) body.memo-page #mweb-editor {
    grid-area: editor; overflow-y: auto; background: #fff;
    border-left: 1px solid var(--line); padding: 16px 38px 48px;
  }
  :is(html.dt-web, html.dt-app) body.memo-page #mweb-editor .memoedit__body { min-height: 60vh; font-size: 1.02rem; }
  :is(html.dt-web, html.dt-app) body.memo-page #memo-list,
  :is(html.dt-web, html.dt-app) body.memo-page main.container:has(> .memo-cats) #memo-list {
    grid-area: list; display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto; padding: 0 14px 24px; min-width: 0; margin: 0;
  }
  :is(html.dt-web, html.dt-app) body.memo-page .memo-item.is-sel { border-color: var(--primary); }
  .mweb-editor__bar { display: flex; justify-content: flex-end; min-height: 20px; font-size: 0.8rem; color: var(--muted-soft); padding: 2px 0 6px; }
}

/* 웹 데스크톱 홈 — 일정은 할 일 아래로, 오른쪽엔 업무 메모 패널 */
.gnote__body { width: 100%; min-height: 340px; border: none; outline: none; resize: vertical; font: inherit; font-size: 0.95rem; line-height: 1.7; color: var(--text); background: none; box-sizing: border-box; }
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) .gtab-grid { align-items: start; }
  :is(html.dt-web, html.dt-app) .gtab-grid > .gtab-col { display: contents; }
  :is(html.dt-web, html.dt-app) .gtab-grid .gtodo--tab,
  :is(html.dt-web, html.dt-app) .gtab-grid #g-carry,
  :is(html.dt-web, html.dt-app) .gtab-grid #g-upcoming,
  :is(html.dt-web, html.dt-app) .gtab-grid #g-events { grid-column: 1; }
  :is(html.dt-web, html.dt-app) .gtab-grid #gnote,
  :is(html.dt-web, html.dt-app) .gtab-grid #gevd { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 84px; align-self: start; }
  :is(html.dt-web, html.dt-app) .gtodo__row.is-note .gtodo__item { background: #fef4f3; border-radius: 10px; }
}

/* 웹 홈 할 일 호버 액션 (★ 중요 · ✎ 수정 · 🗑 삭제) — 스와이프 대체 */
.gt-webacts { display: none; }
@media (min-width: 1100px) {
  html.dt-web .gt-webacts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; background: #fff; padding-left: 10px; z-index: 2; }
  html.dt-web .gtodo__row:hover .gt-webacts { opacity: 1; }
  html.dt-web .gt-webacts button { border: none; background: none; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; color: var(--muted-soft); font-size: 0.92rem; display: flex; align-items: center; justify-content: center; padding: 0; }
  html.dt-web .gt-webacts button:hover { background: rgba(15, 23, 42, 0.06); color: var(--text); }
  html.dt-web .gt-webacts [data-wact="del"]:hover { color: #e5484d; }
  html.dt-web .gtodo__row .memo-row__actions { display: none; }   /* 웹은 스와이프 액션 패널 숨김 */
  html.dt-web .gt-editin { flex: 1; min-width: 0; font: inherit; font-weight: 600; color: var(--text); border: none; outline: none; background: none; border-bottom: 1.5px solid var(--primary); padding: 0 0 2px; }
}
@media (min-width: 1100px) {
  html.dt-web .gt-webacts button svg { width: 16px; height: 16px; }
}

/* 홈 일정 상세 패널 */
#g-events-list [data-hev] { cursor: pointer; }
#g-events-list [data-hev]:hover { background: #f0f0f2; }
.gevd__title { margin: 2px 0 12px; font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.gevd__row { display: flex; justify-content: space-between; padding: 9px 2px; font-size: 0.9rem; border-top: 1px solid var(--line); }
.gevd__row span { color: var(--muted); font-weight: 600; }
.gevd__row b { font-weight: 700; }
#gevd .mtoday__more { display: block; margin: 14px 0 2px; text-align: center; }

/* 태블릿 캘린더: 좌측 일정 패널 / 우측 풀스크린 달력 (웹과 좌우 반대) */
@media (min-width: 1100px) {
  html.dt-app body.fcal-page .fcal {
    grid-template-columns: 340px minmax(0, 1fr);
    grid-template-areas: ". head" ". dows" "events cal";
    height: calc(100dvh - 8px - env(safe-area-inset-top, 0px));
  }
}

/* 메모 워크스페이스 컬럼 구분 보강 */
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.memo-page #memo-list { background: #fafafa; padding-top: 8px; }
  :is(html.dt-web, html.dt-app) body.memo-page .memo-search { background: #fafafa; margin: 0; padding: 14px; width: 100%; box-sizing: border-box; border: none; border-bottom: 1px solid var(--line); border-radius: 0; }
  :is(html.dt-web, html.dt-app) body.memo-page main.container { margin-left: auto; }
}

/* 태블릿 캘린더 최종 보정: 탭바·세이프에어리어 높이 + 일정 패널 꽉 채움 */
@media (min-width: 1100px) {
  html.dt-app body.fcal-page .fcal {
    height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 92px);
  }
  html.dt-app body.fcal-page .fcal__events { height: 100%; min-height: 0; box-sizing: border-box; align-self: stretch; }
}

/* 태블릿 최종: 캘린더·메모를 화면에 고정 배치로 정확히 맞춤 (수동 높이 계산 제거) */
@media (min-width: 1100px) {
  html.dt-app body.fcal-page .fcal {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 12px; right: 12px;
    height: auto; max-width: none; margin: 0; padding-bottom: 0;
  }
  html.dt-app body.fcal-page .fcal__events { height: auto; align-self: stretch; min-height: 0; }

  html.dt-app body.memo-page main.container,
  html.dt-app body.memo-page main.container:has(> .memo-cats) {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 58px);
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 0; right: 0;
    height: auto; max-width: none; margin: 0;
    border-left: none; border-right: none;
  }
}

/* 최종 해제: 일정 패널 max-height 상한 · 메모 컬럼 stretch 차단 해제 */
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.fcal-page .fcal__events { max-height: none; }
  :is(html.dt-web, html.dt-app) body.memo-page main.container,
  :is(html.dt-web, html.dt-app) body.memo-page main.container:has(> .memo-cats) { align-items: stretch; }
}

/* 메모 워크스페이스: 목록 카드 폭 통일 (스와이프 잔상 제거) + 인라인 서식 바 */
@media (min-width: 1100px) {
  :is(html.dt-web, html.dt-app) body.memo-page #memo-list .memo-item { transform: none !important; width: 100%; box-sizing: border-box; }
  :is(html.dt-web, html.dt-app) body.memo-page #memo-list .memo-row { width: 100%; }
  :is(html.dt-web, html.dt-app) body.memo-page #memo-list .memo-row__actions { display: none; }
  .mweb-editor__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
  .fmtbar--inline { position: static; display: flex; gap: 4px; padding: 0; border: none; background: none; box-shadow: none; }
  .fmtbar--inline button { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--text); cursor: pointer; padding: 0 8px; }
  .fmtbar--inline button:hover { background: #f6f6f7; }
  .fmtbar--inline .fmtbar__sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; align-self: center; }
}

/* 앱 태블릿: 타임박스 풀스크린 — 그리드가 화면을 최대한 채우도록 고정 배치
   (높이 계산 대신 fixed: 위=타이틀바 아래, 아래=탭바 위 → 어떤 기기에서도 안 잘림) */
@media (min-width: 1100px) {
  html.dt-app body:has(.tbside) { padding-bottom: 0; }
  html.dt-app main.container:has(> .tbside) {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    left: 0; right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    align-items: stretch;
    padding: 16px 16px 10px; box-sizing: border-box;   /* 위 16px: 타이틀바와 간격 */
  }
  html.dt-app main.container:has(> .tbside) > .tbside { position: static; overflow-y: auto; min-height: 0; }
  /* 사이드가 6행을 차지하므로 뷰도 6행 전체를 스팬해야 세로가 꽉 찬다 */
  html.dt-app main.container:has(> .tbside) > #tb-view,
  html.dt-app main.container:has(> .tbside) > #tb-editor {
    grid-row: 1 / span 6; overflow-y: auto; min-height: 0; margin: 0;
    display: flex; flex-direction: column;
  }
  html.dt-app main.container:has(> .tbside) > #tb-view > #tb-grid { flex: 1; display: flex; flex-direction: column; }
}

/* 앱 태블릿: 수험생 홈 하단 문구·페이지 인디케이터를 탭바에서 띄움 */
@media (min-width: 768px) {
  html.dt-app body:has(.pager) .footer-quote { margin: 26px 0 8px; }
  html.dt-app body:has(.pager) .pager-dots { padding: 4px 0 36px; }
}

/* 모바일 타임박스: 그리드 아래 주간 배분 카드 (태블릿에선 좌측 패널이 있으므로 숨김) */
.tbweekm { margin-top: 12px; padding: 14px; }
@media (min-width: 768px) and (min-height: 500px) {
  .tbweekm { display: none !important; }
}

/* 모바일 주간 배분 카드 내부 행 스타일 (태블릿 패널용 스타일이 미디어쿼리 안이라 전역 복제) */
.tbweekm .tbside__h { margin: 0 0 10px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.02em; color: var(--muted-soft); }
.tbweekm .tbside__row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 0.9rem; }
.tbweekm .tbside__row i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tbweekm .tbside__row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tbweekm .tbside__row b { font-weight: 700; color: var(--navy); font-size: 0.86rem; }
.tbweekm .tbside__sub { margin: 6px 0 0; font-size: 0.84rem; color: var(--muted); }

/* 날씨 위젯 지역 선택 메뉴 */
.weather-regionmenu {
  position: fixed; z-index: 400; width: 180px; max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16); padding: 6px; box-sizing: border-box;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.weather-regionmenu button {
  border: none; background: none; font: inherit; font-size: 0.86rem; font-weight: 600;
  padding: 8px 6px; border-radius: 8px; cursor: pointer; color: var(--text);
}
.weather-regionmenu button[data-auto] { grid-column: 1 / -1; font-weight: 700; }
.weather-regionmenu button:hover { background: rgba(15, 23, 42, 0.05); }
.weather-regionmenu button.is-on { background: #ffece9; color: var(--primary, #f04438); font-weight: 800; }
/* 지역 변경 버튼은 편집 모드가 아니어도 위젯에 올리면 보이도록 (데스크톱 호버) */
html.dt-web .widget--weather:hover .weather__region { display: flex; }
