:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202124;
  background: #f5f5f3;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #315d55; }
.topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .8rem 1.2rem; background: #fff; border-bottom: 1px solid #ddd; }
.brand { color: #222; font-weight: 700; text-decoration: none; }
nav { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap; }
nav form { margin: 0; }
.container { max-width: 1260px; margin: 0 auto; padding: 1.25rem; }
.panel { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 1rem; margin-bottom: 1rem; }
.panel h2, .panel h3 { margin-top: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.metrics { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metrics .panel p { margin: .15rem 0 0; font-size: 1.7rem; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.split-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
label { display: block; font-weight: 600; margin: .55rem 0 .2rem; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; padding: .55rem; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
input[readonly].secret-value { color: #202124; background: #f7f7f4; border-color: #cfcfca; }
textarea { min-height: 90px; resize: vertical; }
button, .button { display: inline-block; border: 1px solid #315d55; border-radius: 4px; padding: .48rem .72rem; color: #fff; background: #315d55; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { color: #315d55; background: #fff; }
button.danger { border-color: #9b3e3e; background: #9b3e3e; }
button.icon-button { flex: 0 0 2.55rem; width: 2.55rem; min-height: 2.45rem; padding: 0; color: #315d55; background: #fff; display: inline-grid; place-items: center; }
button.icon-button.is-unlocked { border-color: #76531c; color: #76531c; background: #fff8e8; }
.link-button { padding: 0; color: #315d55; border: 0; background: transparent; text-decoration: underline; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-scroll { overflow-x: auto; }
th, td { padding: .55rem; border-bottom: 1px solid #ddd; text-align: left; vertical-align: top; }
th { background: #f2f3f1; }
.job-result { white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: .15rem .42rem; border-radius: 999px; font-size: .78rem; background: #e6e8e5; }
.badge.failed, .badge.rejected, .badge.expired { color: #842929; background: #f8dddd; }
.badge.sent, .badge.processed, .badge.manualcompleted { color: #205e39; background: #dcefe2; }
.badge.queued, .badge.approved { color: #76531c; background: #f7e9ca; }
.muted { color: #666; font-size: .9rem; }
.hint { display: block; color: #5a5a5a; font-size: .82rem; font-weight: 400; line-height: 1.35; margin: .15rem 0 .55rem; }
.hint code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: #f1f1f1; padding: 0 .2rem; border-radius: 3px; }
.intro { color: #444; background: #f3f7f6; border: 1px solid #d6e3e0; border-radius: 6px; padding: .6rem .8rem; margin: 0 0 1rem; font-size: .92rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.secret-input { display: flex; gap: .35rem; align-items: stretch; }
.secret-input input { min-width: 0; }
.lock-icon { position: relative; display: inline-block; width: 1rem; height: .78rem; border: 2px solid currentColor; border-radius: 2px; margin-top: .28rem; }
.lock-icon::before { content: ""; position: absolute; left: .16rem; top: -.58rem; width: .48rem; height: .48rem; border: 2px solid currentColor; border-bottom: 0; border-radius: .5rem .5rem 0 0; }
.lock-icon::after { content: ""; position: absolute; left: .38rem; top: .18rem; width: .16rem; height: .28rem; border-radius: 999px; background: currentColor; }
.icon-button.is-unlocked .lock-icon::before { left: .42rem; top: -.62rem; transform: rotate(22deg); transform-origin: bottom left; }
.flash { padding: .75rem; margin-bottom: 1rem; border: 1px solid #b8d6ca; border-radius: 4px; background: #ecf8f3; }
.error { color: #842929; }
.review-card { border-left: 4px solid #b9c7c1; }
.review-card.urgent { border-left-color: #b25d3d; }
.review-text { white-space: pre-wrap; }
.compact { max-width: 580px; }
.event-row { display: grid; gap: .35rem; padding: .45rem 0; border-bottom: 1px solid #ecece8; }
.event-row:last-child { border-bottom: 0; }
.opportunity-list { display: grid; gap: .85rem; }
.opportunity { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: .8rem; padding-bottom: .85rem; border-bottom: 1px solid #ecece8; }
.opportunity:last-child { padding-bottom: 0; border-bottom: 0; }
.opportunity img { width: 112px; height: 112px; object-fit: cover; border-radius: 6px; background: #f2f3f1; }
details pre { overflow-x: auto; padding: .7rem; background: #f5f5f3; }
@media (max-width: 700px) { .topbar { align-items: flex-start; flex-direction: column; } th, td { padding: .4rem; } .opportunity { grid-template-columns: 84px minmax(0, 1fr); } .opportunity img { width: 84px; height: 84px; } }
