:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #111827;
  --primaryText: #ffffff;
  --chip: #111827;
  --chipText: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.logoBox {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: #eef2ff;
  flex: 0 0 auto;
}
.brandText { min-width: 0; }
.company {
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.expires { font-size: 12px; color: var(--muted); }

.statusChip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chipText);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

.h2 { font-size: 18px; font-weight: 800; margin: 0 0 10px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.grid2 {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 520px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}

.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 700; }

.hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3f4f6;
  position: relative;
}
.heroFallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  padding: 10px;
}
.heroIcon { font-size: 34px; }
.heroText { color: var(--muted); font-weight: 700; }
.heroImg { width: 100%; height: 100%; object-fit: cover; }

.totalLine {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.total {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.list { margin: 0; padding-left: 18px; }
.list li { margin: 6px 0; }

.subhead { margin-top: 12px; font-weight: 900; }

.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }

.field { margin-top: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 16px;
}

.btnRow { display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; }
.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 800;
  cursor: pointer;
}
.btn.primary {
  background: var(--primary);
  color: var(--primaryText);
  border-color: var(--primary);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.termsBox {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  background: #fafafa;
  line-height: 1.35;
}

.hidden { display: none !important; }

.approvedBanner {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.approvedBig { font-size: 20px; font-weight: 900; }

.photoGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 520px) {
  .photoGrid { grid-template-columns: repeat(3, 1fr); }
}
.photoThumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #f3f4f6;
  cursor: pointer;
}
.photoThumb img { width: 100%; height: 100%; object-fit: cover; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.6);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}
.modalCard {
  width: min(720px, 100%);
  background: white;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
}
.photoModalImg {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
}
