/* ============================================================
   Japan Event Timeline — Tool-specific styles
   ============================================================ */

/* ── Layout overrides: keep the editor inside the viewport ── */

.dvz-app {
  overflow: hidden !important;
  position: fixed !important;
  top: 104px;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--dvz-setting-sidebar-width, 390px);
  height: auto !important;
  min-height: 0 !important;
  margin-top: 0 !important;
}

#main-area {
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  overflow: hidden !important;
  min-height: 0;
}

#dvz-sidebar {
  width: var(--dvz-setting-sidebar-width, 390px) !important;
  flex-basis: var(--dvz-setting-sidebar-width, 390px) !important;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  border-radius: 0;
}

.dvz-setting-sidebar__panels {
  flex-direction: column;
}

.dvz-setting-sidebar .sidebar-panel {
  padding: 0;
}

.common-export-tab .flex.flex-col {
  gap: 12px;
}

.dvz-export-button {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  padding: 10px 16px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dvz-export-button:hover {
  background: #f9fafb;
}

.dvz-export-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #9ca3af;
}

#dvz-chart {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  height: auto;
  gap: 12px;
  overflow: hidden !important;
  min-height: 0 !important;
}

#chart-area {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden !important;
  min-height: 0;
  height: auto !important;
}

#chart-area > #chart-container,
#chart-area > #chartBlock {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
}

#chart-title,
#chart-source,
#dvz-controls {
  margin: 0 !important;
  flex: 0 0 auto;
}

#dvz-site-links {
  padding-bottom: 12px;
}

@media (max-width: 1100px) {
  .dvz-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(280px, 42dvh);
  }

  #dvz-sidebar {
    width: 100% !important;
    flex-basis: auto !important;
    border-left: 0 !important;
    border-top: 1px solid #e5e7eb;
  }

  .dvz-setting-sidebar__select-wrap {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
  }

  .dvz-setting-sidebar [data-dvz-setting-tab-select] {
    display: block;
  }

  .dvz-setting-sidebar__tabs,
  .dvz-setting-sidebar [data-dvz-setting-tabs] {
    display: none;
  }
}

@media (max-width: 720px) {
  .dvz-app {
    grid-template-rows: minmax(0, 1fr) minmax(250px, 46dvh);
  }

  #dvz-chart {
    gap: 10px;
  }
}

#chart-area #chart-container > svg,
#chart-area #chart-container svg,
#chart-area #chartBlock > svg {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  display: block;
}

#chart-area .empty-state {
  height: 100%;
  min-height: 0;
}

/* ── SVG template (dvz-template-svg) ────────────────────── */

.dvz-template-svg {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}
.dvz-template-svg svg { width: 100%; height: auto; display: block; }

/* ── Empty state ────────────────────────────────────────── */

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 400px;
  color: #999; font-size: 15px; gap: 12px;
}
.empty-state .icon { font-size: 48px; opacity: 0.4; }

/* ── Japan Event Timeline styles ────────────────────────── */

.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px;
}
.chart-card, .table-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05); padding: 14px;
}
.chart-card-head, .table-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
}
.chart-card-title { margin: 0; color: #6b7280; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.chart-slot { min-height: 180px; }
.table-scroll { overflow-x: auto; }
.table-paging { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
div.dc-chart { float: none !important; }
.dc-chart g.row text {
  fill: #FFF !important;
  font-weight: 800;
  font-size: 11px;
  stroke: #000 !important;
  stroke-width: 1px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
.dc-chart g.row rect { rx: 2; }
.dc-data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.dc-data-table thead th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 2px solid #e5e7eb; font-size: 0.75rem; font-weight: 700; color: #6b7280; text-transform: uppercase; vertical-align: top; line-height: 1.6; }
.dc-data-table tbody td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f3f4f6; vertical-align: top; line-height: 1.6; }
.dc-data-table tbody tr:hover td { background-color: #eff6ff; }
.dc-data-table .dc-table-group td { background-color: #f3f4f6; font-weight: 700; font-size: 0.75rem; color: #6b7280; }
.dc-data-table.bcf-table-has-longtext .bcf-table-col-attribute { width: 1%; min-width: clamp(6rem, 11vw, 8.5rem); white-space: normal; word-break: normal; overflow-wrap: normal; }
.dc-data-table.bcf-table-has-longtext .bcf-table-col-longtext { white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.dc-data-table.bcf-table-has-longtext .bcf-table-col-longtext-primary { width: 100%; min-width: clamp(16rem, 42vw, 28rem); }
.dc-data-table.bcf-table-has-longtext .bcf-table-col-longtext-secondary { min-width: 12rem; }
.reset {
  display: inline-flex; align-items: center; padding: 0.25rem 0.625rem;
  font-size: 0.6875rem; color: #4f81bd; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 9999px; cursor: pointer; transition: background-color 0.15s;
}
.reset:hover { background: #dbeafe; }
.reset.hidden { display: none; }
.btn-reset-all {
  display: inline-block; margin-left: 0.5rem; padding: 0.3rem 0.875rem;
  font-size: 0.75rem; font-weight: 600; color: #fff; background: #4f81bd;
  border: none; border-radius: 0.375rem; cursor: pointer;
}
.btn-reset-all:hover { background: #3b6da1; }
.btn-paging {
  display: inline-block; padding: 0.375rem 1rem; font-size: 0.75rem; font-weight: 600;
  color: #374151; background: #f9fafb; border: 1px solid #d1d5db;
  border-radius: 0.375rem; cursor: pointer;
}
.btn-paging:hover { background: #f3f4f6; }
.btn-paging[disabled] { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) {
  .dc-data-table.bcf-table-has-longtext .bcf-table-col-attribute { min-width: 5.25rem; }
  .dc-data-table.bcf-table-has-longtext .bcf-table-col-longtext-primary { min-width: 12rem; }
  .dc-data-table.bcf-table-has-longtext .bcf-table-col-longtext-secondary { min-width: 9rem; }
}

.bcf-column-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bcf-column-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0.3rem 0.7rem; font-size: 0.75rem; font-weight: 600;
  color: #374151; background: #fff; border: 1px solid #d1d5db;
  border-radius: 9999px; cursor: pointer; transition: all 0.15s;
}
.bcf-column-chip:hover:not([disabled]) { border-color: #9ca3af; background: #f9fafb; }
.bcf-column-chip.is-active {
  color: #fff; background: #4f81bd; border-color: #4f81bd;
}
.bcf-column-chip[disabled] { opacity: 0.4; cursor: not-allowed; }
.bcf-column-chip .bcf-column-count {
  font-size: 0.65rem; font-weight: 500; opacity: 0.8;
}
.bcf-column-help { margin-top: 6px; font-size: 0.65rem; color: #9ca3af; }
