/* Workbench layout: readable summaries, natural page height, shared controls. */
.main:has(> .home-page) {
  width: 100%;
  max-width: 1640px;
  height: auto;
  min-height: 0;
  padding: 14px 24px 18px;
}
.home-page {
  --wb-ink: #243244;
  --wb-body: #435365;
  --wb-muted: #536273;
  --wb-border: #dce4eb;
  min-width: 0;
  height: auto;
  display: block;
  color: var(--wb-ink);
}
.home-page .home-heading {
  min-height: 0;
  margin-bottom: 12px;
  gap: 16px;
  align-items: flex-end;
}
.home-page .home-heading h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.6px; }
.home-page .home-heading p { font-size: 12px; line-height: 1.5; color: var(--wb-muted); margin-top: 3px; }
.home-page .home-heading p > span { color: #718093; }
.home-page .home-heading-actions { gap: 12px; font-size: 12px; }
.home-page .home-heading-actions .btn { font-size: 12px; min-height: 36px; }
.home-page .wb-local-label { font-size: 12px; color: var(--wb-muted); }
.home-page .wb-local-label .icon { width: 15px; height: 15px; }

.home-page .bento-grid {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(280px, auto) minmax(230px, auto) minmax(160px, auto);
  gap: 16px;
  align-items: start;
}
.home-page .wb-delivery { grid-column: 1 / 3; grid-row: 1; }
.home-page .wb-calendar { grid-column: 3; grid-row: 1 / 3; align-self: stretch; }
.home-page .wb-today-list { grid-column: 1; grid-row: 2; }
.home-page .wb-memos { grid-column: 2; grid-row: 2; }
.home-page .wb-overview { grid-column: 1; grid-row: 3; }
.home-page .wb-quick-add { grid-column: 2; grid-row: 3; }
.home-page .wb-projects { grid-column: 3; grid-row: 3; }

.home-page .wb-module {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: visible;
  border: 1px solid var(--wb-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 4px 18px #24324404;
}
.home-page .wb-module-head {
  min-height: 24px;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.home-page .wb-module-head h2 { font-size: 16px; line-height: 1.4; gap: 8px; letter-spacing: -.2px; color: var(--wb-ink); }
.home-page .wb-module-head h2 > .icon { width: 18px; height: 18px; color: #2459e8; }
.home-page .wb-count { font-size: 12px; line-height: 1.5; color: #4c5d70; background: #eef2f6; padding: 1px 6px; }
.home-page .wb-module .wb-link {
  min-height: 24px;
  padding: 2px 0;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 550;
  color: #2459e8;
  gap: 3px;
}
.home-page .wb-module .wb-link > .icon { width: 13px; height: 13px; }
.home-page .wb-module .btn.sm { min-height: 36px; padding: 7px 10px; font-size: 12px; line-height: 1.5; border-radius: 10px; }
.home-page .wb-module .btn.sm .icon { width: 15px; height: 15px; }
.home-page .wb-module .btn.sm.icon-only { width: 34px; min-height: 34px; padding: 6px; }
.home-page .wb-module .btn.ghost { color: var(--wb-muted); }
.home-page .wb-module button:focus-visible, .home-page .wb-module a:focus-visible, .home-page .wb-module input:focus-visible { outline: 3px solid #2459e8; outline-offset: 3px; }
.home-page .wb-followup-link { color: #775019; background: #fff5e3; }
.home-page .wb-module .tag { font-size: 12px; line-height: 1.5; padding: 2px 6px; color: #48586b; background: #edf2f6; border-radius: 6px; }
.home-page .wb-module .tag.doing, .home-page .wb-module .tag.blue { color: #244fba; background: #eaf1ff; }
.home-page .wb-module .tag.revision, .home-page .wb-module .tag.waiting, .home-page .wb-module .tag.purple { color: #6941a7; background: #f3edff; }
.home-page .wb-module .tag.done, .home-page .wb-module .tag.green { color: #24664d; background: #e8f5ed; }
.home-page .wb-module .tag.overdue, .home-page .wb-module .tag.urgent, .home-page .wb-module .tag.red { color: #9f332f; background: #fff0ed; }
.home-page .wb-module .tag .icon { width: 13px; height: 13px; }
.home-page .wb-empty { min-height: 0; flex: 0 1 auto; align-items: flex-start; justify-content: flex-start; gap: 9px; padding: 12px 0; }
.home-page .wb-empty-title { font-size: 14px; line-height: 1.5; color: var(--wb-ink); }
.home-page .wb-empty p { font-size: 13px; line-height: 1.7; color: var(--wb-muted); }
.home-page .wb-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.home-page .wb-quiet { font-size: 13px; line-height: 1.6; color: var(--wb-muted); }
.home-page .wb-today-label { font-size: 12px; color: var(--wb-muted); }

/* Dates and work records remain legible in six-week months. */
.home-page .wb-calendar { padding: 14px; }
.home-page .wb-month-nav { min-height: 32px; gap: 5px; margin-bottom: 8px; flex-shrink: 0; }
.home-page .wb-month-nav > span { font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--wb-ink); }
.home-page .wb-month-nav .btn.sm { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.home-page .wb-month-nav .btn.sm.icon-only { width: 32px; padding: 5px; }
.home-page .wb-month-nav .btn:last-child { margin-left: 4px; font-size: 12px; }
.home-page .wb-calendar-week { font-size: 12px; line-height: 1.5; color: var(--wb-muted); margin-bottom: 4px; }
.home-page .wb-calendar-cells {
  flex: 1 1 auto;
  min-height: calc(var(--wb-calendar-rows) * 32px + (var(--wb-calendar-rows) - 1) * 3px);
  max-height: 280px;
  grid-template-rows: repeat(var(--wb-calendar-rows), minmax(32px, 1fr));
  gap: 3px;
}
.home-page .wb-calendar-cell { min-height: 32px; font-size: 14px; line-height: 1.2; color: #435568; padding: 3px 2px; gap: 3px; border-radius: 9px; }
.home-page .wb-calendar-cell.is-weekend:not(.is-today):not(.is-selected) { color: #5c6878; }
.home-page .wb-calendar-cell.is-other { color: #667486; background: #f8fafc; }
.home-page .wb-calendar-cell.is-today { color: #2459e8; background: #eaf1ff; font-weight: 650; }
.home-page .wb-calendar-cell.is-selected { color: #1f4db5; border-color: #9bb7ee; background: #eef4ff; }
.home-page .wb-calendar-cell.is-today.is-selected { color: #fff; background: #2459e8; border-color: #2459e8; }
.home-page .wb-date-markers { height: 5px; gap: 3px; }
.home-page .wb-date-markers > i { width: 5px; height: 5px; }
.home-page .wb-calendar-legend { font-size: 12px; line-height: 1.5; gap: 5px 10px; margin: 6px 0 8px; color: var(--wb-muted); }
.home-page .wb-calendar-legend > span { gap: 5px; }
.home-page .wb-calendar-legend i { width: 5px; height: 5px; }
.home-page .wb-work-summary { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-color: #dce6eb; border-radius: 12px; background: #f6f9fb; }
.home-page .wb-selected-date { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; font-size: 12px; line-height: 1.5; color: var(--wb-muted); }
.home-page .wb-selected-date strong { color: var(--wb-ink); font-weight: 600; }
.home-page .wb-work-time { margin: 0; font-size: 14px; line-height: 1.5; color: #344f62; gap: 6px; }
.home-page .wb-work-time .icon { width: 15px; height: 15px; color: #386b5a; }
.home-page .wb-work-detail { font-size: 12px; line-height: 1.5; color: var(--wb-muted); overflow-wrap: anywhere; }
.home-page .wb-work-foot { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 10px; margin: 0; }
.home-page .wb-work-foot > span { display: block; flex: 1 1 160px; font-size: 12px; line-height: 1.65; color: var(--wb-muted); }
.home-page .wb-work-foot .btn { min-height: 34px !important; padding: 6px 9px !important; font-size: 12px !important; flex-shrink: 0; }
.home-page .wb-work-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 0; }
.home-page .wb-work-actions .btn { font-size: 12px; min-height: 34px; padding: 6px 9px; }

/* The first task summaries are readable; longer bodies have one deliberate scroll area. */
.home-page .wb-today-rows { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; max-height: 284px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; gap: 10px; padding-right: 2px; }
.home-page .wb-task-row { flex-shrink: 0; min-width: 0; padding: 11px; gap: 9px; border-color: #dce6ee; border-radius: 12px; background: #f7fafc; }
.home-page .wb-task-check { width: 22px; height: 22px; margin-top: 2px; border-color: #a4b4c2; color: #6d8093; border-radius: 6px; }
.home-page .wb-task-check .icon { width: 14px; height: 14px; }
.home-page .wb-task-info { min-width: 0; }
.home-page .wb-task-name { font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--wb-ink); }
.home-page .wb-task-project { margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--wb-muted); }
.home-page .wb-task-tags { margin-top: 6px; gap: 4px; }
.home-page .wb-task-tags .tag { font-size: 12px; line-height: 1.5; padding: 2px 5px; }
.home-page .wb-task-tags button.tag { min-height: 25px; }
.home-page .wb-module .wb-task-more { min-height: 32px; width: 28px; padding: 4px; color: #536273; }
.home-page .wb-list-footer { flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 4px; margin-top: 0; font-size: 12px; line-height: 1.5; color: var(--wb-muted); }
.home-page .wb-list-footer > .wb-link { min-height: 24px; font-size: 12px; }
.home-page .wb-plan-note, .home-page .wb-plan-prompt { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid #e6dfd2; border-radius: 10px; background: #f8f6f0; color: #625a49; font-size: 12px; line-height: 1.6; }
.home-page .wb-plan-note button, .home-page .wb-plan-prompt button { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 3px 0; margin-left: auto; background: transparent; color: #2459e8; font-size: 12px; font-weight: 550; }
.home-page .wb-plan-prompt strong { font-size: 13px; color: #514b3e; }
.home-page .wb-plan-prompt { margin: 0; padding: 6px 10px; gap: 4px 8px; }
.home-page .wb-plan-prompt .btn { min-height: 28px; padding: 3px 6px; margin-left: auto; }
.home-page .wb-today-list .wb-empty { gap: 6px; padding: 4px 0; }
.home-page .wb-today-list .wb-empty-actions { margin-top: 0; }

/* Planned hours and their meaning sit together, rather than against the card edges. */
.home-page .wb-overview .wb-module-head { margin-bottom: 4px; }
.home-page .wb-workload { gap: 9px; align-items: center; }
.home-page .wb-workload > strong { font-size: 32px; font-weight: 650; line-height: 1.1; color: var(--wb-ink); }
.home-page .wb-workload > strong small { font-size: 14px; color: var(--wb-muted); }
.home-page .wb-workload > span { font-size: 16px; line-height: 1.3; color: var(--wb-muted); }
.home-page .wb-workload > span small { display: block; font-size: 12px; line-height: 1.4; margin-top: 0; color: var(--wb-muted); }
.home-page .wb-load-track { height: 4px; margin-top: 4px; background: #e7edf2; }
.home-page .wb-load-caption { margin-top: 3px; font-size: 12px; line-height: 1.5; color: #396953; }
.home-page .wb-load-caption.is-over { color: #a13832; }
.home-page .wb-overview-stats { margin-top: 6px; padding-top: 5px; gap: 8px; border-top: 1px solid #e7edf2; }
.home-page .wb-overview-stats > div { gap: 4px; }
.home-page .wb-overview-stats > div + div { padding-left: 10px; border-color: #e0e7ee; }
.home-page .wb-overview-stats strong { font-size: 16px; line-height: 1.25; color: var(--wb-ink); }
.home-page .wb-overview-stats strong small { font-size: 12px; color: var(--wb-muted); }
.home-page .wb-overview-stats span { font-size: 12px; line-height: 1.5; color: var(--wb-muted); }
.home-page .wb-overview-stats > span { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 6px; }

/* Memo text uses the complete card width; the action sits below the summary. */
.home-page .wb-memos { display: flex; flex-direction: column; }
.home-page .wb-memo-content { min-width: 0; min-height: 0; max-height: 224px; overflow-y: auto; scrollbar-width: thin; }
.home-page .wb-memos .ext-memo-list { display: flex; flex-direction: column; gap: 9px; }
.home-page .wb-memos .ext-memo-card { padding: 10px 12px; gap: 4px; border-color: #dce6ee; border-radius: 11px; background: #f7fafc; }
.home-page .wb-memos .ext-memo-title { min-width: 0; font-size: 14px !important; line-height: 1.5; font-weight: 600; color: var(--wb-ink); }
.home-page .wb-memos .ext-memo-text { display: -webkit-box; -webkit-box-orient: vertical; white-space: pre-wrap; text-overflow: clip; overflow: hidden; font-size: 13px; line-height: 1.55; margin-top: 4px; color: var(--wb-body); -webkit-line-clamp: 2; }
.home-page .wb-memos .ext-memo-text.is-main { margin-top: 0; font-size: 14px; line-height: 1.55; font-weight: 500; color: var(--wb-ink); -webkit-line-clamp: 3; }
.home-page .wb-memos .ext-memo-meta { max-height: none; overflow: visible; font-size: 12px; line-height: 1.5; margin-top: 5px; color: var(--wb-muted); }
.home-page .wb-memo-footer { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; padding-top: 0; }
.home-page .wb-memo-footer > span { max-width: none; font-size: 12px; line-height: 1.5; color: var(--wb-muted); text-align: left; }
.home-page .wb-memo-footer .btn { min-height: 34px !important; padding: 6px 9px !important; font-size: 12px !important; }
.home-page .wb-memos .wb-empty { min-height: 0; padding: 8px 0; }
.home-page .wb-memos .wb-empty-title { font-size: 14px; }
.home-page .wb-memos .wb-empty p { font-size: 13px; }

/* Project rows expose counts, known hours, and the next step at the same text scale. */
.home-page .wb-project-previews { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; gap: 6px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.home-page .wb-project-preview { position: relative; display: grid; flex-shrink: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; min-width: 0; min-height: 0; padding: 6px 10px; border-radius: 11px; background: #f7fafc; border-color: #dce6ee; }
.home-page .wb-project-preview > strong { grid-column: 1; grid-row: 1; font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--wb-ink); -webkit-line-clamp: 2; }
.home-page .wb-project-title { display: flex; grid-column: 1 / -1; align-items: flex-start; justify-content: space-between; gap: 5px 8px; min-width: 0; }
.home-page .wb-project-title strong { min-width: 0; overflow-wrap: anywhere; color: var(--wb-ink); font-size: 14px; font-weight: 600; line-height: 1.3; }
.home-page .wb-project-title > span { flex-shrink: 0; color: var(--wb-muted); font-size: 12px; line-height: 1.4; }
.home-page .wb-project-title > .tag { padding-top: 1px; padding-bottom: 1px; line-height: 1.3; }
.home-page .wb-project-title > .tag.overdue { color: #9f332f; }
.home-page .wb-project-symbol { display: flex; grid-column: 2; grid-row: 1; align-self: start; align-items: center; gap: 4px; margin: 0; color: #59738d; }
.home-page .wb-project-symbol > .icon { width: 16px; height: 16px; }
.home-page .wb-project-symbol > span { padding: 2px 5px; font-size: 12px; line-height: 1.4; color: #963c35; background: #fff0ed; }
.home-page .wb-project-client { display: block; grid-column: 1 / -1; font-size: 12px; line-height: 1.5; margin: 0; color: var(--wb-muted); }
.home-page .wb-project-progress { display: block; grid-column: 1 / -1; height: 4px; margin: 3px 0 0; }
.home-page .wb-project-completion { display: block; grid-column: 1 / -1; font-size: 12px; line-height: 1.5; margin: 0; color: var(--wb-muted); }
.home-page .wb-project-numbers { display: flex; grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 3px 12px; margin: 0; font-size: 12px; line-height: 1.5; color: var(--wb-body); white-space: normal; }
.home-page .wb-project-next { display: -webkit-box; grid-column: 1 / -1; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3; color: var(--wb-body); }
.home-page .wb-project-open { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; margin: 3px 0 0; padding-top: 4px; font-size: 12px; line-height: 1.5; color: #2459e8; }
.home-page .wb-project-footer { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-top: 4px; padding-top: 0; }
.home-page .wb-project-footer > span { font-size: 12px; line-height: 1.5; color: var(--wb-muted); }
.home-page .wb-project-footer .wb-link { font-size: 12px; min-height: 28px; }

/* Quick capture is an actual form with normal-size input and one submit action. */
.home-page .wb-quick-add .wb-module-head { margin-bottom: 10px; }
.home-page .wb-add-body { display: flex; flex: 0 1 auto; align-items: flex-start; justify-content: flex-start; gap: 8px; min-height: 0; }
.home-page .wb-add-body > p { font-size: 14px; line-height: 1.5; color: var(--wb-ink); }
.home-page .wb-add-body > span { font-size: 12px; line-height: 1.6; color: var(--wb-muted); }
.home-page .wb-add-body > .btn { min-height: 38px; padding: 8px 12px; margin-top: 2px; font-size: 13px; }
.home-page .wb-capture-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
.home-page .wb-capture-form > label { font-size: 13px; font-weight: 550; line-height: 1.5; color: var(--wb-body); }
.home-page .wb-capture-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; width: 100%; }
.home-page .wb-capture-form input { min-width: 0; min-height: 40px; padding: 8px 11px; font-size: 14px; line-height: 1.5; border-color: #acbac8; border-radius: 10px; color: var(--wb-ink); }
.home-page .wb-capture-form input::placeholder { color: #667588; opacity: 1; }
.home-page .wb-capture-form .btn, .home-page .wb-capture-form button[type="submit"] { min-height: 40px; padding: 8px 12px; font-size: 13px; line-height: 1.5; }
.home-page .wb-capture-form > p, .home-page .wb-capture-form > small, .home-page .wb-capture-form > .field-error { grid-column: 1 / -1; font-size: 12px; line-height: 1.5; color: var(--wb-muted); }
.home-page .wb-capture-form .field-error { color: #9f332f; }
.home-page .wb-capture-form .form-error { margin: 0; font-size: 12px; line-height: 1.5; color: #9f332f; }
.home-page .wb-capture-form .form-error:empty { display: none; }

/* Page scrolling preserves text size when a desktop window becomes smaller. */
@media (min-width: 1500px) {
  .main:has(> .home-page) { padding-top: 14px; }
  .home-page .bento-grid { gap: 18px; }
}
@media (max-width: 1179px) {
  .main:has(> .home-page) { padding: 22px; }
  .home-page .bento-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto; gap: 16px; }
  .home-page .wb-delivery { grid-column: 1 / 3; grid-row: 1; }
  .home-page .wb-calendar { grid-column: 1; grid-row: 2; align-self: start; }
  .home-page .wb-today-list { grid-column: 2; grid-row: 2; }
  .home-page .wb-memos { grid-column: 1; grid-row: 3; }
  .home-page .wb-overview { grid-column: 2; grid-row: 3; }
  .home-page .wb-quick-add { grid-column: 1; grid-row: 4; }
  .home-page .wb-projects { grid-column: 2; grid-row: 4; }
  .home-page .wb-calendar-cells { flex: 0 1 auto; }
}
@media (max-width: 759px) {
  .main:has(> .home-page) { padding: 20px 16px 28px; }
  .home-page .home-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .home-page .home-heading h1 { font-size: 26px; }
  .home-page .home-heading p { font-size: 13px; max-width: none; }
  .home-page .home-heading-actions { width: 100%; }
  .home-page .home-heading-actions .wb-local-label { display: flex; }
  .home-page .bento-grid { display: flex; flex-direction: column; gap: 14px; }
  .home-page .bento-grid > .wb-module { width: 100%; grid-column: auto; grid-row: auto; min-height: 0; }
  .home-page .wb-delivery { order: 1; }
  .home-page .wb-calendar { order: 2; }
  .home-page .wb-today-list { order: 3; }
  .home-page .wb-overview { order: 4; }
  .home-page .wb-memos { order: 5; }
  .home-page .wb-projects { order: 6; }
  .home-page .wb-quick-add { order: 7; }
}
