/* Widgets on Today and a project's Overview, and a project's view tabs (dashboards.js, docs/ARTIFACTS.md §7).
   Flat: hairlines between tiles, no boxed cards. Every colour is a console token, so light and dark both hold, and
   no state is told by colour alone: each carries a word and a shape. */

.dw-wrap { margin: 0 0 22px; }
.dw-head { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.dw-head .sp { flex: 1; }
.dw-from { font-size: 12.5px; }
.dw-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }

/* Four columns on a desktop: small is one, wide two, tall one column over two rows. */
.dw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(132px, auto); grid-auto-flow: row dense;
  gap: 0; border-left: 1px solid var(--line); }
.dw-tile { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-tile.s-wide { grid-column: span 2; }
.dw-tile.s-tall { grid-row: span 2; }
.dw-th { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.dw-th b { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.dw-th a { font-size: 12px; flex: none; }
.dw-grip { color: var(--text-3); cursor: grab; letter-spacing: -2px; flex: none; }
.dw-tools { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.dw-tools select { background: var(--ink-2); color: var(--text); border: 1px solid var(--control); border-radius: 4px; font: 12px var(--sans); padding: 2px 4px; }
.dw-tools .btn svg { width: 14px; height: 14px; }
.dw-editing .dw-tile { outline: 1px dashed var(--line-2); outline-offset: -4px; }
.dw-tile.dw-drag { opacity: .45; }
.dw-tile.dw-over { box-shadow: inset 2px 0 0 var(--canopy); }
.dw-none { padding: 14px 0; }

.dw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.dw-num { display: flex; flex-direction: column; gap: 2px; }
.dw-num b { font-size: 30px; line-height: 1.1; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dw-num.sm { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dw-num.sm b { font-size: 20px; }
.dw-num .dim { font-size: 12.5px; }
.dw-lv { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.dw-lv i { font-style: normal; }
.dw-lv.ok, .dw-status.ok i { color: var(--ok); }
.dw-lv.warn, .dw-status.warn i { color: var(--warn); }
.dw-lv.bad, .dw-status.bad i { color: var(--bad); }
.dw-status.idle i { color: var(--text-3); }
.dw-status { display: flex; align-items: center; gap: 12px; }
.dw-status i { font-style: normal; font-size: 22px; line-height: 1; }
.dw-status div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dw-status b { font-weight: 600; }
.dw-status .dim { font-size: 12.5px; }
.dw-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.dw-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.dw-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dw-list li .dim { flex: none; }
.dw-bars { width: 100%; height: 44px; display: block; }
.dw-bars rect { fill: var(--canopy); opacity: .8; }
.dw-bars line, .dw-line path { stroke: var(--line-2); }
.dw-line { width: 100%; height: 44px; display: block; }
.dw-line path { stroke: var(--canopy); stroke-width: 1.6; fill: none; vector-effect: non-scaling-stroke; }
.dw-hbars { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.dw-hb { display: grid; grid-template-columns: 72px 1fr 28px; align-items: center; gap: 8px; }
.dw-hb span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-hb i { height: 6px; background: var(--canopy); opacity: .8; display: block; border-radius: 1px; }
.dw-hb b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.dw-empty { color: var(--text-3); font-size: 12.5px; margin: 0; }
.dw-off { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.dw-off b { font-weight: 500; color: var(--text-2); }
.dw-off .dim { font-size: 12px; }
.dw-tile.off .dw-th b { color: var(--text-3); }
.dw-frame { flex: 1; min-height: 100px; display: flex; }
.dw-frame > .dim { margin: auto; font-size: 12px; }
.dw-frame iframe { flex: 1; width: 100%; min-height: 100px; border: 0; display: block; background: var(--ink-1); }
.dw-tile.s-tall .dw-frame iframe { min-height: 240px; }

.dw-people fieldset { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* A project's view tabs sit in the same strip as Tasks and Files. */
.prj-vtabs { display: contents; }
.prj-vtabs small { font-size: 11px; }
.prj-vtab-add { color: var(--text-3); }

@media (max-width: 1100px) { .dw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A phone: one column, in order; ↑ ↓ move a widget, there is no dragging. */
@media (max-width: 780px) {
  .dw-grid { grid-template-columns: minmax(0, 1fr); border-left: 0; }
  .dw-tile, .dw-tile.s-wide { grid-column: auto; border-right: 0; padding: 12px 0; }
  .dw-tile.s-tall { grid-row: auto; min-height: 220px; }
  .dw-head .btn { padding: 0 8px; }
}
