@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');
/* 機能ごとに集約。幅別指定はカスケードを維持する位置に置く。
   共通設定 → 上部バー → サイドバー → 各図 → 編集パネル → 共通状態。
   幅別の例外は各機能内に配置。境界は500px・620px・850px。 */

/* ===== 基本設定・ページの土台 ===== */
button[hidden] {
  display: none !important;
}
:root {
  --ui-accent: #0d9488;
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 12%, white);
  --diagram-accent: var(--ui-accent);
  --toolbar-control-height: 36px;
  --toolbar-toggle-height: calc(var(--toolbar-control-height) - 2px);
  --app-font-family: 'DM Sans', 'Noto Sans JP', sans-serif;
  --app-font-control: 500 13px var(--app-font-family);
  --app-font-field: 400 14px/20px var(--app-font-family);
  --app-font-caption: 500 12px var(--app-font-family);
  font-family: var(--app-font-family);
  color: #17202d;
  background: #f7f9fc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ===== 上部バー・図の選択・共通メニュー ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: var(--ui-accent);
  color: #17202d;
  font-size: 19px;
}
.divider {
  height: 24px;
  width: 1px;
  background: #e4e8f0;
  margin: 0 5px;
}
@media (max-width: 850px) {
  .brand {
    font-size: 17px;
  }
}

@media (max-width: 620px) {
  .topbar .topbar-leading {
    justify-content: flex-start;
  }
  .topbar .sidebar-toggle {
    display: none;
  }
  .brand {
    width: auto;
  }
}
@media (max-width: 500px) {
  #diagramTypePicker {
    display: none !important;
  }
  #timetableWeekView,
  #timetableMonthView,
  #timetableListView {
    display: none !important;
  }
  body.timetable-mode #timetablePrevious,
  body.timetable-mode #timetableDate,
  body.timetable-mode #timetableNext,
  body.timetable-mode #timetableNextWeek,
  body.timetable-mode #timetableToday {
    display: none !important;
  }
  body.timetable-mode #exportXlsx,
  body.timetable-mode #copyDiagram,
  body.timetable-mode #exportCalendar,
  body.timetable-mode #toggleExportTools {
    display: none !important;
  }
  body.timetable-mode #timetableTimeEditor {
    display: none !important;
  }
  body.timetable-mode #exportTools[hidden],
  body.timetable-mode #exportTools:not([hidden]) {
    display: contents !important;
  }
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
}
:is(.toolbar-group, .export-tools) > button,
.toolbar-group > select {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}
.toolbar-group > #flowShape,
.toolbar-group > #mindmapArrange,
.toolbar-group > #mindmapConnectionStyle {
  border: 1px solid #e1e6ef;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  color: #435064;
  font: var(--app-font-control);
  cursor: pointer;
}

.autosave-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #647187;
  font-size: 12px;
  cursor: pointer;
}
.autosave-switch-control {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 34px;
  height: 19px;
}
.autosave-switch input {
  position: absolute;
  top: 50%;
  right: 0;
  width: 34px;
  height: 19px;
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  cursor: pointer;
}
.switch-track {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
  flex: none;
  border-radius: 999px;
  background: #cbd3df;
  transition: background 0.15s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #17202d30;
  transition: transform 0.15s;
}
.autosave-switch input:checked + .switch-track {
  background: var(--ui-accent);
}
.autosave-switch input:checked + .switch-track::after {
  transform: translateX(15px);
}
.autosave-switch input:focus-visible + .switch-track {
  outline: 2px solid #17202d;
  outline-offset: 2px;
}
.arrange-picker {
  position: relative;
  flex: none;
}
.arrange-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 104px;
  padding: 8px 10px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
  color: #435064;
  font: var(--app-font-control);
  white-space: nowrap;
  cursor: pointer;
}
.arrange-trigger:hover,
.arrange-trigger[aria-expanded='true'] {
  border-color: var(--ui-accent);
  background: #fff;
}
.arrange-menu {
  min-width: 132px;
  padding: 5px;
  border: 1px solid #e1e6ef;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 24px #24324a24;
}
.arrange-menu[hidden] {
  display: none;
}
.arrange-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #435064;
  text-align: left;
  font: var(--app-font-control);
  white-space: nowrap;
  cursor: pointer;
}
.arrange-menu button:hover,
.arrange-menu button[aria-current='true'] {
  background: color-mix(in srgb, var(--diagram-accent, #5267e8) 12%, white);
  color: var(--diagram-accent, #5267e8);
}
.filter-picker-input {
  box-sizing: border-box;
  width: 190px;
  height: var(--toolbar-control-height);
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--ui-accent, #079b8e);
  border-radius: 8px;
  background: #fff;
  color: #435064;
  font: var(--app-font-control);
  outline: none;
}
.filter-picker-input:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-accent, #079b8e) 15%, transparent);
}
.filter-picker-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 40px;
  height: var(--toolbar-toggle-height);
  border: 0;
  border-left: 1px solid #e1e6ef;
  border-radius: 0 7px 7px 0;
  background: #fff;
  color: #647187;
  font-size: 18px;
  cursor: pointer;
}
.filter-picker-toggle:hover,
.filter-picker-toggle[aria-expanded='true'] {
  background: var(--ui-accent-soft, #e2f3f1);
  color: var(--ui-accent, #079b8e);
}
.toolbar-break {
  display: block;
  flex: 0 0 1px;
  width: 1px;
  height: 24px;
  margin: 0 5px;
  background: #e4e8f0;
}
:is(.toolbar-group, .export-tools) > button {
  border: 1px solid #e1e6ef;
  background: #fff;
  border-radius: 8px;
  padding: 9px 13px;
  color: #435064;
  font: var(--app-font-control);
  cursor: pointer;
}
:is(.toolbar-group, .export-tools) > button:hover {
  background: #f3f5ff;
}
:is(.toolbar-group, .export-tools) > button.primary {
  background: #5267e8;
  border-color: #5267e8;
  color: #fff;
}
:is(.toolbar-group, .export-tools) > button.primary:hover {
  background: #4056d4;
}

@media (max-width: 620px) {
  .toolbar-first-row .topbar-leading,
  .toolbar-first-row .brand {
    width: auto;
  }
}
.toolbar-group > select[hidden] {
  display: none !important;
}
.topbar #diagramType,
.topbar #flowShape,
.topbar .arrange-trigger {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-width: 104px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  padding: 0 34px 0 12px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23647085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: #435064;
  font: 500 13px/20px var(--app-font-family);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.topbar .arrange-trigger > span[aria-hidden='true'] {
  display: none;
}
.topbar select:hover,
.topbar .arrange-trigger:hover {
  background-color: #f7f9fc;
}
.topbar select:focus-visible,
.topbar .arrange-trigger:focus-visible {
  outline: 2px solid #5267e8;
  outline-offset: 2px;
}
.topbar .toolbar-first-row {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: max-content;
  max-width: none;
  width: max-content;
  gap: 8px 12px;
  overflow: visible;
}
.topbar .topbar-leading {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  width: auto;
  min-width: 0;
  max-width: none;
  flex-wrap: nowrap;
  overflow: visible;
  gap: 8px;
}
.topbar-leading .brand {
  width: auto;
}
.toolbar-first-row .toolbar-group,
.toolbar-export-group {
  min-width: 0;
  gap: 6px;
}
#timetableFilters .filter-picker-input {
  width: 150px;
  padding-right: 24px;
  flex: none;
}
#timetableFilters .filter-picker-toggle {
  width: 20px;
  padding-left: 0;
  padding-right: 0;
}
.topbar button,
.topbar label,
.topbar .timetable-count {
  white-space: nowrap;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #e8edf4;
  align-items: center;
  flex: none;
  height: auto;
  min-height: 64px;
  gap: 8px 12px;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  overflow-x: auto;
  flex-shrink: 0;
}
.topbar .toolbar-first-row .toolbar-group,
.topbar #timetableTools,
.topbar .timetable-quick-dates {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  max-width: none;
  overflow: visible;
}
.topbar #timetableTimeEditor,
.topbar .toolbar-export-group {
  flex: 0 0 auto;
  min-width: max-content;
  flex-wrap: nowrap;
  max-width: none;
  overflow: visible;
}
.topbar #timetableTimeEditor label {
  display: flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  gap: 4px;
  font-size: 12px;
  color: #647187;
}
.topbar .toolbar-break:not([hidden]),
.topbar .timetable-date-divider {
  display: block;
  flex: 0 0 1px;
  width: 1px;
  height: 24px;
  margin: 0 5px;
  border: 0;
  background: #e4e8f0;
}
#timetableTimeEditor .timetable-calendar-picker .arrange-trigger {
  position: absolute;
  right: 1px;
  top: 1px;
  box-sizing: border-box;
  width: 25px;
  min-width: 0;
  height: 34px;
  padding: 0;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: var(--app-font-field);
}
.topbar-shell {
  position: relative;
  flex: none;
  width: 100%;
  min-width: 0;
  max-width: 100vw;
}
.topbar-shell .topbar {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: auto;
}
.topbar .toolbar-group,
.topbar #timetableFilters {
  flex-shrink: 0;
  max-width: none;
  overflow: visible;
}
.toolbar-scroll-controls {
  position: absolute;
  right: 4px;
  top: 3px;
  display: flex;
  gap: 2px;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 5px #17202d25;
  border-radius: 5px;
}
.toolbar-scroll-controls[hidden] {
  display: none;
}
.toolbar-scroll-controls button {
  width: 27px;
  height: 27px;
  border: 1px solid #dfe5ef;
  border-radius: 4px;
  background: #fff;
  color: #435064;
  font-size: 20px;
  cursor: pointer;
}
.toolbar-scroll-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}
.export-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.export-tools[hidden] {
  display: none !important;
}
#toggleExportTools {
  white-space: nowrap;
}
.toolbar-autosave {
  flex: 0 0 auto;
  font-size: 11px;
  white-space: nowrap;
  margin-left: 8px;
}
#flowShapePicker {
  min-width: 150px;
}
#flowShapeToggle {
  width: 150px;
  display: flex;
  justify-content: space-between;
}

/* 上部バーの操作欄の高さを統一。候補メニューや日付・時刻パネルは対象外。 */
.topbar
  :where(button, input:not([type='checkbox']):not([type='file']), select):not(
    :where(
      .arrange-menu *,
      .schedule-date-popup *,
      .schedule-time-popup *,
      .schedule-time-accordion *
    )
  ) {
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-height: 0;
}
.topbar
  button:not(
    :where(
      .arrange-menu *,
      .schedule-date-popup *,
      .schedule-time-popup *,
      .schedule-time-accordion *
    )
  ) {
  padding-top: 0;
  padding-bottom: 0;
}
.topbar .filter-picker-toggle,
.topbar #timetableTimeEditor .timetable-calendar-picker > .arrange-trigger {
  height: var(--toolbar-toggle-height);
  padding-top: 0;
  padding-bottom: 0;
}

/* ===== サイドバー・カード一覧・月間カレンダー ===== */
.outline-card-editor {
  min-height: 36px;
  resize: none;
  overflow: hidden;
  cursor: text;
  user-select: text;
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
}
.sidebar h1 {
  font-size: 29px;
  line-height: 1.35;
  letter-spacing: -1.2px;
  margin: 0 0 15px;
}
.sidebar h1 em {
  font-style: normal;
  color: #5267e8;
}
.hint {
  font-size: 13px;
  line-height: 1.8;
  color: #7a8799;
  margin: 0;
}
.tips {
  margin-top: 33px;
  padding-top: 22px;
  border-top: 1px solid #edf0f5;
  display: grid;
  gap: 15px;
  color: #7a8799;
  font-size: 11px;
}
.tips div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tips kbd {
  font: 600 10px 'DM Sans';
  background: #f1f3f7;
  border: 1px solid #e1e5ec;
  border-radius: 5px;
  padding: 4px 6px;
  color: #566278;
  white-space: nowrap;
}
.sidebar-foot span {
  color: #c1c8d2;
}
@media (max-width: 850px) {
  .sidebar h1 {
    font-size: 24px;
  }
}
.sidebar-toggle {
  border: 1px solid #e1e6ef;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  color: #526178;
  font-size: 16px;
  cursor: pointer;
  flex: none;
}
.sidebar-toggle:hover {
  background: #f3f5ff;
}
.sidebar-hidden .sidebar {
  display: none;
}
.outline-card {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #435064;
  text-align: left;
  font: var(--app-font-caption);
  line-height: 1.45;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.outline-card:hover {
  background: #f5f6fb;
  border-color: #e8ebf2;
}
.outline-children {
  margin: 3px 0 4px 13px;
  padding-left: 10px;
  border-left: 1px solid #e2e6ef;
  display: grid;
  gap: 2px;
}
.outline-empty {
  color: #98a2b2;
  font-size: 12px;
  padding: 0 10px;
}
.outline-row > .outline-card {
  flex: 1;
  min-width: 0;
}
.outline-children .outline-row > .outline-card {
  padding-left: 8px;
}
.outline-item {
  min-width: 0;
  position: relative;
}
.outline-row {
  display: flex;
  gap: 3px;
  min-width: 0;
  align-items: center;
}
.outline-toggle,
.outline-toggle-spacer {
  width: 16px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
}
.outline-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  color: #8490a2;
  font-size: 12px;
  cursor: pointer;
}
.outline-toggle:hover {
  color: #5267e8;
}
.outline-grip {
  width: 15px;
  flex: none;
  color: #a0a9b7;
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.outline-grip:hover {
  color: #5267e8;
}
.outline-grip:active {
  cursor: grabbing;
}
.outline-dragging {
  opacity: 0.45;
}
.outline-drop-before > .outline-row {
  border-top: 2px solid #5267e8;
}
.outline-drop-after > .outline-row {
  border-bottom: 2px solid #5267e8;
}
.outline-drop-inside > .outline-row {
  background: #eef0ff;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #5267e8;
}
.outline-children[hidden] {
  display: none;
}
.sidebar-resizer {
  position: relative;
  z-index: 3;
  flex: none;
  width: 8px;
  margin-left: -3px;
  margin-right: -5px;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: #e8edf4;
  transition:
    background 0.15s,
    width 0.15s,
    left 0.15s;
}
.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.resizing-sidebar .sidebar-resizer::after {
  left: 2px;
  width: 3px;
  background: #5267e8;
}
.sidebar-resizer:focus-visible {
  outline: none;
}
.resizing-sidebar {
  cursor: col-resize;
  user-select: none;
}
.sidebar-hidden .sidebar-resizer {
  display: none;
}
@media (max-width: 620px) {
  .sidebar-resizer {
    display: none;
  }
}
.eyebrow {
  letter-spacing: 1.8px;
  color: #99a3b5;
  font-weight: 700;
  margin: 0 0 18px;
  font-size: 18px;
}
.theme-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 20px;
  max-width: 224px;
}
.theme-swatch {
  width: 100%;
  height: 13.5px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 7px;
  background: var(--swatch-color);
  box-shadow: 0 0 0 1px #dce2ec;
  cursor: pointer;
}
.theme-swatch:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--swatch-color);
}
.theme-swatch[aria-pressed='true'] {
  box-shadow:
    0 0 0 2px #17202d,
    0 0 0 4px #fff;
}
.theme-swatch:focus-visible {
  outline: 2px solid #17202d;
  outline-offset: 3px;
}
.theme-palette-status {
  max-width: 224px;
  margin: -12px 0 16px;
  color: #66758a;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.flow-shape-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 4px 5px rgba(40, 57, 85, 0.08));
}
.flow-shape-outline polygon {
  fill: #fff;
  stroke: var(--diagram-accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.sidebar-foot {
  margin-top: auto;
  color: #a5afbd;
  font-size: 10px;
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flow-node.selected .flow-shape-outline polygon {
  stroke-width: 4;
}
.outline-card.active {
  position: relative;
  padding-left: 13px;
  border-color: color-mix(in srgb, var(--outline-accent) 48%, white);
  background: color-mix(in srgb, var(--outline-accent) 12%, white);
  color: var(--outline-accent);
  font-weight: 700;
  box-shadow:
    inset 3px 0 var(--outline-accent),
    0 1px 4px color-mix(in srgb, var(--outline-accent) 12%, transparent);
}
.sidebar-content {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}
.card-outline {
  margin: 18px -8px 18px 0;
  padding: 2px 8px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: none;
  min-height: auto;
  overflow: visible;
}
.outline-date-group {
  flex: none;
  border-top: 1px solid #e1e6ef;
  padding-top: 9px;
  margin-top: 5px;
}
.outline-date-group:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.outline-date-group.outline-date-drop {
  background: color-mix(in srgb, var(--ui-accent) 8%, white);
  box-shadow: inset 0 0 0 2px var(--ui-accent);
  border-radius: 8px;
}
.outline-date-heading {
  padding: 5px 8px 8px;
  color: var(--ui-accent);
  font-size: 12px;
  font-weight: 700;
}
.outline-date-heading.is-today {
  color: #2563eb;
}
.sidebar-month-calendar {
  margin: 12px 0 20px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  color: #344154;
}
.sidebar-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}
.sidebar-month-calendar button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 5px;
}
.sidebar-month-header button {
  width: 28px;
  height: 28px;
  font-size: 20px;
}
.sidebar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  text-align: center;
  font-size: 13px;
}
.sidebar-month-grid > span,
.sidebar-month-grid > button {
  display: grid;
  place-items: center;
  min-height: 27px;
}
.sidebar-month-grid > span {
  color: #647187;
}
.sidebar-month-calendar button:hover {
  background: var(--ui-accent-soft);
}
.sidebar-month-grid button.is-selected {
  background: var(--ui-accent);
  color: white;
  font-weight: 700;
}
.sidebar-month-grid button.has-events {
  color: #ea580c;
  font-weight: 700;
}
.sidebar-month-grid button.has-events.is-selected {
  background: #ffedd5;
  color: #c2410c;
  box-shadow: inset 0 0 0 1px var(--ui-accent);
}
.sidebar-month-grid button.is-today {
  color: #2563eb;
  font-weight: 700;
}
.sidebar-month-grid button.is-today.is-selected {
  background: #dbeafe;
  color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}
.sidebar-month-grid button.is-selected,
.sidebar-month-grid button.has-events.is-selected,
.sidebar-month-grid button.is-today.is-selected {
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}
.timetable-outline .outline-card {
  border: 1px solid color-mix(in srgb, var(--event-accent) 35%, white);
  border-left: 4px solid var(--event-accent);
  background: color-mix(in srgb, var(--event-accent) 10%, white);
  color: #344154;
  margin-bottom: 4px;
}
.timetable-outline .outline-card:hover {
  background: color-mix(in srgb, var(--event-accent) 18%, white);
}
.timetable-outline .outline-card.active {
  border-color: var(--event-accent);
  background: color-mix(in srgb, var(--event-accent) 10%, white);
  box-shadow: 0 0 0 2px var(--event-accent);
  color: #344154;
}
.sidebar {
  flex: none;
  background: #fff;
  border-right: 1px solid #e8edf4;
  padding: 42px 30px 27px;
  flex-direction: column;
  width: var(--sidebar-width, 272px);
  display: block;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
}
.sidebar-collapse {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
}

/* 右サイドバーの開閉・幅はブラウザへ保存しない。 */
.right-sidebar {
  position: relative;
  flex: 0 0 calc(100vw / 6);
  width: calc(100vw / 6);
  min-width: 0;
  min-height: 0;
  border-left: 1px solid #e8edf4;
  background: #fff;
  overflow: auto;
}
.right-sidebar[hidden] {
  display: none;
}
.right-sidebar-close,
.bottom-bar-close {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
}
#toggleRightSidebar,
#toggleBottomBar {
  color: var(--ui-accent);
}

/* 両サイドバーを含む作業領域の下に、画面高の1/6を確保する。 */
.bottom-bar {
  position: relative;
  flex: 0 0 calc(100dvh / 6);
  height: calc(100dvh / 6);
  width: 100%;
  min-height: 0;
  border-top: 1px solid #e8edf4;
  background: #fff;
  overflow: auto;
}
.bottom-bar[hidden] {
  display: none;
}
body.bottom-bar-open .workspace {
  min-height: 0;
}

/* ===== 共通キャンバス・カード・ズーム ===== */
.canvas-shell {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #fbfcfe;
}
.canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image: radial-gradient(#dbe2ee 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab;
}
.canvas.panning {
  cursor: grabbing;
}
.connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  transform-origin: 0 0;
  transform-box: border-box;
}
.connections path {
  fill: none;
  stroke: #c7d0e0;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.connections .coordinate-axis {
  stroke: #9aa4b2;
  stroke-width: 1.5;
  stroke-linecap: butt;
  pointer-events: none;
}
.nodes {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}
.node {
  position: absolute;
  min-width: 142px;
  max-width: 220px;
  padding: 12px 17px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dfe5ef;
  box-shadow: 0 5px 16px rgba(40, 57, 85, 0.08);
  font-size: 13px;
  text-align: center;
  color: #344154;
  cursor: move;
  user-select: none;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.node:hover {
  border-color: #a9b6ef;
}
.node.selected {
  border: 2px solid #5267e8;
  padding: 11px 16px;
  box-shadow: 0 6px 19px rgba(82, 103, 232, 0.2);
  color: #293a9e;
  font-weight: 600;
}
.node.root {
  font-size: 15px;
  min-width: 180px;
}
.node input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  color: inherit;
}
.canvas-help {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #9ba6b6;
  background: rgba(255, 255, 255, 0.82);
  padding: 7px 12px;
  border-radius: 6px;
  pointer-events: none;
}
.zoom-control {
  position: absolute;
  right: 22px;
  bottom: 18px;
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  box-shadow: 0 4px 14px #24324a10;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.zoom-control button {
  border: 0;
  background: #fff;
  padding: 8px 11px;
  color: #617088;
  font-size: 16px;
  cursor: pointer;
}
.zoom-control button:hover {
  background: #f2f4fa;
}
.zoom-control span {
  font-size: 11px;
  min-width: 43px;
  text-align: center;
  color: #69768a;
}
.zoom-control .reset {
  border-left: 1px solid #e8ecf3;
  font-size: 10px;
  padding: 10px;
}
@media (max-width: 620px) {
  .canvas-shell {
    min-width: 0;
  }
  .canvas-help {
    left: 12px;
    transform: none;
    bottom: 65px;
    font-size: 10px;
  }
  .zoom-control {
    right: 10px;
    bottom: 10px;
  }
}
.workspace {
  display: flex;
  height: auto;
  flex: 1;
  min-height: 0;
}
@media (max-width: 620px) {
  .workspace {
    height: auto;
    min-height: 470px;
    flex: 1;
  }
}
#canvas .node.selected {
  border-color: var(--diagram-accent);
}
#canvas .node.root.selected {
  border-color: var(--diagram-accent);
  box-shadow: 0 6px 19px color-mix(in srgb, var(--diagram-accent) 28%, transparent);
}
.canvas.mindmap-mode .connections path.coordinate-axis,
.canvas.fishbone-mode .connections path.coordinate-axis,
.canvas.flowchart-mode .connections path.coordinate-axis {
  stroke: #9aa4b2;
  stroke-opacity: 1;
  stroke-width: 1.5;
  stroke-linecap: butt;
}
.zoom-control .canvas-coordinate {
  min-width: 116px;
  padding: 0 9px;
  color: #69768a;
  font: 11px var(--app-font-family);
  white-space: nowrap;
  border-right: 1px solid #e8ecf3;
}
#themePalette[hidden],
#themePaletteStatus[hidden] {
  display: none !important;
}

/* 図のカード内テキスト編集に共通する操作・折り返し。 */
:is(.mindmap-mode .node, .category-node, .cause-node, .effect-node, .flow-node) textarea {
  display: block;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

/* ===== マインドマップ ===== */
.mindmap-mode .node {
  font-size: 15px;
  line-height: 1.4;
  width: calc(10em + 36px);
  min-width: 0;
  max-width: none;
  min-height: calc(2.8em + 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mindmap-mode .node textarea {
  width: 100%;
  min-height: 2.8em;
  font: inherit;
  line-height: 1.4;
  color: inherit;
  text-align: center;
}
#canvas.mindmap-mode .node:not(.mindmap-point) {
  border-width: 3px;
  padding: 10px 15px;
}
#canvas.mindmap-mode .node.selected:not(.mindmap-point) {
  border-width: 5px;
  padding: 8px 13px;
}
#canvas.mindmap-mode .node.root {
  width: 261px;
  background: #fff;
  border: 5px solid var(--diagram-accent);
  color: #273449;
  font-weight: 700;
  padding: 8px 13px;
}
#canvas.mindmap-mode .node.root.selected {
  border-width: 6px;
  padding: 7px 12px;
}
#canvas.mindmap-mode .node.mindmap-point {
  width: 14px;
  height: 14px;
  min-width: 14px;
  max-width: 14px;
  min-height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
#canvas.mindmap-mode .mindmap-point-dot {
  display: none;
}
#canvas.mindmap-mode .node.mindmap-point.unconnected .mindmap-point-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--diagram-accent);
}
.canvas.mindmap-mode .connections path {
  stroke: var(--diagram-accent);
  stroke-opacity: 1;
}
.canvas.mindmap-mode .connections path.mindmap-connection {
  stroke: var(--diagram-accent);
  stroke-width: 2.5;
  stroke-opacity: 1;
  fill: none;
}
.canvas.mindmap-mode .node,
.canvas.mindmap-mode .node:hover,
.canvas.mindmap-mode .node.selected {
  border-color: var(--diagram-accent);
}
#canvas.mindmap-mode .node.mindmap-point.selected .mindmap-point-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--diagram-accent);
  box-shadow:
    0 0 0 3px var(--diagram-accent),
    0 0 0 7px color-mix(in srgb, var(--diagram-accent) 24%, transparent);
}
#canvas .node.mindmap-point::before,
#canvas .node.flow-point::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
}

/* ===== フィッシュボーン ===== */
.category-node textarea,
.cause-node textarea,
.effect-node textarea {
  box-sizing: border-box;
  min-height: 22px;
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  cursor: text;
}
.effect-node textarea {
  width: 100%;
}
.category-node,
.cause-node {
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 6px 8px 9px;
  border: 1px solid #e4e8f0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 7px #24324a0b;
  display: flex;
  align-items: center;
  gap: 3px;
  text-align: left;
}
.category-node {
  max-width: 300px !important;
  cursor: default;
}
.cause-node {
  position: absolute;
  max-width: 320px !important;
}
.category-node:focus-within,
.cause-node:focus-within {
  border-color: #8190e8;
  box-shadow: 0 0 0 2px #5267e81a;
}
.category-node textarea,
.cause-node textarea {
  min-width: 0;
  flex: 1;
  text-align: left;
  font-weight: 700;
  color: #344154;
}
.category-node.selected,
.cause-node.selected {
  border-width: 1px;
  border-color: #5267e8;
  padding: 8px 6px 8px 9px;
  box-shadow: 0 0 0 2px #5267e81a;
  color: #344154;
}
.category-node:hover,
.cause-node:hover {
  border-color: #a9b6ef;
}
@media (max-width: 620px) {
  .category-node,
  .cause-node {
    max-width: 260px !important;
  }
}
#canvas .node.effect-node {
  box-sizing: border-box;
  left: auto;
  min-width: 236px;
  max-width: 380px !important;
  padding: 10px 13px;
  background: #fff;
  border: 3px solid var(--diagram-accent);
  color: #344154;
  font-weight: 700;
  box-shadow: none;
  cursor: default;
}
#canvas .node.effect-node textarea {
  min-height: 2.9em;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: inherit;
  font-weight: 700;
}
#canvas .connections path.spine,
#canvas .connections path.bone,
#canvas .connections path.twig {
  stroke: var(--diagram-accent);
  stroke-opacity: 1;
}
#canvas .category-node,
#canvas .cause-node {
  border-color: color-mix(in srgb, var(--diagram-accent) 32%, #e4e8f0);
}
#canvas .category-node.selected,
#canvas .cause-node.selected,
#canvas .category-node:hover,
#canvas .cause-node:hover {
  border-color: var(--diagram-accent);
}
.canvas.fishbone-mode .nodes {
  pointer-events: none;
}
.canvas.fishbone-mode .nodes > .fish-draggable {
  pointer-events: auto;
  isolation: isolate;
}
.canvas.fishbone-mode .fish-draggable::before {
  content: '';
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: inherit;
  cursor: grab;
  pointer-events: auto;
}
.canvas.fishbone-mode {
  cursor: default;
}
.canvas.fishbone-mode.panning {
  cursor: grabbing;
}
.canvas.fishbone-mode .connections path.spine {
  stroke-width: 12px;
  pointer-events: stroke;
  cursor: grab;
}
.canvas.fishbone-mode .connections path.bone {
  stroke-width: 9px;
}
.canvas.fishbone-mode .connections path.twig {
  stroke-width: 6px;
}
.canvas.fishbone-mode .connections path.twig-depth-2,
.canvas.fishbone-mode .connections path.twig-depth-3,
.canvas.fishbone-mode .connections path.twig-depth-4,
.canvas.fishbone-mode .connections path.twig-depth-5 {
  stroke-width: 3px;
}
.connections .spine-start-handle {
  fill: #fff;
  stroke: var(--diagram-accent);
  stroke-width: 3;
  cursor: ew-resize;
  pointer-events: all;
  touch-action: none;
}
.connections .spine-start-handle:hover,
.connections .spine-start-handle:focus {
  r: 12;
  outline: none;
}
#canvas.fishbone-mode .category-node:active,
#canvas.fishbone-mode .cause-node:active {
  cursor: grabbing;
}
#canvas.fishbone-mode .category-node.selected,
#canvas.fishbone-mode .cause-node.selected,
#canvas.fishbone-mode .effect-node.selected {
  border-width: 6px;
  padding: 0;
}
#canvas.fishbone-mode .category-node,
#canvas.fishbone-mode .cause-node {
  cursor: grab;
  width: 130px;
  min-width: 130px;
}

/* ===== フローチャート・矢印・スイムレーン ===== */
.connections path.flow-lane-divider {
  stroke: #d6deea;
  stroke-width: 1;
  stroke-opacity: 0.65;
  fill: none;
  pointer-events: none;
}

.flow-node {
  display: grid;
  place-items: center;
  min-width: 0;
  max-width: none;
  padding: 12px 18px;
  border: 2px solid var(--diagram-accent);
  background: #fff;
  color: #273449;
  cursor: default;
  box-shadow: 0 4px 13px rgba(40, 57, 85, 0.09);
}
.flow-node.selected {
  border-color: var(--diagram-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--diagram-accent) 28%, transparent);
}
.diagram-world {
  display: contents;
}
.flow-background {
  display: none;
}
.canvas.flowchart-mode .diagram-world {
  display: block;
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}
.canvas.flowchart-mode .connections {
  pointer-events: none;
  z-index: 2;
}
.canvas.flowchart-mode .flow-background {
  display: block;
  z-index: 0;
}
.canvas.flowchart-mode .nodes {
  pointer-events: none;
}
.canvas.flowchart-mode .flow-node {
  pointer-events: auto;
}
.flow-port {
  position: absolute;
  z-index: 4;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid var(--diagram-accent);
  border-radius: 50%;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}
.flow-port:hover {
  transform: scale(1.25);
  background: var(--diagram-accent);
}
.flow-port-top {
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
}
.flow-port-right {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
}
.flow-port-bottom {
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
}
.flow-port-left {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
}
.flow-port-top:hover,
.flow-port-bottom:hover {
  transform: translateX(-50%) scale(1.25);
}
.flow-port-left:hover,
.flow-port-right:hover {
  transform: translateY(-50%) scale(1.25);
}
.flow-node .flow-label {
  position: absolute;
  inset: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.flow-node textarea {
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 1.4em;
  max-height: 100%;
  color: inherit;
  font: 500 15px/1.4 var(--app-font-family);
  text-align: center;
  pointer-events: auto;
}
.flow-node.flow-process {
  border-radius: 10px;
}
.flow-node.flow-terminator {
  border-radius: 999px;
}
.flow-node.flow-decision,
.flow-node.flow-input {
  border: 0;
  background: transparent;
  overflow: visible;
  padding: 0;
}
.flow-drag-handle {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #dce3ef;
  border-radius: 7px;
  background: #fff;
  color: #73819a;
  font: 600 14px/1 var(--app-font-family);
  cursor: grab;
  touch-action: none;
}
.flow-drag-handle:hover {
  border-color: var(--diagram-accent);
  color: var(--diagram-accent);
  background: #fff;
}
.flow-drag-handle:active {
  cursor: grabbing;
}
.flow-node.flow-decision .flow-drag-handle {
  top: 8px;
  right: 18px;
}
.flow-node.flow-input .flow-drag-handle {
  top: 8px;
  right: 16px;
}
.connections marker path {
  fill: context-stroke;
  stroke: context-stroke;
}
.connections path.flow-connector-hit {
  stroke: transparent;
  stroke-width: 20;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}
.flow-edge-label {
  position: absolute;
  z-index: 6;
  width: 104px;
  min-height: 24px;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: #fff;
  color: #435064;
  font: var(--app-font-caption);
  text-align: center;
  white-space: nowrap;
  cursor: text;
}
.flow-edge-label input {
  box-sizing: border-box;
  width: 100%;
  height: 24px;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #273449;
  font: inherit;
  text-align: center;
  outline: none;
}
.flow-edge-label input::placeholder {
  color: #a5afbd;
}
.flow-edge-label input:focus {
  border: 0;
  box-shadow: none;
}
.connections path.flow-connector {
  stroke: var(--diagram-accent);
  stroke-width: 5px;
  stroke-opacity: 1;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}
.connections path.flow-connector.selected {
  stroke-width: 6px;
}
.connections path.flow-draft {
  pointer-events: none;
  stroke-dasharray: 7 5;
  opacity: 0.85;
}
.flow-endpoint {
  position: absolute;
  z-index: 5;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2.5px solid var(--diagram-accent);
  border-radius: 50%;
  background: #fff;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}
.flow-endpoint:hover {
  transform: scale(1.2);
  cursor: grabbing;
}
.flow-empty {
  position: absolute;
  left: 50%;
  top: 42%;
  width: max-content;
  max-width: 90vw;
  transform: translate(-50%, -50%);
  color: #8994a8;
  font-size: 14px;
  pointer-events: none;
}
.flow-node.flow-decision.selected,
.flow-node.flow-input.selected {
  box-shadow: none;
}
.flow-node.flow-point {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.flow-node.flow-point:hover,
.flow-node.flow-point.selected {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.flow-point-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--diagram-accent);
  box-shadow: 0 0 0 1.5px var(--diagram-accent);
  pointer-events: none;
}
.flow-node.flow-point .flow-port-top {
  top: 6px;
}
.flow-node.flow-point .flow-port-right {
  right: 6px;
}
.flow-node.flow-point .flow-port-bottom {
  bottom: 6px;
}
.flow-node.flow-point .flow-port-left {
  left: 6px;
}
.flow-node.flow-point .flow-point-dot {
  display: none;
}
.flow-node.flow-point .flow-drag-handle {
  display: grid;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
}
.flow-node.flow-point.unconnected .flow-point-dot {
  display: block;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--diagram-accent);
  box-shadow: none;
}
.flow-node.flow-point.selected .flow-point-dot {
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--diagram-accent);
  box-shadow:
    0 0 0 3px var(--diagram-accent),
    0 0 0 7px color-mix(in srgb, var(--diagram-accent) 24%, transparent);
}
.canvas.flowchart-mode .flow-node.flow-swimlane {
  border-width: 0.5px;
  border-radius: 0;
  background-color: transparent !important;
  padding: 0;
  display: block;
  pointer-events: none;
  z-index: 0;
  box-shadow: none;
}
.flow-swimlane .flow-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 50px;
  padding: 7px 40px;
  border-bottom: 0.5px solid var(--diagram-accent);
  background: #fff;
  pointer-events: auto;
}
.flow-swimlane-horizontal .flow-label {
  left: 0;
  top: 0;
  width: 150px;
  height: 100%;
  padding: 7px;
  border-bottom: 0;
  border-right: 0.5px solid var(--diagram-accent);
  writing-mode: horizontal-tb;
}
.flow-swimlane .flow-drag-handle {
  pointer-events: auto;
}
.canvas.flowchart-mode .flow-node.flow-swimlane:not(.flow-swimlane-horizontal) {
  z-index: 1;
}
.canvas.flowchart-mode .flow-node.flow-swimlane.selected {
  z-index: 1 !important;
}
.canvas.flowchart-mode .flow-node:not(.flow-swimlane) {
  z-index: 3;
}
.canvas.flowchart-mode .flow-node.selected {
  z-index: 10 !important;
}
.flow-lane-resize {
  position: absolute;
  z-index: 4;
  right: -7px;
  bottom: -7px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid var(--diagram-accent);
  border-radius: 3px;
  background: white;
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
}
.flow-lane-resize-top-right {
  top: -7px;
  bottom: auto;
  cursor: nesw-resize;
}
.flow-lane-resize-top-left {
  top: -7px;
  right: auto;
  bottom: auto;
  left: -7px;
  cursor: nwse-resize;
}
.flow-lane-resize-bottom-left {
  right: auto;
  left: -7px;
  cursor: nesw-resize;
}

/* ===== タイムテーブル・週／月のタイムライン ===== */
#timetableExportName {
  box-sizing: border-box;
  width: calc(10em + 26px);
  flex: none;
  padding: 9px 12px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
  color: #435064;
  font: var(--app-font-control);
}
#timetableExportName[hidden] {
  display: none !important;
}
#timetableWeekView[aria-pressed='true'],
#timetableMonthView[aria-pressed='true'] {
  border-color: #0d9488;
  background: #e2f3f1;
  color: #0d9488;
}
#timetableTools[hidden] {
  display: none;
}
#timetableTools label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #647187;
}
#timetableTools input {
  width: 52px;
  padding: 7px 4px;
  border: 1px solid #e1e6ef;
  border-radius: 6px;
  font: inherit;
}
.timetable-label {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f9fc;
  border: 0;
  border-radius: 4px;
  color: #435064;
  font-size: 13px;
  white-space: normal;
}
.timetable-label input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  color: inherit;
  outline: none;
}
.timetable-mode .node.timetable-card {
  min-width: 0;
  max-width: none;
  padding: 20px 5px 18px;
  border: 1px solid var(--diagram-accent);
  border-radius: 7px;
  background: #fff;
  cursor: default;
  font-size: 14px;
  overflow: visible;
}
.timetable-card textarea {
  width: 100%;
  height: 30px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  color: inherit;
}
.timetable-drag {
  position: absolute;
  top: 0;
  right: 1px;
  border: 0;
  background: transparent;
  color: #8994a8;
  cursor: grab;
  font-size: 17px;
  touch-action: none;
}
.timetable-duration {
  position: absolute;
  bottom: 1px;
  left: 2px;
  border: 0;
  background: transparent;
  color: #647187;
  font-size: 10px;
  cursor: pointer;
}
#timetableTools #timetableDate {
  width: auto;
  min-width: 0;
  border-radius: 6px;
}
.timetable-count {
  font-size: 11px;
  color: #647187;
}
.timetable-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px !important;
}
.timetable-date-icon {
  font-size: 14px;
  line-height: 1;
  color: #435064;
}
.timetable-resize {
  position: absolute;
  top: 16px;
  bottom: 16px;
  width: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
  z-index: 3;
}
.timetable-resize:hover {
  background: var(--diagram-accent);
}
.timetable-resize-start {
  left: -4px;
}
.timetable-resize-end {
  right: -4px;
}
#timetableTools {
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
#timetableFilters {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}
.timetable-filter-label {
  flex: none;
  font-size: 12px;
  color: #647187;
  white-space: nowrap;
}
#timetableStartDateFilter[hidden] {
  display: none;
}
#timetableFilters #timetableStartDateFilterInput {
  width: 105px;
  padding-left: 8px;
  padding-right: 22px;
  cursor: pointer;
}
#timetableStartDateFilterInput::placeholder {
  color: #a3a3a3;
  opacity: 1;
}
#timetableFilters[hidden] {
  display: none;
}
.canvas.timetable-mode {
  position: relative;
  inset: auto;
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: auto;
  cursor: default;
  background: #fff;
  background-image: none;
  border: 0;
  border-radius: 0;
  overscroll-behavior: contain;
}
.canvas-shell:has(.timetable-mode) {
  display: flex;
  flex-direction: column;
  background: #fff;
}
.canvas-shell:has(.timetable-mode) .zoom-control,
.canvas-shell:has(.timetable-mode) .canvas-help {
  display: none;
}
.timetable-mode .nodes {
  position: relative;
  inset: auto;
  min-width: 100%;
  min-height: 100%;
  z-index: 1;
}
.timetable-mode .connections {
  display: none;
}
.tt-table-header {
  position: sticky;
  top: 0;
  height: 41.6px;
  background: #e2e8f0;
  border-bottom: 1px solid #dfe5ef;
  z-index: 10;
}
.tt-day-section {
  position: relative;
  margin-bottom: 6px;
}
.tt-month-section {
  position: relative;
}
.tt-current-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #e0f2f1;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.tt-table-row.tt-month-row {
  background-image: repeating-linear-gradient(
    to right,
    #e1e6ef 0 2px,
    transparent 2px var(--tt-hour-width)
  );
}
.tt-day-section.tt-move-drop-target {
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
}
.tt-table-row {
  position: relative;
  border-bottom: 1px solid #e1e6ef;
  background-image:
    repeating-linear-gradient(
      to right,
      #e2e8f0 0 3px,
      transparent 3px calc(var(--tt-hour-width) * 6)
    ),
    repeating-linear-gradient(to right, #e1e6ef 0 2px, transparent 2px var(--tt-hour-width)),
    repeating-linear-gradient(
      to right,
      #edf0f5 0 1px,
      transparent 1px calc(var(--tt-hour-width) / 4)
    );
  background-position: var(--tt-name-width) 0;
}
.timetable-mode .tt-table-header .tt-corner {
  position: sticky;
  left: 0;
  top: 0;
}
.timetable-mode .connections path.timetable-grid {
  stroke: #e1e6ef;
  stroke-width: 1;
}
.timetable-mode .connections path.timetable-grid-minor {
  stroke: #edf0f5;
  stroke-dasharray: 3 4;
}
.tt-header-background {
  position: absolute;
  left: 0;
  top: 0;
  height: 41.6px;
  background: #f7f9fc;
  border-bottom: 1px solid #dfe5ef;
  z-index: 10;
  pointer-events: none;
}
.timetable-mode .timetable-label {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #647187;
  font: 500 12px/1.5 var(--app-font-family);
}
.timetable-mode .tt-corner {
  z-index: 14;
  background: #e2e8f0;
  border-right: 1px solid #dfe5ef;
  border-bottom: 1px solid #dfe5ef;
  font-size: 18px;
  font-weight: 700;
  color: #344154;
}
.timetable-mode .tt-weekday-saturday {
  color: #2563eb;
}
.timetable-mode .tt-weekday-sunday {
  color: #dc2626;
}
.timetable-mode .tt-hour-label {
  z-index: 11;
}
.timetable-mode .tt-day-section .tt-hour-label {
  font-size: 13px;
}
.timetable-mode .tt-month-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 13px;
  line-height: 16px;
}
.timetable-mode .tt-next-month-date {
  background: #edf1f6;
}
.timetable-mode .tt-month-corner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  font-size: 16px;
}
.tt-month-sort-trigger > span:first-child {
  display: none;
}
.timetable-mode .tt-month-sort-trigger {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fff;
  color: #435064;
  font: 500 12px/18px var(--app-font-family);
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  justify-content: center;
  padding: 4px;
  font-size: 18px;
}
.tt-month-sort-trigger[aria-expanded='true'] {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
}
.tt-month-sort-menu button:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
  background: var(--ui-accent-soft);
}
.tt-month-sort-menu {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: calc(100vw - 16px);
  text-align: left;
}
.tt-sort-button {
  position: absolute;
  right: 6px;
  bottom: 3px;
  padding: 1px 5px;
  border: 1px solid #dfe5ef;
  border-radius: 4px;
  background: #fff;
  color: #647187;
  font: 500 10px/16px var(--app-font-family);
  cursor: pointer;
}
.timetable-mode .tt-column-resize {
  position: absolute;
  right: 0;
  top: 0;
  width: 3px;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #9ca3af;
  cursor: col-resize;
  touch-action: none;
  z-index: 20;
}
.timetable-mode .tt-column-resize:hover,
.timetable-mode .tt-column-resize:focus-visible {
  background: #0d9488;
  outline: none;
}
.tt-sort-button:hover {
  background: #edf0f5;
  color: #344154;
}
.timetable-mode .tt-row-name {
  z-index: 8;
  justify-content: flex-start;
  padding: 16px;
  border-right: 1px solid #dfe5ef;
  border-bottom: 1px solid #e1e6ef;
  background: #fff;
  color: #344154;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.timetable-mode .tt-add-row {
  padding: 6px 12px;
}
.timetable-mode .tt-row-name:hover {
  background: #f7f9fc;
}
.tt-table-row.tt-reorder-target {
  box-shadow:
    inset 0 3px var(--diagram-accent),
    inset 0 -3px var(--diagram-accent);
}
.timetable-mode .tt-row-name .tt-name-input {
  width: 100%;
  min-width: 0;
  padding: 7px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: text;
  user-select: text;
  outline: none;
  box-shadow: none;
  appearance: none;
}
.timetable-mode .tt-row-name .tt-name-input:focus {
  border: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
}
.timetable-mode .tt-empty {
  justify-content: flex-start;
  font-size: 13px;
}
.timetable-mode .tt-table-row .tt-row-name {
  position: sticky;
  left: 0;
  top: auto !important;
  padding-top: 6px;
  padding-bottom: 6px;
}
.tt-card-location {
  flex: 0 0 auto;
  min-width: 0;
  display: block;
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
  color: #647187;
  pointer-events: none;
}
.tt-card-location:empty,
.timetable-mode .tt-short-event .timetable-duration,
.timetable-mode .tt-short-event .tt-card-location {
  display: none;
}
.timetable-quick-dates {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.timetable-quick-dates button {
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
  color: #435064;
  font: var(--app-font-caption);
  cursor: pointer;
}
#timetableTools button.active {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}
#timetablePrevious,
#timetableNext,
.timetable-quick-dates button {
  min-width: 32px;
  padding: 8px !important;
}

/* 週・月のカレンダー列と表示切り替え。 */
.timetable-mode .tt-calendar-column-corner {
  padding-left: 56px;
}
.tt-calendar-column-toggle {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 9px 13px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
  color: #435064;
  font: var(--app-font-control);
  cursor: pointer;
}
.tt-calendar-column-toggle:hover {
  background: #f3f5ff;
}
.tt-calendar-column-toggle[aria-pressed='true'] {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}
.tt-row-calendar {
  position: sticky;
  left: 0;
  z-index: 9;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-right: 1px solid #dfe5ef;
  border-bottom: 1px solid #e1e6ef;
  background: #fff;
  color: #344154;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ===== タイムテーブル・一覧表示 ===== */
.tt-event-list {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1200px;
  font-size: 13px;
  color: #344154;
  background: #fff;
}
.tt-event-list td:first-child {
  min-width: 220px;
}
.tt-event-list td:last-child {
  min-width: 260px;
}
.tt-event-list td:nth-child(2),
.tt-event-list td:nth-child(4) {
  white-space: nowrap;
  min-width: 90px;
}
.tt-event-list tbody tr {
  cursor: pointer;
}
.tt-event-list tbody tr:focus-visible {
  outline: 2px solid #079b8e;
  outline-offset: -2px;
}
.tt-event-list .tt-event-list-empty {
  text-align: center;
  padding: 32px;
  color: #647187;
}
.tt-event-list .tt-list-text-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 80px;
  height: 36px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
  font: inherit;
  color: inherit;
}
.tt-list-picker {
  display: flex;
  align-items: center;
  min-width: 140px;
}
.tt-list-picker > input {
  border-radius: 6px 0 0 6px !important;
}
.tt-list-picker > button {
  height: 36px;
  flex: none;
  border: 1px solid #dfe5ef;
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #fff;
  color: #647187;
  cursor: pointer;
}
.tt-event-list .tt-list-invalid-dates td:nth-child(n + 2):nth-child(-n + 5) {
  box-shadow: inset 0 -2px #dc2626;
}
.tt-event-list th,
.tt-event-list td {
  border-right: 1px solid #e1e6ef;
  border-bottom: 1px solid #e1e6ef;
  text-align: left;
  padding: 0 7px;
  vertical-align: middle;
  height: 30px;
  border-color: #e6e9ed;
}
.tt-event-list th {
  position: sticky;
  top: 0;
  z-index: 15;
  font-weight: 700;
  white-space: nowrap;
  height: 32px;
  background: #f5f6f7;
  color: #344154;
  border-bottom: 1px solid #b8c2cc;
}
.tt-event-list td {
  overflow-wrap: anywhere;
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
}
.tt-event-list td:nth-child(7),
.tt-event-list td:nth-child(9) {
  max-width: 280px;
  text-overflow: ellipsis;
}
.tt-event-list .tt-list-text-input,
.tt-event-list .schedule-time-input,
.tt-event-list .schedule-date-trigger {
  height: 29px;
  min-height: 0;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  color: inherit;
  text-align: left;
  outline: none;
}
.tt-event-list .schedule-time-input {
  width: 100%;
  min-width: 54px;
  text-align: right;
}
.tt-event-list .schedule-date-trigger {
  width: 100%;
  text-align: right;
  white-space: nowrap;
}
.tt-event-list .tt-list-picker {
  min-width: 130px;
  gap: 0;
}
.tt-event-list .tt-list-picker > input {
  border-radius: 0 !important;
}
.tt-event-list .tt-list-picker > button {
  height: 26px;
  width: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  visibility: hidden;
}
.tt-event-list td:hover .tt-list-picker > button,
.tt-event-list td:focus-within .tt-list-picker > button {
  visibility: visible;
}
.tt-event-list tbody tr:hover {
  background: #fafcfc;
}
.tt-event-list tbody tr.selected {
  background: #f3faf8;
  box-shadow: none;
}
.tt-event-list td:focus-within {
  box-shadow: inset 0 0 0 2px #079b8e;
}
.tt-event-list tbody tr[data-id],
.tt-event-list tbody tr[data-id]:hover,
.tt-event-list tbody tr[data-id].selected {
  background: color-mix(in srgb, var(--event-accent) 10%, white);
}
.tt-event-list .tt-list-text-input:focus,
.tt-event-list .schedule-time-input:focus,
.tt-event-list .schedule-date-trigger:focus-visible {
  outline: 2px solid #079b8e;
  outline-offset: -2px;
  background: transparent;
}
.tt-list-sort {
  margin-left: 6px;
  padding: 2px 4px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #647187;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.tt-list-sort:hover,
.tt-list-sort:focus-visible {
  background: #e2e8f0;
  color: #079b8e;
}
.tt-event-list th[aria-sort='ascending'] .tt-list-sort,
.tt-event-list th[aria-sort='descending'] .tt-list-sort {
  color: #079b8e;
}
.tt-event-list th:nth-child(3),
.tt-event-list td:nth-child(3),
.tt-event-list th:nth-child(5),
.tt-event-list td:nth-child(5) {
  min-width: 72px;
}
#timetableTimeEditor.tt-list-editor > :not(#timetableCalendarColorPicker):not(#deleteNode) {
  display: none !important;
}

/* ===== 予定編集・日付／時刻／候補の選択 ===== */
#timetableTimeEditor #timetableCalendarColor {
  box-sizing: border-box;
  flex: 0 0 48px;
  width: 48px;
  height: var(--toolbar-control-height);
  padding: 5px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
#timetableCalendarColorMenu:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 224px;
  padding: 12px;
}
#timetableCalendarColorMenu .theme-swatch,
#timetableCalendarColorMenu .theme-swatch:hover {
  min-width: 0 !important;
  width: 100%;
  height: 18px;
  padding: 0 !important;
  background: var(--swatch-color);
  border: 2px solid #fff;
  border-radius: 7px;
}
#timetableTools #timetableDate,
#timetableTimeEditor input[type='datetime-local'] {
  height: 36px;
  font: var(--app-font-field);
  padding: 7px 4px;
  box-sizing: border-box;
}
#timetableTimeEditor input[type='datetime-local'] {
  width: 156px;
  min-width: 156px;
}
.timetable-event-dialog::backdrop {
  background: #17202d55;
}
.timetable-event-dialog h2 {
  margin: 0 0 18px;
  font-size: 19px;
}
.timetable-event-dialog form,
.timetable-event-dialog label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timetable-event-dialog form {
  gap: 14px;
}
.timetable-event-dialog label {
  font-size: 13px;
}
.timetable-event-dialog input,
.timetable-event-dialog select,
.timetable-event-dialog textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  padding: 9px;
  font: inherit;
  color: inherit;
  background: #fff;
}
.event-date-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.event-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.event-actions button {
  padding: 9px 16px;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #fff;
  color: #435064;
  cursor: pointer;
}
.event-actions button[type='submit'] {
  background: var(--ui-accent, #0d9488);
  border-color: var(--ui-accent, #0d9488);
  color: #fff;
}
.event-error {
  min-height: 18px;
  margin: 0;
  color: #c2413d;
  font-size: 12px;
}
@media (max-width: 620px) {
  .event-date-fields {
    grid-template-columns: 1fr;
  }
}
#timetableTimeEditor {
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  min-width: 0;
}
.tt-month-section .tt-schedule-card .tt-card-title,
.tt-month-section .tt-schedule-card .timetable-duration,
.tt-month-section .tt-schedule-card .tt-card-location {
  display: none !important;
}
.tt-add-event-button {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px dashed #aab7c8;
  border-radius: 6px;
  background: #fff;
  color: #52677b;
  text-align: left;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.tt-add-event-input {
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  padding: 7px 10px;
  border: 1px dashed #aab7c8;
  border-radius: 6px;
  background: #fff;
  color: #344154;
  font: 500 14px/20px var(--app-font-family);
  outline: none;
}
.tt-add-event-input::placeholder {
  color: #52677b;
  opacity: 1;
}
.tt-add-event-input:focus {
  border-style: solid;
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-accent) 12%, transparent);
}
.tt-add-event-button:hover,
.tt-add-event-button:focus-visible {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 7%, white);
  color: var(--ui-accent);
  outline: none;
}
.tt-copy-drop-target .tt-add-event-button {
  border-style: solid;
  border-color: var(--ui-accent);
  color: var(--ui-accent);
}
.tt-copy-drop-active .tt-add-event-button {
  border-style: solid;
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 12%, white);
  color: var(--ui-accent);
}
.timetable-mode .node.tt-schedule-card.selected {
  box-shadow: 0 0 0 2px var(--diagram-accent);
  font-weight: 500;
}
.timetable-mode .node.tt-schedule-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 2;
  border: 1px solid color-mix(in srgb, var(--diagram-accent) 35%, white);
  border-left: 4px solid var(--diagram-accent);
  border-radius: 14px 14px 14px 5px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--diagram-accent) 10%, white);
  text-align: left;
  cursor: grab;
  box-shadow: 0 3px 10px #0f172a12;
  touch-action: none;
  color: #344154;
  transition: none;
  padding-top: 5px;
  padding-bottom: 5px;
}
.timetable-mode .tt-schedule-card .tt-card-title {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 22px;
  min-height: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  font: 600 13px/20px var(--app-font-family);
  color: #344154;
  white-space: nowrap;
  resize: none;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.tt-schedule-card .timetable-duration {
  position: static;
  flex: 0 0 auto;
  min-width: 0;
  display: block;
  padding: 0;
  margin: 0;
  font: 500 13px/16px var(--app-font-family);
  color: #647187;
  white-space: nowrap;
}
.tt-schedule-card.tt-dragging {
  z-index: 7;
  cursor: grabbing;
  opacity: 0.85;
}
.tt-schedule-card .timetable-resize {
  top: 8px;
  bottom: 8px;
  width: 9px;
}
.tt-schedule-card .timetable-resize-start {
  left: -4px;
}
.tt-schedule-card .timetable-resize-end {
  right: -4px;
}
.timetable-event-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #dfe5ef;
  padding: 24px;
  color: #344154;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 70px #17202d30;
}
.timetable-event-dialog .event-edit-picker {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.timetable-event-dialog .event-edit-picker > input {
  flex: 1;
  width: 1%;
  min-width: 0;
  border-radius: 7px 0 0 7px;
}
.timetable-event-dialog .event-edit-picker-toggle {
  flex: 0 0 42px;
  padding: 0;
  border: 1px solid #dfe5ef;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #fff;
  color: #435064;
  font: 18px/1 var(--app-font-family);
  cursor: pointer;
}
.timetable-event-dialog .event-edit-picker-toggle:hover,
.timetable-event-dialog .event-edit-picker-toggle[aria-expanded='true'] {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}
.timetable-event-dialog .event-edit-picker-menu {
  max-height: 220px;
  overflow: auto;
}
#timetableTimeEditor input {
  border: 1px solid #e1e6ef;
  border-radius: 6px;
  background: #fff;
}
#timetableTimeEditor #timetableEditorTitle {
  box-sizing: border-box;
  flex: 0 0 146px;
  width: 146px;
  height: var(--toolbar-control-height);
  padding: 7px 9px;
  color: #435064;
  font: var(--app-font-field);
}
#timetableTimeEditor[hidden] {
  display: none;
}
.timetable-calendar-picker {
  flex: none;
  position: relative;
  width: 144px;
}
#timetableTimeEditor #timetableCalendarSelect,
#timetableTimeEditor #timetableLocationSelect {
  box-sizing: border-box;
  width: 144px;
  min-width: 0;
  height: var(--toolbar-control-height);
  padding: 7px 28px 7px 9px;
  border: 1px solid #e1e6ef;
  border-radius: 6px;
  background: #fff;
  font: var(--app-font-field);
  color: #435064;
}
#timetableTimeEditor #timetableCalendarToggle,
#timetableTimeEditor #timetableLocationToggle {
  border-left: 1px solid #e1e6ef;
  border-radius: 0 5px 5px 0;
  background-image: none;
  color: #435064;
}
#timetableTimeEditor #timetableCalendarToggle > span[aria-hidden='true'],
#timetableTimeEditor #timetableLocationToggle > span[aria-hidden='true'] {
  display: block;
  font-size: 18px;
  line-height: 1;
}
#timetableCalendarMenu {
  min-width: 120px;
}
.schedule-datetime-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.schedule-date-trigger,
.schedule-date-popup button {
  padding: 7px 9px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fff;
  color: #435064;
  font: 14px/20px var(--app-font-family);
  cursor: pointer;
}
#timetableTimeEditor .schedule-time-input,
.timetable-event-dialog .schedule-time-input {
  width: 66px;
  min-width: 66px;
  height: 36px;
  padding: 7px 4px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fff;
  font: 14px/20px var(--app-font-family);
  text-align: center;
}
.schedule-date-popup {
  width: 320px;
  padding: 16px;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  color: #344154;
}
.schedule-date-popup::backdrop {
  background: #17202d44;
}
.schedule-date-dropdown {
  position: fixed;
  z-index: 10000;
  margin: 0;
  background: #fff;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
  box-shadow: 0 8px 24px #24324a24;
}
.schedule-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.schedule-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 12px;
  text-align: center;
}
.schedule-calendar-grid button {
  padding: 7px 0;
}
.schedule-calendar-grid .selected {
  background: var(--diagram-accent, #5267e8);
  color: #fff;
}
.schedule-date-popup > button {
  margin-right: 8px;
}
.calendar-name-combo {
  position: relative;
  display: block;
  width: 100%;
}
.calendar-name-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  box-shadow: 0 5px 16px #17202d22;
}
.calendar-name-options[hidden] {
  display: none;
}
.calendar-name-options button {
  flex: none;
  padding: 8px;
  border: 0;
  background: #fff;
  color: #435064;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.calendar-name-options button:hover,
.calendar-name-options button:focus {
  background: #eef2f8;
  outline: none;
}
.schedule-time-popup {
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 85vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  color: #344154;
}
.schedule-datetime-field.time-expanded {
  position: relative;
}
.schedule-time-accordion {
  position: fixed;
  right: auto;
  z-index: 10000;
  margin: 0;
  background: #fff;
  max-height: calc(100dvh - 16px);
  overflow: auto;
  white-space: normal;
  box-shadow: 0 8px 24px #24324a24;
}
#timetableTimeEditor .schedule-time-accordion input {
  width: 90px;
}
.schedule-time-popup h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.schedule-time-popup h4 {
  margin: 14px 0 6px;
  font-size: 13px;
}
.schedule-time-popup input {
  width: 90px;
  padding: 8px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  font-size: 16px;
}
.schedule-time-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.schedule-time-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.schedule-time-column {
  min-width: 0;
}
.schedule-time-column + .schedule-time-column {
  border-left: 1px solid #cbd5e1;
  padding-left: 16px;
}
.schedule-time-column .schedule-time-grid {
  grid-template-columns: 1fr;
  max-height: 364px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  align-content: start;
}
.schedule-time-column .schedule-time-grid button {
  background: transparent;
}
.schedule-time-input.time-invalid {
  border-color: #dc2626 !important;
  outline: 1px solid #dc2626;
  box-shadow: 0 0 0 2px #dc262620;
}
.schedule-time-columns button.selected {
  background: var(--ui-accent, #079b8e);
  color: #fff;
}
.schedule-time-popup button {
  padding: 7px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}
.schedule-time-grid .selected {
  background: var(--diagram-accent, #5267e8);
  color: #fff;
}
.schedule-time-popup > button {
  margin-right: 8px;
}
.schedule-time-popup p {
  font-size: 12px;
  color: #b91c1c;
}

/* ===== 複数カードの選択表示 ===== */
.node.multi-selected,
.cause-node.multi-selected {
  outline: 3px solid var(--diagram-accent, #5267e8);
  outline-offset: 3px;
}
.outline-card.multi-selected {
  outline: 2px solid var(--outline-accent, #5267e8);
  outline-offset: -2px;
  background: #eef0ff;
}

/* ===== 共通テーマ・操作状態の配色 ===== */
button,
input,
select,
textarea {
  accent-color: var(--ui-accent);
}
.topbar #diagramType {
  border-color: var(--ui-accent) !important;
}
.topbar .sidebar-toggle {
  color: var(--ui-accent);
}
.topbar .arrange-trigger,
.topbar select {
  border-color: var(--ui-accent);
}
.topbar button:hover,
.arrange-menu button:hover,
.arrange-menu button[aria-current='true'],
.calendar-name-options button:hover,
.calendar-name-options button:focus {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}
button[type='submit'],
.schedule-date-popup > button:nth-last-child(2),
.schedule-time-popup > button:nth-last-child(2) {
  background: var(--ui-accent);
  border: 1px solid var(--ui-accent);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}
.schedule-calendar-grid .selected,
.schedule-time-grid .selected {
  background: var(--ui-accent);
  color: #fff;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}
.timetable-mode .tt-schedule-card .tt-card-title,
.timetable-mode .tt-schedule-card .tt-card-title:focus,
.timetable-mode .tt-schedule-card .tt-card-title:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
}
