/* One time badge above each timed task. Untimed tasks use a single line. */
.scene { --list-line: #d9dbe8; }
.scene h2, .scene .order-head h2 {
  margin: 0;
  padding: .5rem .65rem;
  border: 0;
  border-inline-start: 4px solid #4854ba;
  background: #f0f1f8;
  color: #23284a;
  font-size: 1.125rem;
  line-height: 1.4;
}
.scene .order-head { border: 0; background: #f0f1f8; }
.scene .items { border: 0; border-radius: 0; background: white; }
.scene .row {
  min-height: 58px;
  padding: 4px;
  gap: 4px;
  border-inline-start: 0;
  border-bottom: 1px solid var(--list-line);
}
.task {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  gap: 4px;
  padding: 5px 0;
  color: #1c2239;
  font-size: 1.0625rem;
}
.task input { justify-self: center; margin: 0; }
.task > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; overflow-wrap: anywhere; }
.task .row-clock:empty { display: none; }
.task .row-clock:not(:empty), #item-links .setting-meta time:not(:empty) {
  display: inline-block;
  justify-self: start;
  align-self: start;
  margin: 0;
  padding: 0 .375rem;
  border-radius: 4px;
  background: #eaedff;
  color: #303c98;
  font: 700 1rem/1.25 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

#item-links .setting-line { min-height: 58px; padding: 4px; gap: 4px; }
#item-links .setting-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 24px;
  gap: 2px 4px;
  padding: 5px 4px 5px 0;
  font-size: 1.0625rem;
  line-height: 1.45;
}
.setting-meta { display: contents; }
.setting-meta time { grid-area: 1 / 1; }
.setting-name { grid-area: 2 / 1; }
.setting-detail-icon { grid-area: 1 / 2 / span 2; align-self: center; justify-self: center; }
.setting-row:has(time:empty) .setting-name { grid-row: 1 / span 2; }
.setting-meta time:empty { display: none; }
.setting-line .order-grip { background: transparent; border-color: transparent; color: #48516f; }
.draft-bar { background: #f7f8fb; border-top: 1px solid #b8bdcd; color: #252a50; box-shadow: 0 -3px 12px #20253b18; }
#discard-day { background: white; color: #414963; border: 1px solid #7a8298; min-height: 48px; border-radius: 8px; }
#commit-day { background: #303762; color: white; font-weight: 750; border-radius: 8px; }
#save-error:not(:empty) { color: #8b2840; }
.draft-bar button:focus-visible { outline: 3px solid #9a580b; outline-offset: 2px; }

#item-links .items { overflow:visible; padding-bottom:22px; }
#item-links .setting-line { padding-inline-end:46px; }
#item-links .gap-trigger {
  position:absolute; z-index:1; inset-inline-end:0; bottom:-22px;
  display:grid; place-items:center; width:44px; height:44px; padding:0; background:transparent;
}
.plus-symbol { display:inline-grid; place-items:center; width:22px; height:22px; border:1px solid #8a95b6; border-radius:50%; background:white; color:#37467c; font:600 1rem/1 sans-serif; }
.first-slot { background:white; padding-inline:8px; text-align:end; }
.first-trigger { background:transparent; color:#37467c; font-size:.875rem; min-height:44px; }
#item-links .setting-line:has(#insert-form:not([hidden])) {padding-inline-end:4px;}
#item-links .gap-trigger[aria-expanded=true] {visibility:hidden;}
#insert-form {flex:0 0 100%; min-width:0; text-align:start; padding:12px; background:#f6f7fc; border:1px solid #bbc3d8; border-radius:8px;}
#insert-form .actions {flex-wrap:wrap;}
#insert-form button {width:auto;height:auto;min-height:44px;}
#insert-templates summary {padding:10px 0;min-height:44px;color:#394576;cursor:pointer;}
#insert-options {display:flex;flex-wrap:wrap;gap:6px;}
#template-position:empty {display:none;}

#item-links .scene:not(.show-gaps) .gap-trigger,
#item-links .scene:not(.show-gaps) .first-slot:not(:has(#insert-form:not([hidden]))) {display:none}
#item-links .scene:not(.show-gaps) .first-trigger {display:none}
#item-links .scene:not(.show-gaps) .setting-line {padding-inline-end:4px}
#item-links .scene:not(.show-gaps) .items {padding-bottom:0}
#item-links .order-head {flex-wrap:wrap}
.toggle-gaps {min-height:44px;background:white;color:#1749a1;border:1px solid #b7bfd4;border-radius:6px}
#guide-book {width:min(36rem,calc(100% - 1rem));max-height:86dvh;color:#202b45;padding:0;border:1px solid #bbc3d8;border-radius:12px;}
#guide-book[open] {display:flex;flex-direction:column;}
#guide-book .book-head,#book-actions {padding:.7rem;display:flex;align-items:center;justify-content:space-between;gap:.5rem;flex-wrap:wrap;}
.book-head h2 {font-size:1.15rem;margin:0;overflow-wrap:anywhere;}
#book-body {overflow:auto;padding:.75rem;min-height:0;}
#book-body .book-row {display:block;width:100%;text-align:left;overflow-wrap:anywhere;}
#book-message {margin:0 .75rem;color:#862939;}
#guide-book button,[data-open-guides],.insert-step,#saved-guide-choices summary {min-height:44px;}
.step-editor .insert-step {display:block;margin-top:.5rem;}
#saved-guide-choices summary {padding:.5rem 0;cursor:pointer;}
.setup-tabs {display:grid;grid-template-columns:1fr 1fr;margin:.55rem 0 1rem;border-bottom:1px solid #bcc4d4;}
.setup-tabs a {min-height:46px;display:grid;place-items:center;padding:.4rem .25rem;color:#485369;text-decoration:none;border-bottom:3px solid transparent;font-size:1rem;}
.setup-tabs a[aria-current=page] {color:#233e83;border-bottom-color:#344f96;font-weight:750;}
.setup-tabs a:focus-visible {outline:3px solid #a0610a;outline-offset:-3px;}
#first-setup:not([hidden]) {display:grid;gap:.35rem;margin-bottom:.65rem;}
#first-setup p{margin:0;color:#354662;font-size:.9rem;line-height:1.45;}
#first-setup button{min-height:44px;justify-self:start;max-width:100%;padding:.55rem 1rem;}
#book-host #guide-book[open] {position:static;width:100%;max-width:none;max-height:none;border:0;border-radius:0;box-shadow:none;margin:0;overflow:visible;background:white;}
#book-host #book-body {overflow:visible;}
#book-host .book-head {border-bottom:1px solid #dbe0e9;}
#settings header h1 {font-size:clamp(1.45rem,7.45vw,2rem);line-height:1.35;}

#book-body .guide-origin{display:block;color:#495b70;font-size:.875rem;font-weight:normal;line-height:1.45;margin-top:.2rem;}
#book-body .guide-preview:not([hidden]){display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#35465b;font-size:.9rem;font-weight:normal;line-height:1.45;margin-top:.25rem;}
#book-body .guide-search{width:100%;min-height:44px;font:inherit;padding:.45rem .6rem;}
#book-body .guide-results h3{margin:1rem 0 .4rem;}

#book-body .guide-results .book-row + .book-row{margin-top:.3rem;}

.book-collections{display:grid;grid-template-columns:1fr 1fr;gap:.25rem;background:#f1f3f8;padding:.25rem;border-radius:8px;margin-bottom:.85rem;}
.book-collections button{background:transparent;color:#324666;font-size:.95rem;padding:.45rem .2rem;border:1px solid transparent;border-radius:6px;}
.book-collections button[aria-current=page]{background:white;border-color:#b5c2d6;color:#233e83;font-weight:750;}
#guide-choices .guide-origin{display:block;font-size:.875rem;font-weight:normal;}

.week-open{min-height:44px;margin:.25rem 0 .6rem;}
#week-panel{padding:0;width:min(34rem,calc(100% - 1rem));max-height:90dvh;border:1px solid #b4c1d1;border-radius:12px;color:#20334c;}
#week-panel[open]{display:flex;flex-direction:column;}
#week-panel{position:fixed;top:auto;bottom:var(--week-bottom,0px);margin:0 auto;max-height:var(--week-height,90dvh);overflow:hidden;}
.week-scroll{display:contents;}
#week-panel.scroll-header .week-scroll{display:block;min-height:0;overflow:auto;overscroll-behavior:contain;}
#week-panel.scroll-header .week-body{overflow:visible;}
#week-panel.compact header{flex-wrap:wrap;padding:.25rem .65rem;}
#week-panel.compact footer{flex:none;margin:0;padding:.25rem .65rem max(.25rem,env(safe-area-inset-bottom));}
#week-panel.compact #week-error{max-height:calc(var(--week-height) * .23);overflow:auto;}

#week-panel header,#week-panel footer{padding:.65rem .85rem;background:white;}
#week-panel header{display:flex;align-items:center;justify-content:space-between;gap:.35rem;border-bottom:1px solid #d4dce6;}
#week-cancel{flex-shrink:0;white-space:nowrap;}
#week-context{overflow-wrap:anywhere;}#week-context p{margin:.25rem 0 .65rem;}
#week-title,#week-preview-title{font-size:1.05rem;margin:0;}
.week-body{padding:.8rem;overflow:auto;overscroll-behavior:contain;}
.week-body label{display:block;margin:.45rem 0;font-weight:650;}
.week-body select,.week-body input:not([type=checkbox]){display:block;width:100%;font:inherit;padding:.42rem;min-height:44px;box-sizing:border-box;}
#week-panel button{min-height:44px;}#week-modes,#week-presets{display:flex;gap:.35rem;}
#week-modes [aria-pressed=true]{background:#234984;color:white;}
#week-panel fieldset{border:1px solid #cbd5e2;border-radius:8px;margin:.8rem 0;padding:.5rem;}
#week-days{display:flex;flex-wrap:wrap;gap:.15rem;}#week-days label{min-height:44px;display:flex;gap:.2rem;align-items:center;margin:0;padding:.12rem .35rem;}
#week-preview{list-style:none;padding:0;margin:.4rem 0;}#week-preview li{border-top:1px solid #d9dfe7;padding:.35rem 0;overflow-wrap:anywhere;}
#week-panel footer{border-top:1px solid #cbd5e2;padding-bottom:max(.65rem,env(safe-area-inset-bottom));}#week-save{width:100%;}
#week-error{margin:0;color:#862939;}#week-error:not(:empty){margin-bottom:.45rem;}

#week-entry-feedback:empty{display:none;}#week-location summary{min-height:44px;color:#284e84;cursor:pointer;padding:.55rem 0;overflow-wrap:anywhere;}
#week-presets button[aria-pressed=true]{color:white;background:#234984;}

#week-result{margin:.55rem 0;padding:.6rem .75rem;border-inline-start:3px solid #34558a;background:#f1f5fb;color:#20334c;overflow-wrap:anywhere;}
#week-result p{margin:.35rem 0 0;font-weight:650;}
#week-result ul{margin:0;padding-inline-start:1.25rem;}

#week-clear{background:transparent;border:0;color:#314766;text-decoration:underline;text-underline-offset:.18em;padding-inline:.3rem;}
#week-empty{width:min(28rem,calc(100% - 1.5rem));max-height:85dvh;}
#week-empty button{min-height:44px;}
