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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f7f9;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  color: #687284;
  font-size: 13px;
}

.icon-button,
.notification-panel button,
.tabs button {
  border: 1px solid #d7dce5;
  background: #ffffff;
  color: #172033;
  border-radius: 8px;
}

.icon-button {
  min-height: 40px;
  padding: 0 13px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #687284;
  font-size: 13px;
  margin-bottom: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metrics article,
.panel,
.notification-panel,
.auth-panel {
  background: #ffffff;
  border: 1px solid #e0e4ec;
  border-radius: 8px;
}

.auth-panel {
  display: flex;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.auth-panel[hidden] {
  display: none;
}

.auth-panel input {
  min-width: 0;
  flex: 1;
  border: 1px solid #d7dce5;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 10px;
  font: inherit;
}

.metrics article {
  padding: 14px;
  min-height: 82px;
}

.metrics span,
.row span {
  color: #687284;
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
}

.tabs button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.tabs button.is-active {
  background: #1746a2;
  border-color: #1746a2;
  color: #ffffff;
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 14px;
}

.panel h1 {
  font-size: 15px;
  margin: 0 0 12px;
}

.rows {
  display: grid;
  gap: 9px;
}

.row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #fbfcfe;
}

.row strong,
.row p {
  overflow-wrap: anywhere;
}

.row p {
  margin: 0;
  color: #3f4a5d;
  font-size: 13px;
}

.notification-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
}

.notification-panel button {
  min-height: 36px;
  padding: 0 11px;
}

#notificationStatus {
  color: #687284;
  font-size: 12px;
}

@media (min-width: 640px) {
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
