/* Customer workspace — all surfaces and artwork are served by this origin. */
:root {
  color-scheme: light;
  --paper: #f5f5ef;
  --surface: #fffef9;
  --ink: #172d2b;
  --muted: #526662;
  --line: #d5ddd3;
  --edge: #b8c9ba;
  --forest: #134a45;
  --forest-dark: #0e3436;
  --wash: #eaf2e7;
  --lime: #d5edac;
  --accent: #ae562e;
  --radius: 19px;
  --shadow: 0 2px 5px #20382b06, 0 13px 28px -24px #173d3660;
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, dl { margin: 0; }
h1, h2, h3 { line-height: 1.32; text-wrap: pretty; }
h1 { font-size: clamp(1.9rem, 4.1vw, 3.15rem); letter-spacing: -.035em; }
h2 { font-size: 1.12rem; letter-spacing: .015em; }
h3 { font-size: .96rem; }
p, h1, h2, h3, dd, .button, .product-label { overflow-wrap: anywhere; }
a { color: var(--forest); text-underline-offset: .22em; }
button, input, select { font: inherit; }
button, .button, summary { touch-action: manipulation; }
button, .button, select, summary { cursor: pointer; }
input, select, button { color: var(--ink); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 42px; border: 1px solid var(--edge); border-radius: 9px; padding: .55rem 1rem;
  background: var(--surface); font-weight: 650; font-size: .88rem; line-height: 1.4; text-decoration: none;
}
a, button, input, select, summary { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
button:hover, .button:hover { border-color: #7d9a89; background: #eef3e9; }
button:disabled { opacity: .57; cursor: default; }
.primary { color: white; background: var(--forest); border-color: var(--forest); }
.primary:hover { background: #0b3b37; border-color: #0b3b37; }
.forward::after, .back-link::before {
  content: ""; display: inline-block; flex: none; width: .48em; height: .48em;
  border-top: 1.8px solid currentColor; border-right: 1.8px solid currentColor; transform: rotate(45deg);
}
:focus-visible { outline: 3px solid #a55a23; outline-offset: 3px; }
.skip { position: fixed; z-index: 3; left: 1rem; top: -5rem; border-radius: 8px; padding: .6rem 1rem; background: white; }
.skip:focus { top: .7rem; }
header { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar, main { width: min(calc(100% - clamp(2rem, 8vw, 7.5rem)), 67.5rem); margin-inline: auto; }
.bar { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .64rem; color: var(--ink); text-decoration: none; font-weight: 750; white-space: nowrap; }
.brand-mark { position: relative; width: 34px; height: 34px; background: var(--forest); border-radius: 10px; flex: none; }
.brand-mark::before, .brand-mark::after { position: absolute; content: ""; border-radius: 1px 8px 8px 1px; transform: skewY(-13deg); }
.brand-mark::before { inset: 8px 7px 8px 9px; border: 3px solid #e2f2c4; border-left-width: 4px; }
.brand-mark::after { inset: 13px 12px 11px 14px; background: #96c5af; }
.brand-name { font-size: 1.05rem; letter-spacing: .065em; }
.brand-service { color: var(--muted); font-weight: 600; border-left: 1px solid var(--line); padding-left: .8rem; margin-left: .15rem; font-size: .79rem; }
nav { display: flex; align-items: center; gap: .35rem; }
nav > a { padding: .56rem .92rem; border-radius: 7px; color: var(--muted); font-size: .85rem; font-weight: 650; text-decoration: none; }
nav > a:hover, nav > a[aria-current] { color: var(--forest); background: var(--wash); }
#logout { color: var(--muted); margin-left: .6rem; font-size: .77rem; min-height: 36px; background: transparent; }
main { padding-block: clamp(1.2rem, 2.8vw, 2.25rem) 5rem; }
main:focus:not(:focus-visible) { outline: none; }
.stack, .projects, .order-flow { display: grid; align-content: start; gap: 1.15rem; min-width: 0; }
.material { background-color: var(--forest-dark); background-image: radial-gradient(ellipse at 90% 60%, #30615b, transparent 59%), linear-gradient(108deg, #102f32, #104744); color: #f7f8e9; isolation: isolate; overflow: hidden; }
.material::after { content: ""; position: absolute; pointer-events: none; z-index: -2; inset: 0 0 0 40%; background-image: linear-gradient(#e1f6e00c 1px,transparent 1px),linear-gradient(90deg,#e1f6e00c 1px,transparent 1px); background-size: 33px 33px; mask-image: linear-gradient(100deg,transparent,#000 67%); }
.weave { display: block; position: absolute; z-index: -1; right: -1%; top: 50%; transform: translateY(-50%); width: 59%; height: auto; pointer-events: none; }
.page-head { position: relative; border-radius: var(--radius); min-height: 10.8rem; padding: clamp(1.5rem, 3.8vw, 3.1rem); display: flex; align-items: center; }
.page-head > .weave { mask-image: linear-gradient(90deg,transparent,#000 20%); }
.order-head { min-height: 7.6rem; padding-block: 1.2rem; }
.order-head h1 { font-size: clamp(1.7rem,3.4vw,2.6rem); }
.head-copy { position: relative; width: fit-content; max-width: 61%; display: flex; align-items: baseline; gap: .5rem .92rem; flex-wrap: wrap; }
.head-copy h1 { max-width: 100%; }
.company { flex: 1 0 100%; font-size: .8rem; font-weight: 650; letter-spacing: .045em; color: var(--muted); }
.material .company { color: #c0dbcb; }
.head-count { padding: .12rem .6rem; border: 1px solid #83ac93; border-radius: 5px; color: #e3efd7; font-size: .78rem; font-variant-numeric: tabular-nums; }
.head-copy > .button { flex-basis: auto; margin-top: .45rem; }
.head-copy:has(.button) h1 { flex: 1 0 100%; }
.material .primary { background: var(--lime); border-color: var(--lime); color: #13342d; }
.material .primary:hover { background: #e3f5c4; }
.compact-head { min-height: auto; padding: .1rem 0 .45rem; }
.compact-head h1 { font-size: clamp(1.75rem, 3.3vw, 2.6rem); }
.compact-head .head-copy { max-width: 100%; }
.back-link { justify-self: start; display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 650; min-height: 30px; }
.back-link::before { transform: rotate(-135deg); }
.card, .project-card, .login-panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card, .project-card { padding: clamp(1.1rem, 2.55vw, 2rem); }
.card > h2 { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-bottom: 1.1rem; }
.tally { color: var(--muted); margin-left: auto; font-size: .75rem; font-weight: 550; }
.project-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.project-title { display: flex; align-items: center; gap: .8rem; font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.project-title::before { content: ""; width: .36rem; height: 1.2em; border-radius: 4px; background: #94b49b; }
.project-title a { color: var(--ink); text-decoration: none; }
.project-title a:hover, .back-link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.item-preview { border-top: 1px solid var(--line); margin-top: 1.1rem; }
.item-preview > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 44px; color: var(--forest); font-weight: 650; font-size: .9rem; padding-top: .4rem; }
.item-preview > summary::-webkit-details-marker { display: none; }
.item-preview > summary::after { content: ""; width: .55rem; height: .55rem; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); margin-right: .3rem; }
.item-preview[open] > summary::after { transform: rotate(225deg); }
.family + .family { margin-top: 1rem; }
.family > h3 { margin: .05rem 0 .6rem; font-size: .83rem; font-weight: 650; color: var(--muted); line-height: 1.5; }
.family-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .24rem .62rem; }
.family-heading strong { color: var(--ink); font-size: .97rem; letter-spacing: .01em; }
.family-heading span { font-weight: 500; }
.catalogue { list-style: none; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(11.6rem,100%),1fr)); gap: .55rem; padding: 0; }
.catalogue li { min-width: 0; padding: .78rem .88rem; background: #f5f7ef; border: 1px solid #dde4d8; border-radius: 10px; }
.product-label { display: flex; align-items: center; gap: .62rem; color: var(--ink); min-width: 0; margin: 0; }
.product-copy, .terms { display: flex; min-width: 0; }
.product-copy strong { font-size: .93rem; font-weight: 690; }
.swatch, .item-mark { display: inline-block; flex: none; width: 1.18rem; height: 1.18rem; border-radius: .34rem; border: 1px solid #20372c35; background-color: var(--tone, #a5b5a3); background-image: repeating-linear-gradient(125deg,transparent 0 2px,#ffffff45 2px 3px); }
.tone-white { --tone: #f9fbf3; } .tone-blue { --tone: #73adc6; } .tone-green { --tone: #8ab69c; }
.tone-pink { --tone: #dba7aa; } .tone-black { --tone: #556166; } .tone-gray { --tone: #9aaba8; }
.tone-sand { --tone: #c9bba1; } .tone-yellow { --tone: #dbc888; }
.terms { flex-wrap: wrap; align-items: baseline; gap: .15rem .65rem; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.catalogue .terms { margin-top: .43rem; }
.piece-price strong { font-size: 1.12rem; line-height: 1.28; color: var(--forest); font-weight: 670; letter-spacing: -.025em; }
.pack { white-space: nowrap; }
.reports { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(15rem, .85fr); gap: 1rem; align-items: start; }
.reports select { width: auto; }
.reports h2:not(:first-child) { margin: 1rem 0 .45rem; }
.empty { padding: 1rem 1.1rem; border: 1px dashed var(--edge); border-radius: 9px; background: #f7f8f2; color: var(--muted); font-size: .9rem; }
.reports select + div { margin-top: .7rem; }
.help, .muted, .sum-label { color: var(--muted); font-size: .82rem; }
#message:not(:empty), .notice, .feedback:not(:empty) { margin-block: .8rem; border-left: 3px solid var(--accent); padding: .55rem .8rem; background: #faf0e5; color: #713b22; font-size: .88rem; }
.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .87rem; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: start; }
th { color: var(--muted); font-size: .77rem; white-space: nowrap; background: #f2f5ef; }
td { overflow-wrap: anywhere; }
dl { display: grid; grid-template-columns: minmax(5rem,9rem) 1fr; gap: .45rem .8rem; margin-bottom: 1rem; }
dt { color: var(--muted); } dd { margin: 0; }
input, select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #a3b6a9; border-radius: 8px; padding: .55rem .78rem; background: #fff; }
label { display: block; margin-bottom: .36rem; font-size: .86rem; font-weight: 630; }
.login-panel { overflow: hidden; display: grid; grid-template-columns: .92fr 1.08fr; max-width: 52rem; margin: clamp(1rem, 7vh, 5rem) auto 0; }
.login-art { min-height: 14rem; position: relative; }
.login-art .weave { width: 152%; right: -22%; }
.login-body { padding: clamp(1.55rem, 4.1vw, 3.25rem); align-self: center; }
.login-body h1 { font-size: 2rem; margin-bottom: 1.6rem; }
#credentials .primary { margin-top: 1.3rem; width: 100%; }
#credentials label:not(:first-child) { margin-top: 1rem; }
#login:not([hidden]) + #message { max-width: 52rem; margin-inline: auto; }
.order-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(14.5rem,18rem); gap: 1.1rem; align-items: start; }
.order-flow .card { padding: clamp(1.05rem, 2.15vw, 1.6rem); }
.file-controls { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.drop-hint { color: var(--muted); font-size: .76rem; }
.documents.is-dragging { outline: 2px dashed var(--forest); outline-offset: -6px; background: #edf4e7; }
@media (pointer: coarse) { .drop-hint { display: none; } }
.file-field { position: relative; display: inline-flex; margin-top: .7rem; }
.file-field input { position: absolute; opacity: 0; inset: 0; height: 100%; padding: 0; cursor: pointer; }
.file-field label { display: inline-flex; align-items: center; gap: .6rem; color: var(--forest); border: 1px solid var(--edge); background: #eef4e9; border-radius: 8px; padding: .55rem .9rem; margin: 0; min-height: 42px; font-weight: 650; }
.file-field label::before { content: "↑"; font-size: 1rem; }
.file-field:focus-within { border-radius: 8px; outline: 3px solid #a55a23; outline-offset: 3px; }
.file-list { list-style: none; padding: 0; }
.file-list li { display: flex; align-items: center; gap: .5rem; justify-content: space-between; overflow-wrap: anywhere; margin-top: .6rem; font-size: .84rem; }
.file-list button { min-height: 36px; font-size: .76rem; padding: .3rem .6rem; }
.readout:empty { display: none; }
.readout:not(:empty) { margin-top: .75rem; }
.read-head { display: flex; justify-content: space-between; gap: .65rem; flex-wrap: wrap; align-items: baseline; margin-bottom: .5rem; }
.read-head strong { color: var(--forest); font-size: .9rem; }
.read-head span { font-size: .74rem; color: var(--muted); }
.readout td:nth-child(2), .readout td:nth-child(3), .readout td:nth-child(4) { white-space: nowrap; }
.readout button { margin-top: .5rem; }
.quantity-row { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) auto; align-items: center; column-gap: .8rem; padding: .43rem .3rem .43rem .55rem; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.quantity-row:last-child { border-bottom: 1px solid var(--line); }
.quantity-row.is-selected { background: #eff5e9; border-left-color: #6c9a78; }
.quantity-row .terms { display: grid; gap: 0; }
.quantity-row label { margin-bottom: 0; }
.stepper { display: inline-grid; grid-template-columns: 38px 2.8rem 38px; align-items: stretch; border: 1px solid var(--edge); border-radius: 8px; background: white; }
.stepper button, .stepper input { padding: .3rem .1rem; min-height: 40px; }
.stepper button { color: var(--forest); background: #f2f6ee; border: 0; border-radius: 7px 0 0 7px; font-size: 1.05rem; font-weight: 580; }
.stepper button:last-child { border-radius: 0 7px 7px 0; }
.stepper button:hover { background: #e2ecdd; }
.stepper input { appearance: textfield; -moz-appearance: textfield; border: 0; border-inline: 1px solid var(--line); border-radius: 0; text-align: center; font-weight: 640; font-variant-numeric: tabular-nums; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem 1rem; }
.control { min-width: 0; }
.field-grid + .control, .control + .address, .address + .control { margin-top: .85rem; }
.address .control:has(#ship_to_address) { grid-column: 1 / -1; }
.checkout { position: sticky; top: 1rem; border-top: 4px solid var(--forest); padding: 1.2rem; }
.checkout > h2 { margin-bottom: 1.15rem; }
.subtotal { display: block; font-size: clamp(1.6rem,2.8vw,2.3rem); font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.selected-qty { color: var(--muted); font-size: .84rem; margin: .15rem 0 1rem; }
.checkout > .primary { width: 100%; }
.order-review:not(:empty) { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 1rem; display: grid; gap: .65rem; }
.order-review p { font-size: .82rem; }
.order-review button { background: var(--forest); color: white; }
.order-review td, .order-review th { padding: .4rem .32rem; font-size: .74rem; }
@media (max-width: 49rem) {
  .bar, main { width: calc(100% - 2rem); }
  .order-form { grid-template-columns: minmax(0,1fr); }
  .checkout { position: static; }
  .reports { grid-template-columns: minmax(0,1fr); }
  .stepper { grid-template-columns: 44px 3rem 44px; }
  .stepper button, .stepper input { min-height: 44px; }
  input, select { font-size: 16px; }
}
@media (max-width: 37rem) {
  .bar, main { width: calc(100% - 1.5rem); }
  .bar { min-height: 3.65rem; align-items: flex-start; justify-content: center; flex-direction: column; gap: .45rem; padding-block: .6rem; }
  nav { justify-content: flex-start; width: 100%; }
  nav > a, #logout { min-height: 44px; display: inline-flex; align-items: center; }
  #logout { margin-left: auto; }
  .stack, .projects, .order-flow { gap: .8rem; }
  .page-head:not(.compact-head) { min-height: 9rem; padding: 1.25rem; }
  .head-copy { max-width: 78%; }
  .material .weave { right: -16%; width: 67%; opacity: .63; mask-image: linear-gradient(90deg,transparent,#000 32%); }
  .page-head .company { font-size: .72rem; }
  .page-head.order-head { min-height: 7rem; }
  .family-heading span { font-size: .76rem; }
  .project-row { gap: .8rem; }
  .project-row .actions { flex-basis: 100%; }
  button, .button { min-height: 44px; }
  .catalogue { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; }
  .catalogue li { padding: .62rem .53rem; }
  .catalogue .terms { display: grid; gap: .06rem; }
  .product-label { gap: .4rem; }
  .login-panel { display: block; margin-top: .5rem; }
  .login-art { min-height: 6.5rem; }
  .login-art .weave { right: -5%; width: 95%; opacity: 1; }
  .login-body { padding: 1.45rem; }
  .quantity-row { grid-template-columns: minmax(0,1fr) auto; gap: .12rem .4rem; padding: .5rem .1rem .5rem .3rem; }
  .quantity-row .terms { grid-column: 1; grid-row: auto; display: flex; }
  .quantity-row .stepper { grid-column: 2; grid-row: 1 / span 2; }
  .field-grid { grid-template-columns: minmax(0,1fr); }
  .stepper { grid-template-columns: 44px 2.3rem 44px; }
  .readout .scroll { font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
  header, nav, button, .actions, .skip, .back-link, .weave, .file-field { display: none !important; }
  main { width: 100%; padding: 0; }
  .material, .card, .project-card, .checkout { color: black; background: white; box-shadow: none; border-color: #bbb; }
  .material .company { color: #333; }
  .stack, .order-form { display: block; }
  .card { break-inside: avoid; margin-block: 1rem; }
}
