*{
  box-sizing:border-box;
}

html{
  width:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  width:100%;
  min-height:100vh;
  overflow-x:hidden;
  font-family:Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(203,164,118,.35), transparent 30%),
    linear-gradient(135deg,#f8efe5,#f4e3d2,#fffaf4);
  color:#2f241d;
}

img{
  max-width:100%;
}

.app{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

.card{
  width:100%;
  max-width:760px;
  background:rgba(255,255,255,.74);
  border:1px solid rgba(255,255,255,.8);
  border-radius:34px;
  padding:42px;
  box-shadow:0 28px 80px rgba(87,54,28,.16);
  backdrop-filter:blur(18px);
}

.pose-app-card{
  max-width:520px;
  padding:26px;
  border-radius:32px;
}

.top-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:26px;
}

.app-kicker{
  margin:0 0 4px;
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#9b704c;
  font-weight:900;
}

.app-name{
  margin:0;
  color:#3c2a1f;
  font-weight:900;
  font-size:16px;
}

.credit-pill{
  flex:0 0 auto;
  padding:9px 13px;
  border-radius:999px;
  background:#3b281d;
  color:#fff8ef;
  font-size:12px;
  font-weight:900;
  box-shadow:0 10px 26px rgba(59,40,29,.16);
}

.hero-block{
  text-align:center;
  margin-bottom:22px;
}

.panel{
  padding:16px;
  border-radius:26px;
  background:rgba(255,250,244,.72);
  border:1px solid rgba(122,83,55,.11);
  box-shadow:0 12px 28px rgba(87,54,28,.07);
}

.compact-panel{
  padding:15px;
}

.panel-label{
  margin:0 0 12px;
  color:#6a4b36;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.section-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.section-title-row .panel-label{
  margin:0;
}

.micro-hint{
  color:#9b704c;
  font-size:12px;
  font-weight:800;
}

.eyebrow{
  margin:0 0 14px;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-size:12px;
  color:#9b704c;
  font-weight:800;
}

h1{
  margin:0;
  font-size:46px;
  line-height:1.05;
  letter-spacing:-1.5px;
}

.hero-title{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:clamp(32px, 6.5vw, 44px);
  line-height:.98;
  letter-spacing:-1.7px;
  font-weight:900;
  color:#2f2118;
  text-wrap:balance;
}

.subtitle{
  max-width:590px;
  margin:18px 0 30px;
  color:#6d5a4d;
  font-size:17px;
  line-height:1.7;
}

.form{
  display:flex;
  flex-direction:column;
  gap:20px;
}

.upload-box{
  cursor:pointer;
  min-height:240px;
  border:2px dashed rgba(151,103,66,.35);
  border-radius:28px;
  background:rgba(255,250,244,.78);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  transition:.25s ease;
  overflow:hidden;
}

.upload-box-ref{
  min-height:235px;
  border-radius:24px;
  background:linear-gradient(180deg,rgba(255,255,255,.75),rgba(255,246,234,.9));
}

.upload-icon{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:#efe0d1;
  font-size:28px;
  margin-bottom:4px;
}

.upload-box:hover{
  background:#fff8ef;
  transform:translateY(-2px);
}

.upload-box input{
  display:none;
}

#preview-container{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  padding:18px;
}

#preview{
  display:none;
  width:100%;
  max-height:300px;
  object-fit:contain;
  border-radius:20px;
}

#upload-text{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center;
  font-size:20px;
  font-weight:800;
}

#upload-text small{
  font-size:14px;
  color:#8f7a6d;
  font-weight:500;
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

label{
  font-size:13px;
  font-weight:800;
  color:#6a4b36;
}

select{
  width:100%;
  margin-top:8px;
  padding:15px 16px;
  border-radius:18px;
  border:1px solid rgba(122,83,55,.18);
  background:#fffaf4;
  color:#3b2b21;
  font-size:15px;
}

.hint{
  margin:8px 0 0;
  color:#7a6251;
  font-size:13px;
  line-height:1.5;
  font-weight:500;
}

.quality-preview{
  display:grid;
  grid-template-columns:190px 1fr;
  gap:18px;
  align-items:start;
  padding:18px;
  border-radius:24px;
  background:rgba(255,250,244,.86);
  border:1px solid rgba(122,83,55,.12);
  color:#6d5a4d;
  font-size:14px;
  line-height:1.5;
}

.subtle-quality{
  display:block;
  margin-top:12px;
  padding:12px 13px;
  border-radius:18px;
  background:rgba(255,255,255,.55);
  box-shadow:none;
  font-size:12px;
}

.subtle-quality .quality-preview-score{
  float:right;
  margin:0 0 8px 12px;
  font-size:24px;
}

.subtle-quality h3{
  margin-bottom:3px;
  font-size:13px;
}

.subtle-quality p,
.subtle-quality small{
  color:#7a6251;
}

.subtle-quality ul{
  margin-top:8px;
  clear:both;
}

.quality-preview-score{
  margin:0 0 8px;
  font-size:38px;
  line-height:1;
  font-weight:900;
  letter-spacing:-1px;
  color:#6b4228;
}

.quality-preview h3{
  margin:0 0 8px;
  color:#5a3925;
}

.quality-preview p{
  margin:0 0 6px;
}

.quality-preview ul{
  margin:0;
  padding-left:18px;
}

.quality-preview.waiting{
  opacity:.82;
}

.quality-preview.checking{
  background:rgba(255,246,232,.94);
}

.quality-preview.error{
  background:rgba(255,235,235,.88);
  border-color:rgba(190,70,70,.22);
}

.tier-excellent .quality-preview-score,
.tier-good .quality-preview-score{
  color:#4f7b42;
}

.tier-fair .quality-preview-score{
  color:#b7791f;
}

.tier-low .quality-preview-score{
  color:#b04444;
}

.option-grid{
  display:grid;
  gap:10px;
}

.style-grid{
  grid-template-columns:1fr 1fr;
}

.result-grid-options{
  grid-template-columns:repeat(4, 1fr);
}

.mode-grid{
  display:grid;
  gap:10px;
}

.choice-card{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  padding:12px 13px;
  border-radius:18px;
  border:1px solid rgba(122,83,55,.14);
  background:rgba(255,255,255,.64);
  color:#4a3425;
  text-align:center;
  cursor:pointer;
  transition:.2s ease;
  overflow:hidden;
}

.choice-card input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.choice-card span{
  font-size:13px;
  font-weight:900;
  line-height:1.25;
}

.choice-card small{
  display:block;
  margin-top:3px;
  font-size:11px;
  color:inherit;
  opacity:.75;
  font-weight:700;
}

.choice-card:has(input:checked){
  background:#3b281d;
  color:#fff8ef;
  border-color:#3b281d;
  box-shadow:0 12px 28px rgba(59,40,29,.16);
}

.choice-card:has(input:focus-visible){
  outline:3px solid rgba(185,132,91,.32);
  outline-offset:2px;
}

.choice-card:hover{
  transform:translateY(-1px);
}

.small-choice{
  min-height:58px;
  padding:10px 8px;
}

.mode-card{
  justify-content:flex-start;
  text-align:left;
  min-height:62px;
}

.mode-card span{
  display:flex;
  flex-direction:column;
  gap:3px;
}

button{
  border:0;
  border-radius:999px;
  padding:18px 24px;
  background:linear-gradient(135deg,#6b4228,#b9845b,#d8b489);
  color:white;
  font-weight:900;
  font-size:16px;
  cursor:pointer;
  box-shadow:0 14px 34px rgba(111,70,41,.25);
  transition:.25s ease;
}

button:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 42px rgba(111,70,41,.3);
}

button:disabled{
  cursor:not-allowed;
  opacity:.55;
  filter:grayscale(.25);
  transform:none;
  box-shadow:none;
}

button:disabled:hover{
  transform:none;
  box-shadow:none;
}

/* Loading */
.loading-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(248,239,229,.88);
  backdrop-filter:blur(14px);
  z-index:999;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.coffee-loader{
  background:rgba(255,255,255,.84);
  border-radius:32px;
  padding:42px;
  width:min(90%,420px);
  box-shadow:0 28px 80px rgba(87,54,28,.18);
}

.cup{
  position:relative;
  font-size:58px;
  margin-bottom:18px;
  animation:floatCup 1.8s ease-in-out infinite;
}

.steam{
  position:absolute;
  width:8px;
  height:34px;
  border-radius:999px;
  background:rgba(154,103,68,.32);
  top:-28px;
  animation:steamUp 1.6s ease-in-out infinite;
}

.s1{left:44%; animation-delay:0s;}
.s2{left:50%; animation-delay:.25s;}
.s3{left:56%; animation-delay:.5s;}

.coffee-loader h2{
  margin:0 0 10px;
}

.coffee-loader p{
  margin:0;
  color:#7a6251;
  line-height:1.6;
}

@keyframes floatCup{
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(-8px);}
}

@keyframes steamUp{
  0%{opacity:0; transform:translateY(10px) scale(.8);}
  40%{opacity:1;}
  100%{opacity:0; transform:translateY(-22px) scale(1.15);}
}

/* Result page */
.result-page{
  min-height:100vh;
  padding:34px;
  background:linear-gradient(135deg,#f8efe5,#fffaf4);
}

.result-card{
  max-width:920px;
  margin:auto;
  background:rgba(255,255,255,.78);
  border-radius:34px;
  padding:34px;
  box-shadow:0 28px 80px rgba(87,54,28,.16);
}

.compare-wrapper{
  position:relative;
  width:100%;
  max-width:720px;
  margin:28px auto;
  overflow:hidden;
  border-radius:28px;
  box-shadow:0 18px 50px rgba(87,54,28,.18);
}

.compare-wrapper img{
  display:block;
  width:100%;
}

.after-img{
  position:absolute;
  inset:0;
  width:50%;
  height:100%;
  overflow:hidden;
}

.after-img img{
  height:100%;
  width:720px;
  max-width:none;
  object-fit:cover;
}

.slider{
  width:100%;
  margin:18px 0;
}

.quality-card{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:20px;
  align-items:start;
  padding:22px;
  border-radius:26px;
  background:rgba(255,250,244,.9);
  border:1px solid rgba(122,83,55,.13);
  margin:24px 0;
  color:#5c4637;
}

.quality-score{
  margin:0 0 8px;
  font-size:42px;
  line-height:1;
  font-weight:900;
  letter-spacing:-1px;
  color:#6b4228;
}

.quality-card h3{
  margin:0 0 8px;
}

.quality-card p{
  margin:0 0 8px;
  line-height:1.5;
}

.quality-card ul{
  margin:0;
  padding-left:20px;
  line-height:1.7;
}

.before-img{
  width:100%;
  max-height:480px;
  object-fit:contain;
  border-radius:24px;
  background:#fffaf4;
  box-shadow:0 14px 36px rgba(87,54,28,.13);
  margin-bottom:26px;
}

.generated-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:24px;
  margin:18px 0 28px;
}

.generated-card{
  padding:16px;
  border-radius:26px;
  background:rgba(255,250,244,.78);
  border:1px solid rgba(122,83,55,.1);
}

.result-label{
  margin:0 0 10px;
  font-size:12px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:#9b704c;
  font-weight:900;
}

.result-img{
  width:100%;
  max-height:560px;
  object-fit:contain;
  border-radius:20px;
  background:#fffaf4;
  box-shadow:0 14px 36px rgba(87,54,28,.13);
}

.mini-actions{
  margin-top:14px;
}

.mini-actions a{
  padding:10px 16px;
  font-size:13px;
}

.prompt-details{
  margin:18px 0 28px;
  padding:18px;
  border-radius:20px;
  background:rgba(255,250,244,.82);
  color:#5c4637;
}

.prompt-details summary{
  cursor:pointer;
  font-weight:900;
}

.prompt-details pre{
  white-space:pre-wrap;
  overflow:auto;
  font-size:12px;
  line-height:1.5;
}

.actions{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
}

.actions a{
  text-decoration:none;
  padding:14px 22px;
  border-radius:999px;
  background:#6b4228;
  color:white;
  font-weight:800;
}

.actions a.secondary{
  background:#efe0d1;
  color:#4a3425;
}

@media(max-width:700px){
  body{
    background:linear-gradient(180deg,#fff8ef 0%,#f7e7d7 100%);
  }

  .app{
    min-height:100svh;
    align-items:flex-start;
    padding:14px;
    padding-bottom:calc(22px + env(safe-area-inset-bottom));
  }

  .card{
    padding:22px;
    border-radius:26px;
    box-shadow:0 18px 50px rgba(87,54,28,.13);
  }

  .pose-app-card{
    max-width:100%;
    padding:20px;
  }

  .top-row{
    margin-bottom:22px;
  }

  .app-name{
    font-size:15px;
  }

  .credit-pill{
    padding:8px 11px;
    font-size:11px;
  }

  .hero-block{
    margin-bottom:16px;
  }

  .hero-title{
    font-size:clamp(28px, 8.2vw, 34px);
    letter-spacing:-1.15px;
    line-height:1;
  }

  .panel{
    padding:14px;
    border-radius:22px;
  }

  .panel-label{
    font-size:11px;
    margin-bottom:10px;
  }

  .eyebrow{
    margin-bottom:10px;
    font-size:10px;
    letter-spacing:.14em;
  }

  h1{
    font-size:clamp(30px, 9vw, 38px);
    letter-spacing:-1.1px;
  }

  .subtitle{
    margin:14px 0 22px;
    font-size:15px;
    line-height:1.6;
  }

  .form{
    gap:16px;
  }

  .upload-box{
    min-height:190px;
    border-radius:24px;
  }

  .upload-box-ref{
    min-height:205px;
  }

  .upload-icon{
    width:48px;
    height:48px;
    border-radius:16px;
    font-size:24px;
  }

  #preview-container{
    padding:12px;
  }

  #preview{
    max-height:260px;
    border-radius:18px;
  }

  #upload-text{
    font-size:17px;
    line-height:1.35;
    padding:0 14px;
  }

  #upload-text small{
    font-size:12px;
  }

  .grid,
  .generated-grid,
  .quality-card,
  .quality-preview{
    grid-template-columns:1fr;
  }

  .style-grid{
    grid-template-columns:1fr;
  }

  .result-grid-options{
    grid-template-columns:1fr 1fr;
  }

  .choice-card{
    min-height:48px;
    border-radius:16px;
  }

  .small-choice{
    min-height:56px;
  }

  .mode-card{
    min-height:58px;
  }

  label{
    font-size:12px;
  }

  select{
    min-height:52px;
    padding:14px 15px;
    border-radius:16px;
    font-size:16px;
  }

  .hint{
    font-size:12px;
  }

  .quality-preview{
    gap:10px;
    padding:16px;
    border-radius:22px;
    font-size:13px;
  }

  .subtle-quality{
    padding:12px;
    font-size:12px;
  }

  .quality-preview-score{
    font-size:34px;
  }

  .quality-preview h3{
    font-size:16px;
  }

  button{
    width:100%;
    min-height:54px;
    padding:16px 20px;
    font-size:15px;
    position:sticky;
    bottom:calc(10px + env(safe-area-inset-bottom));
    z-index:10;
  }

  .coffee-loader{
    width:calc(100% - 28px);
    padding:28px 22px;
    border-radius:26px;
  }

  .cup{
    font-size:48px;
  }

  .coffee-loader h2{
    font-size:21px;
  }

  .coffee-loader p{
    font-size:14px;
  }

  .result-page{
    padding:14px;
    padding-bottom:calc(22px + env(safe-area-inset-bottom));
  }

  .result-card{
    padding:20px;
    border-radius:26px;
    box-shadow:0 18px 50px rgba(87,54,28,.13);
  }

  .quality-card{
    gap:12px;
    padding:17px;
    border-radius:22px;
    margin:18px 0;
    font-size:13px;
  }

  .quality-score{
    font-size:36px;
  }

  .before-img{
    max-height:420px;
    border-radius:20px;
    margin-bottom:20px;
  }

  .generated-grid{
    gap:16px;
  }

  .generated-card{
    padding:12px;
    border-radius:22px;
  }

  .result-img{
    max-height:520px;
    border-radius:18px;
  }

  .actions{
    gap:10px;
  }

  .actions a{
    width:100%;
    text-align:center;
    padding:13px 18px;
  }

  .mini-actions a{
    width:auto;
    min-width:130px;
  }

  .prompt-details{
    padding:14px;
    border-radius:18px;
  }
}

@media(max-width:380px){
  .app,
  .result-page{
    padding-left:10px;
    padding-right:10px;
  }

  .card,
  .result-card{
    padding:18px;
    border-radius:22px;
  }

  h1{
    font-size:29px;
  }

  .hero-title{
    font-size:28px;
    letter-spacing:-1px;
  }

  .upload-box{
    min-height:170px;
  }

  .quality-preview-score,
  .quality-score{
    font-size:31px;
  }
}
/* Reference-inspired mobile app UI override */
.reference-screen{
  min-height:100svh;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:14px;
  background:linear-gradient(180deg,#fbf4ec 0%,#f4e2d1 100%);
}

.reference-card{
  width:100%;
  max-width:430px;
  min-height:calc(100svh - 28px);
  background:rgba(255,250,244,.82);
  border:1px solid rgba(122,83,55,.10);
  border-radius:30px;
  padding:0 14px 16px;
  box-shadow:0 24px 70px rgba(87,54,28,.13);
  overflow:hidden;
}

.reference-topbar{
  height:66px;
  margin:0 -14px 18px;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:linear-gradient(135deg,#3a2115 0%,#5b301f 55%,#7a4a30 100%);
}

.topbar-logo-card{
  height:42px;
  max-width:180px;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,250,244,.94);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 22px rgba(0,0,0,.12);
}

.topbar-logo-card img{
  max-height:24px;
  width:auto;
  display:block;
}

.reference-topbar .credit-pill{
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,250,244,.94);
  color:#3b281d;
  font-size:12px;
  font-weight:950;
  white-space:nowrap;
  box-shadow:0 10px 22px rgba(0,0,0,.12);
}

.reference-hero{
  text-align:center;
  padding:0 10px;
  margin-bottom:16px;
}

.reference-hero h1{
  margin:0;
  font-size:34px;
  line-height:1;
  letter-spacing:-1.4px;
  color:#2f2118;
  font-weight:950;
}

.hero-tagline{
  margin:10px auto 0;
  max-width:300px;
  color:#7a6251;
  font-size:13px;
  line-height:1.55;
  font-weight:750;
}

.reference-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ref-panel{
  padding:12px;
  border-radius:22px;
  background:rgba(255,255,255,.58);
  border:1px solid rgba(122,83,55,.10);
  box-shadow:0 10px 22px rgba(87,54,28,.055);
}

.compact-panel{
  padding:10px;
}

.ref-upload-box{
  cursor:pointer;
  min-height:172px;
  border:1.7px dashed rgba(122,83,55,.28);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(255,247,238,.92));
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.ref-upload-box input{
  display:none;
}

.ref-preview-container{
  width:100%;
  min-height:172px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:11px;
}

#preview{
  display:none;
  width:100%;
  max-height:250px;
  object-fit:contain;
  border-radius:17px;
}

.ref-upload-text{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  color:#4a3425;
  text-align:center;
}

.ref-upload-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:17px;
  background:#efe0d1;
  font-size:24px;
}

.ref-upload-text strong{
  font-size:15px;
  font-weight:950;
}

.ref-upload-text small{
  color:#8f7a6d;
  font-size:12px;
  font-weight:700;
}

.ref-quality{
  margin-top:10px;
  padding:10px 11px;
  border-radius:17px;
  background:rgba(255,250,244,.78);
  border:1px solid rgba(122,83,55,.09);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.ref-quality-main{
  display:flex;
  align-items:flex-start;
  gap:9px;
}

.ref-quality-dot{
  width:9px;
  height:9px;
  flex:0 0 auto;
  margin-top:5px;
  border-radius:999px;
  background:#b9845b;
}

.ref-quality h3{
  margin:0 0 2px;
  color:#5a3925;
  font-size:12px;
  font-weight:950;
}

.ref-quality p{
  margin:0;
  color:#7a6251;
  font-size:11px;
  line-height:1.35;
}

.ref-quality-score{
  flex:0 0 auto;
  font-size:18px;
  line-height:1;
  color:#6b4228;
  font-weight:950;
}

.ref-quality.tier-excellent .ref-quality-dot,
.ref-quality.tier-good .ref-quality-dot{
  background:#4f7b42;
}

.ref-quality.tier-excellent .ref-quality-score,
.ref-quality.tier-good .ref-quality-score{
  color:#4f7b42;
}

.ref-quality.tier-fair .ref-quality-dot,
.ref-quality.checking .ref-quality-dot{
  background:#b7791f;
}

.ref-quality.tier-low .ref-quality-dot,
.ref-quality.error .ref-quality-dot{
  background:#b04444;
}

.ref-section-heading{
  margin-bottom:8px;
}

.ref-section-heading h2{
  margin:0;
  color:#5a3925;
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.ref-section-heading span{
  display:none;
}

.ref-choice-grid{
  display:grid;
  gap:7px;
}

.ref-choice-grid.four-col{
  grid-template-columns:repeat(4,1fr);
}

.ref-choice-grid.three-col{
  grid-template-columns:repeat(3,1fr);
}

.ref-choice-grid.two-col{
  grid-template-columns:1fr 1fr;
}

.ref-choice{
  position:relative;
  min-height:40px;
  border:1px solid rgba(122,83,55,.14);
  background:rgba(255,255,255,.68);
  border-radius:15px;
  color:#4a3425;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:8px 6px;
  cursor:pointer;
  transition:.18s ease;
}

.ref-choice input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.ref-choice span{
  font-size:11px;
  font-weight:900;
  line-height:1.15;
}

.ref-choice:has(input:checked){
  background:#3b281d;
  color:#fff8ef;
  border-color:#3b281d;
  box-shadow:0 9px 18px rgba(59,40,29,.14);
}

.ref-choice:hover{
  transform:translateY(-1px);
}

.ref-mode-choice{
  min-height:40px;
}

.ref-count-choice{
  min-height:40px;
}

.ref-generate-button{
  width:100%;
  min-height:54px;
  border-radius:999px;
  border:0;
  background:linear-gradient(135deg,#3b2116,#5c301f);
  color:#fff8ef;
  font-size:15px;
  font-weight:950;
  box-shadow:0 16px 34px rgba(59,40,29,.20);
  position:sticky;
  bottom:calc(10px + env(safe-area-inset-bottom));
  z-index:10;
}

.ref-generate-button:disabled{
  opacity:.48;
  filter:grayscale(.2);
  box-shadow:none;
}

/* Loading polish */
.loader-logo{
  width:88px;
  height:auto;
  margin:0 auto 18px;
  display:block;
}

.coffee-loader{
  border:1px solid rgba(122,83,55,.10);
  background:rgba(255,250,244,.92);
}

.coffee-loader .cup{
  display:none;
}

.coffee-loader h2{
  color:#2f2118;
}

/* Responsive */
@media(max-width:420px){
  .reference-screen{
    padding:10px;
  }

  .reference-card{
    min-height:calc(100svh - 20px);
    border-radius:28px;
    padding:0 12px 14px;
  }

  .reference-topbar{
    margin:0 -12px 16px;
    height:62px;
    padding:11px 14px;
  }

  .topbar-logo-card{
    height:38px;
    max-width:160px;
    padding:7px 12px;
  }

  .topbar-logo-card img{
    max-height:22px;
  }

  .reference-hero h1{
    font-size:30px;
  }

  .hero-tagline{
    font-size:12px;
  }

  .ref-upload-box,
  .ref-preview-container{
    min-height:155px;
  }

  .ref-choice-grid.four-col{
    grid-template-columns:repeat(4,1fr);
  }

  .ref-choice{
    min-height:38px;
    border-radius:14px;
    padding:7px 4px;
  }

  .ref-choice span{
    font-size:10.5px;
  }
}

@media(max-width:360px){
  .reference-hero h1{
    font-size:27px;
  }

  .ref-choice-grid.four-col{
    grid-template-columns:repeat(2,1fr);
  }

  .ref-choice-grid.three-col{
    grid-template-columns:1fr;
  }
}


.reference-card{
  background:rgba(255,250,244,.82);
}

.reference-topbar.clean-topbar{
  min-height:44px;
  height:auto;
  margin:0 0 14px;
  padding:0;
  background:transparent;
  display:flex;
  justify-content:center;
  align-items:center;
}

.hero-brand-logo{
  display:block;
  width:auto;
  max-height:28px;
  margin:0 auto 10px;
  object-fit:contain;
  opacity:.96;
}

.reference-topbar .credit-pill{
  justify-self:end;
  padding:9px 13px;
  border-radius:999px;
  background:rgba(255,250,244,.72);
  color:#3b281d;
  border:1px solid rgba(122,83,55,.18);
  box-shadow:none;
  font-size:12px;
  font-weight:900;
}

.reference-hero h1{
  font-size:34px;
  font-weight:950;
  letter-spacing:-1.4px;
}

.hero-tagline{
  margin-top:12px;
  color:#5f4a3b;
  font-size:15px;
  line-height:1.55;
  font-weight:650;
}

.ref-panel{
  background:rgba(255,250,244,.68);
}

.ref-section-heading h2{
  text-transform:none;
  letter-spacing:0;
  font-size:16px;
  color:#2f2118;
}

.ref-choice{
  border-radius:14px;
  min-height:44px;
  background:rgba(255,255,255,.54);
}

.ref-choice span{
  font-size:13px;
}

.ref-choice:has(input:checked){
  background:linear-gradient(135deg,#3b2116,#6a351f);
  color:#fff8ef;
}

.reference-hero h1{
  font-family: "Playfair Display", Georgia, serif;
  font-size:32px;
  font-weight:800;
  letter-spacing:-.8px;
  line-height:1.08;
}

.ref-choice{
  min-height:36px;
  padding:7px 6px;
  border-radius:13px;
}

.ref-choice span{
  font-size:11px;
  font-weight:850;
}

.ref-choice-grid{
  gap:6px;
}

.compact-panel{
  padding:9px 10px;
}

.ref-panel{
  border-radius:20px;
}

.ref-section-heading{
  margin-bottom:7px;
}

.ref-section-heading h2{
  font-size:14px;
  font-weight:850;
}

.ref-mode-choice{
  min-height:44px;
  justify-content:center;
  text-align:center;
}

.mode-note{
  margin:7px 2px 0;
  color:#8f7a6d;
  font-size:11px;
  line-height:1.35;
  font-weight:650;
  text-align:center;
}

.ref-generate-button{
  margin-top:2px;
}

.clean-loader{
  background:rgba(255,250,244,.94);
  border-radius:30px;
  padding:38px 28px;
  width:min(86%,340px);
  box-shadow:0 24px 70px rgba(87,54,28,.16);
}

.floating-cup{
  width:92px;
  height:auto;
  display:block;
  margin:0 auto 20px;
  animation:floatingCup 2s ease-in-out infinite;
}

.clean-loader h2{
  margin:0;
  font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color:#6b4a35;
  font-size:13px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.loading-dots{
  display:flex;
  justify-content:center;
  gap:7px;
  margin-top:16px;
}

.loading-dots span{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#6b4228;
  animation:dotPulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2){animation-delay:.18s;}
.loading-dots span:nth-child(3){animation-delay:.36s;}

@keyframes floatingCup{
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(-10px);}
}

@keyframes dotPulse{
  0%,100%{opacity:.25; transform:scale(.85);}
  50%{opacity:1; transform:scale(1.15);}
}
/* MissCapuchino processing animation refresh */
.coffee-loader::before{
  animation:cappuccinoFloat 2.2s ease-in-out infinite, cappuccinoGlow 1.8s ease-in-out infinite alternate;
  transform-origin:center;
}

.coffee-loader .cup{
  position:relative;
  overflow:visible;
  animation:cappuccinoSip 2.6s ease-in-out infinite;
}

.coffee-loader .cup::after{
  content:'';
  position:absolute;
  inset:9px;
  border-radius:999px;
  background:conic-gradient(from 20deg, rgba(255,255,255,.0), rgba(255,248,239,.95), rgba(138,87,54,.10), rgba(255,255,255,.0));
  mix-blend-mode:screen;
  animation:foamSwirl 1.7s linear infinite;
  pointer-events:none;
}

.coffee-loader h2::after{
  content:none;
}

.clean-loader h2.message-swap{
  animation:loadingMessageFade .45s ease;
}

@keyframes loadingMessageFade{
  from{ opacity:.35; transform:translateY(4px); }
  to{ opacity:1; transform:translateY(0); }
}

@keyframes cappuccinoFloat{
  0%,100%{ transform:translateY(0) scale(1); }
  50%{ transform:translateY(-7px) scale(1.025); }
}

@keyframes cappuccinoGlow{
  from{ box-shadow:0 16px 36px rgba(59,40,29,.22); }
  to{ box-shadow:0 20px 48px rgba(122,75,46,.34); }
}

@keyframes cappuccinoSip{
  0%,100%{ transform:rotate(-1deg); }
  50%{ transform:rotate(2deg) translateY(-2px); }
}

@keyframes foamSwirl{
  to{ transform:rotate(360deg); }
}

@keyframes processingDots{
  0%{ content:''; }
  25%{ content:'.'; }
  50%{ content:'..'; }
  75%,100%{ content:'...'; }
}

/* Polished clean result page */
.polished-result-page{
  padding-top:24px;
}

.polished-result-hero{
  margin:4px 0 14px;
  text-align:center;
}

.polished-result-hero .eyebrow{
  margin-bottom:7px;
}

.polished-result-hero h1{
  margin-bottom:5px;
}

.polished-result-grid{
  gap:16px;
}

.polished-result-card{
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
}

.result-photo-wrap{
  position:relative;
  padding:10px;
  border-radius:30px;
  background:linear-gradient(180deg,rgba(255,255,255,.82),rgba(255,248,239,.62));
  border:1px solid rgba(122,83,55,.12);
  box-shadow:0 16px 36px rgba(87,54,28,.10);
}

.polished-result-card .result-photo{
  border-radius:24px;
  max-height:510px;
  box-shadow:0 10px 24px rgba(42,28,19,.08);
}

.before-floating-toggle{
  position:absolute;
  top:18px;
  right:18px;
  z-index:3;
}

.before-floating-toggle summary{
  list-style:none;
  cursor:pointer;
  min-height:32px;
  padding:0 12px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(59,40,29,.84);
  color:#fff8ef;
  font-size:11px;
  font-weight:950;
  letter-spacing:.04em;
  backdrop-filter:blur(10px);
  box-shadow:0 10px 22px rgba(42,28,19,.18);
}

.before-floating-toggle summary::-webkit-details-marker{
  display:none;
}

.before-popover{
  position:absolute;
  top:42px;
  right:0;
  width:min(190px,58vw);
  padding:7px;
  border-radius:18px;
  background:#fff8ef;
  border:1px solid rgba(122,83,55,.14);
  box-shadow:0 18px 38px rgba(42,28,19,.22);
}

.before-popover .before-compact{
  margin:0;
  max-height:220px;
  border-radius:13px;
}

.compact-result-actions{
  grid-template-columns:.72fr 1.28fr;
  gap:9px;
  margin:12px 4px 0;
}

.compact-share-button{
  min-height:40px;
  font-size:12px;
  background:rgba(239,224,209,.86);
  color:#57341f;
  border:1px solid rgba(122,83,55,.10);
}

.stylish-download-button{
  min-height:44px;
  background:linear-gradient(135deg,#2f2118 0%,#6f4228 100%);
  color:#fff8ef;
  letter-spacing:.02em;
  box-shadow:0 13px 26px rgba(59,40,29,.18);
}

.stylish-download-button::before{
  content:'↓';
  margin-right:7px;
  width:22px;
  height:22px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,248,239,.18);
  box-shadow:inset 0 0 0 1px rgba(255,248,239,.14);
}

.single-next-row{
  grid-template-columns:1fr;
  margin-top:16px;
}

.next-photo-button{
  min-height:52px;
  background:linear-gradient(135deg,#3b281d,#8b5736);
  box-shadow:0 18px 34px rgba(87,54,28,.22);
  letter-spacing:.02em;
}

@media(max-width:420px){
  .polished-result-page{
    padding-top:20px;
  }

  .result-photo-wrap{
    padding:8px;
    border-radius:26px;
  }

  .polished-result-card .result-photo{
    border-radius:21px;
    max-height:480px;
  }

  .compact-result-actions{
    margin-left:2px;
    margin-right:2px;
  }
}

/* Minor result button refinement requested by MissKa */
.compact-result-actions{
  grid-template-columns:.64fr 1.36fr;
  gap:10px;
  margin:13px 2px 0;
}

.compact-share-button{
  min-height:38px;
  border-radius:999px;
  background:rgba(255,248,239,.78);
  color:#75513a;
  border:1px solid rgba(122,83,55,.14);
  box-shadow:0 8px 18px rgba(87,54,28,.07);
}

.stylish-download-button{
  min-height:48px;
  border-radius:999px;
  background:linear-gradient(135deg,#2d1f17 0%,#6d3f25 58%,#9a6241 100%);
  color:#fff8ef;
  font-weight:950;
  letter-spacing:.015em;
  border:1px solid rgba(255,248,239,.16);
  box-shadow:0 16px 30px rgba(87,54,28,.22), inset 0 1px 0 rgba(255,248,239,.18);
}

.next-photo-button{
  min-height:54px;
  border-radius:999px;
  background:linear-gradient(135deg,#f6d8bf 0%,#9b6040 38%,#3b281d 100%);
  color:#fff8ef;
  font-weight:950;
  letter-spacing:.02em;
  box-shadow:0 18px 34px rgba(87,54,28,.24), inset 0 1px 0 rgba(255,248,239,.24);
  border:1px solid rgba(255,248,239,.18);
}

.next-photo-button::after{
  content:'→';
  margin-left:9px;
  width:24px;
  height:24px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,248,239,.16);
}

.before-floating-toggle summary{
  padding:0 13px;
  min-height:34px;
  font-size:10.5px;
  letter-spacing:.03em;
}

@media(max-width:420px){
  .compact-result-actions{
    grid-template-columns:.62fr 1.38fr;
  }

  .stylish-download-button,
  .next-photo-button{
    font-size:13px;
  }
}

/* Result page refresh — before first, result second */
.refined-result-hero{
  margin:6px 0 18px;
  text-align:center;
}

.refined-result-hero h1{
  margin:0 0 10px;
  font-size:clamp(30px, 7vw, 46px);
  line-height:1.02;
  letter-spacing:-1.4px;
  text-transform:none;
  color:#2f2118;
}

.refined-result-hero p{
  margin:0;
  color:#7b604e;
  font-size:13px;
  line-height:1.5;
  font-weight:750;
}

.result-before-section,
.result-after-card{
  width:100%;
}

.result-section-label{
  margin:0 0 9px 4px;
  color:#9b704c;
  font-size:11px;
  font-weight:950;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.result-before-wrap,
.result-after-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
}

.result-before-wrap{
  margin-bottom:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(255,248,239,.58));
}

.before-preview-photo,
.polished-result-card .result-photo{
  width:100%;
  object-fit:contain;
}

.before-preview-photo{
  max-height:430px;
  border-radius:24px;
  box-shadow:0 10px 24px rgba(42,28,19,.07);
}

.refined-result-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:22px;
}

.comfortable-result-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:14px 2px 0;
}

.compact-share-button,
.stylish-download-button,
.next-photo-button,
.back-home-button{
  min-height:50px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  text-decoration:none;
  font-size:14px;
  font-weight:950;
  letter-spacing:.01em;
  cursor:pointer;
  border:1px solid rgba(122,83,55,.14);
}

.compact-share-button{
  background:rgba(255,248,239,.88);
  color:#57341f;
  box-shadow:0 10px 22px rgba(87,54,28,.08);
}

.stylish-download-button{
  background:linear-gradient(135deg,#2f2118,#7a472b);
  color:#fff8ef;
  box-shadow:0 14px 28px rgba(87,54,28,.20);
}

.stylish-download-button::before,
.next-photo-button::after{
  content:none;
  display:none;
}

.result-bottom-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:22px;
}

.next-photo-button{
  background:linear-gradient(135deg,#3b281d,#8b5736);
  color:#fff8ef;
  box-shadow:0 16px 30px rgba(87,54,28,.22);
}

.back-home-button{
  background:rgba(255,248,239,.86);
  color:#57341f;
  box-shadow:0 10px 22px rgba(87,54,28,.08);
}

@media(max-width:420px){
  .refined-result-hero{
    margin-top:2px;
  }

  .result-photo-wrap{
    padding:8px;
  }

  .before-preview-photo,
  .polished-result-card .result-photo{
    max-height:470px;
  }

  .comfortable-result-actions,
  .result-bottom-actions{
    gap:10px;
  }

  .compact-share-button,
  .stylish-download-button,
  .next-photo-button,
  .back-home-button{
    min-height:48px;
    border-radius:16px;
    font-size:13px;
  }
}

/* Model Editorial style option — 5 active pose styles */
.pose-style-grid{
  grid-template-columns:repeat(5,1fr);
}

@media(max-width:480px){
  .pose-style-grid{
    grid-template-columns:repeat(3,1fr);
  }
}


/* TASK 1 — Account Foundation minimal auth UI */
.auth-screen{
  min-height:100svh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:linear-gradient(180deg,#fbf4ec 0%,#f4e2d1 100%);
}

.auth-card{
  width:100%;
  max-width:420px;
  padding:26px 20px 22px;
  border-radius:30px;
  background:rgba(255,250,244,.88);
  border:1px solid rgba(122,83,55,.12);
  box-shadow:0 24px 70px rgba(87,54,28,.14);
  text-align:center;
}

.auth-logo{
  max-height:38px;
  width:auto;
  margin-bottom:16px;
}

.auth-kicker{
  margin:0 0 8px;
  color:#9b704c;
  font-size:11px;
  font-weight:950;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.auth-card h1{
  margin:0;
  font-size:32px;
  line-height:1;
  letter-spacing:-1px;
  color:#2f2118;
}

.auth-subtitle{
  margin:12px auto 18px;
  color:#7a6251;
  font-size:14px;
  line-height:1.55;
}

.auth-error{
  margin:0 0 14px;
  padding:11px 12px;
  border-radius:16px;
  background:#fff0ed;
  color:#8f3024;
  border:1px solid rgba(143,48,36,.16);
  font-size:13px;
  font-weight:800;
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  text-align:left;
}

.auth-form label{
  display:flex;
  flex-direction:column;
  gap:7px;
  color:#5d4635;
  font-size:12px;
  font-weight:900;
}

.auth-form input{
  width:100%;
  border:1px solid rgba(122,83,55,.18);
  border-radius:16px;
  padding:13px 14px;
  background:rgba(255,255,255,.78);
  color:#2f2118;
  font-size:14px;
  outline:none;
}

.auth-form input:focus{
  border-color:rgba(91,48,31,.48);
  box-shadow:0 0 0 4px rgba(91,48,31,.08);
}

.auth-helper-note{
  margin-top:-1px;
  color:#9a7b65;
  font-size:11.5px;
  font-weight:700;
  line-height:1.45;
}

.auth-form button{
  margin-top:4px;
  width:100%;
  border:0;
  border-radius:18px;
  padding:14px 16px;
  background:#3b281d;
  color:#fff8ef;
  font-size:14px;
  font-weight:950;
  cursor:pointer;
  box-shadow:0 16px 28px rgba(59,40,29,.16);
}

.auth-switch{
  margin:18px 0 0;
  color:#7a6251;
  font-size:13px;
  font-weight:750;
}

.auth-switch a{
  color:#3b281d;
  font-weight:950;
  text-decoration:none;
}

.topbar-account{
  flex:0 1 auto;
  max-width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:8px 11px;
  border-radius:999px;
  background:rgba(255,250,244,.94);
  color:#3b281d;
  font-size:11px;
  font-weight:950;
  white-space:normal;
  flex-wrap:wrap;
  line-height:1.25;
  text-align:center;
  box-shadow:0 10px 22px rgba(0,0,0,.10);
  border:1px solid rgba(122,83,55,.10);
}

.topbar-account span{
  white-space:nowrap;
}

.topbar-account a{
  color:#7a4a30;
  text-decoration:none;
  font-size:11px;
  font-weight:950;
  white-space:nowrap;
}

.topbar-account a::before{
  content:"|";
  color:rgba(122,83,55,.32);
  margin-right:7px;
  font-weight:800;
}


/* TASK 3 — Activation Code / Redeem minimal UI */
.redeem-card{
  max-width:430px;
}

.redeem-balance-card{
  margin:0 0 16px;
  padding:13px 14px;
  border-radius:18px;
  background:rgba(59,40,29,.08);
  border:1px solid rgba(59,40,29,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:#3b281d;
}

.redeem-balance-card span,
.redeem-balance-card small{
  color:#7a6251;
  font-size:12px;
  font-weight:850;
}

.redeem-balance-card strong{
  font-size:13px;
  font-weight:950;
}

.auth-success{
  margin:0 0 14px;
  padding:11px 12px;
  border-radius:16px;
  background:#edf8ef;
  color:#2f6f3f;
  border:1px solid rgba(47,111,63,.16);
  font-size:13px;
  font-weight:850;
}

/* TASK 6 - Admin activation code management */
.admin-screen{
  min-height:100svh;
  padding:24px;
  display:flex;
  justify-content:center;
}

.admin-card{
  width:100%;
  max-width:1120px;
  background:rgba(255,250,244,.86);
  border:1px solid rgba(255,255,255,.82);
  border-radius:34px;
  padding:26px;
  box-shadow:0 28px 80px rgba(87,54,28,.15);
  backdrop-filter:blur(18px);
}

.admin-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:20px;
}

.admin-topbar h1{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:38px;
  letter-spacing:-1.3px;
}

.admin-topbar p:not(.auth-kicker){
  max-width:680px;
  margin:10px 0 0;
  color:#745b49;
  line-height:1.55;
}

.admin-top-actions{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.admin-top-actions a,
.admin-export-button,
.admin-filter-tabs a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
  text-decoration:none;
  color:#57341f;
  background:rgba(255,248,239,.9);
  border:1px solid rgba(122,83,55,.13);
  font-size:12px;
  font-weight:950;
}

.admin-stats-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin:18px 0;
}

.admin-stats-grid div,
.admin-panel{
  background:rgba(255,255,255,.66);
  border:1px solid rgba(122,83,55,.11);
  border-radius:24px;
  box-shadow:0 12px 28px rgba(87,54,28,.07);
}

.admin-stats-grid div{
  padding:16px;
}

.admin-stats-grid span{
  display:block;
  color:#8b6b55;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.admin-stats-grid strong{
  display:block;
  margin-top:8px;
  color:#2f2118;
  font-size:28px;
  font-weight:950;
}

.admin-panel{
  padding:18px;
  margin-top:14px;
}

.admin-panel-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}

.admin-panel-heading h2{
  margin:0;
  font-size:18px;
  color:#322219;
}

.admin-panel-heading p{
  margin:6px 0 0;
  color:#806754;
  font-size:13px;
  line-height:1.55;
}

.admin-generate-form{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:12px;
  align-items:end;
}

.admin-generate-form input,
.admin-generate-form select{
  width:100%;
  margin-top:8px;
  min-height:48px;
  padding:0 14px;
  border-radius:16px;
  border:1px solid rgba(122,83,55,.18);
  background:#fffaf4;
  color:#35251b;
  font-weight:850;
}

.admin-generate-form button{
  min-height:48px;
  padding:0 18px;
  white-space:nowrap;
}

.generated-code-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:8px;
  max-height:220px;
  overflow:auto;
}

.generated-code-list code,
.admin-code-table code{
  font-family:Consolas, 'Courier New', monospace;
  color:#3b281d;
  font-weight:900;
}

.generated-code-list code{
  display:block;
  padding:10px 12px;
  border-radius:14px;
  background:#fff7ed;
  border:1px solid rgba(122,83,55,.12);
}

.admin-list-heading{
  align-items:center;
}

.admin-export-button{
  background:linear-gradient(135deg,#3b281d,#8b5736);
  color:#fff8ef;
}

.admin-filter-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.admin-filter-tabs a.active{
  background:#3b281d;
  color:#fff8ef;
}

.admin-table-wrap{
  width:100%;
  overflow:auto;
  border-radius:18px;
  border:1px solid rgba(122,83,55,.1);
}

.admin-code-table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
  background:rgba(255,250,244,.65);
}

.admin-code-table th,
.admin-code-table td{
  padding:12px 14px;
  text-align:left;
  border-bottom:1px solid rgba(122,83,55,.09);
  font-size:13px;
}

.admin-code-table th{
  color:#7a5842;
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  background:rgba(239,224,209,.46);
}

.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:74px;
  padding:6px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:950;
  text-transform:uppercase;
}

.status-unused{
  background:#ecf8ee;
  color:#226b37;
}

.status-used{
  background:#f1e6dc;
  color:#765039;
}

.status-disabled{
  background:#fbe5e2;
  color:#9a3228;
}

.empty-table{
  text-align:center!important;
  color:#8a705d;
  padding:28px!important;
}

@media (max-width:780px){
  .admin-screen{
    padding:10px;
  }

  .admin-card{
    padding:18px;
    border-radius:28px;
  }

  .admin-topbar,
  .admin-panel-heading,
  .admin-list-heading{
    flex-direction:column;
  }

  .admin-topbar h1{
    font-size:30px;
  }

  .admin-stats-grid{
    grid-template-columns:1fr 1fr;
  }

  .admin-generate-form{
    grid-template-columns:1fr;
  }
}

/* TASK 7 - Temporary generate history */
.history-screen{
  align-items:flex-start;
}

.history-card{
  max-width:760px;
}

.history-hero{
  margin-bottom:18px;
}

.history-expiry-note{
  max-width:560px;
  margin:10px auto 0;
  padding:10px 12px;
  border-radius:18px;
  background:rgba(255,248,239,.88);
  border:1px solid rgba(122,83,55,.12);
  color:#7a5a44;
  font-size:12px;
  font-weight:850;
  line-height:1.5;
}

.history-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.history-item-card{
  display:grid;
  grid-template-columns:132px 1fr auto;
  gap:14px;
  align-items:center;
  padding:12px;
  border-radius:24px;
  background:rgba(255,255,255,.68);
  border:1px solid rgba(122,83,55,.11);
  box-shadow:0 12px 28px rgba(87,54,28,.07);
}

.history-image-wrap{
  width:132px;
  aspect-ratio:1/1;
  border-radius:18px;
  overflow:hidden;
  background:#f1e2d3;
}

.history-image-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.history-item-copy{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}

.history-item-copy strong{
  color:#2f2118;
  font-size:15px;
  font-weight:950;
}

.history-item-copy span,
.history-item-copy small{
  color:#7b6250;
  font-size:12px;
  line-height:1.45;
}

.history-actions a,
.history-empty-state a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 16px;
  border-radius:999px;
  background:linear-gradient(135deg,#3b281d,#8b5736);
  color:#fff8ef;
  text-decoration:none;
  font-size:12px;
  font-weight:950;
  white-space:nowrap;
}

.history-empty-state{
  padding:30px 18px;
  border-radius:24px;
  text-align:center;
  background:rgba(255,255,255,.66);
  border:1px solid rgba(122,83,55,.11);
}

.history-empty-state h2{
  margin:0;
  color:#2f2118;
  font-size:20px;
}

.history-empty-state p{
  margin:10px auto 18px;
  max-width:360px;
  color:#7b6250;
  line-height:1.6;
}

@media (max-width:640px){
  .history-item-card{
    grid-template-columns:96px 1fr;
  }

  .history-image-wrap{
    width:96px;
  }

  .history-actions{
    grid-column:1 / -1;
  }

  .history-actions a{
    width:100%;
  }
}

/* TASK 8 - PWA install note */
.pwa-install-note{
  max-width:420px;
  margin:10px auto 0;
  padding:9px 12px;
  border-radius:16px;
  background:rgba(255,248,239,.76);
  border:1px solid rgba(122,83,55,.1);
  color:#7a5a44;
  font-size:12px;
  font-weight:850;
  line-height:1.5;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

.pwa-install-note[hidden],
.pwa-install-note.is-hidden{
  display:none !important;
}

.pwa-install-note button{
  appearance:none;
  border:0;
  border-radius:999px;
  background:#4a2c1b;
  color:#fff8ef;
  min-height:34px;
  padding:0 14px;
  font-size:12px;
  font-weight:950;
  letter-spacing:.01em;
  box-shadow:0 10px 22px rgba(74,44,27,.16);
}

.pwa-install-note button:disabled{
  opacity:.58;
}

/* History back action */
.history-back-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  margin:10px auto 0;
  padding:0 14px;
  border-radius:999px;
  background:rgba(255,248,239,.82);
  border:1px solid rgba(122,83,55,.12);
  color:#7a4a30;
  text-decoration:none;
  font-size:12px;
  font-weight:950;
  box-shadow:0 8px 18px rgba(87,54,28,.08);
}

/* Pending credit claim welcome */
.pending-credit-welcome{
  display:flex;
  flex-direction:column;
  gap:5px;
  max-width:420px;
  margin:12px auto 0;
  padding:14px 16px;
  border-radius:22px;
  background:linear-gradient(135deg, rgba(255,248,239,.96), rgba(246,218,178,.82));
  border:1px solid rgba(122,83,55,.14);
  box-shadow:0 14px 30px rgba(87,54,28,.11);
  color:#3b281d;
  font-size:13px;
  line-height:1.45;
}
.pending-credit-welcome strong,
.pending-credit-welcome b{
  font-weight:950;
}
.pending-credit-welcome span{
  color:#6d5a4d;
}
