/* 배달의민족 주아체 — fonts/BMJUA-LICENSE.txt 참고 */
@font-face {
  font-family: "BM JUA";
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/BMJUA.woff2") format("woff2");
}

:root {
  --bg: #e8eef7;
  --bg-accent: linear-gradient(145deg, #e8eef7 0%, #dce6f2 45%, #ebe6f6 100%);
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --border: #c5d1e3;
  --text: #1a2740;
  --muted: #5a6882;
  --accent: #2f4f7a;
  --accent-deep: #243d63;
  --accent-mid: #4a6fa5;
  --accent-soft: #e4ebf7;
  --highlight: #4a60a9;
  --highlight-deep: #3d4f8f;
  --highlight-soft: #e4eaf7;
  --sun: #b8475a;
  --sun-bg: #faf0f3;
  --sat: #3d6ea8;
  --sat-bg: #eaf1fa;
  --cal-bg: #b8c8de;
  --cal-border: #a8bcd4;
  --cal-header: linear-gradient(180deg, #2f4f7a 0%, #243d63 100%);
  --cal-header-sun: #f0b8c0;
  --cal-header-sat: #a8c8f0;
  --today-bg: linear-gradient(165deg, #e8dff8 0%, #f4effc 42%, #ebe3f9 100%);
  --today-border: #4a60a9;
  --today-border-hover: #3f528f;
  --today-glow: rgba(74, 96, 169, 0.22);
  --today-glow-strong: rgba(74, 96, 169, 0.28);
  --shadow: 0 10px 30px rgba(26, 39, 63, 0.08);
  --shadow-sm: 0 2px 8px rgba(26, 39, 63, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "NanumGothicBold", "Nanum Gothic", sans-serif;
  --font-extrabold: "NanumGothicExtraBold", "NanumGothicBold", sans-serif;
  --font-schedule: "BM JUA", "NanumGothicBold", "Nanum Gothic", sans-serif;
  --hour-unit: 34px;
  --hour-unit-modal: 34px;
  --scrollbar-size: 7px;
  --scrollbar-size-compact: 5px;
  --scrollbar-track: rgba(47, 79, 122, 0.07);
  --scrollbar-thumb: rgba(74, 111, 165, 0.42);
  --scrollbar-thumb-hover: rgba(47, 79, 122, 0.62);
  --scrollbar-thumb-active: rgba(36, 61, 99, 0.78);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── 스크롤바 (Firefox + WebKit) ── */
html,
body,
.sidebar,
.day-modal-body,
.mobile-agenda,
.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day),
.calendar.calendar--week .slot-list:not(.slot-list--all-day) {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.day-modal-body::-webkit-scrollbar,
.mobile-agenda::-webkit-scrollbar,
.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar,
.calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar,
.calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar {
  width: var(--scrollbar-size-compact);
  height: var(--scrollbar-size-compact);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.day-modal-body::-webkit-scrollbar-track,
.mobile-agenda::-webkit-scrollbar-track,
.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-track,
.calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  margin: 3px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.day-modal-body::-webkit-scrollbar-thumb,
.mobile-agenda::-webkit-scrollbar-thumb,
.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb,
.calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-mid) 0%, var(--accent) 100%);
  border-radius: 999px;
  border: 1.5px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.day-modal-body::-webkit-scrollbar-thumb:hover,
.mobile-agenda::-webkit-scrollbar-thumb:hover,
.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb:hover,
.calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover) 0%, var(--accent-deep) 100%);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active,
.sidebar::-webkit-scrollbar-thumb:active,
.day-modal-body::-webkit-scrollbar-thumb:active,
.mobile-agenda::-webkit-scrollbar-thumb:active,
.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb:active,
.calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--scrollbar-thumb-active) 0%, var(--accent-deep) 100%);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.sidebar::-webkit-scrollbar-corner,
.day-modal-body::-webkit-scrollbar-corner {
  background: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  html::-webkit-scrollbar-thumb,
  body::-webkit-scrollbar-thumb,
  .sidebar::-webkit-scrollbar-thumb,
  .day-modal-body::-webkit-scrollbar-thumb,
  .mobile-agenda::-webkit-scrollbar-thumb,
  .calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb,
  .calendar.calendar--week .slot-list:not(.slot-list--all-day)::-webkit-scrollbar-thumb {
    transition: background 0.18s ease;
  }
}

html {
  height: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-accent);
}

.page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 10px 14px;
  overflow: hidden;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mode-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px 6px 12px;
}

.mode-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s;
}

.mode-label.active {
  color: var(--text);
}

.mode-control--compact {
  padding: 0;
  gap: 6px;
  background: transparent;
  border: none;
}

.mode-control--compact .toggle-track {
  width: 34px;
  height: 20px;
}

.mode-control--compact .toggle-track::after {
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
}

.mode-control--compact .toggle-switch input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.mode-control--compact .auth-role-badge {
  font-size: 0.68rem;
  padding: 4px 8px;
}

.mode-control--compact .mode-status {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.mode-control--compact .mode-status--streamer {
  color: var(--highlight);
}

.auth-login-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.auth-login-input {
  width: 108px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  background: #fff;
  color: var(--text);
}

.auth-login-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--highlight) 45%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--highlight) 16%, transparent);
}

.auth-login-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.header-auth .auth-login-form .btn-sm {
  height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: #fff;
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.beta-badge.hidden {
  display: none;
}

html.is-beta .page-title {
  display: inline-flex;
  align-items: center;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c8d0dc;
  position: relative;
  transition: background 0.2s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--accent) 0%, var(--highlight) 100%);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.76rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-google {
  background: #fff;
  color: #333;
  border-color: #dadce0;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.header--sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.header--sidebar .header-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header--sidebar .page-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 1.32rem;
  line-height: 1.15;
}

.header--sidebar .header-top-row .header-auth {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-top: 2px;
}

.header--sidebar .header-auth .mode-control--auth {
  align-items: center;
}

.header--sidebar .header-auth .auth-login-btn {
  height: 24px;
  min-height: 24px;
  padding: 0 9px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  box-shadow: none;
}

.header--sidebar .header-auth .auth-login-btn:hover {
  transform: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.auth-user-menu {
  position: relative;
}

.auth-user-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  line-height: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.auth-user-trigger:hover {
  transform: scale(1.04);
}

.auth-user-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--highlight) 55%, transparent);
  outline-offset: 2px;
}

.auth-user-avatar-wrap {
  position: relative;
  display: inline-flex;
}

.auth-user-avatar {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 85%, transparent);
}

.auth-user-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--highlight) 100%);
}

.auth-user-streamer-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #43a047;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, #43a047 35%, transparent);
}

.auth-user-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 196px;
  padding: 0;
  border-radius: 14px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--border) 90%, #fff);
  box-shadow:
    0 4px 6px -2px rgba(20, 28, 45, 0.06),
    0 16px 32px -8px rgba(20, 28, 45, 0.16);
  overflow: hidden;
}

.auth-user-popover::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef3f9 100%);
  border-top: 1px solid color-mix(in srgb, var(--border) 90%, #fff);
  border-left: 1px solid color-mix(in srgb, var(--border) 90%, #fff);
  transform: rotate(45deg);
}

.auth-user-popover.hidden {
  display: none;
}

.auth-user-popover-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef3f9 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}

.auth-user-popover-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(20, 28, 45, 0.1);
}

.auth-user-popover-avatar.auth-user-avatar--fallback {
  font-size: 0.72rem;
}

.auth-user-popover-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.auth-user-popover-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.auth-user-popover-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--accent-deep, #243a6e);
  line-height: 1.2;
  word-break: break-all;
  letter-spacing: -0.02em;
}

.auth-user-popover-name-row .auth-role-badge {
  font-size: 0.6rem;
  padding: 3px 8px;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 0;
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-user-menu-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.72;
}

.auth-user-menu-item--logout {
  color: #5c6578;
}

.auth-user-menu-item--logout:hover {
  background: #fff5f5;
  color: #c62828;
}

.auth-user-menu-item--logout:hover .auth-user-menu-icon {
  opacity: 1;
}

.header--sidebar .header-month {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.header--sidebar .header-month .month-title {
  min-width: 0;
  flex: 1;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.header--sidebar .header-month .nav-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.debut-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin: 6px 0 2px;
  padding: 0;
  line-height: 1;
  text-align: center;
}

.debut-day.hidden {
  display: none;
}

.debut-day-value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep, #243a6e);
}

.debut-day-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.page-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--highlight) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-month {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-month .month-title {
  min-width: 112px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.header-month .nav-btn {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.header-auth {
  flex-shrink: 0;
}

.header-auth .mode-control {
  padding: 4px 8px;
  gap: 8px;
}

.main-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 12px;
  align-items: stretch;
}

.calendar-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.calendar-column .calendar-wrap {
  flex: 1;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html.display-timeline .sidebar {
  max-height: none;
}

.sidebar .panel {
  padding: 14px 14px 12px;
}

.sidebar .panel-foot {
  margin-top: 10px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-head h3::before {
  content: "";
  flex-shrink: 0;
  width: 4px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-mid) 0%, var(--accent-deep) 100%);
}

.panel-head .hl-count,
.panel-head .btn-sm {
  flex-shrink: 0;
  margin: 0;
  height: 26px;
  min-height: 26px;
  line-height: 1;
}

.panel-head .btn-sm {
  padding: 0 11px;
  font-size: 0.74rem;
}

.panel-foot {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}

.edit-hint--inline {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.74rem;
  border-radius: var(--radius-sm);
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.brand h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.note {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
}

.month-title {
  margin: 0;
  min-width: 84px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.nav-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend--edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-panel--readonly .legend--edit,
body:not(.edit-mode) .legend-panel .cat-editor,
body:not(.edit-mode) .legend-panel #cat-add-btn {
  display: none !important;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
}

.edit-mode .legend-item--editable {
  cursor: context-menu;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cat-editor {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cat-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  background: var(--chip-bg, #fff);
  color: var(--chip-text, #333);
  border: 1px solid color-mix(in srgb, var(--chip-text, #333) 18%, transparent);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.cat-color-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.cat-color-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--muted);
}

.cat-color-field input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.cat-label-input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.cat-delete-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 8px;
  background: #fff5f4;
  color: #c0392b;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
}

.cat-delete-btn:hover {
  background: #fdecea;
}

.calendar-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  --cal-grid-gap: 3px;
  --cal-grid-pad: 3px;
  background: var(--cal-bg);
  border: 1px solid var(--cal-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.weekdays {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--cal-grid-gap);
  padding: var(--cal-grid-pad) var(--cal-grid-pad) 2px;
  background: var(--cal-bg);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.weekdays span {
  padding: 8px 2px;
  border-radius: 10px;
  background: var(--cal-header);
  color: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 1px 2px rgba(20, 28, 45, 0.1);
}

.weekdays span:first-child {
  color: var(--cal-header-sun);
}

.weekdays span:last-child {
  color: var(--cal-header-sat);
}

.calendar {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(var(--calendar-rows, 6), minmax(0, 1fr));
  gap: var(--cal-grid-gap);
  padding: var(--cal-grid-pad);
  background: var(--cal-bg);
}

.calendar.calendar--week {
  grid-template-rows: minmax(0, 1fr);
}

.calendar.calendar--week .day-cell:not(.empty) {
  min-height: 0;
}

.day-cell {
  min-height: 0;
  height: 100%;
  padding: 7px 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px rgba(26, 34, 51, 0.06);
  isolation: isolate;
  cursor: default;
  transition: box-shadow 0.15s;
  overflow: hidden;
}

.day-cell:not(.empty):hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px rgba(26, 34, 51, 0.06);
}

.day-head--detail {
  cursor: pointer;
  border-radius: 8px;
  margin: -2px -4px 0;
  padding: 2px 4px 0;
  transition: background 0.15s;
}

.day-head--detail:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.day-head--detail:focus-visible {
  outline: 2px solid rgba(26, 34, 51, 0.35);
  outline-offset: 1px;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 28px;
  flex-shrink: 0;
}

.day-bangon-time {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  max-width: 58%;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7faff 0%, #edf2fa 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, #d5dde8);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 1px 2px rgba(26, 39, 63, 0.05);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: color-mix(in srgb, var(--accent) 82%, #1a2233);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-head-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

@keyframes today-badge-blink {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--highlight) 35%, transparent);
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 5px transparent;
  }
}

.today-badge {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--highlight);
  animation: today-badge-blink 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .today-badge {
    animation: none;
  }
}

.day-cell.empty {
  background: linear-gradient(180deg, #e3eaf4 0%, #d8e1ed 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
  opacity: 0.92;
}

.day-cell.today {
  border: 2px solid var(--today-border);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--today-border) 18%, transparent),
    0 4px 12px var(--today-glow);
  z-index: 2;
}

.day-cell.today::before,
.day-cell.today::after {
  display: none;
}

.day-cell.today:not(.empty):hover {
  border-color: var(--today-border-hover);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--today-border-hover) 22%, transparent),
    0 6px 16px var(--today-glow-strong);
}

.day-cell.today .day-num,
.day-cell.today.sun .day-num,
.day-cell.today.sat .day-num {
  background: linear-gradient(135deg, var(--highlight) 0%, var(--highlight-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--highlight-deep) 35%, transparent);
}

.day-num {
  font-size: 0.88rem;
  font-weight: 800;
  min-width: 28px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 7px;
  background: var(--surface-2);
  border: 1px solid rgba(26, 39, 63, 0.06);
}

.day-cell.sun .day-num {
  color: var(--sun);
  background: var(--sun-bg);
}

.day-cell.sat .day-num {
  color: var(--sat);
  background: var(--sat-bg);
}

.slot-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day),
.calendar.calendar--week .slot-list:not(.slot-list--all-day) {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html:not(.display-timeline) .calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day),
html:not(.display-timeline) .calendar.calendar--week .slot-list:not(.slot-list--all-day) {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.day-cell--scroll::after {
  display: none;
}

.day-cell--scroll .slot-list:not(.slot-list--all-day) {
  padding-bottom: 4px;
  scroll-padding-bottom: 4px;
}

.day-cell:has(.slot-overflow-hint:not(.is-collapsed)) .slot-list:not(.slot-list--all-day) {
  mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 14px), rgba(0, 0, 0, 0.45) calc(100% - 6px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 14px), rgba(0, 0, 0, 0.45) calc(100% - 6px), transparent 100%);
}

.slot-overflow-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 3;
  height: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 1px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgba(47, 79, 122, 0.92);
  pointer-events: none;
  overflow: visible;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.26s ease,
    transform 0.26s ease,
    height 0.3s ease,
    padding 0.3s ease;
}

.slot-overflow-hint::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(255, 255, 255, 0.72) 52%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: blur(5px) saturate(1.1);
  -webkit-backdrop-filter: blur(5px) saturate(1.1);
  transition: opacity 0.26s ease;
}

.slot-overflow-hint.is-collapsed {
  opacity: 0;
  transform: translateY(4px);
  height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.slot-overflow-hint.is-collapsed::before {
  opacity: 0;
}

.day-cell.today .slot-overflow-hint::before {
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(247, 244, 252, 0.78) 55%,
    rgba(247, 244, 252, 0) 100%
  );
}

.day-cell.today .slot-overflow-hint {
  color: color-mix(in srgb, var(--highlight-deep) 95%, transparent);
}

.calendar[data-calendar-rows="6"] .day-cell:not(.empty) {
  padding: 5px 6px 4px;
  gap: 4px;
}

.calendar[data-calendar-rows="6"] .day-head {
  min-height: 28px;
}

.calendar[data-calendar-rows="6"] .day-bangon-time {
  max-width: 62%;
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 0.52rem;
}

.calendar[data-calendar-rows="6"] .day-num {
  height: 22px;
  min-width: 24px;
  font-size: 0.8rem;
}

.calendar[data-calendar-rows="6"] .today-badge {
  font-size: 0.52rem;
  padding: 2px 5px;
}

.calendar[data-calendar-rows="6"] .slot-list:not(.slot-list--all-day) {
  gap: 3px;
}

/* ── 전체(시간) 보기: 페이지 스크롤 + 사이드바 화면 고정 ── */
html.display-timeline,
html.display-timeline body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

html.display-timeline .page {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

html.display-timeline .layout {
  flex: none;
  min-height: auto;
  align-items: start;
}

html.display-timeline .calendar-column {
  height: auto;
  min-height: 0;
  overflow: visible;
}

@media (min-width: 901px) {
  html.display-timeline .layout {
    display: block;
  }

  html.display-timeline .calendar-column {
    margin-right: 284px;
  }

  html.display-timeline .sidebar {
    position: fixed;
    top: 10px;
    right: max(14px, env(safe-area-inset-right, 0px));
    width: 272px;
    height: auto;
    max-height: calc(100dvh - 20px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 20;
  }
}

html.display-timeline .sidebar .header--sidebar,
html.display-timeline .sidebar .highlights-panel,
html.display-timeline .sidebar .layout-panel,
html.display-timeline .sidebar .legend-panel {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

html.display-timeline .day-head {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

html.display-timeline .slot-list:not(.slot-list--all-day) {
  position: relative;
  z-index: 1;
}

html.display-timeline .slot-list--has-evening > .slot-chip--evening:first-of-type {
  margin-top: auto;
}

html.display-timeline .calendar:not(.calendar--week) .slot-chip,
html.display-timeline .calendar.calendar--week .slot-chip,
html.display-timeline .day-cell:not(.day-cell--scroll) .slot-chip {
  flex: var(--slot-hours, 1) 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}

html.display-timeline .day-cell--all-day,
html.display-timeline .day-cell.empty {
  min-height: var(--calendar-row-min, 212px);
}

html.display-timeline .calendar-column .calendar-wrap {
  flex: none;
  min-height: auto;
  overflow: visible;
  overscroll-behavior: auto;
}

html.display-timeline .calendar {
  flex: none;
  min-height: 0;
  height: auto;
  overscroll-behavior: auto;
}

html.display-timeline .day-cell {
  height: auto;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
}

html.display-timeline .calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day),
html.display-timeline .calendar.calendar--week .slot-list:not(.slot-list--all-day),
html.display-timeline .slot-list:not(.slot-list--all-day) {
  flex: 0 0 var(--day-slots-height, 148px);
  height: var(--day-slots-height, 148px);
  min-height: var(--day-slots-height, 148px);
  max-height: var(--day-slots-height, 148px);
  overflow: hidden;
  overflow-y: hidden;
  overscroll-behavior: auto;
}

html.display-timeline .day-cell:has(.slot-overflow-hint:not(.is-collapsed)) .slot-list:not(.slot-list--all-day),
html.display-timeline .day-cell--scroll .slot-list:not(.slot-list--all-day) {
  mask-image: none;
  -webkit-mask-image: none;
  padding-bottom: 0;
  scroll-padding-bottom: 0;
}

html.display-timeline .slot-overflow-hint {
  display: none !important;
}

html.display-timeline .slot-chip-body {
  min-height: 0;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1px 3px;
  overflow: hidden;
}

html.display-timeline .slot-chip {
  grid-template-columns: 1fr;
  align-items: stretch;
}

html.display-timeline .slot-chip--has-start:not(.slot-chip--editable):not(.slot-chip--all-day),
html.display-timeline .slot-chip--all-day:not(.slot-chip--editable) {
  grid-template-columns: auto 1fr !important;
}

html.display-timeline .slot-chip--has-start.slot-chip--editable:not(.slot-chip--all-day),
html.display-timeline .slot-chip--all-day.slot-chip--editable {
  grid-template-columns: auto 1fr auto !important;
}

html.display-timeline .slot-chip--has-start:not(.slot-chip--all-day) .slot-chip-body,
html.display-timeline .slot-chip--all-day .slot-chip-body {
  grid-column: 2;
  padding: 1px 3px;
}

html.display-timeline .slot-chip--editable {
  grid-template-columns: 1fr;
  position: relative;
  align-items: stretch;
}

html.display-timeline .slot-chip:not(.slot-chip--has-start):not(.slot-chip--all-day) .slot-chip-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  grid-column: 1;
  min-height: 100%;
  height: 100%;
  padding: 2px 8px;
}

html.display-timeline .slot-chip--has-start:not(.slot-chip--all-day) .slot-chip-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  min-height: 100%;
  height: 100%;
  padding: 2px 8px;
}

html.display-timeline .slot-chip--all-day .slot-chip-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  min-height: 100%;
  height: 100%;
  padding: 2px 8px;
}

html.display-timeline .slot-chip--all-day .slot-text {
  text-align: center;
  width: 100%;
}

html.display-timeline .slot-duration--all-day {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour-unit, 34px) - 1px),
    rgba(30, 58, 95, 0.1) calc(var(--hour-unit, 34px) - 1px),
    rgba(30, 58, 95, 0.1) var(--hour-unit, 34px)
  ) !important;
}

html.display-timeline .slot-chip:not(.slot-chip--all-day) .slot-text {
  width: 100%;
  margin: 0;
  text-align: center;
}

html.display-timeline .day-cell:not(.day-cell--scroll) .slot-chip {
  flex: var(--slot-hours, 1) 1 0 !important;
  align-self: stretch;
  overflow: hidden;
}

html.display-timeline .calendar:not(.calendar--week) .slot-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 28px;
  width: auto;
  min-height: 100%;
  height: 100%;
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  white-space: nowrap;
  color: #1e3a5f;
  background-color: rgba(255, 255, 255, 0.55);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour-unit, 34px) - 1px),
    rgba(30, 58, 95, 0.1) calc(var(--hour-unit, 34px) - 1px),
    rgba(30, 58, 95, 0.1) var(--hour-unit, 34px)
  );
  border-right: 1px dashed rgba(30, 58, 95, 0.18);
}

html.display-timeline .slot-duration--start {
  position: relative;
  z-index: 1;
}

html.display-timeline .calendar:not(.calendar--week) .slot-text,
html.display-timeline .calendar.calendar--week .slot-text {
  white-space: pre-line;
  display: block;
  margin: 0;
  font-size: 1rem;
  line-height: 1.15;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-align: center;
  width: 100%;
}

html.display-timeline .slot-drag-handle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  padding: 0 2px;
  margin: 0;
  pointer-events: auto;
  cursor: grab;
}

html.display-timeline .slot-list:not(.slot-list--all-day) > .slot-chip--all-day {
  flex: 1 1 auto !important;
  align-self: stretch;
  min-height: var(--hour-unit, 34px);
}

html.display-timeline
  .slot-list:not(.slot-list--all-day):not(:has(> .slot-chip:not(.slot-chip--all-day)))
  > .slot-chip--all-day {
  flex: 1 1 auto !important;
  align-self: stretch;
  min-height: 100%;
  max-height: none !important;
}

html.display-timeline .slot-list:not(.slot-list--all-day) > .slot-chip--all-day:only-child {
  flex: 1 1 auto !important;
  align-self: stretch;
  min-height: 100%;
  max-height: none !important;
}

/* 1시간 1칸 */
html.cal-layout-hourly.display-timeline .calendar:not(.calendar--week) .slot-list:not(.slot-list--all-day),
html.cal-layout-hourly.display-timeline .calendar.calendar--week .slot-list:not(.slot-list--all-day),
html.cal-layout-hourly.display-timeline .slot-list:not(.slot-list--all-day) {
  flex: 0 0 auto;
  height: auto;
  min-height: var(--day-slots-height, 148px);
  max-height: none;
  overflow: visible;
}

html.cal-layout-hourly.display-timeline .day-cell:not(.day-cell--scroll) .slot-chip {
  flex: 0 0 auto !important;
  height: calc(var(--slot-hours, 1) * var(--hour-unit, 34px));
  min-height: calc(var(--slot-hours, 1) * var(--hour-unit, 34px));
  max-height: none;
}

.layout-panel {
  margin-top: 0;
}

.layout-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layout-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}

.layout-option:hover {
  border-color: color-mix(in srgb, var(--highlight) 35%, var(--border));
  background: #fafcff;
}

.layout-option.is-active {
  border-color: color-mix(in srgb, var(--highlight) 55%, var(--border));
  background: linear-gradient(135deg, #f7faff 0%, #eef4ff 100%);
  box-shadow: 0 2px 10px rgba(36, 58, 110, 0.08);
}

.layout-option.is-disabled {
  opacity: 0.72;
  pointer-events: none;
}

.layout-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.layout-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.layout-option-text strong {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-deep, #243a6e);
  letter-spacing: -0.02em;
}

.layout-option-text small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.layout-option-preview {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f2f6fb;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  display: grid;
  place-items: center;
}

.layout-preview-cell {
  width: 30px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.layout-preview-slot {
  display: block;
  height: 8px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--highlight) 28%, #fff);
  border: 1px solid color-mix(in srgb, var(--highlight) 18%, transparent);
}

.layout-option-preview--proportional .layout-preview-slot--a {
  height: 6px;
}

.layout-option-preview--proportional .layout-preview-slot--b {
  height: 12px;
}

.layout-option-preview--hourly .layout-preview-slot--a {
  height: 5px;
}

.layout-option-preview--hourly .layout-preview-slot--b {
  height: 14px;
  border-left: 3px solid color-mix(in srgb, var(--accent-deep) 55%, transparent);
}

.layout-hourly-options {
  margin-top: 4px;
  padding: 10px 12px 12px;
  border: 1.5px solid color-mix(in srgb, var(--highlight) 35%, var(--border));
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fd 100%);
}

.layout-hourly-options.hidden {
  display: none;
}

.layout-hourly-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layout-hourly-field.is-disabled {
  opacity: 0.72;
  pointer-events: none;
}

.layout-hourly-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-deep, #243a6e);
  letter-spacing: -0.02em;
}

.layout-hourly-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}

.layout-hourly-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.slot-chip {
  --hour-size: var(--hour-unit);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  flex: 0 0 auto;
  min-height: calc(var(--slot-hours, 1) * var(--hour-size));
  height: calc(var(--slot-hours, 1) * var(--hour-size));
  background: var(--chip-bg, #fff);
  color: var(--chip-text, #333);
  border: 1px solid var(--chip-border, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.calendar:not(.calendar--week) .slot-chip:not(.slot-chip--all-day) {
  flex: 0 0 auto;
  height: var(--cell-slot-min, 28px);
  min-height: var(--cell-slot-min, 28px);
}

.day-cell:not(.day-cell--scroll):not(.day-cell--all-day) .slot-chip:not(.slot-chip--all-day) {
  flex: 1 1 0;
  height: auto;
  min-height: var(--cell-slot-min, 28px);
}

.calendar:not(.calendar--week) .slot-duration {
  background-image: none;
  align-self: stretch;
}

.slot-chip--editable {
  grid-template-columns: auto 1fr auto;
}

.slot-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1e3a5f;
  background-color: rgba(255, 255, 255, 0.55);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour-size) - 1px),
    rgba(30, 58, 95, 0.1) calc(var(--hour-size) - 1px),
    rgba(30, 58, 95, 0.1) var(--hour-size)
  );
  border-right: 1px dashed rgba(30, 58, 95, 0.18);
}

.slot-chip-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5px;
  overflow: hidden;
}

.slot-index {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0.55;
  line-height: 1.5;
  min-width: 10px;
}

.slot-text {
  font-family: var(--font-schedule);
  font-size: 1rem;
  font-weight: normal;
  line-height: 1.15;
  white-space: pre-line;
  overflow: hidden;
  display: block;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.slot-members {
  display: block;
  width: 100%;
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  color: color-mix(in srgb, var(--chip-text, #333) 72%, #000);
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-duration--start {
  font-size: 0.72rem;
  letter-spacing: -0.04em;
}

.calendar--week .slot-text {
  white-space: pre-line;
  overflow: hidden;
}

.hl-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(47, 79, 122, 0.18);
}

.highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlight-item {
  margin: 0;
  cursor: pointer;
}

.hl-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  min-height: 44px;
  background: var(--chip-bg, #fff);
  color: var(--chip-text, #333);
  border: 1px solid var(--chip-border, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.highlight-item:hover .hl-card {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hl-date-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 2px 6px;
  background-color: rgba(255, 255, 255, 0.55);
  border-right: 1px dashed color-mix(in srgb, var(--chip-text, #333) 18%, transparent);
  border-radius: 0;
}

.hl-date-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--chip-text, #333);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hl-date-dow {
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--chip-text, #333);
  opacity: 0.72;
}

.hl-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 2px 8px 2px 6px;
}

.hl-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hl-cat {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip-text, #333) 10%, var(--chip-bg, #fff));
  color: var(--chip-text, #333);
  border: 1px solid color-mix(in srgb, var(--chip-text, #333) 18%, transparent);
}

.hl-today-badge {
  margin-top: 4px;
  font-size: 0.52rem;
  padding: 2px 6px;
}

.hl-text {
  margin: 0;
  font-family: var(--font-schedule);
  font-size: 0.76rem;
  font-weight: normal;
  line-height: 1.25;
  color: var(--chip-text, #333);
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.highlight-item--today .hl-card {
  border: 2px solid var(--today-border);
  box-shadow: 0 2px 10px var(--today-glow);
}

.highlight-item--today:hover .hl-card {
  border-color: var(--today-border-hover);
  box-shadow: 0 4px 14px var(--today-glow-strong);
}

.highlight-item--today .hl-date-pill {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--highlight) 16%, transparent) 0%,
    rgba(255, 255, 255, 0.55) 100%
  );
  border-right-color: color-mix(in srgb, var(--today-border) 28%, transparent);
}

.highlight-item--today .hl-date-num {
  color: var(--highlight-deep);
}

.highlight-item--today .hl-date-dow {
  color: var(--highlight);
  opacity: 1;
}

.edit-mode .highlight-item--editable {
  cursor: pointer;
}

.edit-mode .highlight-item--editable .hl-card {
  cursor: pointer;
}

.highlights-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin: 0;
  padding: 22px 14px;
  border: 1px dashed rgba(79, 110, 247, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
}

.highlights-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 110, 247, 0.14);
}

.highlights-empty-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.highlights-empty-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--muted);
}

.sidebar-foot {
  margin: 16px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}

.font-credit {
  margin-top: 10px;
  padding: 0 2px;
}

.font-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.font-credit a:hover {
  color: var(--accent);
}

.footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf2f7;
  color: #4a5568;
}

.auth-role-badge.streamer {
  background: #e8f5e9;
  color: #2e7d32;
}

body.modal-open {
  overflow: hidden;
}

html.modal-open,
html.display-timeline.modal-open,
html.display-timeline.modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.day-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  overscroll-behavior: contain;
}

.day-modal.hidden {
  display: none;
}

.day-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 28, 0.52);
  backdrop-filter: blur(6px);
}

.day-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: min(85vh, 680px);
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgba(20, 28, 45, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.day-modal-card--today {
  box-shadow:
    0 24px 60px rgba(20, 28, 45, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 0 0 2px color-mix(in srgb, var(--today-border) 28%, transparent);
}

.day-modal-card--today .day-modal-header {
  border-bottom-color: color-mix(in srgb, var(--today-border) 24%, var(--border));
}

.day-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 16px;
  background: linear-gradient(180deg, #f8fafd 0%, #fff 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.day-modal-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-modal-kicker {
  margin: 0;
}

.day-modal-kicker:empty {
  display: none;
}

.day-modal-today-badge {
  align-self: flex-start;
  font-size: 0.62rem;
  padding: 3px 8px;
  animation: none;
}

.day-modal-bangon-wrap {
  flex-shrink: 0;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.day-modal-bangon-wrap.hidden {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

.day-modal-schedule {
  min-height: 0;
}

.day-modal-bangon {
  display: block;
}

.bangon-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bangon-picker-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.bangon-picker-presets .bangon-chip {
  width: 100%;
  padding: 7px 6px;
  font-size: 0.72rem;
  text-align: center;
}

.bangon-hour-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.bangon-grid-btn {
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: #fff;
  color: #3d4657;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 7px 2px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.bangon-grid-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: #f7f9fd;
}

.bangon-grid-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: color-mix(in srgb, var(--accent) 88%, #1e2636);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.bangon-custom-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--border) 90%, transparent);
  background: rgba(255, 255, 255, 0.72);
}

.bangon-custom-field--active {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, #fff);
}

.bangon-custom-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.bangon-custom-input {
  flex: 0 1 auto;
  width: auto;
  min-width: 108px;
  max-width: 132px;
  margin-left: auto;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e2636;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
}

.bangon-custom-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.day-modal-bangon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-modal-bangon-row--presets {
  padding-top: 2px;
}

.bangon-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: #3d4657;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 8px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.bangon-chip--hour {
  flex: 0 0 auto;
  min-width: 50px;
  text-align: center;
}

.bangon-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: #f7f9fd;
}

.bangon-chip.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: color-mix(in srgb, var(--accent) 88%, #1e2636);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.bangon-chip--preset {
  background: #f8fafc;
}

.bangon-chip--preset.is-active {
  background: color-mix(in srgb, var(--accent) 14%, #f8fafc);
}

.day-modal-bangon-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f7faff 0%, #edf2fa 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, #d5dde8);
}

.day-modal-bangon-view .day-modal-bangon-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e2636;
  letter-spacing: -0.02em;
}

.day-modal-header h2 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.35;
  color: #1a2233;
  letter-spacing: -0.02em;
}

.day-modal-close {
  flex-shrink: 0;
  border: none;
  background: rgba(240, 243, 248, 0.9);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #5c667a;
  transition: background 0.15s, color 0.15s;
}

.day-modal-close:hover {
  background: #e8edf5;
  color: #2d3748;
}

.day-modal-body {
  padding: 12px 18px 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.day-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-all-day-card + .day-detail-list {
  margin-top: 8px;
}

.day-detail-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: stretch;
  min-height: calc(var(--item-hours, 1) * var(--day-modal-hour-unit, 76px));
  height: calc(var(--item-hours, 1) * var(--day-modal-hour-unit, 76px));
  background: var(--item-accent, var(--surface));
  border: 1px solid color-mix(in srgb, var(--item-text, #333) 16%, transparent);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 28, 45, 0.06);
}

.day-detail-item--no-badge {
  grid-template-columns: 1fr;
}

.day-detail-item > .day-detail-body {
  min-height: 0;
  align-self: stretch;
}

.day-detail-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 44px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--item-text, #1e3a5f);
  background-color: color-mix(in srgb, #fff 58%, var(--item-accent, #fff));
  background-image: none;
  border: none;
  border-right: 1px solid color-mix(in srgb, var(--item-text, #333) 14%, transparent);
  border-radius: 0;
}

.day-detail-duration.slot-duration--start {
  min-width: 48px;
  font-size: 0.74rem;
  line-height: 1.15;
  white-space: nowrap;
}

.day-detail-duration.slot-duration--all-day {
  font-size: 0;
}

.day-detail-body {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.day-detail-main {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 3px;
  padding: 10px 12px;
  padding-top: calc(var(--day-detail-foot-reserve, 40px) * 0.35);
  padding-bottom: calc(var(--day-detail-foot-reserve, 40px) * 0.65 + 4px);
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
}

.day-detail-item--has-members .day-detail-main {
  justify-content: center;
  padding-top: calc(var(--day-detail-foot-reserve, 40px) * 0.35);
  padding-bottom: calc(var(--day-detail-foot-reserve, 40px) * 0.65 + 4px);
  transform: translateY(-7px);
}

.day-detail-item--has-members .day-detail-text {
  line-height: 1.25;
}

.day-detail-item--has-members .day-detail-members {
  line-height: 1.3;
}

.day-detail-text,
.day-detail-members {
  pointer-events: auto;
}

.day-detail-text {
  margin: 0;
  flex: 0 0 auto;
  width: 100%;
  font-family: var(--font-schedule);
  font-size: 1.08rem;
  font-weight: normal;
  line-height: 1.35;
  color: var(--item-text, #1e2636);
  text-align: left;
  overflow: hidden;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.day-detail-members {
  margin: 0;
  flex: 0 0 auto;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  color: color-mix(in srgb, var(--item-text, #333) 78%, #000);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-detail-tag--muted {
  opacity: 0.72;
}

.day-detail-tag--muted::before {
  opacity: 0.45;
}

.day-detail-foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  width: auto;
  min-height: 0;
  overflow: hidden;
}

.day-detail-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.day-detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--item-text, #333) 82%, #000);
}

.day-detail-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.88;
  flex-shrink: 0;
}

.day-detail-tag--all-day::before {
  width: auto;
  height: auto;
  border-radius: 2px;
  background: none;
  border: 1.5px solid currentColor;
  width: 7px;
  height: 7px;
  opacity: 0.75;
}

.day-detail-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.day-modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
}

.day-modal-empty-icon {
  font-size: 2rem;
  line-height: 1;
  opacity: 0.85;
}

.day-modal-empty-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #3d4657;
}

.day-modal-empty-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.day-detail-btn {
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--item-text, #333) 16%, transparent);
  background: color-mix(in srgb, #fff 75%, var(--item-accent, #fff));
  color: var(--item-text, #4a5568);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.day-detail-btn:hover {
  background: #f5f7fb;
  border-color: #c5ced9;
}

.day-detail-btn--danger {
  color: #c0392b;
  border-color: rgba(192, 57, 43, 0.25);
  background: #fff5f4;
}

.day-detail-btn--danger:hover {
  background: #fdecea;
  border-color: rgba(192, 57, 43, 0.4);
}

.day-detail-btn--highlight {
  color: var(--highlight-deep);
  border-color: color-mix(in srgb, var(--highlight) 30%, transparent);
  background: color-mix(in srgb, var(--highlight-soft) 70%, #fff);
}

.day-detail-btn--highlight:hover {
  background: color-mix(in srgb, var(--highlight-soft) 90%, #fff);
  border-color: color-mix(in srgb, var(--highlight) 45%, transparent);
}

.day-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 22px 22px;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.day-modal-actions .btn {
  flex: 1;
  justify-content: center;
}

.day-modal-actions.hidden {
  display: none;
}

.btn-danger.btn-ghost {
  background: #fff5f4;
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.btn-danger.btn-ghost:hover {
  background: #fdecea;
}

/* ─── 편집 모드 ─── */

.edit-hint {
  margin: 12px 0 0;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #1e3a5f;
  background: linear-gradient(135deg, #e8f0ff, #dbeafe);
  border-radius: 8px;
  border: 1px solid rgba(45, 74, 122, 0.12);
}

.edit-mode .day-cell--editable {
  cursor: default;
}

.edit-mode .day-cell--editable .slot-list {
  cursor: default;
}

.edit-mode .day-cell--editable .slot-chip--editable {
  cursor: pointer;
}

.edit-mode .day-cell--editable:hover {
  transform: none;
}

.day-cell.drop-target {
  box-shadow:
    0 0 0 2px rgba(79, 110, 247, 0.45),
    0 4px 14px rgba(79, 110, 247, 0.15);
}

.slot-chip--editable {
  cursor: pointer;
  position: relative;
}

.slot-chip--editable:active {
  cursor: grabbing;
}

.edit-mode .slot-chip--selected {
  outline: 2px solid var(--highlight, #4a60a9);
  outline-offset: -1px;
  z-index: 1;
}

.day-cell--all-day {
  background: var(--all-day-bg, var(--surface)) !important;
  border-color: color-mix(in srgb, var(--all-day-text, #333) 22%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 1px 3px rgba(26, 34, 51, 0.08);
  gap: 0;
}

.day-cell--all-day .day-head {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.day-cell--all-day .slot-list--all-day {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 2px 6px;
  z-index: 0;
}

.day-cell--all-day-mixed {
  background: var(--all-day-bg, var(--surface)) !important;
  border-color: color-mix(in srgb, var(--all-day-text, #333) 22%, transparent);
  gap: 4px;
}

.day-cell--all-day-mixed .slot-list--all-day {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
  padding: 2px 4px 0;
  z-index: 1;
}

.day-cell--all-day-mixed .slot-chip--all-day {
  min-height: 0 !important;
  height: auto !important;
}

.day-cell--all-day-mixed .slot-text--all-day {
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: center;
  -webkit-line-clamp: 2;
}

.day-cell--all-day-mixed .slot-list:not(.slot-list--all-day) {
  position: relative;
  flex: 0 0 var(--day-slots-height, 148px);
  height: var(--day-slots-height, 148px);
  min-height: var(--day-slots-height, 148px);
  max-height: var(--day-slots-height, 148px);
}

.slot-duration--all-day {
  background-image: none !important;
}

.slot-duration-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: block;
  flex-shrink: 0;
}

.slot-chip--all-day {
  width: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  min-height: 0;
  height: auto;
  background: var(--chip-bg, #fff);
  color: var(--chip-text, #333);
  border: 1px solid var(--chip-border, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.slot-chip--all-day .slot-chip-body {
  flex: 1 1 auto;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 0 5px;
}

.slot-chip--all-day .slot-text {
  text-align: left;
  white-space: pre-line;
  display: block;
  overflow: hidden;
}

.day-cell--all-day.today {
  border: 2px solid var(--today-border) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--today-border) 18%, transparent),
    0 4px 12px var(--today-glow);
  z-index: 2;
}

.day-cell--all-day.today::before,
.day-cell--all-day.today::after,
.day-cell--all-day-mixed.today::before,
.day-cell--all-day-mixed.today::after {
  display: none;
}

.day-cell--all-day .day-num {
  background: rgba(255, 255, 255, 0.92);
  color: #1a2233;
  border-color: rgba(26, 34, 51, 0.12);
  box-shadow: 0 1px 2px rgba(26, 34, 51, 0.08);
}

.day-cell--all-day.sun .day-num {
  color: var(--sun);
  background: rgba(255, 255, 255, 0.92);
}

.day-cell--all-day.sat .day-num {
  color: var(--sat);
  background: rgba(255, 255, 255, 0.92);
}

.day-cell--all-day.today .day-num,
.day-cell--all-day.today.sun .day-num,
.day-cell--all-day.today.sat .day-num {
  background: linear-gradient(135deg, var(--highlight) 0%, var(--highlight-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--highlight-deep) 35%, transparent);
}

.day-cell--all-day.today .day-num {
  color: #fff;
}

.day-cell--all-day.today.sun .day-num {
  color: #fff;
}

.day-cell--all-day.today.sat .day-num {
  color: #fff;
}

.day-all-day-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--item-accent, var(--surface));
  border: 1px solid color-mix(in srgb, var(--item-text, #333) 16%, transparent);
  box-shadow: 0 1px 3px rgba(20, 28, 45, 0.06);
}

.day-all-day-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.day-all-day-text {
  margin: 0;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  color: var(--item-text, #1e2636);
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.slot-chip.dragging {
  opacity: 0.45;
}

.slot-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 0.7rem;
  opacity: 0.35;
  line-height: 1;
  align-self: center;
  flex-shrink: 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.slot-drag-handle:active {
  cursor: grabbing;
}

.slot-chip--editable .slot-chip-body,
.slot-chip--editable .slot-duration,
.slot-chip--editable .slot-text {
  user-select: none;
  -webkit-user-select: none;
}

.duration-legend {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.duration-legend strong {
  color: #1e3a5f;
  font-weight: 700;
}

.add-hint {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 12px 4px;
  border: 1px dashed rgba(26, 34, 51, 0.15);
  border-radius: 8px;
}

.slot-list--empty {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.ctx-menu {
  position: fixed;
  z-index: 300;
  min-width: 160px;
  max-width: min(240px, calc(100vw - 20px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(26, 34, 51, 0.16);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ctx-menu--anchor-left .ctx-menu-color-row {
  flex-direction: row-reverse;
}

#cat-ctx-menu .ctx-menu-color-row {
  flex-wrap: wrap;
}

#cat-ctx-menu .ctx-menu-color-row input[type="color"] {
  margin-left: auto;
}

.ctx-menu--anchor-left#cat-ctx-menu .ctx-menu-color-row input[type="color"] {
  margin-left: 0;
  margin-right: auto;
}

.ctx-menu.hidden {
  display: none;
}

.ctx-menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

.ctx-menu-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
}

.ctx-menu-color-row:hover {
  background: #f0f3f8;
}

.ctx-menu-color-row input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  flex-shrink: 0;
}

.ctx-menu-color-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.ctx-menu-color-row input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.ctx-menu button:hover {
  background: #f0f3f8;
}

.ctx-menu button.danger {
  color: #c0392b;
}

.ctx-menu button.hidden {
  display: none;
}

.visually-hidden {
  position: fixed;
  left: -9999px;
  width: 24px;
  height: 24px;
  opacity: 0;
}

.hidden {
  display: none !important;
}

.mobile-agenda {
  display: none;
}

.slot-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 16px;
}

.slot-edit-modal.hidden {
  display: none;
}

.slot-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 28, 0.45);
  backdrop-filter: blur(4px);
}

.slot-edit-card {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(26, 34, 51, 0.2);
}

.slot-edit-card h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 800;
}

.slot-edit-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.field-optional {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.slot-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.slot-edit-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.bangon-picker-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #3d4657;
  letter-spacing: -0.02em;
}

.bangon-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bangon-quick-btn {
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: #fff;
  color: #3d4657;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 10px 4px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.bangon-quick-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: #f7f9fd;
}

.bangon-quick-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: color-mix(in srgb, var(--accent) 88%, #1e2636);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.bangon-quick-btn--clear {
  color: #a94442;
}

.bangon-quick-btn--clear:hover {
  border-color: color-mix(in srgb, #c0392b 35%, var(--border));
  background: #fff7f7;
}

.bangon-quick-btn--clear.is-active {
  border-color: color-mix(in srgb, #c0392b 45%, var(--border));
  background: #fff0f0;
  color: #c0392b;
  box-shadow: 0 0 0 1px color-mix(in srgb, #c0392b 15%, transparent);
}

.bangon-picker .slot-start-picker-custom--solo {
  margin-top: 0;
}

.bangon-hour-select,
.bangon-minute-select {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: inherit;
}

.bangon-hour-select:focus,
.bangon-minute-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.slot-start-picker,
.slot-start-picker-mount {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-start-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.slot-start-picker--direct {
  padding: 0;
  background: transparent;
  border: none;
}

.slot-start-picker-custom--solo {
  display: flex;
  align-items: center;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.slot-start-picker-custom--solo .slot-start-picker-selects {
  width: 100%;
  margin-left: 0;
}

.slot-start-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.slot-start-picker-preview {
  font-size: 0.88rem;
  font-weight: 800;
  color: color-mix(in srgb, var(--accent) 88%, #1e2636);
  letter-spacing: -0.02em;
}

.slot-start-picker-preview.is-empty {
  font-weight: 700;
  color: var(--muted);
}

.slot-start-clear-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.slot-start-clear-btn:hover {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
}

.slot-start-hour-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.slot-start-grid-btn {
  font-size: 0.68rem;
}

.slot-start-picker-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
}

.slot-start-picker-custom-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.slot-start-picker-selects {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.slot-start-hour-select,
.slot-start-minute-select {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  min-width: 0;
}

.slot-start-hour-select {
  flex: 1 1 auto;
  max-width: 132px;
}

.slot-start-minute-select {
  flex: 0 0 auto;
  width: 72px;
}

.slot-start-hour-select:focus,
.slot-start-minute-select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.slot-start-colon {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
}

.slot-edit-card input,
.slot-edit-card select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

#slot-edit-start-wrap.hidden {
  display: none;
}

.slot-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-danger {
  background: #fee;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}

.save-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e3a5f;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  z-index: 400;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.save-toast.hidden {
  display: none;
}

.save-toast.error {
  background: #c0392b;
}

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .page {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .layout {
    flex: none;
    min-height: auto;
  }

  .calendar-wrap {
    min-height: 480px;
  }

  .header--sidebar .header-month {
    width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
    position: static;
  }

  .calendar-column {
    order: 1;
    min-height: 480px;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 12px 10px 28px;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    align-items: stretch;
  }

  .mode-control {
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
  }

  .calendar {
    grid-template-rows: repeat(var(--calendar-rows, 6), minmax(96px, 1fr));
  }

  .day-cell {
    min-height: 96px;
    padding: 6px 4px;
  }

  .slot-text {
    font-size: 0.62rem;
  }

  .day-modal-card {
    border-radius: 16px;
    max-height: 92vh;
  }

  .day-detail-item {
    grid-template-columns: 40px 1fr;
    min-height: calc(var(--item-hours, 1) * var(--day-modal-hour-unit, 72px));
    height: calc(var(--item-hours, 1) * var(--day-modal-hour-unit, 72px));
  }

  .day-detail-body {
    min-height: 0;
  }

  .day-detail-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .day-detail-actions {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .day-modal-actions {
    flex-direction: column;
  }
}
