/* Kulmasauma's work-order tool (a demo). The company's world in an operating register: cool plaster ground,
   white slips, ink, 1px rules, tape-measure yellow only for the running timer, the current place and the mark.
   Archivo at normal width, a fixed rem scale, tabular figures. Square corners like the website. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("../fonts/archivo-var.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/instrument-sans-var.woff2") format("woff2"); }

.ty {
  --ground: #eeede9;
  --panel: #ffffff;
  --panel-2: #f7f6f2;
  --ink: #1a1b19;
  --ink-2: #45463f;
  --ink-3: #62635b;
  --rule: #d6d3cb;
  --rule-2: #a8a59c;
  --yellow: #f2b600;
  --yellow-soft: #fbefc4;
  --blue: #2f5d8a;
  --blue-soft: #e2ebf4;
  --green: #2f6b3f;
  --green-soft: #e1eee3;
  --red: #a8261d;
  --w-jari: #cfe0ee; --w-jari-2: #4f789c;
  --w-aino: #ecdcc6; --w-aino-2: #8c6a40;
  --w-teemu: #d8e5d0; --w-teemu-2: #5e7a4f;
  --w-none: #e6e4de; --w-none-2: #7d7a72;
  --font: "Archivo", system-ui, sans-serif;
  --rail: 14rem;
  color-scheme: light;
  accent-color: var(--ink);
  caret-color: var(--ink);
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 .9375rem/1.45 var(--font);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--rule-2) var(--ground);
}
.ty *, .ty *::before, .ty *::after { box-sizing: border-box; }
.ty ::selection { background: var(--yellow); color: var(--ink); }
.ty :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:where(.ty) :where(h1, h2, h3, p, ul, ol, dl, dd, figure) { margin: 0; }
:where(.ty) :where(ul, ol) { padding: 0; list-style: none; }
:where(.ty) a { color: inherit; }
:where(.ty) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.ty) img { display: block; max-width: 100%; height: auto; }
.ty [hidden] { display: none !important; }
.ty .skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--ink); color: #fff; }
.ty .skip:focus { top: .6rem; }
.ty-quiet { color: var(--ink-3); }
.ty-num { font-variant-numeric: tabular-nums lining-nums; }
.ty-right { text-align: right; }
.ty-ic { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; }
.ty-ic svg, .ty-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Mrrp Software's demo bar ---- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1.5rem; padding: .45rem 1.25rem; background: #0b0b0e; color: #b0afba; font: 400 .82rem/1.45 "Instrument Sans", system-ui, sans-serif; }
.demo-bar p { flex: 1 1 28rem; }
.demo-bar strong { color: #f0a9c6; font-weight: 600; }
.demo-bar-end { display: flex; align-items: center; gap: 1rem; }
.demo-bar a { color: #f1f0f4; }
.demo-bar .demo-tool { font-weight: 600; text-decoration-color: #f0a9c6; }
.demo-bar .lang { display: inline-flex; padding: 2px; border: 1px solid #2e2e38; border-radius: 999px; }
.demo-bar .lang a { min-width: 2.2rem; padding: .12rem .5rem; border-radius: 999px; color: #8d8c97; font-size: .74rem; font-weight: 600; text-align: center; text-decoration: none; }
.demo-bar .lang a[aria-current] { background: #2e2e38; color: #f1f0f4; }
.demo-bar :focus-visible { outline: 2px solid #f0a9c6; }

/* ---- Frame ---- */
.ty-app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: calc(100svh - 2.2rem); }
.ty-top { grid-column: 1 / -1; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; min-height: 3.5rem; padding: 0 1.25rem; background: var(--panel); border-bottom: 1px solid var(--ink); }
.ty-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.ks-mark-icon { width: 1.6rem; height: 1.6rem; fill: none; stroke-linecap: square; }
.ks-mark-wall { stroke: var(--ink); stroke-width: 3.2; }
.ks-mark-seam { stroke: var(--yellow); stroke-width: 3.2; }
.ty-brand-word { font-weight: 800; font-stretch: 112%; letter-spacing: .02em; text-transform: uppercase; font-size: 1.05rem; }
.ty-brand-sub { padding-left: .6rem; margin-left: .1rem; border-left: 1px solid var(--rule-2); color: var(--ink-2); font-weight: 600; }
.ty-top-end { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.ty-ws { font-size: .82rem; color: var(--ink-3); }
.ty-site { font-size: .88rem; font-weight: 600; }
.ty-reset { display: flex; align-items: center; }
.ty-reset-confirm { display: flex; align-items: center; gap: .5rem; padding: .25rem .25rem .25rem .7rem; background: #fbeeec; border: 1px solid var(--red); font-size: .86rem; }

.ty-rail { position: sticky; top: 3.5rem; align-self: start; display: flex; flex-direction: column; gap: .15rem; height: calc(100svh - 3.5rem); padding: 1rem .75rem; border-right: 1px solid var(--rule); background: var(--panel-2); overflow-y: auto; }
.ty-rail a { display: grid; grid-template-columns: 1.3rem 1fr auto auto; align-items: center; gap: .6rem; min-height: 2.6rem; padding: 0 .65rem; color: var(--ink-2); font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.ty-rail a svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ty-rail a:hover { background: var(--panel); color: var(--ink); }
.ty-rail a[aria-current] { background: var(--panel); color: var(--ink); border-color: var(--ink); }
.ty-rail kbd { font: 600 .7rem/1 var(--font); color: var(--ink-3); padding: .2rem .35rem; border: 1px solid var(--rule); background: var(--panel); }
.ty-rail .ty-new { margin-top: .8rem; border-color: var(--ink); color: var(--ink); }
.ty-rail .ty-new:hover { background: var(--ink); color: #fff; }
.ty-rail .ty-new:hover kbd { color: var(--ink); }
.ty-badge { min-width: 1.4rem; padding: .1rem .35rem; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 750; text-align: center; }
.ty-keys { margin-top: auto; padding: 1.2rem .65rem 0; font-size: .76rem; line-height: 1.5; color: var(--ink-3); }

.ty-main { grid-column: 2; min-width: 0; padding: 1.5rem clamp(1rem, 2vw, 2.25rem) 4rem; outline: none; }
.ty-loading { display: flex; align-items: center; gap: .4rem; padding: 3rem 0; color: var(--ink-3); }
.ty-loading span { width: .55rem; height: .55rem; background: var(--ink); animation: ty-blink 1s infinite; }
.ty-loading span:nth-child(2) { animation-delay: .15s; } .ty-loading span:nth-child(3) { animation-delay: .3s; }
.ty-loading p { margin-left: .6rem; }
@keyframes ty-blink { 50% { opacity: .2; } }
.ty-toast { position: fixed; z-index: 50; left: 50%; bottom: 1.5rem; transform: translateX(-50%); padding: .7rem 1.1rem; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(26, 27, 25, .5); }
.ty-toast.is-bad { background: var(--red); }

/* ---- Controls ---- */
.ty-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.4rem; padding: 0 .9rem; border: 1px solid var(--ink); background: var(--panel); color: var(--ink); font-weight: 650; font-size: .9rem; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s; }
.ty-btn:hover { background: var(--ink); color: #fff; }
.ty-btn:disabled { opacity: .45; cursor: default; background: var(--panel); color: var(--ink); }
.ty-btn-primary { background: var(--ink); color: #fff; }
.ty-btn-primary:hover { background: #3a3b37; }
.ty-btn-quiet { border-color: var(--rule-2); background: transparent; }
.ty-btn-quiet:hover { border-color: var(--ink); background: var(--panel); color: var(--ink); }
.ty-btn-danger { border-color: var(--red); background: var(--red); color: #fff; }
.ty-btn-danger:hover { background: #861c15; }
.ty-btn-icon { width: 2.4rem; padding: 0; }
.ty-btn-icon svg { width: 1.15rem; height: 1.15rem; }
.ty-btn-sm { min-height: 2rem; padding: 0 .7rem; font-size: .84rem; }
.ty-link { font-weight: 650; text-underline-offset: .2em; }
.ty-code { display: inline-block; padding: .08rem .32rem .06rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: .72rem; font-weight: 750; letter-spacing: .05em; line-height: 1.15; white-space: nowrap; }
.ty-count { display: inline-block; min-width: 1.4rem; margin-left: .5rem; padding: .05rem .35rem; border: 1px solid var(--rule-2); font-size: .78rem; font-weight: 650; text-align: center; vertical-align: .15em; }
.ty-sub { margin-left: .8rem; font-size: .95rem; font-weight: 500; color: var(--ink-3); }
.ty-label { font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ty-empty { padding: 1rem 0; color: var(--ink-3); }
.ty-hint { font-size: .84rem; color: var(--ink-3); }
.ty-err { font-size: .82rem; font-weight: 600; color: var(--red); }
.ty-err-box { margin-top: 1rem; padding: .7rem .9rem; border: 1px solid var(--red); background: #fbeeec; }
.ty-status { display: inline-block; padding: .14rem .5rem; font-size: .78rem; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.ty-status.st-request { background: var(--yellow-soft); border-color: #d6b14a; }
.ty-status.st-scheduled { background: var(--panel); border-color: var(--rule-2); }
.ty-status.st-active { background: var(--blue-soft); color: #1f4466; border-color: #9db6cf; }
.ty-status.st-done { background: var(--green-soft); color: #22502e; border-color: #a3c4aa; }
.ty-who { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.ty-who::before { content: ""; width: .65rem; height: .65rem; background: var(--wc, var(--w-none)); outline: 1px solid var(--wc2, var(--w-none-2)); }
.w-jari { --wc: var(--w-jari); --wc2: var(--w-jari-2); }
.w-aino { --wc: var(--w-aino); --wc2: var(--w-aino-2); }
.w-teemu { --wc: var(--w-teemu); --wc2: var(--w-teemu-2); }
.w-none { --wc: var(--w-none); --wc2: var(--w-none-2); }

.ty-viewhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; margin-bottom: 1.25rem; }
.ty-viewhead h1 { font-size: 1.75rem; font-weight: 800; font-stretch: 88%; line-height: 1.1; }
.ty-weeknav { display: flex; gap: .4rem; }
.ty-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--ink); background: var(--panel); }
.ty-seg-btn { min-height: 2.3rem; padding: 0 .85rem; border: 0; border-right: 1px solid var(--rule); background: transparent; font-weight: 600; font-size: .88rem; cursor: pointer; }
.ty-seg-btn:last-child { border-right: 0; }
.ty-seg-btn:hover { background: var(--panel-2); }
.ty-seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ty-seg-btn[aria-pressed="true"] .ty-count { border-color: #6b6c66; }

/* ---- Inbox and week board ---- */
.ty-inbox { margin-bottom: 1.5rem; padding: 1rem 1.1rem 1.1rem; background: var(--panel); border: 1px solid var(--rule); }
.ty-inbox-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .8rem; }
.ty-inbox h2 { font-size: 1rem; font-weight: 750; }
.ty-inbox-head .ty-link { font-size: .88rem; }
.ty-inbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; }
.ty-req-link { display: grid; gap: .25rem; height: 100%; padding: .75rem .85rem; border: 1px solid var(--rule-2); background: var(--yellow-soft); text-decoration: none; transition: border-color .15s, transform .15s; }
.ty-req-link:hover { border-color: var(--ink); }
.ty-req.is-new .ty-req-link { border: 2px solid var(--ink); box-shadow: 0 0 0 3px var(--yellow); animation: ty-pulse 1.6s ease-out 2; }
@keyframes ty-pulse { 0% { box-shadow: 0 0 0 0 var(--yellow); } 100% { box-shadow: 0 0 0 10px rgba(242, 182, 0, 0); } }
.ty-req-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.ty-req-link strong { font-size: 1rem; }
.ty-req-link .ty-quiet { font-size: .82rem; }

/* the week fills the rest of the screen: the board grows, its rows share the height */
.ty-week { display: flex; flex-direction: column; min-height: calc(100svh - 3.5rem - 2.2rem - 5.5rem); }
.ty-board-wrap { flex: 1 1 auto; display: flex; overflow-x: auto; border: 1px solid var(--ink); background: var(--panel); }
.ty-board { display: grid; grid-template-columns: 12rem repeat(5, minmax(8rem, 1fr)) repeat(2, minmax(5rem, .5fr)); grid-template-rows: auto; grid-auto-rows: minmax(4.6rem, 1fr); flex: 1 1 auto; min-width: 60rem; }
.ty-board-corner, .ty-dayhead { position: sticky; top: 0; display: flex; align-items: baseline; gap: .4rem; min-height: 2.6rem; padding: .6rem .7rem; border-bottom: 1px solid var(--ink); background: var(--panel-2); font-size: .82rem; font-weight: 600; color: var(--ink-2); grid-row: 1; }
.ty-dayhead { border-left: 1px solid var(--rule); }
.ty-dayhead strong { color: var(--ink); font-size: .95rem; }
.ty-dayhead.is-today { background: var(--ink); color: #fff; }
.ty-dayhead.is-today strong { color: #fff; }
.ty-dayhead.is-weekend { color: var(--ink-3); flex-wrap: wrap; gap: 0 .3rem; }
.ty-rowhead { grid-column: 1; display: grid; align-content: start; gap: .1rem; padding: .7rem .75rem; border-bottom: 1px solid var(--rule); }
.ty-rowhead > a::before, .ty-pick-btn strong::before { content: ""; display: inline-block; width: .7rem; height: .7rem; margin-right: .45rem; background: var(--wc); outline: 1px solid var(--wc2); vertical-align: .02em; }
.ty-rowhead a { font-weight: 700; text-decoration: none; }
.ty-rowhead a:hover { text-decoration: underline; }
.ty-rowhead .ty-quiet { font-size: .8rem; }
.ty-rowhours { margin-top: .35rem; font-size: .82rem; font-weight: 600; }
.ty-cell { border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ty-cell.is-today { background: #fbf6e6; }
.ty-cell.is-weekend { background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(26, 27, 25, .04) 7px 8px); }
.ty-bar { position: relative; z-index: 1; align-self: start; display: grid; align-content: start; gap: .1rem; min-width: 0; margin: .35rem .3rem; padding: .45rem .6rem; border: 1px solid var(--wc2); background: var(--wc); text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.ty-bar:hover { box-shadow: 0 6px 16px -8px rgba(26, 27, 25, .45); transform: translateY(-1px); }
.ty-bar.st-scheduled { background: var(--panel); border-style: dashed; border-width: 1.5px; }
.ty-bar.st-done { opacity: .72; }
.ty-bar.cont-l { border-left-style: dotted; margin-left: 0; }
.ty-bar.cont-r { border-right-style: dotted; margin-right: 0; }
.ty-bar-top { display: flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ty-bar-no { font-weight: 800; }
.ty-bar-done { display: inline-grid; width: 1rem; height: 1rem; margin-left: auto; color: var(--green); }
.ty-bar-done svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.6; }
.ty-bar-sub { font-size: .82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ty-bar-meta { display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--ink-3); white-space: nowrap; }
.ty-bar-live { padding: 0 .3rem; background: var(--yellow); color: var(--ink); font-weight: 700; }
.ty-bar.is-arriving { z-index: 3; animation: ty-arrive .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes ty-arrive { 0% { transform: translateY(-3.5rem) scale(.96); opacity: 0; box-shadow: 0 0 0 3px var(--yellow), 0 18px 30px -14px rgba(26, 27, 25, .5); } 60% { opacity: 1; } 100% { box-shadow: 0 0 0 3px rgba(242, 182, 0, 0); } }

/* ---- Tables ---- */
.ty-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.ty-search { min-height: 2.4rem; width: min(24rem, 100%); padding: 0 .8rem; border: 1px solid var(--rule-2); background: var(--panel); }
.ty-search:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.ty-table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--ink); }
.ty-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ty-table th { padding: .55rem .7rem; text-align: left; font-size: .76rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); background: var(--panel-2); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.ty-table th.ty-right { text-align: right; }
.ty-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ty-table tbody tr:last-child td { border-bottom: 0; }
.ty-table tfoot td, .ty-table tfoot th { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; background: var(--panel-2); color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .9rem; }
.ty-cellsub { display: block; font-size: .8rem; color: var(--ink-3); }
.ty-jobs .ty-table tbody tr { cursor: pointer; }
.ty-jobs .ty-table tbody tr:hover td { background: #faf9f5; }
.ty-jobs .ty-table tbody tr.is-new td { background: var(--yellow-soft); }
.ty-jobs .ty-table td:first-child a { font-weight: 800; text-decoration: none; }
.ty-jobs .ty-table td:first-child a:hover { text-decoration: underline; }
.ty-strong { font-weight: 750; }
.ty-zero { color: var(--ink-3); }
.ty-hours .is-today { background: #fbf6e6; }

/* ---- Job slip: the work order ---- */
.ty-crumb { margin-bottom: .8rem; font-size: .88rem; }
.ty-crumb a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; text-decoration: none; }
.ty-crumb a:hover { text-decoration: underline; }
.ty-slip { background: var(--panel); border: 1px solid var(--ink); }
.ty-slip-head { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; padding: 1rem 1.2rem; border-bottom: 2px solid var(--ink); }
.ty-signoff { margin-top: .35rem; font-size: .86rem; font-weight: 650; color: var(--green); }
.ty-slip-head h1 { font-size: 1.9rem; font-weight: 800; font-stretch: 85%; line-height: 1; }
.ty-slip-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.ty-web { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; padding: .7rem 1.2rem; background: var(--yellow-soft); border-bottom: 1px solid #d6b14a; font-size: .9rem; }
.ty-web.is-new { background: var(--yellow); }
.ty-slip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ty-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; align-content: start; padding: 1.1rem 1.2rem 1.3rem; border-bottom: 1px solid var(--rule); }
.ty-box:nth-child(odd) { border-right: 1px solid var(--rule); }
.ty-box-5, .ty-box-6, .ty-box-7 { grid-column: 1 / -1; border-right: 0 !important; }
.ty-box h2 { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 750; }
.ty-box-no { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 750; }
.ty-box-sum { margin-left: auto; font-weight: 750; }
.span-2 { grid-column: 1 / -1; }
.ty-field { display: grid; gap: .3rem; align-content: start; min-width: 0; }
.ty-field label { font-size: .8rem; font-weight: 650; color: var(--ink-2); }
.ty-field input, .ty-field select, .ty-field textarea, .ty-inline input, .ty-inline select, .ty-inline textarea, .ty-mats input, .ty-mats select { width: 100%; min-height: 2.5rem; padding: .4rem .6rem; border: 1px solid var(--rule-2); border-radius: 0; background: var(--panel); }
.ty-field textarea, .ty-inline textarea { resize: vertical; line-height: 1.45; }
.ty :is(input, select, textarea):hover { border-color: var(--ink-2); }
.ty :is(input, select, textarea):focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.ty [aria-invalid="true"] { border-color: var(--red) !important; }
.ty-endhint { align-self: end; padding-bottom: .55rem; }
.ty-photos ul { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.ty-photos img { width: 10rem; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); }
.ty-photos a:hover img { border-color: var(--ink); }
.ty-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ty-inline input[type="date"] { width: auto; }
.ty-inline input.ty-num { width: 5.5rem; }
.ty-inline select { width: auto; }
.ty-inline textarea { flex: 1 1 18rem; width: auto; }
.ty-mats td { padding: .35rem .4rem; vertical-align: middle; }
.ty-mats td:nth-child(2) input { width: 5rem; }
.ty-mats td:nth-child(4) input { width: 7rem; }
.ty-mats input.ty-num { text-align: right; }
.ty-add { justify-self: start; }
.ty-entries .is-running td { background: #fbf6e6; }
.ty-live { margin-left: .4rem; padding: .05rem .35rem; background: var(--yellow); font-size: .72rem; font-weight: 700; }
.ty-notes { display: grid; gap: .5rem; }
.ty-notes li { padding: .55rem .75rem; background: var(--panel-2); border: 1px solid var(--rule); }
.ty-note-meta { font-size: .76rem; font-weight: 650; color: var(--ink-3); margin-bottom: .15rem; }
.ty-slip > .ty-err-box { margin: 1rem 1.2rem; }

/* ---- Worker view: phone first ---- */
.ty-workerview, .ty-workerpick { max-width: 44rem; }
.ty-lead { margin-bottom: 1.2rem; color: var(--ink-2); max-width: 46ch; }
.ty-pick { display: grid; gap: .6rem; }
.ty-pick-btn { display: grid; gap: .15rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--ink); text-decoration: none; }
.ty-pick-btn strong { font-size: 1.2rem; }
.ty-pick-btn:hover { background: var(--panel-2); }
.ty-whead { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; background: var(--wc); border: 1px solid var(--wc2); }
.ty-whead h1 { font-size: 1.6rem; font-weight: 800; font-stretch: 88%; line-height: 1.1; }
.ty-wmeta { margin-top: .2rem; color: var(--ink-2); font-size: .9rem; }
.ty-wsec { display: flex; align-items: baseline; margin: 1.6rem 0 .7rem; font-size: 1.05rem; font-weight: 750; }
.ty-cards { display: grid; gap: 1rem; }
.ty-card { display: grid; gap: .9rem; padding: 1.1rem; background: var(--panel); border: 1px solid var(--ink); }
.ty-card.is-done { background: var(--panel-2); }
.ty-card-head { display: grid; gap: .35rem; }
.ty-card-top { display: flex; align-items: center; gap: .5rem; font-size: .84rem; font-weight: 650; color: var(--ink-2); }
.ty-card-top .ty-status { margin-left: auto; }
.ty-card h3 { font-size: 1.3rem; font-weight: 800; font-stretch: 90%; line-height: 1.15; }
.ty-card-where { display: grid; }
.ty-card-where span { color: var(--ink-2); }
.ty-card-when { font-size: .86rem; color: var(--ink-3); }
.ty-call { justify-self: start; margin-top: .2rem; }
.ty-btn-start { min-height: 3.6rem; width: 100%; font-size: 1.1rem; background: var(--ink); color: #fff; }
.ty-btn-start:hover { background: #3a3b37; }
.ty-timer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .8rem .7rem 1rem; background: var(--yellow); border: 1px solid var(--ink); }
.ty-timer-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ty-timer-clock { font-size: 2.1rem; font-weight: 800; font-stretch: 80%; line-height: 1; }
.ty-btn-stop { min-height: 3rem; padding: 0 1.2rem; font-size: 1rem; background: var(--ink); color: #fff; }
.ty-btn-stop:hover { background: #3a3b37; }
.ty-done-line { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; background: var(--green-soft); color: #22502e; font-weight: 700; border: 1px solid #a3c4aa; }
.ty-card-logged { font-size: .9rem; color: var(--ink-2); }
.ty-more summary { cursor: pointer; font-weight: 650; font-size: .9rem; padding: .3rem 0; }
.ty-more .ty-inline { margin-top: .5rem; }
.ty-card-notes { display: grid; gap: .6rem; }
.ty-card-pics { display: flex; flex-wrap: wrap; gap: .4rem; }
.ty-card-pics img { width: 6.5rem; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); }
.ty-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .8rem; border-top: 1px solid var(--rule); }
.ty-card-foot .ty-link { margin-left: auto; font-size: .9rem; }
.ty-filewrap { position: relative; display: inline-flex; }
.ty-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ty-file:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.ty-btn-done { border-color: var(--green); color: var(--green); }
.ty-btn-done:hover { background: var(--green); color: #fff; }
.ty-next { display: grid; gap: .5rem; }
.ty-next a { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; padding: .7rem .85rem; background: var(--panel); border: 1px solid var(--rule-2); text-decoration: none; }
.ty-next a:hover { border-color: var(--ink); }
.ty-next .ty-code { grid-row: 1 / span 3; align-self: start; margin-top: .15rem; }

/* ---- Hours and invoice ---- */
.ty-panel { margin-bottom: 1.6rem; }
.ty-panel h2 { margin-bottom: .6rem; font-size: 1rem; font-weight: 750; }
.ty-inv-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; max-width: 56rem; margin-bottom: 1rem; }
.ty-invoice { max-width: 56rem; padding: clamp(1.2rem, 3vw, 2.6rem); background: var(--panel); border: 1px solid var(--ink); display: grid; gap: 1.6rem; }
.ty-inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 2px solid var(--ink); }
.ty-inv-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-stretch: 110%; text-transform: uppercase; letter-spacing: .02em; font-size: 1.1rem; }
.ty-inv-brand svg { width: 2rem; height: 2rem; }
.ty-inv-head h1 { font-size: 1.7rem; font-weight: 800; font-stretch: 85%; text-align: right; line-height: 1; }
.ty-stamp { margin-top: .5rem; padding: .2rem .5rem; border: 1.5px solid var(--red); color: var(--red); font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.ty-inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.ty-inv-meta .ty-label { margin-bottom: .3rem; }
.ty-inv-dl { display: grid; gap: .3rem; }
.ty-inv-dl div { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--rule); }
.ty-inv-dl dt { color: var(--ink-3); font-size: .86rem; }
.ty-invoice > * { min-width: 0; }
.ty-inv-scroll { overflow-x: auto; }
.ty-inv-lines { border: 1px solid var(--ink); }
.ty-inv-lines td { white-space: nowrap; }
.ty-inv-lines td:first-child { white-space: normal; }
.ty-inv-totals { justify-self: end; width: min(24rem, 100%); display: grid; }
.ty-inv-totals div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.ty-inv-totals dd { font-weight: 650; }
.ty-inv-grand { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink) !important; font-size: 1.2rem; font-weight: 800; }
.ty-inv-grand dd { font-weight: 800 !important; }
.ty-inv-household { font-size: .9rem; color: var(--ink-2); }
.ty-inv-foot { padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .8rem; color: var(--ink-3); }
.ty-warn { padding: .7rem .9rem; background: var(--yellow-soft); border: 1px solid #d6b14a; font-weight: 600; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .ty { --rail: 4.2rem; }
  .ty-rail a { grid-template-columns: 1fr; justify-items: center; padding: .4rem 0; }
  .ty-rail a span:not(.ty-badge), .ty-rail kbd, .ty-keys { display: none; }
  .ty-rail .ty-badge { position: absolute; transform: translate(.9rem, -.8rem); }
  .ty-rail a { position: relative; }
  .ty-slip-grid, .ty-box { grid-template-columns: 1fr; }
  .ty-box { border-right: 0 !important; }
  .ty-ws { display: none; }
}
@media (max-width: 760px) {
  .demo-bar { padding: .35rem .8rem; font-size: .76rem; }
  .demo-bar .demo-long, .demo-bar .demo-by, .demo-bar .demo-tool { display: none; }
  .demo-bar p { flex-basis: auto; }
  .ty-app { grid-template-columns: 1fr; padding-bottom: 4.4rem; }
  .ty-top { padding: 0 .8rem; gap: .5rem; }
  .ty-brand-sub, .ty-site { display: none; }
  .ty-reset-confirm span { display: none; }
  .ty-main { grid-column: 1; padding: 1rem .8rem 2rem; }
  .ty-rail { position: fixed; z-index: 30; top: auto; bottom: 0; left: 0; right: 0; height: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 0; border-right: 0; border-top: 1px solid var(--ink); background: var(--panel); padding-bottom: env(safe-area-inset-bottom); }
  .ty-rail a, .ty-rail .ty-new { min-height: 3.9rem; margin: 0; border: 0; border-radius: 0; gap: .15rem; align-content: center; }
  .ty-rail a span:not(.ty-badge) { display: block; font-size: .72rem; font-weight: 650; text-align: center; line-height: 1.1; }
  .ty-rail a[aria-current] { box-shadow: inset 0 3px 0 var(--yellow); border: 0; background: var(--panel-2); }
  .ty-rail .ty-new { background: var(--ink); color: #fff; }
  .ty-viewhead h1 { font-size: 1.45rem; }
  .ty-sub { display: block; margin: .2rem 0 0; }
  .ty-inbox-list { grid-template-columns: 1fr; }
  .ty-week { min-height: 0; }
  /* materials: each line stacks into labelled fields */
  .ty-mats thead { display: none; }
  .ty-mats, .ty-mats tbody, .ty-mats tfoot { display: block; }
  .ty-mats tbody tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .4rem; padding: .7rem .6rem; border-bottom: 1px solid var(--rule); }
  .ty-mats tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .2rem; font-size: .74rem; font-weight: 650; color: var(--ink-3); }
  .ty-mats tbody td:last-child { align-self: end; }
  .ty-mats tbody td { padding: 0; border: 0; }
  .ty-mats tbody td:first-child { grid-column: 1 / -1; }
  .ty-mats tbody td:nth-child(5) { grid-column: 1 / 4; text-align: left; }
  .ty-mats td input, .ty-mats td select { width: 100% !important; }
  .ty-mats tfoot tr { display: flex; justify-content: space-between; }
  .ty-mats tfoot td:last-child { display: none; }
  .ty-board { grid-template-columns: 6.6rem repeat(5, 8.5rem) repeat(2, 4.6rem); min-width: 0; }
  .ty-rowhead .ty-quiet { display: none; }
  .ty-board-corner { position: sticky; left: 0; z-index: 2; }
  .ty-rowhead { position: sticky; left: 0; z-index: 2; background: var(--panel); }
  /* a long bar keeps its label in view while the board scrolls */
  .ty-bar { overflow: visible; }
  .ty-bar > span { position: sticky; left: 7.2rem; max-width: 15rem; overflow: hidden; }
  .ty-jobs .ty-table thead { display: none; }
  .ty-jobs .ty-table, .ty-jobs .ty-table tbody, .ty-jobs .ty-table tr, .ty-jobs .ty-table td { display: block; }
  .ty-jobs .ty-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: .15rem .7rem; padding: .7rem .8rem; border-bottom: 1px solid var(--rule); }
  .ty-jobs .ty-table td { padding: 0; border: 0; }
  .ty-jobs .ty-table td:nth-child(1) { grid-row: 1 / span 2; font-size: 1.05rem; }
  .ty-jobs .ty-table td:nth-child(2) { grid-column: 2; }
  .ty-jobs .ty-table td:nth-child(3) { grid-column: 2; font-size: .86rem; }
  .ty-jobs .ty-table td:nth-child(4), .ty-jobs .ty-table td:nth-child(5) { display: none; }
  .ty-jobs .ty-table td:nth-child(6) { grid-column: 3; grid-row: 2; justify-self: end; font-size: .84rem; }
  .ty-jobs .ty-table td:nth-child(7) { grid-column: 3; grid-row: 1; justify-self: end; }
  .ty-jobs .ty-table td:nth-child(8) { display: none; }
  .ty-search { width: 100%; }
  .ty-slip-head { padding: .9rem; }
  .ty-slip-actions { margin-left: 0; width: 100%; }
  .ty-slip-actions .ty-btn-primary { flex: 1 1 auto; }
  .ty-box { padding: 1rem .9rem 1.1rem; }
  .ty-inv-meta { grid-template-columns: 1fr; }
  .ty-inv-dl div { grid-template-columns: 7.5rem 1fr; }
  .ty-inv-head h1 { font-size: 1.3rem; }
  .ty-toast { bottom: 5rem; width: calc(100% - 2rem); text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ty *, .ty *::before, .ty *::after { transition: none !important; animation: none !important; }
}
@media print {
  .ty { background: #fff; }
  .demo-bar, .ty-top, .ty-rail, .ty-inv-actions, .ty-toast, .skip { display: none !important; }
  .ty-app { display: block; }
  .ty-main { padding: 0; }
  .ty-invoice { border: 0; max-width: none; padding: 0; }
  .ty-inv-lines { border: 1px solid #000; }
}
