/*
 * 提案ワークベンチ — the app's own layer over the PMA design system (static/design/tokens.css + components.css,
 * vendored from design/ by scripts/vendor-design.sh). Every value is a token; no colour is defined here.
 * Direction: an editorial production desk — a flatplan on a light table. Depth = 1px rules (no shadows);
 * printer's marks (crop marks, centre marks, dotted leaders, a double rule under the price) are the only ornament.
 * Classes: t-* (teian). Base unit 4px; rows 16px; sections 48-64px.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--pma-paper);
  color: var(--pma-ink);
  font-family: var(--pma-font-sans);
  font-size: var(--pma-text-base);
  line-height: var(--pma-leading-ui);
  letter-spacing: var(--pma-tracking-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: var(--pma-leading-heading); word-break: auto-phrase; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--pma-link); text-underline-offset: 0.2em; }
:focus-visible { outline: var(--pma-focus-outline); outline-offset: 2px; }
[hidden] { display: none !important; }
[lang="en"] { font-family: var(--pma-font-display); font-variant-numeric: lining-nums tabular-nums; }

.t-wrap { max-width: var(--pma-page-max); margin: 0 auto; padding: 0 var(--pma-gutter); }
.t-main { padding-block: var(--pma-space-7) var(--pma-space-8); min-height: 60vh; }
.t-hint { color: var(--pma-ink-muted); font-size: var(--pma-text-sm); line-height: 1.6; }
.t-empty { color: var(--pma-ink-muted); }
.t-mt { margin-top: var(--pma-space-4); }
.t-visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.t-skip { position: absolute; inset-inline-start: var(--pma-space-4); inset-block-start: -4rem; padding: var(--pma-space-2) var(--pma-space-4); background: var(--pma-brand); color: var(--pma-on-brand); z-index: 10; }
.t-skip:focus { inset-block-start: var(--pma-space-2); }
.t-plainlist { margin: var(--pma-space-2) 0 0; padding-inline-start: 1.2em; }
.t-count { font-variant-numeric: tabular-nums; margin-inline-start: 0.25em; }
.pma-btn svg { inline-size: 1.1em; block-size: 1.1em; flex: none; }
.pma-btn:active { transform: scale(0.98); }
.t-btn-lead { min-height: 3.25rem; padding-inline: var(--pma-space-6); font-size: var(--pma-text-md); }
.t-linkbtn {
  min-height: var(--pma-tap); padding: 0 var(--pma-space-2); border: 0; background: none; color: var(--pma-link);
  font: inherit; font-size: var(--pma-text-sm); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}
.t-linkbtn:hover { color: var(--pma-brand-hover); }

/* ---------------------------------------------------------------- top bar: logo, name, three links, who */
.t-bar { border-bottom: 1px solid var(--pma-rule-strong); background: var(--pma-paper); }
.t-bar__in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--pma-space-6); min-height: 4rem; }
.t-brand { display: inline-flex; align-items: center; gap: var(--pma-space-3); color: var(--pma-ink); text-decoration: none; min-height: var(--pma-tap); }
.t-brand__logo { display: block; block-size: 34px; inline-size: auto; }
.t-brand__name { font-weight: var(--pma-weight-bold); letter-spacing: var(--pma-tracking-heading); display: inline-flex; align-items: baseline; gap: var(--pma-space-2); }
.t-brand__en { font-size: var(--pma-text-md); font-weight: var(--pma-weight-display); color: var(--pma-ink-muted); letter-spacing: var(--pma-tracking-display); }
.t-nav { display: flex; gap: var(--pma-space-1); margin-inline-end: auto; }
.t-nav a {
  display: inline-flex; align-items: center; min-height: 4rem; padding: 0 var(--pma-space-3);
  color: var(--pma-ink-2); font-weight: var(--pma-weight-medium); text-decoration: none;
}
.t-nav a:hover { color: var(--pma-ink); background: var(--pma-surface-alt); }
.t-nav a[aria-current="page"] { color: var(--pma-ink); font-weight: var(--pma-weight-bold); box-shadow: inset 0 -3px 0 var(--pma-brand); }
.t-who { display: flex; align-items: center; gap: var(--pma-space-3); font-size: var(--pma-text-sm); }
.t-who__name { color: var(--pma-ink-2); }
.t-who__desk { display: inline-flex; align-items: center; min-height: var(--pma-tap); }
.t-who__out { margin: 0; }

/* ---------------------------------------------------------------- page heads */
.t-head { margin-bottom: var(--pma-space-5); }
.t-head__title { margin-bottom: var(--pma-space-4); }
.t-head__act { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pma-space-3) var(--pma-space-5); flex-direction: row-reverse; }
.t-head__act .t-hint { max-width: var(--pma-measure); }

.t-kicker { display: flex; align-items: baseline; gap: var(--pma-space-3); color: var(--pma-ink-muted); font-size: var(--pma-text-sm); margin-bottom: var(--pma-space-2); }
.t-kicker [lang="en"] { font-size: var(--pma-text-lg); font-weight: var(--pma-weight-display); text-transform: uppercase; letter-spacing: var(--pma-tracking-display); color: var(--pma-ink); }
.t-dochead { padding-bottom: var(--pma-space-5); margin-bottom: var(--pma-space-6); border-bottom: 1px solid var(--pma-rule-strong); }
.t-dochead__client { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem); font-weight: var(--pma-weight-bold); letter-spacing: var(--pma-tracking-heading); overflow-wrap: anywhere; }
.t-dochead__title { margin-top: var(--pma-space-1); font-size: var(--pma-text-md); color: var(--pma-ink-2); line-height: 1.6; }
.t-meta { display: flex; flex-wrap: wrap; gap: var(--pma-space-1) var(--pma-space-4); margin-top: var(--pma-space-3); color: var(--pma-ink-muted); font-size: var(--pma-text-sm); overflow-wrap: anywhere; }
.t-dochead__act { display: flex; flex-wrap: wrap; gap: var(--pma-space-3); margin-top: var(--pma-space-4); }
.t-dochead__state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pma-space-2) var(--pma-space-4); margin-top: var(--pma-space-4); }
.t-h2 { font-size: var(--pma-text-lg); font-weight: var(--pma-weight-bold); margin-bottom: var(--pma-space-4); }
.t-sub { font-size: var(--pma-text-md); font-weight: var(--pma-weight-bold); margin: var(--pma-space-6) 0 var(--pma-space-2); }
.t-sec { margin-top: var(--pma-space-7); }
.t-sec > .pma-section-title { margin-bottom: var(--pma-space-4); }
.pma-notice { margin-bottom: var(--pma-space-4); }
.pma-notice__body form { margin-top: var(--pma-space-3); }
.pma-notice__body p + p { margin-top: var(--pma-space-2); }

/* ---------------------------------------------------------------- the shelf (棚): an index of past proposals */
.t-shelf { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pma-rule-strong); }
.t-intake { padding: var(--pma-space-4) 0; border-bottom: 1px solid var(--pma-rule); }
/* crop marks (トンボ) at the four corners of the intake: "place the pages here" */
.t-intake__form {
  padding: 6px;
  --m: var(--pma-ink-muted);
  background:
    linear-gradient(var(--m), var(--m)) top left / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top left / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 1px 14px no-repeat;
}
.t-intake__drop {
  display: grid; gap: var(--pma-space-2); padding: var(--pma-space-5);
  background: var(--pma-surface-alt);
  transition: background-color var(--pma-duration) var(--pma-ease);
}
.t-intake__drop[data-over] { background: var(--pma-brand-tint); outline: 2px solid var(--pma-brand); outline-offset: -2px; }
.t-intake--first .t-intake__drop { padding: var(--pma-space-7) var(--pma-space-6); }
.t-intake__lead { font-size: var(--pma-text-md); font-weight: var(--pma-weight-bold); line-height: 1.6; }
.t-intake__act { display: flex; flex-wrap: wrap; gap: var(--pma-space-3); margin-top: var(--pma-space-2); }
.t-intake__act:has(input:focus-visible) label { box-shadow: var(--pma-focus-ring); }
.t-steps-plain { margin: var(--pma-space-2) 0; padding-inline-start: 1.4em; color: var(--pma-ink-2); line-height: 1.8; }
.t-steps-plain li::marker { font-family: var(--pma-font-display); font-weight: var(--pma-weight-display); }
.t-intake__files { list-style: none; margin: 0; padding: 0; }
.t-intake__files:not(:empty) { margin-top: var(--pma-space-3); border-top: 1px solid var(--pma-rule-soft); }
.t-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--pma-space-1) var(--pma-space-4); align-items: center; padding: var(--pma-space-2) 0; border-bottom: 1px solid var(--pma-rule-soft); font-size: var(--pma-text-sm); }
.t-file__name { overflow-wrap: anywhere; color: var(--pma-ink); }
.t-file__state { display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap; }
.t-file__state svg { inline-size: 1em; block-size: 1em; }
.t-file[data-state="sending"] .t-file__state { color: var(--pma-wait-fg); }
.t-file[data-state="ok"] .t-file__state { color: var(--pma-ok-fg); }
.t-file[data-state="ng"] .t-file__state { color: var(--pma-blocked-fg); font-weight: var(--pma-weight-bold); }
.t-file__why { grid-column: 1 / -1; color: var(--pma-blocked-fg); }
.t-file progress { grid-column: 1 / -1; inline-size: 100%; block-size: 2px; appearance: none; border: 0; background: var(--pma-rule-soft); }
.t-file progress::-webkit-progress-bar { background: var(--pma-rule-soft); }
.t-file progress::-webkit-progress-value { background: var(--pma-brand); }
.t-file progress::-moz-progress-bar { background: var(--pma-brand); }

.t-row {
  position: relative;
  display: grid; grid-template-columns: 3rem minmax(0, 1fr) 8.5rem 15rem; gap: var(--pma-space-1) var(--pma-space-4);
  align-items: baseline; padding: var(--pma-space-4) var(--pma-space-2) var(--pma-space-4) 0;
  border-bottom: 1px solid var(--pma-rule-soft);
  transition: background-color var(--pma-duration) var(--pma-ease);
}
.t-row:has(.t-row__client:hover) { background: var(--pma-surface-alt); }
.t-row__no { font-family: var(--pma-font-display); font-size: var(--pma-text-xl); font-weight: var(--pma-weight-display); color: var(--pma-ink-muted); font-variant-numeric: lining-nums tabular-nums; line-height: 1; text-align: end; }
.t-row__main { min-width: 0; display: grid; gap: var(--pma-space-1); }
.t-row__client { color: var(--pma-ink); font-size: var(--pma-text-md); font-weight: var(--pma-weight-bold); line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.t-row__client::after { content: ""; position: absolute; inset: 0; }
.t-row__client:hover { text-decoration: underline; }
.t-row__client:focus-visible { outline: none; }
.t-row:has(.t-row__client:focus-visible) { box-shadow: var(--pma-focus-ring); }
.t-row__client--file { font-weight: var(--pma-weight-medium); color: var(--pma-ink-2); }
.t-row__title { color: var(--pma-ink-2); font-size: var(--pma-text-sm); line-height: 1.6; }
.t-row__why { color: var(--pma-ink-muted); font-size: var(--pma-text-sm); }
.t-row[data-status="failed"] .t-row__why { color: var(--pma-blocked-fg); }
.t-row__meta { display: flex; flex-wrap: wrap; gap: var(--pma-space-1) var(--pma-space-3); align-items: baseline; color: var(--pma-ink-muted); font-size: var(--pma-text-sm); }
.t-row__year { font-family: var(--pma-font-display); font-size: var(--pma-text-md); font-weight: var(--pma-weight-display); color: var(--pma-ink-2); font-variant-numeric: lining-nums tabular-nums; }
.t-row__state { display: flex; flex-wrap: wrap; gap: var(--pma-space-2); align-items: center; justify-content: flex-end; }
.t-row__state form, .t-row__state .pma-chip { position: relative; z-index: 1; margin: 0; }
.t-tags { display: flex; flex-wrap: wrap; gap: var(--pma-space-1) var(--pma-space-2); margin-top: var(--pma-space-1); }
.t-tag {
  display: inline-flex; align-items: center; padding: 0 0.6em; border: 1px solid var(--pma-rule); border-radius: var(--pma-radius-pill);
  color: var(--pma-ink-2); font-size: var(--pma-text-sm); line-height: 1.6; white-space: nowrap;
}
/* media names are often Japanese (京急, 東京モノレール): Noto, not Cormorant; set apart by weight and a firmer rule */
.t-tag[data-kind="media"] { font-weight: var(--pma-weight-bold); color: var(--pma-ink); border-color: var(--pma-rule-input); }
/* 受注 is a neutral fact: same ink for every value */
.t-outcome { color: var(--pma-ink-muted); white-space: nowrap; }
.t-final { display: inline-flex; align-items: center; padding: 0 0.5em; border: 1px solid var(--pma-rule-input); border-radius: 2px; color: var(--pma-ink-2); font-size: var(--pma-text-sm); line-height: 1.6; white-space: nowrap; }
.t-final[data-earlier] { border-style: dashed; color: var(--pma-ink-muted); }
.t-versions { display: grid; gap: var(--pma-space-1); margin-bottom: var(--pma-space-2); }
.t-intake__role { justify-self: start; margin-top: var(--pma-space-1); }
.t-estlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pma-rule); }
.t-estlist li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pma-space-2) var(--pma-space-4); min-height: var(--pma-tap); padding: var(--pma-space-2) 0; border-bottom: 1px solid var(--pma-rule-soft); overflow-wrap: anywhere; }
.t-footnote { margin-top: var(--pma-space-3); color: var(--pma-ink-muted); font-size: var(--pma-text-sm); }
.t-result { margin-bottom: var(--pma-space-4); }
.t-emptybox { padding: var(--pma-space-7) var(--pma-space-6); background: var(--pma-surface-alt); border-top: 1px solid var(--pma-rule-strong); display: grid; gap: var(--pma-space-2); }

/* ---------------------------------------------------------------- document (校正): facts with their source text */
.t-checks { margin-bottom: var(--pma-space-6); padding: var(--pma-space-5); background: var(--pma-surface); border: 1px solid var(--pma-ink); }
.t-checks__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--pma-space-2) var(--pma-space-4); font-size: var(--pma-text-base); font-weight: var(--pma-weight-regular); }
.t-checks__head .pma-ball { font-size: var(--pma-text-base); }
.t-checks__list { list-style: none; margin: var(--pma-space-4) 0 0; padding: 0; }
.t-check { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--pma-space-2) var(--pma-space-4); align-items: center; padding: var(--pma-space-3) 0; border-top: 1px solid var(--pma-rule-soft); }
.t-check__what { overflow-wrap: anywhere; }
.t-check__act { display: flex; flex-wrap: wrap; gap: var(--pma-space-2); align-items: center; }
.t-check__act form { margin: 0; }
.t-facts { margin: 0; display: grid; }
.t-facts > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: var(--pma-space-4); padding: var(--pma-space-3) 0; border-bottom: 1px solid var(--pma-rule-soft); }
.t-facts dt { color: var(--pma-ink-2); font-size: var(--pma-text-sm); font-weight: var(--pma-weight-bold); padding-top: 0.15em; }
.t-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--pma-space-1) var(--pma-space-2); align-items: baseline; overflow-wrap: anywhere; }
.t-human { color: var(--pma-attn-fg); background: var(--pma-attn-bg); font-size: var(--pma-text-sm); padding: 0 var(--pma-space-2); margin-inline-start: var(--pma-space-2); }
.t-human::before { content: "✎ "; }
.t-toc { list-style: none; margin: 0; padding: 0; inline-size: 100%; max-width: 34rem; }
.t-toc li { display: flex; align-items: baseline; gap: var(--pma-space-2); }
.t-toc li::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--pma-rule-input); min-inline-size: 2rem; }
.t-toc__p { order: 2; font-family: var(--pma-font-display); font-weight: var(--pma-weight-display); font-size: var(--pma-text-md); color: var(--pma-ink-2); font-variant-numeric: lining-nums tabular-nums; }
.t-quotes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pma-rule); }
.t-quotes > li { padding: var(--pma-space-4) 0; border-bottom: 1px solid var(--pma-rule-soft); }
.t-quotes__fact { display: flex; flex-wrap: wrap; gap: var(--pma-space-1) var(--pma-space-3); align-items: baseline; }
.t-snippet {
  margin: var(--pma-space-2) 0 0; padding: var(--pma-space-2) var(--pma-space-3); max-width: 46rem;
  background: var(--pma-surface-alt); border-inline-start: 2px solid var(--pma-rule-input);
  color: var(--pma-ink-2); font-size: var(--pma-text-sm); line-height: 1.75; overflow-wrap: anywhere;
}
.t-snippet--sm { margin-top: var(--pma-space-1); }
.t-snippet__p { float: inline-end; margin-inline-start: var(--pma-space-3); font-size: var(--pma-text-md); font-weight: var(--pma-weight-display); color: var(--pma-ink-muted); line-height: 1.4; }
.t-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pma-space-7); }
.t-two > .t-sec { padding-top: var(--pma-space-4); border-top: 1px solid var(--pma-rule); }
.t-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--pma-rule-input); border-radius: var(--pma-radius-control); overflow: hidden; margin: 0 0 var(--pma-space-2); }
.t-seg button {
  min-height: var(--pma-tap); padding: 0 var(--pma-space-5); border: 0; border-inline-start: 1px solid var(--pma-rule);
  background: var(--pma-surface); color: var(--pma-ink-2); font: inherit; cursor: pointer;
}
.t-seg button:first-child { border-inline-start: 0; }
.t-seg button:hover { background: var(--pma-surface-alt); }
.t-seg button:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--pma-focus); }
.t-seg button[aria-pressed="true"] { background: var(--pma-brand-tint); color: var(--pma-ink); font-weight: var(--pma-weight-bold); box-shadow: inset 0 -3px 0 var(--pma-brand); }
.t-seg .t-outcome { color: inherit; }
.t-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--pma-space-3); margin-top: var(--pma-space-3); }
.t-inline .pma-field { flex: 1 1 16rem; min-width: 0; }

/* ---------------------------------------------------------------- forms: the job ticket (依頼票) and the edit form */
.t-ticket { max-width: 54rem; padding: var(--pma-space-6); border: 1px solid var(--pma-rule); background: var(--pma-surface); }
.t-ticket__head { display: grid; gap: var(--pma-space-1); padding-bottom: var(--pma-space-4); margin-bottom: var(--pma-space-2); border-bottom: 1px solid var(--pma-rule-strong); }
.t-ticket__name { font-size: var(--pma-text-lg); font-weight: var(--pma-weight-bold); letter-spacing: var(--pma-tracking-heading); }
.t-ticket__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pma-space-4); margin-top: var(--pma-space-5); padding-top: var(--pma-space-5); border-top: 1px solid var(--pma-rule-strong); }
.t-ticket__foot .t-hint { flex: 1 1 20rem; max-width: var(--pma-measure); }
.t-group { margin: 0; padding: var(--pma-space-5) 0; border: 0; border-bottom: 1px solid var(--pma-rule-soft); min-width: 0; }
.t-group:last-of-type { border-bottom: 0; }
.t-group > legend { display: flex; align-items: baseline; gap: var(--pma-space-3); padding: 0; margin-bottom: var(--pma-space-2); font-weight: var(--pma-weight-bold); font-size: var(--pma-text-md); }
.t-group > legend + * { margin-top: 0; }
.t-group__no { font-size: var(--pma-text-xl); font-weight: var(--pma-weight-display); color: var(--pma-ink-muted); font-variant-numeric: lining-nums tabular-nums; line-height: 1; }
.t-group__label { font-weight: var(--pma-weight-bold); font-size: var(--pma-text-sm); margin-bottom: var(--pma-space-2); }
.t-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pma-space-5) var(--pma-space-6); align-items: start; }
.t-form .pma-field, .t-ticket .pma-field { align-content: start; }
.t-span2 { grid-column: 1 / -1; }
textarea.pma-input { resize: vertical; line-height: 1.7; }
.t-checks-grid { display: flex; flex-wrap: wrap; gap: var(--pma-space-2); }
.t-checkbox {
  display: inline-flex; align-items: center; gap: var(--pma-space-2); min-height: var(--pma-tap); padding: 0 var(--pma-space-4) 0 var(--pma-space-3);
  border: 1px solid var(--pma-rule-input); border-radius: var(--pma-radius-control); background: var(--pma-surface); cursor: pointer;
  transition: background-color var(--pma-duration) var(--pma-ease);
}
.t-checkbox input { inline-size: 1.125rem; block-size: 1.125rem; margin: 0; accent-color: var(--pma-brand); }
.t-checkbox:hover { background: var(--pma-surface-alt); }
.t-checkbox:has(input:checked) { background: var(--pma-brand-tint); border-color: var(--pma-brand); font-weight: var(--pma-weight-bold); }
.t-checkbox:has(input:focus-visible) { box-shadow: var(--pma-focus-ring); }
.t-edit__lead { max-width: var(--pma-measure); margin-bottom: var(--pma-space-2); }
.t-form { max-width: 54rem; }
.t-form__submit { margin-top: var(--pma-space-4); }
.t-pricerow { padding: var(--pma-space-4) 0; border-top: 1px solid var(--pma-rule-soft); }
.t-pricerow__label { font-weight: var(--pma-weight-bold); margin-bottom: var(--pma-space-3); }
.t-pricerow__fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--pma-space-3) var(--pma-space-4); }

/* ---------------------------------------------------------------- the workbench: 台割 (flatplan) strip */
.t-making { padding: var(--pma-space-5); border: 1px solid var(--pma-rule); }
.t-making .t-h2 { font-size: var(--pma-text-md); }
.t-progress { list-style: none; margin: 0 0 var(--pma-space-4); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pma-space-3); }
.t-progress li { position: relative; display: grid; gap: var(--pma-space-1); padding-top: var(--pma-space-3); border-top: 3px solid var(--pma-rule-soft); color: var(--pma-ink-muted); }
.t-progress li[data-state="done"] { border-top-color: var(--pma-ok-mark); color: var(--pma-ink-2); }
.t-progress li[data-state="now"] { border-top-color: var(--pma-brand); color: var(--pma-ink); }
.t-progress li[data-state="now"]::before { content: ""; position: absolute; inset: -3px 0 auto; block-size: 3px; background: var(--pma-paper); opacity: 0; animation: t-pulse 1.6s var(--pma-ease) infinite; }
.t-progress__no { font-size: var(--pma-text-xl); font-weight: var(--pma-weight-display); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.t-progress__label { font-weight: var(--pma-weight-bold); }
.t-progress__state { font-size: var(--pma-text-sm); min-block-size: 1.5em; }
.t-progress li[data-state="done"] .t-progress__state { color: var(--pma-ok-fg); }
.t-progress li[data-state="now"] .t-progress__state { color: var(--pma-brand); font-weight: var(--pma-weight-bold); }
@keyframes t-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .t-progress li[data-state="now"]::before { animation: none; } .pma-btn:active { transform: none; } }

/* The light table: the strip sits on the wash with crop marks, each section a spread with centre marks. */
.t-flat {
  margin-top: var(--pma-space-2); padding: var(--pma-space-4);
  --m: var(--pma-ink-muted);
  background:
    linear-gradient(var(--m), var(--m)) top left / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top left / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) top right / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / 1px 14px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / 1px 14px no-repeat,
    var(--pma-surface-alt);
}
.t-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: var(--pma-space-2); }
.t-spread { display: contents; }
.t-face {
  grid-row: 1; position: relative; display: flex; flex-direction: column; gap: var(--pma-space-2);
  min-height: 10.5rem; padding: var(--pma-space-3) 10px; background: var(--pma-surface); border: 1px solid var(--pma-rule);
  color: var(--pma-ink); text-decoration: none;
  transition: border-color var(--pma-duration) var(--pma-ease);
}
/* centre marks (トンボの中心): where a spread folds */
.t-face::before, .t-face::after { content: ""; position: absolute; inset-inline-start: 50%; inline-size: 1px; block-size: 6px; background: var(--pma-rule-input); }
.t-face::before { top: -1px; }
.t-face::after { bottom: -1px; }
.t-face:hover { border-color: var(--pma-brand); }
.t-face:focus-visible { outline: none; box-shadow: var(--pma-focus-ring); }
.t-face[aria-current="true"] { border-color: var(--pma-ink); box-shadow: inset 0 3px 0 var(--pma-brand); }
.t-face__no { font-size: var(--pma-text-2xl); font-weight: var(--pma-weight-display); line-height: 1; font-variant-numeric: lining-nums tabular-nums; color: var(--pma-ink-muted); }
.t-face[aria-current="true"] .t-face__no { color: var(--pma-brand); }
.t-face__h { font-size: var(--pma-text-sm); font-weight: var(--pma-weight-bold); line-height: 1.45; letter-spacing: -0.03em; word-break: auto-phrase; }
.t-face__marks { display: flex; flex-wrap: wrap; gap: var(--pma-space-1); }
.t-mark { display: inline-flex; align-items: center; gap: 0.25em; padding: 0 0.5em; border-radius: var(--pma-radius-pill); font-size: var(--pma-text-xs); font-weight: var(--pma-weight-bold); line-height: 1.7; white-space: nowrap; }
.t-mark svg { inline-size: 0.9em; block-size: 0.9em; }
.t-mark[data-mark="attn"] { color: var(--pma-attn-fg); background: var(--pma-attn-bg); }
.t-mark[data-mark="hyp"] { color: var(--pma-ink-2); box-shadow: inset 0 0 0 1px var(--pma-attn-mark); }
.t-face__src { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--pma-space-1); }
.t-src--mini { display: inline-block; padding: 0 0.5em; border-radius: var(--pma-radius-pill); background: var(--pma-surface-alt); color: var(--pma-ink-2); font-size: var(--pma-text-xs); line-height: 1.7; white-space: nowrap; max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; }
.t-face__new { font-size: var(--pma-text-xs); color: var(--pma-ink-muted); }

.t-sheet { grid-row: 2; grid-column: 1 / -1; margin-top: var(--pma-space-3); padding: var(--pma-space-6); background: var(--pma-surface); border: 1px solid var(--pma-ink); }
.t-sheet__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--pma-space-3) var(--pma-space-5); padding-bottom: var(--pma-space-4); margin-bottom: var(--pma-space-4); border-bottom: 1px solid var(--pma-rule); }
.t-sheet__title { display: flex; align-items: baseline; gap: var(--pma-space-3); font-size: var(--pma-text-xl); font-weight: var(--pma-weight-bold); letter-spacing: var(--pma-tracking-heading); }
.t-sheet__no { font-size: var(--pma-text-2xl); font-weight: var(--pma-weight-display); color: var(--pma-brand); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.t-sheet__src { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pma-space-2); }
.t-sheet__checks { margin-bottom: var(--pma-space-4); padding: var(--pma-space-3) var(--pma-space-4); background: var(--pma-surface-alt); border-inline-start: 3px solid var(--pma-attn-mark); }
.t-sheet__checks ul { list-style: none; margin: var(--pma-space-2) 0 0; padding: 0; display: grid; gap: var(--pma-space-2); }
.t-sheet__checks li, .t-price__checks li, .t-price__check { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--pma-space-2); }
.t-src {
  position: relative; display: inline-flex; align-items: baseline; gap: 0.4em; padding: 0.1em 0.75em; border: 1px solid var(--pma-rule);
  border-radius: var(--pma-radius-pill); color: var(--pma-link); font-size: var(--pma-text-sm); line-height: 1.6; text-decoration: none; white-space: nowrap;
}
.t-src::before { content: ""; position: absolute; inset: -8px -2px; } /* 44px hit area */
.t-src:hover { border-color: var(--pma-brand); background: var(--pma-brand-tint); }
.t-src__p { font-family: var(--pma-font-display); font-weight: var(--pma-weight-display); color: var(--pma-ink-muted); }
.t-copy { max-width: var(--pma-measure); line-height: var(--pma-leading-body); }
.t-copy p { margin-bottom: var(--pma-space-4); }
.t-copy__list { margin: 0 0 var(--pma-space-4); padding-inline-start: 1.1em; list-style-type: "・"; }
.t-copy__list li { padding-inline-start: 0.1em; }
.t-hyp {
  display: inline-block; margin-inline-end: 0.35em; padding: 0 0.35em; border: 1px solid var(--pma-attn-mark); border-radius: 2px;
  background: transparent; color: var(--pma-attn-fg); font-size: 0.75em; font-weight: var(--pma-weight-bold); line-height: 1.5; vertical-align: 0.12em;
}
.t-hyp-note { max-width: var(--pma-measure); }

/* The price: a written calculation, set like an equation in tabular figures; the conclusion carries a double rule. */
.t-price { margin-top: var(--pma-space-5); padding-top: var(--pma-space-2); border-top: 1px solid var(--pma-rule-strong); max-width: 52rem; }
.t-price .t-sub { margin-top: var(--pma-space-3); }
.t-price__line { padding: var(--pma-space-4) 0; border-bottom: 1px solid var(--pma-rule-soft); }
.t-price__line[data-status="needs_check"] .t-eq { color: var(--pma-ink-2); }
.t-eq { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--pma-space-1) var(--pma-space-3); font-variant-numeric: lining-nums tabular-nums; font-size: var(--pma-text-base); line-height: 1.6; }
.t-eq--big { font-size: var(--pma-text-md); }
.t-eq__medium { font-family: var(--pma-font-display); font-weight: var(--pma-weight-bold); font-size: 1.25em; letter-spacing: 0.02em; margin-inline-end: var(--pma-space-1); }
.t-eq__term { display: inline-flex; align-items: baseline; gap: 0.2em; white-space: nowrap; }
.t-eq__lbl { color: var(--pma-ink-muted); font-size: var(--pma-text-sm); margin-inline-end: 0.2em; }
.t-eq__v { font-weight: var(--pma-weight-medium); }
.t-eq__v[data-unknown] { padding: 0 0.4em; background: var(--pma-attn-bg); color: var(--pma-attn-fg); font-weight: var(--pma-weight-bold); border-radius: 2px; }
.t-eq__u { color: var(--pma-ink-2); font-size: 0.85em; }
.t-eq__op { color: var(--pma-ink-muted); font-weight: var(--pma-weight-regular); }
.t-eq__tag { display: inline-block; padding: 0 0.35em; border: 1px solid var(--pma-rule); border-radius: 2px; color: var(--pma-ink-2); font-size: var(--pma-text-xs); font-weight: var(--pma-weight-medium); line-height: 1.6; margin-inline-start: 0.3em; vertical-align: 0.1em; }
.t-eq__then { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--pma-space-1) var(--pma-space-2); }
.t-eq__special .t-eq__v, .t-eq__v.t-eq__special { font-weight: var(--pma-weight-bold); border-bottom: 3px double var(--pma-ink); }
.t-eq__pct { color: var(--pma-ink-2); font-size: 0.9em; }
.t-price__check { margin-top: var(--pma-space-2); font-size: var(--pma-text-sm); }
.t-price__basis { margin-top: var(--pma-space-2); color: var(--pma-ink-2); font-size: var(--pma-text-sm); }
.t-price__notes { list-style: none; margin: var(--pma-space-2) 0 0; padding: 0; }
.t-price__src { list-style: none; margin: var(--pma-space-3) 0 0; padding: 0; display: grid; gap: var(--pma-space-3); }
.t-price__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--pma-space-2); margin-top: var(--pma-space-3); padding-top: var(--pma-space-3); border-top: 1px solid var(--pma-ink); font-size: var(--pma-text-lg); font-variant-numeric: lining-nums tabular-nums; }
.t-price__checks { list-style: none; margin: var(--pma-space-3) 0 0; padding: 0; display: grid; gap: var(--pma-space-2); font-size: var(--pma-text-sm); }
.t-required { margin-top: var(--pma-space-5); padding: var(--pma-space-4); border: 1px solid var(--pma-rule); }
.t-required__h { font-size: var(--pma-text-base); font-weight: var(--pma-weight-bold); }
.t-required ul { margin: var(--pma-space-2) 0 0; padding-inline-start: 1.1em; display: grid; gap: var(--pma-space-1); }

.t-matches { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pma-rule); }
.t-matches li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--pma-space-4); align-items: baseline; padding: var(--pma-space-3) 0; border-bottom: 1px solid var(--pma-rule-soft); }
.t-matches li .t-row__no { font-size: var(--pma-text-lg); }
.t-matches__t { font-weight: var(--pma-weight-bold); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- the door (signed out / errors) */
.t-door { max-width: 36rem; margin: var(--pma-space-7) auto; display: grid; gap: var(--pma-space-4); }
.t-door__en { font-size: var(--pma-text-3xl); font-weight: var(--pma-weight-display); letter-spacing: var(--pma-tracking-display); line-height: var(--pma-leading-display); text-transform: uppercase; color: var(--pma-ink-muted); }
.t-door__title { font-size: var(--pma-text-xl); font-weight: var(--pma-weight-bold); padding-bottom: var(--pma-space-3); border-bottom: 1px solid var(--pma-rule-strong); }
.t-door__reason { color: var(--pma-blocked-fg); font-weight: var(--pma-weight-bold); }
.t-door__body { color: var(--pma-ink-2); line-height: var(--pma-leading-body); }
.t-door__dev { margin-top: var(--pma-space-5); padding-top: var(--pma-space-4); border-top: 1px solid var(--pma-rule-soft); display: grid; gap: var(--pma-space-2); justify-items: start; }

.t-foot { padding-block: 0 var(--pma-space-6); color: var(--pma-ink-muted); font-size: var(--pma-text-sm); }
.t-foot p { padding-top: var(--pma-space-5); border-top: 1px solid var(--pma-rule); }
.t-foot__en { font-size: var(--pma-text-md); font-weight: var(--pma-weight-display); color: var(--pma-ink-2); letter-spacing: var(--pma-tracking-display); }

/* ---------------------------------------------------------------- narrower desks: the strip becomes a run of compact blocks */
@media (max-width: 1079px) {
  .t-flat { padding: var(--pma-space-3); }
  .t-strip { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--pma-space-2); }
  .t-spread { display: block; }
  .t-face { min-height: var(--pma-tap); flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--pma-space-1) var(--pma-space-3); padding: var(--pma-space-3) var(--pma-space-4); }
  .t-face::before, .t-face::after { display: none; }
  .t-face[aria-current="true"] { box-shadow: inset 3px 0 0 var(--pma-brand); }
  .t-face__no { font-size: var(--pma-text-xl); min-inline-size: 2ch; }
  .t-face__h { font-size: var(--pma-text-base); flex: 1 1 auto; }
  .t-face__src { margin-top: 0; flex-basis: 100%; padding-inline-start: calc(2ch + var(--pma-space-3) + 0.4em); }
  .t-face__src:empty { display: none; }
  .t-sheet { margin-top: 0; border-top: 0; padding: var(--pma-space-4); }
  .t-sheet__title { display: none; } /* the face right above already names the section */
  .t-sheet__head { padding-bottom: var(--pma-space-3); }
  .t-sheet__head:not(:has(.t-sheet__src)) { display: none; }
}
@media (max-width: 900px) {
  .t-row { grid-template-columns: 2.25rem minmax(0, 1fr); padding-inline-end: 0; }
  .t-row__no { font-size: var(--pma-text-lg); }
  .t-row__meta, .t-row__state { grid-column: 2; justify-content: flex-start; }
  .t-two { grid-template-columns: minmax(0, 1fr); gap: var(--pma-space-5); }
}
@media (max-width: 760px) {
  .t-main { padding-block: var(--pma-space-5) var(--pma-space-7); }
  .t-bar__in { gap: 0 var(--pma-space-3); }
  .t-brand__en { display: none; }
  .t-who { margin-inline-start: auto; gap: var(--pma-space-1); }
  .t-who__name, .t-hide-sm { display: none; }
  .t-brand { gap: var(--pma-space-2); }
  .t-brand__logo { block-size: 28px; }
  .t-brand__name { font-size: var(--pma-text-sm); }
  .t-nav { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--pma-gutter)); padding: 0 var(--pma-gutter); border-top: 1px solid var(--pma-rule-soft); gap: 0; }
  .t-nav a { min-height: var(--pma-tap); flex: 1; justify-content: center; }
  .t-head__act { flex-direction: column; align-items: stretch; }
  .t-head__act .pma-btn { inline-size: 100%; }
  .t-grid2 { grid-template-columns: minmax(0, 1fr); }
  .t-ticket { padding: var(--pma-space-4); }
  .t-ticket__foot .pma-btn { inline-size: 100%; }
  .t-facts > div { grid-template-columns: minmax(0, 1fr); gap: var(--pma-space-1); }
  .t-check { grid-template-columns: minmax(0, 1fr); }
  .t-progress { grid-template-columns: minmax(0, 1fr); }
  .t-intake__drop, .t-intake--first .t-intake__drop { padding: var(--pma-space-4); }
  .t-intake__act .pma-btn { flex: 1 1 auto; }
  .t-checks { padding: var(--pma-space-4); }
  .t-sheet__title { font-size: var(--pma-text-lg); }
  .t-eq--big { font-size: var(--pma-text-base); }
  .t-snippet__p { float: none; display: block; margin: 0; }
}

/* ---------------------------------------------------------------- print view (A4) */
.t-print { background: var(--pma-paper); }
.t-print .t-main { max-width: 46rem; padding-block: var(--pma-space-5); }
.t-print__bar { padding: var(--pma-space-3) var(--pma-gutter); border-bottom: 1px solid var(--pma-rule); font-size: var(--pma-text-sm); color: var(--pma-ink-muted); }
.t-print__bar a { display: inline-flex; align-items: center; min-height: var(--pma-tap); }
.t-print__head { display: flex; gap: var(--pma-space-5); align-items: flex-start; padding-bottom: var(--pma-space-4); margin-bottom: var(--pma-space-5); border-bottom: 1px solid var(--pma-ink); }
.t-print__head h1 { font-size: var(--pma-text-xl); }
.t-print__kicker { color: var(--pma-ink-muted); font-size: var(--pma-text-sm); }
.t-print__sec { padding: var(--pma-space-3) 0 var(--pma-space-4); border-bottom: 1px solid var(--pma-rule-soft); line-height: 1.8; }
.t-print__sec h2 { display: flex; align-items: baseline; gap: var(--pma-space-3); font-size: var(--pma-text-md); margin-bottom: var(--pma-space-2); break-after: avoid; }
.t-print__sec p, .t-print__sec ul { margin: 0 0 var(--pma-space-2); }
.t-print__sec ul { padding-inline-start: 1.1em; list-style-type: "・"; }
.t-print__no { font-size: var(--pma-text-lg); font-weight: var(--pma-weight-display); color: var(--pma-ink-muted); }
.t-print__note { color: var(--pma-attn-fg); font-size: var(--pma-text-sm); }
.t-print__src { color: var(--pma-ink-muted); font-size: var(--pma-text-sm); }
@page { size: A4; margin: 16mm 18mm; }
@media print {
  :root { color-scheme: light; }
  .t-noprint { display: none !important; }
  .t-print .t-main { max-width: none; padding: 0; }
  body { font-size: 10.5pt; }
  .t-print__sec { break-inside: avoid-page; }
}
#estimates { padding-top: var(--pma-space-4); border-top: 1px solid var(--pma-rule); }
