/* A quieter layer shared by every feature and both color schemes. */
:root { --radius-sm: 7px; --radius: 10px; --radius-lg: 14px; --shadow-sm: none; --shadow: none; }
body { font-size: var(--font-size-body); line-height: 1.6; }
#app { max-width: 960px; }
#topbar { padding: 24px 26px 10px; }
.brand { font-size: var(--font-size-body); font-weight: 600; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; }
#tabs { width: 100%; padding: 8px 20px 12px; gap: 4px; }
.tab-btn { flex: 1 0 auto; font-size: var(--font-size-action); font-weight: 500; }
.tab-btn.active { color: var(--text); background: var(--surface-2); }
.tab-more-count { display: none; }
main { padding: 28px 26px 80px; }
.page-head { margin: 0 0 24px; }
.page-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.card { padding: 22px; margin-bottom: 20px; box-shadow: none; }
.card h3, .section-lbl { text-transform: none; letter-spacing: 0; font-size: var(--font-size-section); font-weight: 600; color: var(--text); }
.card h3 > .icon { display: none; }
.btn { font-weight: 500; box-shadow: none; }
.btn-primary { font-weight: 600; }
.chip { border-radius: 5px; background: var(--surface-2); font-weight: 400; }
.stat-row { gap: 0; border-bottom: 1px solid var(--border); padding: 4px 0 20px; margin-bottom: 24px; }
.stat { background: transparent; border: 0; border-radius: 0; padding: 8px 14px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-icon { display: none; }
.stat .num { font-size: 21px; font-weight: 500; }
.stat .lbl { margin-top: 4px; }
.schedule-list-header h3 { font-size: var(--font-size-section); }
.task-row:is(.schedule-task, .project-task) { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 15px 0; box-shadow: none; }
.task-title { font-weight: 500; }
.task-meta { gap: 4px 7px; }
.task-meta .chip { background: transparent; padding: 0; color: var(--muted); font-size: var(--font-size-caption); }
.task-tree-children { border-left-width: 1px; }
.time-block-group > .time-block-row { border-bottom: 1px solid var(--border); }
.time-block-group > .task-tree-children > .task-tree-node > .task-row:not(.time-block-row) { border: 0; border-bottom: 1px solid var(--border); background: transparent; }
.time-block-row .task-title { font-size: var(--font-size-action); }
/* Secondary content stays discoverable without competing with the main task. */
.form-section, .page-section { border: 0; border-top: 1px solid var(--border); margin: 0; }
.form-section > summary, .page-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; min-height: 36px; padding: 6px 0; color: var(--muted); font-size: var(--font-size-action); font-weight: 500; }
.form-section > summary::-webkit-details-marker, .page-section > summary::-webkit-details-marker { display: none; }
.form-section > summary::after, .page-section > summary::after { content: '+'; font-size: 18px; font-weight: 400; }
.form-section[open] > summary::after, .page-section[open] > summary::after { content: '−'; }
.form-section[open] > summary, .page-section[open] > summary { color: var(--text); }
.form-section-body { padding: 0 0 8px; }
.page-section-body { padding: 0 0 12px; }
.page-section-body > .card:last-child { margin-bottom: 0; }
.form-section-body > .field:last-child { margin-bottom: 0; }
/* Modal essentials come first; optional fields never leave the form DOM. */
dialog { width: min(520px, calc(100vw - 32px)); border-radius: 14px; border-color: var(--border); }
dialog::backdrop { background: rgb(10 12 18 / .35); }
dialog form { padding: 26px; max-height: min(88dvh, 820px); }
dialog h3 { font-size: var(--font-size-section); font-weight: 600; margin-bottom: 24px; }
dialog .field { margin-bottom: 18px; }
dialog .field > span, .picker-label { font-size: var(--font-size-label); font-weight: 500; }
dialog .doc-help { display: none; }
dialog .seg { background: var(--surface-2); border: 0; padding: 3px; margin-bottom: 20px; }
dialog .seg-btn { font-size: var(--font-size-action); font-weight: 500; min-height: 36px; }
dialog .seg-btn.active { background: var(--surface); box-shadow: none; color: var(--text); }
#fTitle, #nTitle, #gTitle, #rmTitle, #chTitle, #lTitle { font-size: var(--font-size-input); }
#sourceSeg .icon, #sourceSeg svg { display: none; }
.when-card { border: 0; padding: 0; background: transparent; box-shadow: none; }
.task-slot-heading { font-size: var(--font-size-caption); }
.task-slot:first-of-type .task-slot-heading > span { display: none; }
.picker-trigger { min-height: 44px; font-weight: 500; font-size: var(--font-size-input); }
.time-picker .picker-trigger [data-picker-value] { font-size: var(--font-size-input); }
.picker-trigger:hover, .picker-details[open] > .picker-trigger { box-shadow: none; }
.dialog-actions { position: sticky; bottom: -26px; background: var(--surface); padding: 16px 0 8px; margin-top: 20px; border-top: 1px solid var(--border); z-index: 5; }
.dialog-actions .btn { min-height: 40px; }
#learnTypeHint, #rmKindHint { display: none; }
/* Focus remains explicit without decoration on resting controls. */
summary:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  #topbar { padding: 18px 16px 8px; }
  #tabs { padding: 6px 10px 10px; }
  main { padding: 22px 16px 64px; }
  .card { padding: 16px; margin-bottom: 18px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); }
  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); }
  dialog form { padding: 20px; max-height: calc(100dvh - 24px); }
  dialog h3 { font-size: var(--font-size-section); margin-bottom: 20px; }
  dialog input:not([type="checkbox"]):not([type="range"]), dialog textarea { font-size: var(--font-size-input); }
  .dialog-actions { bottom: -20px; gap: 6px; flex-wrap: wrap; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .dialog-actions .btn { min-height: 44px; padding-inline: 12px; }
  .form-section > summary, .page-section > summary { min-height: 44px; }
  #sourceSeg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .schedule-list-header { align-items: flex-start; }
}

.form-section[hidden] { display: none; }
.management-section .btn { font-size: var(--font-size-label); }

/* One add action opens the shared task form. */
.schedule-add-actions { display: flex; gap: 4px; align-items: center; }
.schedule-task-note, .project-task-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) {
  .schedule-list-header { flex-wrap: wrap; gap: 10px; }
}
