.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.portal{padding:56px 0 84px;min-height:62vh}
.portal h1{font-size:clamp(1.8rem,3.6vw,2.5rem);margin-bottom:.2em}
.portal h2{font-size:1.35rem;margin:1.6em 0 .6em}
.muted{color:var(--muted);margin:0}
.crumb{margin:0 0 14px;font-size:.95rem}
.portal-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:16px;margin-bottom:24px}
.portal-head p{margin:0}
.pre{white-space:pre-wrap}
.empty{background:#fff;border:1px dashed #9DB3A9;border-radius:10px;padding:28px;color:var(--muted)}
.nav-form{margin:0 0 0 8px}
.nav-form .btn{cursor:pointer}

/* auth */
.auth{max-width:460px;margin:0 auto;background:#fff;border:1px solid var(--line);border-radius:12px;padding:36px 32px}
.auth h1{font-size:2rem}
.auth-sub{color:var(--muted);margin-bottom:22px}
.auth-links{margin:22px 0 0;color:var(--muted);font-size:.98rem}
.btn-block{display:block;width:100%;text-align:center}
.field{margin-bottom:18px}
.field label{display:block;font-weight:600;margin-bottom:6px}
.field .hint{display:block;font-size:.9rem;color:var(--muted);margin-top:4px}
.field.check{display:flex;gap:10px;align-items:flex-start}
.field.check input{width:auto;margin-top:6px}
.field.check label{font-weight:400;margin:0}
.hp{position:absolute;left:-9999px;height:0;overflow:hidden}
select{width:100%;font:inherit;padding:12px 14px;border:1.5px solid #9DB3A9;border-radius:8px;background:#fff;color:var(--ink)}
select:focus{border-color:var(--green-700);outline:3px solid rgba(52,211,153,.45);outline-offset:0}

/* alerts */
.alert{padding:14px 18px;border-radius:8px;margin-bottom:20px;border-left:4px solid}
.alert.ok{background:#E6F4EE;border-color:var(--green-700);color:#0B4A35}
.alert.error{background:#FDECEC;border-color:#B42318;color:#7A1A12}
.alert.info{background:#E3ECF5;border-color:var(--navy-600);color:var(--navy-800)}

/* badges */
.badge{display:inline-block;padding:4px 12px;border-radius:999px;font-size:.88rem;font-weight:600;white-space:nowrap}
.s-new{background:#E3ECF5;color:#0B2B4A}
.s-planning{background:#E9E4F7;color:#3B2A7A}
.s-in_progress{background:#DDF3E9;color:#0B4A35}
.s-review{background:#FFF0CC;color:#6B4A00}
.s-delivered{background:var(--green-700);color:#fff}
.s-on_hold{background:#E4E7EA;color:#33404B}
.unread{display:inline-block;background:#B42318;color:#fff;border-radius:999px;padding:2px 10px;font-size:.85rem;font-weight:600}

/* tables */
table.list a{font-weight:600}
.filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px}
.filters a{padding:6px 14px;border:1px solid var(--line);border-radius:999px;background:#fff;text-decoration:none;color:var(--ink);font-size:.95rem}
.filters a:hover{border-color:var(--green-700)}
.filters a[aria-current="true"]{background:var(--navy-800);color:#fff;border-color:var(--navy-800)}
.panel-light{background:#fff;border:1px solid var(--line);border-radius:12px;padding:28px;margin-top:40px;max-width:640px}
.panel-light h2{margin-top:0}

/* order */
.stepper{list-style:none;margin:8px 0 36px;padding:0;display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.stepper li{border-top:4px solid var(--line);padding-top:10px;color:var(--muted);font-weight:500;font-size:.98rem}
.stepper li.done{border-color:var(--green-700);color:var(--ink)}
.stepper li.current{border-color:var(--green-700);color:var(--green-800);font-weight:700}
.stepper.held li.current{border-color:#8A97A3;color:#33404B}
.hold-note{background:#E4E7EA;border-radius:8px;padding:12px 16px;margin:-16px 0 28px}
.order-grid{display:grid;grid-template-columns:1fr 1.15fr;gap:48px;align-items:start}
.order-grid h2:first-child{margin-top:0}
.history{list-style:none;margin:0;padding:0}
.history li{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;padding:12px 0;border-top:1px solid var(--line)}
.history li:last-child{border-bottom:1px solid var(--line)}
.h-note{flex:1 1 200px}
.h-time{color:var(--muted);font-size:.9rem}

/* chat */
.chat h2{margin-top:0}
.chat-list{height:420px;overflow-y:auto;background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:12px}
.chat-empty{color:var(--muted);margin:auto;text-align:center}
.msg{max-width:84%}
.msg.mine{align-self:flex-end}
.msg.theirs{align-self:flex-start}
.msg-meta{font-size:.82rem;color:var(--muted);margin-bottom:3px}
.msg.mine .msg-meta{text-align:right}
.msg-body{padding:10px 14px;border-radius:12px;white-space:pre-wrap;overflow-wrap:anywhere}
.msg.mine .msg-body{background:var(--green-700);color:#fff;border-bottom-right-radius:3px}
.msg.theirs .msg-body{background:#EAF2EE;border-bottom-left-radius:3px}
#chat-form{margin-top:14px}
#chat-form textarea{min-height:90px;margin-bottom:10px}

@media (max-width:900px){
  .order-grid{grid-template-columns:1fr;gap:32px}
}
@media (max-width:640px){
  .stepper{grid-template-columns:1fr}
  .auth{padding:28px 20px}
  .nav-form{margin:8px 0 0}
  .nav-form .btn{width:100%}
}
