/* Taikyokai SDF Events - Frontend
 *
 * Breakpoints used by this stylesheet and the companion frontend.js
 * (keep these four values in sync if adjusted — they express distinct
 *  design intents, not mere duplicates):
 *    720px — card grid: stack vs. horizontal layout for list items
 *    768px — SP tab switch + calendar icon density (mobile vs desktop)
 *   1024px — host-theme content column widening ("wide wrap")
 *    750px — TCD theme SP FV guard (site-tweaks.php)
 *
 * Service palettes come in two tiers. "Light" is the badge color
 * (`--tkek-army`, `--tkek-navy-svc`, `--tkek-air`); "dark" is used by
 * calendar service underlines, mascot gradients, and the per-service
 * shield icons. The dark palette was previously hardcoded in three JS
 * places — audit A-1 (v1.2.4) consolidated them to the three custom
 * properties below; frontend.js reads these at init via readPalette().
 */
:root {
  --tkek-navy: #1a2456;
  --tkek-navy-light: #2a3670;
  --tkek-gold: #c9a961;
  --tkek-bg: #ffffff;
  --tkek-bg-soft: #f7f8fb;
  --tkek-border: #e1e5ee;
  --tkek-text: #1f2937;
  --tkek-text-soft: #6b7280;
  --tkek-army: #4a7c59;
  --tkek-navy-svc: #2c5f8d;
  --tkek-air: #5b9bd5;
  /* Dark service palette — calendar underline + mascot + SVG icons +
   * modal hero gradients. Single source of truth for all consumers
   * (CSS and JS). JS reads these via getComputedStyle at init. */
  --tkek-svc-army-dark: #2d5a3e;
  --tkek-svc-navy-dark: #1a2456;
  --tkek-svc-air-dark:  #4a7ba8;
  --tkek-radius: 6px;
  --tkek-shadow: 0 2px 8px rgba(26,36,86,0.08);
  --tkek-wrap-max: 1200px;
}

.tkek-wrap {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  color: var(--tkek-text);
  max-width: var(--tkek-wrap-max);
  margin: 0 auto;
  padding: 1rem;
  line-height: 1.6;
}

/**
 * IMPORTANT — no breakout / no transform on .tkek-wrap.
 *
 * Earlier versions used `position: relative; left: 50%; transform: translateX(-50%)`
 * to break out of the host theme's content column to force a 1200px-wide
 * layout. That approach had two problems on the live TCD theme:
 *
 *   1. The theme's content column is intentionally left-biased (the
 *      right ~30% of the viewport is reserved for a decorative image),
 *      so centering on the parent column produced a visibly left-shifted
 *      plugin block that also overlapped the decorative area.
 *
 *   2. `transform` on an ancestor turns `position: fixed` descendants
 *      into position-relative-to-that-ancestor, which broke the event
 *      detail modal — it scrolled out of view instead of staying pinned
 *      to the viewport.
 *
 * We now respect the host theme's content column: the plugin just fills
 * its natural parent width. At the wide viewport it's still up to 1200px
 * via .tkek-wrap's max-width. No transform, no negative margins.
 */
@media (min-width: 1024px) {
  .tkek-wrap {
    width: 100%;
    max-width: var(--tkek-wrap-max);
    /* margin:0 auto is inherited from the base rule */
  }
}

/**
 * Host-theme column widening on pages that contain the [sdf_events_view]
 * shortcode. The TCD muum_tcd085 theme constrains #main_col to 740px at PC
 * and reserves ~40px right-gutter for a sidebar. That leaves a wide empty
 * strip on the right of the plugin's content column.
 *
 * When the plugin detects a shortcode on the page, it adds body.tkek-fullwide
 * via a body_class filter (see includes/frontend.php -> tkek_body_class).
 * We then widen #main_col to 100%/max-1200px and hide #side_col, ONLY on
 * pages that opt in via that body class, ONLY at >=1024px. Narrow viewports
 * continue to use the theme's responsive behavior (full-width with padding).
 *
 * Note: we widen the parent container (#main_col), NOT the .tkek-wrap via a
 * transform/negative-margin breakout. The old breakout approach caused
 *   (a) a left-shifted plugin block on a layout biased toward a decorative
 *       right area, and
 *   (b) position:fixed descendants (the event detail modal) to be trapped
 *       inside the transformed ancestor.
 * Widening the parent avoids both issues.
 */
@media (min-width: 1024px) {
  body.tkek-fullwide #main_contents #main_col,
  body.tkek-fullwide #main_contents.layout_type1 #main_col,
  body.tkek-fullwide #main_contents.layout_type2 #main_col,
  body.tkek-fullwide #main_contents.layout_type3 #main_col {
    width: 100% !important;
    max-width: var(--tkek-wrap-max) !important;
    margin: 0 auto !important;
    float: none !important;
  }
  body.tkek-fullwide #side_col { display: none !important; }
}

.tkek-header { margin-bottom: 1.5rem; }
.tkek-title {
  color: var(--tkek-navy);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  border-left: 4px solid var(--tkek-gold);
  padding-left: 0.75rem;
}
.tkek-lead { color: var(--tkek-text-soft); margin: 0; font-size: 0.95rem; }

/* Tabs */
.tkek-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--tkek-border);
  margin-bottom: 1rem;
}
.tkek-tab {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--tkek-text-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tkek-tab:hover { color: var(--tkek-navy); }
.tkek-tab.is-active {
  color: var(--tkek-navy);
  border-bottom-color: var(--tkek-gold);
  font-weight: 700;
}
.tkek-tabs-sp { display: none; width: 100%; padding: 0.5rem; margin-bottom: 1rem; border-radius: var(--tkek-radius); border: 1px solid var(--tkek-border); }

/* Filters */
.tkek-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--tkek-bg-soft);
  border-radius: var(--tkek-radius);
  margin-bottom: 1rem;
}
.tkek-filter-group { border: none; padding: 0; margin: 0; }
.tkek-filter-group legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tkek-navy);
  margin-bottom: 0.4rem;
  padding: 0;
}
.tkek-filter-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.tkek-filter-group input[type="checkbox"] { accent-color: var(--tkek-navy); }

/* Badges */
.tkek-badge {
  display: inline-block;
  min-width: 1.5em;
  text-align: center;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.tkek-badge.army { background: var(--tkek-army); }
.tkek-badge.navy { background: var(--tkek-navy-svc); }
.tkek-badge.air  { background: var(--tkek-air); }

/* Views */
.tkek-view { display: none; }
.tkek-view.is-active { display: block; }
/* List view is rendered permanently below the tab group — never hidden.
 * !important is required because `.tkek-view { display: none }` above has
 * equal specificity; the only other ways to beat it (tacking on `.is-active`
 * everywhere, or raising specificity via an ancestor) would both contradict
 * the semantic that "always-on" isn't a tab state. */
.tkek-view--always-on { display: block !important; }

/* List section heading (the always-on list is kept outside the tab group and
 * gets its own heading for clarity). */
.tkek-list-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tkek-border);
}
.tkek-list-heading {
  color: var(--tkek-navy);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  padding-left: 0.65rem;
  border-left: 3px solid var(--tkek-gold);
  line-height: 1.3;
}
.tkek-list-lead {
  color: var(--tkek-text-soft);
  font-size: 0.88rem;
  margin: 0 0 1rem;
  padding-left: 0.65rem;
}

/* Map */
.tkek-map {
  height: 420px;
  border-radius: var(--tkek-radius);
  overflow: hidden;
  border: 1px solid var(--tkek-border);
}
@media (min-width: 768px)  { .tkek-map { height: 460px; } }
@media (min-width: 1024px) { .tkek-map { height: 520px; } }

/* SP: hide Leaflet +/- zoom control (pinch-zoom still works, and the buttons
 * overlap with the event-detail popup on narrow screens). PC keeps the
 * default buttons. Attribution control is untouched (license requirement). */
@media (max-width: 767px) {
  .leaflet-control-zoom { display: none; }
}

/* Calendar */
.tkek-calendar {
  background: #fff;
  border: 1px solid var(--tkek-border);
  border-radius: var(--tkek-radius);
  padding: 1rem;
}

/* --- Calendar: day-number label ("14" instead of "14日") ---
 *
 * FullCalendar's dayGridMonth view applies `flex-direction: row-reverse` on
 * .fc-daygrid-day-top (so the day number lands in the top-right corner).
 * We want the number on the LEFT to match our plan-3 underline which sits
 * below and is inset from the left. Override to natural row direction and
 * start-align. */
.tkek-calendar .fc-daygrid-day-top {
  flex-direction: row;
  justify-content: flex-start;
}
.tkek-calendar .fc-daygrid-day-number { padding: 4px 6px; text-decoration: none; }
.tkek-calendar .tkek-daynum {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tkek-text);
  line-height: 1;
}

/* --- Calendar: Sun / Sat visual differentiation --- */
.tkek-calendar .fc-day-sun { background-color: #fdf4ef; }
.tkek-calendar .fc-day-sun .tkek-daynum { color: #c94747; }
.tkek-calendar .fc-day-sat .tkek-daynum { color: #3a5b8a; }

/* --- Calendar: per-service cell tint (plan 1 — "at a glance" visibility) ---
 *
 * Each day cell that carries at least one event gets a very pale service-
 * colored wash so the user can pick out active days by color alone. A single-
 * service day uses the paired tint; a day with multiple services uses a warm
 * cream tone so it never collides with the single-service palette. The
 * intensity is tuned so it reads as "tinted white", not "colored block",
 * keeping the calendar uncluttered.
 */
.tkek-calendar .fc-daygrid-day.tkek-only-army { background-color: #eaf2ec; }
.tkek-calendar .fc-daygrid-day.tkek-only-navy { background-color: #e8ebf3; }
.tkek-calendar .fc-daygrid-day.tkek-only-air  { background-color: #ecf1f6; }
.tkek-calendar .fc-daygrid-day.tkek-mixed     { background-color: #f7f2e6; }

/* Sunday priority: if a Sunday has events, keep the warm peach (#fdf4ef)
 * rather than the service tint — "日曜日である" has stronger calendar
 * semantics than "イベントがある". Placed AFTER the tint rules above so the
 * cascade picks this last with equal specificity. */
.tkek-calendar .fc-day-sun.tkek-has-events { background-color: #fdf4ef; }

/* --- Calendar: service underline (plan 3 — "what kind of event" cue) ---
 *
 * A short colored bar appears under the day number on event days. Single-
 * service days are a solid color; mixed-service days get a hard-edged
 * gradient built by JS (renderCalendarIcons) with one stripe per service in
 * fixed army→navy→air order. Width is 60% desktop / 80% mobile so the bar
 * reads as a dash, not a full divider.
 */
.tkek-day-underline {
  display: block;
  height: 3px;
  width: 60%;
  margin: 2px 6px 0;            /* small left inset so it sits under the day number */
  border-radius: 2px;
  pointer-events: none;
}
.tkek-day-underline.tkek-svc-army  { background: var(--tkek-svc-army-dark); }
.tkek-day-underline.tkek-svc-navy  { background: var(--tkek-svc-navy-dark); }
.tkek-day-underline.tkek-svc-air   { background: var(--tkek-svc-air-dark); }
/* .tkek-svc-mixed receives an inline gradient from JS (one equal-width stripe
 * per service); we only need to keep the base block styling. */

/* Today emphasis kept subtle (FullCalendar default is a bit strong) */
.tkek-calendar .fc-day-today {
  background-color: rgba(201, 169, 97, 0.10) !important;
}
.tkek-calendar .fc-day-today .tkek-daynum {
  color: var(--tkek-navy);
  font-weight: 700;
}

/* --- Calendar: toolbar polish (keep FC defaults, just tune colors) --- */
.tkek-calendar .fc-toolbar-title {
  font-size: 1.15rem;
  color: var(--tkek-navy);
  font-weight: 700;
}
.tkek-calendar .fc-button-primary {
  background-color: var(--tkek-navy);
  border-color: var(--tkek-navy);
  color: #fff;
  font-weight: 600;
}
.tkek-calendar .fc-button-primary:hover,
.tkek-calendar .fc-button-primary:focus {
  background-color: var(--tkek-navy-light);
  border-color: var(--tkek-navy-light);
  box-shadow: none;
}
.tkek-calendar .fc-button-primary:disabled {
  background-color: var(--tkek-navy);
  border-color: var(--tkek-navy);
  opacity: 0.55;
}
.tkek-calendar .fc-button-primary:not(:disabled).fc-button-active,
.tkek-calendar .fc-button-primary:not(:disabled):active {
  background-color: var(--tkek-gold);
  border-color: var(--tkek-gold);
}

/* --- Calendar: per-day icon row --- */
.tkek-calendar .fc-daygrid-day.tkek-has-events { cursor: pointer; }
.tkek-calendar .fc-daygrid-day-events { min-height: 0 !important; margin: 0 !important; }
.tkek-calendar .fc-daygrid-day-bottom { display: none; }
/* Hide any default event chips (we render our own icons). */
.tkek-calendar .fc-daygrid-event-harness { display: none; }

.tkek-day-icons {
  display: flex;
  flex-wrap: wrap;      /* allow wrap rather than clip — prevents thin-sliver
                           appearance on very narrow cells */
  align-items: center;
  gap: 4px;
  padding: 2px 4px 6px;
  /* No overflow: hidden — on narrow SP cells, clipping caused the icons to
     appear as 1-2px vertical lines instead of the full shield badge. We now
     allow the icons to wrap onto a second row if the cell is too narrow. */
}
.tkek-svc-icon {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  width: 22px;
  height: 24px;
  flex: 0 0 auto;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.12s ease;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.10));
}
.tkek-svc-icon:hover { transform: translateY(-1px) scale(1.06); }
.tkek-svc-icon:focus-visible {
  outline: 2px solid var(--tkek-gold);
  outline-offset: 2px;
  border-radius: 4px;
}
.tkek-svc-icon svg { display: block; width: 100%; height: 100%; }

.tkek-day-more {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: #8b92a5;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  height: 20px;
  min-width: 26px;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.tkek-day-more:hover { background: var(--tkek-navy); }
.tkek-day-more:focus-visible {
  outline: 2px solid var(--tkek-gold);
  outline-offset: 2px;
}

/* --- Calendar: day modal (reuses .tkek-modal shell) --- */
.tkek-daymodal-heading {
  color: var(--tkek-navy);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 1.75rem 1rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--tkek-gold);
}
.tkek-daymodal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tkek-daymodal-item {
  border: 1px solid var(--tkek-border);
  border-radius: var(--tkek-radius);
  padding: 0.75rem 0.9rem;
  background: var(--tkek-bg-soft);
}
.tkek-daymodal-grid {
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 0.85rem;
  align-items: start;
}
.tkek-daymodal-mascot { align-self: center; }
.tkek-daymodal-body   { min-width: 0; }
.tkek-daymodal-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tkek-gold);
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}
.tkek-daymodal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tkek-navy);
  line-height: 1.4;
  margin-bottom: 0.15rem;
}
.tkek-daymodal-place {
  font-size: 0.85rem;
  color: var(--tkek-text-soft);
  margin-bottom: 0.5rem;
}
.tkek-daymodal-public {
  display: inline-block;
  background: var(--tkek-gold);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08em 0.45em;
  border-radius: 3px;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.tkek-daymodal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.tkek-daymodal-detail {
  appearance: none;
  -webkit-appearance: none;
  background: var(--tkek-navy);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.tkek-daymodal-detail:hover { background: var(--tkek-navy-light); }
.tkek-daymodal-source {
  font-size: 0.8rem;
  color: var(--tkek-gold);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.tkek-daymodal-source:hover { text-decoration: underline; }

/* List — single column on PC-wide layout (see card grid below) */
.tkek-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tkek-card {
  background: #fff;
  border: 1px solid var(--tkek-border);
  border-radius: var(--tkek-radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--tkek-shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}
.tkek-card::before {
  /* Subtle gold corner accent to add visual warmth */
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle at center, rgba(201,169,97,0.16), transparent 65%);
  pointer-events: none;
}
.tkek-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(26,36,86,0.14);
}

/**
 * Tablet+: make each card a horizontal row — mascot avatar pinned left,
 * date on a separate row, title/meta/excerpt flowing on the right, footer
 * spanning full width.
 */
@media (min-width: 720px) {
  .tkek-card {
    display: grid;
    grid-template-columns: 82px 150px 1fr;
    grid-template-areas:
      "mascot date title"
      "mascot date meta"
      "mascot date excerpt"
      "footer footer footer";
    column-gap: 1.25rem;
    row-gap: 0.35rem;
    align-items: start;
    padding: 1.1rem 1.4rem;
  }
  .tkek-card-mascot  { grid-area: mascot;  align-self: center; }
  .tkek-card-date    { grid-area: date;    align-self: center; font-size: 1rem; }
  .tkek-card-title   { grid-area: title; }
  .tkek-card-meta    { grid-area: meta; }
  .tkek-card-excerpt { grid-area: excerpt; }
  .tkek-card-footer  { grid-area: footer; }
}
@media (max-width: 719px) {
  .tkek-card-mascot { align-self: flex-start; }
}

/* --- Venue mascot (decorative placeholder avatar) ---
 * Renders a circular, service-colored badge with the venue's first
 * character and a small star flourish. Designed to add visual warmth
 * without requiring per-venue image assets; can later be swapped out
 * for real mascot PNGs by checking ev.mascot_url in JS.
 */
.tkek-mascot {
  width: 72px;
  height: 72px;
  position: relative;
  flex: 0 0 auto;
}
.tkek-mascot-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(26,36,86,0.22), inset 0 -4px 8px rgba(0,0,0,0.10);
  border: 2px solid #fff;
  overflow: hidden;
}
.tkek-mascot-circle::after {
  /* inner sheen */
  content: "";
  position: absolute;
  top: 8%; left: 14%;
  width: 36%; height: 28%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.45), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.tkek-mascot-char {
  color: #fff;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.20);
  position: relative;
  z-index: 1;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
}
.tkek-mascot-spark {
  position: absolute;
  top: -4px; right: -2px;
  width: 22px; height: 22px;
  background: var(--tkek-gold);
  color: #fff;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  z-index: 2;
}
.tkek-mascot--sm {
  width: 44px;
  height: 44px;
}
.tkek-mascot--sm .tkek-mascot-char { font-size: 1.15rem; }
.tkek-mascot--sm .tkek-mascot-spark {
  width: 16px; height: 16px; line-height: 16px; font-size: 0.55rem;
  top: -2px; right: -2px;
}
.tkek-mascot--lg {
  width: 96px;
  height: 96px;
}
.tkek-mascot--lg .tkek-mascot-char { font-size: 2.4rem; }

.tkek-card-date {
  color: var(--tkek-gold);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.tkek-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tkek-navy);
  margin: 0;
  line-height: 1.4;
}
.tkek-card-meta { font-size: 0.88rem; color: var(--tkek-text-soft); }
.tkek-card-excerpt { font-size: 0.92rem; color: var(--tkek-text); }
.tkek-card-public {
  display: inline-block;
  background: var(--tkek-gold);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  font-weight: 700;
}
.tkek-card-footer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--tkek-border);
}
.tkek-card-source {
  font-size: 0.85rem;
  color: var(--tkek-gold);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.tkek-card-source:hover { text-decoration: underline; color: #a8893d; }

/* Leaflet popup */
.tkek-popup-title { font-weight: 700; color: var(--tkek-navy); margin-bottom: 0.25rem; font-size: 1rem; }
.tkek-popup-meta { font-size: 0.8rem; color: var(--tkek-text-soft); margin-bottom: 0.5rem; }
.tkek-popup-link { color: var(--tkek-navy); font-weight: 600; text-decoration: none; line-height: 1.35; }
.tkek-popup-link:hover { text-decoration: underline; color: var(--tkek-navy-light); }

/* Popup list (multiple events at same venue) */
.tkek-popup-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
}
.tkek-popup-item {
  padding: 0.5rem 0;
  border-top: 1px dashed var(--tkek-border);
}
.tkek-popup-item:first-child { border-top: none; padding-top: 0.25rem; }
.tkek-popup-item-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}
.tkek-popup-date { font-size: 0.8rem; color: var(--tkek-text-soft); }
.tkek-popup-public {
  font-size: 0.7rem;
  background: var(--tkek-gold);
  color: #fff;
  padding: 0.05em 0.35em;
  border-radius: 3px;
}
.tkek-popup-source {
  font-size: 0.75rem;
  color: var(--tkek-gold);
  text-decoration: none;
  margin-left: 0.25rem;
  white-space: nowrap;
}
.tkek-popup-source:hover { text-decoration: underline; }

/* Custom venue marker (count badge for multi-event locations) */
.tkek-venue-divicon { background: transparent; border: none; }
.tkek-venue-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.tkek-venue-count { line-height: 1; }

/* Modal */
.tkek-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,28,60,0.55);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tkek-modal.is-open { display: flex; }
.tkek-modal-inner {
  background: #fff;
  border-radius: var(--tkek-radius);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding: 1.5rem;
}
.tkek-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--tkek-text-soft);
}
.tkek-modal-body h3 { color: var(--tkek-navy); margin: 0 0 0.5rem; padding-right: 1.5rem; }

/* Hero header for event modal (mascot + service color band) */
.tkek-modal-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: -1.5rem -1.5rem 1rem;
  padding: 1.1rem 1.5rem;
  color: #fff;
  border-radius: var(--tkek-radius) var(--tkek-radius) 0 0;
  position: relative;
  overflow: hidden;
}
.tkek-modal-hero::before {
  /* decorative diagonal sweep */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 55%, rgba(255,255,255,0.08) 58%, rgba(255,255,255,0.08) 62%, transparent 65%);
  pointer-events: none;
}
.tkek-modal-hero--army { background: linear-gradient(135deg, var(--tkek-svc-army-dark), var(--tkek-army)); }
.tkek-modal-hero--navy { background: linear-gradient(135deg, var(--tkek-svc-navy-dark), var(--tkek-navy-svc)); }
.tkek-modal-hero--air  { background: linear-gradient(135deg, var(--tkek-svc-air-dark),  var(--tkek-air)); }
.tkek-modal-hero .tkek-mascot {
  flex: 0 0 auto;
  z-index: 1;
}
.tkek-modal-hero-text {
  flex: 1 1 auto;
  z-index: 1;
}
.tkek-modal-hero-eyebrow {
  font-size: 0.75rem;
  opacity: 0.85;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.tkek-modal-hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: #fff;
}
.tkek-modal-body .tkek-meta-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.tkek-modal-body .tkek-meta-list li { padding: 0.25rem 0; font-size: 0.9rem; }
.tkek-modal-body .tkek-meta-list .label { display: inline-block; min-width: 6em; color: var(--tkek-text-soft); }
.tkek-modal-excerpt { font-size: 0.9rem; line-height: 1.65; margin: 0.5rem 0; }
.tkek-modal-actions { margin-top: 1rem; text-align: center; }
.tkek-modal-source-btn {
  display: inline-block;
  background: var(--tkek-navy);
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: var(--tkek-radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s;
}
.tkek-modal-source-btn:hover { background: var(--tkek-navy-light); color: #fff; text-decoration: none; }

/* Empty state */
.tkek-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--tkek-text-soft);
}

/* Responsive */
@media (max-width: 768px) {
  .tkek-tabs { display: none; }
  .tkek-tabs-sp { display: block; }
  .tkek-title { font-size: 1.4rem; }
  .tkek-filters { flex-direction: column; gap: 0.75rem; padding: 0.75rem; }

  /* Calendar: tighter cells on narrow viewports */
  .tkek-calendar { padding: 0.5rem; }
  .tkek-calendar .tkek-daynum { font-size: 0.8rem; }
  .tkek-calendar .fc-daygrid-day-number { padding: 2px 4px; }
  .tkek-day-icons { gap: 3px; padding: 1px 2px 4px; }
  .tkek-svc-icon { width: 18px; height: 20px; }
  .tkek-day-more {
    font-size: 0.62rem;
    padding: 2px 5px;
    height: 17px;
    min-width: 22px;
    border-radius: 9px;
  }
  .tkek-calendar .fc-toolbar-title { font-size: 1rem; }
  /* Plan-3 underline: wider stripe on SP so the color stripe is still
   * readable even with smaller numeric labels. */
  .tkek-day-underline { width: 80%; margin: 1px 3px 0; height: 3px; }
}

/* --- v1.2.9: SP listMonth polish ---
 *
 * On narrow viewports the calendar mounts with initialView='listMonth'
 * (see frontend.js `renderCalendar`). FullCalendar's built-in list layout
 * is already compact and vertical, but a few tweaks keep it on-brand and
 * maximize the number of events visible without scrolling:
 *   - tighter toolbar (smaller padding, font-size) and a short "今日" label
 *   - smaller row padding on list events
 *   - service-colored dot swapped in for FC's default colored square
 *   - compact title/time typography
 *
 * Kept inside the existing SP media query block above, but scoped to the
 * listMonth view only (`.fc-list`) so dayGridMonth on SP is unaffected when
 * the user switches views via the toolbar button. */
@media (max-width: 767px) {
  /* Toolbar: a 5-button row (prev/next | title | list/month) fits at 375px
   * only if each element is compact. Reduce gap and button padding. */
  .tkek-calendar .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
  }
  .tkek-calendar .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  .tkek-calendar .fc-button-primary {
    padding: 0.28em 0.55em;
    font-size: 0.78rem;
    line-height: 1.2;
  }
  .tkek-calendar .fc-toolbar-title {
    font-size: 1.05rem;
  }

  /* List view polish. `.fc-list` is the root container of listMonth. */
  .tkek-calendar .fc-list {
    border-radius: 8px;
    overflow: hidden;
  }
  /* Day header row (e.g. "2026年4月15日 水曜日"): quieter color, smaller
   * padding so each event row climbs higher on the screen. */
  .tkek-calendar .fc-list-day-cushion {
    background-color: #f5f3ec;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--tkek-navy);
  }
  /* Event row: tighter padding + tappable target height. */
  .tkek-calendar .fc-list-event {
    cursor: pointer;
  }
  .tkek-calendar .fc-list-event:hover td {
    background-color: rgba(201, 169, 97, 0.12);
  }
  .tkek-calendar .fc-list-event td {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    vertical-align: middle;
  }
  .tkek-calendar .fc-list-event-time {
    color: #666;
    font-size: 0.78rem;
    white-space: nowrap;
    width: 1px; /* shrink to content */
  }
  .tkek-calendar .fc-list-event-title {
    line-height: 1.35;
  }
  .tkek-calendar .fc-list-event-title a {
    color: var(--tkek-text);
    text-decoration: none;
  }
  /* FC renders a small colored square dot per event (`.fc-list-event-dot`,
   * a transparent-backed element with a border-color set to the event
   * color). We tint it with our service palette via the event's class,
   * matching the dayGrid underline / mascot gradient. */
  .tkek-calendar .fc-list-event-graphic {
    padding-right: 0.4rem;
    width: 1px;
  }
  .tkek-calendar .fc-list-event.tkek-svc-army .fc-list-event-dot {
    border-color: var(--tkek-svc-army-dark);
  }
  .tkek-calendar .fc-list-event.tkek-svc-navy .fc-list-event-dot {
    border-color: var(--tkek-svc-navy-dark);
  }
  .tkek-calendar .fc-list-event.tkek-svc-air .fc-list-event-dot {
    border-color: var(--tkek-svc-air-dark);
  }
  /* "この期間にイベントはありません" empty-state: lift the vertical padding
   * so it doesn't look like a rendering bug. */
  .tkek-calendar .fc-list-empty {
    padding: 2rem 1rem;
    color: #777;
    font-size: 0.9rem;
  }
}
