.work-portfolio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.wp-heading, .wp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.wp-heading { justify-content: space-between; }
.wp-heading h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); line-height: 1.18; letter-spacing: -.025em; }
.wp-heading p { margin: 5px 0 0; font-size: 13px; color: var(--mut); }
.wp-actions button { min-height: 44px; font-weight: 650; }
.wp-filters { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, .55fr) minmax(0, .75fr) minmax(0, .85fr) minmax(0, .9fr) auto; gap: 8px; align-items: end; }
.wp-filters label { display: grid; min-width: 0; gap: 4px; margin: 0; }
.wp-filters input:not([type="checkbox"]), .wp-filters select { min-width: 0; width: 100%; min-height: 44px; }
.wp-filters .wp-archive { display: flex; align-items: center; min-height: 44px; padding-inline: 8px; }
.wp-table, .wp-empty { border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.wp-table { overflow-x: auto; }
.wp-table table { table-layout: fixed; }
.wp-table th, .wp-table td { padding: 7px 10px; vertical-align: top; white-space: normal; }
.wp-table thead th { background: var(--tint); color: var(--ink); }
.wp-table thead th:first-child { width: 27%; }
.wp-table thead th:nth-child(2) { width: 21%; }
.wp-table thead th:nth-child(3) { width: 16%; }
.wp-entry > * { overflow-wrap: anywhere; }
.wp-month td { background: var(--bg); }
.wp-table tr:last-child > * { border-bottom: 0; }
.wp-table tbody tr:hover { background: var(--bg); }
.wp-table small { display: block; color: var(--mut); font-weight: 400; font-size: 12px; }
.wp-open { display: block; min-height: 32px; background: transparent; color: var(--pri); text-align: left; padding: 2px 0; line-height: 1.35; font-weight: 750; font-size: 14px; overflow-wrap: anywhere; }
.wp-open:hover { text-decoration: underline; }
.wp-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.wp-status strong { font-variant-numeric: tabular-nums; }
.wp-table .bar { height: 5px; }
.wp-metrics { margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.wp-metrics div { display: flex; justify-content: space-between; gap: 8px; }
.wp-metrics dt { color: var(--mut); }
.wp-metrics dd { white-space: nowrap; margin: 0; font-weight: 700; }
.wp-empty { padding: 24px; }
.wp-empty p { margin: 4px 0 0; color: var(--mut); }
.work-portfolio :focus-visible { outline: 2px solid var(--pri); outline-offset: -2px; }
@media (max-width: 800px) {
  .wp-table :is(table, tbody) { display: block; }
  .wp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wp-entry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding: 4px 0; }
  .wp-entry > th { grid-column: 1 / -1; text-align: left; }
  .wp-table .wp-entry > * { padding: 4px 9px; border: 0; }
  .wp-open { min-height: 44px; }
  .wp-month, .wp-month td { display: block; }
  .wp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wp-filters label:first-child { grid-column: 1 / -1; }
  .wp-filters .wp-archive { padding-inline: 0; }
}

main:has(.wk-layout) { max-width: 1440px; }
.wk-layout {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 14px;
}
.wk-views {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.wk-views-title { padding: 4px 10px 8px; color: var(--mut); font-size: 13px; font-weight: 650; }
#wkTabs { display: grid; gap: 2px; }
#wkTabs button {
  min-height: 44px;
  padding: 7px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
#wkTabs button:hover { background: var(--surface-soft); }
#wkTabs button.on {
  background: var(--tint);
  color: var(--pri);
  box-shadow: inset 3px 0 var(--brand-lime);
  font-weight: 700;
}
.wk-view-picker { display: none; }
.wk-content { min-width: 0; }
#wkF { margin-top: 0; }

@media (max-width: 760px) {
  .wk-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wk-views { position: static; max-height: none; padding: 8px 12px; }
  .wk-views-title, #wkTabs { display: none; }
  .wk-view-picker { display: grid; gap: 4px; margin: 0; }
  .wk-view-picker select { width: 100%; min-width: 0; min-height: 44px; }
}

.wk-cal-toolbar, .wk-cal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wk-cal-toolbar { justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.wk-cal-toolbar h3 { margin: 0; font-size: 20px; }
.wk-cal-actions button { min-width: 44px; min-height: 44px; }
.wk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-content: start;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
}
.wk-cal-weekday, .wk-cal-outside { background: var(--surface-soft); }
.wk-cal-weekday { padding: 7px 0; text-align: center; color: var(--mut); font-size: 13px; font-weight: 650; }
.wk-cal-day, .wk-cal-outside { min-height: 104px; min-width: 0; }
.wk-cal-day { padding: 4px; background: var(--card); }
.wk-cal-day.is-today { background: var(--tint); box-shadow: inset 0 2px var(--brand-lime); }
.wk-cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.wk-cal-date, .wk-cal-add.ghost, .wk-cal-more {
  padding: 2px 5px;
  min-height: 28px;
  background: transparent;
  color: var(--pri);
  font-size: 13px;
}
.wk-cal-date { font-weight: 750; }
.wk-cal-add.ghost { min-width: 28px; border-color: transparent; }
.wk-cal-date:hover, .wk-cal-add.ghost:hover, .wk-cal-more:hover { background: var(--surface-soft); }
.wk-cal-count { display: none; }
.wk-cal-items { display: grid; gap: 3px; min-width: 0; }
.wk-cal-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
}
.wk-cal-task.is-doing { background: var(--tint); color: var(--pri); }
.wk-cal-task.is-done { background: var(--okbg); color: var(--ok); }
.wk-cal-task.is-late { background: var(--badbg); color: var(--bad); }
.wk-cal-task:hover { text-decoration: underline; }
.wk-cal-more { justify-self: start; font-size: 12px; }
.wk-cal-hint { margin: 8px 0; }
#wk-cal-add-dialog { margin-top: 8px; }

@media (max-width: 760px) {
  .wk-cal-day, .wk-cal-outside { min-height: 52px; }
  .wk-cal-day { padding: 0; }
  .wk-cal-add.ghost, .wk-cal-items { display: none; }
  .wk-cal-date { display: grid; place-content: center; width: 100%; min-height: 52px; padding: 2px; }
  .wk-cal-count { display: block; font-size: 11px; font-weight: 650; color: var(--mut); }
}

.st-dashboard { display: grid; gap: 14px; }
.st-dashboard h2, .st-dashboard .row, .st-dashboard .grid { margin: 0; }
.st-dashboard h2 { font-size: clamp(22px, 3vw, 30px); }
.st-dashboard .card h3 { color: var(--ink); font-size: 15px; }
.st-filters :is(select, button), .st-report-actions button { min-height: 44px; max-width: 100%; }
.st-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.st-kpis .v { font-size: clamp(18px, 2vw, 24px); overflow-wrap: anywhere; }
.st-analysis { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); align-items: start; gap: 12px; }
.st-chart { height: 260px; }
#stFind { width: 100%; min-height: 44px; }
#stFound { margin-top: 10px; overflow-wrap: anywhere; }
.st-lookup-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.st-sales :is(td, th), .st-table-summary :is(td, th) { white-space: normal; overflow-wrap: anywhere; }
.card.st-report { padding: 0; }
.st-report-head, .st-report-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-report-head { justify-content: space-between; padding: 10px 12px; }
.st-report-head h3 { margin: 0; }
.st-report-actions [aria-pressed="true"] { background: var(--tint); }
.st-table-scroll { max-height: 65vh; overflow: auto; }
.st-table-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.st-table-summary { table-layout: fixed; }
.st-table-summary thead th:first-child { width: 36%; }
.st-table-full tbody td:nth-child(2) { min-width: 220px; }
.st-report .mrow :is(td, th) { background: var(--surface-soft); font-weight: 650; }
.st-report .total :is(td, th) { position: static; background: var(--tint); font-weight: 750; }
.st-tour { background: transparent; color: var(--pri); text-align: left; padding: 2px 0; font-weight: 700; }
.st-tour:hover { text-decoration: underline; }
.st-month.ghost { border-color: transparent; padding: 4px 0; text-align: left; }
.st-month small { color: var(--mut); }

@media (max-width: 710px) {
  .st-analysis { grid-template-columns: minmax(0, 1fr); }
  .st-dashboard .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .st-sales :is(td, th) { padding-inline: 3px; font-size: 11px; }
  .st-table-summary :is(td, th) { padding-inline: 4px; font-size: 12px; }
  .st-table-summary thead th:first-child { width: 42%; }
  .st-table-summary :is(td, th):nth-child(n+4) { display: none; }
}
