/* Crosscut Hub — Settings (v0.47). A sidebar of pages on a computer, the same list as a drill-down on a phone.
   Markup: hub-settings.js. Colours come from the theme variables, so light and dark both work. */
.st { display: grid; grid-template-columns: 288px minmax(0, 1fr); align-items: start; }
.st [hidden] { display: none !important; }
.st-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- sidebar ---- */
.st-side { position: sticky; top: calc(var(--nav-h) + 12px); max-height: calc(100vh - var(--nav-h) - 24px); overflow: auto; overscroll-behavior: contain; padding: 2px 16px 32px 2px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.st-h1 { font-family: var(--text); text-transform: none; letter-spacing: -.02em; font-size: 24px; font-weight: 700; margin: 0 0 6px 8px; }
.st-search { position: relative; display: block; margin-bottom: 6px; }
.st-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.st-search input { width: 100%; padding: 9px 12px 9px 34px; font-size: 14px; background: var(--paper); }
.st-me { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); text-decoration: none; color: inherit; margin-bottom: 4px; }
.st-me .avatar { width: 40px; height: 40px; border-radius: 50%; font-size: 14px; pointer-events: none; }
.st-me b { display: block; font-size: 15px; color: var(--charcoal); }
.st-me small { display: block; font-size: 12.5px; color: var(--muted); }
.st-me.on { box-shadow: inset 0 0 0 2px var(--orange), var(--shadow); }
.st-att { display: none; }
.st-gh { padding: 14px 10px 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.st-nav-g { display: flex; flex-direction: column; gap: 1px; }
.st-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.st-item:hover { background: var(--fill); }
.st-item.on { background: var(--fill-2, var(--fill)); color: var(--charcoal); font-weight: 600; }
.st-item svg.i { color: var(--muted); flex: none; }
.st-item.on svg.i { color: var(--orange); }
.st-il { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-il .st-hit, .st-me .st-hit { font-size: 12px; font-weight: 400; color: var(--muted); }
.st-sum, .st-chev { display: none; }
.st-bdg { display: contents; }
.st-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #231f1a; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.st-draft { padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); font-size: 11px; font-weight: 700; line-height: 17px; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }
.st-none { margin: 10px; font-size: 13.5px; color: var(--muted); }

/* ---- the open page ---- */
.st-page { min-width: 0; padding: 4px 0 72px 40px; }
.st-inner { max-width: 720px; display: flex; flex-direction: column; gap: 26px; }
.st-head { display: flex; flex-direction: column; gap: 6px; }
.st-head h1 { font-family: var(--text); text-transform: none; letter-spacing: -.02em; font-size: 28px; font-weight: 700; }
.st-lead { margin: 0; max-width: 62ch; font-size: 14.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.st-back { display: none; align-self: flex-start; align-items: center; gap: 2px; color: var(--orange-2); font-weight: 600; font-size: 15px; text-decoration: none; padding: 6px 8px 6px 0; min-height: 40px; }
.st-back.sub { display: inline-flex; }
.st-savebar { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; margin: -10px 0; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-hi, var(--shadow)); }
.st-savebar span { flex: 1; font-size: 13.5px; color: var(--muted); }

.st-grp { display: flex; flex-direction: column; gap: 8px; }
.st-grp > h3 { font-family: var(--text); text-transform: none; letter-spacing: .01em; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0; padding: 0 16px; }
.st-card { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.st-card > * + *, .st-sub > * + * { border-top: 1px solid var(--line); }
.st-foot { margin: 0; padding: 0 16px; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.st-foot a, .st-note a { color: var(--orange-2); }
.st-foot code, .st-note code, .st-key code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.st-row { display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 6px 16px; color: inherit; text-decoration: none; }
.st-l { flex: 0 0 210px; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; color: var(--charcoal); }
.st-l small { font-size: 12px; color: var(--muted); }
.st-l b { font-weight: 600; }
.st-row > input, .st-row > select { flex: 1; min-width: 0; border: 0; background: transparent; text-align: right; padding: 9px 10px; font-size: 14.5px; color: var(--ink); box-shadow: none; }
.st-row > input:focus, .st-row > select:focus { box-shadow: var(--focus); }
.st-row > input:disabled { opacity: .6; }
.st-suf { flex: none; font-size: 14px; color: var(--muted); }
.st-warn-ic { color: var(--orange-2); flex: none; }
.st-stack { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 16px 14px; }
.st-stack .st-l { flex: none; }
.st-stack textarea { width: 100%; font-size: 14.5px; line-height: 1.45; resize: vertical; background: var(--ground); }
.st-tog .st-l { flex: 1; }
.st-switch { appearance: none; -webkit-appearance: none; position: relative; width: 46px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--fill-2, #d9d4cb); flex: none; cursor: pointer; transition: background .2s; }
.st-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .2s; }
.st-switch:checked { background: var(--orange); }
.st-switch:checked::after { left: 21px; }
.st-switch:focus-visible { outline: none; box-shadow: var(--focus); }
.st-switch:disabled { opacity: .5; cursor: default; }
.st-segrow { flex-wrap: wrap; gap: 10px 16px; padding: 8px 16px; }
.st-segrow .st-l { flex: 1 1 160px; }
.st-segw { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fill-2, var(--fill)); }
.st-segw label { position: relative; }
.st-segw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.st-segw span { display: block; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.st-segw input:checked + span { background: var(--paper); color: var(--charcoal); box-shadow: 0 1px 4px rgba(0, 0, 0, .16); }
.st-segw input:focus-visible + span { box-shadow: var(--focus); }
.st-segw input:disabled { cursor: default; } .st-segw input:disabled + span { opacity: .55; }
.st-nav { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.st-nav:hover { background: var(--fill); }
.st-nav .st-l { flex: 1; }
.st-val { flex: none; font-size: 14px; color: var(--muted); text-align: right; }
.st-val.warn { color: var(--orange-2); } .st-val.ok { color: var(--green); font-weight: 600; }
.st-rchev { color: var(--muted); opacity: .7; flex: none; }
.st-clause small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-btns { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.st-btns .btn { text-decoration: none; }
.btn.st-danger { color: var(--red); }
.st-free { display: block; padding: 12px 16px; }
.st-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; font-size: 14px; }
.st-line + .st-line { margin-top: 10px; }
.st-line > span:first-child { flex: 1 1 220px; min-width: 0; }
.st-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.st-mono { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.st-steps { margin: 0 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.st-info .st-l { flex: 0 0 170px; }
.st-v { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); text-align: right; text-wrap: pretty; overflow-wrap: anywhere; }
.st-status { align-items: center; }
.st-sv { flex: 1; min-width: 0; display: flex; gap: 16px; align-items: baseline; }
.st-sv b { flex: 0 0 150px; font-weight: 400; font-size: 14.5px; color: var(--charcoal); }
.st-sv span { flex: 1; font-size: 14px; color: var(--muted); text-wrap: pretty; overflow-wrap: anywhere; }
.st-tone { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: #8a857c; vertical-align: middle; }
.st-tone.ok { background: var(--green); } .st-tone.wait { background: #d29922; } .st-tone.bad { background: var(--red); }
.st-tone.ring { background: transparent; box-shadow: inset 0 0 0 2px var(--red); }
.st-warnrow { align-items: flex-start; padding: 12px 16px; background: color-mix(in srgb, var(--orange) 10%, transparent); font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.st-warnrow .st-warn-ic { margin-top: 2px; }
.st-todo { align-items: flex-start; padding: 14px 16px; }
.st-todo .st-l { flex: 1; }
.st-todo .st-l span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.st-ic { width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange-2); display: grid; place-items: center; flex: none; }
.st-todo .btn { flex: none; text-decoration: none; }
.st-person { min-height: 66px; padding: 10px 12px 10px 16px; }
.st-person:hover { background: var(--fill); }
.st-person .avatar { width: 38px; height: 38px; border-radius: 50%; pointer-events: none; }
.st-person .st-l { flex: 1; }
.st-person em { font-style: normal; font-weight: 400; color: var(--muted); }
.st-seen { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.st-warntxt { font-size: 12.5px; color: var(--orange-2); }
.st-chiprow { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
.st-chiprow .st-l { flex: none; flex-direction: row; align-items: center; gap: 8px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 11px; border-radius: 999px; background: var(--fill); font-size: 13px; color: var(--charcoal); }
.st-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.st-chip button:hover { background: var(--fill-2, var(--line)); color: var(--charcoal); }
.st-chipadd { display: inline-flex; gap: 6px; }
.st-chipadd input { width: 170px; padding: 6px 10px; font-size: 13.5px; }
.st-mach { min-height: 68px; padding: 10px 16px; gap: 14px; }
.st-mach .st-l { flex: 1; }
.st-mach .ph { position: relative; width: 48px; height: 48px; border-radius: 10px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; background-size: cover; background-position: center; }
.st-mach .ph.has { border: 0; } .st-mach .ph.has svg { display: none; }
.st-rate { display: flex; align-items: center; gap: 2px; width: 124px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); flex: none; color: var(--muted); }
.st-rate input { border: 0; background: transparent; padding: 8px 0; text-align: right; width: 100%; min-width: 0; box-shadow: none; font-variant-numeric: tabular-nums; color: var(--charcoal); }
.st-rate:focus-within { box-shadow: var(--focus); border-color: var(--orange); }
.st-preview { background: #f3f1ed; color: #232221; border-radius: 10px; padding: 16px 18px; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.st-lineedit { padding: 4px 8px 4px 16px; gap: 8px; }
.st-lineedit input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 4px; font-size: 14.5px; color: var(--charcoal); box-shadow: none; }
.st-lineedit input:focus { box-shadow: var(--focus); }
.st-iconbtn { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.st-iconbtn:hover { background: var(--fill); color: var(--charcoal); }
.st-find svg { color: var(--muted); flex: none; }
.st-find input { text-align: left !important; }
.st-numrow .st-l { flex: 1; }
.st-key { min-height: 42px; gap: 12px; }
.st-key code { flex: 1; color: var(--charcoal); }
.st-immsg { font-size: 12.5px; flex: 1 1 100%; }
.st-scroll { overflow-x: auto; }
.st-computer { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 20px 22px; }
.st-computer svg { color: var(--orange-2); }
.st-computer b { font-size: 17px; color: var(--charcoal); }
.st-computer span { font-size: 14.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.st-phone-only { display: none; }

/* Sales, ops and crew: just their own page, full width. */
.st-solo { display: block; }
.st-solo .st-page { padding-left: 0; }

/* ---- phone: the list, then one page at a time ---- */
@media (max-width: 899px) {
  .st { display: block; }
  .st-side { position: static; max-height: none; overflow: visible; border: 0; padding: 0 0 24px; gap: 16px; }
  .st-h1 { font-size: 32px; margin: 2px 4px 0; }
  .st-search input { height: 42px; font-size: 16px; }
  .st-me { min-height: 74px; margin: 0; }
  .st-me .avatar { width: 50px; height: 50px; font-size: 17px; }
  .st-me b { font-size: 17px; }
  .st-chev { display: block; color: var(--muted); opacity: .7; flex: none; }
  .st-att { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--orange) 13%, transparent); text-decoration: none; font-weight: 600; font-size: 16px; color: var(--charcoal); }
  .st-att span:nth-child(2) { flex: 1; }
  .st-g { display: flex; flex-direction: column; gap: 7px; }
  .st-gh { padding: 0 14px; font-size: 13px; }
  .st-nav-g { gap: 0; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
  .st-item { min-height: 50px; border-radius: 0; padding: 6px 12px 6px 14px; font-size: 16px; gap: 12px; }
  .st-item + .st-item { border-top: 1px solid var(--line); }
  .st-item.on { background: transparent; font-weight: 400; color: var(--ink); }
  .st-item.on svg.i { color: var(--muted); }
  .st-item[data-id="overview"] { display: none; }
  .st-g:has(.st-item[data-id="overview"]) { display: none; }
  .st-sum { display: block; font-size: 15px; color: var(--muted); white-space: nowrap; }
  .st-sum.warn { color: var(--orange-2); }
  .st-bdg { display: none; }
  .st.st-open .st-side { display: none; }
  .st.st-root .st-page { display: none; }
  .st-page { padding: 0 0 56px; }
  .st-back { display: inline-flex; }
  .st-inner { gap: 22px; }
  .st-head h1 { font-size: 30px; }
  .st-savebar { top: calc(var(--nav-h) + 6px); }
  .st-row { padding: 4px 14px; min-height: 50px; gap: 10px; }
  .st-l { flex: 0 0 42%; font-size: 16px; }
  .st-row > input, .st-row > select { font-size: 16px; padding: 9px 4px; }
  .st-stack, .st-chiprow { padding: 12px 14px; }
  .st-stack .st-l, .st-chiprow .st-l { flex: none; }
  .st-stack textarea { font-size: 16px; }
  .st-tog .st-l, .st-nav .st-l, .st-person .st-l, .st-mach .st-l, .st-numrow .st-l, .st-todo .st-l { flex: 1; }
  .st-switch { width: 51px; height: 31px; } .st-switch::after { width: 27px; height: 27px; top: 2px; left: 2px; } .st-switch:checked::after { left: 22px; }
  .st-segrow { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  .st-segrow .st-l { flex: none; }
  .st-segw { display: flex; }
  .st-segw label { flex: 1; }
  .st-segw span { text-align: center; padding: 9px 4px; font-size: 14px; white-space: normal; }
  .st-btns { flex-direction: column; align-items: stretch; padding: 12px 14px; }
  .st-btns .btn { width: 100%; min-height: 46px; justify-content: center; text-align: center; }
  .st-sv { flex-direction: column; gap: 2px; }
  .st-sv b { flex: none; font-size: 16px; }
  .st-status { align-items: flex-start; padding: 12px 14px; }
  .st-status .st-tone { margin-top: 7px; }
  .st-info { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; }
  .st-info .st-l { flex: none; }
  .st-v { text-align: left; }
  .st-todo { flex-wrap: wrap; }
  .st-todo .btn { margin-left: 40px; min-height: 40px; }
  .st-mach { padding: 10px 12px 10px 14px; gap: 12px; }
  .st-mach .ph { width: 52px; height: 52px; }
  .st-rate { width: 104px; }
  .st-chipadd { flex: 1 1 100%; } .st-chipadd input { flex: 1; width: auto; font-size: 16px; }
  .st-lineedit input { font-size: 16px; }
  .st-desk-only { display: none; }
  .st-phone-only { display: block; }
}

/* The initials in the sidebar and top bar are links to Settings › You. */
a.avatar { text-decoration: none; }
/* The switch is an <input> inside a row: keep the row's input rule (flex: 1, transparent) off it. */
.st-row > input.st-switch { flex: none; width: 46px; height: 28px; padding: 0; text-align: initial; background: var(--fill-2, #d9d4cb); box-shadow: none; }
.st-row > input.st-switch:checked { background: var(--orange); }
.st-row > input.st-switch:focus-visible { box-shadow: var(--focus); }
@media (max-width: 899px) { .st-row > input.st-switch { width: 51px; height: 31px; } }
/* Phone: a machine's name gets the full width; its rate and Edit sit on the line below. */
@media (max-width: 899px) {
  .st-mach { flex-wrap: wrap; row-gap: 8px; }
  .st-mach .st-l { flex: 1 1 calc(100% - 66px); }
  .st-mach .st-l small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .st-mach .st-rate, .st-mach > .st-val { margin-left: 64px; }
  .st-mach .st-rate { flex: 0 1 150px; width: auto; }
  .st-mach > .btn { margin-left: auto; }
}
