:root {
  --bg: #f6f6f2;
  --ink: #111;
  --muted: #595959;
  --line: #111;
  --soft: #e4e4df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button,
input,
textarea {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

button {
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 700;
}

button:hover {
  background: var(--ink);
  color: #fff;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.parked {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 18px;
  text-align: center;
  background: #fff;
}

.parked-logo,
.brand {
  display: inline-block;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  color: transparent;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0 / 8px 8px,
    linear-gradient(#111 50%, transparent 0) 0 0 / 8px 8px;
  -webkit-background-clip: text;
  background-clip: text;
  text-transform: uppercase;
}

.parked-logo {
  font-size: clamp(52px, 12vw, 150px);
}

.brand {
  font-size: 32px;
}

.hidden-word {
  border: 0;
  background: transparent;
  color: #efefef;
  padding: 0;
  font-size: 11px;
  justify-self: center;
}

.hidden-word:hover {
  background: transparent;
  color: #bdbdbd;
}

dialog {
  border: 2px solid var(--line);
  padding: 22px;
  box-shadow: 8px 8px 0 var(--line);
}

dialog::backdrop {
  background: rgba(255, 255, 255, 0.7);
}

#login-form {
  display: grid;
  gap: 10px;
  min-width: 280px;
}

.shell {
  width: min(1420px, calc(100vw - 36px));
  margin: 24px auto 64px;
}

.topbar,
.detail-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 720px);
  gap: 24px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--line);
}

h1,
h2 {
  margin: 8px 0 12px;
  line-height: 1.05;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(28px, 5vw, 72px);
}

h2 {
  font-size: 20px;
  margin-top: 28px;
}

.upload-form {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 8px;
}

.upload-form textarea,
.upload-form input[type="file"],
.upload-form progress,
.upload-form .sub {
  grid-column: 1 / -1;
}

progress {
  width: 100%;
  height: 14px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
  border: 2px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 18px 18px,
    #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.92);
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: var(--ink);
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
}

td:last-child,
th:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.back {
  display: inline-block;
  margin-bottom: 18px;
}

.detail-head {
  grid-template-columns: 1fr auto;
}

.status-block {
  border: 2px solid var(--line);
  padding: 12px 16px;
  min-width: 150px;
  text-transform: uppercase;
  background: #fff;
}

.status-block span {
  display: block;
  font-size: 28px;
  font-weight: 900;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  border: 2px solid var(--line);
  margin-top: 24px;
  background: #fff;
}

.metrics-grid div {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics-grid span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
}

.metrics-grid b {
  display: block;
  margin-top: 5px;
  font-size: 26px;
}

.warnings {
  border: 2px solid var(--line);
  background: #fff;
  padding: 12px 28px;
}

.description-editor {
  display: grid;
  gap: 8px;
  max-width: 880px;
}

.description-editor textarea {
  width: 100%;
}

#pr-canvas {
  width: 100%;
  max-width: 920px;
  height: auto;
  border: 2px solid var(--line);
  background: #fff;
}

.mini {
  border: 2px solid var(--line);
}

.downloads {
  padding-left: 18px;
}

.error {
  color: #8b0000;
  min-height: 18px;
}

@media (max-width: 820px) {
  .topbar,
  .detail-head,
  .upload-form {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  th,
  td {
    padding: 8px;
  }
}

body.app-page {
  --bg: #101010;
  --ink: #f2f2ee;
  --muted: #9b9b94;
  --line: #eeeeea;
  --soft: #1f1f1d;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  color: var(--ink);
}

.app-page a {
  color: var(--ink);
}

.app-page .shell {
  width: min(1500px, calc(100vw - 48px));
  margin: 30px auto 72px;
}

.app-page .topbar {
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
  gap: clamp(54px, 8vw, 140px);
  border-bottom: 0;
  padding-bottom: 6px;
}

.app-page .detail-head {
  border-bottom: 0;
}

.app-page .brand {
  color: var(--ink);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: none;
}

.app-page .dot-word {
  --dot: clamp(4px, 0.48vw, 6px);
  --dot-gap: clamp(2px, 0.22vw, 3px);
  display: flex;
  gap: calc(var(--dot) * 1.25);
  align-items: flex-start;
  margin-bottom: 20px;
}

.app-page .dot-letter {
  display: grid;
  grid-template-columns: repeat(5, var(--dot));
  grid-template-rows: repeat(7, var(--dot));
  gap: var(--dot-gap);
}

.app-page .dot-letter span {
  width: var(--dot);
  height: var(--dot);
}

.app-page .dot-letter .on {
  background: var(--ink);
}

.app-page .dot-letter .off {
  opacity: 0;
}

.app-page h1 {
  color: var(--ink);
  font-size: clamp(42px, 5.8vw, 88px);
  max-width: 8ch;
}

.app-page .lead {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.app-page .upload-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 760px;
  justify-self: end;
}

.app-page .field {
  display: grid;
  gap: 6px;
}

.app-page .field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-page button,
.app-page input,
.app-page select,
.app-page textarea {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  outline: 0;
  padding: 12px 14px;
}

.app-page input::placeholder,
.app-page textarea::placeholder {
  color: #77776f;
}

.app-page input:focus,
.app-page select:focus,
.app-page textarea:focus {
  box-shadow:
    inset 0 0 0 1px rgba(242, 242, 238, 0.35),
    0 0 0 2px rgba(242, 242, 238, 0.18);
}

.app-page textarea {
  min-height: 112px;
}

.app-page .field-small {
  max-width: 220px;
}

.app-page .file-field input[type="file"] {
  position: absolute;
  inset: 0;
  min-height: 100%;
  cursor: pointer;
  opacity: 0;
}

.app-page .file-field {
  position: relative;
  min-height: 132px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.app-page .file-field strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  pointer-events: none;
}

.app-page .file-field span,
.app-page .file-field small {
  pointer-events: none;
}

.app-page .file-field.dragging {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 2px rgba(242, 242, 238, 0.55);
}

.app-page .file-field small {
  color: var(--muted);
  line-height: 1.4;
}

.app-page button {
  min-height: 50px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.14);
}

.app-page button:hover {
  color: #101010;
  background: var(--ink);
}

.app-page .progress-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.app-page .progress-row {
  display: grid;
  gap: 6px;
  width: 100%;
}

.app-page .progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.app-page .progress-label b {
  min-width: 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-page .progress-label span {
  flex: 0 0 auto;
  text-align: right;
}

.app-page .square-progress {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  overflow: hidden;
}

.app-page .square-progress span {
  width: 100%;
  aspect-ratio: 1;
  background: var(--ink);
  opacity: 0.12;
  transition: opacity 180ms ease;
}

.app-page .square-progress span.active {
  opacity: 0.95;
}

.app-page .square-progress span.current {
  opacity: 1;
}

.app-page .sub {
  color: var(--muted);
}

.app-page .model-link {
  text-decoration: none;
}

.app-page .model-link:hover {
  text-decoration: none;
  color: var(--muted);
}

.app-page .codename-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(242, 242, 238, 0.88);
  color: #101010;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.app-page .table-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}

.app-page .table-tools label {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.app-page .table-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-page .table-tools button,
.app-page .table-tools select {
  min-height: 38px;
}

.app-page .table-wrap {
  border-color: var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 18px 18px,
    #121210;
  overflow-x: auto;
  margin-top: 14px;
}

.app-page table {
  background: #121210;
  color: var(--ink);
}

.app-page th {
  background: var(--ink);
  color: #101010;
}

.app-page .sort-head {
  min-height: auto;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.app-page .sort-head:hover {
  background: transparent;
  color: inherit;
}

.app-page .sort-head.active::after {
  content: " " attr(data-dir);
  font-weight: 400;
  opacity: 0.7;
}

.app-page th,
.app-page td {
  border-color: rgba(242, 242, 238, 0.55);
}

.app-page .empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.app-page .status-block,
.app-page .metrics-grid,
.app-page .warnings,
.app-page .metric-canvas,
.app-page .mini {
  background: #151513;
  border-color: var(--line);
}

.app-page .metrics-grid div {
  border-color: rgba(242, 242, 238, 0.55);
}

.app-page .detail-title {
  max-width: min(100%, 22ch);
  font-size: clamp(30px, 3.4vw, 54px);
  overflow-wrap: anywhere;
}

.app-page .detail-codename {
  margin-bottom: 8px;
}

.app-page .metrics-grid {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  margin-top: 26px;
}

.app-page .metrics-grid div {
  padding: 12px;
}

.app-page .metrics-grid b {
  font-size: 21px;
}

.app-page .chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 22px;
  align-items: start;
}

.app-page .chart-grid > div:first-child {
  grid-column: 1 / -1;
}

.app-page .metric-canvas {
  width: 100%;
  height: auto;
  border: 1px solid rgba(242, 242, 238, 0.55);
  background: transparent;
}

.app-page #pr-canvas.metric-canvas {
  max-width: none;
  border: 1px solid rgba(242, 242, 238, 0.55);
  background: transparent;
}

@media (max-width: 900px) {
  .app-page .topbar,
  .app-page .detail-head {
    grid-template-columns: 1fr;
  }

  .app-page .upload-form {
    justify-self: stretch;
    max-width: none;
  }

  .app-page h1 {
    max-width: none;
  }

  .app-page .chart-grid,
  .app-page .metrics-grid {
    grid-template-columns: 1fr;
  }
}
