:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17211d;
  --muted: #64716a;
  --line: #dfe6e2;
  --surface: #ffffff;
  --soft: #f4f7f5;
  --accent: #176f4d;
  --warning: #93620c;
  --danger: #a23b31;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background: #f7f9f8;
  color: var(--ink);
  margin: 0;
}

.pin-screen {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.pin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 auto;
  max-width: 380px;
  padding: 28px;
  width: 100%;
}

.pin-panel > strong {
  font-family: Georgia, serif;
  font-size: 1.4rem;
}

.pin-panel h1 {
  font-size: 1.7rem;
  margin: 24px 0 8px;
}

.pin-panel p {
  color: var(--muted);
}

.pin-panel label,
.pin-panel label span {
  display: block;
}

.pin-panel label span {
  font-size: 0.78rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.pin-panel input {
  font-size: 1.4rem;
  letter-spacing: 0.28em;
  text-align: center;
  width: 100%;
}

.pin-panel button {
  margin-top: 14px;
  width: 100%;
}

.pin-error {
  color: var(--danger) !important;
  font-size: 0.84rem;
  margin: 12px 0 0;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
}

.topbar div {
  align-items: baseline;
  display: flex;
  gap: 10px;
}

.topbar-brand {
  align-items: center !important;
}

.topbar-logo {
  display: block;
  height: 44px;
  overflow: hidden;
  position: relative;
  width: 178px;
}

.topbar-logo img {
  display: block;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
}

.topbar span,
.topbar p {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.topbar-actions {
  align-items: center !important;
  display: flex;
  gap: 14px !important;
}

.quiet-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  min-height: 34px;
  padding: 0 12px;
}

main {
  margin: 0 auto;
  max-width: 1280px;
  padding: 36px 28px 64px;
}

.page-heading,
.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.page-heading p,
.section-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

button,
input {
  font: inherit;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}

.metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 144px;
  padding: 18px;
}

.metrics span,
.status-strip span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.metrics strong {
  display: block;
  font-size: 2.25rem;
  margin: 18px 0 10px;
}

.metrics small {
  color: var(--muted);
}

.status-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.status-strip div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 18px;
}

.status-strip div + div {
  border-left: 1px solid var(--line);
}

.merchant-section {
  background: var(--surface);
  border: 1px solid var(--line);
  margin-top: 24px;
}

.section-heading {
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

input {
  background: #ffffff;
  border: 1px solid #cbd6d0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 12px;
  width: min(280px, 40vw);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

td {
  font-size: 0.88rem;
}

.store-name {
  display: block;
  font-weight: 750;
}

.store-domain {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  margin-top: 3px;
}

.status {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status[data-status="paid"] {
  color: var(--accent);
}

.status[data-status="trial"],
.status[data-status="test"] {
  color: var(--warning);
}

.status[data-status="expired"],
.status[data-status="uninstalled"] {
  color: var(--danger);
}

.error {
  background: #fff0ee;
  border: 1px solid #efc4bd;
  color: #8a1f12;
  margin-top: 18px;
  padding: 12px;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 18px;
  }

  .topbar p {
    display: none;
  }

  main {
    padding: 24px 16px 48px;
  }

  .metrics,
  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-strip div:nth-child(3) {
    border-left: 0;
  }

  .status-strip div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  input {
    width: 100%;
  }
}
