/* The account pages, in the app's Rubby theme: plain black, warm white
   text, the duck's yellow for what to do next. Flat surfaces, thin
   borders, the system's monospace type; down to phone width. */
:root {
  color-scheme: dark;
  --bg: #121212;
  --bg-subtle: #0c0c0c;
  --surface: #1a1a1a;
  --input: #202020;
  --border: #2b2b2b;
  --fg: #f2f0eb;
  --fg-muted: #b4b4b4;
  --fg-subtle: #8f8f8f;
  --accent: #ffcf4d;
  --on-accent: #121212;
  --danger: #ff8a7a;
  --ok: #a9d4a2;
  --font: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, 'Ubuntu Mono', 'DejaVu Sans Mono', monospace;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
[hidden] {
  display: none !important;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

/* One card in the middle, for signing in and the like. */
.card {
  width: min(440px, calc(100% - 32px));
  margin: 24px auto 48px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.card .duck {
  width: 88px;
  margin: 0 auto 12px;
}
h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
  text-align: center;
}
h2 {
  margin: 0 0 12px;
  font-size: 17px;
}
.lede {
  margin: 0 0 20px;
  color: var(--fg-muted);
  text-align: center;
}

form {
  display: grid;
  gap: 14px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 13px;
}
input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--fg);
  font: inherit;
}
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
.hint {
  color: var(--fg-subtle);
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 120ms ease-out;
}
.button:hover {
  opacity: 0.88;
}
.button:disabled {
  opacity: 0.5;
  cursor: default;
}
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.button.danger {
  border-color: var(--danger);
  background: transparent;
  color: var(--danger);
}
.button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}
.note {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
}
.links {
  margin: 18px 0 0;
  color: var(--fg-subtle);
  font-size: 14px;
  text-align: center;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.actions.start {
  justify-content: flex-start;
  margin-top: 0;
  margin-bottom: 12px;
}
.center {
  text-align: center;
}

/* The account page: sections stacked in a wider column. */
.page {
  display: grid;
  gap: 16px;
  width: min(720px, calc(100% - 32px));
  margin: 8px auto 48px;
}
.section {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.banner {
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--fg);
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.row:first-of-type {
  border-top: 0;
}
.row-main {
  display: grid;
  min-width: 0;
}
.row-main strong {
  overflow-wrap: anywhere;
}
.tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  font-size: 12px;
}
.tag.ok {
  border-color: var(--ok);
  color: var(--ok);
}
.app {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.app:first-child {
  border-top: 0;
  padding-top: 0;
}

.app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
details summary {
  color: var(--fg-muted);
  cursor: pointer;
}
details[open] summary {
  margin-bottom: 12px;
}

/* The admin: totals, then a table. */
.admin {
  width: min(1100px, calc(100% - 32px));
  margin: 8px auto 48px;
}
.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.total {
  display: grid;
  min-width: 160px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.total strong {
  font-size: 20px;
}
.table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--fg-subtle);
  font-weight: 600;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.status-active {
  color: var(--ok);
}
.status-refunded,
.status-disputed,
.status-revoked {
  color: var(--danger);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
