:root{--ink:#172033;--muted:#687386;--line:#dce2eb;--panel:#fff;--bg:#f3f5f8;--accent:#2061a6;--accent-hover:#174f89;--accent-soft:#edf5fc;--accent-ring:#2061a666;--slot:48px;--timew:72px;--head:72px}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
.topbar{height:80px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:20}
.brand{display:flex;align-items:center;gap:24px;min-width:0}.brand>div{display:flex;flex-direction:column;min-width:0}.brand strong{font-size:21px;line-height:1.15;white-space:nowrap}.brand small{color:var(--muted);font-size:11px}.di-logo{display:block;width:auto;height:44px;flex:none}
.actions,.controls{display:flex;align-items:center;gap:9px}
button,input,select,textarea{font:inherit}button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:9px 12px;color:var(--ink);cursor:pointer}button:hover{background:#f7f7fb}
.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}.danger{color:#c5324b}
.export-wrap{position:relative}.menu{display:none;position:absolute;right:0;top:43px;background:#fff;border:1px solid var(--line);box-shadow:0 10px 30px #1c24401c;border-radius:9px;padding:6px;min-width:210px;z-index:30}.menu.open{display:grid}.menu button{text-align:left;border:0}
main{padding:22px 28px 50px;margin-right:340px}.card{background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 2px 8px #19233e09}
.controls{padding:14px;margin-bottom:16px;flex-wrap:wrap}.controls label,.editor label{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;display:flex;flex-direction:column;gap:5px}
.autosave-note{margin-left:auto;color:#43845d;font-size:11px;font-weight:700;white-space:nowrap}
.controls input,.controls select,.editor input,.editor textarea{border:1px solid var(--line);border-radius:7px;padding:8px;background:#fff;color:var(--ink)}#titleInput{width:230px}#viewInput{min-width:135px}
.workspace{overflow:hidden}.hint{padding:11px 16px;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}#canvasWrap{overflow:auto;padding:18px;background:#fafbfc}
#agenda{position:relative;min-width:900px;background:#fff;border:1px solid #cfd6e1;user-select:none}.agenda-title{height:48px;display:flex;align-items:center;padding-left:var(--timew);font-size:20px;font-weight:800;border-bottom:1px solid var(--line)}
.days{display:grid;margin-left:var(--timew);height:var(--head)}.day-head{text-align:center;padding:7px 5px;border-left:1px solid var(--line);font-weight:750;position:relative}.day-head input{width:95%;border:0;text-align:center;font:inherit;background:transparent}.day-title-row{display:flex;align-items:center;gap:2px}.day-title-row .day-name{flex:1;min-width:0;width:auto}.day-move{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:5px;background:transparent;color:var(--muted);font-size:18px;line-height:1}.day-move:hover{background:var(--accent-soft);color:var(--accent)}.day-move:disabled{opacity:.22;cursor:default;background:transparent;color:var(--muted)}
.track-labels{font-size:10px;color:var(--muted);display:grid;grid-template-columns:1fr 1fr;margin-top:7px}.day-head .track-labels input{width:100%;min-width:0;border:0;border-top:1px solid var(--line);border-radius:0;padding:5px 4px 0;color:var(--muted);font-size:10px;font-weight:600}.day-head .track-labels input+input{border-left:1px solid var(--line)}.day-head input:focus{outline:2px solid var(--accent-ring);outline-offset:1px;border-radius:4px}
.grid-body{position:relative;margin-top:0;touch-action:none}.time-label{position:absolute;left:0;width:var(--timew);text-align:right;padding-right:12px;transform:translateY(-7px);font-size:11px;color:var(--muted);pointer-events:none}
.grid-line{position:absolute;left:var(--timew);right:0;border-top:1px solid var(--line);pointer-events:none}.grid-line.half{border-top-style:dashed;border-color:#e5e9ef}
.columns{position:absolute;left:var(--timew);right:0;top:0;bottom:0;display:grid}.track{position:relative;border-left:1px solid var(--line);background:transparent;touch-action:none}.track:nth-child(even){border-left-color:#e6e9ef}.track.day-start{border-left:2px solid #aab2c0}
.event{position:absolute;left:3px;right:3px;border:1px solid #ffffffe6;border-radius:6px;padding:3px 8px;color:#fff;overflow:hidden;box-shadow:0 2px 5px #17203325;cursor:grab;font-size:12px;line-height:1.22;z-index:4;touch-action:none;will-change:top,height}
.event.all-tracks{right:auto;width:calc(200% - 6px);z-index:5}
.event.dragging{cursor:grabbing;box-shadow:0 7px 18px #1720333d;z-index:30;opacity:.94}
.event.conflict{box-shadow:inset 0 0 0 2px #d7263d,0 2px 5px #17203325}
.event.conflict.dragging{box-shadow:inset 0 0 0 2px #d7263d,0 7px 18px #1720333d}
.event.selected{outline:3px solid #1b2130;outline-offset:1px;z-index:20}
.event-line{display:flex;align-items:flex-start;gap:7px;min-width:0}.event-time{display:inline-block;flex:none;font-size:9px;line-height:1.45;opacity:.8;font-weight:700;font-variant-caps:all-small-caps}.event-title{display:block;min-width:0;white-space:pre-wrap;line-height:1.22}
.resize-handle{position:absolute;height:12px;left:0;right:0;cursor:ns-resize;z-index:2}
.resize-top{top:0}.resize-bottom{bottom:0}
.resize-handle::after{content:"";position:absolute;left:35%;right:35%;bottom:3px;height:3px;border-radius:3px;background:currentColor;opacity:0;transition:opacity .12s}
.resize-top::after{top:3px;bottom:auto}
.event:hover .resize-handle::after,.event.selected .resize-handle::after{opacity:.9}
.editor{position:fixed;right:0;top:80px;bottom:0;width:340px;background:#fff;border-left:1px solid var(--line);box-shadow:-8px 0 30px #17203316;padding:18px;z-index:15;display:flex;flex-direction:column;gap:17px;overflow:auto}.editor-head{display:flex;justify-content:space-between;align-items:center;font-size:17px}.editor-empty{color:#9aa3b1;font-size:13px;line-height:1.5;padding:4px 2px}.editor:not(.empty) .editor-empty{display:none}.editor-fields{display:flex;flex:1;min-height:0;flex-direction:column;gap:17px}.editor.empty .editor-fields{display:none}.editor .row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.editor .row label{min-width:0}.editor .row input{width:100%;min-width:0}.color-row{display:flex;align-items:center;gap:9px}#eventColor{height:38px;width:50px;padding:3px}#swatches{display:flex;gap:5px;flex-wrap:wrap}.swatch{width:24px;height:24px;border-radius:6px;border:2px solid #fff;box-shadow:0 0 0 1px #ccd2dc;padding:0}.editor-actions{margin-top:auto;display:flex;justify-content:space-between}
.editor-save{display:flex;flex-direction:column;gap:7px}.editor-save button{width:100%}.editor-save small{text-align:center;color:var(--muted);font-size:11px}.editor-actions{margin-top:auto}
.field-help{color:var(--muted);font-size:11px;font-weight:500;text-transform:none;letter-spacing:0}
#eventNotes{font-weight:400;text-transform:none;letter-spacing:normal}
.editor label.check-label{flex-direction:row;align-items:center;gap:10px;padding:11px;border:1px solid var(--line);border-radius:8px;cursor:pointer;text-transform:none;letter-spacing:0}.check-label input{width:18px;height:18px;padding:0;flex:none}.check-label span{display:flex;flex-direction:column;gap:2px}.check-label strong{font-size:12px;color:var(--ink)}.check-label small{font-size:11px;font-weight:500;color:var(--muted)}
#toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);background:#1f2937;color:#fff;padding:10px 16px;border-radius:8px;opacity:0;pointer-events:none;transition:.2s;z-index:50}#toast.show{opacity:1;transform:translate(-50%,0)}
.session-menu{display:none;position:fixed;z-index:80;min-width:150px;padding:5px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 28px #1720332b}.session-menu.open{display:block}.session-menu button{width:100%;border:0;text-align:left;padding:9px 11px}
.modal-overlay{position:fixed;inset:0;z-index:100;display:none;align-items:center;justify-content:center;padding:24px;background:#1720339c}.modal-overlay.open{display:flex}body.modal-open{overflow:hidden}
.help-modal{width:min(760px,100%);max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:16px;padding:30px 34px;box-shadow:0 24px 70px #1118274d}.help-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:14px}.help-head h2{margin:0;color:#243f60;font-size:26px}.help-close{border:0;padding:2px 8px;background:transparent;color:#98a0ab;font-size:30px;line-height:1}.help-close:hover{background:#f3f5f8;color:var(--ink)}.help-intro{margin:0 0 10px;color:#3e4652;line-height:1.55}.help-section{border-bottom:1px solid var(--line)}.help-section summary{display:flex;align-items:center;gap:8px;padding:13px 2px;color:#243f60;font-size:15px;font-weight:750;cursor:pointer;list-style:none}.help-section summary::-webkit-details-marker{display:none}.help-section summary::before{content:"▸";display:inline-block;color:var(--accent);font-size:15px;transition:transform .15s ease}.help-section[open] summary::before{transform:rotate(90deg)}.help-section summary:focus-visible{outline:3px solid var(--accent-ring);outline-offset:2px;border-radius:5px}.help-content{padding:0 2px 13px 23px}.help-content ul{margin:0;padding-left:19px;color:#3e4652;line-height:1.45}.help-content li+li{margin-top:5px}.help-note{margin-top:10px;padding:8px 11px;border-left:3px solid var(--accent);border-radius:0 6px 6px 0;background:#f3f6f9;color:#52606d;font-size:12px;line-height:1.45}.help-shortcuts{width:100%;margin-top:16px;border-collapse:collapse;color:#354052;font-size:13px}.help-shortcuts caption{text-align:left;margin-bottom:5px;color:#243f60;font-weight:750}.help-shortcuts th,.help-shortcuts td{padding:4px 8px 4px 0;text-align:left;vertical-align:middle}.help-shortcuts th{width:150px;font-weight:500}.help-shortcuts kbd{display:inline-block;padding:1px 6px;border:1px solid #cbd2d9;border-bottom-width:2px;border-radius:4px;background:#f5f7fa;color:#354052;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;line-height:1.5}.help-got-it{width:100%;margin-top:18px;font-weight:750}
.template-modal,.import-modal{width:min(760px,100%);max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:16px;padding:30px 34px;box-shadow:0 24px 70px #1118274d}.template-intro{margin:0 0 20px;color:#3e4652;line-height:1.5}.template-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.template-option{min-height:142px;padding:18px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:10px;border:1px solid var(--line);background:#fafbfc}.template-option:hover{border-color:var(--accent);background:var(--accent-soft)}.template-option strong{color:#243f60;font-size:15px;line-height:1.25}.template-option small{color:var(--muted);font-size:12px;line-height:1.55}.template-note{margin:18px 0 0;padding:11px 13px;border-radius:8px;background:#f1f3f7;color:#4a5565;font-size:12px;line-height:1.45}.template-cancel{width:100%;margin-top:14px}
.import-modal{width:min(640px,100%)}.import-intro{margin:0 0 14px;color:#3e4652;line-height:1.5}.import-project{display:flex;flex-direction:column;gap:3px;padding:11px 13px;border-radius:8px;background:var(--accent-soft);color:#243f60}.import-project small{color:var(--muted)}.import-day-list{display:grid;gap:8px;margin-top:14px}.import-day{display:flex;align-items:flex-start;gap:11px;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer}.import-day:hover{border-color:var(--accent);background:#fafcff}.import-day:has(input:focus-visible){outline:3px solid var(--accent-ring);outline-offset:1px}.import-day:has(input:disabled){cursor:default;opacity:.55}.import-day input{width:18px;height:18px;margin:1px 0 0;flex:none;accent-color:var(--accent)}.import-day span{display:flex;min-width:0;flex-direction:column;gap:3px}.import-day strong{color:#243f60;font-size:13px}.import-day small{color:var(--muted);font-size:11px;line-height:1.4}.import-limit{margin:12px 0 0;color:#52606d;font-size:12px;line-height:1.45}.import-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}.import-actions .primary:disabled{opacity:.5;cursor:default}
@media(max-width:800px){.topbar{padding:0 12px}.brand{gap:0}.brand>div{display:none}.di-logo{height:34px}.brand small,.actions>button:not(.primary){display:none}#helpBtn{display:inline-block}main{padding:12px;margin-right:0}.controls label:first-child{width:100%}#titleInput{width:100%}.autosave-note{width:100%;margin-left:0}.editor{position:static;width:auto;margin:0 12px 18px;min-height:180px;border:1px solid var(--line);border-radius:12px;box-shadow:0 2px 8px #19233e09}}
@media(max-width:600px){.modal-overlay{padding:12px}.help-modal,.template-modal,.import-modal{max-height:calc(100vh - 24px);padding:22px 20px}.help-head h2{font-size:22px}.help-content{padding-left:18px}.help-shortcuts th{width:132px}.template-grid{grid-template-columns:1fr}.template-option{min-height:0}.import-actions{flex-direction:column-reverse}.import-actions button{width:100%}}
@media(prefers-reduced-motion:reduce){.help-section summary::before{transition:none}}
