/* 첫 화면 "오늘 할 일" (기획 1번) — 모든 클래스는 .hd- 로 시작 (+ app.js의 최근 회의록 카드 .dash-latest-meeting 재사용) */

.hd-root {
  /* 단계별 색: 글자(fg) / 연한 바탕(bg) / 줄·막대(accent) */
  --hd-danger-fg: #b42318; --hd-danger-bg: #fdecea; --hd-danger-c: #e0495e;
  --hd-warn-fg:   #7c5200; --hd-warn-bg:   #fff2d1; --hd-warn-c:   #e0a100;
  --hd-info-fg:   #1d4ed8; --hd-info-bg:   #e8effd; --hd-info-c:   #4f7cf0;
  --hd-ok-fg:     #0a6a47; --hd-ok-bg:     #e6f7ef; --hd-ok-c:     #10b981;
  --hd-muted-fg:  var(--text-muted); --hd-muted-bg: var(--surface-2); --hd-muted-c: var(--border);
  --hd-track: rgba(0, 0, 0, 0.08);
  --hd-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  container-type: inline-size;
  container-name: hd;
  max-width: 1240px;
  margin: 0 auto;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hd-root {
    --hd-danger-fg: #fca5a5; --hd-danger-bg: rgba(248, 113, 113, 0.15); --hd-danger-c: #f87171;
    --hd-warn-fg:   #f6cf6d; --hd-warn-bg:   rgba(245, 180, 40, 0.16);  --hd-warn-c:   #f5b428;
    --hd-info-fg:   #93b4fb; --hd-info-bg:   rgba(96, 140, 250, 0.16);  --hd-info-c:   #6b95f7;
    --hd-ok-fg:     #6ee7b7; --hd-ok-bg:     rgba(52, 211, 153, 0.12);  --hd-ok-c:     #34d399;
    --hd-track: rgba(255, 255, 255, 0.1);
    --hd-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] .hd-root {
  --hd-danger-fg: #fca5a5; --hd-danger-bg: rgba(248, 113, 113, 0.15); --hd-danger-c: #f87171;
  --hd-warn-fg:   #f6cf6d; --hd-warn-bg:   rgba(245, 180, 40, 0.16);  --hd-warn-c:   #f5b428;
  --hd-info-fg:   #93b4fb; --hd-info-bg:   rgba(96, 140, 250, 0.16);  --hd-info-c:   #6b95f7;
  --hd-ok-fg:     #6ee7b7; --hd-ok-bg:     rgba(52, 211, 153, 0.12);  --hd-ok-c:     #34d399;
  --hd-track: rgba(255, 255, 255, 0.1);
  --hd-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* 톤 → 현재 색 */
.hd-t-danger { --hd-fg: var(--hd-danger-fg); --hd-bg: var(--hd-danger-bg); --hd-c: var(--hd-danger-c); }
.hd-t-warn   { --hd-fg: var(--hd-warn-fg);   --hd-bg: var(--hd-warn-bg);   --hd-c: var(--hd-warn-c); }
.hd-t-info   { --hd-fg: var(--hd-info-fg);   --hd-bg: var(--hd-info-bg);   --hd-c: var(--hd-info-c); }
.hd-t-ok     { --hd-fg: var(--hd-ok-fg);     --hd-bg: var(--hd-ok-bg);     --hd-c: var(--hd-ok-c); }
.hd-t-muted  { --hd-fg: var(--hd-muted-fg);  --hd-bg: var(--hd-muted-bg);  --hd-c: var(--hd-muted-c); }

.hd-root button { font-family: inherit; }
.hd-root button:focus-visible,
.hd-root .dash-latest-meeting:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 왼쪽 위 로고 = 첫 화면으로 */
.logo-wrap.hd-home-link { cursor: pointer; border-radius: 10px; }
.logo-wrap.hd-home-link:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* ── 머리말 ───────────────────────────────────────────────────── */
.hd-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; }
.hd-greet { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); line-height: 1.3; }
.hd-date { margin: 0; font-size: 13px; color: var(--text-muted); }
.hd-tools { display: flex; align-items: center; gap: 10px; }
.hd-updated { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hd-refresh { min-height: 36px; white-space: nowrap; }
.hd-refresh:disabled { opacity: 0.65; cursor: progress; }

/* ── 알림 줄 / 연차 줄 ─────────────────────────────────────────── */
.hd-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 14px; border-radius: 10px; font-size: 13px;
  background: var(--hd-bg); color: var(--hd-fg);
}
.hd-note-btn {
  min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid currentColor; background: transparent;
  color: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.hd-note-btn:hover { background: rgba(127, 127, 127, 0.12); }

.hd-leave {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 14px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--hd-shadow);
  color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.hd-leave:hover { border-color: var(--accent); }
.hd-leave b { white-space: nowrap; }
.hd-leave-names { flex: 1; min-width: 0; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 요약 타일 ─────────────────────────────────────────────────── */
.hd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.hd-tiles > :nth-child(5) { grid-column: span 2; }   /* 휴대폰: 2열 + 마지막 하나는 한 줄 */
.hd-tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; text-align: left;
  min-height: 112px; padding: 14px 16px 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--hd-shadow); cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.hd-tile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--hd-c); }
.hd-tile:hover { border-color: var(--hd-c); transform: translateY(-1px); }
.hd-tile-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.hd-tile-label > [aria-hidden] { font-size: 15px; line-height: 1; }
.hd-tile-num { display: flex; align-items: baseline; gap: 3px; margin-top: 2px; }
.hd-tile-value { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.hd-tile.hd-t-warn .hd-tile-value, .hd-tile.hd-t-danger .hd-tile-value { color: var(--hd-fg); }
.hd-tile.hd-t-muted .hd-tile-value { color: var(--text-muted); }
.hd-tile-unit { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hd-tile-sub { font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.hd-tile.hd-t-danger .hd-tile-sub, .hd-tile.hd-t-warn .hd-tile-sub { color: var(--hd-fg); font-weight: 600; }

/* 태블릿: 3칸 + 2칸(넓게), 넓은 화면: 5칸 한 줄 */
@container hd (min-width: 480px) {
  .hd-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hd-tiles > :nth-child(n) { grid-column: span 2; }
  .hd-tiles > :nth-child(n+4) { grid-column: span 3; }
}
@container hd (min-width: 780px) {
  .hd-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hd-tiles > :nth-child(n) { grid-column: span 1; }
}

/* ── 본문 카드 / 두 칸 ─────────────────────────────────────────── */
.hd-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.hd-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@container hd (min-width: 640px) {   /* 화면 폭 약 960px 이상 (왼쪽 메뉴 240px 제외) */
  .hd-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}
@supports not (container-type: inline-size) {
  @media (min-width: 1000px) { .hd-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
}
.hd-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--hd-shadow); overflow: hidden; }
.hd-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.hd-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.hd-chip {
  padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--rose-light); color: var(--rose-dark);
}
:root[data-theme="dark"] .hd-chip { color: #f0a3b4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hd-chip { color: #f0a3b4; } }

/* ── 오늘 할 일 줄 ─────────────────────────────────────────────── */
.hd-list { list-style: none; margin: 0; padding: 0; }
.hd-list > li { border-top: 1px solid var(--border); }
.hd-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 11px 14px 11px 12px;
  background: transparent; color: var(--text); border: 0; border-left: 4px solid var(--hd-c); text-align: left; cursor: pointer;
  transition: background 0.12s;
}
.hd-row:hover { background: var(--bg-hover); }
.hd-row.hd-skel { cursor: default; border-left-color: transparent; }
.hd-row-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 11px; background: var(--hd-bg); font-size: 18px;
  line-height: 1; overflow: hidden; white-space: nowrap;   /* 아이콘 칸에 긴 글자가 들어와도 밖으로 안 나가게 */
}
.hd-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hd-row-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hd-row-detail { font-size: 12.5px; line-height: 1.45; color: var(--text-muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hd-t-danger.hd-row .hd-row-detail, .hd-t-warn.hd-row .hd-row-detail { color: var(--hd-fg); }
.hd-t-ok.hd-row .hd-row-title { color: var(--text-muted); font-weight: 500; }
.hd-row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.hd-chev { color: var(--text-muted); font-size: 20px; line-height: 1; }
.hd-count {
  min-width: 26px; padding: 2px 8px; border-radius: 99px; text-align: center; font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; background: var(--hd-bg); color: var(--hd-fg);
}
.hd-pill {
  padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums; background: var(--hd-bg); color: var(--hd-fg);
}
.hd-prog { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.hd-bar { flex: 1; height: 6px; background: var(--hd-track); border-radius: 99px; overflow: hidden; }
.hd-bar > i { display: block; height: 100%; background: var(--hd-c); border-radius: 99px; transition: width 0.25s; }
.hd-prog-n { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.hd-empty { padding: 26px 16px 22px; text-align: center; color: var(--text-muted); }
.hd-empty p { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.hd-empty-ico { display: block; margin-bottom: 6px; font-size: 30px; }
.hd-empty-sm { padding: 18px 16px; }
.hd-empty-sm p { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* ── 다가오는 일정 ─────────────────────────────────────────────── */
.hd-up {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px;
  background: transparent; color: var(--text); border: 0; text-align: left; cursor: pointer; transition: background 0.12s;
}
.hd-up:hover { background: var(--bg-hover); }
.hd-up-date { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.hd-up-date b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hd-up-date small { font-size: 11px; color: var(--text-muted); }
.hd-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hd-up-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hd-up-detail { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 최근 회의록 카드(기존 .dash-latest-meeting 재사용) / 바로가기 ─── */
.hd-root .dash-latest-meeting { max-width: none; margin-top: 0; width: auto; }
.hd-root .dash-latest-meeting[hidden] { display: none; }
.hd-shortcuts { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; margin-top: 20px; }

/* ── 오류 / 불러오는 중 ────────────────────────────────────────── */
.hd-fail { padding: 30px 16px; text-align: center; color: var(--text-muted); }
.hd-fail-ico { font-size: 32px; margin-bottom: 8px; }
.hd-fail p { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.hd-fail .hd-fail-sub { margin-bottom: 14px; font-size: 12.5px; font-weight: 400; color: var(--text-muted); }

.hd-skel { cursor: default; }
.hd-skel:hover { transform: none; border-color: var(--border); }
.hd-skel::before { background: transparent; }
.hd-sk { display: block; height: 11px; margin: 5px 0; border-radius: 6px; background: var(--hd-track); animation: hd-pulse 1.3s ease-in-out infinite; }
.hd-sk-big { height: 28px; width: 40%; }
.hd-sk-dot { width: 36px; height: 36px; margin: 0; border-radius: 11px; flex: none; }
@keyframes hd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .hd-sk { animation: none; }
  .hd-tile, .hd-row, .hd-up, .hd-bar > i { transition: none; }
  .hd-tile:hover { transform: none; }
}

/* ── 좁은 화면 ─────────────────────────────────────────────────── */
@container hd (max-width: 480px) {
  .hd-greet { font-size: 21px; }
  .hd-tile { min-height: 100px; padding: 12px 12px 10px; }
  .hd-tile-value { font-size: 26px; }
  .hd-tools { width: 100%; justify-content: space-between; }
  .hd-row { gap: 10px; padding-right: 10px; }
  .hd-row-icon { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
  .hd-up { gap: 10px; padding: 10px 12px; }
}
