:root {
  color-scheme: light;
  --paper: #f9f8f2;
  --surface: #fffefa;
  --ink: #17362d;
  --muted: #52645c;
  --line: #cdd4c8;
  --accent: #e1ef86;
  --serif: "Iowan Old Style", "Baskerville", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--sans); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #ac5900; outline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.045em; line-height: 1.04; }
.parcel-mark {
  flex: none;
  position: relative;
  display: inline-block;
  width: 1.6rem;
  height: 1.35rem;
  border: 2px solid currentColor;
  border-radius: 2px;
}
.parcel-mark::before, .parcel-mark::after {
  content: "";
  position: absolute;
  height: 2px;
  background: currentColor;
}
.parcel-mark::before { top: .32rem; left: 0; width: 100%; }
.parcel-mark::after { bottom: .22rem; left: .18rem; width: .48rem; }

/* A paper cover and a folded route diagram give the two screens a shared identity. */
.login-layout { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 36rem;
  padding: clamp(2rem, 5vw, 6rem);
  color: var(--paper);
  background-color: var(--ink);
}
.cover-label { display: flex; gap: .75rem; align-items: center; font-size: .9rem; font-weight: 600; }
.cover-label .parcel-mark { color: var(--accent); }
.cover-title { margin: auto 0; padding: 4rem 0 8rem; }
.cover h1 { max-width: 14ch; font-size: clamp(2.7rem, 6vw, 6.6rem); overflow-wrap: anywhere; }
.cover p { max-width: 27rem; margin-top: 1.5rem; font-size: 1.1rem; color: #d7e3d7; }
.route-art { position: absolute; z-index: -1; inset: auto 0 0; height: 22%; overflow: hidden; }
.route-art i {
  position: absolute;
  width: 96%;
  height: 200%;
  top: 30%;
  left: -12%;
  border: 1px solid #82a194;
  border-radius: 50%;
  transform: rotate(-11deg);
}
.route-art i:nth-child(2) { top: 42%; left: -7%; }
.route-art i:nth-child(3) { top: 54%; left: -2%; border-color: var(--accent); }
.route-art i:nth-child(4) { top: 66%; left: 3%; }
.login-form-panel { display: grid; place-items: center; padding: 2rem; }
.login-form-wrap { width: min(100%, 23rem); }
.login-form-wrap h2 { font-size: clamp(2.25rem, 4vw, 3.5rem); }
.login-form-wrap > p { margin: .85rem 0 2rem; color: var(--muted); }
.field { display: grid; gap: .45rem; margin-bottom: 1.2rem; }
.field label { font-weight: 650; }
.field input { width: 100%; padding: .7rem .85rem; color: var(--ink); border: 1px solid #84968b; background: var(--surface); border-radius: 4px; }
.login-error { margin: 0 0 1rem; color: #992e19; }
.login-error:empty { display: none; }
.sign-in, .sign-out { border-radius: 4px; font-weight: 650; }
.sign-in { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: .8rem 1rem; border: 0; color: var(--paper); background: var(--ink); }
.sign-in:hover { background: #285746; }
.sign-in span { color: var(--accent); }
.login-form-wrap .login-note { margin: 1.2rem 0 0; font-size: .86rem; }

/* Native disclosure controls keep every workflow usable without JavaScript. */
.frame { width: min(calc(100% - 3rem), 66rem); margin-inline: auto; }
.skip-link { position: absolute; left: .5rem; top: -4rem; background: var(--surface); padding: .55rem; z-index: 2; }
.skip-link:focus { top: .5rem; }
.workspace-header { color: var(--paper); background: var(--ink); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; padding-block: .7rem; }
.app-name { display: flex; align-items: center; gap: .8rem; overflow-wrap: anywhere; font-weight: 650; }
.app-name .parcel-mark { color: var(--accent); }
.sign-out { background: transparent; border: 1px solid #6e897b; color: var(--paper); padding: .45rem .85rem; white-space: nowrap; }
.sign-out:hover { border-color: var(--accent); }
.workspace { padding-bottom: 4rem; }
.workspace-title { padding: clamp(2rem, 5vw, 4rem) 0 1.6rem; }
.sample-label { display: inline-block; background: var(--accent); color: var(--ink); border-radius: 2px; padding: .15rem .5rem; font: 600 .72rem/1.55 var(--mono); }
.workspace-title h1 { margin: .6rem 0 .8rem; font-size: clamp(2.75rem, 6vw, 5rem); }
.workspace-title p, .section-note, .shop-detail p { color: var(--muted); }
.workspace-title p { max-width: 39rem; }
.section-nav { display: flex; flex-wrap: wrap; column-gap: 1.6rem; border-block: 1px solid var(--line); }
.section-nav a { display: block; padding: .7rem 0; font-weight: 650; font-size: .9rem; text-decoration: none; }
.section-nav a:hover { text-decoration: underline; }
.workspace section[id] { scroll-margin-top: 1.5rem; }
.workspace h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
.register { margin-block: 2.2rem; }
.section-note { margin: .55rem 0 1.15rem; }
.order { border-top: 1px solid var(--line); }
.order:last-child { border-bottom: 1px solid var(--line); }
.order summary {
  list-style: none;
  display: grid;
  grid-template-columns: .85rem minmax(9rem, 1fr) 2fr minmax(6rem, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .9rem .6rem;
}
.order summary::-webkit-details-marker { display: none; }
.order summary::before { content: ""; width: .46rem; height: .46rem; border-bottom: 2px solid; border-right: 2px solid; transform: rotate(-45deg); }
.order[open] summary::before { transform: rotate(45deg); }
.order summary:hover { background: #eff1e9; }
.order-id, .amount, .ledger dd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.order-id { font-weight: 600; font-size: .89rem; }
.amount { text-align: right; }
.status { width: max-content; padding: .15rem .55rem; border-radius: 3px; font-size: .8rem; font-weight: 650; }
.delivered { color: #284f38; background: #dfebda; }
.returned { color: #754a20; background: #f3e5cf; }
.order-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 1rem 1.4rem 1.2rem 2.35rem; background: #eef1e8; }
.order-body h3 { margin-bottom: .25rem; font-size: .83rem; }
.order-body p { font-size: .94rem; }
.ledger-columns { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
.ledger { margin-top: 1rem; }
.ledger > div { display: flex; gap: .9rem; justify-content: space-between; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--line); }
.ledger dt { color: var(--muted); }
.ledger dd { text-align: right; font-size: .9rem; }
.ledger .total { border-top: 1px solid var(--ink); }
.total dt, .total dd { color: var(--ink); font-weight: 650; }
.shop { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; margin-top: 2.4rem; padding: 1.5rem; background: #e7ece3; }
.shop-detail p { margin-top: .3rem; }

@media (max-width: 43rem) {
  .login-layout { grid-template-columns: 1fr; align-content: start; }
  .cover { min-height: 0; padding: 1.6rem; }
  .cover-title { padding: 1.8rem 0 .6rem; }
  .cover h1 { max-width: none; }
  .cover p { margin-top: .75rem; font-size: 1rem; }
  .route-art { left: auto; width: 25%; opacity: .45; }
  .login-form-panel { padding: 2.25rem 1.5rem; }
  .login-form-wrap { width: min(100%, 31rem); }
  .frame { width: calc(100% - 2rem); }
  .section-nav { column-gap: 1.1rem; }
  .order summary { grid-template-columns: .65rem 1fr auto; gap: .35rem .65rem; }
  .order summary::before { grid-column: 1; grid-row: 1 / span 2; }
  .order-id { grid-column: 2; }
  .item-name { grid-column: 2; grid-row: 2; }
  .status { grid-column: 3; grid-row: 2; justify-self: end; }
  .amount { grid-column: 3; grid-row: 1; }
  .order-body, .ledger-columns, .shop { grid-template-columns: 1fr; }
  .order-body { padding: 1rem 1.25rem; }
  .shop { gap: .8rem; }
}
