:root {
  --bg: #fff7e7;
  --paper: #fffdf4;
  --paper-2: #fff8e8;
  --ink: #151512;
  --muted: #5f625f;
  --line: #171715;
  --soft-line: #d8bd92;
  --red: #d9271f;
  --red-dark: #b71917;
  --orange: #f06d17;
  --gold: #f7b51f;
  --shadow: #ccb38d;
  --radius: 20px;
  --hard-shadow: 6px 8px 0 rgba(138, 94, 44, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #efe4d0; font-family: var(--font); color: var(--ink); }
body { display: flex; justify-content: center; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
.phone-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.7), transparent 28%),
    linear-gradient(90deg, rgba(246,154,62,.045) 1px, transparent 1px),
    linear-gradient(rgba(246,154,62,.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 8px 8px, 8px 8px, auto;
  position: relative;
  overflow-x: hidden;
  padding: 0 18px 28px;
}
.phone-shell::before,
.phone-shell::after {
  content: "";
  position: fixed;
  width: 62px; height: 62px;
  pointer-events: none;
  background:
    linear-gradient(var(--orange), var(--orange)) 0 0/8px 8px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 8px 0/8px 8px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 16px 0/8px 8px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 0 8px/8px 8px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 0 16px/8px 8px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 0 24px/8px 8px no-repeat;
  opacity: .55;
}
.phone-shell::before { left: calc(50% - min(50vw,215px) + 14px); top: 48px; }
.phone-shell::after { right: calc(50% - min(50vw,215px) + 10px); bottom: 18px; transform: rotate(180deg); }
.site-compliance-footer {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 10px 8px max(10px, env(safe-area-inset-bottom));
  color: rgba(21, 18, 15, .58);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
}
.site-compliance-footer a {
  color: inherit;
  text-decoration: none;
}
.site-compliance-footer a:active {
  color: var(--red);
}
.statusbar { height: 50px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 12px 6px; font-weight: 800; font-size: 16px; }
.status-icons { display: flex; gap: 7px; align-items: center; font-size: 12px; }
.status-signal { display: grid; grid-auto-flow: column; gap: 2px; align-items: end; height: 14px; }
.status-signal i { width: 4px; background: var(--ink); border-radius: 2px; display: block; }
.status-signal i:nth-child(1){height:5px}.status-signal i:nth-child(2){height:8px}.status-signal i:nth-child(3){height:11px}.status-signal i:nth-child(4){height:14px}
.wifi { width: 19px; height: 14px; position: relative; }
.wifi::before { content:""; position:absolute; inset:0; border: 4px solid var(--ink); border-left-color:transparent; border-right-color:transparent; border-bottom-color:transparent; border-radius:50%; }
.battery { background: var(--ink); color: #fff; padding: 1px 4px; border-radius: 4px; font-weight: 900; line-height: 1.2; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 38px; }
.back, .admin-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; font-weight: 700; }
.back .arrow, .big-arrow { font-size: 34px; line-height: 1; font-weight: 700; transform: translateY(-1px); }
.admin-link img { width: 20px; height: 20px; image-rendering: pixelated; }
.hero { text-align: center; padding: 22px 8px 16px; position: relative; }
.hero.compact { padding-top: 16px; }
.hero h1 { margin: 0; font-size: clamp(42px, 13vw, 62px); letter-spacing: 1px; line-height: 1.05; font-weight: 1000; text-shadow: 0 3px 0 rgba(0,0,0,.05); }
.hero h1 .red { color: var(--red); }
.hero h2 { margin: 5px 0 0; font-size: 40px; line-height: 1.1; font-weight: 1000; }
.hero p { margin: 10px 0 0; font-size: 17px; letter-spacing: 2px; color: #242524; }
.hero .sub { font-size: 15px; letter-spacing: .5px; color: #222; }
.pixel-divider { margin: 8px auto 0; height: 14px; width: 210px; opacity: .5; background: repeating-linear-gradient(90deg, transparent 0 18px, var(--orange) 18px 24px, transparent 24px 36px); }
.card {
  background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(255,247,229,.9));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--hard-shadow);
  position: relative;
}
.card.soft { border-color: var(--soft-line); box-shadow: 4px 5px 0 rgba(164,124,72,.18); }
.section { margin: 16px 0 20px; padding: 14px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 0 9px 9px 0; background: var(--red); color: #fff; font-weight: 900; border: 2px solid var(--line); box-shadow: 3px 3px 0 rgba(0,0,0,.12); }
.tag img { width: 26px; height: 26px; image-rendering: pixelated; }
.corner-ribbon { position: absolute; right: -2px; top: -2px; width: 54px; height: 54px; overflow: hidden; border-top-right-radius: var(--radius); }
.corner-ribbon::after { content:"★"; position: absolute; right: -22px; top: -22px; width: 76px; height: 76px; background: var(--red); color:#fff; display:flex; align-items:flex-end; justify-content:center; padding-bottom:12px; transform: rotate(45deg); font-size: 18px; font-weight: 900; }
.icon { width: 58px; height: 58px; image-rendering: pixelated; flex: 0 0 auto; }
.icon.lg { width: 90px; height: 90px; }
.icon.xl { width: 120px; height: 120px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.red-text { color: var(--red); }
.primary-btn,
.outline-btn,
.dark-btn { width: 100%; height: 62px; border-radius: 12px; display:flex; align-items:center; justify-content:center; gap:14px; font-size: 25px; font-weight: 1000; letter-spacing: 2px; border: 2px solid var(--line); box-shadow: 5px 6px 0 rgba(84,45,28,.28); }
.primary-btn { color:#fff; background: linear-gradient(#ff5142, #d9231d); }
.dark-btn { color:#fff; background: linear-gradient(#27231f, #080807); }
.outline-btn { color: var(--ink); background: rgba(255,255,255,.64); }
.primary-btn img, .dark-btn img, .outline-btn img { width: 42px; height: 42px; image-rendering: pixelated; }
.progress { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; height: 18px; }
.progress span { border: 1px solid rgba(0,0,0,.42); background: rgba(255,255,255,.36); }
.progress span.on { background: linear-gradient(90deg, var(--orange), var(--gold)); }
/* Home */
.home .hero { padding-top: 24px; }
.home h1 { font-size: clamp(49px, 14vw, 69px); }
.home .headline { margin-top: 4px; font-size: 22px; letter-spacing: 8px; font-weight: 500; }
.home .hello { margin-top: 11px; font-size: 15px; letter-spacing: .7px; }
.ranking { padding: 12px 10px 11px; }
.ranking-title { justify-content: center; gap: 10px; font-size: 24px; font-weight: 1000; margin: 4px 0 10px; }
.ranking-title img { width: 34px; height: 34px; image-rendering: pixelated; }
.rank-table { padding: 6px 10px; border: 1px solid var(--soft-line); border-radius: 12px; background: rgba(255,255,255,.45); }
.rank-line { display: grid; grid-template-columns: 52px 72px 48px 1fr 56px 38px; align-items: center; gap: 6px; min-height: 47px; border-bottom: 1px solid rgba(211,173,117,.55); font-weight: 900; }
.rank-line:last-child { border-bottom: none; }
.rank-line .rank { font-size: 25px; text-align:center; }
.rank-line .team { font-size: 21px; }
.rank-line .rocket-sm { width: 40px; height: 40px; image-rendering: pixelated; }
.rank-line .pct { font-size: 21px; text-align:right; }
.rank-line .pct.hot { color: var(--red); }
.rank-line .pct.warm { color: var(--orange); }
.mini-progress { display: grid; grid-template-columns: repeat(14, 1fr); gap: 1px; height: 13px; }
.mini-progress i { border: 1px solid rgba(0,0,0,.28); background: rgba(255,255,255,.45); }
.mini-progress i.on { background: linear-gradient(90deg,var(--red),var(--orange)); }
.notice-line { text-align:center; color:#4d4031; margin-top: 10px; font-size: 15px; }
.app-card { display: grid; grid-template-columns: 92px 1fr 82px; gap: 12px; align-items: center; min-height: 102px; margin: 15px 2px; padding: 12px 13px; }
.app-card h3 { margin: 0 0 7px; font-size: 25px; line-height: 1.2; }
.app-card p { margin: 0; font-size: 15px; color: #55514b; }
.enter-btn { background: #15130f; color:#fff; border-radius: 9px; height: 48px; display:flex; justify-content:center; align-items:center; gap:8px; font-weight: 1000; font-size:18px; border:2px solid var(--line); }
.enter-btn.disabled { background: var(--red); }
.footnote { display:flex; align-items:center; justify-content:center; gap:10px; color:#5a4a31; font-size:14px; margin: 14px 0 0; }
.footnote img { width:28px; height:28px; image-rendering:pixelated; }
/* Admin */
.stats { padding: 16px 12px; display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { text-align:center; padding: 12px 5px 16px; border:1.5px solid var(--soft-line); border-radius:14px; background: rgba(255,255,255,.52); box-shadow:3px 4px 0 rgba(194,155,101,.16); }
.stat-card h3 { margin:0 0 8px; font-size:18px; }
.stat-card img { width:64px; height:64px; image-rendering:pixelated; }
.stat-card strong { display:block; font-size:41px; line-height:1; margin-top:6px; }
.menu-card { min-height: 108px; margin: 14px 0; padding: 14px 18px; display:grid; grid-template-columns: 92px 1fr 28px; align-items:center; gap:14px; }
.menu-card h3 { margin:0 0 8px; font-size:26px; }
.menu-card p { margin:0; font-size:15px; color:#595652; }
.logout-btn { margin-top: 28px; height: 62px; color: var(--red); background: rgba(255,255,255,.45); border-color: var(--red); }
/* Upload */
.form-card { padding: 12px 10px 14px; }
.form-list { margin-top: 10px; display:grid; gap:10px; }
.field { height: 64px; display:grid; grid-template-columns: 46px minmax(96px, 1fr) 155px 16px; gap: 8px; align-items:center; padding: 0 12px; border:1px solid var(--soft-line); border-radius: 10px; background: rgba(255,255,255,.56); }
.field img { width:38px; height:38px; image-rendering:pixelated; }
.field b { font-size:21px; }
.field .value { text-align:right; color:#686863; font-size:16px; }
.field .req { color: var(--red); margin-left:5px; }
.photo-card { padding: 18px 8px 14px; text-align:center; }
.photo-card .camera-wrap { display:flex; justify-content:center; margin-top:3px; }
.photo-card h2 { margin: 3px 0 4px; font-size: 30px; }
.photo-card .upload-sub { margin:0 0 20px; color:#56524e; }
.upload-count { height: 43px; display:flex; align-items:center; gap:9px; padding:0 14px; border:1px solid var(--soft-line); border-radius: 8px; background:rgba(255,255,255,.52); text-align:left; font-size:17px; font-weight:800; }
.upload-count img { width:27px; height:27px; image-rendering:pixelated; }
.thumbs { display:grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 14px 4px 16px; }
.thumb { position:relative; height: 82px; border:2px solid var(--line); border-radius: 8px; box-shadow: 3px 4px 0 rgba(120,85,45,.2); overflow:hidden; background: #ddd; }
.thumb::before { content:""; position:absolute; inset:0; background: var(--thumb-bg); background-size: cover; background-position:center; }
.thumb .x { position:absolute; right:-5px; top:-6px; width:24px; height:24px; border:2px solid var(--line); border-radius:50%; background:var(--red); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:900; }
.tip { display:grid; grid-template-columns: 52px 1fr; gap:10px; text-align:left; align-items:center; padding:11px 14px; border:1px solid var(--soft-line); border-radius:9px; background: rgba(255,255,255,.6); }
.tip img { width:44px; height:44px; image-rendering:pixelated; }
.tip b { color:#e35e16; display:block; margin-bottom:5px; }
.tip p { margin:0; font-size:14px; color:#2c2b29; }
/* Success */
.success-illus { display:flex; justify-content:center; align-items:end; gap:12px; margin: 24px 0 6px; }
.success-illus img { image-rendering:pixelated; }
.success-illus img:nth-child(1){width:82px}.success-illus img:nth-child(2){width:120px}.success-illus img:nth-child(3){width:82px}
.success .hero h1 { font-size: 62px; }
.info-card { padding: 18px 18px; }
.info-row { min-height: 61px; display:grid; grid-template-columns: 48px 1fr 120px; align-items:center; border-bottom:1px dashed rgba(148,120,83,.45); font-size:23px; font-weight:900; }
.info-row:last-child{ border-bottom:none; }
.info-row img { width:34px; height:34px; image-rendering:pixelated; }
.info-row .val { text-align:right; }
.progress-card { padding: 22px 18px; display:grid; grid-template-columns: 1fr 64px; gap: 10px; align-items:center; }
.progress-card h3 { margin:0 0 14px; font-size:24px; }
.progress-card strong { color:var(--orange); font-size:34px; }
.success-actions { display:grid; gap:14px; margin-top: 22px; }
/* Library */
.library .hero h1 { font-size: 54px; letter-spacing: 1px; }
.searchbar { height: 62px; display:grid; grid-template-columns: 48px 1fr 28px; align-items:center; gap: 8px; padding:0 14px; margin: 8px 0 17px; }
.searchbar img { width: 39px; height:39px; image-rendering:pixelated; }
.searchbar span { color:#8b8a86; font-size:20px; }
.category-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 18px; }
.cat-card { min-height: 86px; display:grid; grid-template-columns: 76px 1fr 16px; align-items:center; gap: 8px; padding:10px; border:1.5px solid var(--soft-line); border-radius:14px; background:rgba(255,255,255,.48); box-shadow:4px 5px 0 rgba(157,118,70,.16); }
.cat-card img { width:70px; height:70px; image-rendering:pixelated; }
.cat-card b { font-size: 19px; }
.recent { padding: 14px 10px; }
.recent h2 { display:flex; align-items:center; justify-content:center; gap:12px; margin:0 0 12px; font-size:25px; }
.recent h2 img { width: 38px; height:38px; image-rendering:pixelated; }
.file-row { display:grid; grid-template-columns: 46px 1fr 44px 72px 44px; align-items:center; gap:10px; min-height:61px; border-bottom:1px solid rgba(211,173,117,.7); }
.file-row:last-child { border-bottom:none; }
.file-row img { width:42px; height:42px; image-rendering:pixelated; }
.file-title { font-size:16px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-type, .file-date { color:#66615b; font-size:14px; text-align:center; }
.badge { justify-self:end; padding: 5px 8px; border-radius:7px; color:#fff; background:var(--red); font-weight:900; font-size:13px; }
.badge.orange { background: var(--orange); }
@media (max-width: 370px) {
  .phone-shell { padding-left: 13px; padding-right: 13px; }
  .rank-line { grid-template-columns: 38px 55px 34px 1fr 46px 28px; gap: 4px; }
  .rank-line .team, .rank-line .pct { font-size: 18px; }
  .app-card { grid-template-columns: 76px 1fr 70px; }
  .field { grid-template-columns: 38px 90px 1fr 14px; padding: 0 8px; }
  .field b { font-size: 18px; }
  .field .value { font-size: 14px; }
}

/* Functional bindings inside the locked design template */
.field-control {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #5f625f;
  font: inherit;
  font-size: 16px;
  text-align: right;
}
select.field-control {
  appearance: auto;
}
.photo-pick {
  display: block;
  cursor: pointer;
}
.thumb.has-image::before,
.thumb.placeholder::before {
  display: none;
}
.thumb.has-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 244, .7);
  color: #8b7b62;
  font-weight: 900;
}
.thumb button.x {
  position: absolute;
  right: -5px;
  top: -6px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  padding: 0;
}
.inline-feedback {
  min-height: 20px;
  margin: 10px 4px 0;
  color: var(--red-dark);
  text-align: center;
  font-weight: 800;
}
.admin-auth,
.admin-extra {
  margin: 16px 0;
  padding: 18px;
}
.admin-auth label,
.admin-extra h3 {
  display: block;
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 1000;
}
.admin-auth-row,
.goal-form,
.review-filter {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
}
.admin-auth input,
.goal-form input,
.review-filter input,
.review-filter select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  padding: 0 12px;
  outline: 0;
  font-size: 17px;
}
.admin-auth button,
.goal-form button {
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #15130f;
  color: #fff;
  font-weight: 1000;
}
.admin-team-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}
.admin-team-row {
  display: grid;
  grid-template-columns: 1fr 38px 38px 52px;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: rgba(255,255,255,.5);
}
.admin-team-row button {
  min-height: 34px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 1000;
}
.admin-team-row span {
  color: var(--red);
  text-align: right;
  font-weight: 1000;
}
.review-filter {
  grid-template-columns: 1fr 118px;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.review-item {
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.65);
  color: var(--ink);
  text-decoration: none;
}
.review-item img {
  width: 100%;
  height: 104px;
  display: block;
  object-fit: cover;
}
.review-item b,
.review-item span {
  display: block;
  padding: 6px 8px 0;
  font-size: 13px;
}
.review-item span {
  padding-bottom: 8px;
  color: #5f625f;
}
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #15130f;
  color: #fff;
  box-shadow: 5px 6px 0 rgba(84,45,28,.28);
  font-weight: 900;
}
.searchbar input {
  border: 0;
  outline: 0;
  background: transparent;
  color: #5f625f;
  font: inherit;
  font-size: 20px;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 18px;
  color: #7a6a55;
  text-align: center;
  font-weight: 900;
}

/* Design fidelity corrections: keep hero and app cards aligned with supplied mockups */
.home h1 {
  white-space: nowrap;
  font-size: clamp(42px, 11.8vw, 58px);
}
.hero h1 {
  word-break: keep-all;
}
.app-card {
  grid-template-columns: 82px 1fr 82px;
  gap: 10px;
}
.app-card .icon.lg {
  width: 82px;
  height: 82px;
}
.app-card h3 {
  font-size: 22px;
  line-height: 1.15;
  word-break: keep-all;
}
.app-card p {
  font-size: 14px;
}
.enter-btn {
  font-size: 17px;
}
@media (min-width: 410px) {
  .app-card h3 { font-size: 24px; }
  .app-card { grid-template-columns: 90px 1fr 82px; gap: 12px; }
  .app-card .icon.lg { width: 90px; height: 90px; }
}

/* 390px design-fit fixes */
.field {
  grid-template-columns: 38px 96px minmax(0, 1fr) 12px;
  gap: 6px;
  padding: 0 10px;
}
.field b {
  font-size: 20px;
  line-height: 1.15;
}
.field-control {
  max-width: 100%;
  font-size: 15px;
}
.library .hero h1 {
  white-space: nowrap;
  font-size: clamp(44px, 12vw, 58px);
}
.searchbar {
  grid-template-columns: 42px minmax(0, 1fr) 20px;
}
.searchbar input {
  min-width: 0;
}
@media (max-width: 370px) {
  .field { grid-template-columns: 34px 84px minmax(0, 1fr) 10px; }
  .field b { font-size: 18px; }
  .field-control { font-size: 14px; }
}

/* Final design-fit pass: prevent form/search/card text clipping on 390px viewport */
.field {
  grid-template-columns: 36px 90px minmax(0, 1fr) 9px;
  gap: 5px;
}
.field b {
  white-space: nowrap;
  font-size: 19px;
}
.field .req {
  margin-left: 2px;
}
.field-control {
  font-size: 14px;
}
.searchbar input {
  font-size: 18px;
  letter-spacing: 0;
}
.app-card {
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  gap: 8px;
}
.app-card .icon.lg {
  width: 76px;
  height: 76px;
}
.app-card h3 {
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: 0;
}
.app-card p {
  font-size: 13px;
  line-height: 1.35;
}
.enter-btn {
  height: 46px;
  font-size: 16px;
}

.searchbar input { font-size: 17px; }
.app-card h3 br { display: block; }

/* Premium polish pass: keep the pixel-phone style, improve scan, touch, and depth. */
html {
  min-height: 100%;
  background: #e7dccb;
}

body {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(250, 246, 238, .92), rgba(224, 231, 218, .82)),
    #e7dccb;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(49, 31, 20, .035) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(0deg, rgba(49, 31, 20, .025) 0 1px, transparent 1px 12px);
  opacity: .45;
}

.phone-shell {
  min-height: 100dvh;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .94), rgba(255, 247, 231, .92) 58%, rgba(243, 229, 206, .96)),
    linear-gradient(90deg, rgba(196, 122, 50, .05) 1px, transparent 1px),
    linear-gradient(rgba(196, 122, 50, .045) 1px, transparent 1px);
  background-size: auto, 10px 10px, 10px 10px;
  isolation: isolate;
}

@media (min-width: 460px) {
  body {
    align-items: flex-start;
  }

  .phone-shell {
    min-height: calc(100dvh - 36px);
    margin: 18px 0;
    border: 2px solid rgba(34, 28, 20, .88);
    border-radius: 28px;
    box-shadow:
      10px 14px 0 rgba(92, 64, 35, .18),
      0 28px 70px rgba(55, 40, 25, .22);
  }
}

:where(.hero h1, .hero h2, .hero p, .home .headline, .primary-btn, .outline-btn, .dark-btn) {
  letter-spacing: 0;
}

.hero {
  padding-bottom: 18px;
}

.hero h1,
.hero h2 {
  text-wrap: balance;
  text-shadow: 0 3px 0 rgba(122, 85, 42, .12);
}

.hero h1 {
  font-size: 3.25rem;
}

.home h1 {
  font-size: 3.05rem;
}

.library .hero h1 {
  font-size: 3.2rem;
}

.hero p,
.home .hello {
  line-height: 1.45;
}

.home .headline {
  font-size: 1.35rem;
  font-weight: 650;
}

.pixel-divider {
  width: 168px;
  height: 12px;
  margin-top: 12px;
  opacity: .68;
  background: repeating-linear-gradient(90deg, transparent 0 14px, #e99958 14px 20px, transparent 20px 32px);
}

.card {
  border-color: rgba(28, 27, 24, .92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(255, 247, 231, .9)),
    var(--paper);
  box-shadow:
    6px 8px 0 rgba(113, 78, 42, .18),
    0 16px 32px rgba(73, 51, 28, .08);
}

.card.soft,
.stat-card,
.cat-card,
.rank-table,
.field,
.tip,
.upload-count {
  border-color: rgba(180, 139, 82, .56);
}

:where(button, .photo-pick, .review-item, .cat-card, .app-card, .enter-btn) {
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

@media (hover: hover) {
  button:not(:disabled):hover,
  .photo-pick:hover,
  .review-item:hover {
    transform: translateY(-2px);
    filter: saturate(1.04);
  }

  .app-card:hover,
  .cat-card:hover {
    box-shadow:
      7px 9px 0 rgba(113, 78, 42, .2),
      0 18px 34px rgba(73, 51, 28, .1);
  }

  .primary-btn:not(:disabled):hover,
  .dark-btn:not(:disabled):hover,
  .outline-btn:not(:disabled):hover {
    transform: translateY(-2px);
  }
}

button:not(:disabled):active,
.photo-pick:active {
  transform: translateY(2px);
  box-shadow: 2px 3px 0 rgba(84, 45, 28, .28);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.photo-pick:focus-within,
.review-item:focus-visible {
  outline: 3px solid rgba(47, 118, 107, .36);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.primary-btn,
.outline-btn,
.dark-btn {
  min-height: 62px;
  font-variant-numeric: tabular-nums;
}

.primary-btn:disabled {
  filter: grayscale(.18) saturate(.78);
  opacity: .72;
}

.ranking {
  padding: 12px 10px 12px;
}

.ranking-title {
  margin-top: 6px;
  margin-bottom: 12px;
  font-size: 1.48rem;
  line-height: 1.12;
}

.rank-table {
  padding: 8px 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 246, 226, .58));
}

.rank-line {
  grid-template-columns: 32px minmax(86px, 1fr) 32px minmax(62px, .78fr) 44px 28px;
  gap: 5px;
  min-height: 45px;
}

.rank-line .rank {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.rank-line .team {
  min-width: 0;
  font-size: 1.18rem;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-line .rocket-sm {
  width: 32px;
  height: 32px;
}

.rank-line .pct {
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.mini-progress {
  height: 15px;
  padding: 2px;
  gap: 2px;
  border: 1px solid rgba(143, 113, 72, .42);
  border-radius: 7px;
  background: rgba(242, 229, 208, .78);
}

.mini-progress i {
  border: 0;
  border-radius: 2px;
  background: rgba(196, 178, 151, .62);
}

.mini-progress i.on {
  background: linear-gradient(180deg, #f6ba3c, #df6d1b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

.notice-line,
.footnote {
  line-height: 1.5;
}

.app-card {
  min-height: 108px;
  padding: 14px 12px;
  text-align: left;
}

.app-card h3 {
  text-wrap: balance;
}

.enter-btn {
  min-width: 70px;
  box-shadow: 3px 4px 0 rgba(84, 45, 28, .24);
}

.field {
  min-height: 66px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 248, 235, .68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
}

.field:focus-within {
  border-color: rgba(47, 118, 107, .72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7),
    0 0 0 3px rgba(47, 118, 107, .13);
}

.field b {
  text-wrap: nowrap;
}

.photo-pick {
  margin-bottom: 12px;
  padding: 14px 8px 10px;
  border: 2px dashed rgba(143, 113, 72, .58);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 246, 229, .42));
}

.photo-card .camera-wrap {
  margin-top: 0;
}

.upload-count {
  font-variant-numeric: tabular-nums;
}

.thumb {
  height: 86px;
}

.thumb.placeholder {
  border-style: dashed;
  background:
    repeating-linear-gradient(45deg, rgba(217, 154, 44, .08) 0 8px, rgba(255, 255, 255, .42) 8px 16px);
}

.tip {
  line-height: 1.4;
}

.searchbar {
  margin-top: 10px;
  border-color: rgba(28, 27, 24, .88);
}

.category-grid {
  gap: 12px;
}

.cat-card {
  min-height: 92px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(255, 245, 223, .68));
}

.cat-card b {
  line-height: 1.12;
  text-wrap: balance;
}

.file-row {
  grid-template-columns: 42px minmax(0, 1fr) 38px 68px 44px;
  gap: 8px;
}

.file-title {
  min-width: 0;
}

.badge {
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.review-item {
  box-shadow: 3px 4px 0 rgba(113, 78, 42, .12);
}

.toast {
  bottom: max(22px, env(safe-area-inset-bottom));
}

@media (max-width: 370px) {
  .hero h1,
  .library .hero h1 {
    font-size: 2.72rem;
  }

  .home h1 {
    font-size: 2.55rem;
  }

  .ranking-title {
    font-size: 1.3rem;
  }

  .rank-line {
    grid-template-columns: 28px minmax(72px, 1fr) 28px minmax(48px, .7fr) 40px 24px;
    gap: 4px;
  }

  .rank-line .team,
  .rank-line .pct {
    font-size: 1rem;
  }

  .rank-line .rocket-sm {
    width: 28px;
    height: 28px;
  }

  .mini-progress {
    height: 13px;
    gap: 1px;
  }

  .app-card {
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    padding: 12px 10px;
  }

  .app-card .icon.lg {
    width: 68px;
    height: 68px;
  }

  .enter-btn {
    min-width: 62px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Home reference rebuild: uses the supplied split PNG layers as the visual source of truth. */
.phone-shell.design-home-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 15px max(18px, env(safe-area-inset-bottom));
  background-color: #fff7e8;
  background-image: url("./assets/home-design/frames/00_full_paper_bg_941x1672.png");
  background-image: image-set(
    url("./assets/home-design/frames/00_full_paper_bg_941x1672.webp") type("image/webp"),
    url("./assets/home-design/frames/00_full_paper_bg_941x1672.png") type("image/png")
  );
  background-position: top center;
  background-size: 100% auto;
  background-repeat: no-repeat;
  overflow-x: hidden;
}

.phone-shell.design-home-shell::before,
.phone-shell.design-home-shell::after {
  display: none;
}

.design-home-shell .statusbar {
  height: 45px;
  padding: 0 20px 5px;
  font-size: 16px;
}

.design-home-shell .status-icons {
  gap: 8px;
}

.design-home-shell .battery {
  border-radius: 5px;
  padding: 1px 5px;
}

.design-home {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 45px);
  padding-bottom: 8px;
}

.design-home img {
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

.home-corner {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.home-corner-tl {
  left: -10px;
  top: 24px;
  width: 36px;
}

.home-corner-tr {
  right: -14px;
  top: 166px;
  width: 38px;
}

.design-admin-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 36px;
  padding-top: 8px;
}

.design-home-entry-link {
  min-height: 32px;
  padding: 0 11px;
  border: 3px solid #17130f;
  border-radius: 7px;
  background: #fff4d7;
  color: #17130f;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 3px 4px 0 rgba(52, 34, 13, .16);
}

.design-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: #17130f;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.design-admin-link img {
  width: 18px;
  height: 18px;
}

.design-admin-link span {
  font-size: 26px;
  line-height: 1;
  transform: translateY(-1px);
}

.design-hero {
  position: relative;
  z-index: 1;
  padding: 28px 0 18px;
  text-align: center;
}

.design-hero h1 {
  margin: 0;
  white-space: nowrap;
  color: #15120f;
  font-size: clamp(43px, 12.9vw, 55px);
  font-weight: 1000;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(116, 76, 30, .12);
}

.design-hero h1 span {
  color: #db2018;
  text-shadow:
    0 3px 0 rgba(93, 24, 17, .22),
    0 0 0 #000;
}

.design-subtitle {
  display: grid;
  grid-template-columns: 58px minmax(0, max-content) 58px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.design-subtitle img {
  width: 58px;
  height: auto;
}

.design-subtitle b {
  color: #15120f;
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 6px;
  white-space: nowrap;
}

.design-hero p {
  margin: 17px 0 0;
  color: #1f1c18;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: .3px;
}

.design-board {
  position: relative;
  z-index: 1;
  margin: 7px 2px 16px;
  min-height: 244px;
  padding: 12px 10px 10px;
  background-image: url("./assets/home-design/frames/01_leaderboard_outer_frame.png");
  background-image: image-set(
    url("./assets/home-design/frames/01_leaderboard_outer_frame.webp") type("image/webp"),
    url("./assets/home-design/frames/01_leaderboard_outer_frame.png") type("image/png")
  );
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.design-board-head {
  position: relative;
  display: grid;
  grid-template-columns: 102px 1fr 46px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
}

.design-news {
  display: flex;
  align-items: center;
  gap: 2px;
}

.design-news img:first-child {
  width: 24px;
}

.design-news img:last-child {
  width: 68px;
}

.design-board-head h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  color: #15120f;
  font-size: 19px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.design-board-head h2 img {
  width: 16px;
  height: auto;
}

.design-trophy {
  justify-self: end;
  width: 32px;
}

.design-rank-table {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  margin: 7px 3px 0;
  min-height: 174px;
  padding: 12px 12px 9px;
  background-image: url("./assets/home-design/frames/02_leaderboard_inner_table_frame.png");
  background-image: image-set(
    url("./assets/home-design/frames/02_leaderboard_inner_table_frame.webp") type("image/webp"),
    url("./assets/home-design/frames/02_leaderboard_inner_table_frame.png") type("image/png")
  );
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.design-rank-line {
  display: grid;
  grid-template-columns: 32px minmax(88px, 96px) 30px minmax(54px, 1fr) 43px 24px;
  align-items: center;
  column-gap: 4px;
  min-height: 30px;
  border-bottom: 1px solid rgba(204, 166, 103, .56);
}

.design-rank-line:last-child {
  border-bottom: 0;
}

.design-rank-no {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.design-rank-no img {
  width: 24px;
  height: auto;
}

.design-rank-no b {
  display: block;
  color: #111;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.design-team {
  min-width: 0;
  color: #111;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.design-rocket {
  width: 29px;
  justify-self: center;
}

.design-progress {
  position: relative;
  height: 16px;
  padding: 3px 4px;
  background: rgba(255, 250, 238, .86);
  border: 1px solid #c9a77a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
  overflow: hidden;
}

.design-progress::before {
  content: "";
  position: absolute;
  inset: 3px 4px;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(138, 102, 64, .38) 9px 10px), rgba(255, 250, 238, .85);
}

.design-progress span {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--value);
  height: 100%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 1px, transparent 1px 10px), linear-gradient(180deg, color-mix(in srgb, var(--fill), #fff 18%), var(--fill));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.design-percent {
  color: #2b1513;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.design-percent.hot {
  color: #cf1c17;
}

.design-percent.warm {
  color: #e95117;
}

.design-coin {
  width: 23px;
  justify-self: end;
}

.design-board-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  color: #4a3725;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.design-board-foot img:nth-child(1) {
  width: 24px;
}

.design-board-foot img:nth-child(2) {
  width: 18px;
}

.design-board-foot img:last-child {
  width: 30px;
}

.design-app-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 101px minmax(0, 1fr) 75px;
  align-items: center;
  gap: 10px;
  width: calc(100% - 4px);
  min-height: 82px;
  margin: 0 2px 10px;
  padding: 10px 14px 10px 11px;
  color: #15120f;
  text-align: left;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.design-race-card {
  background-image: url("./assets/home-design/frames/04_tool_card_frame_red_star.png");
  background-image: image-set(
    url("./assets/home-design/frames/04_tool_card_frame_red_star.webp") type("image/webp"),
    url("./assets/home-design/frames/04_tool_card_frame_red_star.png") type("image/png")
  );
  grid-template-columns: 84px minmax(0, 1fr) 66px;
  gap: 7px;
}

.design-library-card {
  background-image: url("./assets/home-design/frames/05_tool_card_frame_orange_doc.png");
  background-image: image-set(
    url("./assets/home-design/frames/05_tool_card_frame_orange_doc.webp") type("image/webp"),
    url("./assets/home-design/frames/05_tool_card_frame_orange_doc.png") type("image/png")
  );
}

.design-ai-card {
  grid-template-columns: 92px minmax(0, 1fr) 76px;
  gap: 9px;
  background-image: url("./assets/ai-assistant/home-entry/cards/frame_tool_card_empty_870x172.png");
}

.design-visit-card {
  min-height: 76px;
  background-image: url("./assets/home-design/frames/06_tool_card_frame_gray_clock.png");
  background-image: image-set(
    url("./assets/home-design/frames/06_tool_card_frame_gray_clock.webp") type("image/webp"),
    url("./assets/home-design/frames/06_tool_card_frame_gray_clock.png") type("image/png")
  );
}

.design-app-card:disabled {
  opacity: 1;
}

.design-app-icon {
  justify-self: center;
}

.design-app-icon.race {
  width: 78px;
}

.design-app-icon.folder {
  width: 82px;
}

.design-app-icon.ai {
  width: 86px;
}

.design-app-icon.camera {
  width: 83px;
}

.design-ai-badge {
  position: absolute;
  right: 104px;
  top: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 43px;
  height: 27px;
  padding: 0 9px;
  border: 2px solid #15120f;
  border-radius: 7px;
  background: #1f8fe5;
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 2px 3px 0 rgba(12, 64, 113, .18);
}

.design-app-copy {
  display: block;
  min-width: 0;
}

.design-app-copy h3 {
  margin: 0 0 9px;
  color: #15120f;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.design-app-copy p {
  margin: 0;
  color: #504941;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.design-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 70px;
  height: 34px;
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  background: url("./assets/home-design/frames/07_black_button_frame.png") center / 100% 100% no-repeat;
}

.design-enter b {
  font-size: 28px;
  line-height: .7;
  transform: translateY(-1px);
}

.design-enter.disabled {
  width: 77px;
  background-image: url("./assets/home-design/frames/08_red_button_frame.png");
  font-size: 16px;
  letter-spacing: 0;
}

.design-footer {
  position: relative;
  z-index: 1;
  min-height: 50px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4d4031;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  white-space: nowrap;
}

.design-footer span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.design-footer span img {
  width: 19px;
}

.footer-corner,
.footer-dot {
  position: absolute;
  pointer-events: none;
}

.footer-corner.left {
  left: -12px;
  bottom: -4px;
  width: 36px;
}

.footer-corner.right {
  right: -12px;
  bottom: -4px;
  width: 36px;
}

.footer-dot.left {
  left: 36px;
  bottom: 19px;
  width: 28px;
}

.footer-dot.right {
  right: 36px;
  bottom: 19px;
  width: 38px;
}

@media (max-width: 370px) {
  .phone-shell.design-home-shell {
    padding-left: 11px;
    padding-right: 11px;
  }

  .design-hero h1 {
    font-size: 40px;
  }

  .design-subtitle {
    grid-template-columns: 48px minmax(0, max-content) 48px;
    gap: 7px;
  }

  .design-subtitle b {
    font-size: 19px;
    letter-spacing: 4px;
  }

  .design-board-head {
    grid-template-columns: 86px 1fr 38px;
    padding: 0 8px;
  }

  .design-news img:last-child {
    width: 58px;
  }

  .design-board-head h2 {
    font-size: 17px;
  }

  .design-rank-line {
    grid-template-columns: 28px minmax(76px, 84px) 26px minmax(42px, 1fr) 38px 20px;
    column-gap: 4px;
  }

  .design-team,
  .design-percent {
    font-size: 16px;
  }

  .design-rocket {
    width: 25px;
  }

  .design-app-card {
    grid-template-columns: 82px minmax(0, 1fr) 68px;
    padding-left: 9px;
    padding-right: 11px;
  }

  .design-app-copy h3 {
    font-size: 18px;
  }

  .design-app-copy p {
    font-size: 12px;
  }

  .design-enter {
    width: 64px;
    font-size: 16px;
  }

  .design-enter.disabled {
    width: 70px;
    font-size: 14px;
  }
}

/* Home reference rebuild pass 2: fit the footer and restore title spacing. */
.design-home-shell .statusbar {
  height: 42px;
}

.design-home {
  min-height: calc(100dvh - 42px);
}

.design-hero {
  padding-top: 24px;
  padding-bottom: 15px;
}

.design-hero h1 span {
  display: inline-block;
  margin-right: .11em;
}

.design-subtitle {
  margin-top: 14px;
}

.design-hero p {
  margin-top: 14px;
}

.design-board {
  min-height: 236px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.design-rank-table {
  min-height: 168px;
  padding-top: 10px;
  padding-bottom: 8px;
}

.design-board-foot {
  margin-top: 6px;
}

.design-app-card {
  min-height: 78px;
  margin-bottom: 8px;
}

.design-visit-card {
  min-height: 72px;
}

.design-footer {
  min-height: 42px;
  font-size: 13px;
}

/* Home reference rebuild pass 3: prevent first card title/button collision. */
.design-race-card {
  grid-template-columns: 98px minmax(0, 1fr) 70px;
}

.design-race-card .design-app-copy h3 {
  font-size: 18px;
}

.design-race-card .design-enter {
  width: 66px;
}

/* Home manual debug mode: CSS variables controlled by ?debug=1. */
.phone-shell.design-home-shell {
  padding-left: var(--home-page-x, 15px);
  padding-right: var(--home-page-x, 15px);
}

.design-home-shell .statusbar {
  height: var(--home-status-h, 42px);
}

.design-home {
  min-height: calc(100dvh - var(--home-status-h, 42px));
}

.design-hero {
  padding-top: var(--home-hero-top, 24px);
  padding-bottom: var(--home-hero-bottom, 15px);
}

.design-hero h1 {
  font-size: var(--home-title-size, 50px);
}

.design-subtitle {
  margin-top: var(--home-subtitle-top, 14px);
}

.design-hero p {
  margin-top: var(--home-hello-top, 14px);
}

.design-board {
  min-height: var(--home-board-height, 236px);
  margin-top: var(--home-board-top, 4px);
  margin-bottom: var(--home-board-bottom, 12px);
}

.design-rank-table {
  min-height: var(--home-table-height, 168px);
}

.design-app-card {
  min-height: var(--home-card-height, 78px);
  margin-bottom: var(--home-card-gap, 8px);
}

.design-visit-card {
  min-height: var(--home-visit-card-height, 72px);
  grid-template-columns: 88px minmax(0, 1fr) 78px;
  gap: 8px;
}

.design-race-card .design-app-copy h3 {
  font-size: var(--home-race-title-size, 17px);
}

.design-race-card .design-app-copy p {
  font-size: 12px;
}

.design-visit-card .design-app-copy h3 {
  font-size: 17px;
}

.design-footer {
  min-height: var(--home-footer-height, 42px);
  transform: translateY(var(--home-footer-y, 0px));
}

.home-debug-panel {
  position: fixed;
  z-index: 9999;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 24px));
  max-height: min(620px, calc(100dvh - 24px));
  overflow: hidden;
  border: 2px solid #16120f;
  border-radius: 14px;
  background: rgba(255, 250, 238, .96);
  box-shadow: 8px 10px 0 rgba(60, 35, 20, .22), 0 18px 44px rgba(45, 30, 18, .18);
  color: #15120f;
  font-family: var(--font);
}

.home-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #15120f;
  color: #fff;
}

.home-debug-head strong {
  font-size: 15px;
  letter-spacing: 0;
}

.home-debug-head button,
.home-debug-actions button {
  min-height: 34px;
  border: 2px solid #15120f;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff7e8;
  color: #15120f;
  font-size: 13px;
  font-weight: 900;
}

.home-debug-head button {
  min-height: 28px;
  border-color: #fff;
  background: #fff;
}

.home-debug-body {
  display: grid;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
  padding: 12px;
}

.home-debug-panel.is-collapsed .home-debug-body {
  display: none;
}

.home-debug-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 800;
}

.home-debug-row input[type="range"] {
  width: 100%;
  accent-color: #d9271f;
}

.home-debug-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #d9271f;
}

.home-debug-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.home-debug-actions button:first-child {
  background: #15120f;
  color: #fff;
}

.home-debug-body p {
  margin: 0;
  color: #675b4c;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 430px) {
  .home-debug-panel {
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* Debug panel usability pass: keep more of the design visible while tuning. */
.home-debug-panel {
  max-height: min(470px, 55dvh);
}

.home-debug-body {
  max-height: min(400px, calc(55dvh - 52px));
}

.home-debug-actions {
  position: sticky;
  bottom: -12px;
  padding: 8px 0 2px;
  background: rgba(255, 250, 238, .96);
}

/* Real H5 cleanup: mock phone status bar is removed; optional top inset is only for manual tuning. */
.statusbar {
  display: none !important;
}


.design-home {
  min-height: 100dvh;
  padding-top: var(--home-status-h, 0px);
}

/* Upload page reference rebuild: split PNG layers + real form controls. */
.phone-shell.design-upload-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 16px max(22px, env(safe-area-inset-bottom));
  background: #fff7e8 url("./assets/upload-design/background/page_background_paper_grid_clean.png") top center / 100% auto no-repeat;
  overflow-x: hidden;
}

.phone-shell.design-upload-shell::before,
.phone-shell.design-upload-shell::after {
  display: none;
}

.design-upload {
  position: relative;
  min-height: 100dvh;
  padding: 30px 0 22px;
}

.design-upload img {
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

.upload-bg-corner,
.upload-bg-sparkle,
.upload-bottom-corner {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.upload-bg-tl {
  left: -10px;
  top: 28px;
  width: 36px;
}

.upload-bg-tr {
  right: -12px;
  top: 96px;
  width: 42px;
}

.upload-sparkle-left {
  left: 42px;
  top: 118px;
  width: 30px;
}

.upload-sparkle-right {
  right: 46px;
  top: 114px;
  width: 35px;
}

.upload-bottom-left {
  left: -12px;
  bottom: 0;
  width: 43px;
}

.upload-bottom-right {
  right: -12px;
  bottom: 0;
  width: 46px;
}

.upload-back {
  position: absolute;
  z-index: 3;
  left: 11px;
  top: 56px;
  width: 36px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-back img {
  width: 34px;
  height: auto;
}

.upload-hero {
  position: relative;
  z-index: 1;
  padding: 72px 6px 20px;
  text-align: center;
}

.upload-hero h1 {
  margin: 0;
  color: #15120f;
  font-size: clamp(38px, 12vw, 52px);
  font-weight: 1000;
  line-height: 1.03;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(116, 76, 30, .12);
  white-space: nowrap;
}

.upload-hero p {
  margin: 14px 0 0;
  color: #37322e;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
}

.upload-design-form {
  position: relative;
  z-index: 1;
}

.upload-form-panel {
  position: relative;
  min-height: 244px;
  margin: 0 1px 12px;
  padding: 14px 12px 12px;
  background: url("./assets/upload-design/frames/frame_form_panel_clean.png") center / 100% 100% no-repeat;
}

.upload-section-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  margin: 0 0 7px 5px;
}

.upload-section-tag .tag-icon {
  width: 28px;
}

.upload-section-tag .tag-label {
  width: 82px;
}

.upload-field-list {
  display: grid;
  gap: 7px;
}

.upload-field-row {
  position: relative;
  display: grid;
  grid-template-columns: 43px 100px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding: 0 16px 0 12px;
  background: url("./assets/upload-design/frames/frame_form_input_row_clean.png") center / 100% 100% no-repeat;
}

.upload-field-icon {
  width: 30px;
  justify-self: center;
}

.upload-field-row b {
  color: #15120f;
  font-size: 19px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.upload-field-row b span {
  color: #d9271f;
  margin-left: 4px;
}

.upload-field-row input,
.upload-field-row select {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #5b5f62;
  font: inherit;
  font-size: 16px;
  text-align: right;
}

.upload-field-row input::placeholder {
  color: #7f8284;
  opacity: 1;
}

.upload-field-row select {
  appearance: none;
  color: #66696c;
}

.upload-field-row em {
  color: #15120f;
  font-style: normal;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-2px);
}

.upload-photo-panel {
  position: relative;
  min-height: 340px;
  margin: 0 1px 13px;
  padding: 20px 12px 13px;
  background: url("./assets/upload-design/frames/frame_upload_panel_clean.png") center / 100% 100% no-repeat;
}

.upload-photo-pick {
  display: block;
  text-align: center;
  cursor: pointer;
  padding-top: 2px;
}

.upload-camera {
  display: block;
  width: 118px;
  margin: 0 auto 7px;
}

.upload-photo-pick h2 {
  margin: 0;
  color: #15120f;
  font-size: 32px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
}

.upload-photo-pick p {
  margin: 10px 0 14px;
  color: #3a3936;
  font-size: 18px;
  line-height: 1;
}

.upload-count-row {
  position: relative;
  display: grid;
  grid-template-columns: 35px auto 1fr 28px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  margin: 0 0 10px;
  background: url("./assets/upload-design/frames/frame_uploaded_count_row_clean.png") center / 100% 100% no-repeat;
}

.upload-count-row > img:first-child {
  width: 29px;
}

.upload-count-row b {
  color: #15120f;
  font-size: 18px;
  font-weight: 1000;
  white-space: nowrap;
}

.upload-count-row b span {
  color: #d9271f;
  margin: 0 3px;
}

.upload-count-row i {
  height: 12px;
  background: url("./assets/upload-design/frames/dotted_orange_divider_clean.png") center / 100% 100% no-repeat;
}

.upload-count-row .count-sparkle {
  width: 24px;
}

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

.upload-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  padding: 6px;
  background: url("./assets/upload-design/frames/frame_photo_thumbnail_clean.png") center / 100% 100% no-repeat;
  overflow: visible;
}

.upload-thumb.has-image > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.upload-thumb.placeholder {
  cursor: pointer;
}

.upload-thumb.placeholder span {
  color: #a57b42;
  font-size: 15px;
  font-weight: 1000;
}

.upload-thumb .x {
  position: absolute;
  right: -4px;
  top: -7px;
  width: 24px;
  height: 26px;
  padding: 0;
  z-index: 2;
}

.upload-thumb .x img {
  width: 100%;
  height: 100%;
}

.upload-tip-box {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 16px 8px 12px;
  background: url("./assets/upload-design/frames/frame_tip_box_clean.png") center / 100% 100% no-repeat;
}

.upload-tip-box .tip-icon {
  width: 35px;
  justify-self: center;
}

.upload-tip-box b {
  display: block;
  margin: 0 0 4px;
  color: #df5d18;
  font-size: 17px;
  font-weight: 1000;
}

.upload-tip-box p {
  margin: 0;
  color: #15120f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.upload-tip-box .tip-sparkle {
  width: 28px;
  justify-self: end;
}

.upload-submit-btn {
  display: grid;
  grid-template-columns: 1fr 64px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  margin: 0 0 18px;
  padding: 0 36px 0 76px;
  color: #fff;
  background: url("./assets/upload-design/frames/frame_submit_button_red_clean.png") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.upload-submit-btn span {
  justify-self: center;
  color: #fff;
  font-size: 24px;
  font-weight: 1000;
  letter-spacing: 1px;
  line-height: 1;
}

.upload-submit-btn img {
  width: 48px;
  justify-self: end;
}

.upload-submit-btn:disabled {
  opacity: .75;
  filter: grayscale(.08);
}

.upload-feedback {
  margin-top: -8px;
  margin-bottom: 10px;
}

@media (max-width: 370px) {
  .phone-shell.design-upload-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .upload-hero h1 {
    font-size: 36px;
  }

  .upload-field-row {
    grid-template-columns: 36px 86px minmax(0, 1fr) 12px;
    gap: 4px;
    padding-left: 9px;
    padding-right: 12px;
  }

  .upload-field-row b {
    font-size: 17px;
  }

  .upload-field-row input,
  .upload-field-row select {
    font-size: 14px;
  }

  .upload-submit-btn {
    padding-left: 52px;
    padding-right: 28px;
  }

  .upload-submit-btn span {
    font-size: 21px;
  }
}

/* Upload rebuild pass 2: fit the supplied full-page design into a 390x844 viewport without the mock status bar. */
.design-upload {
  padding-top: 10px;
}

.upload-back {
  top: 34px;
}

.upload-hero {
  padding-top: 54px;
  padding-bottom: 15px;
}

.upload-hero h1 {
  font-size: clamp(36px, 11vw, 47px);
}

.upload-hero p {
  margin-top: 10px;
  font-size: 16px;
}

.upload-form-panel {
  min-height: 232px;
  margin-bottom: 9px;
  padding-top: 12px;
}

.upload-field-list {
  gap: 5px;
}

.upload-field-row {
  min-height: 44px;
}

.upload-field-row b {
  font-size: 18px;
}

.upload-field-row input,
.upload-field-row select {
  font-size: 15px;
}

.upload-photo-panel {
  min-height: 306px;
  margin-bottom: 10px;
  padding-top: 15px;
}

.upload-camera {
  width: 98px;
  margin-bottom: 5px;
}

.upload-photo-pick h2 {
  font-size: 29px;
}

.upload-photo-pick p {
  margin-top: 8px;
  margin-bottom: 11px;
  font-size: 16px;
}

.upload-count-row {
  min-height: 34px;
  margin-bottom: 8px;
}

.upload-thumb-grid {
  gap: 10px;
  margin-bottom: 9px;
}

.upload-thumb {
  height: 76px;
}

.upload-tip-box {
  min-height: 52px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.upload-tip-box b {
  font-size: 16px;
}

.upload-tip-box p {
  font-size: 12px;
}

.upload-submit-btn {
  min-height: 56px;
  margin-bottom: 10px;
}

/* Upload rebuild pass 3: give right-side values more room, especially the note placeholder. */
.upload-field-row {
  grid-template-columns: 43px 92px minmax(0, 1fr) 15px;
}

.upload-field-row input,
.upload-field-row select {
  font-size: 14px;
}

/* Success page reference rebuild: split PNG layers + dynamic result data. */
.phone-shell.design-success-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 18px max(18px, env(safe-area-inset-bottom));
  background: #fff7e8 url("./assets/success-design/background/page_background_clean_941x1672.png") top center / 100% auto no-repeat;
  overflow-x: hidden;
}

.phone-shell.design-success-shell::before,
.phone-shell.design-success-shell::after {
  display: none;
}

.design-success {
  position: relative;
  min-height: 100dvh;
  padding: 36px 0 22px;
}

.design-success img {
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

.success-corner,
.success-sparkle {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.success-corner-tl {
  left: -12px;
  top: 34px;
  width: 38px;
}

.success-corner-bl {
  left: -14px;
  bottom: 0;
  width: 40px;
}

.success-corner-br {
  right: -14px;
  bottom: 0;
  width: 38px;
}

.success-mid-left {
  left: 48px;
  top: 254px;
  width: 34px;
}

.success-mid-right {
  right: -4px;
  top: 244px;
  width: 84px;
}

.success-hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  min-height: 128px;
}

.success-hero-art img {
  width: min(292px, 82vw);
  height: auto;
}

.success-design-hero {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 11px;
  padding: 8px 0 18px;
}

.success-title-img {
  width: min(255px, 72vw);
}

.success-subtitle-img {
  width: min(214px, 62vw);
}

.success-info-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  min-height: 214px;
  margin: 0 6px 13px;
  padding: 19px 18px 18px;
  background: url("./assets/success-design/frames_clean/card_info_large_clean.png") center / 100% 100% no-repeat;
}

.success-info-row {
  display: grid;
  grid-template-columns: 44px 1fr 142px;
  align-items: center;
  min-height: 43px;
  border-bottom: 1px dashed rgba(182, 146, 95, .72);
}

.success-info-row:last-child {
  border-bottom: 0;
}

.success-info-row img {
  width: 31px;
  justify-self: center;
}

.success-info-row b {
  color: #15120f;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
}

.success-info-row strong {
  min-width: 0;
  color: #15120f;
  font-size: 21px;
  font-weight: 1000;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.success-info-row strong.is-red {
  color: #d9271f;
}

.success-progress-card {
  position: relative;
  z-index: 1;
  min-height: 96px;
  margin: 0 6px 14px;
  padding: 20px 25px 14px;
  background: url("./assets/success-design/frames_clean/card_progress_clean.png") center / 100% 100% no-repeat;
}

.success-progress-head {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  margin-bottom: 15px;
}

.success-progress-head b {
  color: #15120f;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1;
}

.success-progress-head strong {
  color: #e85b18;
  font-size: 32px;
  font-weight: 1000;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.success-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 45px;
  align-items: center;
  gap: 12px;
}

.success-progress-row > img {
  width: 35px;
  justify-self: center;
}

.success-progress-bar {
  position: relative;
  height: 20px;
  background: url("./assets/success-design/frames_clean/progress_bar_empty_clean.png") center / 100% 100% no-repeat;
  overflow: hidden;
}

.success-progress-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--success-progress, 0%);
  max-width: 100%;
  background: repeating-linear-gradient(90deg, transparent 0 13px, rgba(115, 85, 46, .4) 13px 14px), linear-gradient(180deg, #f8bd20, #ef6a16);
  clip-path: inset(3px 4px 3px 4px);
}

.success-design-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 0 6px;
}

.success-action {
  display: grid;
  grid-template-columns: 1fr 55px;
  align-items: center;
  min-height: 56px;
  padding: 0 38px 0 86px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.success-action-primary {
  background-image: url("./assets/success-design/frames_clean/button_continue_red_clean.png");
  color: #fff;
}

.success-action-secondary {
  background-image: url("./assets/success-design/frames_clean/button_home_white_clean.png");
  color: #15120f;
}

.success-action span {
  justify-self: center;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
}

.success-action img {
  width: 32px;
  justify-self: end;
}

.success-action-secondary img {
  width: 30px;
}

@media (max-width: 370px) {
  .phone-shell.design-success-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .success-hero-art img {
    width: 266px;
  }

  .success-info-row {
    grid-template-columns: 38px 1fr 116px;
  }

  .success-info-row b,
  .success-info-row strong {
    font-size: 19px;
  }

  .success-action {
    padding-left: 62px;
    padding-right: 28px;
  }

  .success-action span {
    font-size: 21px;
  }
}

/* Admin page reference rebuild: split PNG layers + real management controls. */
.phone-shell.design-admin-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 15px max(22px, env(safe-area-inset-bottom));
  background: #fff7e8 url("./assets/admin-design/backgrounds/bg_paper_grid_blank.png") top center / 100% auto repeat-y;
  color: #141210;
}

.phone-shell.design-admin-shell::before,
.phone-shell.design-admin-shell::after {
  display: none;
}

.design-admin {
  min-height: 100dvh;
  padding: 0 0 26px;
}

.design-admin img {
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

.admin-design-header {
  position: relative;
  margin: 0 -15px 8px;
}

.admin-design-header > img {
  display: block;
  width: 100%;
  height: auto;
}

.admin-design-back {
  position: absolute;
  left: 16px;
  top: 43%;
  width: 50px;
  height: 44px;
  border: 0;
  background: transparent;
  transform: translateY(-50%);
}

.admin-design-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 171px;
  margin: 0 0 8px;
  padding: 18px 12px 16px;
  background: url("./assets/admin-design/frames/stats_panel_with_three_tiles_clean.png") center / 100% 100% no-repeat;
}

.admin-design-stat {
  display: grid;
  grid-template-rows: 30px 1fr 42px;
  justify-items: center;
  align-items: center;
  min-width: 0;
  padding: 2px 2px 0;
}

.admin-design-stat b {
  color: #16130f;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.admin-design-stat img {
  width: 58px;
  max-height: 62px;
  object-fit: contain;
}

.admin-design-stat strong {
  color: #15120f;
  font-size: 36px;
  font-weight: 1000;
  line-height: .95;
  font-variant-numeric: tabular-nums;
  transform: translateY(-2px);
}

.admin-design-menu-list {
  display: grid;
  gap: 10px;
  margin: 0 0 13px;
}

.admin-design-menu-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.admin-design-menu-card img {
  display: block;
  width: 100%;
  height: auto;
}

.admin-menu-text-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 15px;
  border: 3px solid #15120f;
  border-radius: 9px;
  background: #fff5dc;
  text-align: left;
  box-shadow: 4px 5px 0 rgba(87, 69, 43, .28);
}

.admin-menu-text-card > img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.admin-menu-text-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-menu-text-card b {
  color: #15120f;
  font-size: 19px;
  font-weight: 1000;
  line-height: 1.08;
}

.admin-menu-text-card small {
  color: #5d5143;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.admin-design-logout {
  display: grid;
  grid-template-columns: 36px auto;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin: 0 0 18px;
  border: 0;
  background: url("./assets/admin-design/frames/logout_button_red_outline_clean.png") center / 100% 100% no-repeat;
  color: #d92c22;
  box-shadow: none;
}

.admin-design-logout img {
  width: 27px;
  justify-self: end;
}

.admin-design-logout span {
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
}

.admin-design-login-card,
.admin-design-detail {
  position: relative;
  margin: 12px 0 18px;
  padding: 20px 18px;
  border: 3px solid #14120f;
  border-radius: 9px;
  background: rgba(255, 251, 240, .9);
  box-shadow: 5px 6px 0 rgba(87, 69, 43, .36);
}

.admin-design-login-card {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-top: 26px;
}

.admin-login-icon {
  width: 104px;
  margin-bottom: 10px;
}

.admin-design-login-card h3,
.admin-design-detail h3 {
  margin: 0;
  color: #15120f;
  font-size: 25px;
  font-weight: 1000;
  line-height: 1.08;
}

.admin-design-login-card p,
.admin-design-detail p {
  margin: 8px 0 0;
  color: #39332b;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-design-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}

.admin-design-login-row input,
.admin-design-goal-form input,
.admin-design-team-row input,
.admin-design-review-filter input,
.admin-design-review-filter select {
  min-width: 0;
  min-height: 48px;
  border: 2px solid #15120f;
  border-radius: 7px;
  background: #fffdf5;
  color: #17130e;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .18);
}

.admin-design-login-row input,
.admin-design-goal-form input,
.admin-design-team-row input,
.admin-design-review-filter input {
  padding: 0 12px;
}

.admin-design-login-row button,
.admin-design-goal-form button,
.admin-design-team-row button,
.admin-team-name-save {
  min-height: 48px;
  border: 2px solid #15120f;
  border-radius: 7px;
  background: #15120f;
  color: #fff;
  font-size: 17px;
  font-weight: 1000;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .22);
}

.admin-detail-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-detail-head > img {
  width: 66px;
  justify-self: center;
}

.admin-design-goal-form {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 9px;
}

.admin-design-goal-form label {
  font-size: 18px;
  font-weight: 1000;
}

.admin-design-team-name-form {
  margin-top: 16px;
}

.admin-team-name-head {
  display: grid;
  gap: 3px;
}

.admin-team-name-head b {
  color: #15120f;
  font-size: 17px;
  font-weight: 1000;
}

.admin-team-name-head span {
  color: #5d5143;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-design-team-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.admin-design-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 38px 38px 58px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 9px;
  border: 2px solid #d9b47d;
  border-radius: 7px;
  background: rgba(255, 247, 229, .8);
}

.admin-design-team-row b {
  overflow: hidden;
  color: #15120f;
  font-size: 17px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-design-team-row input {
  min-height: 36px;
  font-size: 16px;
}

.admin-design-team-row button {
  min-height: 34px;
  background: #fffdf5;
  color: #15120f;
  font-size: 15px;
}

.admin-design-team-row strong {
  display: grid;
  gap: 2px;
  color: #d9271f;
  font-weight: 1000;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-design-team-row strong span {
  font-size: 19px;
  line-height: 1;
}

.admin-design-team-row strong small {
  color: #6a4d2f;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
}

.admin-team-name-save {
  width: 100%;
  margin-top: 10px;
}

.admin-design-review-filter {
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 9px;
  margin-bottom: 14px;
}

.admin-design-review-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-design-review-grid .review-item {
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fffdf5;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .2);
}

.admin-design-review-grid .review-item a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.admin-design-review-grid .review-item img {
  image-rendering: auto;
}

.admin-design-review-grid .review-item button {
  width: calc(100% - 16px);
  min-height: 34px;
  margin: 0 8px 8px;
  border: 2px solid #d9271f;
  border-radius: 7px;
  background: #fff4ec;
  color: #d9271f;
  font-size: 14px;
  font-weight: 1000;
}

.admin-library-upload-form {
  display: grid;
  gap: 10px;
}

.admin-library-upload-form label {
  display: grid;
  gap: 5px;
  color: #15120f;
  font-size: 13px;
  font-weight: 1000;
}

.admin-library-upload-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 2px solid #15120f;
  border-radius: 7px;
  background: #fffdf5;
  color: #17130e;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .18);
}

.admin-library-upload-form button {
  min-height: 46px;
  border: 2px solid #15120f;
  border-radius: 7px;
  background: #15120f;
  color: #fff;
  font-size: 17px;
  font-weight: 1000;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .22);
}

.admin-library-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.admin-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 2px solid #d9b47d;
  border-radius: 7px;
  background: rgba(255, 247, 229, .8);
}

.admin-library-item a {
  min-width: 0;
  color: #15120f;
  text-decoration: none;
}

.admin-library-item b,
.admin-library-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-library-item b {
  font-size: 15px;
  font-weight: 1000;
}

.admin-library-item span {
  margin-top: 4px;
  color: #5d5143;
  font-size: 12px;
  font-weight: 800;
}

.admin-library-item button {
  min-height: 34px;
  border: 2px solid #d9271f;
  border-radius: 7px;
  background: #fff4ec;
  color: #d9271f;
  font-size: 14px;
  font-weight: 1000;
}

.admin-copy-form {
  display: grid;
  gap: 12px;
}

.admin-copy-actions {
  position: sticky;
  top: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
  padding: 8px;
  border: 2px solid #e0bd83;
  border-radius: 8px;
  background: rgba(255, 251, 240, .96);
}

.admin-copy-actions button,
.admin-copy-row input,
.admin-copy-row textarea {
  border: 2px solid #15120f;
  border-radius: 7px;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .18);
}

.admin-copy-actions button {
  min-height: 43px;
  background: #15120f;
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
}

.admin-copy-actions button.danger {
  border-color: #d9271f;
  background: #fff4ec;
  color: #d9271f;
}

.admin-copy-group {
  border: 2px solid #d9b47d;
  border-radius: 8px;
  background: rgba(255, 247, 229, .8);
  overflow: hidden;
}

.admin-copy-group summary {
  cursor: pointer;
  padding: 12px 13px;
  color: #15120f;
  font-size: 17px;
  font-weight: 1000;
}

.admin-copy-field-list {
  display: grid;
  gap: 9px;
  padding: 0 10px 12px;
}

.admin-copy-row {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 2px solid #edd3a6;
  border-radius: 7px;
  background: #fffdf5;
}

.admin-copy-row span {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.admin-copy-row input,
.admin-copy-row textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  background: #fffaf0;
  color: #17130e;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
  outline: 0;
}

.admin-copy-row textarea {
  resize: vertical;
}

.admin-copy-row small {
  color: #756959;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.design-admin .inline-feedback {
  min-height: 20px;
  margin: 10px 0 0;
  color: #d9271f;
  font-weight: 900;
}

@media (max-width: 370px) {
  .phone-shell.design-admin-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .admin-design-header {
    margin-left: -12px;
    margin-right: -12px;
  }

  .admin-design-stats {
    gap: 7px;
    min-height: 160px;
    padding: 16px 10px 14px;
  }

  .admin-design-stat b {
    font-size: 14px;
  }

  .admin-design-stat img {
    width: 50px;
  }

  .admin-design-stat strong {
    font-size: 31px;
  }

  .admin-design-login-row,
  .admin-design-review-filter,
  .admin-copy-actions {
    grid-template-columns: 1fr;
  }

  .admin-design-goal-form {
    grid-template-columns: 1fr 76px;
  }

  .admin-design-goal-form label {
    grid-column: 1 / -1;
  }

  .admin-design-team-row {
    grid-template-columns: minmax(0, 1fr) 62px 34px 34px 45px;
    gap: 6px;
    padding-left: 7px;
    padding-right: 7px;
  }

  .admin-design-team-row input {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 14px;
  }

  .admin-design-team-row button {
    font-size: 13px;
  }

  .admin-design-team-row strong span {
    font-size: 16px;
  }

  .admin-design-team-row strong small {
    font-size: 10px;
  }
}
/* Library page reference rebuild: split PNG layers + searchable file list. */
.phone-shell.design-library-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 18px max(18px, env(safe-area-inset-bottom));
  background: #fff7e8 url("./assets/library-design/backgrounds/page_background_clean.png") top center / 100% auto repeat-y;
  color: #14120f;
}

.phone-shell.design-library-shell::before,
.phone-shell.design-library-shell::after {
  display: none;
}

.design-library {
  min-height: 100dvh;
  padding: 0 0 20px;
}

.design-library img {
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

.library-design-header {
  position: relative;
  margin: 0 -4px 12px;
}

.library-design-header > img {
  display: block;
  width: 100%;
  height: auto;
}

.library-back-hit,
.library-admin-hit {
  position: absolute;
  top: 16px;
  height: 40px;
  border: 0;
  background: transparent;
}

.library-back-hit {
  left: 0;
  width: 150px;
}

.library-admin-hit {
  right: 0;
  width: 132px;
}

.library-design-search {
  position: relative;
  display: block;
  height: 54px;
  margin: 0 0 16px;
}

.library-search-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.library-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 1;
  width: 31px;
  transform: translateY(-50%);
}

.library-search-plus {
  position: absolute;
  right: 22px;
  top: 50%;
  z-index: 1;
  width: 18px;
  transform: translateY(-50%);
}

.library-design-search input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0 45px 0 58px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #15120f;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.library-design-search input::placeholder {
  color: #8b8a86;
  opacity: 1;
}

.library-design-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 11px;
  margin: 0 0 17px;
}

.library-design-category {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

.library-design-category img {
  display: block;
  width: 100%;
  height: auto;
}

.library-design-category:nth-child(5) {
  grid-column: 1 / 2;
}

.library-design-recent {
  position: relative;
  min-height: 280px;
  margin: 0 0 20px;
  padding: 16px 14px 14px;
  background: url("./assets/library-design/frames/recent_update_panel_frame_clean.png") center / 100% 100% no-repeat;
}

.library-recent-title {
  display: grid;
  grid-template-columns: 52px 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 0 10px;
}

.library-recent-megaphone {
  width: 36px;
  justify-self: center;
}

.library-recent-title h2 {
  margin: 0;
  color: #15120f;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.library-recent-deco {
  width: 42px;
  justify-self: center;
}

.library-design-file-list {
  display: grid;
  min-height: 223px;
  padding: 6px 11px;
  background: url("./assets/library-design/frames/recent_update_inner_list_frame_clean.png") center / 100% 100% no-repeat;
}

.library-design-file-row {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) 26px 64px 32px;
  align-items: center;
  gap: 4px;
  min-height: 43px;
  border-bottom: 1px solid rgba(211, 173, 117, .7);
  color: inherit;
  text-decoration: none;
}

.library-design-file-row:last-child {
  border-bottom: 0;
}

.library-file-icon {
  width: 27px;
  justify-self: center;
}

.library-file-title {
  overflow: hidden;
  color: #15120f;
  font-size: 13px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-file-type,
.library-file-date {
  color: #56524c;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.library-file-badge {
  min-width: 0;
  justify-self: end;
}

.library-file-badge img {
  width: 30px;
  height: auto;
}

.library-empty-state {
  display: grid;
  place-items: center;
  min-height: 200px;
  color: #5e564c;
  font-size: 18px;
  font-weight: 1000;
}

.library-design-footer {
  display: flex;
  justify-content: center;
  padding-bottom: 10px;
}

.library-design-footer img {
  width: min(224px, 66vw);
}

@media (max-width: 370px) {
  .phone-shell.design-library-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .library-design-header {
    margin-left: -2px;
    margin-right: -2px;
  }

  .library-design-search {
    height: 50px;
    margin-bottom: 13px;
  }

  .library-design-search input {
    padding-left: 56px;
    padding-right: 48px;
    font-size: 17px;
  }

  .library-design-category-grid {
    gap: 9px;
  }

  .library-design-recent {
    padding-left: 11px;
    padding-right: 11px;
  }

  .library-recent-title h2 {
    font-size: 22px;
  }

  .library-design-file-list {
    padding-left: 9px;
    padding-right: 9px;
  }

  .library-design-file-row {
    grid-template-columns: 31px minmax(0, 1fr) 30px 58px 36px;
    gap: 5px;
  }

  .library-file-title {
    font-size: 13px;
  }

  .library-file-type,
  .library-file-date {
    font-size: 12px;
  }

  .library-file-badge img {
    width: 32px;
  }
}

/* Finance guide: WeChat公众号导流页，延续米白像素报纸感。 */
.phone-shell.design-finance-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 18px max(22px, env(safe-area-inset-bottom));
  background-color: #fff7e8;
  background-image:
    image-set(
      url("./assets/home-design/frames/00_full_paper_bg_941x1672.webp") type("image/webp"),
      url("./assets/home-design/frames/00_full_paper_bg_941x1672.png") type("image/png")
    );
  background-position: top center;
  background-size: 100% auto;
  background-repeat: repeat-y;
  color: #15120f;
}

.phone-shell.design-finance-shell::before,
.phone-shell.design-finance-shell::after {
  display: none;
}

.finance-page {
  min-height: 100dvh;
  padding: 14px 0 18px;
}

.finance-page img {
  user-select: none;
  -webkit-user-drag: none;
}

.finance-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 8px;
  color: #15120f;
  font-size: 16px;
  font-weight: 900;
}

.finance-back span {
  font-size: 34px;
  line-height: .8;
  transform: translateY(-1px);
}

.finance-hero {
  position: relative;
  padding: 15px 4px 18px;
  text-align: center;
}

.finance-hero::before,
.finance-hero::after {
  content: "";
  position: absolute;
  top: 46px;
  width: 48px;
  height: 14px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, #f0a85d 10px 16px);
}

.finance-hero::before {
  left: 4px;
}

.finance-hero::after {
  right: 4px;
  transform: scaleX(-1);
}

.finance-hero p {
  margin: 0 0 7px;
  color: #db2018;
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 2px;
}

.finance-hero h1 {
  margin: 0;
  color: #15120f;
  font-size: 48px;
  font-weight: 1000;
  line-height: 1.03;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(116, 76, 30, .12);
}

.finance-hero span {
  display: block;
  max-width: 310px;
  margin: 12px auto 0;
  color: #473c32;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
}

.finance-follow-card,
.finance-article-card {
  border: 2px solid #15120f;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(246, 154, 62, .08) 1px, transparent 1px),
    linear-gradient(rgba(246, 154, 62, .07) 1px, transparent 1px),
    rgba(255, 253, 244, .86);
  background-size: 8px 8px, 8px 8px, auto;
  box-shadow: 6px 7px 0 rgba(138, 94, 44, .2);
}

.finance-follow-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 15px;
  align-items: center;
  padding: 16px 15px 16px 17px;
  overflow: hidden;
}

.finance-follow-card::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #db2018 0 50%, transparent 51%);
}

.finance-follow-copy b {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #db2018;
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
}

.finance-follow-copy h2 {
  margin: 12px 0 8px;
  color: #15120f;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
}

.finance-follow-copy p {
  margin: 0;
  color: #4d4338;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.finance-qr-wrap {
  display: grid;
  place-items: center;
  padding: 7px;
  border: 2px solid #15120f;
  border-radius: 12px;
  background: #fff;
  box-shadow: 4px 5px 0 rgba(84, 45, 28, .16);
}

.finance-qr-wrap img {
  display: block;
  width: 108px;
  height: 108px;
  object-fit: cover;
  image-rendering: auto;
}

.finance-article-section {
  margin-top: 18px;
}

.finance-section-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 4px 12px;
}

.finance-section-title span,
.finance-section-title i {
  height: 8px;
  background: repeating-linear-gradient(90deg, transparent 0 9px, #f0a85d 9px 15px);
}

.finance-section-title h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 1000;
  line-height: 1;
}

.finance-article-list {
  display: grid;
  gap: 13px;
}

.finance-article-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
}

.finance-article-index {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid #15120f;
  border-radius: 10px;
  background: #f06d17;
  color: #fff;
  font-size: 17px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(84, 45, 28, .16);
}

.finance-article-copy {
  min-width: 0;
}

.finance-article-copy em {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(217, 39, 31, .1);
  color: #d9271f;
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
}

.finance-article-copy h3 {
  margin: 0;
  color: #15120f;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1.28;
}

.finance-article-copy p {
  margin: 8px 0 0;
  color: #504941;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.finance-article-button {
  grid-column: 2 / 3;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 110px;
  min-height: 38px;
  margin-top: 2px;
  padding: 0 13px;
  border: 2px solid #15120f;
  border-radius: 9px;
  background: #15120f;
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  text-decoration: none;
  box-shadow: 4px 5px 0 rgba(84, 45, 28, .18);
}

.finance-article-button b {
  font-size: 25px;
  line-height: .7;
  transform: translateY(-1px);
}

.finance-notice {
  margin: 18px 6px 0;
  color: #675944;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 370px) {
  .phone-shell.design-finance-shell {
    padding-left: 13px;
    padding-right: 13px;
  }

  .finance-hero h1 {
    font-size: 43px;
  }

  .finance-follow-card {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 11px;
    padding-left: 14px;
    padding-right: 12px;
  }

  .finance-follow-copy h2 {
    font-size: 25px;
  }

  .finance-follow-copy p {
    font-size: 13px;
  }

  .finance-qr-wrap img {
    width: 96px;
    height: 96px;
  }

  .finance-article-copy h3 {
    font-size: 16px;
  }
}

/* Copy and layout editor: hidden utility page for local tweaking. */
:root {
  --editor-font-scale: 1;
  --editor-home-y: 0px;
  --editor-upload-y: 0px;
  --editor-success-y: 0px;
  --editor-admin-y: 0px;
  --editor-library-y: 0px;
  --editor-library-search-size: 17px;
  --editor-library-list-size: 13px;
  --editor-panel-gap: 12px;
}

.design-home,
.design-upload,
.design-success,
.design-admin,
.design-library,
.finance-page {
  font-size: calc(1em * var(--editor-font-scale));
}

.design-home { margin-top: var(--editor-home-y); }
.design-upload { margin-top: var(--editor-upload-y); }
.design-success { margin-top: var(--editor-success-y); }
.design-admin { margin-top: var(--editor-admin-y); }
.design-library { margin-top: var(--editor-library-y); }

.design-app-card,
.admin-design-menu-list,
.library-design-category-grid {
  gap: var(--editor-panel-gap);
}

.library-design-search input {
  font-size: var(--editor-library-search-size);
}

.library-file-title {
  font-size: var(--editor-library-list-size);
}

.phone-shell.design-editor-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 16px 16px max(24px, env(safe-area-inset-bottom));
  background: #fff7e8;
  color: #15120f;
}

.phone-shell.design-editor-shell::before,
.phone-shell.design-editor-shell::after {
  display: none;
}

.editor-page {
  display: grid;
  gap: 14px;
}

.editor-hero {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 0 4px;
}

.editor-back {
  width: 38px;
  height: 38px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fffdf5;
  color: #15120f;
  font-size: 25px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .18);
}

.editor-hero h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1.05;
}

.editor-hero p {
  margin: 6px 0 0;
  color: #5a5145;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.editor-panel {
  padding: 14px;
  border: 3px solid #15120f;
  border-radius: 9px;
  background: #fffdf5;
  box-shadow: 4px 5px 0 rgba(87, 69, 43, .2);
}

.editor-panel h2 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 1000;
}

.editor-note {
  margin: 12px 0 0;
  color: #6a5d4d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.editor-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.editor-action-grid button {
  min-height: 43px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #15120f;
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 3px 3px 0 rgba(87, 69, 43, .18);
}

.editor-action-grid button.danger {
  background: #fff1e9;
  color: #d9271f;
  border-color: #d9271f;
}

.editor-group {
  display: grid;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px dashed rgba(190, 150, 92, .7);
}

.editor-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.editor-group h3,
.editor-group summary {
  color: #15120f;
  font-size: 17px;
  font-weight: 1000;
}

.editor-group summary {
  cursor: pointer;
  list-style-position: outside;
  margin-left: 18px;
}

.editor-copy-row,
.editor-range-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 2px solid #ead1a6;
  border-radius: 8px;
  background: #fff8e9;
}

.editor-copy-row span,
.editor-range-row span {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.editor-copy-row input,
.editor-copy-row textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 2px solid #15120f;
  border-radius: 7px;
  background: #fffdf5;
  color: #15120f;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
  outline: 0;
}

.editor-copy-row textarea {
  resize: vertical;
}

.editor-copy-row small {
  color: #756959;
  font-size: 12px;
  line-height: 1.35;
}

.editor-range-row {
  grid-template-columns: 1fr;
}

.editor-range-row input[type="range"] {
  width: 100%;
  accent-color: #e6422e;
}

.editor-range-row b {
  justify-self: end;
  color: #d9271f;
  font-size: 14px;
  font-weight: 1000;
}

@media (max-width: 370px) {
  .phone-shell.design-editor-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .editor-action-grid {
    grid-template-columns: 1fr;
  }
}

/* AI assistant MVP */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.phone-shell.design-ai-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 0 17px;
  background:
    linear-gradient(90deg, rgba(246,154,62,.05) 1px, transparent 1px),
    linear-gradient(rgba(246,154,62,.045) 1px, transparent 1px),
    #fff7e8;
  background-size: 8px 8px;
  color: #15120f;
}

.phone-shell.design-ai-shell::before,
.phone-shell.design-ai-shell::after {
  opacity: .5;
}

.ai-page {
  min-height: 100dvh;
  padding: 24px 0 18px;
}

.ai-chat-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  padding: 7px 0 7px;
  overflow: hidden;
}

.ai-chat-page > .ai-page-header,
.ai-chat-page > .ai-workbar,
.ai-chat-page > .ai-input-panel,
.ai-chat-page > .ai-page-note {
  flex: 0 0 auto;
}

.ai-chat-page > .ai-page-note {
  display: none;
}

.ai-chat-page > .ai-history-drawer {
  flex: 0 1 auto;
  max-height: 32dvh;
  overflow-y: auto;
}

.ai-page-header {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 84px;
  margin: 0 0 10px;
}

.ai-chat-page .ai-page-header {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 48px;
  margin-bottom: 6px;
}

.ai-chat-page .ai-back {
  width: 38px;
  height: 38px;
}

.ai-chat-page .ai-title-block h1 {
  font-size: 22px;
  line-height: 1;
}

.ai-chat-page .ai-title-block p {
  display: none;
}

.ai-chat-page .ai-model-pill {
  min-width: 52px;
  min-height: 32px;
  padding: 0 6px;
}

.ai-back {
  position: relative;
  width: 52px;
  height: 52px;
}

.ai-back span,
.ai-back::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-left: 4px solid #15120f;
  border-bottom: 4px solid #15120f;
  transform: rotate(45deg);
}

.ai-back::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 13px;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(#f6a642, #f6a642) 0 0 / 7px 7px no-repeat,
    linear-gradient(#f6a642, #f6a642) 7px 0 / 7px 7px no-repeat,
    linear-gradient(#f6a642, #f6a642) 0 7px / 7px 7px no-repeat;
  z-index: -1;
}

.ai-title-block {
  min-width: 0;
  text-align: center;
}

.ai-title-block h1 {
  margin: 0;
  color: #15120f;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1.05;
  letter-spacing: 0;
}

.ai-title-block p {
  margin: 7px 0 0;
  color: #171412;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.ai-model-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 73px;
  height: 29px;
  padding: 0 9px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #eaf7ff;
  box-shadow: 2px 3px 0 rgba(21, 18, 15, .12);
  white-space: nowrap;
}

.ai-model-pill b,
.ai-model-pill em {
  color: #1684d4;
  font-style: normal;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
}

.ai-model-pill em {
  color: #15120f;
  font-size: 12px;
}

.ai-chat-card,
.ai-input-panel,
.ai-workbar,
.ai-history-drawer,
.ai-limit-card,
.ai-pay-hero,
.ai-plan-card,
.ai-pay-card,
.ai-submitted-card,
.ai-admin-gate,
.ai-admin-panel,
.ai-admin-stats {
  border: 2px solid #15120f;
  border-radius: 12px;
  background: rgba(255, 253, 244, .92);
  box-shadow: 4px 5px 0 rgba(78, 52, 23, .16);
}

.ai-workbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 12px;
  padding: 9px;
}

.ai-chat-page .ai-workbar {
  gap: 6px;
  margin: 0 0 6px;
  padding: 6px;
}

.ai-workbar button,
.ai-history-head button,
.ai-limit-close {
  min-height: 38px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fff8e8;
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
  box-shadow: 2px 3px 0 rgba(21, 18, 15, .14);
}

.ai-workbar button:first-child {
  background: #d9271f;
  color: #fff;
}

.ai-workbar button:disabled {
  color: #958c7c;
  background: #e8dfd1;
  box-shadow: none;
}

.ai-chat-page .ai-workbar button {
  min-height: 31px;
  font-size: 12px;
  box-shadow: 2px 2px 0 rgba(21, 18, 15, .12);
}

.ai-history-drawer {
  margin: 0 0 12px;
  padding: 13px;
}

.ai-history-head,
.ai-conversation-item,
.ai-user-item,
.ai-document-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.ai-history-head {
  margin: 0 0 10px;
}

.ai-history-head b {
  color: #15120f;
  font-size: 19px;
  font-weight: 1000;
}

.ai-history-head button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.ai-history-drawer h3 {
  margin: 12px 0 7px;
  color: #6d4c21;
  font-size: 13px;
  font-weight: 1000;
}

.ai-conversation-list {
  display: grid;
  gap: 9px;
}

.ai-conversation-item {
  padding: 9px;
  border: 2px solid #ead1a6;
  border-radius: 8px;
  background: #fffaf0;
}

.ai-conversation-item.active {
  border-color: #d9271f;
  background: #fff1ef;
}

.ai-conversation-item > button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.ai-conversation-item b,
.ai-conversation-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-conversation-item b {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-conversation-item span {
  margin-top: 3px;
  color: #716554;
  font-size: 11px;
  font-weight: 750;
}

.ai-conversation-actions {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 5px;
}

.ai-conversation-actions button {
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid #15120f;
  border-radius: 6px;
  background: #fffdf7;
  color: #15120f;
  font-size: 11px;
  font-weight: 900;
}

.ai-chat-card {
  display: grid;
  grid-template-rows: auto auto minmax(330px, 1fr) auto;
  min-height: min(60dvh, 520px);
  margin: 0 0 13px;
  padding: 10px 10px 15px;
}

.ai-chat-page .ai-chat-card {
  flex: 1 1 auto;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  margin-bottom: 6px;
  padding: 7px;
  overflow: hidden;
}

.ai-chat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 8px 9px;
  border-bottom: 2px solid #e3bd7b;
}

.ai-chat-page .ai-chat-card-head {
  min-height: 31px;
  padding: 0 5px 5px;
}

.ai-chat-page .ai-chat-card-head img {
  width: 24px;
  height: 24px;
}

.ai-chat-page .ai-chat-card-head b {
  min-width: 58px;
  padding: 3px 6px;
  font-size: 11px;
}

.ai-chat-card-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-chat-card-head img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.ai-chat-card-head b {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 4px 9px;
  border: 2px solid #2594e7;
  border-radius: 7px;
  background: #f2fbff;
  color: #178ee1;
  font-size: 12px;
  font-weight: 1000;
  text-align: center;
}

.ai-context-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 9px 4px 0;
  padding: 8px 10px;
  border: 2px dashed #d6aa6d;
  border-radius: 8px;
  background: #fff8e8;
  color: #6d4c21;
  font-size: 12px;
  font-weight: 850;
}

.ai-context-strip span {
  color: #15120f;
  font-weight: 1000;
}

.ai-context-strip b {
  color: #5b4630;
}

.ai-context-strip em {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid #168ee2;
  border-radius: 999px;
  color: #168ee2;
  font-style: normal;
  font-size: 11px;
  font-weight: 1000;
  background: #f2fbff;
}

.ai-chat-page .ai-context-strip {
  gap: 4px;
  margin: 5px 2px 0;
  padding: 5px 7px;
  font-size: 11px;
}

.ai-message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 13px 2px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ai-empty-chat {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: auto;
  padding: 18px 12px;
  text-align: center;
}

.ai-empty-chat b {
  color: #15120f;
  font-size: 19px;
  font-weight: 1000;
}

.ai-empty-chat p {
  max-width: 280px;
  margin: 0;
  color: #6b604f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.ai-empty-chat button {
  min-height: 40px;
  padding: 0 16px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #d9271f;
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .16);
}

.ai-message-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 8px;
}

.ai-message-row.user {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}

.ai-message-content {
  grid-column: 2;
  display: grid;
  justify-items: start;
  gap: 5px;
  min-width: 0;
}

.ai-message-row.user .ai-message-content {
  grid-column: 2;
  justify-self: end;
  justify-items: end;
}

.ai-message-row.user .ai-bubble {
  border-color: #d9271f;
  box-shadow: 3px 4px 0 rgba(217, 39, 31, .12);
}

.ai-user-mark {
  grid-column: 3;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 4px;
  border: 2px solid #15120f;
  border-radius: 50%;
  background: #fff7e8;
  color: #d9271f;
  font-size: 13px;
  font-weight: 1000;
}

.ai-bot-mark {
  width: 31px;
  height: 31px;
  margin-top: 2px;
  object-fit: contain;
}

.ai-bubble {
  max-width: 100%;
  padding: 11px 13px;
  border: 2px solid #15120f;
  border-radius: 9px;
  background: #fffdf7;
  color: #191613;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .14);
  overflow-wrap: anywhere;
}

.ai-copy-message {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #15120f;
  border-radius: 6px;
  background: #fff8e8;
  color: #5e5345;
  font-size: 11px;
  font-weight: 1000;
  box-shadow: 1px 2px 0 rgba(21, 18, 15, .1);
}

.ai-message-row.user .ai-copy-message {
  border-color: #d9271f;
  color: #d9271f;
}

.ai-copy-message:active {
  transform: translateY(1px);
  box-shadow: none;
}

.ai-markdown {
  font-weight: 650;
}

.ai-markdown a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 0;
  padding: 0 9px;
  border: 1px solid #15120f;
  border-radius: 7px;
  background: #fff8e8;
  color: #d9271f;
  font-weight: 1000;
  text-decoration: none;
  box-shadow: 1px 2px 0 rgba(21, 18, 15, .12);
}

.ai-markdown > :first-child {
  margin-top: 0;
}

.ai-markdown > :last-child {
  margin-bottom: 0;
}

.ai-markdown h1,
.ai-markdown h2,
.ai-markdown h3,
.ai-markdown h4 {
  margin: 12px 0 6px;
  color: #15120f;
  font-weight: 1000;
  line-height: 1.25;
}

.ai-markdown h1 {
  font-size: 19px;
}

.ai-markdown h2 {
  font-size: 17px;
}

.ai-markdown h3,
.ai-markdown h4 {
  font-size: 15px;
}

.ai-markdown p {
  margin: 0 0 9px;
}

.ai-markdown ul,
.ai-markdown ol {
  display: grid;
  gap: 5px;
  margin: 7px 0 10px;
  padding-left: 20px;
}

.ai-markdown li {
  padding-left: 2px;
}

.ai-markdown strong {
  color: #d9271f;
  font-weight: 1000;
}

.ai-markdown em {
  color: #6d4c21;
  font-style: normal;
  font-weight: 850;
}

.ai-markdown blockquote {
  margin: 8px 0;
  padding: 7px 9px;
  border-left: 4px solid #d9271f;
  background: #fff8e8;
  color: #5e5345;
}

.ai-markdown code {
  padding: 1px 4px;
  border: 1px solid #e3bd7b;
  border-radius: 5px;
  background: #fff8e8;
  color: #15120f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

.ai-markdown pre {
  margin: 9px 0;
  padding: 10px;
  overflow-x: auto;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #292521;
  color: #fffdf7;
}

.ai-markdown pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.ai-markdown a {
  color: #168ee2;
  font-weight: 1000;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.ai-bubble.typing {
  border-color: #168ee2;
  color: #2d3740;
}

.ai-bubble.typing span::after {
  content: "...";
  display: inline-block;
  width: 18px;
  animation: aiDots 1.2s steps(4, end) infinite;
  overflow: hidden;
  vertical-align: bottom;
}

@keyframes aiDots {
  0% { width: 0; }
  100% { width: 18px; }
}

.ai-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 0 8px;
}

.ai-quick-actions button {
  min-height: 30px;
  padding: 0 8px;
  border: 2px solid #d6aa6d;
  border-radius: 8px;
  background: #fff8e8;
  color: #513f27;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
}

.ai-input-panel {
  padding: 10px;
}

.ai-chat-page .ai-input-panel {
  padding: 7px;
}

.ai-auth-card {
  display: grid;
  gap: 13px;
  margin: 14px 10px 10px;
  padding: 16px;
}

.ai-auth-head b {
  display: block;
  color: #15120f;
  font-size: 24px;
  font-weight: 1000;
}

.ai-auth-head p {
  margin: 6px 0 0;
  color: #5e5345;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.ai-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-auth-tabs button {
  min-height: 38px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fff8e8;
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
  box-shadow: 2px 3px 0 rgba(21, 18, 15, .14);
}

.ai-auth-tabs button.active {
  background: #15120f;
  color: #fffdf7;
}

.ai-auth-form {
  display: grid;
  gap: 10px;
}

.ai-auth-form label {
  display: grid;
  gap: 6px;
}

.ai-auth-form label span {
  color: #5e5345;
  font-size: 12px;
  font-weight: 1000;
}

.ai-auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid #15120f;
  border-radius: 10px;
  background: #fffdf7;
  color: #15120f;
  font-size: 15px;
  font-weight: 850;
  outline: 0;
}

.ai-auth-form button[type="submit"] {
  min-height: 50px;
  border: 2px solid #15120f;
  border-radius: 10px;
  background: #d9271f;
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .18);
}

.ai-auth-form button[type="submit"]:disabled {
  background: #958c7c;
  box-shadow: none;
}

.ai-attachment-panel {
  display: grid;
  gap: 8px;
  margin: 0 0 9px;
}

.ai-chat-page .ai-attachment-panel {
  gap: 6px;
  margin-bottom: 6px;
}

.ai-chat-page .ai-attachment-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-attachment-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 104px)) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ai-attach-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fff8e8;
  color: #15120f;
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 2px 3px 0 rgba(21, 18, 15, .15);
  cursor: pointer;
}

.ai-attach-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.ai-attach-button.disabled {
  color: #958c7c;
  background: #e8dfd1;
  box-shadow: none;
  cursor: not-allowed;
}

.ai-attach-button.disabled input {
  cursor: not-allowed;
}

.ai-attachment-actions em {
  min-width: 0;
  color: #7b705f;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.ai-chat-page .ai-attachment-actions em {
  display: none;
}

.ai-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ai-attachment-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) 22px;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 4px 4px 7px;
  border: 2px solid #d6aa6d;
  border-radius: 8px;
  background: #fffdf7;
  color: #15120f;
  box-shadow: 2px 2px 0 rgba(21, 18, 15, .08);
}

.ai-attachment-chip b {
  margin-right: 5px;
  color: #d9271f;
  font-size: 11px;
  font-weight: 1000;
}

.ai-attachment-chip em {
  overflow: hidden;
  color: #5e5345;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-attachment-chip button {
  width: 22px;
  height: 22px;
  margin-left: 5px;
  border: 1px solid #15120f;
  border-radius: 6px;
  background: #15120f;
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
}

.ai-quota-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  margin: 0 0 9px;
  padding: 0 13px;
  border: 2px solid #d9271f;
  border-radius: 8px;
  background: #fff0ee;
  color: #d9271f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-limit-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(21, 18, 15, .28);
}

.ai-limit-card {
  width: min(100%, 360px);
  padding: 17px;
}

.ai-limit-card h2 {
  margin: 0 0 6px;
  color: #15120f;
  font-size: 24px;
  font-weight: 1000;
}

.ai-limit-card p {
  margin: 0 0 13px;
  color: #5e5345;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.ai-limit-list {
  display: grid;
  gap: 9px;
}

.ai-limit-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  padding: 9px;
  border: 2px solid #ead1a6;
  border-radius: 8px;
  background: #fff8e8;
}

.ai-limit-list span {
  min-width: 0;
}

.ai-limit-list b,
.ai-limit-list em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-limit-list b {
  color: #15120f;
  font-size: 13px;
  font-weight: 1000;
}

.ai-limit-list em {
  color: #766a59;
  font-style: normal;
  font-size: 11px;
  font-weight: 750;
}

.ai-limit-list button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #15120f;
  border-radius: 6px;
  background: #fffdf7;
  color: #15120f;
  font-size: 11px;
  font-weight: 1000;
}

.ai-limit-list button:first-of-type {
  background: #15120f;
  color: #fff;
}

.ai-limit-close {
  width: 100%;
  margin-top: 12px;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 11px;
}

.ai-chat-form input {
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 2px solid #15120f;
  border-radius: 10px;
  background: #fffdf7;
  color: #15120f;
  font-size: 15px;
  font-weight: 750;
  outline: 0;
}

.ai-chat-page .ai-chat-form input,
.ai-chat-page .ai-chat-form button {
  height: 46px;
}

.ai-chat-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 52px;
  border: 2px solid #15120f;
  border-radius: 10px;
  background: #d9271f;
  color: #fff;
  font-size: 17px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .18);
}

.ai-chat-form button.busy {
  background: #292521;
}

.ai-chat-form button:disabled,
.ai-chat-form input:disabled {
  color: #958c7c;
  background: #e8dfd1;
  box-shadow: none;
  cursor: not-allowed;
}

.ai-page-note {
  margin: 9px 0 0;
  color: #7b705f;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.ai-pay-hero {
  padding: 18px;
  margin: 0 0 14px;
}

.ai-pay-hero b {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 7px;
  background: #e9f6ff;
  color: #168ee2;
  font-size: 12px;
  font-weight: 1000;
}

.ai-pay-hero h2,
.ai-submitted-card h2,
.ai-admin-gate h2,
.ai-admin-panel h2 {
  margin: 10px 0 6px;
  color: #15120f;
  font-size: 25px;
  font-weight: 1000;
  line-height: 1.15;
}

.ai-pay-hero p,
.ai-submitted-card p,
.ai-admin-gate p,
.ai-pay-card p {
  margin: 0;
  color: #5e5345;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.ai-plan-list {
  display: grid;
  gap: 13px;
}

.ai-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 128px;
  padding: 17px;
  text-align: left;
}

.ai-plan-card span {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ai-plan-card em {
  color: #15120f;
  font-style: normal;
  font-size: 22px;
  font-weight: 1000;
}

.ai-plan-card strong {
  color: #d9271f;
  font-size: 31px;
  font-weight: 1000;
  line-height: 1;
}

.ai-plan-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: #5e5345;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.ai-plan-card > b {
  justify-self: end;
  min-width: 86px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #15120f;
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
  text-align: center;
}

.ai-plan-card.monthly {
  background: linear-gradient(145deg, #fffdf4, #ecf7ff);
}

.ai-pay-card,
.ai-submitted-card,
.ai-admin-gate {
  padding: 18px;
}

.ai-pay-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.ai-pay-title span {
  color: #15120f;
  font-size: 25px;
  font-weight: 1000;
}

.ai-pay-title strong {
  color: #d9271f;
  font-size: 33px;
  font-weight: 1000;
}

.ai-qr-box {
  display: grid;
  place-items: center;
  margin: 17px auto;
  padding: 12px;
  border: 2px dashed #d6aa6d;
  border-radius: 10px;
  background: #fff8e8;
}

.ai-qr-box img {
  display: block;
  width: min(100%, 255px);
  height: auto;
  border-radius: 8px;
}

.ai-payment-form {
  display: grid;
  gap: 11px;
}

.ai-payment-form label,
.ai-admin-gate {
  display: grid;
  gap: 9px;
}

.ai-payment-form label span {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-payment-form input,
.ai-admin-gate input {
  width: 100%;
  min-height: 47px;
  padding: 9px 11px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fffdf7;
  color: #15120f;
  font-size: 15px;
  font-weight: 750;
}

.ai-payment-form button,
.ai-submitted-card button,
.ai-admin-gate button,
.ai-admin-actions button,
.ai-payment-item button {
  min-height: 46px;
  padding: 0 15px;
  border: 2px solid #15120f;
  border-radius: 9px;
  background: #d9271f;
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .16);
}

.ai-submitted-card {
  display: grid;
  justify-items: center;
  text-align: center;
}

.ai-submit-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 2px solid #15120f;
  border-radius: 50%;
  background: #e9f9ef;
  color: #1d9c52;
  font-size: 35px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .14);
}

.ai-submitted-card button {
  width: 100%;
  margin-top: 16px;
}

.ai-admin-hidden-entry {
  display: block;
  width: fit-content;
  min-height: 28px;
  margin: -2px auto 12px;
  padding: 0 11px;
  border: 1px dashed rgba(21, 18, 15, .28);
  border-radius: 999px;
  color: rgba(21, 18, 15, .52);
  font-size: 12px;
  font-weight: 850;
  background: rgba(255, 253, 244, .46);
}

.ai-admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  margin: 0 0 13px;
}

.ai-admin-stats div {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 4px;
  border: 2px solid #ead1a6;
  border-radius: 8px;
  background: #fff8e8;
}

.ai-admin-stats b {
  color: #d9271f;
  font-size: 29px;
  font-weight: 1000;
  line-height: 1;
}

.ai-admin-stats span {
  color: #504941;
  font-size: 12px;
  font-weight: 900;
}

.ai-admin-panel {
  padding: 15px;
  margin: 0 0 13px;
}

.ai-admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 11px;
}

.ai-admin-panel h2 {
  margin: 0;
  font-size: 21px;
}

.ai-admin-panel-head span {
  color: #168ee2;
  font-size: 12px;
  font-weight: 1000;
  text-align: right;
}

.ai-document-intro {
  display: grid;
  gap: 5px;
  margin: 0 0 12px;
  padding: 10px 11px;
  border: 2px dashed #edbe75;
  border-radius: 9px;
  background: #fff8e8;
}

.ai-document-intro b,
.ai-document-intro span {
  color: #15120f;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
}

.ai-document-intro span {
  color: #6d6253;
  font-size: 12px;
  font-weight: 700;
}

.ai-admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ai-admin-actions button {
  background: #15120f;
  font-size: 14px;
}

.ai-payment-list {
  display: grid;
  gap: 10px;
}

.ai-user-list,
.ai-document-list,
.ai-question-list {
  display: grid;
  gap: 10px;
}

.ai-user-item,
.ai-document-item,
.ai-question-item {
  padding: 11px;
  border: 2px solid #ead1a6;
  border-radius: 9px;
  background: #fff8e8;
}

.ai-user-item div,
.ai-document-item div {
  min-width: 0;
}

.ai-user-item b,
.ai-user-item span,
.ai-user-item em,
.ai-document-item b,
.ai-document-item span,
.ai-document-item em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-user-item b,
.ai-document-item b {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-user-item span,
.ai-document-item span {
  margin-top: 3px;
  color: #6d6253;
  font-size: 12px;
  font-weight: 650;
}

.ai-user-item em {
  margin-top: 4px;
  color: #9b4b13;
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.ai-user-item.registered {
  border-color: #f1a545;
  background: #fff5da;
}

.ai-user-item.guest b {
  color: #716553;
}

.ai-document-item em {
  margin-top: 4px;
  color: #d9271f;
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
  white-space: normal;
}

.ai-user-item strong,
.ai-document-item strong {
  color: #168ee2;
  font-size: 13px;
  font-weight: 1000;
  text-align: right;
}

.ai-document-item.failed strong {
  color: #d9271f;
}

.ai-document-item.ready strong {
  color: #1d9c52;
}

.ai-document-item button {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #15120f;
  border-radius: 6px;
  background: #fffdf7;
  color: #15120f;
  font-size: 12px;
  font-weight: 1000;
}

.ai-document-buttons {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-document-buttons button:last-child {
  background: #15120f;
  color: #fff;
}

.ai-document-form {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
}

.ai-document-form label {
  display: grid;
  gap: 7px;
}

.ai-document-form label span {
  color: #15120f;
  font-size: 13px;
  font-weight: 1000;
}

.ai-document-form input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fffdf7;
  color: #15120f;
  font-size: 13px;
  font-weight: 750;
}

.ai-document-button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ai-document-form button,
.ai-admin-bottom-actions button {
  min-height: 42px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #d9271f;
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
  box-shadow: 3px 4px 0 rgba(21, 18, 15, .16);
}

.ai-document-form button:disabled,
.ai-admin-bottom-actions button:disabled {
  color: #81776a;
  background: #e8dfd1;
  box-shadow: none;
}

.ai-document-button-row button:last-child,
.ai-admin-bottom-actions button:last-child {
  background: #15120f;
}

.ai-document-button-row button:disabled:last-child {
  color: #81776a;
  background: #e8dfd1;
}

.ai-upload-status {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(21, 18, 15, .18);
  border-radius: 8px;
  background: #fffdf7;
  color: #6d6253;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.ai-document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
}

.ai-document-toolbar span {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-document-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #15120f;
  border-radius: 7px;
  background: #fffdf7;
  color: #15120f;
  font-size: 12px;
  font-weight: 1000;
}

.ai-question-filter {
  margin: 0 0 10px;
}

.ai-question-filter input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid #15120f;
  border-radius: 8px;
  background: #fffdf7;
  color: #15120f;
  font-size: 13px;
  font-weight: 800;
}

.ai-question-item {
  display: grid;
  gap: 8px;
}

.ai-question-meta {
  display: grid;
  gap: 3px;
}

.ai-question-meta b,
.ai-question-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-question-meta b {
  color: #15120f;
  font-size: 14px;
  font-weight: 1000;
}

.ai-question-meta span {
  color: #6d6253;
  font-size: 12px;
  font-weight: 750;
}

.ai-question-block {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(21, 18, 15, .16);
  border-radius: 8px;
  background: #fffdf7;
}

.ai-question-block.answer {
  background: #fff4df;
}

.ai-question-block strong {
  color: #d9271f;
  font-size: 12px;
  font-weight: 1000;
}

.ai-question-block p {
  max-height: 7.5em;
  margin: 0;
  overflow-y: auto;
  color: #191613;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
}

.ai-question-block p.muted {
  color: #8b806f;
}

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

.ai-question-actions button {
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #15120f;
  border-radius: 7px;
  background: #15120f;
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
}

.ai-question-actions button:disabled {
  color: #81776a;
  background: #e8dfd1;
}

.ai-payment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 11px;
  border: 2px solid #ead1a6;
  border-radius: 9px;
  background: #fff8e8;
}

.ai-payment-item div {
  min-width: 0;
}

.ai-payment-item b,
.ai-payment-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-payment-item b {
  color: #15120f;
  font-size: 15px;
  font-weight: 1000;
}

.ai-payment-item span {
  color: #6d6253;
  font-size: 12px;
  font-weight: 650;
}

.ai-payment-item strong {
  color: #d9271f;
  font-size: 13px;
  font-weight: 1000;
  text-align: right;
}

.ai-payment-item.approved strong {
  color: #1d9c52;
}

.ai-payment-item.rejected strong {
  color: #827767;
}

.ai-payment-item button {
  grid-column: span 1;
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
  box-shadow: none;
}

.ai-payment-item button:last-child {
  background: #15120f;
}

@media (max-width: 370px) {
  .design-ai-card {
    grid-template-columns: 76px minmax(0, 1fr) 66px;
  }

  .design-app-icon.ai {
    width: 74px;
  }

  .design-ai-badge {
    right: 88px;
    top: 20px;
    min-width: 36px;
    height: 24px;
    font-size: 13px;
  }

  .ai-page-header {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .ai-title-block h1 {
    font-size: 26px;
  }

  .ai-model-pill {
    min-width: 57px;
    padding: 0 6px;
    gap: 4px;
  }

  .ai-model-pill em {
    max-width: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ai-chat-card {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .ai-quick-actions {
    grid-template-columns: 1fr;
  }

  .ai-conversation-item,
  .ai-user-item,
  .ai-document-item {
    grid-template-columns: 1fr;
  }

  .ai-document-button-row,
  .ai-document-buttons {
    grid-template-columns: 1fr;
  }

  .ai-conversation-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-limit-list article {
    grid-template-columns: 1fr;
  }

  .ai-attachment-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-attachment-actions em {
    grid-column: 1 / -1;
  }

  .ai-attachment-chip {
    width: 100%;
  }

  .ai-chat-form {
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 8px;
  }

  .ai-chat-form button {
    font-size: 15px;
  }

  .ai-plan-card {
    grid-template-columns: 1fr;
  }

  .ai-plan-card > b {
    justify-self: stretch;
  }
}
/* Activity hub: root preheat page for choosing 630 or July. */
.phone-shell.activity-hub-shell {
  width: min(100vw, 430px) !important;
  max-width: 100vw !important;
  min-height: 100dvh;
  margin: 0 auto !important;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom)) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(221, 176, 105, .22) 0 18px, transparent 18px 36px) 0 0 / 36px 36px,
    linear-gradient(180deg, #fff8e9 0%, #f6e6c8 100%);
  color: #17130f;
}

.phone-shell.activity-hub-shell::before,
.phone-shell.activity-hub-shell::after {
  display: none;
}

.activity-hub-page {
  min-height: calc(100dvh - 36px);
  display: grid;
  align-content: start;
  gap: 14px;
}

.activity-hub-hero {
  position: relative;
  padding: 16px 8px 8px;
}

.activity-admin-link {
  position: absolute;
  right: 0;
  top: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 3px solid #17130f;
  border-radius: 7px;
  background: #fff4d7;
  color: #17130f;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 3px 4px 0 rgba(52, 34, 13, .18);
}

.activity-hub-hero span {
  display: inline-block;
  padding: 5px 9px;
  border: 3px solid #17130f;
  border-radius: 7px;
  background: #f47a18;
  color: #fff8e9;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 3px 4px 0 rgba(52, 34, 13, .18);
}

.activity-hub-hero h1 {
  margin: 15px 0 8px;
  color: #17130f;
  font-size: 38px;
  line-height: 1;
  font-weight: 1000;
  letter-spacing: 0;
}

.activity-hub-hero h1 b {
  color: #e83027;
}

.activity-hub-hero p {
  max-width: 330px;
  margin: 0;
  color: #6a4927;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 850;
}

.activity-hub-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 4px solid #17130f;
  border-radius: 10px;
  background: #fff9ec;
  box-shadow: 6px 7px 0 rgba(52, 34, 13, .2);
}

.activity-july-card {
  background:
    linear-gradient(135deg, rgba(232, 48, 39, .1), transparent 34%),
    #fff9ec;
}

.activity-june-card {
  background:
    linear-gradient(135deg, rgba(244, 122, 24, .12), transparent 36%),
    #fff9ec;
}

.activity-hub-card.is-history {
  background:
    linear-gradient(135deg, rgba(23, 19, 15, .08), transparent 36%),
    #fff9ec;
}

.activity-hub-card.is-history .activity-card-copy span {
  color: #6a4927;
}

.activity-card-copy span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 8px;
  border: 2px solid #17130f;
  border-radius: 6px;
  background: #fff0cf;
  color: #e83027;
  font-size: 12px;
  font-weight: 950;
}

.activity-card-copy h2 {
  margin: 0 0 6px;
  color: #17130f;
  font-size: 25px;
  line-height: 1.1;
  font-weight: 1000;
}

.activity-card-copy p {
  margin: 0;
  color: #604322;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 820;
}

.activity-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.activity-card-stats span,
.activity-card-stats b,
.activity-card-stats small {
  display: block;
  min-width: 0;
  text-align: center;
}

.activity-card-stats span {
  overflow: hidden;
}

.activity-card-stats b {
  padding: 9px 6px 2px;
  border: 3px solid #17130f;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff4d7;
  color: #d3211b;
  font-size: 23px;
  line-height: 1;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card-stats small {
  padding: 6px;
  border: 3px solid #17130f;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff4d7;
  color: #6a4927;
  font-size: 12px;
  font-weight: 900;
}

.activity-hub-card > button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border: 4px solid #17130f;
  border-radius: 8px;
  background: #17130f;
  color: #fff8e9;
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 4px 5px 0 rgba(52, 34, 13, .22);
}

.activity-july-card > button {
  background: #e83027;
}

.activity-july-card.is-coming-soon > button {
  background: #f47a18;
}

.activity-hub-card > button strong {
  font-size: 25px;
  line-height: 1;
}

.activity-hub-card em {
  color: #8a5c24;
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 850;
}

.activity-hub-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 0 0;
}

.activity-hub-footer button {
  min-height: 42px;
  padding: 0 4px;
  border: 3px solid #17130f;
  border-radius: 7px;
  background: #fff4d7;
  color: #17130f;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 3px 4px 0 rgba(52, 34, 13, .16);
}

@media (max-width: 370px) {
  .activity-hub-hero h1 {
    font-size: 33px;
  }

  .activity-card-copy h2 {
    font-size: 22px;
  }
}

/* July Monopoly local branch homepage. The first pass uses the supplied full-page
   visual as the source of truth, with click hotspots layered on top. */
.phone-shell.design-home-shell.july-home-shell {
  width: min(100vw, 430px) !important;
  max-width: 100vw !important;
  min-height: 100dvh;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden;
  background: #f9f1e2;
}

.phone-shell.design-home-shell.july-home-shell::before,
.phone-shell.design-home-shell.july-home-shell::after {
  display: none;
}

.july-monopoly-home {
  min-height: 100dvh;
  background: #f9f1e2;
}

.july-monopoly-board {
  position: relative;
  width: 100%;
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  background: #f9f1e2;
  box-shadow: 0 0 0 1px rgba(122, 82, 40, .08);
}

.july-monopoly-reference {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.july-home-hotspot {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0);
}

.july-home-nav {
  position: absolute;
  z-index: 4;
  top: calc(34 / 1672 * 100%);
  min-width: calc(118 / 941 * 100%);
  height: calc(58 / 1672 * 100%);
  padding: 0 10px;
  border: 3px solid #17130f;
  border-radius: 8px;
  background: #fff4d7;
  color: #17130f;
  font-size: clamp(12px, 3.4vw, 15px);
  font-weight: 950;
  line-height: 1;
  box-shadow: 3px 4px 0 rgba(52, 34, 13, .22);
}

.july-home-nav.back {
  left: calc(34 / 941 * 100%);
}

.july-home-nav.admin {
  right: calc(34 / 941 * 100%);
  background: #17130f;
  color: #fff8e9;
}

.july-home-hotspot:focus-visible {
  outline: 3px solid rgba(232, 48, 39, .72);
  outline-offset: 3px;
}

.july-home-hotspot.upload {
  left: calc(118 / 941 * 100%);
  top: calc(1434 / 1672 * 100%);
  width: calc(364 / 941 * 100%);
  height: calc(126 / 1672 * 100%);
}

.july-home-hotspot.claim {
  left: calc(503 / 941 * 100%);
  top: calc(1434 / 1672 * 100%);
  width: calc(339 / 941 * 100%);
  height: calc(126 / 1672 * 100%);
}

.july-home-hotspot.library {
  left: calc(328 / 941 * 100%);
  top: calc(1556 / 1672 * 100%);
  width: calc(342 / 941 * 100%);
  height: calc(102 / 1672 * 100%);
}

.phone-shell.july-upload-shell {
  width: min(100vw, 430px) !important;
  max-width: 100vw !important;
  min-height: 100dvh;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden;
  background: #f9f1e2;
}

.phone-shell.july-upload-shell::before,
.phone-shell.july-upload-shell::after {
  display: none;
}

.july-upload-page {
  min-height: 100dvh;
  background: #f9f1e2;
}

.july-upload-board {
  position: relative;
  width: 100%;
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  background: #f9f1e2;
  box-shadow: 0 0 0 1px rgba(122, 82, 40, .08);
}

.july-upload-reference {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.july-upload-back,
.july-upload-form,
.july-upload-control,
.july-upload-submit,
.july-upload-feedback {
  position: absolute;
  z-index: 2;
}

.july-upload-back {
  z-index: 4;
  left: calc(54 / 941 * 100%);
  top: calc(108 / 1672 * 100%);
  width: calc(78 / 941 * 100%);
  height: calc(78 / 1672 * 100%);
  border-radius: 999px;
  background: transparent;
}

.july-upload-form {
  inset: 0;
}

.july-upload-control input,
.july-upload-control textarea {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f1a13;
  font-weight: 800;
  letter-spacing: 0;
  -webkit-appearance: none;
  appearance: none;
}

.july-upload-control input::placeholder,
.july-upload-control textarea::placeholder {
  color: transparent;
}

.july-upload-control input:focus-visible,
.july-upload-control textarea:focus-visible,
.july-upload-back:focus-visible,
.july-upload-submit:focus-visible,
.july-upload-photo-zone:focus-visible {
  outline: 3px solid rgba(232, 48, 39, .68);
  outline-offset: 3px;
}

.july-upload-work-id {
  left: calc(164 / 941 * 100%);
  top: calc(344 / 1672 * 100%);
  width: calc(612 / 941 * 100%);
  height: calc(78 / 1672 * 100%);
}

.july-upload-work-id input {
  padding: 0 calc(28 / 941 * 100vw);
  font-size: clamp(15px, 4.2vw, 19px);
}

.july-upload-photo-zone {
  left: calc(166 / 941 * 100%);
  top: calc(874 / 1672 * 100%);
  width: calc(608 / 941 * 100%);
  height: calc(185 / 1672 * 100%);
  display: block;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0);
}

.july-upload-photo-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 2px dashed rgba(213, 137, 65, .7);
  background: rgba(255, 248, 230, .72);
}

.july-upload-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
}

.july-upload-photo-preview span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border: 2px solid #17130f;
  border-radius: 6px;
  background: #fff3cf;
  color: #17130f;
  font-size: 12px;
  font-weight: 900;
}

.july-upload-note {
  left: calc(164 / 941 * 100%);
  top: calc(1256 / 1672 * 100%);
  width: calc(612 / 941 * 100%);
  height: calc(132 / 1672 * 100%);
}

.july-upload-note textarea {
  resize: none;
  padding: 14px 18px;
  color: #3d3022;
  font-size: clamp(14px, 3.9vw, 18px);
  line-height: 1.45;
}

.july-upload-submit {
  left: calc(164 / 941 * 100%);
  top: calc(1448 / 1672 * 100%);
  width: calc(613 / 941 * 100%);
  height: calc(102 / 1672 * 100%);
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0);
}

.july-upload-submit span {
  padding: 7px 12px;
  border: 3px solid #17130f;
  border-radius: 8px;
  background: #f02f24;
  color: #fff9e9;
  font-size: clamp(16px, 4.8vw, 22px);
  font-weight: 900;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .26);
}

.july-upload-submit:disabled {
  cursor: wait;
}

.july-upload-feedback {
  left: calc(150 / 941 * 100%);
  top: calc(1554 / 1672 * 100%);
  width: calc(640 / 941 * 100%);
  min-height: 24px;
  margin: 0;
  color: #d62d24;
  font-size: clamp(12px, 3.4vw, 15px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 1px 0 #fff7df;
}

.phone-shell.july-claim-shell {
  width: min(100vw, 430px) !important;
  max-width: 100vw !important;
  min-height: 100dvh;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden;
  background: #f9f1e2;
}

.phone-shell.july-claim-shell::before,
.phone-shell.july-claim-shell::after {
  display: none;
}

.july-claim-page {
  min-height: 100dvh;
  background: #f9f1e2;
}

.july-claim-board {
  position: relative;
  width: 100%;
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  background: #f9f1e2;
  box-shadow: 0 0 0 1px rgba(122, 82, 40, .08);
}

.july-claim-reference {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.july-claim-back,
.july-claim-form,
.july-claim-control,
.july-claim-stepper,
.july-claim-submit,
.july-claim-feedback {
  position: absolute;
  z-index: 2;
}

.july-claim-back {
  z-index: 4;
  left: calc(18 / 941 * 100%);
  top: calc(70 / 1672 * 100%);
  width: calc(100 / 941 * 100%);
  height: calc(96 / 1672 * 100%);
  border-radius: 12px;
  background: transparent;
}

.july-claim-form {
  inset: 0;
}

.july-claim-control input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f1a13;
  font-size: clamp(17px, 4.7vw, 22px);
  font-weight: 900;
  letter-spacing: 0;
  -webkit-appearance: none;
  appearance: none;
}

.july-claim-control input::placeholder {
  color: transparent;
}

.july-claim-control input:focus-visible,
.july-claim-back:focus-visible,
.july-claim-minus:focus-visible,
.july-claim-plus:focus-visible,
.july-claim-submit:focus-visible {
  outline: 3px solid rgba(232, 48, 39, .68);
  outline-offset: 3px;
}

.july-claim-work-id {
  left: calc(140 / 941 * 100%);
  top: calc(420 / 1672 * 100%);
  width: calc(665 / 941 * 100%);
  height: calc(95 / 1672 * 100%);
}

.july-claim-work-id input {
  padding: 0 28px;
}

.july-claim-stepper {
  left: calc(235 / 941 * 100%);
  top: calc(1144 / 1672 * 100%);
  width: calc(470 / 941 * 100%);
  height: calc(111 / 1672 * 100%);
  display: grid;
  grid-template-columns: calc(120 / 470 * 100%) 1fr calc(135 / 470 * 100%);
  align-items: stretch;
}

.july-claim-minus,
.july-claim-plus {
  border-radius: 8px;
  background: transparent;
}

.july-claim-stepper output {
  display: grid;
  place-items: center;
  margin: 4px 0 12px;
  background: rgba(255, 246, 224, .96);
  color: #17130f;
  font-size: clamp(26px, 9.4vw, 42px);
  font-weight: 950;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .9);
}

.july-claim-submit {
  left: calc(90 / 941 * 100%);
  top: calc(1505 / 1672 * 100%);
  width: calc(752 / 941 * 100%);
  height: calc(143 / 1672 * 100%);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0);
}

.july-claim-submit:disabled {
  cursor: wait;
}

.july-claim-feedback {
  left: calc(110 / 941 * 100%);
  top: calc(1462 / 1672 * 100%);
  width: calc(720 / 941 * 100%);
  min-height: 28px;
  margin: 0;
  color: #d62d24;
  font-size: clamp(12px, 3.3vw, 15px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 1px 0 #fff7df;
}

.phone-shell.july-success-shell {
  width: min(100vw, 430px) !important;
  max-width: 100vw !important;
  min-height: 100dvh;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden;
  background: #f9f1e2;
}

.phone-shell.july-success-shell::before,
.phone-shell.july-success-shell::after {
  display: none;
}

.july-success-page {
  min-height: 100dvh;
  background: #f9f1e2;
}

.july-success-board {
  position: relative;
  width: 100%;
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  background: #f9f1e2;
  box-shadow: 0 0 0 1px rgba(122, 82, 40, .08);
}

.july-success-reference {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.july-success-hotspot {
  position: absolute;
  z-index: 2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0);
}

.july-success-hotspot:focus-visible {
  outline: 3px solid rgba(232, 48, 39, .68);
  outline-offset: 3px;
}

.july-success-hotspot.continue {
  left: calc(155 / 941 * 100%);
  top: calc(1370 / 1672 * 100%);
  width: calc(645 / 941 * 100%);
  height: calc(118 / 1672 * 100%);
}

.july-success-hotspot.home {
  left: calc(155 / 941 * 100%);
  top: calc(1498 / 1672 * 100%);
  width: calc(640 / 941 * 100%);
  height: calc(102 / 1672 * 100%);
}

.phone-shell.july-admin-shell {
  width: min(100vw, 430px) !important;
  max-width: 100vw !important;
  min-height: 100dvh;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden;
  background: #f9f1e2;
}

.phone-shell.july-admin-shell::before,
.phone-shell.july-admin-shell::after {
  display: none;
}

.july-admin-page {
  min-height: 100dvh;
  background: #f9f1e2;
}

.july-admin-board {
  position: relative;
  width: 100%;
  aspect-ratio: 853 / 1844;
  overflow: hidden;
  background: #f9f1e2;
  box-shadow: 0 0 0 1px rgba(122, 82, 40, .08);
}

.july-admin-reference {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.july-admin-hotspot {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0);
}

.july-admin-hotspot:focus-visible {
  outline: 3px solid rgba(232, 48, 39, .72);
  outline-offset: 3px;
}

.july-admin-hotspot.csv {
  left: calc(40 / 853 * 100%);
  top: calc(635 / 1844 * 100%);
  width: calc(378 / 853 * 100%);
  height: calc(200 / 1844 * 100%);
}

.july-admin-hotspot.selection {
  left: calc(420 / 853 * 100%);
  top: calc(635 / 1844 * 100%);
  width: calc(390 / 853 * 100%);
  height: calc(200 / 1844 * 100%);
}

.july-admin-hotspot.jiulongpo {
  left: calc(40 / 853 * 100%);
  top: calc(855 / 1844 * 100%);
  width: calc(378 / 853 * 100%);
  height: calc(200 / 1844 * 100%);
}

.july-admin-hotspot.preview {
  left: calc(420 / 853 * 100%);
  top: calc(855 / 1844 * 100%);
  width: calc(390 / 853 * 100%);
  height: calc(200 / 1844 * 100%);
}

.july-admin-modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  align-items: end;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(47, 32, 14, .22);
}

.july-admin-modal.compact {
  align-items: center;
}

.july-admin-modal-card {
  position: relative;
  max-height: 76dvh;
  overflow: auto;
  padding: 18px;
  border: 4px solid #17130f;
  border-radius: 10px;
  background: #fff8e8;
  box-shadow: 6px 7px 0 rgba(58, 38, 15, .26);
  color: #17130f;
}

.july-admin-modal-card h2 {
  margin: 0 34px 8px 0;
  color: #17130f;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 950;
}

.july-admin-modal-card p,
.july-admin-modal-card small {
  display: block;
  margin: 0 0 12px;
  color: #6a4927;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.july-admin-modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 34px;
  height: 34px;
  border: 3px solid #17130f;
  border-radius: 6px;
  background: #f37b19;
  color: #fff8e8;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.july-admin-form {
  display: grid;
  gap: 12px;
}

.july-admin-form.inline {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.july-admin-form label {
  display: grid;
  gap: 6px;
  color: #312417;
  font-size: 13px;
  font-weight: 900;
}

.july-admin-form input,
.july-admin-form textarea,
.july-admin-modal-card > input {
  width: 100%;
  border: 3px solid #17130f;
  border-radius: 7px;
  background: #fffdf5;
  color: #17130f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.july-admin-form input,
.july-admin-modal-card > input {
  min-height: 42px;
  padding: 0 10px;
}

.july-admin-form textarea {
  min-height: 140px;
  padding: 10px;
  resize: vertical;
}

.july-admin-form button,
.july-admin-modal-card > button {
  min-height: 44px;
  border: 3px solid #17130f;
  border-radius: 7px;
  background: #e83027;
  color: #fff8e8;
  font-size: 16px;
  font-weight: 950;
  box-shadow: 3px 4px 0 rgba(58, 38, 15, .2);
}

.july-admin-loading {
  padding: 8px 10px;
  border: 2px solid #d6b98d;
  border-radius: 7px;
  background: #fff1ce;
}

.july-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.july-preview-stats b {
  padding: 8px 6px;
  border: 2px solid #17130f;
  border-radius: 7px;
  background: #fff1ce;
  color: #17130f;
  font-size: 12px;
  text-align: center;
}

.july-preview-table-wrap {
  overflow-x: auto;
  border: 2px solid #8f7044;
  border-radius: 7px;
}

.july-preview-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fffdf5;
  color: #17130f;
  font-size: 12px;
  font-weight: 850;
}

.july-preview-table th,
.july-preview-table td {
  padding: 8px 7px;
  border-bottom: 1px solid #dfc99d;
  text-align: center;
  white-space: nowrap;
}

.july-preview-table th {
  background: #fff0ce;
}

.july-preview-table tr.is-abnormal td {
  background: #ffe4dc;
}

.july-preview-table tr.is-manual td {
  background: #fff1ce;
}

.july-preview-table td small {
  display: block;
  margin: 4px 0 0;
  color: #8a5c24;
  font-size: 10px;
  font-weight: 900;
}

.july-override-control {
  display: inline-grid;
  grid-template-columns: 58px auto auto;
  align-items: center;
  gap: 4px;
}

.july-override-control input {
  width: 58px;
  height: 32px;
  padding: 0 4px;
  border: 2px solid #17130f;
  border-radius: 5px;
  background: #fffdf5;
  color: #17130f;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.july-override-control button,
.july-danger-zone button {
  min-height: 32px;
  padding: 0 8px;
  border: 2px solid #17130f;
  border-radius: 5px;
  background: #17130f;
  color: #fff8e8;
  font-size: 12px;
  font-weight: 950;
}

.july-override-control button[data-july-override-reset] {
  background: #fff4d7;
  color: #17130f;
}

.july-danger-zone {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px;
  border: 2px dashed #b71917;
  border-radius: 7px;
  background: #fff1ce;
}

.july-danger-zone button {
  width: 100%;
  background: #b71917;
}

.july-danger-zone small {
  margin: 0;
  color: #6a4927;
}

.phone-shell.design-july-shell {
  width: min(100vw, 430px);
  min-height: 100dvh;
  padding: 18px 18px max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 10%, rgba(245, 134, 24, .14), transparent 26%),
    linear-gradient(180deg, #fbf2df 0%, #f4dfbd 100%);
}

.phone-shell.design-july-shell::before,
.phone-shell.design-july-shell::after {
  display: none;
}

.july-placeholder-page {
  min-height: calc(100dvh - 40px);
  display: grid;
  align-content: start;
  gap: 18px;
}

.july-placeholder-back {
  justify-self: start;
  padding: 10px 14px;
  border: 3px solid #17130f;
  border-radius: 8px;
  background: #fff2d6;
  box-shadow: 3px 4px 0 rgba(38, 23, 8, .2);
  color: #1f1b16;
  font-weight: 900;
}

.july-placeholder-card {
  padding: 28px 22px;
  border: 4px solid #17130f;
  border-radius: 12px;
  background: #fff8e9;
  box-shadow: 5px 6px 0 rgba(38, 23, 8, .22);
}

.july-placeholder-card b {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  background: #e83027;
  color: #fff;
  font-size: 14px;
}

.july-placeholder-card h1 {
  margin: 18px 0 10px;
  color: #17130f;
  font-size: 30px;
  line-height: 1.08;
}

.july-placeholder-card p,
.july-placeholder-card span {
  display: block;
  margin: 0;
  color: #5f4225;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 700;
}

.july-placeholder-card span {
  margin-top: 18px;
  color: #98641f;
  font-size: 14px;
}
