*{box-sizing:border-box}
:root{
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  color:#222;
  background:#f7f7f7;
}
body{margin:0}
button,select,input,textarea{font:inherit}
button{cursor:pointer}
.topbar{
  height:54px;display:flex;align-items:center;gap:8px;padding:8px 12px;
  background:#fff;border-bottom:1px solid #ddd;position:sticky;top:0;z-index:20
}
.topbar strong{margin-right:8px}
.topbar select{min-width:220px}
.spacer{flex:1}
.save-state{font-size:12px;color:#666}
main{height:calc(100vh - 54px)}
.hidden{display:none!important}
.empty{display:grid;place-content:center;height:100%;text-align:center}
.gantt-app{
  display:grid;grid-template-columns:320px 1fr;height:100%;overflow:hidden;background:#fff
}
.task-pane{border-right:1px solid #ccc;overflow:hidden}
.task-head,.timeline-header{
  height:58px;background:#fafafa;border-bottom:1px solid #ccc;position:sticky;top:0;z-index:5
}
.task-head{display:flex;align-items:end;padding:0 10px 8px;font-weight:600}
#taskList{overflow:hidden}
.task-row{
  height:36px;border-bottom:1px solid #eee;display:flex;align-items:center;
  gap:6px;padding-right:8px;white-space:nowrap
}
.task-row:hover{background:#f7f9ff}
.task-indent{flex:0 0 auto}
.fold{width:22px;border:0;background:transparent;padding:0}
.task-name{
  overflow:hidden;text-overflow:ellipsis;cursor:pointer;flex:1
}
.task-duration{font-size:12px;color:#666;flex:0 0 auto}
.task-name.folder{font-weight:600}
.task-name.completed{text-decoration:line-through;color:#888}
.timeline-pane{overflow:auto;position:relative;cursor:grab}
.timeline-pane.panning{cursor:grabbing;user-select:none}
.bar{cursor:grab}
.timeline-header{
  min-width:max-content;display:flex;align-items:stretch
}
.day-head{
  width:32px;min-width:32px;border-right:1px solid #eee;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:4px;font-size:11px;line-height:1.35
}
.day-head-dow{font-size:9px;color:#888}
.day-head.weekend{background:#f3f3f3}
.day-head.sat{color:#3b6fc9}
.day-head.sat .day-head-dow{color:#3b6fc9}
.day-head.sun{color:#c94747}
.day-head.sun .day-head-dow{color:#c94747}
.day-head.today{background:#fff3cd}
.timeline-body{position:relative;min-width:max-content}
.timeline-row{
  height:36px;border-bottom:1px solid #eee;position:relative
}
.day-grid{
  position:absolute;inset:0;display:flex;pointer-events:none
}
.day-cell{width:32px;min-width:32px;border-right:1px solid #f1f1f1}
.day-cell.weekend{background:#fafafa}
.day-cell.today{background:#fff9e6}
.bar{
  position:absolute;top:6px;height:24px;border-radius:5px;color:#fff;
  font-size:12px;line-height:24px;padding:0 8px;overflow:hidden;white-space:nowrap;
  text-overflow:ellipsis;cursor:grab;user-select:none;min-width:32px
}
.bar.completed{opacity:.45}
.bar.blue{background:#4776d0}
.bar.green{background:#3f8f5d}
.bar.yellow{background:#c79a24}
.bar.red{background:#c95858}
.bar.purple{background:#8064b9}
.bar.orange{background:#dd7a2d}
.bar.teal{background:#278c8c}
.bar.gray{background:#777}
.bar.folder{background-image:repeating-linear-gradient(135deg,#0000 0 6px,#ffffff26 6px 12px)}
.handle{
  position:absolute;top:0;width:7px;height:100%;cursor:ew-resize
}
.handle.left{left:0}.handle.right{right:0}
dialog{border:0;border-radius:10px;box-shadow:0 12px 40px #0004;min-width:380px}
dialog::backdrop{background:#0005}
dialog form{display:grid;gap:12px}
dialog label{display:grid;gap:5px}
dialog input,dialog textarea,dialog select{width:100%;padding:7px}
.color-picker{display:flex;gap:8px;padding:2px 0}
.color-swatch{width:26px;height:26px;border:2px solid transparent;border-radius:50%;padding:0}
.color-swatch.selected{border-color:#222;box-shadow:0 0 0 2px #fff,0 0 0 4px #222}
.color-swatch.blue{background:#4776d0}.color-swatch.green{background:#3f8f5d}
.color-swatch.yellow{background:#c79a24}.color-swatch.red{background:#c95858}
.color-swatch.purple{background:#8064b9}.color-swatch.orange{background:#dd7a2d}
.color-swatch.teal{background:#278c8c}.color-swatch.gray{background:#777}
.folder-option{display:flex;align-items:center;gap:6px}
.folder-option input{width:auto;padding:0}
.date-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:5px}
.danger{margin-right:auto;color:#a00}
@media(max-width:800px){
  .gantt-app{grid-template-columns:220px 1fr}
  .topbar{overflow-x:auto}
  .topbar select{min-width:150px}
}

.zoom-label{font-size:12px;color:#666;min-width:42px;text-align:center}
.task-row[draggable="true"]{cursor:grab}
.task-row.dragging{opacity:.35}
.task-row.drop-target{outline:2px solid #4776d0;outline-offset:-2px;background:#eef4ff}
.task-head.drop-target{outline:2px dashed #4776d0;outline-offset:-4px;background:#eef4ff}

.view-btn.active{font-weight:700;box-shadow:inset 0 -2px 0 currentColor}.login-error{min-height:20px;color:#a00;font-size:13px}
.login-hint{background:#eef4ff;color:#345;font-size:12px;padding:6px 8px;border-radius:4px;margin:4px 0 10px}
