/* ==========================================================================
   OphthalConf - 眼科医向け 講演会・学会検索 スタイルシート
   ========================================================================== */

:root {
  --primary: #0284c7;           /* 眼科医療にマッチするクリーンなサイアン・オーシャンブルー */
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-border: #bae6fd;
  --secondary: #475569;

  /* 予定空き状況カラーパレット */
  --status-free: #16a34a;       /* 🟢 空きあり */
  --status-free-bg: #f0fdf4;
  --status-free-border: #bbf7d0;

  --status-partial: #d97706;    /* 🟡 一部重複 */
  --status-partial-bg: #fffbeb;
  --status-partial-border: #fde68a;

  --status-conflict: #dc2626;   /* 🔴 重複 */
  --status-conflict-bg: #fef2f2;
  --status-conflict-border: #fecaca;

  --status-reg: #2563eb;        /* ✓ カレンダー登録済み */
  --status-reg-bg: #eff6ff;
  --status-reg-border: #bfdbfe;

  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;

  --border-color: #e2e8f0;
  --border-color-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 24px -6px rgba(15, 23, 42, 0.11), 0 4px 10px -2px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --sidebar-width: 320px;
  --header-height: 68px;
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.brand-title {
  display: block;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.brand-subtitle {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Beta-only presentation; remove these classes and the two HTML elements together. */
.brand-text { min-width: 0; }
.brand-logo { flex-shrink: 0; }
.beta-badge {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.beta-notice {
  box-sizing: border-box;
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border-color);
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.8;
}
.beta-notice p { max-width: 90ch; margin: 0; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-controls { min-width: 0; max-width: 270px; }
.auth-buttons { display: flex; align-items: center; gap: 8px; min-width: 0; }
.auth-user { max-width: 130px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.auth-status { display: block; font-size: 0.72rem; color: var(--text-muted); overflow-wrap: anywhere; }
.auth-controls [hidden] { display: none; }
.auth-buttons button { flex-shrink: 0; }
.auth-buttons button:disabled { opacity: 0.6; cursor: default; }

@media (min-width: 981px) {
  .app-header { height: auto; min-height: var(--header-height); }
  .header-container { min-height: var(--header-height); gap: 12px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
  .header-actions { flex-wrap: wrap; }
}

@media (max-width: 980px) {
  .header-actions .auth-controls { grid-column: 1 / -1; grid-row: 1; max-width: 100%; }
  .auth-buttons { justify-content: flex-end; }
  .auth-user { max-width: min(50vw, 240px); }
  .auth-status { text-align: right; }
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 6px;
}

.btn-outline-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-nav:hover,
.btn-outline-nav.active {
  background: var(--status-reg-bg);
  border-color: var(--status-reg-border);
  color: var(--status-reg);
}

.btn-outline-nav.active .badge-count {
  background: var(--status-reg);
}

.setting-active-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
}

/* ==========================================================================
   Calendar Settings Dialog Styles
   ========================================================================== */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.settings-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.settings-radio-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.settings-radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-radio-card:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.settings-radio-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

.settings-radio-card.disabled input[type="radio"] {
  cursor: not-allowed;
}

.settings-section.disabled .settings-section-title {
  color: #94a3b8;
}

.settings-section.disabled .settings-section-desc {
  color: #cbd5e1;
}

.radio-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.radio-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.radio-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-radio-card:has(input[type="radio"]:checked) .radio-card-desc {
  color: #0369a1;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.service-icon.google {
  background: #e0f2fe;
  color: #0284c7;
}

.service-icon.icloud {
  background: #f1f5f9;
  color: #334155;
}

.service-icon.both {
  background: #ede9fe;
  color: #7c3aed;
  font-size: 0.65rem;
  padding: 0 4px;
  width: auto;
}

.service-icon.none {
  background: #fee2e2;
  color: #ef4444;
}

.service-icon.ask {
  background: #fef3c7;
  color: #d97706;
}

.badge-recommend {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 4px;
}

/* ==========================================================================
   Layout: Sidebar + Content Area
   ========================================================================== */
.main-layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color-subtle);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

.btn-text:hover {
  text-decoration: underline;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 9px 34px 9px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.clear-icon {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.clear-icon:hover {
  color: var(--text-main);
}

.sidebar-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.schedule-sync-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}

.group-select-all {
  font-size: 0.72rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.group-select-all:hover {
  text-decoration: underline;
}

.region-select-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.company-filter-empty {
  font-size: 0.72rem;
  color: var(--text-muted);
}

#filter-company .chip-btn {
  white-space: normal;
  overflow-wrap: anywhere;
}

.group-select-domestic {
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.group-select-domestic:hover {
  text-decoration: underline;
}

/* 片道GO風 チップボタングリッド */
.chip-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-label {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}

.chip-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid transparent;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.chip-btn:hover {
  background: #e2e8f0;
}

.chip-label input:checked + .chip-btn {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 600;
}

.chip-count {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* 予定重複ステータス */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  user-select: none;
  transition: background 0.15s ease;
}

.custom-checkbox-row:hover {
  background: #f1f5f9;
}

.custom-checkbox-row input {
  accent-color: var(--primary);
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.status-dot-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-free { background: var(--status-free); }
.dot-partial { background: var(--status-partial); }
.dot-conflict { background: var(--status-conflict); }
.dot-registered { background: var(--status-reg); }

/* ==========================================================================
   Content Area
   ========================================================================== */
.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.results-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.results-count-container {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.count-highlight {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.filter-chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--status-reg-bg);
  border: 1px solid var(--status-reg-border);
  color: var(--status-reg);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-close {
  background: none;
  border: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--status-reg);
}

.sort-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-select {
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary);
}

.active-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--secondary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.active-filter-badge strong {
  color: var(--primary);
  font-weight: 600;
}

.badge-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.badge-remove:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Event Cards Grid
   ========================================================================== */
.event-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: #cbd5e1;
}

/* カレンダー登録済みカードの強調 */
.event-card.status-registered-card {
  border-left: 4px solid var(--status-reg);
}

/* 上段ヘッダー：日付・バッジ群 */
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.date-time-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  text-align: center;
  flex-shrink: 0;
}

.date-badge .month-day {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.date-badge .day-week {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.time-and-region {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-time-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-width: 0;
}

.event-time-zones > span {
  overflow-wrap: anywhere;
}

.time-text:has(.event-time-zones) {
  align-items: flex-start;
  min-width: 0;
}

.time-text:has(.event-time-zones) > svg {
  flex-shrink: 0;
  margin-top: 3px;
}

@media (max-width: 480px) {
  .event-time-zones {
    flex-direction: column;
    gap: 2px;
    flex: 1;
  }
}

.location-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 会場Google Mapsリンク（ボタン化せず、自然なインラインリンクとして表示） */
.venue-map-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #94a3b8;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
  word-break: break-all;
  cursor: pointer;
}

.venue-map-link:hover,
.venue-map-link:focus-visible {
  color: var(--primary, #0284c7);
  text-decoration-style: solid;
  text-decoration-color: var(--primary, #0284c7);
}

/* 右側バッジグループ */
.badges-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* 予定空き状況バッジ */
.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
}

.schedule-badge.free {
  background: var(--status-free-bg);
  color: var(--status-free);
  border: 1px solid var(--status-free-border);
}

.schedule-badge.partial_conflict {
  background: var(--status-partial-bg);
  color: var(--status-partial);
  border: 1px solid var(--status-partial-border);
}

.schedule-badge.conflict {
  background: var(--status-conflict-bg);
  color: var(--status-conflict);
  border: 1px solid var(--status-conflict-border);
}

.schedule-badge.registered {
  background: var(--status-reg-bg);
  color: var(--status-reg);
  border: 1px solid var(--status-reg-border);
}

.schedule-badge.unlinked {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.format-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
}

.format-badge.web {
  background: #e0f2fe;
  color: #0369a1;
}

.format-badge.onsite {
  background: #fef3c7;
  color: #b45309;
}

.format-badge.hybrid {
  background: #ede9fe;
  color: #6d28d9;
}

/* 予定重複アラートバー */
.conflict-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
}

.conflict-alert-box.partial {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.conflict-alert-box.full {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.conflict-alert-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.conflict-alert-title {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.conflict-item-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.conflict-provider-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.conflict-provider-tag.google {
  background: #dbeafe;
  color: #1e40af;
}

.conflict-provider-tag.icloud {
  background: #f1f5f9;
  color: #334155;
}

.conflict-alert-icon {
  flex-shrink: 0;
}

/* 中段：タイトル・サブタイトル・概要 */
.card-content-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.conference-title-link {
  color: inherit;
  font: inherit;
  padding-block: 6px;
  text-decoration: underline;
  text-decoration-color: #94a3b8;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.conference-title-link:hover {
  color: var(--primary);
  text-decoration-color: currentColor;
}

.conference-title-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

.card-subtitle {
  font-size: 0.88rem;
  color: #334155;
  font-weight: 500;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* 学会 (国内学会・海外学会) 特有情報ボックス */
.conference-special-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.conf-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.conf-item-full {
  width: 100%;
}

.conf-deadlines-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

.conf-registration-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.conf-registration-period .conf-label {
  white-space: normal;
  overflow-wrap: anywhere;
  flex-shrink: 1;
}

.conf-label {
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

.conf-val {
  color: #0f172a;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.conf-val.deadline-highlight {
  white-space: normal;
}

.deadline-highlight {
  color: #b91c1c;
  font-weight: 600;
  white-space: nowrap; /* 締切済などの途中の改行を防止 */
}

/* 学会参加予定切り替えバー */
.conf-attendance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: all 0.2s ease;
}

.conf-attendance-bar.attending {
  background: #f0fdf4;
  border-color: #86efac;
}

.conf-attendance-label-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.conf-attendance-main-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.conf-attendance-hint {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

/* 参加予定（あり・なし 排他2択）ボタングループ */
.conf-choice-group {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.conf-choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.conf-choice-btn .choice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.conf-choice-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

/* 「あり」アクティブ時 */
.conf-choice-btn.choice-yes.active {
  background: #16a34a;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.conf-choice-btn.choice-yes.active .choice-dot {
  background: #ffffff;
}

/* 「なし」アクティブ時 */
.conf-choice-btn.choice-no.active {
  background: #475569;
  color: #ffffff;
  border-color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.conf-choice-btn.choice-no.active .choice-dot {
  background: #ffffff;
}

/* 参加予定は、輪郭と内側の丸で選択状態を示す。 */
.conf-planned-choice-group {
  flex-wrap: wrap;
  background: transparent;
  border: none;
  padding: 0;
  gap: 6px;
}

.conf-attendance-bar.conf-planned-attendance-bar {
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
}

.conf-planned-choice-group .conf-attendance-main-text {
  font-size: 0.82rem;
  white-space: nowrap;
}

.conf-planned-choice-group .conf-choice-btn {
  min-height: 36px;
  gap: 6px;
  padding: 6px 8px;
  font-size: 0.78rem;
  white-space: nowrap;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

@media (max-width: 480px) {
  .conf-planned-choice-group .choice-seminar-hint {
    display: none;
  }

  .conf-planned-choice-group {
    gap: 4px;
  }

  .conf-planned-choice-group .conf-choice-btn {
    padding: 6px 4px;
    gap: 4px;
    font-size: 0.74rem;
  }

  .conf-planned-choice-group .conf-attendance-main-text {
    font-size: 0.78rem;
  }
}

.conf-planned-choice-group .choice-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 2px solid #64748b;
  background: transparent;
}

.conf-planned-choice-group .choice-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.conf-planned-choice-group .conf-choice-btn:hover {
  background: #f8fafc;
  border-color: #64748b;
}

.conf-planned-choice-group .conf-choice-btn:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.conf-planned-choice-group .conf-choice-btn.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: none;
}

.conf-planned-choice-group .conf-choice-btn.active .choice-dot {
  border-color: currentColor;
  background: transparent;
}

.conf-planned-choice-group .conf-choice-btn.active .choice-dot::after {
  transform: scale(1);
}

/* 「参加した」アクティブ時 */
.conf-choice-btn.choice-attended.active {
  background: #0d9488;
  color: #ffffff;
  border-color: #0f766e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.conf-choice-btn.choice-attended.active .choice-dot {
  background: #ffffff;
}

/* 「参加しなかった」アクティブ時 */
.conf-choice-btn.choice-not-attended.active {
  background: #64748b;
  color: #ffffff;
  border-color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.conf-choice-btn.choice-not-attended.active .choice-dot {
  background: #ffffff;
}

/* 参加実績バー（ハイライト） */
.conf-history-record-bar.history-attended {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.conf-attended-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
  white-space: nowrap;
}

.conf-attending-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

/* 学会参加予定バッジ（カード右上） */
.conf-attending-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

/* 終了学会バッジ（カード右上） */
.conf-ended-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* 学会参加実績バッジ（カード右上: マイ学会履歴「参加した」） */
.conf-history-attended-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #5eead4;
}

/* 参加予定設定中の学会カードハイライト */
.event-card.card-attending-conference {
  border-color: #86efac;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.08);
}

/* 参加記録ありの学会カードハイライト */
.event-card.card-history-attended {
  border-color: #5eead4;
}

/* 終了済み学会カード */
.event-card.card-conference-ended {
  opacity: 0.85;
  border-color: #e2e8f0;
}

.event-card.card-conference-ended:hover {
  opacity: 1;
}

/* 学会関連セミナー（ランチョン・モーニング等）親学会バッジ */
.parent-conference-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.parent-conference-pill svg {
  flex-shrink: 0;
}

.event-card.card-seminar-related {
  border-left: 3px solid #0284c7;
}

/* 学会分類バッジ（国内/海外、カテゴリ） */
.conf-classification-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.conf-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
}

.conf-category-badge.region {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.conf-category-badge.category {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* 演題募集ステータス・締切表示 */
.conf-abstract-deadline-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  overflow-wrap: anywhere;
}

.conf-deadlines-row > .conf-item {
  min-width: 0;
}

.abstract-status-tag.normal,
.abstract-status-tag.upcoming {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.abstract-status-tag.closed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.abstract-status-tag.today {
  background: #991b1b;
  color: #ffffff;
  border: 2px solid #7f1d1d;
  font-size: 0.8rem;
}

.abstract-start-date,
.abstract-unknown {
  color: #64748b;
  font-size: 0.75rem;
}

.abstract-status-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.70rem;
  font-weight: 700;
  white-space: nowrap;
}

.abstract-status-tag.open {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.abstract-status-tag.soon {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.abstract-status-tag.urgent {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.abstract-submit-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.abstract-submit-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .conf-abstract-deadline-val {
    width: 100%;
    gap: 8px;
  }

  .abstract-submit-link {
    min-height: 44px;
  }
}

.abstract-submit-link:hover {
  color: var(--primary-hover);
  background: var(--primary-light);
}

.abstract-submit-link.abstract-submit-link-closed {
  color: #64748b;
  font-weight: 500;
  border-color: transparent;
  background: transparent;
}

.abstract-submit-link.abstract-submit-link-closed:hover {
  color: #334155;
  background: #f1f5f9;
}

.deadline-highlight.closed {
  color: #64748b;
}

.deadline-highlight.upcoming {
  color: #0284c7;
}

/* メタ情報（共催・単位等） */
.card-meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 4px 12px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  line-height: 1.4;
}

.card-meta-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  color: #475569;
}

.card-meta-label {
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-meta-item > :last-child {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.credits-highlight {
  color: #0284c7;
  font-weight: 600;
}

/* タグ一覧 */
.card-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-item {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  color: #64748b;
}

/* 下段フッター：3つの操作ボタングループ */
.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color-subtle);
}

/* ボタン汎用 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-color);
  color: #334155;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* カレンダー追加ボタン */
.btn-calendar {
  background: #ffffff;
  border-color: var(--border-color);
  color: #1e293b;
}

.btn-calendar:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f9ff;
}

/* 公式申込ページボタン */
.btn-official {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0284c7;
}

.btn-official:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  color: var(--text-light);
  margin-bottom: 4px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 420px;
}

/* ==========================================================================
   Dialog / Modal (案内PDFプレビュー)
   ========================================================================== */
.custom-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 620px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background: #ffffff;
  margin: auto;
}

.custom-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

.dialog-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.dialog-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dc2626;
}

.dialog-title-wrapper h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

.close-btn:hover {
  color: var(--text-main);
}

.dialog-body {
  padding: 24px;
  overflow-y: auto;
}

.pdf-paper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pdf-paper-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  text-align: center;
}

.pdf-stamp {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #0284c7;
  color: #0284c7;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pdf-main-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.pdf-paper-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
}

.dialog-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-action-btn {
  background: #38bdf8;
  color: #0f172a;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-left: 6px;
}

.toast-action-btn:hover {
  background: #7dd3fc;
}

.toast-action-btn:active {
  transform: scale(0.97);
}

/* ==========================================================================
   Hidden Conferences Management
   ========================================================================== */
.filter-group-hidden-conferences {
  border-top: 1px dashed #e2e8f0;
  padding-top: 14px;
  margin-top: 14px;
}

.btn-manage-hidden {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 8px 12px;
  color: #475569;
  border-color: #cbd5e1;
  background: #ffffff;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  width: 100%;
}

.btn-manage-hidden:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.hidden-conferences-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.hidden-conference-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.hidden-conference-item-card:hover {
  background: #f1f5f9;
}

.hidden-item-info {
  flex: 1;
  min-width: 0;
}

.hidden-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.35;
}

.hidden-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  color: #64748b;
  flex-wrap: wrap;
}

.btn-restore-conf {
  flex-shrink: 0;
  font-size: 0.76rem;
  padding: 5px 12px;
  border-color: #0284c7;
  color: #0284c7;
  background: #ffffff;
}

.btn-restore-conf:hover {
  background: #0284c7;
  color: #ffffff;
}

.hidden-empty-state {
  padding: 30px 16px;
  text-align: center;
}

/* ==========================================================================
   Responsive & Mobile Adjustments
   ========================================================================== */
.mobile-only {
  display: none !important;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 45;
}

@media (max-width: 980px) {
  .mobile-only {
    display: inline-flex !important;
  }

  /* ヘッダーの高さ自動化 & パディング調整 */
  .app-header {
    height: auto;
    min-height: var(--header-height);
    padding: 10px 0;
  }

  .header-container {
    height: auto;
    padding: 0 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand {
    justify-content: flex-start;
  }

  /* 上部操作エリア：2段構成
     1段目: 「カレンダー連携設定」「登録済み一覧」「マイ学会履歴」（3等分）
     2段目: 「条件で絞り込む」（全幅）
  */
  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
  }

  .header-actions #calendar-settings-btn {
    grid-column: 1 / 2;
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
    font-size: 0.72rem;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }

  .header-actions #calendar-settings-btn span:first-of-type {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
  }

  .header-actions #calendar-settings-btn .setting-active-pill {
    flex-shrink: 0;
    font-size: 0.65rem;
    padding: 1px 4px;
    margin-left: 2px;
    white-space: nowrap;
  }

  .header-actions #toggle-registered-filter {
    grid-column: 2 / 3;
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
    font-size: 0.72rem;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }

  .header-actions #toggle-registered-filter span:first-of-type {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
  }

  .header-actions #conference-history-btn {
    grid-column: 3 / 4;
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
    font-size: 0.72rem;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }

  .header-actions #conference-history-btn span:first-of-type {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
  }

  .header-actions #mobile-filter-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    font-size: 0.88rem;
    justify-content: center;
  }

  /* サイドバー（スマホドロワー） */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    max-height: 100vh;
    z-index: 50;
    border-radius: 0;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.15);
  }

  .sidebar.open {
    left: 0;
  }

  .modal-backdrop.open {
    display: block;
  }

  .sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
  }

  .btn-block {
    width: 100%;
  }

  .active-dot {
    width: 8px;
    height: 8px;
    background: #facc15;
    border-radius: 50%;
    display: inline-block;
  }

  .main-layout {
    padding: 14px 12px;
    width: 100%;
    max-width: 100%;
  }

  .content-area {
    width: 100%;
    max-width: 100%;
  }

  .content-header-bar {
    padding: 14px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sort-selector-wrapper {
    justify-content: space-between;
    width: 100%;
  }

  .sort-select {
    flex: 1;
    max-width: 220px;
  }

  .event-card {
    padding: 16px 14px;
    width: 100%;
    max-width: 100%;
  }

  .card-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .date-time-block {
    align-items: flex-start;
    gap: 10px;
  }

  .time-and-region {
    min-width: 0;
    flex: 1;
  }

  .time-text {
    font-size: 0.88rem;
    flex-wrap: wrap;
  }

  .location-text {
    word-break: break-all;
  }

  .badges-group {
    justify-content: flex-start;
    gap: 6px;
  }

  /* 予定重複アラート */
  .conflict-alert-box {
    padding: 8px 10px;
  }

  .conflict-item-line {
    flex-wrap: wrap;
    gap: 4px;
    word-break: break-all;
  }

  /* 学会情報ボックス */
  .conference-special-box {
    padding: 8px 10px;
  }

  .conf-attendance-bar {
    padding: 7px 10px;
    gap: 6px;
  }

  .conf-attendance-main-text {
    font-size: 0.82rem;
  }

  .conf-attendance-hint {
    font-size: 0.70rem;
  }

  .conf-choice-btn {
    padding: 3px 9px;
    font-size: 0.74rem;
  }

  .parent-conference-pill {
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  .conf-item {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .conf-label {
    min-width: 0;
  }

  .conf-deadlines-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* メタ情報リストのminmax(280px)解除 */
  .card-meta-list {
    grid-template-columns: 1fr;
    padding: 8px 10px;
    gap: 4px;
  }

  .card-meta-item {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .card-meta-label {
    min-width: 0;
  }

  .card-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .card-actions-row .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .header-actions #calendar-settings-btn,
  .header-actions #toggle-registered-filter,
  .header-actions #conference-history-btn {
    padding: 7px 3px;
    font-size: 0.70rem;
    gap: 3px;
    letter-spacing: -0.02em;
  }

  .header-actions #calendar-settings-btn svg,
  .header-actions #toggle-registered-filter svg,
  .header-actions #conference-history-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }

  .header-actions #calendar-settings-btn .setting-active-pill {
    padding: 1px 4px;
    font-size: 0.60rem;
    margin-left: 2px;
    border-radius: var(--radius-sm);
  }

  .badge-count {
    margin-left: 2px;
    padding: 0 4px;
    min-width: 17px;
    height: 17px;
    font-size: 0.65rem;
  }

  .date-badge {
    min-width: 68px;
    padding: 5px 6px;
  }

  .date-badge .month-day {
    font-size: 0.95rem;
  }

  .date-badge .day-week {
    font-size: 0.66rem;
  }

  .card-title {
    font-size: 1.05rem;
  }

  /* スマホでは項目名と値を同じ行に置き、長い値だけ折り返す。 */
  .conference-special-box {
    padding: 8px 10px;
    gap: 4px;
    line-height: 1.4;
  }

  .conf-item,
  .card-meta-item {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
  }

  .conf-label,
  .card-meta-label {
    white-space: nowrap;
  }

  .conf-val,
  .card-meta-item > :last-child {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .conf-deadlines-row {
    gap: 4px;
  }

  .card-meta-list {
    padding: 8px 10px;
    gap: 4px;
    line-height: 1.4;
  }
}

/* ==========================================================================
   マイ学会履歴モーダル & 参加履歴機能スタイル
   ========================================================================== */
.conference-history-dialog .dialog-content {
  max-width: 680px;
}

.history-nav-control .btn-manage-history {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #0f766e;
  border-color: #99f6e4;
  background: #f0fdfa;
  font-weight: 600;
}

.history-nav-control .btn-manage-history:hover {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #115e59;
}

.history-overall-summary {
  margin: 16px 0 20px 0;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.history-summary-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}

.history-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.summary-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0d9488;
}

.summary-stat-value small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.history-summary-divider {
  width: 1px;
  height: 32px;
  background: #e2e8f0;
}

/* 年度切り替えタブバー */
.history-fy-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.history-fy-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.history-fy-tab-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.history-fy-tab-btn.active {
  background: #0d9488;
  border-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.25);
}

.history-fy-tab-btn .tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 0.70rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.history-fy-tab-btn.active .tab-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.conference-history-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* 年度別カード */
.history-fiscal-year-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.history-fy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

.history-fy-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.history-fy-stat-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-stat-chip {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.history-stat-chip.total {
  background: #ccfbf1;
  color: #0f766e;
}

.history-stat-chip.domestic {
  background: #e0f2fe;
  color: #0369a1;
}

.history-stat-chip.international {
  background: #f3e8ff;
  color: #7e22ce;
}

.history-conf-list {
  display: flex;
  flex-direction: column;
}

.history-conf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.history-conf-item:last-child {
  border-bottom: none;
}

.history-conf-item:hover {
  background: #f8fafc;
}

.history-conf-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.history-conf-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-conf-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.4;
}

.history-conf-title a {
  color: var(--text-main);
  text-decoration: none;
}

.history-conf-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.history-conf-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.history-conf-actions {
  flex-shrink: 0;
}

.btn-cancel-attended {
  font-size: 0.72rem;
  padding: 4px 10px;
  color: #64748b;
  border-color: #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel-attended:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
}

.history-empty-state {
  padding: 36px 16px;
  text-align: center;
}

.history-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.history-empty-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 440px;
  margin: 0 auto;
}

.google-connection-actions {display:flex; flex-wrap:wrap; gap:8px; margin-top:10px;}
.google-connection-actions .btn {white-space:normal; max-width:100%;}
#google-calendar-message {font-size:.85rem; overflow-wrap:anywhere;}
#google-calendar-connection[hidden], #google-calendar-connection button[hidden] {display:none;}
.conflict-item-line {overflow-wrap:anywhere; min-width:0;}
.city-label-mobile {display:none;}
.card-action-mobile {display:none;}
@media (max-width: 480px) {
  .conf-city-label .city-label-full {display:none;}
  .conf-city-label .city-label-mobile {display:inline;}
  .card-actions-row {
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:6px;
  }
  .card-actions-row .btn {
    min-width:0;
    min-height:36px;
    padding:7px 4px;
    gap:4px;
    font-size:clamp(.625rem, 3vw, .8rem);
    line-height:1.2;
    white-space:nowrap;
  }
  .card-actions-row .btn svg {flex-shrink:0;}
  .card-actions-row .card-action-full {display:none;}
  .card-actions-row .card-action-mobile {display:inline;}
}
