.work-area { --todo-detail-width:23.5rem; }
.todo-detail-panel[open] {
  position:fixed;
  z-index:10;
  inset:0 0 0 auto;
  width:min(var(--todo-detail-width), calc(100% - 1.5rem));
  max-width:none;
  height:auto;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  border-inline-start:1px solid var(--line);
  border-radius:0;
  background:var(--surface);
  color:var(--ink);
  box-shadow:var(--shadow-float);
  overflow:hidden;
}
@media (min-width:1200px) {
  .work-area:has(>.todo-detail-panel[open]) :is(.topbar,main:has(.todo-workspace)) {
    margin-inline-end:var(--todo-detail-width);
  }
  .work-area:has(>.todo-detail-panel[open]) .todo-workspace {
    grid-template-columns:12rem minmax(0,1fr);
  }
  .todo-detail-panel[open] {
    inset-block:var(--frame-inset);
    inset-inline-end:max(1rem, calc((100% - var(--frame-width)) / 2));
    border:1px solid var(--line);
    border-radius:0 0.75rem 0.75rem 0;
  }
}
@media (prefers-reduced-motion:no-preference) {
  :root:not([data-reduce-motion="true"]) .todo-detail-panel[open] {
    animation:todo-detail-enter .17s ease-out;
  }
  :root:not([data-reduce-motion="true"]) .todo-detail-panel[open] form {
    animation:todo-detail-slide .17s ease-out;
  }
  @keyframes todo-detail-enter {
    from { clip-path:inset(0 0 0 100%); }
    to { clip-path:inset(0); }
  }
  @keyframes todo-detail-slide { from { transform:translateX(100%); } }
}
.todo-detail-panel form { height:100%; display:flex; flex-direction:column; }
.todo-detail-head,.todo-detail-foot {
  display:flex; align-items:center; flex:none; gap:0.5rem; padding:0.75rem 1.125rem;
}
.todo-detail-head { justify-content:space-between; border-bottom:1px solid var(--line); }
.todo-detail-head h2 { font-size:1rem; outline:0; }
.todo-detail-head .icon-btn { width:2.25rem; height:2.25rem; }
.todo-detail-body {
  flex:1; min-height:0; overflow:auto; overscroll-behavior:contain;
  display:flex; flex-direction:column; align-items:stretch; gap:1.3125rem; padding:1.25rem;
}
.todo-detail-body>*,.todo-detail-fields>label { flex:none; min-width:0; }
.todo-detail-body :is(label,legend) { font-size:.81rem; font-weight:560; color:var(--muted); }
.todo-detail-title,.todo-detail-fields>label,.todo-detail-body .note-link-editor label { display:grid; gap:0.3125rem; }
.todo-detail-body input:not([type="checkbox"],[type="hidden"]),.todo-detail-fields select {
  box-sizing:border-box; width:100%; min-width:0; min-height:2.3125rem; padding:0.4375rem 0.5625rem;
  color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:0.375rem; font:inherit;
  font-size:.92rem; font-weight:450;
}
.todo-detail-title input[name="title"] { font-size:1.13rem; font-weight:620; }
.todo-detail-fields { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:0.75rem; }
.todo-detail-fields>label:first-child { grid-column:1/-1; }
.todo-detail-fields .btn { align-self:end; justify-self:start; }
.todo-detail-body .step-editor { padding-block-start:0.375rem; }
.todo-detail-body .note-editor { margin-block-start:0.125rem; }
.todo-detail-foot { justify-content:flex-end; border-top:1px solid var(--line); }
[data-todo-task].todo-detail-selected { background:var(--accent-soft); }
@media (max-width:450px) {
  .todo-detail-body { padding:0.9375rem; gap:1rem; }
  .todo-detail-head,.todo-detail-foot { padding:0.5rem 0.875rem; }
}
