/* Portal-only additions, on top of Echo's style.css + ccc.css */
body { padding-top: 96px; }
.wrap { max-width: 860px; margin: 0 auto; }
.nav-user { color: var(--dim); font-size: .85rem; display:flex; align-items:center; gap:10px; }
.nav-user form { margin:0; }
.linkbtn { background:none; border:1px solid var(--line-2); color:var(--dim); font-family:var(--mono); font-size:.85rem;
  padding:6px 12px; border-radius:5px; cursor:pointer; }
.linkbtn:hover { color:var(--green-hi); border-color:var(--line-hot); }
.login-box { max-width: 440px; margin: 6vh auto 0; }
.login-box label { display:block; font-size:.78rem; color:var(--dim); margin:12px 0 4px; }
.login-box input, .ask textarea { width:100%; padding:10px 12px; background:var(--inset); border:1px solid var(--line-2);
  border-radius:6px; color:var(--txt); font-family:var(--mono); font-size:.95rem; }
.login-box input:focus, .ask textarea:focus { outline:none; border-color:var(--green); box-shadow:var(--glow); }
.login-box .btn, .ask .btn { width:100%; margin:16px 0 0; }
.err { color: var(--amber); font-size:.85rem; border-left:2px solid var(--amber); padding-left:10px; margin:12px 0 0; }
.ok  { color: var(--green-hi); font-size:.85rem; border-left:2px solid var(--green); padding-left:10px; margin:12px 0; }
.hint { color: var(--faint); font-size:.75rem; margin-top:14px; line-height:1.5; }
.jobs { list-style:none; padding:0; margin:0; }
.jobs li { border:1px solid var(--line-2); background:var(--panel); border-radius:8px; margin-bottom:12px; }
.jobs a { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:16px; color:var(--txt); }
.jobs a:hover { background:var(--raised); text-shadow:none; }
.jobs .t { color:var(--green-hi); font-weight:700; display:block; }
.jobs .m { color:var(--dim); font-size:.8rem; }
.status { font-size:.75rem; font-weight:700; padding:3px 10px; border-radius:12px; white-space:nowrap;
  border:1px solid var(--line-hot); color:var(--green-hi); }
.status.amber { border-color: rgba(255,179,71,.45); color: var(--amber); }
.kv { display:grid; grid-template-columns: max-content 1fr; gap:6px 18px; font-size:.9rem; margin:0 0 6px; }
.kv dt { color:var(--dim); } .kv dd { margin:0; }
.files { list-style:none; padding:0; margin:0; }
.files li { padding:10px 0; border-bottom:1px dashed var(--line); display:flex; justify-content:space-between; gap:12px; }
.files li:last-child { border-bottom:0; }
.files .k { color:var(--dim); font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; }
.summary { white-space: pre-line; }
.back { font-size:.85rem; display:inline-block; margin-bottom:14px; }

/* ---- admin ---- */
.nav-user a { color:var(--dim); } .nav-user a:hover { color:var(--green-hi); }
.wrap.wide { max-width: 1100px; }
.flash { color:var(--green-hi); border:1px solid var(--line-hot); background:var(--panel); border-radius:6px; padding:10px 14px; margin-bottom:16px; font-size:.88rem; }
.flash.warn { color:var(--amber); border-color:rgba(255,179,71,.45); }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:16px; }
.stat { background:var(--panel); border:1px solid var(--line-2); border-radius:8px; padding:14px 16px; }
.stat .n { color:var(--green-hi); font-size:1.5rem; font-weight:700; text-shadow:var(--glow); display:block; }
.stat .n.amber { color:var(--amber); text-shadow:var(--glow-amber); }
.stat .l { color:var(--dim); font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; }
.panel h3 .more { float:right; font-size:.8rem; font-weight:400; }
.tbl { width:100%; border-collapse:collapse; font-size:.88rem; }
.tbl th { text-align:left; color:var(--dim); font-weight:500; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; border-bottom:1px solid var(--line-2); padding:6px 8px; }
.tbl td { padding:8px; border-bottom:1px solid var(--line); vertical-align:top; }
.tbl tr:last-child td { border-bottom:0; }
.tbl .r { text-align:right; white-space:nowrap; }
.muted { color:var(--dim); font-size:.8rem; }
.owe { color:var(--amber); font-weight:700; }
.af label { display:block; font-size:.75rem; color:var(--dim); margin:10px 0 3px; }
.af input[type=text], .af input[type=email], .af input[type=tel], .af input[type=date], .af input[type=search], .af select, .af textarea, .af input[type=file] {
  width:100%; padding:8px 10px; background:var(--inset); border:1px solid var(--line-2); border-radius:6px; color:var(--txt); font-family:var(--mono); font-size:.88rem; }
.af input:focus, .af select:focus, .af textarea:focus { outline:none; border-color:var(--green); box-shadow:var(--glow); }
.af .row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.af .row3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.af .check { display:flex; align-items:center; gap:8px; font-size:.82rem; color:var(--txt); margin:10px 0 0; }
.af .btn { margin-top:12px; }
.btn-sm { font-family:var(--mono); font-size:.8rem; padding:6px 12px; border-radius:5px; cursor:pointer; background:var(--raised); color:var(--green-hi); border:1px solid var(--line-hot); }
.btn-sm:hover { border-color:var(--green); box-shadow:var(--glow); }
.btn-sm.ghost { background:none; color:var(--dim); border-color:var(--line-2); }
.statusbar { display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 4px; }
.statusbar button { font-family:var(--mono); font-size:.8rem; padding:7px 12px; border-radius:16px; cursor:pointer; background:none; color:var(--dim); border:1px solid var(--line-2); }
.statusbar button:hover { color:var(--green-hi); border-color:var(--green); }
.statusbar button.on { color:#0b0f0c; background:var(--green); border-color:var(--green); font-weight:700; }
.inline { display:inline; margin:0; }
.rm { display:flex; align-items:center; gap:6px; justify-content:flex-end; font-size:.75rem; color:var(--dim); }
.ledger { width:100%; border-collapse:collapse; font-size:.88rem; }
.ledger td { padding:6px 4px; border-bottom:1px dashed var(--line); }
.ledger .amt { text-align:right; white-space:nowrap; }
.ledger .amt.payment, .ledger .amt.discount { color:var(--dim); }
.ledger .tot td { border-bottom:0; font-weight:700; color:var(--green-hi); padding-top:10px; }
.events { list-style:none; padding:0; margin:0; font-size:.85rem; }
.events li { padding:5px 0; border-bottom:1px dashed var(--line); }
.events li:last-child { border-bottom:0; }
.events .when { color:var(--dim); font-size:.75rem; margin-right:6px; }
.events .priv { color:var(--faint); font-size:.7rem; border:1px solid var(--line-2); border-radius:8px; padding:0 6px; margin-left:6px; }
.q { border-left:2px solid var(--amber); padding:6px 0 6px 12px; margin-bottom:12px; }
.q p { margin:4px 0; white-space:pre-line; }
.pre { white-space:pre-line; }
details summary { cursor:pointer; color:var(--green); font-size:.85rem; margin:4px 0; }
@media (max-width:768px){ .grid2, .grid3, .af .row, .af .row3 { grid-template-columns:1fr; } .tbl .hide-sm { display:none; }
  /* On a phone grid2 stacks in DOM order, which buried the admin forms under the whole
     list above them. .form-first lifts the last column to the top so the thing you came
     to type into is the thing you see. Desktop layout is unchanged. */
  .form-first > div:last-child { order:-1; } }

/* ---- shop ---- */
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.chips a { font-size:.8rem; padding:5px 12px; border-radius:14px; border:1px solid var(--line-2); color:var(--dim); }
.chips a.on, .chips a:hover { color:#0b0f0c; background:var(--green); border-color:var(--green); text-shadow:none; }
.shop-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px; }
.pcard { display:block; background:var(--panel); border:1px solid var(--line-2); border-radius:8px; overflow:hidden; color:var(--txt); }
.pcard:hover { border-color:var(--green); box-shadow:var(--glow); text-shadow:none; }
.pcard .ph { position:relative; aspect-ratio:4/3; background:var(--inset); display:flex; align-items:center; justify-content:center; color:var(--faint); font-size:.8rem; }
.pcard .ph img { width:100%; height:100%; object-fit:cover; display:block; }
.pcard .tag { position:absolute; top:8px; left:8px; background:var(--amber); color:#0b0f0c; font-size:.7rem; font-weight:700; padding:2px 8px; border-radius:10px; }
.pcard .body { padding:12px 14px; display:flex; flex-direction:column; gap:3px; }
.pcard .t { color:var(--green-hi); font-weight:700; }
.pcard .m { color:var(--dim); font-size:.78rem; }
.price { color:var(--green-hi); font-weight:700; text-shadow:var(--glow); }
.price.big { font-size:1.6rem; margin:4px 0 12px; }
.gallery { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.gallery a { display:block; border:1px solid var(--line-2); border-radius:6px; overflow:hidden; aspect-ratio:1; }
.gallery a.main { grid-column:1 / -1; aspect-ratio:4/3; }
.gallery img { width:100%; height:100%; object-fit:cover; display:block; }
.thumb { width:48px; height:48px; object-fit:cover; border-radius:4px; border:1px solid var(--line-2); display:block; }
.thumbs { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; margin-bottom:10px; }
.thumbs img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:6px; border:1px solid var(--line-2); display:block; margin-bottom:4px; }
.hp { position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }
.item .kv { margin-bottom:10px; }

/* messages */
.badge { display:inline-block; background:var(--amber); color:#111; border-radius:9px; padding:0 6px; font-size:.7rem; font-weight:700; line-height:1.5; }
.thread { list-style:none; padding:0; margin:12px 0; display:flex; flex-direction:column; gap:10px; max-height:520px; overflow-y:auto; }
.thread li { max-width:85%; padding:8px 12px; border-radius:8px; border:1px solid var(--line-2); background:var(--inset); }
.thread li.me { align-self:flex-end; border-color:var(--green); }
.thread li.them { align-self:flex-start; border-left:2px solid var(--amber); }
.thread .who { font-size:.72rem; color:var(--dim); }
.thread p { margin:4px 0 0; white-space:pre-line; }
.msgs textarea { width:100%; padding:10px 12px; background:var(--inset); border:1px solid var(--line-2); color:inherit; border-radius:6px; font:inherit; }
.msgs .btn { margin-top:10px; }
/* register */
.periods { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px; }
.periods a { font-size:.78rem; border:1px solid var(--line-2); border-radius:5px; padding:3px 9px; }
.periods a.on { border-color:var(--green); color:var(--green-hi); }
.periods a.dl { margin-left:auto; }
.tbl.reg .in { color:var(--green-hi); font-weight:700; }
.tbl.reg .out { color:var(--amber); font-weight:700; }
.settle { display:flex; flex-direction:column; gap:8px; margin:10px 0; padding:10px; border:1px dashed var(--line-2); border-radius:6px; }
.settle form { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.settle select, .settle input[type=date], .settle input[type=text] { width:auto; }
.tbl.reg td:first-child { white-space:nowrap; }
/* chat window: newest at the bottom, opens scrolled to the newest */
.thread { flex-direction:column-reverse; }
