/**
 * ひよくま カレンダー スタイル（TimeTree風）
 * .hiyokuma-calendar でスコープを切り、SWELLテーマと競合しない
 *
 * カテゴリカラー:
 *   event  (イベント)       : #42A5F5 (ブルー)
 *   gourmet(グルメ)         : #FF7043 (オレンジ)
 *   oyako  (子連れスポット)  : #66BB6A (グリーン)
 *   spot   (個別スポット)    : #AB47BC (パープル)
 */

/* ========================================
   CSS Custom Properties
   ======================================== */
.hiyokuma-calendar {
  --hkc-color-event: #42A5F5;
  --hkc-color-event-light: #E3F2FD;
  --hkc-color-gourmet: #FF7043;
  --hkc-color-gourmet-light: #FBE9E7;
  --hkc-color-oyako: #66BB6A;
  --hkc-color-oyako-light: #E8F5E9;
  --hkc-color-spot: #AB47BC;
  --hkc-color-spot-light: #F3E5F5;

  --hkc-color-text: #37474F;
  --hkc-color-text-secondary: #78909C;
  --hkc-color-text-muted: #B0BEC5;
  --hkc-color-border: #ECEFF1;
  --hkc-color-bg: #FFFFFF;
  --hkc-color-bg-secondary: #F5F7FA;
  --hkc-color-sun: #EF5350;
  --hkc-color-sat: #42A5F5;
  --hkc-color-today: #42A5F5;

  --hkc-radius-sm: 6px;
  --hkc-radius-md: 10px;
  --hkc-radius-lg: 16px;
  --hkc-radius-pill: 9999px;
  --hkc-radius-circle: 50%;

  --hkc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --hkc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --hkc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --hkc-transition: 0.2s ease;
  --hkc-touch-min: 44px;
}

/* ========================================
   Reset / Base
   ======================================== */
.hiyokuma-calendar {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--hkc-color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.hiyokuma-calendar button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hiyokuma-calendar select {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.hiyokuma-calendar a {
  -webkit-tap-highlight-color: transparent;
}

/* ========================================
   Filters - カテゴリフィルター行
   ======================================== */
.hkc-filters {
  margin-bottom: 20px;
}

.hkc-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

/* カテゴリフィルター - 横スクロール対応 */
.hkc-filters__categories {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.hkc-filters__categories::-webkit-scrollbar {
  display: none;
}

/* --- カテゴリピルボタン (TimeTree風) --- */
.hkc-cat-btn {
  padding: 8px 18px;
  border: 2px solid var(--hkc-color-border);
  border-radius: var(--hkc-radius-pill);
  background: var(--hkc-color-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--hkc-color-text-secondary);
  cursor: pointer;
  transition: all var(--hkc-transition);
  white-space: nowrap;
  min-height: var(--hkc-touch-min);
  flex-shrink: 0;
  user-select: none;
}

.hkc-cat-btn:hover {
  border-color: var(--hkc-color-text-muted);
  color: var(--hkc-color-text);
}

.hkc-cat-btn:active {
  transform: scale(0.96);
}

/* Active state: all */
.hkc-cat-btn.is-active {
  background: var(--hkc-color-text);
  color: #fff;
  border-color: var(--hkc-color-text);
}

/* Category-specific active colors */
.hkc-cat-btn[data-cat="event"] {
  border-color: var(--hkc-color-event);
  color: var(--hkc-color-event);
}

.hkc-cat-btn[data-cat="event"].is-active {
  background: var(--hkc-color-event);
  color: #fff;
  border-color: var(--hkc-color-event);
}

.hkc-cat-btn[data-cat="gourmet"] {
  border-color: var(--hkc-color-gourmet);
  color: var(--hkc-color-gourmet);
}

.hkc-cat-btn[data-cat="gourmet"].is-active {
  background: var(--hkc-color-gourmet);
  color: #fff;
  border-color: var(--hkc-color-gourmet);
}

.hkc-cat-btn[data-cat="oyako"] {
  border-color: var(--hkc-color-oyako);
  color: var(--hkc-color-oyako);
}

.hkc-cat-btn[data-cat="oyako"].is-active {
  background: var(--hkc-color-oyako);
  color: #fff;
  border-color: var(--hkc-color-oyako);
}

.hkc-cat-btn[data-cat="spot"] {
  border-color: var(--hkc-color-spot);
  color: var(--hkc-color-spot);
}

.hkc-cat-btn[data-cat="spot"].is-active {
  background: var(--hkc-color-spot);
  color: #fff;
  border-color: var(--hkc-color-spot);
}

/* "全て" button keeps neutral colors */
.hkc-cat-btn[data-cat="all"] {
  border-color: var(--hkc-color-border);
  color: var(--hkc-color-text-secondary);
}

.hkc-cat-btn[data-cat="all"].is-active {
  background: var(--hkc-color-text);
  color: #fff;
  border-color: var(--hkc-color-text);
}

/* ========================================
   Filters - セレクト / トグル行（折りたたみ可能）
   ======================================== */
.hkc-filters__selects {
  background: var(--hkc-color-bg-secondary);
  border-radius: var(--hkc-radius-md);
  padding: 12px 14px;
  gap: 10px;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  overflow: hidden;
}

/* 折りたたみ時のスタイル（JSで .is-collapsed を付与） */
.hkc-filters__selects.is-collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 14px;
  margin-bottom: 0;
  pointer-events: none;
}

.hkc-filter-select {
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--hkc-color-border);
  border-radius: var(--hkc-radius-sm);
  background: var(--hkc-color-bg);
  font-size: 13px;
  color: var(--hkc-color-text);
  cursor: pointer;
  min-width: 120px;
  min-height: var(--hkc-touch-min);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2378909C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--hkc-transition);
}

.hkc-filter-select:focus {
  outline: none;
  border-color: var(--hkc-color-today);
  box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.15);
}

/* --- トグルスイッチ --- */
.hkc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: var(--hkc-touch-min);
  user-select: none;
}

.hkc-toggle__input {
  display: none;
}

.hkc-toggle__slider {
  width: 48px;
  height: 26px;
  background: #CFD8DC;
  border-radius: 13px;
  position: relative;
  transition: background var(--hkc-transition);
  flex-shrink: 0;
}

.hkc-toggle__slider::after {
  content: "";
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: var(--hkc-radius-circle);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--hkc-transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.hkc-toggle__input:checked + .hkc-toggle__slider {
  background: var(--hkc-color-oyako);
}

.hkc-toggle__input:checked + .hkc-toggle__slider::after {
  transform: translateX(22px);
}

.hkc-toggle__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--hkc-color-text-secondary);
}

/* --- リセットリンク --- */
.hkc-reset-link {
  font-size: 12px;
  color: var(--hkc-color-text-muted);
  text-decoration: none;
  margin-left: auto;
  transition: color var(--hkc-transition);
  flex-shrink: 0;
}

.hkc-reset-link:hover {
  color: var(--hkc-color-text-secondary);
  text-decoration: underline;
}

/* ========================================
   Tabs - 表示モード切替 (TimeTree風)
   ======================================== */
.hkc-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: var(--hkc-color-bg-secondary);
  border-radius: var(--hkc-radius-md);
  padding: 3px;
  position: relative;
}

.hkc-tab {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--hkc-color-text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--hkc-transition);
  min-height: var(--hkc-touch-min);
  text-align: center;
  position: relative;
  z-index: 1;
}

.hkc-tab:hover {
  color: var(--hkc-color-text);
}

.hkc-tab.is-active {
  background: var(--hkc-color-bg);
  color: var(--hkc-color-text);
  box-shadow: var(--hkc-shadow-sm);
}

/* ========================================
   Header - 月ナビゲーション
   ======================================== */
.hkc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 4px 0;
}

.hkc-header__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--hkc-color-text);
  letter-spacing: 0.02em;
  min-width: 140px;
  text-align: center;
}

.hkc-nav-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--hkc-radius-circle);
  background: var(--hkc-color-bg-secondary);
  font-size: 16px;
  font-weight: 600;
  color: var(--hkc-color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--hkc-transition);
  min-width: var(--hkc-touch-min);
  min-height: var(--hkc-touch-min);
}

.hkc-nav-btn:hover {
  background: var(--hkc-color-today);
  color: #fff;
}

.hkc-nav-btn:active {
  transform: scale(0.92);
}

/* --- 今日ボタン --- */
.hkc-today-btn {
  padding: 4px 12px;
  border: 1.5px solid var(--hkc-color-text-muted);
  border-radius: var(--hkc-radius-pill);
  background: transparent;
  color: var(--hkc-color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--hkc-transition);
  white-space: nowrap;
  min-height: 32px;
  display: none;
}

.hkc-today-btn.is-visible {
  display: inline-flex;
  align-items: center;
}

.hkc-today-btn:hover {
  background: var(--hkc-color-today);
  color: #fff;
  border-color: var(--hkc-color-today);
}

.hkc-today-btn:active {
  transform: scale(0.95);
}

/* --- 今週末ボタン --- */
.hkc-weekend-btn {
  margin-left: auto;
  padding: 6px 14px;
  border: 2px solid var(--hkc-color-today);
  border-radius: var(--hkc-radius-pill);
  background: transparent;
  color: var(--hkc-color-today);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--hkc-transition);
  white-space: nowrap;
  min-height: 36px;
}

.hkc-weekend-btn:hover {
  background: var(--hkc-color-today);
  color: #fff;
}

.hkc-weekend-btn:active {
  transform: scale(0.95);
}

/* --- セル選択・週末ハイライト --- */
.hkc-cell--selected {
  background: var(--hkc-color-event-light) !important;
  outline: 2px solid var(--hkc-color-today);
  outline-offset: -2px;
}

.hkc-cell--weekend-highlight {
  animation: hkcPulse 0.6s ease 2;
}

@keyframes hkcPulse {
  0%, 100% { background: inherit; }
  50% { background: #FFF9C4; }
}

/* --- 詳細パネル Empty state --- */
.hkc-detail-panel__empty {
  text-align: center;
  color: var(--hkc-color-text-muted);
  padding: 32px 20px;
  font-size: 14px;
}

/* ========================================
   View Toggle
   ======================================== */
.hkc-view {
  display: none;
}

.hkc-view.is-active {
  display: block;
}

/* ========================================
   Calendar Grid - カレンダーグリッド
   ======================================== */
.hkc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--hkc-color-text-muted);
  margin-bottom: 2px;
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

.hkc-grid {
  display: flex;
  flex-direction: column;
  border-radius: var(--hkc-radius-md);
  overflow: hidden;
  box-shadow: var(--hkc-shadow-sm);
  border: 1px solid var(--hkc-color-border);
}

/* ── 週コンテナ ── */
.hkc-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 1px;
  background: var(--hkc-color-bg);
  border-bottom: 2px solid var(--hkc-color-border);
}

.hkc-week:last-child {
  border-bottom: none;
}

/* ── 日付番号行 ── */
.hkc-day-num {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--hkc-color-text);
  cursor: pointer;
  border-bottom: 1px solid var(--hkc-color-border);
}

.hkc-day-num--empty {
  cursor: default;
  border-bottom-color: transparent;
}

.hkc-day-num--sun { color: var(--hkc-color-sun); }
.hkc-day-num--sat { color: var(--hkc-color-sat); }

.hkc-day-num--today .hkc-day-num__num {
  background: var(--hkc-color-today);
  color: #fff;
  border-radius: var(--hkc-radius-circle);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 今日+曜日色の優先 */
.hkc-day-num--today.hkc-day-num--sun,
.hkc-day-num--today.hkc-day-num--sat {
  color: var(--hkc-color-text);
}


/* ── スパニングバー（複数日イベント） ── */
.hkc-span-bar {
  display: flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 20px;
  z-index: 1;
  transition: opacity var(--hkc-transition);
}

.hkc-span-bar:hover {
  opacity: 0.85;
}

/* カテゴリ別バー色 */
.hkc-span--event   { background: var(--hkc-color-event); }
.hkc-span--gourmet { background: var(--hkc-color-gourmet); }
.hkc-span--oyako   { background: var(--hkc-color-oyako); }
.hkc-span--spot    { background: var(--hkc-color-spot); }

/* 開始・終了の角丸 */
.hkc-span--start                          { border-radius: 4px 0 0 4px; margin-left: 2px; }
.hkc-span--end                            { border-radius: 0 4px 4px 0; margin-right: 2px; }
.hkc-span--start.hkc-span--end           { border-radius: 4px; margin-left: 2px; margin-right: 2px; }
.hkc-span-bar:not(.hkc-span--start):not(.hkc-span--end) { border-radius: 0; }

/* --- 単発イベントセル --- */
.hkc-cell {
  min-height: 36px;
  padding: 4px;
  background: var(--hkc-color-bg);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--hkc-transition);
}

.hkc-cell:hover {
  background: var(--hkc-color-bg-secondary);
}

.hkc-cell--empty {
  background: var(--hkc-color-bg-secondary);
  cursor: default;
}

.hkc-cell--empty:hover {
  background: var(--hkc-color-bg-secondary);
}

/* (日付番号スタイルは .hkc-day-num セクションに移動済み) */

/* --- セル内イベント一覧 --- */
.hkc-cell__events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ========================================
   Event Item - セル内のイベント
   ======================================== */
.hkc-event-item {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--hkc-color-text);
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 4px;
  border-radius: var(--hkc-radius-sm);
  border-left: 3px solid transparent;
  transition: background var(--hkc-transition);
  overflow: hidden;
}

.hkc-event-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Category left-border colors */
.hkc-event-item[data-cat="event"] {
  border-left-color: var(--hkc-color-event);
  background: var(--hkc-color-event-light);
}

.hkc-event-item[data-cat="event"]:hover {
  background: #BBDEFB;
}

.hkc-event-item[data-cat="gourmet"] {
  border-left-color: var(--hkc-color-gourmet);
  background: var(--hkc-color-gourmet-light);
}

.hkc-event-item[data-cat="gourmet"]:hover {
  background: #FFCCBC;
}

.hkc-event-item[data-cat="oyako"] {
  border-left-color: var(--hkc-color-oyako);
  background: var(--hkc-color-oyako-light);
}

.hkc-event-item[data-cat="oyako"]:hover {
  background: #C8E6C9;
}

.hkc-event-item[data-cat="spot"] {
  border-left-color: var(--hkc-color-spot);
  background: var(--hkc-color-spot-light);
}

.hkc-event-item[data-cat="spot"]:hover {
  background: #E1BEE7;
}

/* 「他N件をみる」バッジ - モーダル誘導 */
.hkc-more-badge {
  cursor: pointer;
  text-align: center;
}

/* ========================================
   Category Badge (dot)
   ======================================== */
.hkc-badge {
  width: 8px;
  height: 8px;
  border-radius: var(--hkc-radius-circle);
  flex-shrink: 0;
  display: inline-block;
  margin-right: 4px;
}

.hkc-badge--event {
  background: var(--hkc-color-event);
}

.hkc-badge--gourmet {
  background: var(--hkc-color-gourmet);
}

.hkc-badge--oyako {
  background: var(--hkc-color-oyako);
}

.hkc-badge--spot {
  background: var(--hkc-color-spot);
}

/* ========================================
   Event Title (in cell)
   ======================================== */
.hkc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* ========================================
   +N More Badge
   ======================================== */
.hkc-more-badge {
  display: inline-block;
  background: var(--hkc-color-bg-secondary);
  color: var(--hkc-color-text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--hkc-radius-pill);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 2px;
  transition: all var(--hkc-transition);
  border: 1px solid var(--hkc-color-border);
}

.hkc-more-badge:hover {
  background: var(--hkc-color-text);
  color: #fff;
  border-color: var(--hkc-color-text);
}

/* ========================================
   List View - リストビュー
   ======================================== */
.hkc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- リストアイテム (カード型) --- */
.hkc-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--hkc-color-bg);
  border: 1px solid var(--hkc-color-border);
  border-left: 4px solid transparent;
  border-radius: var(--hkc-radius-md);
  text-decoration: none;
  color: var(--hkc-color-text);
  transition: all var(--hkc-transition);
  box-shadow: var(--hkc-shadow-sm);
}

.hkc-list-item:hover {
  box-shadow: var(--hkc-shadow-md);
  transform: translateY(-1px);
  border-color: var(--hkc-color-border);
}

.hkc-list-item:active {
  transform: translateY(0);
  box-shadow: var(--hkc-shadow-sm);
}

/* Category left-border on list items */
.hkc-list-item[data-cat="event"] {
  border-left-color: var(--hkc-color-event);
}

.hkc-list-item[data-cat="gourmet"] {
  border-left-color: var(--hkc-color-gourmet);
}

.hkc-list-item[data-cat="oyako"] {
  border-left-color: var(--hkc-color-oyako);
}

.hkc-list-item[data-cat="spot"] {
  border-left-color: var(--hkc-color-spot);
}

/* --- 日付 --- */
.hkc-list-item__date {
  font-size: 13px;
  font-weight: 700;
  color: var(--hkc-color-text-secondary);
  min-width: 100px;
  flex-shrink: 0;
  line-height: 1.3;
}

/* --- タイトル --- */
.hkc-list-item__title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 場所 --- */
.hkc-list-item__place {
  font-size: 12px;
  color: var(--hkc-color-text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hkc-list-item__place::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B0BEC5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* --- Empty state --- */
.hkc-list-empty {
  text-align: center;
  color: var(--hkc-color-text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

/* ========================================
   Detail Panel - 日付タップ時の詳細パネル
   下部からスライドインするオーバーレイパネル
   ======================================== */
.hkc-detail-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--hkc-color-bg);
  border-radius: var(--hkc-radius-lg) var(--hkc-radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding: 0;
}

.hkc-detail-panel.is-open {
  transform: translateY(0);
}

/* Drag handle */
.hkc-detail-panel__handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
  cursor: grab;
  position: sticky;
  top: 0;
  background: var(--hkc-color-bg);
  z-index: 1;
}

.hkc-detail-panel__handle::after {
  content: "";
  width: 36px;
  height: 4px;
  background: var(--hkc-color-border);
  border-radius: 2px;
}

/* Panel header (date) */
.hkc-detail-panel__header {
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--hkc-color-border);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hkc-detail-panel__date {
  font-size: 22px;
  font-weight: 700;
  color: var(--hkc-color-text);
}

.hkc-detail-panel__weekday {
  font-size: 14px;
  color: var(--hkc-color-text-secondary);
  font-weight: 500;
}

/* Panel event list */
.hkc-detail-panel__list {
  padding: 12px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hkc-detail-panel__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--hkc-color-bg-secondary);
  border-radius: var(--hkc-radius-md);
  border-left: 4px solid var(--hkc-color-event);
  text-decoration: none;
  color: var(--hkc-color-text);
  transition: background var(--hkc-transition);
}

.hkc-detail-panel__item:hover {
  background: var(--hkc-color-border);
}

/* モーダル内カテゴリ別左ボーダー色 */
.hkc-detail-panel__item[data-cat="event"]   { border-left-color: var(--hkc-color-event); }
.hkc-detail-panel__item[data-cat="gourmet"] { border-left-color: var(--hkc-color-gourmet); }
.hkc-detail-panel__item[data-cat="oyako"]   { border-left-color: var(--hkc-color-oyako); }
.hkc-detail-panel__item[data-cat="spot"]    { border-left-color: var(--hkc-color-spot); }

.hkc-detail-panel__item-title {
  font-size: 15px;
  font-weight: 600;
}

.hkc-detail-panel__item-place {
  font-size: 12px;
  color: var(--hkc-color-text-secondary);
}

.hkc-detail-panel__item-place::before {
  content: "📍 ";
}

.hkc-detail-panel__item-period {
  font-size: 11px;
  color: var(--hkc-color-text-muted);
}

/* Panel backdrop */
.hkc-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hkc-detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   Responsive - Tablet (768px)
   ======================================== */
@media (max-width: 768px) {
  .hiyokuma-calendar {
    padding: 0 12px;
  }

  /* Spanning bar - tablet */
  .hkc-span-bar {
    font-size: 10px;
    min-height: 18px;
    padding: 1px 4px;
  }

  .hkc-day-num {
    font-size: 12px;
    padding: 4px 0 3px;
  }

  .hkc-day-num--today .hkc-day-num__num {
    width: 24px;
    height: 24px;
  }

  .hkc-cell {
    min-height: 36px;
    padding: 3px;
  }

  .hkc-event-item {
    font-size: 10px;
    padding: 2px 4px;
    border-left-width: 2px;
  }

  .hkc-event-title {
    max-width: 70px;
  }

  /* Filters: horizontal scroll for categories */
  .hkc-filters__categories {
    gap: 6px;
  }

  .hkc-cat-btn {
    padding: 6px 14px;
    font-size: 12px;
  }

  /* Selects stack vertically */
  .hkc-filters__selects {
    flex-wrap: wrap;
  }

  .hkc-filter-select {
    flex: 1;
    min-width: calc(50% - 6px);
  }

  .hkc-reset-link {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }

  /* List items wrap */
  .hkc-list-item {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 8px;
  }

  .hkc-list-item__title {
    white-space: normal;
    order: 2;
    flex-basis: calc(100% - 112px);
  }

  .hkc-list-item__place {
    width: 100%;
    order: 3;
    padding-left: 112px;
  }

  .hkc-header__title {
    font-size: 18px;
  }

  .hkc-header {
    gap: 16px;
  }
}

/* ========================================
   Responsive - Mobile (480px)
   ======================================== */
@media (max-width: 480px) {
  .hiyokuma-calendar {
    padding: 0 8px;
  }

  /* Spanning bar - mobile: テキスト表示で視認性UP */
  .hkc-span-bar {
    font-size: 10px;
    min-height: 20px;
    padding: 2px 4px;
    font-weight: 700;
  }

  .hkc-day-num {
    font-size: 12px;
    padding: 4px 0 3px;
  }

  .hkc-day-num--today .hkc-day-num__num {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  /* セル高さ拡大: タッチしやすく、イベント名が読める */
  .hkc-cell {
    min-height: 44px;
    padding: 3px 2px;
  }

  /* Show event text on mobile with category color as bg+text */
  .hkc-event-title {
    display: block;
    font-size: 10px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .hkc-event-item {
    border-left-width: 0;
    padding: 3px 5px;
    border-radius: 4px;
    gap: 0;
    min-height: 22px;
  }

  /* Category bg+text color for mobile readability */
  .hkc-event-item[data-cat="event"] {
    background: var(--hkc-color-event) !important;
    color: #fff;
  }
  .hkc-event-item[data-cat="gourmet"] {
    background: var(--hkc-color-gourmet) !important;
    color: #fff;
  }
  .hkc-event-item[data-cat="oyako"] {
    background: var(--hkc-color-oyako) !important;
    color: #fff;
  }
  .hkc-event-item[data-cat="spot"] {
    background: var(--hkc-color-spot) !important;
    color: #fff;
  }

  .hkc-event-item .hkc-event-title {
    font-weight: 700;
  }

  /* Hide dot badge on mobile - text with bg color is enough */
  .hkc-badge {
    display: none;
  }

  .hkc-cell__events {
    flex-direction: column;
    gap: 2px;
  }

  .hkc-more-badge {
    font-size: 9px;
    padding: 2px 6px;
    min-height: 18px;
    display: inline-flex;
    align-items: center;
  }

  /* Category buttons: smaller */
  .hkc-cat-btn {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 36px;
  }

  /* Filter selects full width */
  .hkc-filter-select {
    width: 100%;
    min-width: 100%;
  }

  /* Tabs */
  .hkc-tab {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 40px;
  }

  /* Nav buttons */
  .hkc-nav-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .hkc-header__title {
    font-size: 16px;
    min-width: 120px;
  }

  /* List items compact */
  .hkc-list-item {
    padding: 10px 12px;
    gap: 6px;
  }

  .hkc-list-item__date {
    font-size: 12px;
    min-width: 80px;
  }

  .hkc-list-item__title {
    font-size: 13px;
    flex-basis: calc(100% - 92px);
  }

  .hkc-list-item__place {
    padding-left: 92px;
    font-size: 11px;
  }

  /* Skeleton on mobile */
  .hkc-skeleton__cell {
    height: 50px;
  }

  /* Detail panel full width */
  .hkc-detail-panel {
    max-height: 80vh;
  }

  .hkc-detail-panel__header {
    padding: 0 16px 10px;
  }

  .hkc-detail-panel__list {
    padding: 10px 16px 20px;
  }

  .hkc-detail-panel__date {
    font-size: 20px;
  }
}

/* ========================================
   Skeleton Loading
   ======================================== */
.hkc-skeleton {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.hkc-skeleton__row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.hkc-skeleton__cell {
  height: 70px;
  background: linear-gradient(90deg, var(--hkc-color-bg-secondary) 25%, var(--hkc-color-border) 50%, var(--hkc-color-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: hkcShimmer 1.5s ease infinite;
  border-radius: 4px;
}

@keyframes hkcShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* グリッドのスワイプトランジション */
.hkc-grid.is-swiping {
  transition: transform 0.05s linear, opacity 0.05s linear;
}

.hkc-grid.is-loading {
  pointer-events: none;
}

/* ========================================
   Animations & Transitions
   ======================================== */

/* Calendar view fade in */
.hkc-view--calendar.is-active {
  animation: hkcFadeIn 0.25s ease;
}

.hkc-view--list.is-active {
  animation: hkcFadeIn 0.25s ease;
}

@keyframes hkcFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* List item stagger (applied via JS) */
.hkc-list-item {
  animation: hkcSlideUp 0.3s ease both;
}

@keyframes hkcSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .hiyokuma-calendar {
    max-width: 100%;
    padding: 0;
  }

  .hkc-filters,
  .hkc-tabs,
  .hkc-nav-btn,
  .hkc-detail-panel,
  .hkc-detail-overlay {
    display: none !important;
  }

  .hkc-grid {
    box-shadow: none;
  }

  .hkc-cell {
    border: 1px solid #ddd;
  }

  .hkc-list-item {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
