/* Old School Photo Lab — Contact Sheet · assets/style.css · v0.4 */

:root {
  --paper: #F4EFE6;
  --card: #FFFDF9;
  --ink: #1E1B18;
  --muted: #6B6259;
  --line: #D8CFC2;
  --dash: #B5AA9C;
  --accent: #A8431A;
  --accent-dark: #7E3112;
  --ok-bg: #E3EDE0;
  --ok-ink: #2F5130;
  --sheet: #1E1B18;
  --frame-no: #E9C77B;
  --type: "American Typewriter", "Courier Prime", "Courier New", monospace;
  --serif: "EB Garamond", Garamond, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1 {
  font-family: var(--type);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  margin: 8px 0 6px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.lead { font-size: 19px; }
.muted { color: var(--muted); margin: 2px 0; font-size: 16px; }
.small { font-size: 15px; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 16px;
  border-bottom: 1px dashed var(--dash);
}
.topbar a {
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand { font-family: var(--type); letter-spacing: 0.04em; color: var(--ink); font-size: 15px; }
.back, .signout { font-size: 17px; }

.testbar {
  background: #FFF1C9;
  color: #5A4300;
  text-align: center;
  font-family: "Courier Prime", monospace;
  font-size: 14px;
  padding: 6px 12px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px 20px;
  border-radius: 6px;
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.btn small { font-family: var(--serif); font-weight: 400; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-outline-light { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn-outline-light:hover { background: var(--paper); color: var(--ink); }
.btn-two-line { min-height: 58px; }

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  margin: 18px 0 22px;
}
.zip-status:empty { display: none; }

/* ---- Cards ---- */
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
}
.card-dashed { background: transparent; border-style: dashed; border-color: var(--dash); }
.card-ok { background: var(--ok-bg); border-color: var(--ok-bg); }
.card-ok .card-title { color: var(--ok-ink); }
.card-title { font-family: "Courier Prime", monospace; font-weight: 700; font-size: 17px; margin: 0 0 2px; }
.card p { margin: 6px 0; }

.alert {
  background: #FBE7DD;
  border: 1px solid #E8B9A3;
  color: #6E2A0C;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 16px;
}

/* ---- Sign in ---- */
.signin {
  max-width: 420px;
  margin: 8vh auto 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 4vh; }
.logo-mark {
  width: 56px; height: 56px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--type); font-weight: 700; font-size: 18px;
}
.logo-name { font-family: var(--type); letter-spacing: 0.04em; font-size: 17px; }
.signin h1 { font-size: 34px; }
.signin p { margin: 0; }

/* ---- My Rolls ---- */
.roll-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.roll-card { display: flex; flex-direction: column; gap: 10px; }
.roll-card:hover { border-color: var(--ink); }
.roll-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.strip { display: grid; gap: 4px; padding: 6px; background: var(--sheet); border-radius: 3px; }
.strip-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.strip img, .strip .noimg { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: #4A443E; }
.pill {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  font-size: 13px;
}
.pill-ready { background: var(--ok-bg); color: var(--ok-ink); }

/* ---- Contact sheet ---- */
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 10px;
  background: var(--sheet);
  border-radius: 4px;
}
@media (max-width: 480px) {
  .contact-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; }
}
.frame-cell { display: flex; flex-direction: column; gap: 3px; text-decoration: none; }
.frame-cell img, .frame-cell .noimg {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4A443E;
  color: #CFC6B8;
  font-size: 12px;
  text-align: center;
}
.frame-cell:hover img { outline: 2px solid var(--frame-no); }
.frame-no { font-family: "Courier Prime", monospace; font-size: 12px; color: var(--frame-no); }

/* ---- Frame view (dark) ---- */
body.dark { background: #161412; color: var(--paper); }
body.dark a { color: var(--frame-no); }
body.dark .topbar { border-bottom-color: #2E2A26; }
body.dark .muted { color: #CFC6B8; }
body.dark .foot { color: #CFC6B8; border-top-color: #2E2A26; }
body.dark .btn-primary { color: #fff; }
.frame-count { font-family: "Courier Prime", monospace; color: #CFC6B8; margin: 0 0 10px; }
.viewer { display: flex; justify-content: center; }
.viewer img {
  max-width: 100%;
  max-height: 72vh;
  border: 6px solid var(--paper);
  display: block;
}
.noimg-large {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #2E2A26;
  color: #CFC6B8;
  text-align: center;
}
.frame-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 14px auto 0;
  text-align: center;
}
.round {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid #6B6259;
  display: flex; align-items: center; justify-content: center;
}
body.dark .round { color: var(--paper); }
.round.disabled { border-color: transparent; }
body.dark .actions { margin-left: auto; margin-right: auto; }

/* ---- Ask ---- */
.context { display: flex; gap: 12px; align-items: center; max-width: 520px; margin: 12px 0 16px; }
.context img { width: 84px; height: 56px; object-fit: cover; border: 3px solid var(--ink); flex-shrink: 0; }
.ask-form { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.ask-form label { font-family: "Courier Prime", monospace; font-weight: 700; font-size: 15px; }
.ask-form textarea, .ask-form input {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #8F8477;
  border-radius: 6px;
  background: var(--card);
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}
.ask-form textarea { resize: vertical; }

/* ---- Setup checks ---- */
.diag { border-collapse: collapse; width: 100%; font-size: 16px; margin: 12px 0 18px; }
.diag th, .diag td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.diag td.ok { color: var(--ok-ink); font-weight: 700; }
.diag td.bad { color: #9C2E0B; font-weight: 700; }
.diag td:last-child { word-break: break-word; }

/* ---- Footer ---- */
.foot {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  border-top: 1px dashed var(--dash);
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}
.tagline { font-family: var(--type); color: inherit; margin-bottom: 4px; }

/* ---- v0.4: parts, waiting rolls, notes ---- */
.pill-wait { background: #EDE6DA; color: #5A4E40; }
.part { margin: 26px 0 8px; }
.part h2 {
  font-family: var(--type);
  font-size: 21px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--dash);
}
.part .actions { margin: 10px 0 14px; }
.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
  max-width: 720px;
}
.note-title { font-family: "Courier Prime", monospace; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.note p { margin: 6px 0; }
.frame-no { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- v0.5: direct download page ---- */
.download-page { max-width: 520px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 12px; }
.download-page .logo { margin-bottom: 2vh; }
.dl-rolls { margin: 4px 0; padding-left: 20px; }
.dl-rolls li { margin: 4px 0; }
