/* UniCirc Workspace 2 — start screens (/role, /home, /settings). Prefix: hm-.
   Small additions only; colours come from the variables in ws2.css (original dark look, purple glow for the suggested start).
   Also styles two shell parts made in ws2-ui.js (this file is always loaded): the role groups (.hm-rgs/.hm-rg in the role
   dialog and on /role) and the top-bar garment lookup (form#ws-find.hm-find). No new colour values.
   20 Nov: Home's "Supply chain transparency" group (hm-ch, hm-feed) for the store, head office and the contract manager. */

/* role groups by organisation (role dialog and /role) */
.hm-rgs { display: grid; gap: 18px; }
/* role picker: with 10 roles the list is long, so "Continue" stays visible at the bottom of the dialog (same colours as the dialog) */
.dlg:has(.hm-rgs) .dlg-bar { position: sticky; bottom: 0; z-index: 1; background: var(--bg-2); border-top: 1px solid var(--line-2); }
.hm-rg { display: grid; gap: 8px; min-width: 0; }
.hm-rg-h { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
html[data-lang="zh"] .hm-rg-h { font-family: var(--sans); letter-spacing: .04em; font-size: 14px; text-transform: none; }
.hm-rg > .hint { margin-top: -4px; }
/* in the dialog: up to 3 compact cards per row, so each organisation fits on one row (Hick, Fitts: less scrolling) */
.hm-rg .rcs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hm-rg .rc > span { padding: 12px 14px; gap: 4px; }
@media (max-width: 640px) { .hm-rg .rcs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .hm-rg .rcs { grid-template-columns: minmax(0, 1fr); } }

/* top bar: find a garment by its ID or RFID tag (every role) */
.hm-find { display: flex; align-items: center; gap: 2px; flex: 0 1 300px; min-width: 0; margin-left: 6px; }
.hm-find input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 15px; -webkit-appearance: none; appearance: none; }
.hm-find input::placeholder { color: var(--ink-3); }
.hm-find input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.hm-find .tb { flex: none; }
@media (max-width: 1080px) { .hm-find { flex-basis: 220px; } }
/* narrow screens: the search icon alone opens the lookup page (it has the big field and the examples) */
@media (max-width: 960px) { .hm-find { flex: none; margin-left: 0; } .hm-find input { display: none; } }

/* /role: five big role cards */
.hm-welcome { font-size: 17px; line-height: 1.6; max-width: 62ch; }
.hm-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.hm-rc-w { display: grid; gap: 10px; min-width: 0; }
.hm-rc { display: grid; gap: 8px; align-content: start; width: 100%; min-height: 176px; padding: 20px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: border-color .15s, background .15s; }
.hm-rc:hover { border-color: var(--ink-3); background: var(--surface-2); }
.hm-rc-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hm-rc-h .ic { width: 30px; height: 30px; color: var(--glow); }
.hm-rc-n { font-size: 18px; font-weight: 700; line-height: 1.3; }
.hm-rc-d { color: var(--ink-2); font-size: 14.5px; }
.hm-rc-o { color: var(--ink-3); font-size: 13px; }
.hm-rc-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.hm-rc-z { color: var(--ink-3); font-size: 13.5px; }
.hm-rc-why { color: var(--glow); font-size: 14px; }
.hm-rc.hm-sug { border-color: rgba(169, 156, 255, .6); box-shadow: 0 0 0 1px rgba(169, 156, 255, .3), 0 0 28px rgba(169, 156, 255, .14); }
.hm-rc.hm-cur { border-color: var(--ink); }
.hm-sites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hm-sites-l { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; }
.hm-site { width: 100%; padding: 0 12px; }
.hm-site.hm-site-on { border-color: var(--ink); }
.hm-site .badge { margin-left: 2px; }
.hm-howto { margin-top: 4px; }
.hm-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--ink-3); }
.hm-link:hover { text-decoration-color: var(--ink); }
.hm-link .ic { color: var(--glow); }

/* /home: to-do cards, one button each */
.hm-count { color: var(--ink-2); font-size: 14px; }
.hm-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hm-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center; padding: 14px 16px 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); }
.hm-task-t { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.hm-task-x { font-weight: 600; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-task-l { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-2); font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.hm-task-l:hover { color: var(--ink); }
.hm-task-a { display: flex; justify-content: flex-end; }
/* a long button label ("Approve: remove trims (buttons, zips, labels, logos)") wraps inside a column of at most 45 % of the
   card, so the to-do text keeps its room between 861 px and wide screens (phones stack the button below, see the media rule) */
.hm-task { grid-template-columns: minmax(0, 1fr) fit-content(45%); }
.hm-task-a { min-width: 0; }
.hm-task-a .b { max-width: 100%; white-space: normal; text-align: center; line-height: 1.3; padding-top: 8px; padding-bottom: 8px; }
.hm-task.hm-info { background: transparent; border-style: dashed; }
.hm-task.hm-info .hm-task-x { font-weight: 400; color: var(--ink-2); }
.hm-todo details.more { margin-top: 10px; }
/* a notice that comes first (head office intake, UniCirc resolve): the glow edge like the current menu item, and the short steps */
.hm-task.hm-notice { box-shadow: inset 3px 0 0 var(--glow); }
.hm-nsteps { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 14px; }
.hm-nsteps li { display: inline-flex; align-items: baseline; gap: 6px; }
.hm-nsteps b { font: 600 12px/1 var(--mono); color: var(--ink-3); }

/* UniCirc: grade C held for a full recycling batch */
.hm-batch { display: grid; gap: 10px; }
.hm-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); overflow: hidden; }
.hm-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--glow); }
.hm-done { padding: 24px 18px; }
.hm-done h3 { font: 700 22px/1.2 var(--mono); text-transform: uppercase; }
html[data-lang="zh"] .hm-done h3 { font-family: var(--sans); text-transform: none; }
.hm-done-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* in progress */
.hm-all { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.hm-all:hover { color: var(--ink); }

/* supply chain transparency (store, head office, contract manager): the three loops as rows, the latest 3 shared records */
.hm-ch { display: grid; gap: 16px; min-width: 0; }
.hm-ch-s { display: grid; gap: 8px; min-width: 0; }
.hm-ch-h { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
html[data-lang="zh"] .hm-ch-h { font-family: var(--sans); letter-spacing: .04em; font-size: 14px; text-transform: none; }
.hm-ch-c { gap: 4px; }
.hm-ch-c > span { color: var(--ink-2); font-size: 14.5px; }
.hm-ch-c small { color: var(--ink-3); font-size: 13px; }
.hm-ch .row-side small { text-align: right; }
.hm-feed { list-style: none; margin: 0; padding: 0; display: grid; }
.hm-feed li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--line-2); min-width: 0; }
.hm-feed li:first-child { border-top: 0; padding-top: 2px; }
.hm-feed time { color: var(--ink-3); font-size: 13.5px; white-space: nowrap; padding-top: 1px; }
.hm-feed-b { display: grid; gap: 2px; min-width: 0; justify-items: start; }
.hm-feed-w { font-size: 13.5px; color: var(--ink-2); }
.hm-feed-w .org { color: var(--ink-3); }
.hm-feed-x { font-size: 15px; overflow-wrap: anywhere; }
.hm-feed-r { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--ink-2); font-size: 14px; }
a.hm-feed-r { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
a.hm-feed-r:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* more about your work (closed by default): recently viewed + in numbers */
.hm-more { display: grid; gap: 22px; }
.hm-sub { display: grid; gap: 10px; min-width: 0; }
.hm-sub h3 { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
html[data-lang="zh"] .hm-sub h3 { font-family: var(--sans); letter-spacing: .04em; font-size: 14px; text-transform: none; }
.hm-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hm-recent a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 14.5px; }
.hm-recent a:hover { color: var(--ink); border-color: var(--ink-3); }
.hm-facts small { line-height: 1.4; }

/* /settings */
.hm-trash { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hm-trash-i { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); }
.hm-trash-t { display: grid; gap: 2px; min-width: 0; }
.hm-trash-t span { color: var(--ink-2); font-size: 14.5px; }
.hm-data { display: grid; gap: 10px; }
.hm-data-i { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); }
.hm-data-i.fld { grid-template-columns: minmax(0, 1fr); }
.hm-data-t { display: grid; gap: 4px; min-width: 0; }
.hm-data-i input[type=file] { cursor: pointer; }

@media (max-width: 860px) {
  .hm-roles { grid-template-columns: minmax(0, 1fr); }
  .hm-rc { min-height: 0; }
  .hm-task, .hm-trash-i, .hm-data-i { grid-template-columns: minmax(0, 1fr); }
  .hm-task-a, .hm-task-a > .bw, .hm-task-a > a.b, .hm-task-a .bw > .b { width: 100%; }
  .hm-task-a .b { white-space: normal; text-align: center; }
  /* the first card's white button sits in the thumb zone, like every page's main button (same values as .ph-act.has-primary in ws2.css) */
  .hm-task.hm-first .hm-task-a .b.primary.lg { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 35; width: auto; box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
  .hm-trash-i > .bw, .hm-trash-i > .bw > .b, .hm-data-i > .bw, .hm-data-i > .bw > .b { width: 100%; }
  .hm-done-acts { width: 100%; }
  .hm-done-acts > .b, .hm-done-acts > .bw { flex: 1 1 100%; }
  .hm-done-acts .b { white-space: normal; }
}
/* long status words wrap instead of pushing the page sideways at 390 px (same as .ro-rows) */
@media (max-width: 860px) {
  .hm-rows .row-side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
  .hm-rows .chip { white-space: normal; }
  .hm-ch .row-side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
  .hm-ch .row-side small { text-align: left; }
  .hm-ch .chip { white-space: normal; }
}
@media (max-width: 600px) { .hm-feed li { grid-template-columns: minmax(0, 1fr); } }
