* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f5f6f8;
  color: #122238;
  font:
    17px Arial,
    sans-serif;
}
header {
  background: #122238;
  color: white;
  padding: 24px;
  border-bottom: 4px solid #bf9c54;
}
small {
  display: block;
  margin-top: 6px;
}
main {
  max-width: 850px;
  margin: auto;
  padding: 24px;
}
section {
  background: white;
  padding: 20px;
  margin: 20px 0;
  border-radius: 6px;
}
label {
  display: block;
  margin: 12px 0;
}
input,
select,
textarea,
button {
  font: inherit;
  padding: 12px;
  width: 100%;
  margin-top: 6px;
}
button {
  background: #122238;
  color: white;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#state,
#identity {
  white-space: pre-wrap;
  padding: 16px;
  background: #fff5dd;
  font-weight: bold;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
}
#work {
  overflow: auto;
}
[hidden] {
  display: none !important;
}
a {
  color: #314e76;
}

/* PFY role UI v1: hide entire role-only sections until the session is verified. */
#stage[hidden], #actions[hidden], #settings[hidden], #labelLinks[hidden], #acceptedWork[hidden] {
  display: none !important;
}

h2 { margin-top: 0; }
.field-help { margin: 8px 0 16px; padding: 12px 14px; background: #eef3f8; border-left: 4px solid #314e76; border-radius: 4px; }
.field-help.notice { background: #fff5dd; border-left-color: #bf9c54; font-weight: 600; }
.label-panel { border: 1px solid #d9dee5; }
.button-link { display: inline-block; background: #122238; color: #fff; text-decoration: none; padding: 12px 18px; border-radius: 4px; font-weight: 700; }
.button-link:hover { text-decoration: underline; }

/* Packing quantity selector */
.pack-title{margin:1.1rem 0 .15rem;font-size:1.05rem}
.pack-contents{display:grid;gap:.65rem;margin:.4rem 0 .7rem}
.pack-line{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem .9rem;border:1px solid #d9dde4;border-radius:8px;background:#f8fafc}
.pack-line-info{display:flex;flex-direction:column;gap:.18rem;min-width:0}
.pack-line-info span{font-size:.88rem;color:#596273}
.qty-stepper{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}
.qty-stepper button{width:auto;min-width:2.4rem;margin:0;padding:.45rem .7rem}
.qty-stepper output{min-width:2.3rem;text-align:center;font-weight:700;font-size:1.05rem}
.qty-stepper .qty-all{font-size:.83rem;padding:.45rem .65rem}
.pack-total{font-weight:700;margin:.25rem 0 .6rem}
@media(max-width:680px){.pack-line{align-items:flex-start;flex-direction:column}.qty-stepper{justify-content:flex-start}}
.dimension-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:8px 0 4px}.dimension-grid label{margin:0}.dimension-grid input{width:100%}@media(max-width:700px){.dimension-grid{grid-template-columns:1fr}}


/* PFY Action Centre */
.action-centre{border:1px solid #d9dee5}
.action-centre-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}
.action-centre-heading h2{margin-bottom:.25rem}.action-centre-heading p{margin:.2rem 0 0;color:#596273}
.compact-button{width:auto;margin:0;padding:.65rem 1rem}
.action-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:.7rem;margin:1rem 0}
.summary-card{border:1px solid #d9dee5;border-radius:8px;padding:.9rem;background:#f8fafc;display:flex;flex-direction:column;gap:.2rem}
.summary-card strong{font-size:1.55rem}.summary-card span{font-size:.88rem;color:#596273}
.action-nav{display:flex;gap:.45rem;flex-wrap:wrap;margin:.75rem 0 1rem}
.action-chip{width:auto;margin:0;border:1px solid #cbd3dc;background:#eef3f8;color:#122238;padding:.55rem .75rem;border-radius:999px;font-size:.86rem}
.action-chip.has-work{background:#fff5dd;border-color:#d7b66c;font-weight:700}
.action-groups{display:grid;gap:1rem}.queue-group{margin:0;padding:0;border:1px solid #e0e4e9;border-radius:9px;overflow:hidden}
.queue-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem 1rem;background:#f8fafc;border-bottom:1px solid #e0e4e9}.queue-heading h3{margin:0;font-size:1rem}
.queue-count{display:inline-flex;min-width:2rem;height:2rem;padding:0 .55rem;align-items:center;justify-content:center;border-radius:999px;background:#e9edf2;font-weight:700}.queue-count.has-work{background:#fff0c8;color:#725114}
.queue-description{padding:0 1rem;margin:.8rem 0;color:#596273;font-size:.9rem}.queue-empty{padding:0 1rem 1rem;margin:0;color:#687385}
.queue-list{display:grid}.queue-item{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem 1rem;border-top:1px solid #edf0f3}.queue-item:first-child{border-top:0}.queue-item-body{display:flex;flex-direction:column;gap:.18rem;min-width:0}.queue-item-body>span{font-size:.88rem;color:#596273}.queue-status{font-weight:600;color:#344966!important}.queue-age{font-size:.8rem!important;color:#7b8492!important}.queue-open{width:auto;margin:0;white-space:nowrap;padding:.65rem .85rem}
.all-clear{padding:1rem;border-radius:8px;background:#edf7ef;border:1px solid #c9e2cf;font-weight:700}.action-updated{font-size:.8rem;color:#7b8492;margin:1rem 0 0}
@media(max-width:680px){.action-centre-heading,.queue-item{align-items:stretch;flex-direction:column}.compact-button,.queue-open{width:100%}}


/* Operations 3.0.0 — maintain existing PFY visual language. */
.ops-row-list { display:grid; gap:1rem; }
.ops-row-list fieldset { min-width:0; margin:.5rem 0; border:1px solid #ccd2db; border-radius:.5rem; padding:1rem; }
.ops-row-list legend { font-weight:700; padding:0 .35rem; }
.ops-quantity-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem; }
.ops-quantity-grid input { width:100%;box-sizing:border-box; }
.ops-row-list .compact-button { margin:.35rem .5rem .35rem 0; }
.ops-recovery { border:2px solid #D4AF37; }
@media(max-width:650px) { .ops-quantity-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Shipping responsibility 3.1.1 */
.shipping-choice { border: 1px solid #ccd3dd; border-radius: 10px; margin: 12px 0; padding: 16px; min-width: 0; }
.shipping-choice legend { font-weight: 700; padding: 0 6px; }
.shipping-segments { display: inline-flex; gap: 0; border: 1px solid #475569; border-radius: 8px; overflow: hidden; }
.shipping-segments button { width: auto; min-width: 100px; border: 0; border-radius: 0; margin: 0; padding: 12px 24px; background: #f1f5f9; color: #1f2937; }
.shipping-segments button[aria-pressed="true"] { background: #1f2937; color: #fff; font-weight: 700; box-shadow: inset 0 -3px #d4af37; }
.shipping-segments button:focus-visible { outline: 3px solid #8a2be2; outline-offset: -4px; }
.shipping-segments button:disabled { opacity: .55; cursor: not-allowed; }
.shipping-help { margin-bottom: 8px; }
#shippingSaveState { min-height: 1.4em; margin: 0; }
