/* ========================================
   ガンガンガントチャート - Style
   ======================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e0e3e8;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --primary: #e84057;
  --primary-hover: #d63050;
  --header-h: 80px;
  --label-w: 160px;
  --cell-w: 100px;
  --cell-h-small: 28px;
  --cell-h-medium: 52px;
  --cell-h-large: 100px;
  --row-h: 110px;
  --category-row-h: 40px;
  --chart-header-h: 72px;
  --font-family: 'Helvetica Neue', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

/* ========== Overlay / Dialog ========== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.setup-dialog, .export-dialog {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px;
  width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.setup-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 4px;
}

.setup-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.setup-section {
  margin-bottom: 20px;
}

.setup-section > label, .setup-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.setup-section input[type="text"],
.setup-section input[type="number"],
.setup-section select,
.setup-field input,
.setup-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-family);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.setup-section input:focus, .setup-field input:focus,
.setup-section select:focus, .setup-field select:focus {
  outline: none;
  border-color: var(--primary);
}

.setup-row {
  display: flex; gap: 12px;
  margin-bottom: 12px;
}

.setup-field {
  flex: 1;
}

.setup-actions, .export-actions {
  display: flex; gap: 12px;
  margin-top: 24px;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-secondary {
  flex: 1;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background: #f0f0f0; }

.btn-small {
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-family);
  cursor: pointer;
}

.btn-small:hover { background: #f0f0f0; }

/* ========== Header Toolbar ========== */
#main-toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.toolbar-row {
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  height: 40px;
  overflow: visible;
}

.toolbar-row-2 {
  height: 36px;
  border-top: 1px solid #f0f0f0;
}

.zoom-label {
  font-size: 12px;
  min-width: 40px;
  text-align: center;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 12px;
}

.toolbar-spacer { flex: 1; }

.app-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.project-name-input {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: var(--font-family);
  background: transparent;
  max-width: 240px;
  transition: border-color 0.2s, background 0.2s;
}

.project-name-input:hover {
  border-color: var(--border);
  background: #f8f8f8;
}

.project-name-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.autosave-status {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 4px;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.autosave-status.saved {
  color: #16a34a;
}

/* Marquee selection rectangle */
.marquee-rect {
  position: absolute;
  border: 2px dashed var(--primary);
  background: rgba(232, 64, 87, 0.08);
  pointer-events: none;
  z-index: 9999;
}

/* Marquee mode cursor */
.marquee-mode {
  cursor: crosshair !important;
}
.marquee-mode * {
  cursor: crosshair !important;
}

/* Marquee button active state */
.tool-btn.marquee-active {
  background: var(--primary) !important;
  color: #fff !important;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-separator {
  width: 1px;
  height: 26px;
  background: var(--border);
  margin: 0 6px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-family: var(--font-family);
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
}

.tool-btn:hover {
  background: #f0f0f0;
  border-color: var(--border);
}

.tool-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.format-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
}

.tool-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

#main-toolbar select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-family);
  background: var(--surface);
}

#font-color {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}

/* Color Palette */
.color-preview-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  vertical-align: middle;
  margin-right: 3px;
}

.color-palette-popup {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2000;
  width: 240px;
}

.color-palette {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
  transition: transform 0.1s;
}

.color-swatch:hover {
  transform: scale(1.3);
  z-index: 1;
}

.color-swatch.selected {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* ========== Canvas Area ========== */
#canvas-wrapper {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  background: var(--bg);
}

#canvas-container {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  /* zoom is applied via JS */
}

/* ========== Chart Header ========== */
#chart-header {
  position: sticky;
  top: 0;
  z-index: 400;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}

.header-row {
  display: flex;
}

.header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-right: 1px solid var(--border);
  padding: 6px;
  white-space: nowrap;
  background: var(--surface);
}

.header-cell.month-cell {
  background: #1a1a2e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.header-cell.sub-cell {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  height: 32px;
}

.header-cell.sunday { background: #fff5f5; }
.header-cell.saturday { background: #f0f4ff; }
.header-cell.holiday { background: #fef3c7; }

/* ========== Chart Body ========== */
#chart-body {
  position: relative;
  min-height: calc(100vh - var(--header-h) - var(--chart-header-h));
}

.chart-row {
  display: flex;
  position: relative;
  border-bottom: 1px solid #e0e0e0;
  min-height: var(--row-h);
}

.chart-row.category-row {
  background: #f0f0f0;
  min-height: var(--category-row-h);
}

/* Label cell (sticky left column) */
.label-cell {
  position: sticky;
  left: 0;
  z-index: 300;
  width: var(--label-w);
  min-width: var(--label-w);
  background: #666;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  border-right: 2px solid #555;
  cursor: text;
}

.label-cell input,
.label-cell .label-edit {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  padding: 2px 4px;
  outline: none;
}

.label-cell input::placeholder {
  color: rgba(255,255,255,0.5);
}

.label-cell .label-edit:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,0.5);
}

.label-cell input:focus,
.label-cell .label-edit:focus {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.label-edit {
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.4em;
  line-height: 1.4;
  cursor: text;
}

.category-row .label-cell {
  background: #555;
  font-size: 15px;
  font-weight: 700;
}

/* Header label spacer */
.header-label-spacer {
  position: sticky;
  left: 0;
  z-index: 401;
  width: var(--label-w);
  min-width: var(--label-w);
  background: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  border-right: 2px solid #555;
}

.chart-cell {
  width: var(--cell-w);
  min-width: var(--cell-w);
  border-right: 1px solid #f0f0f0;
  position: relative;
}

.chart-cell.week-border { border-right: 1px solid var(--border); }
.chart-cell.month-border { border-right: 2px solid #ccc; }
.chart-cell.sunday { background: rgba(255,200,200,0.15); }
.chart-cell.saturday { background: rgba(200,210,255,0.15); }
.chart-cell.holiday { background: rgba(254,243,199,0.2); }
.chart-cell.alt-month { background: rgba(0,0,0,0.02); }

/* Drag creation overlay */
.drag-create-preview {
  position: absolute;
  background: rgba(59, 130, 246, 0.2);
  border: 2px dashed #3b82f6;
  border-radius: 6px;
  pointer-events: none;
  z-index: 250;
}

/* ========== Timeline ========== */
.timeline-day-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  padding: 0 10px;
  min-width: 70px;
  border-right: 1px solid var(--border);
}

.timeline-day-label .day-num { font-weight: 600; }
.timeline-day-label .day-name { font-size: 12px; color: var(--text-muted); }

.timeline-row { display: flex; min-height: var(--row-h); border-bottom: 1px solid #f0f0f0; }
.timeline-row.weekend-row { background: #fff5f5; }
.timeline-row.holiday-row { background: #fef9e7; }

.timeline-party-cell {
  flex: 1;
  border-right: 1px solid #f0f0f0;
  position: relative;
  min-height: var(--row-h);
  padding: 4px;
}

.timeline-party-cell:last-child { border-right: none; }

.timeline-month-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  padding: 10px;
  background: #1a1a2e;
  color: #fff;
}

.timeline-party-header {
  display: flex;
  background: #f0f0f0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  z-index: 300;
}

.timeline-party-header-cell {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
}

.timeline-party-header-cell:last-child { border-right: none; }

/* ========== Task Objects ========== */
.task-object {
  position: absolute;
  border-radius: 6px;
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 14px;
  z-index: 200;
  user-select: none;
  white-space: nowrap;
  overflow: visible;
  min-width: 30px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: box-shadow 0.15s;
}

.task-object:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.task-object.selected {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  z-index: 300;
}

.task-object.dragging {
  opacity: 0.8;
  z-index: 900;
  cursor: grabbing;
}

.task-object .task-text {
  flex: 1;
  min-width: 0;
  outline: none;
  overflow: visible;
  white-space: normal;
  word-break: break-all;
  line-height: 1.3;
}

.task-object .task-text.text-overflow {
  text-shadow: 0 1px 3px rgba(255,255,255,0.9), 0 0 6px rgba(255,255,255,0.7);
}

.task-object[style*="useDark"] .task-text.text-overflow,
.task-object .task-text.text-overflow-dark {
  text-shadow: 0 1px 3px rgba(0,0,0,0.6), 0 0 6px rgba(0,0,0,0.4);
}

/* 4-directional resize handles */
.resize-handle-right {
  position: absolute; right: -3px; top: 0; bottom: 0; width: 6px;
  cursor: ew-resize; z-index: 10;
}
.resize-handle-left {
  position: absolute; left: -3px; top: 0; bottom: 0; width: 6px;
  cursor: ew-resize; z-index: 10;
}
.resize-handle-top {
  position: absolute; top: -3px; left: 0; right: 0; height: 6px;
  cursor: ns-resize; z-index: 10;
}
.resize-handle-bottom {
  position: absolute; bottom: -3px; left: 0; right: 0; height: 6px;
  cursor: ns-resize; z-index: 10;
}

.task-object.size-small { height: var(--cell-h-small); }
.task-object.size-medium { height: var(--cell-h-medium); }
.task-object.size-large { height: var(--cell-h-large); }

/* Milestone */
.milestone-object {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: rotate(45deg);
  cursor: grab;
  z-index: 200;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s;
}

.milestone-object { box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.milestone-object:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.milestone-object.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.milestone-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  font-size: 12px;
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
}

/* Comment Bubble */
.comment-bubble {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  max-width: 200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 250;
  cursor: grab;
  user-select: none;
}

.comment-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 16px;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #fff;
}

.comment-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 15px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--border);
}

.comment-bubble.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.comment-text {
  outline: none;
  min-width: 30px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========== Arrow SVG ========== */
.arrow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
}

.arrow-svg line, .arrow-svg path {
  pointer-events: stroke;
  cursor: pointer;
}

.arrow-line {
  stroke: #6b7280;
  stroke-width: 2;
  fill: none;
  marker-end: url(#arrowhead);
}

.arrow-line:hover {
  stroke: var(--primary);
  stroke-width: 3;
}

.arrow-line.selected {
  stroke: var(--primary);
  stroke-width: 3;
}

/* ========== Context Menu ========== */
.context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 10000;
  min-width: 170px;
  padding: 4px 0;
}

.ctx-item {
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.ctx-item:hover {
  background: #f0f0f0;
}

.ctx-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ========== Utilities ========== */
.hidden { display: none !important; }

/* Scrollbars */
#canvas-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
#canvas-wrapper::-webkit-scrollbar-track {
  background: #f0f0f0;
}
#canvas-wrapper::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 5px;
}
#canvas-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Resize handle hover indicators */
.task-object:hover .resize-handle-right,
.task-object:hover .resize-handle-left,
.task-object.selected .resize-handle-right,
.task-object.selected .resize-handle-left {
  background: rgba(232,64,87,0.2);
}
.task-object:hover .resize-handle-top,
.task-object:hover .resize-handle-bottom,
.task-object.selected .resize-handle-top,
.task-object.selected .resize-handle-bottom {
  background: rgba(232,64,87,0.2);
}

/* ========== Arrow Edge Handles ========== */
.arrow-edge-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  cursor: crosshair;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.task-object:hover .arrow-edge-handle,
.task-object.selected .arrow-edge-handle,
.milestone-object:hover .arrow-edge-handle,
.milestone-object.selected .arrow-edge-handle {
  opacity: 1;
}

.arrow-edge-left {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.arrow-edge-right {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.arrow-edge-top {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.arrow-edge-bottom {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.arrow-edge-milestone {
  right: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

/* ========== Setup Checkboxes ========== */
.setup-view-checks {
  display: flex;
  gap: 16px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.setup-view-config {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.config-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* ========== Export Dialog ========== */
.export-dialog h2 {
  margin-bottom: 20px;
  font-size: 20px;
}

/* ========== Column Width Resize Handle ========== */
.col-resize-handle {
  position: absolute;
  right: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 450;
  background: transparent;
}

.col-resize-handle:hover {
  background: rgba(232,64,87,0.3);
}

/* Row height resize handle */
.row-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 6px;
  cursor: row-resize;
  z-index: 310;
  background: transparent;
}

.row-resize-handle:hover {
  background: rgba(232,64,87,0.3);
}

/* Add column button */
.add-col-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  z-index: 450;
  transition: all 0.15s;
}

.add-col-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Label cell add row button */
.label-add-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.label-cell:hover .label-add-btn,
.label-cell:hover .label-del-btn { opacity: 1; }
.label-add-btn:hover {
  background: rgba(255,255,255,0.4);
  color: #fff;
}

/* Label cell delete row button */
.label-del-btn {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.label-del-btn:hover {
  background: rgba(220,38,38,0.6);
  color: #fff;
}

/* Chart bottom add row */
.chart-add-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.add-row-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px dashed var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}

.add-row-btn:hover {
  background: #f0f0f0;
  color: var(--text);
  border-color: var(--text-muted);
}

/* Drop zone */
.drop-zone {
  margin-top: 16px;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  transition: all 0.2s;
}

.drop-zone.drop-active {
  border-color: var(--primary);
  background: rgba(232,64,87,0.05);
  color: var(--primary);
}

/* Setup footer */
.setup-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.setup-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.setup-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-sep {
  margin: 0 6px;
  color: var(--border);
}

/* ========== App Footer (work screen) ========== */
.app-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 500;
  padding: 4px 12px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.85);
  border-top-left-radius: 6px;
  backdrop-filter: blur(4px);
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.app-footer .footer-sep {
  margin: 0 4px;
  color: var(--border);
}

.version-link {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 10px;
  opacity: 0.7;
}
.version-link:hover { opacity: 1; }

/* ========== Tutorial / Guide Tour ========== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9990;
  cursor: pointer;
  transition: opacity 0.2s;
}

.tutorial-spotlight {
  position: fixed;
  z-index: 9991;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-tooltip {
  position: fixed;
  z-index: 9992;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  animation: tutorialFadeIn 0.3s ease;
  box-sizing: border-box;
}

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

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tutorial-step-count {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.tutorial-skip {
  background: none;
  border: none;
  font-size: 18px;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.tutorial-skip:hover {
  background: #f3f4f6;
  color: #374151;
}

.tutorial-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.tutorial-text {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
  margin: 0 0 18px;
  white-space: pre-line;
}

.tutorial-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tutorial-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.tutorial-btn:hover {
  background: #f9fafb;
}

.tutorial-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

/* Help button (re-show tutorial) */
.btn-help {
  font-size: 16px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}
