:root {
  --blue: #164cff;
  --ink: #111827;
  --line: #d7deed;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Noto Sans",
    Arial,
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
select {
  font: inherit;
}
button,
a,
select {
  border-radius: 0;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #164cff;
  outline-offset: 4px;
}
header {
  padding: 24px 5vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1.6px;
}
.brand b {
  color: var(--blue);
}
.brand small {
  font-size: 15px;
  letter-spacing: 0;
}
.head-actions {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 14px;
}
.head-actions select {
  border: 1px solid var(--line);
  background: white;
  padding: 10px;
}
main {
  max-width: 1500px;
  padding: clamp(40px, 7vw, 110px) 5vw 100px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr minmax(350px, 480px);
  gap: clamp(40px, 7vw, 110px);
}
.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kicker,
.number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
}
h1 {
  font-size: clamp(46px, 6vw, 86px);
  letter-spacing: -0.065em;
  line-height: 1.13;
  margin: 35px 0 25px;
}
h1 em {
  font-style: normal;
  color: var(--blue);
}
.intro > p:not(.kicker) {
  max-width: 520px;
  color: #4d5b70;
  font-size: 16px;
  line-height: 1.9;
}
.line {
  margin-top: 75px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  color: #68748a;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.panel {
  border: 1px solid var(--line);
  padding: clamp(24px, 3.5vw, 50px);
  box-shadow: 12px 12px 0 #f0f4ff;
}
h2 {
  font-size: 28px;
  letter-spacing: -0.04em;
  margin: 25px 0 12px;
}
.panel > p {
  color: #53617a;
}
.primary,
.secondary {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--blue);
  padding: 15px 20px;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}
.primary {
  background: var(--blue);
  color: white;
}
.secondary {
  background: white;
  color: var(--blue);
  margin-top: 12px;
}
.primary:hover {
  background: #113bc8;
}
.secondary:hover {
  background: #f2f5ff;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.hint {
  font-size: 13px;
  color: #56647b;
  line-height: 1.8;
}
.back {
  display: inline-block;
  color: var(--blue);
  margin-top: 22px;
  font-size: 14px;
  border-bottom: 1px solid var(--blue);
}
.message {
  min-height: 1.5em;
  font-size: 14px;
  color: #a02a2a !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
footer {
  border-top: 1px solid var(--line);
  padding: 25px 5vw;
  display: flex;
  justify-content: space-between;
  color: #68748a;
  font-size: 10px;
  letter-spacing: 0.08em;
}
@media (max-width: 720px) {
  header {
    padding: 18px 20px;
  }
  .brand {
    font-size: 24px;
  }
  .head-actions {
    gap: 10px;
  }
  .head-actions a {
    font-size: 12px;
  }
  main {
    display: block;
    padding: 48px 20px 70px;
  }
  .intro {
    margin-bottom: 42px;
  }
  h1 {
    font-size: clamp(40px, 11vw, 64px);
    margin: 24px 0;
  }
  .line {
    margin-top: 35px;
  }
  .panel {
    padding: 28px 22px;
    box-shadow: 8px 8px 0 #f0f4ff;
  }
  footer {
    padding: 20px;
    gap: 20px;
  }
}

[hidden] {
  display: none !important;
}
.history{max-width:1500px;margin:0 auto 90px;padding:0 5vw}.history-head{display:flex;justify-content:space-between;align-items:end;gap:20px;border-bottom:1px solid var(--line);padding-bottom:18px}.history-head h2{margin:5px 0 0;font-size:clamp(28px,4vw,48px)}.history-kicker{font-size:11px;letter-spacing:.12em;font-weight:700;color:var(--blue);margin:0}.history-refresh,.history-action{border:1px solid var(--blue);background:white;color:var(--blue);min-height:44px;padding:10px 16px;cursor:pointer;font-weight:700}.history-refresh:hover,.history-action:hover{background:#f1f5ff}.history-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:22px}.history-card{border:1px solid var(--line);padding:22px;display:flex;flex-direction:column;gap:12px}.history-card h3,.history-card p{margin:0}.history-card h3{font-size:18px}.history-card p,.history-meta{font-size:13px;color:#526078}.history-card .history-action{margin-top:auto}.history-detail{margin-top:25px;border:1px solid var(--line);padding:24px}.history-detail h3{margin:0 0 10px}.history-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.history-delete{border-color:#a12b30;color:#a12b30}.history-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,240px));gap:14px}.history-photo{margin:0}.history-photo>.portrait-open{display:block;width:100%;margin:0;padding:0;border:0;background:#f0f0ef;cursor:zoom-in}.history-photo>.portrait-open img{display:block;width:100%;aspect-ratio:1;object-fit:contain}.history-photo>.portrait-open:focus-visible{outline:3px solid var(--blue);outline-offset:2px}.history-photo button{width:100%;margin-top:8px}.history-error{color:#a12b30!important}.history-action:disabled{opacity:.5;cursor:wait}@media(max-width:600px){.history{padding:0 20px;margin-bottom:60px}.history-detail{padding:18px}.history-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
.account-delete-link{display:block;background:none;border:0;padding:14px 0 0;color:#9b3036;font:inherit;font-size:13px;text-decoration:underline;cursor:pointer}#delete-account-dialog{width:min(92vw,560px);border:1px solid #bbc6d7;padding:clamp(24px,5vw,38px);color:#111827;background:#fff}#delete-account-dialog::backdrop{background:rgba(9,20,42,.66)}#delete-account-dialog h2{margin:0 0 14px}#delete-account-dialog p{color:#53617a;line-height:1.75}#delete-account-dialog label{display:block;font-weight:700;margin:24px 0 8px}#delete-account-confirm{width:100%;min-height:54px;padding:12px;font:inherit;border:1px solid #8290a7;border-radius:0}#delete-account-status{min-height:1.5em;font-size:14px;color:#a12b30!important}.delete-account-actions{display:flex;flex-wrap:wrap;gap:10px}.delete-account-submit,.delete-account-cancel{min-height:52px;padding:12px 18px;font:inherit;font-weight:700;cursor:pointer;border:1px solid #a12b30;background:#a12b30;color:white}.delete-account-cancel{border-color:#9aa7bc;background:white;color:#182740}.delete-account-submit:disabled{opacity:.5;cursor:not-allowed}
.history-selection{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:20px 0}.history-selection p{flex-basis:100%;margin:0;color:#526078;font-size:13px}.history-photo-select{display:flex;gap:8px;align-items:center;min-height:44px;font-size:12px;line-height:1.4;cursor:pointer}.history-photo-select input{width:20px;height:20px;accent-color:#164cff;flex:none}.history-photo-select:focus-within{outline:2px solid #164cff;outline-offset:2px}@media(max-width:600px){.history-selection .history-action{flex:1;min-width:130px}}

.history-export .crop-frame{position:relative;width:100%;overflow:hidden;background:#e4ebf5;touch-action:none;cursor:grab}.history-export .crop-frame img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;aspect-ratio:auto}.history-export select{max-width:100%;width:100%;padding:8px}.history-export .crop-label{display:block;margin:12px 0;font-size:12px}.history-export .crop-label input{width:100%;min-height:44px}.history-export .crop-hint{font-size:12px}.history-export .button{background:#fff;border:1px solid #164cff;color:#164cff;padding:10px}
#recovery-panel{margin-top:28px;padding-top:24px;border-top:1px solid #dbe4f3}#recovery-panel h2{font-size:1.1rem}#recovery-panel p{line-height:1.7}#recovery-code-input{display:block;width:100%;max-width:100%;padding:12px;margin:10px 0;box-sizing:border-box}#recovery-output code{display:block;overflow-wrap:anywhere;padding:12px;background:#f1f5ff;user-select:all}
.history-variation{display:grid;gap:1rem;padding:1.5rem;border:1px solid #cbd5e1;margin:1.5rem 0}.history-variation label{display:grid;gap:.4rem}.history-variation select{min-height:3rem;padding:.6rem;border:1px solid #aab6c8;border-radius:0;background:#fff;color:#17233e}.history-variation button{justify-self:start}

#email-login { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
#email-login label { display: block; font-weight: 650; margin: 8px 0; }
#email-login input { width: 100%; min-height: 52px; border: 1px solid #7a889d; border-radius: 0; padding: 10px 14px; font: inherit; background: white; color: var(--ink); margin-bottom: 10px; }
#email-login input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#email-login input[readonly] { background: #f1f4fa; }
#email-code { letter-spacing: .25em; }
#email-options { display: flex; flex-wrap: wrap; gap: 6px 22px; }
#email-other button, #email-options button { min-height: 44px; border: 0; padding: 0; color: var(--blue); background: transparent; text-decoration: underline; cursor: pointer; }
#email-status { margin: 0; font-size: .93rem; overflow-wrap: anywhere; }
#email-login [hidden], #email-login[hidden] { display: none; }

.portrait-cover{display:block;align-self:flex-start;width:min(100%,24rem);aspect-ratio:4/3;background:#f1f4fa;overflow:hidden}.portrait-cover img{display:block;width:100%;height:100%;object-fit:contain}.portrait-cover:focus-visible{outline:3px solid #204eff;outline-offset:3px}

.history-favorite-filter { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; margin: 6px 0; cursor: pointer; font-weight: 600; }
.history-favorite-filter[hidden] { display: none; }
.history-favorite-filter input { accent-color: var(--blue); width: 1.15rem; height: 1.15rem; }

.library-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.library-actions:empty { display: none; }
.library-actions .history-action { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; text-decoration: none; }
.library-actions .library-primary { background: var(--blue); color: white; }
.library-actions .library-primary:hover { background: #0c36bb; }
.library-actions [hidden] { display: none; }
.library-actions .history-action:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.library-actions .library-primary:focus-visible { outline-color: #122a58; }
@media(max-width: 480px) { .library-actions .history-action { width: 100%; } }

/* Give the gallery room to land at the top while the portraits are loading. */
.history-destination{min-height:100svh}

.history-shot-settings,.history-shoot-note{border-block-end:1px solid var(--line)}
.history-shot-settings summary,.history-shoot-note summary{min-height:44px;cursor:pointer}
.history-shot-settings summary{display:flex;align-items:center;gap:12px;padding:10px 0;text-align:start}
.history-shot-settings summary:after{content:'+';margin-inline-start:auto;color:var(--blue);font-size:20px}
.history-shot-settings[open] summary:after{content:'−'}
.history-shot-settings summary img{object-fit:contain;background:#f4f6f8;flex:none}
.history-shot-settings summary>span{display:grid;gap:3px;overflow-wrap:anywhere}
.history-shot-settings small,.history-shot-settings dt{color:#556272;font-size:.8rem}
.history-shot-settings summary span>span{font-size:.85rem}
.history-shot-settings summary:focus-visible,.history-shoot-note summary:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.history-shot-settings dl{display:grid;grid-template-columns:fit-content(40%) minmax(0,1fr);gap:6px 14px;margin:4px 0 16px}
.history-shot-settings dd{margin:0;overflow-wrap:anywhere}
.reference-comparison .reference-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.reference-comparison .reference-pair figure{margin:0;min-width:0}
.reference-comparison figcaption{padding:0 0 8px;font-weight:650}
.reference-comparison img{width:100%;height:min(65vh,780px);height:min(65dvh,780px);display:block;object-fit:contain;background:#f2f3f4}
.reference-comparison .reference-switch{display:none}
.history-shot-settings>.history-action{margin:0 0 12px}
@media(max-width:640px){
  .reference-comparison .reference-pair{grid-template-columns:minmax(0,1fr)}
  .reference-comparison .reference-pair figure:not(.reference-active){display:none}
  .reference-comparison .reference-switch{display:inline-block}
  .reference-comparison figcaption{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
}
.history-shoot-note summary{align-content:center;font-weight:600}
.history-shoot-note p{white-space:pre-wrap;overflow-wrap:anywhere}

#email-other {display:flex;align-items:center;flex-wrap:wrap;gap:0 22px;margin:0 0 18px}
#email-other[hidden],#email-other [hidden]{display:none}
#email-outage{flex-basis:100%;margin:0}
.history-retention{margin:14px 0;max-width:44rem}.history-retention summary{color:var(--blue);cursor:pointer;font-weight:700;min-height:44px;align-content:center}.history-retention [role=status]{margin:6px 0;color:#526078;font-size:.875rem}.history-retention .history-toolbar{margin:10px 0;align-items:end}.history-retention label{display:grid;gap:4px;font-size:.825rem}.history-retention select{max-width:100%;min-height:44px;border:1px solid var(--line);padding:6px 12px;background:white;color:inherit;border-radius:0}
