:root {
  color-scheme: light;
  --ink: #3f3029;
  --muted: #70665f;
  --line: #d9e4df;
  --soft: #f4faf7;
  --brand: #299ba1;
  --brand-strong: #207a80;
  --panel: #fffefa;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fbf8f1;
  color: var(--ink);
}

button, input, select, textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.home-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.home-hero,
.home-guide {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.home-hero img,
.home-guide img {
  display: block;
  width: 100%;
  height: auto;
}

.home-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.home-login strong,
.home-login span {
  display: block;
}

.home-login strong {
  margin-bottom: 3px;
  font-size: 18px;
}

.home-login span {
  color: var(--muted);
  line-height: 1.6;
}

.home-login-button {
  min-width: 210px;
  min-height: 50px;
  font-size: 17px;
  font-weight: 800;
}

.home-guide {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.hero,
.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.branded-top {
  align-items: center;
}

.wide-brand-logo {
  display: block;
  width: min(430px, 48vw);
  height: auto;
}

.admin-sections {
  display: grid;
  gap: 16px;
}

#albumForm {
  position: relative;
  overflow: hidden;
  padding-top: 72px;
}

#albumForm {
  border-color: #8bcdd0;
  background: #fbfefe;
}

#albumForm > h2 {
  position: absolute;
  inset: 0 0 auto;
  min-height: 54px;
  margin: 0;
  padding: 15px 18px;
  color: #fff;
  font-size: 21px;
}

#albumForm > h2 {
  background: #299ba1;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 12px;
  letter-spacing: 0;
}

p, .help {
  color: var(--muted);
  line-height: 1.7;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 9px 14px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.button.primary:hover {
  background: var(--brand-strong);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.button.ghost {
  background: #fff;
}

.button.danger {
  background: #fff;
  border-color: #e3b6b2;
  color: #b3261e;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.steps article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.steps b,
.steps span {
  display: block;
}

.steps b {
  margin-bottom: 8px;
}

.steps span {
  color: var(--muted);
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  align-items: start;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.customer-top {
  align-items: center;
}

.customer-top .wide-brand-logo {
  width: min(430px, 48vw);
}

.customer-album-summary {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px 18px;
}

.customer-album-summary h1 {
  margin-bottom: 4px;
  font-size: 25px;
}

.customer-album-summary p {
  margin-bottom: 0;
}

.customer-message {
  margin-bottom: 16px;
  border: 1px solid #f1d19e;
  border-radius: 8px;
  background: #fff8eb;
  padding: 14px 18px;
}

.customer-message span {
  display: block;
  margin-bottom: 6px;
  color: #a76313;
  font-size: 13px;
  font-weight: 800;
}

.customer-message p {
  margin: 0;
  color: var(--ink);
  white-space: pre-line;
}

.customer-store {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  max-width: 460px;
  text-align: right;
}

.customer-store-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  flex: 0 0 auto;
}

.customer-store strong,
.customer-store span,
.customer-store a {
  display: block;
  overflow-wrap: anywhere;
}

.customer-store strong,
.customer-store span {
  text-align: left;
}

.customer-store strong {
  margin-bottom: 5px;
  font-size: 18px;
}

.customer-store span,
.customer-store a {
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.customer-store a {
  color: var(--brand);
  font-weight: 700;
  text-align: right;
}

.store-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: start;
}

.check-label {
  display: flex;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 8px;
  font-weight: 500;
}

.check-label input {
  width: auto;
  margin: 0;
}

.store-logo-preview-wrap {
  display: grid;
  gap: 10px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
  text-align: center;
}

.store-logo-preview-wrap > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.store-logo-preview {
  width: 160px;
  height: 120px;
  object-fit: contain;
}

.store-logo-preview-wrap .help {
  margin-bottom: 0;
}

.message {
  min-height: 26px;
  margin: 12px 0 0;
  color: #9a4b00;
}

.notice-line {
  margin: 0 0 12px;
  border: 1px solid #b9ddcf;
  border-radius: 8px;
  background: #eff9f5;
  color: #24745b;
  padding: 10px 12px;
  font-weight: 700;
}

.reviewer-banner {
  margin: 0;
  border: 1px solid #f1d19e;
  border-radius: 8px;
  background: #fff8eb;
  color: #8a5412;
  padding: 12px 14px;
  font-weight: 800;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.summary-grid b,
.summary-grid span {
  display: block;
}

.summary-grid b {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.summary-grid span {
  font-weight: 800;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.variant-actions {
  display: flex;
  justify-content: flex-start;
}

.download-confirm {
  margin: 0 0 12px;
  border: 1px solid #f0cf94;
  border-radius: 8px;
  background: #fff7e8;
  padding: 14px;
}

.download-confirm p {
  color: #6f4300;
  font-weight: 700;
  margin-bottom: 12px;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.album-list {
  display: grid;
  gap: 20px;
}

.album {
  border: 1px solid #f4bd72;
  border-radius: 8px;
  padding: 0 14px 14px;
  overflow: hidden;
  background: #fffdf9;
  display: grid;
  gap: 12px;
}

.album b,
.album span {
  display: block;
}

.album span {
  color: var(--muted);
  margin-top: 4px;
}

.album .album-password-line {
  color: var(--ink);
  font-weight: 800;
  margin-top: 8px;
}

.album-overview {
  display: grid;
  gap: 0;
  margin: 0 -14px;
}

.album-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: #ed9828;
  color: #fff;
}

.album-card-header > div {
  min-width: 0;
}

.album .album-title-display {
  font-size: 23px;
  line-height: 1.4;
  color: #fff;
  overflow-wrap: anywhere;
}

.album .album-status {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(255,255,255,.92);
  color: #24745b;
  font-size: 13px;
  font-weight: 800;
}

.album .album-status.is-expired {
  background: #f6e8e6;
  color: #a33a32;
}

.album-password-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.album .album-password-box span {
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: 13px;
  font-weight: 700;
}

.album-password-box strong {
  color: #fff;
  font-size: 20px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.album-card-body {
  padding: 12px 14px 0;
}

.album-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.album-details div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 9px 10px;
}

.album-details dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.album-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.album-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-preview-button {
  min-height: 46px;
  padding-right: 19px;
  padding-left: 19px;
  font-weight: 800;
}

.important-submit {
  min-height: 46px;
  min-width: 220px;
  font-weight: 800;
}

.album-edit-settings {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.album-edit-settings h3 {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0;
}

.download-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.download-bar select {
  max-width: 190px;
}

.download-bar span {
  color: var(--muted);
}

.download-bar .download-complete {
  color: #c62828;
  font-weight: 800;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.photo {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(0,0,0,.08)),
    var(--photo-bg, #b8c4cf);
  display: flex;
  align-items: end;
  padding: 9px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.45);
}

.real-photo {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #e7efea;
  border: 1px solid var(--line);
}

.real-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.real-photo figcaption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  min-width: 30px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.upload-form,
.expiry-form,
.title-form,
.client-password-form {
  display: grid;
  gap: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.upload-form label,
.expiry-form label,
.title-form label,
.client-password-form label {
  margin-bottom: 0;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.admin-photo {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.admin-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.admin-photo figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px;
  font-size: 13px;
}

.mini-danger {
  border: 1px solid #e3b6b2;
  border-radius: 6px;
  background: #fff;
  color: #b3261e;
  padding: 4px 7px;
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 780px) {
  .home-page {
    width: 100%;
    padding-top: 0;
  }

  .home-hero,
  .home-guide {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .home-login {
    display: grid;
    gap: 14px;
    padding: 18px 16px 20px;
    text-align: center;
  }

  .home-login-button {
    width: 100%;
  }

  .hero,
  .top,
  .grid,
  .steps {
    grid-template-columns: 1fr;
    display: grid;
  }

  .branded-top {
    gap: 14px;
  }

  .wide-brand-logo,
  .customer-top .wide-brand-logo {
    width: 100%;
  }

  .customer-top {
    gap: 14px;
  }

  h1 {
    font-size: 25px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-bar select,
  .download-bar .button {
    max-width: none;
    width: 100%;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions .button {
    width: 100%;
  }

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

  .album-card-header {
    align-items: flex-start;
  }

  .album .album-title-display {
    font-size: 20px;
  }

  .album-password-box {
    display: grid;
    gap: 3px;
  }

  .album-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-store {
    justify-content: flex-start;
    max-width: none;
  }

  .customer-store-logo {
    width: 68px;
    height: 68px;
  }

  .store-settings-grid {
    grid-template-columns: 1fr;
  }

  .backup-actions {
    justify-content: stretch;
  }

  .backup-actions .button {
    width: 100%;
  }
}
