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

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-bottom: 1px solid #d8ddd2;
  background: #ffffff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 7px;
  color: #52715c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.upload-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 220px;
  padding: 32px;
  border: 2px dashed #9fb49d;
  border-radius: 8px;
  background: #eef3ea;
}

.upload-zone.dragover {
  border-color: #146c43;
  background: #e2f0e4;
}

.upload-zone input {
  display: none;
}

.profile-control {
  min-width: 180px;
}

select {
  min-height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid #bcc6b7;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2b20;
  font-weight: 750;
}

.upload-zone p:not(.eyebrow) {
  margin-top: 10px;
  color: #4f554a;
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: #183c2a;
  color: white;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: #245438;
}

button.ghost {
  border: 1px solid #bcc6b7;
  background: #ffffff;
  color: #1f2b20;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid #d8ddd2;
  border-radius: 8px;
  background: #d8ddd2;
}

.active-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #d8ddd2;
  border-radius: 8px;
  background: #ffffff;
}

.subline {
  margin-top: 8px;
  color: #66705f;
}

.active-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef0ea;
  color: #3f463c;
  font-size: 14px;
  font-weight: 800;
}

.health-badge.online {
  background: #e3f3e8;
  color: #146c43;
}

.health-badge.pending {
  background: #fff2c9;
  color: #7b5600;
}

.health-badge.stale {
  background: #ece5ff;
  color: #4b3a82;
}

.health-badge.error {
  background: #ffe0d8;
  color: #9a2f21;
}

.status-item {
  min-width: 0;
  padding: 18px;
  background: #ffffff;
}

.status-item span {
  display: block;
  margin-bottom: 8px;
  color: #66705f;
  font-size: 13px;
}

.status-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.profile-section,
.history-section {
  margin-top: 30px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid #d8ddd2;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.preview {
  display: none;
  width: 100%;
  margin-top: 22px;
  border: 1px solid #d8ddd2;
  border-radius: 8px;
  background: white;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.profile-card {
  display: grid;
  gap: 9px;
  padding: 8px;
  border: 2px solid transparent;
  background: #ffffff;
  color: #1f2b20;
  text-align: left;
}

.profile-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
  background: #edf0ea;
}

.profile-card span {
  padding: 0 3px 4px;
}

.profile-card.selected {
  border-color: #183c2a;
  background: #eef3ea;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.history-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d8ddd2;
  border-radius: 8px;
  background: #ffffff;
}

.history-card.active {
  border-color: #183c2a;
}

.history-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
  background: #edf0ea;
}

.history-card strong,
.history-card span {
  display: block;
  overflow-wrap: anywhere;
}

.history-card span {
  margin-top: 5px;
  color: #66705f;
  font-size: 13px;
}

.empty {
  color: #66705f;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid #d8ddd2;
  border-radius: 8px;
  background: #ffffff;
}

label {
  display: grid;
  gap: 8px;
  color: #4f554a;
  font-weight: 700;
}

input[type="password"],
input[type="text"] {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #bfc8b9;
  border-radius: 7px;
}

.error {
  display: none;
  color: #9a2f21;
}

@media (max-width: 760px) {
  .topbar,
  .upload-zone,
  .active-panel,
  .profile-section,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row {
    justify-content: stretch;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }
}
