* { box-sizing: border-box; }
body { margin: 0; color: var(--pq-color-text); background: var(--pq-color-canvas); font: var(--pq-font-weight-regular) var(--pq-font-size-md)/var(--pq-line-height-body) var(--pq-font-family); }
button, input, select { font: inherit; }
button { min-height: var(--pq-control-min-size); border: 0; border-radius: var(--pq-radius-md); padding: var(--pq-space-3) var(--pq-space-5); background: var(--pq-color-cta); color: var(--pq-color-surface-raised); font-weight: var(--pq-font-weight-heavy); cursor: pointer; }
button:hover { background: var(--pq-color-cta-hover); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--pq-color-brand-700) 45%, transparent); outline-offset: 2px; }
button.secondary { background: var(--pq-color-brand-100); color: var(--pq-color-brand-900); }
button.text { padding: var(--pq-space-2); background: transparent; color: var(--pq-color-brand-900); }
.brand { color: var(--pq-color-brand-950); font-size: 22px; font-weight: var(--pq-font-weight-heavy); letter-spacing: .08em; }
.brand span { color: var(--pq-color-cta); }
header { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--pq-space-6); background: var(--pq-color-surface-raised); border-bottom: 1px solid var(--pq-color-border); }
.header-actions { display: flex; align-items: center; gap: var(--pq-space-2); }
.icon-button { position: relative; width: var(--pq-control-min-size); padding: 0; border-radius: var(--pq-radius-round); background: transparent; color: var(--pq-color-brand-950); font-size: 24px; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: var(--pq-radius-round); background: var(--pq-color-warning); }
.badge { color: var(--pq-color-text-muted); font-size: var(--pq-font-size-xs); }
.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.side-nav { display: grid; align-content: start; gap: var(--pq-space-2); padding: var(--pq-space-6) 14px; background: linear-gradient(180deg, var(--pq-color-brand-950), var(--pq-color-brand-900)); }
.side-nav button { background: transparent; color: #ddd6f4; text-align: left; }
.side-nav button:hover, .side-nav button.active { background: rgb(255 255 255 / 12%); color: var(--pq-color-on-dark); }
.side-nav .create-link { background: var(--pq-color-cta); color: var(--pq-color-surface-raised); }
.event-shell { min-width: 0; }
.event-heading { display: grid; grid-template-columns: var(--pq-control-min-size) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 22px var(--pq-space-6) var(--pq-space-3); }
.event-heading h1 { margin: 3px 0; color: var(--pq-color-brand-950); font-size: var(--pq-font-size-xl); }
.back-button { width: var(--pq-control-min-size); padding: 0; border-radius: var(--pq-radius-round); background: var(--pq-color-brand-100); color: var(--pq-color-brand-900); font-size: 30px; }
.event-tabs { display: flex; gap: 6px; padding: 0 var(--pq-space-6); overflow: auto; scrollbar-width: thin; }
.event-tabs button { background: transparent; color: var(--pq-color-text-muted); white-space: nowrap; }
.event-tabs button:hover, .event-tabs button.active { background: transparent; color: var(--pq-color-brand-900); border-bottom: 3px solid var(--pq-color-cta); border-radius: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: var(--pq-space-5); max-width: 1200px; padding: var(--pq-space-5) var(--pq-space-6) 38px; }
.card { min-width: 0; padding: var(--pq-space-6); background: var(--pq-color-surface); border: 1px solid var(--pq-color-border); border-radius: var(--pq-radius-lg); box-shadow: var(--pq-shadow-card); }
.eyebrow { color: var(--pq-color-brand-700); font-size: 11px; font-weight: var(--pq-font-weight-heavy); letter-spacing: .18em; }
.lead, .card > small { color: var(--pq-color-text-muted); }
.fields, .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pq-space-3); }
.fields label, .cost label { display: grid; gap: 6px; font-size: var(--pq-font-size-xs); font-weight: var(--pq-font-weight-bold); }
input, select { width: 100%; min-height: var(--pq-control-min-size); padding: 11px; color: var(--pq-color-text); background: var(--pq-color-surface-raised); border: 1px solid var(--pq-color-border); border-radius: var(--pq-radius-sm); }
.section { display: flex; align-items: center; justify-content: space-between; margin-top: var(--pq-space-6); }
.cost { display: grid; grid-template-columns: 1.5fr 1fr .8fr 1fr auto; align-items: end; gap: 9px; padding: var(--pq-space-3) 0; border-top: 1px solid var(--pq-color-border); }
.remove { padding: 11px; background: var(--pq-color-danger); }
.card > button[type="submit"] { width: 100%; margin-top: var(--pq-space-4); box-shadow: var(--pq-shadow-action); }
.card > small { display: block; margin-top: 10px; }
.metrics > div { display: grid; gap: 5px; padding: 15px; background: var(--pq-color-surface-raised); border: 1px solid var(--pq-color-border); border-radius: var(--pq-radius-md); }
.metrics strong { color: var(--pq-color-brand-950); font-size: 23px; }
.metrics span { font-size: var(--pq-font-size-xs); }
.metrics .accent { background: var(--pq-color-success-soft); border-color: var(--pq-color-success); }
.metrics .accent strong { color: #147357; }
.table { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--pq-color-border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
.loss td:last-child, .error { color: var(--pq-color-danger); font-weight: var(--pq-font-weight-heavy); }
details { margin-top: var(--pq-space-5); }
pre { max-height: 340px; padding: 14px; overflow: auto; color: var(--pq-color-on-dark); background: var(--pq-color-brand-950); border-radius: var(--pq-radius-md); }
.gate { max-width: 520px; margin: 15vh auto; padding: 36px; background: var(--pq-color-surface); border-radius: var(--pq-radius-lg); box-shadow: var(--pq-shadow-card); text-align: center; }
.gate p { color: var(--pq-color-text-muted); }
.bottom-nav { display: none; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .cost { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  header { padding: 10px 14px; }
  .header-actions > .badge { display: none; }
  .app-shell { display: block; }
  .side-nav { display: none; }
  .event-heading { padding: var(--pq-space-3) 14px; }
  .event-heading h1 { font-size: var(--pq-font-size-lg); }
  .event-tabs { padding: 0 var(--pq-space-2); }
  .event-tabs button { padding: 10px 13px; }
  .layout { padding: var(--pq-space-3); }
  .fields, .metrics, .cost { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--pq-color-surface-raised); border-top: 1px solid var(--pq-color-border); }
  .bottom-nav button { min-width: 0; min-height: 48px; padding: var(--pq-space-2) 2px; background: transparent; color: var(--pq-color-text-muted); font-size: 10px; }
  .bottom-nav button:hover, .bottom-nav .active { background: transparent; color: var(--pq-color-brand-900); }
  .bottom-nav .create { display: grid; place-items: center; gap: 0; width: 58px; height: 58px; margin-top: -25px; justify-self: center; color: var(--pq-color-surface-raised); background: var(--pq-color-cta); border-radius: var(--pq-radius-round); box-shadow: var(--pq-shadow-action); font-size: 24px; }
  .bottom-nav .create small { font-size: 9px; line-height: 1; }
}
