@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

/* Realworld brand tokens — same values as identity-issuer/static/styles/base.css
   and realworld-verifier's own pages, so this panel matches the rest of the
   sandbox stack instead of inventing its own theme. */
:root {
  --blue-core:   #0042C5;
  --blue-deep:   #02359D;
  --grey-90:     #2B333E;
  --grey-60:     #727B89;
  --grey-45:     #969FAB;
  --grey-30:     #BBC3CE;
  --grey-15:     #D7DDE6;
  --grey-05:     #EFF4F9;
  --black:       #070F1A;

  --bg:          var(--grey-05);
  --panel-bg:    #ffffff;
  --border:      var(--grey-15);
  --text:        var(--black);
  --text-dim:    var(--grey-60);
  --accent:      var(--blue-core);
  --accent-deep: var(--blue-deep);

  --ok:          #1a8a4a;
  --failed:      #c22b3c;
  --started:     var(--grey-45);

  --verified-bg: #e3f5ea;
  --verified-fg: #1a8a4a;
  --reg-fg:      var(--blue-core);
  --self-fg:     var(--grey-60);

  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  color: var(--black);
}
.brand img.wordmark {
  height: 18px;
  display: block;
}
.brand-sub {
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 6px;
  font-size: 12px;
}

.role-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.role-picker select {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--grey-30);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}
.role-picker select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 66, 197, 0.15);
}

.trust-legend {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.trust-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  font-weight: 600;
}
.trust-verified {
  background: var(--verified-bg);
  color: var(--verified-fg);
  border-color: var(--verified-fg);
}
.trust-registry {
  color: var(--reg-fg);
  border-color: var(--reg-fg);
  border-style: solid;
}
.trust-self {
  color: var(--self-fg);
  border-color: var(--self-fg);
  border-style: dashed;
}

.feeds {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  min-height: 0;
}

.feed-col {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.feed-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
}
.feed-head h2 {
  font-size: 13px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 700;
}
.feed-sub {
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent);
  font-weight: 600;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.feed-list.paused {
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}

.event-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--grey-15);
  background: var(--panel-bg);
}
.event-row:nth-child(even) {
  background: var(--bg);
}
.event-row .ts {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.event-row .actor {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.event-row .narration {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-row .corr {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.status-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.status-ok { background: var(--ok); }
.status-failed { background: var(--failed); }
.status-started {
  background: var(--started);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.conn-connecting { background: var(--started); animation: pulse 1.2s ease-in-out infinite; }
.conn-open { background: var(--ok); }
.conn-closed { background: var(--failed); }

.statusbar {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--panel-bg);
}

.empty-hint {
  padding: 14px;
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 800px) {
  .feeds { grid-template-columns: 1fr; }
  .trust-legend { margin-left: 0; }
}
