/* W1 daily family (Today, Weekly Focus, Day close, Reconsider, capacity) on the Mihwar design system r51.
   Tokens, components, icons and states come only from the verbatim app/public/lifeos.css (W0). This file adds the
   page layout the boards express inline (today-grid 2 → 1 columns) and a few W1-prefixed helpers. No new colors:
   every value is a lifeos.css token. Breakpoints follow the boards: 1280/1024/768/640/390/375/360. */

.w1-today, .w1-weekly, .w1-dayclose { min-width: 0; }
.w1-min0 { min-width: 0; }
.w1-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
@media (max-width: 1279px) { .w1-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; } }
@media (max-width: 1023px) { .w1-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* hero tools */
.w1-today .hero .actions .w1-date .input { width: auto; min-height: 36px; padding-block: 4px; font-size: 14px; direction: ltr; }
.w1-date { display: inline-flex; align-items: center; }
.w1-date .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top three and task rows */
.w1-top3 { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.w1-today .task .w1-chk { margin-top: 6px; }
.w1-today .task.compact .w1-chk { margin-top: 2px; }
.w1-note { margin-top: 6px; }
.w1-pre { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.w1-small { font-size: 13px; }
.w1-today .task.is-unavailable .t { color: var(--ink-3); }

/* folded sections: the board's <details class="section"> with a plain summary row */
.w1-fold > summary { cursor: pointer; list-style: none; }
.w1-fold > summary::-webkit-details-marker { display: none; }
.w1-fold > summary .ic-chev-down { transition: transform var(--dur) var(--ease); }
.w1-fold[open] > summary .ic-chev-down { transform: rotate(180deg); }
.w1-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* «خيارات أخرى»: the board's more button opening a .menu; the same handlers, one tap away */
.w1-more { position: relative; display: inline-block; }
.w1-more > summary { list-style: none; cursor: pointer; }
.w1-more > summary::-webkit-details-marker { display: none; }
.w1-more > .menu { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; }
.w1-more > .menu button[disabled] { opacity: .5; cursor: not-allowed; }

/* capacity legend swatches (the board draws them inline) */
.w1-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.w1-sw.known { background: var(--accent); }
.w1-sw.buffer { background: var(--warn); }
.w1-sw.unknown { background: repeating-linear-gradient(135deg, var(--ink-3) 0 3px, transparent 3px 7px); }
.w1-sw.free { background: var(--surface-3); }
.cap .link { font-size: 13px; }
.w1-cap-edit .inline-form .field { flex: 1 1 140px; }

/* editors (session, follow-up, plan, time block): one calm panel above the day */
.w1-editor { box-shadow: var(--shadow-2); }
.w1-links .w1-link-option { cursor: pointer; height: auto; min-height: 30px; white-space: normal; }
.w1-links .w1-link-option input { margin: 0; accent-color: var(--accent); }

/* reconsider and day close rows */
.w1-rc { flex-wrap: wrap; align-items: flex-start; }
.w1-rc .grow { flex: 1 1 260px; }
.w1-rc .act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.w1-dc-row { flex-wrap: wrap; align-items: flex-start; padding: 14px 4px; }
.w1-dc-row .grow { flex: 1 1 260px; }
.w1-dc-choice { align-items: flex-end; }
.w1-dc-choice .seg { flex-wrap: wrap; }

/* weekly focus editor */
.w1-weekly .focus .w1-fi-edit { grid-template-columns: 34px minmax(0, 1fr); gap: 12px 14px; }
.w1-intent { font-weight: 600; font-size: 16px; }
.w1-chip-x { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: inherit; margin-inline-start: 2px; }
.w1-chip-x:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.w1-search { max-width: none; }
.w1-search input { flex: 1 1 60px; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 14.5px; outline: none; }
.w1-focus-mini { border-top: 1px solid var(--line); }
.w1-focus-mini .fi { padding: 8px 0; }
.w1-focus-mini .fi .n { font-size: 22px; }
.w1-focus-mini .fi .t { font-size: 14px; }

/* habits in detailed mode */
.w1-ruled { border-top: 1px solid var(--line); }

/* phone widths: 44px touch targets, actions under the title (the board's 390/375/360 frames) */
@media (max-width: 640px) {
  .w1-today .btn, .w1-weekly .btn, .w1-dayclose .btn, .w1-editor .btn, .w1-today .seg button, .w1-dayclose .seg button, .w1-weekly .seg button,
  .w1-more > summary, .w1-today .chip-btn { min-height: 44px; }
  .w1-today .btn-icon.btn-sm, .w1-more > summary.btn-icon { width: 44px; }
  .w1-today .chk, .w1-today .chk .box { width: 28px; height: 28px; }
  .w1-today .hero .actions { width: 100%; }
  .w1-more > .menu { inset-inline-end: auto; inset-inline-start: 0; max-width: calc(100vw - 32px); }
  .w1-rc .act, .w1-dc-choice { width: 100%; justify-content: flex-start; align-items: flex-start; }
  .w1-dc-choice .seg-sm button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .w1-fold > summary .ic-chev-down { transition: none; } }
