* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; }

.onboarding {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #6F8F2A 0%, #5C7A1C 100%);
}
.onboarding .card {
  background: #FFFDF7;
  border-radius: 12px;
  padding: 3rem 2rem;
  max-width: 32rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(28,33,20,.3);
}
.onboarding h1 { margin: 0 0 .5rem; font-size: 2rem; color: #1a202c; }
.subtitle { margin: 0 0 1.5rem; font-size: 1.125rem; color: #4a5568; }
.description { margin: 0 0 2rem; color: #718096; line-height: 1.6; }
.primary-button, .btn-primary {
  background: linear-gradient(135deg, #6F8F2A, #5C7A1C); color: #fff; border: none;
  padding: .875rem 2rem; font-size: 1rem; font-weight: 600;
  border-radius: 8px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(92,122,28,.3);
  transition: all 0.2s;
}
.primary-button:hover, .btn-primary:hover {
  background: linear-gradient(135deg, #5C7A1C, #4A6317);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(92,122,28,.4);
}

.dashboard { min-height: 100vh; background: linear-gradient(135deg, #c9d7b2 0%, #EDE5DB 50%, #F0E6D8 100%); display: flex; flex-direction: column; }
.dashboard-header {
  background: linear-gradient(135deg, #6F8F2A 0%, #5C7A1C 100%);
  border-bottom: 1px solid #5A6150;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 6px rgba(92,122,28,.2);
}
.header-content {
  max-width: 96rem; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.dashboard-header h1 {
  margin: 0; font-size: 1.5rem; font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.header-actions { display: flex; gap: 1rem; align-items: center; }
.btn-add-task {
  padding: .625rem 1.5rem; color: #1C2114; border: none; border-radius: 8px;
  font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #F4FBE3, #E8F5D0);
  box-shadow: 0 3px 8px rgba(111,143,42,.4);
  transition: all 0.2s;
  border: 2px solid #6F8F2A;
}
.btn-add-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(111,143,42,.5);
  background: linear-gradient(135deg, #E8F5D0, #D9EDC0);
}
.profile-bar { display: flex; align-items: center; gap: .75rem; position: relative; }
.dark-mode-toggle, .current-profile {
  padding: .5rem .75rem;
  background: rgba(255,255,255,.95);
  border: 2px solid rgba(255,255,255,.5);
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
  color: #ffffff;
  font-weight: 600;
}
.dark-mode-toggle:hover, .current-profile:hover {
  background: rgba(255,255,255,1);
  box-shadow: 0 2px 8px rgba(255,255,255,.3);
  transform: translateY(-1px);
}
.current-profile { display: flex; align-items: center; gap: .5rem; }
.profile-name { font-weight: 600; color: #1C2114; }
.profile-menu {
  position: absolute; top: calc(100% + .5rem); left: 0;
  background: #FFFDF7; border: 1px solid #D9D3C2; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(28,33,20,.12); min-width: 16rem; z-index: 20;
}
.menu-header {
  padding: .75rem 1rem; font-size: .85rem; font-weight: 600;
  color: #5A6150; text-transform: uppercase; border-bottom: 1px solid #D9D3C2;
}
.profile-item { display: flex; align-items: center; padding: .25rem .5rem; }
.profile-item.active { background: #f5f5f5; }
.profile-select {
  flex: 1; background: none; border: none; text-align: left;
  padding: .5rem; cursor: pointer; border-radius: 4px;
}
.new-profile-btn {
  width: 100%; padding: .75rem 1rem; background: none; border: none;
  border-top: 1px solid #e5e5e5; color: #5C7A1C; font-weight: 600; cursor: pointer; text-align: left;
}

.dashboard-main {
  max-width: 96rem; margin: 0 auto; padding: 1.5rem 1.5rem 0 1.5rem; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.left-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.right-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.task-panel {
  background: transparent;
  border: none;
  padding: 0;
}
.bottom-section {
  max-width: 96rem; margin: 0 auto; padding: 1.5rem; width: 100%;
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
.graph-card, .settings-panel, .io-panel, .glossary-panel {
  background: #FFFDF7; border: 2px solid #6F8F2A; border-radius: 12px; padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(92,122,28,.15);
}
.graph-card h3, .settings-panel h3, .io-panel h3, .glossary-panel h3 {
  color: #1C2114;
}
.settings-panel {
  background: linear-gradient(135deg, #F4FBE3 0%, #FFFDF7 100%);
  border-color: #6F8F2A;
}
.io-panel {
  background: linear-gradient(135deg, #E8F5D0 0%, #FFFDF7 100%);
  border-color: #6F8F2A;
}
.glossary-panel {
  background: linear-gradient(135deg, #FFFDF7 0%, #F3F0E6 100%);
  border-color: #D9D3C2;
}
.graph-card { min-height: 360px; }
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.chart-header h3 {
  margin: 0;
}
.chart-axes-selector {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .85rem;
}
.axis-select-inline {
  padding: .375rem .5rem;
  border: 1px solid #6F8F2A;
  border-radius: 6px;
  background: #F4FBE3;
  color: #1C2114;
  font-weight: 500;
  font-size: .85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.axis-select-inline:hover {
  border-color: #5C7A1C;
  background: #E8F5D0;
}
.axis-select-inline:focus {
  outline: none;
  border-color: #5C7A1C;
  box-shadow: 0 0 0 3px rgba(111,143,42,.1);
}
.axis-vs {
  color: #1C2114;
  font-weight: 600;
  font-size: .85rem;
}
.graph-wrap {
  position: relative;
  width: 100%;
  height: 320px;
}
.graph-card canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.legend { display: flex; gap: 1rem; margin-top: .75rem; font-size: .85rem; color: #4a5568; }
.lg::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; }
.lg.high::before { background: rgb(92,122,28); }
.lg.med::before { background: rgb(184,149,106); }
.lg.low::before { background: rgb(154,90,70); }

.settings-panel h3, .io-panel h3, .task-list h3 { margin: 0 0 1rem; }
.setting-group {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.setting-group .setting-label {
  min-width: 240px;
  margin-bottom: 0;
  white-space: nowrap;
}
.setting-group input[type="range"] {
  flex: 1;
}
.setting-group:has(.axis-selectors) {
  flex-direction: column;
  align-items: flex-start;
}
.setting-group:has(.axis-selectors) .setting-label {
  margin-bottom: 0.5rem;
}

.presets-bar-container {
  background: linear-gradient(135deg, #FFFDF7 0%, #F4FBE3 100%);
  border-bottom: 2px solid #6F8F2A;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 4px rgba(92,122,28,.1);
  position: sticky;
  top: 73px;
  z-index: 40;
}
.presets-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 96rem;
  margin: 0 auto;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(111,143,42,0.3);
}
.current-factors-container {
  max-width: 96rem;
  margin: 0 auto;
  padding-top: 0.75rem;
}
.current-factors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
}
.current-factors {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.875rem;
  flex: 1;
}
.factor-label {
  color: #5C7A1C;
  font-weight: 500;
}
.factor-label strong {
  color: #5C7A1C;
  font-weight: 700;
}
.preset-indicator {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  background: #F4FBE3;
  border-radius: 12px;
  font-weight: 600;
  color: #1C2114;
}
.preset-indicator.custom-values {
  background: #F3F0E6;
  color: #5A6150;
}
.expand-toggle {
  background: none;
  border: 2px solid #6F8F2A;
  color: #1C2114;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.2s;
  flex-shrink: 0;
}
.expand-toggle:hover {
  background: #E8F5D0;
  border-color: #6F8F2A;
}
.ranking-controls {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(111,143,42,0.05);
  border-radius: 8px;
  border: 1px solid rgba(111,143,42,0.2);
}
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.control-label {
  color: #5C7A1C;
  font-weight: 600;
  font-size: 0.875rem;
}
.control-label span {
  color: #5C7A1C;
  font-weight: 700;
}
.preset-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #6F8F2A;
  background: #FFFDF7;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 0.875rem;
}
.preset-btn-builtin {
  border-color: #6F8F2A;
  color: #1C2114;
}
.preset-btn-builtin:hover {
  background: #F4FBE3;
  border-color: #5C7A1C;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(92,122,28,.2);
}
.preset-btn-builtin.active {
  background: linear-gradient(135deg, #6F8F2A 0%, #5C7A1C 100%);
  color: #fff;
  border-color: #5C7A1C;
}
.preset-btn-custom {
  border-color: #D9D3C2;
  color: #1C2114;
  background: #F3F0E6;
}
.preset-btn-custom:hover {
  background: #E8F5D0;
  border-color: #6F8F2A;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(111,143,42,.2);
}
.preset-btn-custom.active {
  background: linear-gradient(135deg, #5A6150 0%, #1C2114 100%);
  color: #F4FBE3;
  border-color: #1C2114;
}
.preset-save {
  border-color: #6F8F2A;
  color: #1C2114;
}
.preset-save:hover {
  background: #E8F5D0;
  border-color: #5C7A1C;
}
.preset-manage {
  border-color: #D9D3C2;
  color: #5A6150;
}
.preset-manage:hover {
  background: #F3F0E6;
  border-color: #5A6150;
}
.preset-dropdown-container {
  position: relative;
}
.preset-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: #fff;
  border: 2px solid #8FB85C;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(139,92,246,.2);
  min-width: 250px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}
.preset-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #D9D3C2;
  transition: background 0.2s;
}
.preset-dropdown-item:last-child {
  border-bottom: none;
}
.preset-dropdown-item:hover {
  background: #f5f3ff;
}
.preset-dropdown-item.active {
  background: #E8F5D0;
  border-left: 3px solid #6F8F2A;
}
.preset-dropdown-name {
  font-weight: 600;
  color: #5C7A1C;
  margin-bottom: 0.25rem;
}
.preset-dropdown-desc {
  font-size: 0.8rem;
  color: #6b7280;
}

.presets-manager-card {
  max-width: 800px;
  max-height: 90vh;
}
.presets-manager-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.presets-section h3 {
  color: #5C7A1C;
  margin: 0;
  font-size: 1.1rem;
}
.pin-count {
  font-size: 0.875rem;
  color: #5C7A1C;
  font-weight: 600;
  background: #E8F5D0;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}
.presets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.preset-card {
  display: flex;
  gap: 0.75rem;
  background: #FFFDF7;
  border: 2px solid #D9D3C2;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s;
}
.preset-card.pinned {
  border-color: #6F8F2A;
  background: linear-gradient(135deg, #F4FBE3 0%, #FFFDF7 100%);
}
.preset-card-builtin.pinned {
  border-color: #6F8F2A;
  background: linear-gradient(135deg, #F4FBE3 0%, #FFFDF7 100%);
}
.preset-card-custom.pinned {
  border-color: #D9D3C2;
  background: linear-gradient(135deg, #F3F0E6 0%, #FFFDF7 100%);
}
.preset-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.preset-card.drag-over {
  border-color: #5C7A1C;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(92,122,28,.2);
}
.drag-handle {
  cursor: grab;
  color: #6F8F2A;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  padding: 0 0.25rem;
  user-select: none;
}
.drag-handle:active {
  cursor: grabbing;
}
.preset-card-content {
  flex: 1;
  min-width: 0;
}
.preset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.preset-card-title {
  font-weight: 700;
  color: #5C7A1C;
  font-size: 1rem;
}
.built-in-badge {
  font-size: 0.7rem;
  background: #E8F5D0;
  color: #5C7A1C;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}
.custom-badge {
  font-size: 0.7rem;
  background: #F3F0E6;
  color: #5A6150;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}
.preset-card-actions {
  display: flex;
  gap: 0.25rem;
}
.preset-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.preset-action-btn:hover {
  background: #f5f3ff;
}
.preset-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.preset-action-btn.danger:hover {
  background: #fee;
}
.preset-action-btn.pinned {
  filter: hue-rotate(90deg) saturate(2);
}
.preset-action-btn.unpinned {
  filter: grayscale(100%) opacity(0.5);
}
.preset-action-btn.unpinned:hover {
  filter: grayscale(0%) opacity(1);
}
.preset-card-desc {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.preset-card-factors {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #5C7A1C;
  font-weight: 600;
  flex-wrap: wrap;
}
.preset-card-factors span {
  background: #E8F5D0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.empty-message {
  text-align: center;
  color: #9ca3af;
  padding: 2rem;
  font-style: italic;
}
.setting-label { display: block; font-weight: 600; margin-bottom: .5rem; color: #5C7A1C; }
.axis-selectors {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}
.axis-select {
  flex: 1;
  min-width: 140px;
  padding: .5rem;
  border: 2px solid #8FB85C;
  border-radius: 6px;
  background: #fff;
  color: #5C7A1C;
  font-weight: 600;
  cursor: pointer;
}
.axis-label {
  color: #5C7A1C;
  font-weight: 600;
  font-size: .9rem;
}

.glossary-panel h3 {
  margin: 0 0 1rem 0;
}
.glossary-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 0.75rem;
  background: rgba(111,143,42,0.1);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}
.glossary-section-header:hover {
  background: rgba(111,143,42,0.2);
}
.glossary-section-header h4 {
  margin: 0;
  font-size: 0.95rem;
}
.section-toggle {
  background: none;
  border: none;
  color: #5C7A1C;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-weight: bold;
}
.glossary-content {
  max-height: none;
  overflow-y: visible;
  padding-right: 0.5rem;
}
.glossary-content::-webkit-scrollbar {
  width: 8px;
}
.glossary-content::-webkit-scrollbar-track {
  background: rgba(167,139,250,0.1);
  border-radius: 4px;
}
.glossary-content::-webkit-scrollbar-thumb {
  background: #8FB85C;
  border-radius: 4px;
}
.glossary-content::-webkit-scrollbar-thumb:hover {
  background: #6F8F2A;
}
.glossary-section {
  margin-bottom: 0.75rem;
}
.glossary-section:last-child {
  margin-bottom: 0;
}
.glossary-scale {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.scale-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.5);
  border-radius: 6px;
  border-left: 3px solid #8FB85C;
}
.scale-num {
  font-weight: 700;
  color: #5C7A1C;
  min-width: 1.5rem;
  text-align: center;
  font-size: 1rem;
}
.scale-desc {
  color: #4a5568;
  font-size: 0.875rem;
  line-height: 1.5;
}
.radio-option {
  display: flex; align-items: center; gap: .5rem;
  padding: .625rem; border: 1px solid #d4d4d4; border-radius: 6px;
  margin-bottom: .5rem; cursor: pointer; background: #fff;
}
.setting-hint { font-size: .85rem; color: #718096; margin-top: 0; }
input[type=range] { width: 100%; accent-color: #6F8F2A; height: 6px; }
.formula-preview {
  padding: 1rem; border-radius: 8px;
  background: #F4FBE3;
  border: 2px solid #D9D3C2;
}
.formula-label { color: #5A6150; }
.formula { color: #1C2114; font-size: 1.05rem; }
.formula-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; color: #718096; }
.formula { font-family: "Courier New", monospace; font-weight: 600; color: #5C7A1C; margin-top: .35rem; }

.io-actions { display: flex; gap: .5rem; margin: .75rem 0; flex-wrap: wrap; }
.btn-secondary {
  padding: .5rem 1rem; border: 2px solid #6F8F2A;
  background: linear-gradient(135deg, #FFFDF7 0%, #F4FBE3 100%);
  border-radius: 8px; cursor: pointer; font-weight: 600; color: #1C2114;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: linear-gradient(135deg, #F4FBE3 0%, #E8F5D0 100%);
  border-color: #5C7A1C;
  box-shadow: 0 3px 8px rgba(92,122,28,.2);
  transform: translateY(-1px);
}
.dropzone {
  border: 2px dashed #D9D3C2; border-radius: 8px; padding: 1.5rem;
  text-align: center; color: #5A6150;
  background: #F3F0E6;
  margin-top: 1rem;
  transition: all 0.2s ease;
}
.dropzone:hover { border-color: #6F8F2A; background: #F4FBE3; color: #1C2114; }
.dropzone.dragging { border-color: #5C7A1C; background: #E8F5D0; color: #1C2114; }

.task-list {
  display: flex;
  flex-direction: column;
  background: #FFFDF7;
  border: 2px solid #6F8F2A;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(139,92,246,.15);
}
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.list-header h3 {
  color: #5C7A1C;
  margin: 0;
}
.header-controls { display: flex; gap: .5rem; align-items: center; }
.toggle-view-btn {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
  border: 1px solid #e9d5ff; border-radius: 6px; cursor: pointer; padding: .25rem .5rem;
  transition: all 0.2s;
}
.toggle-view-btn:hover {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}
.task-count { color: #718096; font-size: .9rem; }
.empty-state {
  text-align: center; color: #6b7280; padding: 2rem;
  background: linear-gradient(135deg, #fefefe 0%, #f8faff 100%);
  border-radius: 8px; border: 1px solid #e0e7ff;
  box-shadow: 0 2px 4px rgba(102,126,234,.06);
}
.task-item {
  display: flex; gap: .75rem;
  background: linear-gradient(135deg, #FFFDF7 0%, #F4FBE3 100%);
  border: 2px solid #D9D3C2;
  border-left-width: 5px; border-radius: 10px; padding: .75rem; margin-bottom: .75rem;
  box-shadow: 0 2px 4px rgba(92,122,28,.12);
  transition: box-shadow 0.2s, transform 0.2s;
}
.task-item:hover {
  box-shadow: 0 4px 12px rgba(92,122,28,.25);
  transform: translateY(-2px);
  border-color: #6F8F2A;
}
.task-rank {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0; border: 1px solid;
}
.task-content, .task-content-collapsed { flex: 1; min-width: 0; }
.task-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.task-title-with-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.task-title {
  margin: 0;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.status-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #5A6150;
  margin: 0;
}
.status-select {
  padding: 0.375rem 0.5rem;
  border: 2px solid #D9D3C2;
  border-radius: 6px;
  background: #FFFDF7;
  color: #1C2114;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.status-select:hover {
  border-color: #6F8F2A;
  background: #F4FBE3;
}
.status-select:focus {
  outline: none;
  border-color: #5C7A1C;
  box-shadow: 0 0 0 3px rgba(111,143,42,.1);
}
.task-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.badge { font-size: .75rem; background: #E8F5D0; border-radius: 999px; padding: .2rem .6rem; color: #1C2114; border: 1px solid #6F8F2A; font-weight: 600; }
.badge.urgent { background: #fed7d7; color: #c53030; }
.task-scores { display: flex; gap: 1rem; font-size: .85rem; color: #4a5568; margin: 0 0 .35rem 0; flex-wrap: wrap; }
.quick-adjust label { display: block; font-size: .8rem; color: #4a5568; margin-top: .35rem; }
.quick-adjust small { display: block; color: #718096; }
.task-notes { color: #718096; font-size: .9rem; margin: .5rem 0 0; }
.task-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.action-btn { background: none; border: none; cursor: pointer; border-radius: 4px; padding: .3rem .4rem; font-size: 1rem; transition: all 0.2s; }
.action-btn:hover { background: #f5f5f5; }
.action-btn.js-apply {
  color: #fff;
  background: #6F8F2A;
  font-weight: bold;
  animation: pulse 1.5s ease-in-out infinite;
}
.action-btn.js-apply:hover {
  background: #5C7A1C;
  transform: scale(1.05);
}
.action-btn.js-complete { color: #10b981; font-weight: bold; }
.action-btn.js-complete:hover { background: #d1fae5; }
.action-btn.danger { color: #ef4444; }
.action-btn.danger:hover { background: #fee2e2; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.task-item.has-pending-changes {
  background: linear-gradient(135deg, #F4FBE3 0%, #FFFDF7 100%);
  border-left-width: 6px;
  box-shadow: 0 2px 8px rgba(111,143,42,.25);
}
.task-item.completed { opacity: .7; }
.completed-section {
  margin-top: 1.5rem;
}
.completed-section h3 {
  color: #5C7A1C;
  margin-bottom: 0.75rem;
}

.toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #6F8F2A 0%, #5C7A1C 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(92,122,28,.3);
  font-weight: 600;
  z-index: 9999;
  animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 2.7s;
  pointer-events: none;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

.editor-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.editor-card {
  background: #FFFDF7; border-radius: 12px; width: 100%; max-width: 40rem;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(28,33,20,.3);
}
.editor-header, .editor-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid #D9D3C2;
}
.editor-footer { border-bottom: none; border-top: 1px solid #D9D3C2; justify-content: flex-end; gap: .75rem; background: #F3F0E6; }
.editor-header h2 { margin: 0; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: #a0aec0; cursor: pointer; }
.editor-body { padding: 1.5rem; overflow-y: auto; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .4rem; }
.form-group input[type=text],
.form-group input[type=date],
.form-group input[type=number],
.form-group textarea {
  width: 100%; padding: .625rem .875rem; border: 1px solid #D9D3C2;
  border-radius: 6px; font: inherit; background: #F3F0E6;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none; border-color: #6F8F2A; background: #FFFDF7;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.scale-hint { font-weight: 400; color: #718096; font-size: .85rem; }

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid #E5DCC8;
  background: rgba(243, 240, 230, 0.5);
}
.app-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: #718096;
}
.app-footer a {
  color: #6F8F2A;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.app-footer a:hover {
  color: #5C7A1C;
  text-decoration: underline;
}

.dashboard.dark-mode { background: #1a202c; color: #e2e8f0; }
.dashboard.dark-mode .dashboard-header,
.dashboard.dark-mode .graph-card,
.dashboard.dark-mode .settings-panel,
.dashboard.dark-mode .io-panel,
.dashboard.dark-mode .glossary-panel,
.dashboard.dark-mode .task-list,
.dashboard.dark-mode .task-item,
.dashboard.dark-mode .empty-state,
.dashboard.dark-mode .dark-mode-toggle,
.dashboard.dark-mode .current-profile,
.dashboard.dark-mode .profile-menu,
.dashboard.dark-mode .toggle-view-btn { background: #2d3748; border-color: #4a5568; color: #e2e8f0; }
.dashboard.dark-mode .profile-name,
.dashboard.dark-mode .task-title { color: #e2e8f0; }
.dashboard.dark-mode h3,
.dashboard.dark-mode .list-header h3,
.dashboard.dark-mode .completed-section h3 { color: #C9D7B2; }
.dashboard.dark-mode .dropzone { background: #314361; border-color: #4a5568; color: #a0aec0; }
.dashboard.dark-mode .dropzone:hover { background: #3a4f6b; border-color: #6F8F2A; color: #e2e8f0; }
.dashboard.dark-mode .dropzone.dragging { background: #4a5b7a; border-color: #6F8F2A; }
.dashboard.dark-mode .setting-label { color: #C9D7B2; }
.dashboard.dark-mode .formula-label { color: #a0aec0; }
.dashboard.dark-mode .formula { color: #C9D7B2; }
.dashboard.dark-mode .formula-preview { background: #1e293b; border-color: #4a5568; }
.dashboard.dark-mode .action-btn:hover { background: #374151; }
.dashboard.dark-mode .action-btn.js-apply {
  background: #6F8F2A;
  color: #fff;
}
.dashboard.dark-mode .action-btn.js-apply:hover {
  background: #5C7A1C;
}
.dashboard.dark-mode .action-btn.js-complete { color: #34d399; }
.dashboard.dark-mode .action-btn.js-complete:hover { background: #064e3b; }
.dashboard.dark-mode .action-btn.danger:hover { background: #7f1d1d; }
.dashboard.dark-mode .task-item.has-pending-changes {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-left-color: #8FB85C;
  box-shadow: 0 2px 8px rgba(143,184,92,.35);
}
.dashboard.dark-mode .status-label {
  color: #a0aec0;
}
.dashboard.dark-mode .status-select {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}
.dashboard.dark-mode .status-select:hover {
  background: #374151;
  border-color: #6F8F2A;
}
.dashboard.dark-mode .task-scores { color: #cbd5e0; }
.dashboard.dark-mode .quick-adjust label { color: #cbd5e0; }
.dashboard.dark-mode .quick-adjust small { color: #a0aec0; }
.dashboard.dark-mode .axis-select { background: #1a202c; border-color: #4a5568; color: #C9D7B2; }
.dashboard.dark-mode .axis-label { color: #C9D7B2; }
.dashboard.dark-mode .axis-select-inline { background: #2d3748; border-color: #4a5568; color: #C9D7B2; }
.dashboard.dark-mode .axis-select-inline:hover { background: #374151; border-color: #6b7280; }
.dashboard.dark-mode .axis-vs { color: #C9D7B2; }
.dashboard.dark-mode .toast-notification {
  background: linear-gradient(135deg, #5C7A1C 0%, #6F8F2A 100%);
}
.dashboard.dark-mode .section-toggle {
  color: #C9D7B2;
}
.dashboard.dark-mode .glossary-section-header {
  background: rgba(139,92,246,0.15);
}
.dashboard.dark-mode .glossary-section-header:hover {
  background: rgba(139,92,246,0.25);
}
.dashboard.dark-mode .glossary-section-header h4 {
  color: #C9D7B2;
}
.dashboard.dark-mode .scale-item {
  background: rgba(0,0,0,0.2);
  border-left-color: #6F8F2A;
}
.dashboard.dark-mode .scale-num {
  color: #C9D7B2;
}
.dashboard.dark-mode .scale-desc {
  color: #cbd5e0;
}
.dashboard.dark-mode .glossary-content::-webkit-scrollbar-track {
  background: rgba(74,85,104,0.3);
}
.dashboard.dark-mode .glossary-content::-webkit-scrollbar-thumb {
  background: #6F8F2A;
}
.dashboard.dark-mode .glossary-content::-webkit-scrollbar-thumb:hover {
  background: #8FB85C;
}
.dashboard.dark-mode .presets-bar-container {
  background: linear-gradient(135deg, #1e293b 0%, #2d3748 100%);
  border-bottom-color: #6F8F2A;
}
.dashboard.dark-mode .presets-bar {
  border-bottom-color: rgba(139,92,246,0.4);
}
.dashboard.dark-mode .factor-label {
  color: #C9D7B2;
}
.dashboard.dark-mode .factor-label strong {
  color: #D9EDC0;
}
.dashboard.dark-mode .preset-indicator {
  background: #374151;
  color: #C9D7B2;
}
.dashboard.dark-mode .preset-indicator.custom-values {
  background: #78350f;
  color: #fcd34d;
}
.dashboard.dark-mode .expand-toggle {
  border-color: #6F8F2A;
  color: #C9D7B2;
}
.dashboard.dark-mode .expand-toggle:hover {
  background: #374151;
  border-color: #8FB85C;
}
.dashboard.dark-mode .ranking-controls {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.3);
}
.dashboard.dark-mode .control-label {
  color: #C9D7B2;
}
.dashboard.dark-mode .control-label span {
  color: #D9EDC0;
}
.dashboard.dark-mode .preset-btn {
  background: #1a202c;
}
.dashboard.dark-mode .preset-btn-builtin {
  border-color: #6F8F2A;
  color: #C9D7B2;
}
.dashboard.dark-mode .preset-btn-builtin:hover {
  background: #2d3748;
  border-color: #8FB85C;
}
.dashboard.dark-mode .preset-btn-builtin.active {
  background: linear-gradient(135deg, #6F8F2A 0%, #5C7A1C 100%);
  color: #fff;
}
.dashboard.dark-mode .preset-btn-custom {
  border-color: #34d399;
  color: #6ee7b7;
}
.dashboard.dark-mode .preset-btn-custom:hover {
  background: #064e3b;
  border-color: #6ee7b7;
}
.dashboard.dark-mode .preset-btn-custom.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}
.dashboard.dark-mode .preset-save {
  border-color: #34d399;
  color: #6ee7b7;
}
.dashboard.dark-mode .preset-save:hover {
  background: #064e3b;
  border-color: #6ee7b7;
}
.dashboard.dark-mode .preset-manage {
  border-color: #fbbf24;
  color: #fcd34d;
}
.dashboard.dark-mode .preset-manage:hover {
  background: #78350f;
  border-color: #fcd34d;
}
.dashboard.dark-mode .preset-dropdown {
  background: #2d3748;
  border-color: #6F8F2A;
}
.dashboard.dark-mode .preset-dropdown-item {
  border-bottom-color: #4a5568;
}
.dashboard.dark-mode .preset-dropdown-item:hover {
  background: #374151;
}
.dashboard.dark-mode .preset-dropdown-item.active {
  background: #4a5568;
  border-left-color: #8FB85C;
}
.dashboard.dark-mode .preset-dropdown-name {
  color: #C9D7B2;
}
.dashboard.dark-mode .preset-dropdown-desc {
  color: #a0aec0;
}
.dashboard.dark-mode .presets-section h3 {
  color: #C9D7B2;
}
.dashboard.dark-mode .pin-count {
  background: #374151;
  color: #C9D7B2;
}
.dashboard.dark-mode .preset-card {
  background: #1a202c;
  border-color: #4a5568;
}
.dashboard.dark-mode .preset-card.pinned {
  border-color: #6F8F2A;
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}
.dashboard.dark-mode .preset-card-builtin.pinned {
  border-color: #6F8F2A;
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}
.dashboard.dark-mode .preset-card-custom.pinned {
  border-color: #34d399;
  background: linear-gradient(135deg, #064e3b 0%, #1a202c 100%);
}
.dashboard.dark-mode .drag-handle {
  color: #6F8F2A;
}
.dashboard.dark-mode .preset-card-title {
  color: #C9D7B2;
}
.dashboard.dark-mode .built-in-badge {
  background: #4a5568;
  color: #C9D7B2;
}
.dashboard.dark-mode .custom-badge {
  background: #064e3b;
  color: #6ee7b7;
}
.dashboard.dark-mode .preset-action-btn:hover {
  background: #374151;
}
.dashboard.dark-mode .preset-action-btn.danger:hover {
  background: #7f1d1d;
}
.dashboard.dark-mode .preset-card-desc {
  color: #a0aec0;
}
.dashboard.dark-mode .preset-card-factors {
  color: #C9D7B2;
}
.dashboard.dark-mode .preset-card-factors span {
  background: #374151;
}
.dashboard.dark-mode .empty-message {
  color: #718096;
}
.editor-card.dark-mode { background: #2d3748; color: #e2e8f0; }
.editor-card.dark-mode input,
.editor-card.dark-mode textarea { background: #1a202c; border-color: #4a5568; color: #e2e8f0; }
.dashboard.dark-mode .app-footer {
  border-top-color: #374151;
  background: rgba(45, 55, 72, 0.5);
}
.dashboard.dark-mode .app-footer p {
  color: #9ca3af;
}
.dashboard.dark-mode .app-footer a {
  color: #C9D7B2;
}
.dashboard.dark-mode .app-footer a:hover {
  color: #D9EDC0;
}

@media (max-width: 1200px) {
  .dashboard-main { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .bottom-section { grid-template-columns: 1fr; }
  .presets-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .preset-btn {
    width: 100%;
    text-align: center;
  }
  .current-factors-header {
    flex-direction: column;
    align-items: stretch;
  }
  .current-factors {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .preset-indicator {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
  .expand-toggle {
    width: 100%;
  }
  .controls-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .setting-group {
    flex-direction: column;
    align-items: flex-start;
  }
  .setting-group .setting-label {
    margin-bottom: 0.5rem;
    min-width: auto;
  }
  .setting-group input[type="range"] {
    width: 100%;
  }
}
@media (max-width: 768px) {
  .header-content { flex-direction: column; gap: 1rem; align-items: stretch; }
  .task-title { font-size: 0.95rem; }
  .action-btn { padding: .25rem .35rem; font-size: 0.95rem; }
  .task-scores { gap: 0.5rem; font-size: 0.8rem; }
}
