/* ========================================
   minikanna - Style Sheet
   Taskcle Brand Colors
   ======================================== */

:root {
  --primary: #00A26A;
  --primary-dark: #008556;
  --accent: #EB4113;
  --background: #FFFFFF;
  --surface: #FAF9F7;
  --text: #111111;
  --text-secondary: #666666;
  --border: #E5E5E5;
  --success: #00A26A;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --primary: #00C77B;
  --primary-dark: #00A26A;
  --background: #1A1A1A;
  --surface: #252525;
  --text: #F5F5F5;
  --text-secondary: #A0A0A0;
  --border: #333333;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .status-badge.active {
  background: #1E3A2F;
  color: #4ADE80;
}

[data-theme="dark"] .status-badge.completed {
  background: #1E3A5F;
  color: #60A5FA;
}

[data-theme="dark"] .status-badge.archived {
  background: #2A2A2A;
  color: #9CA3AF;
}

[data-theme="dark"] .promo-section {
  background: linear-gradient(135deg, #2D1B0E 0%, #3D2415 100%);
  border-color: #7C3A1C;
}

[data-theme="dark"] .project-card-meta .deadline-info.overdue {
  background: #450A0A;
  color: #F87171;
}

[data-theme="dark"] .project-card-meta .deadline-info.due-today,
[data-theme="dark"] .project-card-meta .deadline-info.due-soon {
  background: #451A03;
  color: #FBBF24;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background-color: var(--surface);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-icon {
  flex-shrink: 0;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

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

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
}

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

.fab {
  position: fixed;
  bottom: calc(120px + env(safe-area-inset-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  z-index: 50;
  font-size: 1.5rem;
}

.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 162, 106, 0.3);
}

/* ========================================
   Views
   ======================================== */
main {
  flex: 1;
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}

.view {
  display: none;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.view-header h2 {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 600;
}

.view-actions {
  display: flex;
  gap: 8px;
}

/* ========================================
   Search Bar
   ======================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.search-bar i {
  color: var(--text-secondary);
  font-size: 1rem;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

/* ========================================
   Dropdown Menu
   ======================================== */
.dropdown-menu {
  position: fixed;
  background: var(--background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 160px;
  z-index: 150;
  display: none;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--surface);
}

.dropdown-item.active {
  color: var(--primary);
  font-weight: 500;
}

.dropdown-item.active::before {
  content: '✓';
  margin-right: 4px;
}

/* ========================================
   Color Picker
   ======================================== */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.color-option[data-color=""] {
  background: var(--surface);
  border-color: var(--border);
}

.color-option[data-color="red"] { background: #EF4444; }
.color-option[data-color="orange"] { background: #F97316; }
.color-option[data-color="yellow"] { background: #EAB308; }
.color-option[data-color="green"] { background: #22C55E; }
.color-option[data-color="blue"] { background: #3B82F6; }
.color-option[data-color="purple"] { background: #8B5CF6; }

.color-option.selected {
  border-color: var(--text);
  transform: scale(1.1);
}

.color-option:hover {
  transform: scale(1.1);
}

/* Project card color indicator */
.project-card[data-color="red"] { border-left: 4px solid #EF4444; }
.project-card[data-color="orange"] { border-left: 4px solid #F97316; }
.project-card[data-color="yellow"] { border-left: 4px solid #EAB308; }
.project-card[data-color="green"] { border-left: 4px solid #22C55E; }
.project-card[data-color="blue"] { border-left: 4px solid #3B82F6; }
.project-card[data-color="purple"] { border-left: 4px solid #8B5CF6; }

/* ========================================
   Filter Tabs
   ======================================== */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  padding: 6px 14px;
  font-size: 0.875rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.filter-tab:not(.active):hover {
  background: var(--surface);
}

/* ========================================
   Project List
   ======================================== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.project-card-meta .date-range {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-card-meta .deadline-info {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.project-card-meta .deadline-info.overdue {
  background: #FEE2E2;
  color: var(--danger);
}

.project-card-meta .deadline-info.due-today {
  background: #FEF3C7;
  color: #B45309;
}

.project-card-meta .deadline-info.due-soon {
  background: #FEF3C7;
  color: #B45309;
}

.project-card.overdue {
  border-left: 3px solid var(--danger);
}

.project-card.due-today,
.project-card.due-soon {
  border-left: 3px solid var(--warning);
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 12px;
  background: var(--surface);
}

.status-badge.active {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-badge.completed {
  background: #E3F2FD;
  color: #1565C0;
}

.status-badge.archived {
  background: #F5F5F5;
  color: #757575;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9375rem;
}

/* ========================================
   Project Detail
   ======================================== */
.project-info {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}

.project-info p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.project-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ========================================
   Task Board
   ======================================== */
.task-section {
  margin-top: 20px;
}

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

.task-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

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

.view-switcher {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px;
}

.view-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.view-switch-btn.active {
  background: var(--background);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.view-switch-btn:hover:not(.active) {
  color: var(--text);
}

.task-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.task-column {
  flex: 1;
  min-width: 200px;
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.task-column h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.task-column[data-status="todo"] h4 {
  border-color: var(--text-secondary);
}

.task-column[data-status="in_progress"] h4 {
  border-color: var(--warning);
}

.task-column[data-status="done"] h4 {
  border-color: var(--success);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.task-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: transform var(--transition);
  border-left: 3px solid transparent;
}

.task-card:hover {
  transform: translateX(2px);
}

.task-card.priority-high {
  border-left-color: var(--danger);
}

.task-card.priority-medium {
  border-left-color: var(--warning);
}

.task-card.priority-low {
  border-left-color: var(--border);
}

.task-card h5 {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.task-card .task-due {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.task-card .task-due.overdue {
  color: var(--danger);
}

.task-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-repeat-icon {
  font-size: 0.75rem;
  color: var(--primary);
}

/* Task List View */
.task-board:not(.task-view-active) {
  display: none;
}

.task-list-view {
  display: none;
}

.task-list-view.task-view-active {
  display: block;
}

.task-list-view .task-group {
  background: var(--background);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.task-list-view .task-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.875rem;
}

.task-list-view .task-group-header .badge {
  background: var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.task-list-view .task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.task-list-view .task-item:last-child {
  border-bottom: none;
}

.task-list-view .task-item:hover {
  background: var(--surface);
}

/* ========================================
   My Tasks
   ======================================== */
.toggle-switch {
  display: flex;
  background: var(--surface);
  border-radius: 20px;
  padding: 4px;
}

.toggle-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  background: transparent;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
}

.my-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-group {
  background: var(--background);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.875rem;
}

.task-group-header .badge {
  background: var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

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

.task-item:hover {
  background: var(--surface);
}

.task-item .task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.task-item.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.task-item .task-content {
  flex: 1;
  min-width: 0;
}

.task-item .task-title {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.task-item .task-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.task-item .task-project {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}

.task-item .priority-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-item .priority-indicator.high {
  background: var(--danger);
}

.task-item .priority-indicator.medium {
  background: var(--warning);
}

.task-item .priority-indicator.low {
  background: var(--border);
}

/* ========================================
   Settings
   ======================================== */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.settings-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.settings-section .btn {
  width: 100%;
  margin-bottom: 12px;
}

.settings-section .btn:last-child {
  margin-bottom: 0;
}

.settings-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.feature-list {
  list-style: none;
  margin-bottom: 20px;
}

.feature-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 600;
}

.promo-section {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid #FDBA74;
}

.promo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.promo-badge {
  background: var(--accent);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.promo-section h3 {
  margin-bottom: 0;
}

/* Info Section */
.info-section {
  background: var(--surface);
}

.info-notice {
  display: flex;
  gap: 12px;
}

.info-notice > i {
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-notice p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.info-notice p:first-child {
  color: var(--text);
  margin-bottom: 4px;
}

.info-notice ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-notice ul li {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.info-notice ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
}

.promo-lead {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 16px;
}

/* PWA Install Section */
.pwa-section {
  background: linear-gradient(135deg, #F0F4FF 0%, #E8EEFF 100%);
  border: 1px solid #C7D2FE;
}

[data-theme="dark"] .pwa-section {
  background: linear-gradient(135deg, #1E2A4A 0%, #252D4A 100%);
  border-color: #3B4A6B;
}

.pwa-section h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.pwa-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.pwa-status {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 12px;
  margin-bottom: 0;
}

.pwa-status.installed {
  color: #2E7D32;
}

[data-theme="dark"] .pwa-status.installed {
  color: #4ADE80;
}

.btn-pwa {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  background: #4F6AF5;
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-pwa:hover {
  background: #3D56D9;
}

.btn-pwa:disabled {
  background: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.btn-pwa i {
  margin-right: 8px;
}

.install-instructions {
  margin-top: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.6;
}

[data-theme="dark"] .install-instructions {
  background: rgba(0, 0, 0, 0.2);
}

.install-instructions ol {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.install-instructions li {
  margin-bottom: 4px;
}

.install-guide-card {
  margin-top: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(79, 106, 245, 0.2);
  border-radius: var(--radius);
}

[data-theme="dark"] .install-guide-card {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(199, 210, 254, 0.35);
}

.install-guide-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.install-guide-card ol {
  margin: 0;
  padding-left: 20px;
}

.install-guide-card li {
  font-size: 0.8125rem;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.install-help-note {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ========================================
   Settings Toggle Switch
   ======================================== */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-label span:first-child {
  font-weight: 500;
}

.setting-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 28px;
  transition: var(--transition);
}

.slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.625rem;
  cursor: pointer;
  transition: color var(--transition);
}

.nav-tab i {
  font-size: 1.25rem;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab:not(.active):hover {
  color: var(--text);
}

/* ========================================
   Promo Banner
   ======================================== */
.promo-banner {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 90;
}

.promo-banner.hidden {
  display: none;
}

.promo-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.promo-icon {
  font-size: 1.125rem;
}

.promo-banner p {
  font-size: 0.8125rem;
  margin: 0;
}

.promo-link {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.promo-link:hover {
  opacity: 0.9;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  line-height: 1;
}

.close-btn:hover {
  opacity: 1;
}

/* ========================================
   Modal
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--background);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

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

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

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

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

/* ========================================
   Forms
   ======================================== */
form {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions-right {
  display: flex;
  gap: 12px;
}

/* Safe Modal Actions - 誤操作防止レイアウト */
.modal-actions-safe {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.btn-block {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 10px;
  cursor: pointer;
  transition: color var(--transition);
}

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

.delete-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-delete-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 8px 0;
  cursor: pointer;
  transition: color var(--transition);
}

.btn-delete-link:hover {
  color: var(--danger);
}

/* ========================================
   Upgrade Modal
   ======================================== */
.upgrade-content {
  padding: 20px;
  text-align: center;
}

.upgrade-content p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.upgrade-content p:first-child {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.upgrade-content .feature-list {
  text-align: left;
  margin: 20px 0;
}

.upgrade-content .btn {
  width: 100%;
  margin-bottom: 12px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 600px) {
  .task-board {
    flex-direction: column;
  }

  .task-column {
    min-width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions-right {
    flex-direction: column;
    width: 100%;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .search-bar {
    margin-bottom: 12px;
  }

  .view-header {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .view {
    padding: 24px 40px;
  }

  .project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .fab {
    bottom: calc(130px + env(safe-area-inset-bottom));
    right: 40px;
  }
}

/* ========================================
   Drag & Drop (タスク移動時)
   ======================================== */
.task-card.dragging {
  opacity: 0.5;
}

.task-list.drag-over {
  background: rgba(0, 162, 106, 0.1);
  border-radius: var(--radius);
}

/* ========================================
   Utilities
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
