:root {
  --bg: #0b0b0f; --panel: #15151c; --panel-2: #1d1d26; --line: #2a2a36; --ink: #f4f4f7; --soft: #9a9aab;
  --pink: #ff4fa3; --pink-2: #ff7bbd; --orange: #ff9a2e; --chrome: linear-gradient(135deg, #f6f6fb, #b9bccb 45%, #f6f6fb 60%, #8d90a3);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
body { min-height: 100vh; padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.pro { border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 12px; letter-spacing: .08em;
  background: var(--pink); color: #fff; box-shadow: 0 0 18px rgba(255,79,163,.45); }

.modes { display: flex; gap: 6px; margin: 4px 16px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.modes button { flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 999px; color: var(--soft); font-weight: 700; font-size: 14px; }
.modes button.on { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

#view { padding: 0 16px; }
.drop { border: 1.5px dashed #3a3a4a; border-radius: 22px; padding: 38px 18px; text-align: center; background: radial-gradient(120% 100% at 50% 0%, #1a1a24, var(--bg)); }
.drop h1 { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 6px; }
.drop p { color: var(--soft); margin: 0 0 18px; line-height: 1.45; }
.big { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 15px 26px; font-weight: 800; font-size: 16px;
  background: var(--pink); color: #fff; box-shadow: 0 8px 26px rgba(255,79,163,.35); }
.big.ghost { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.small { font-size: 13px; color: var(--soft); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }

.stage { position: relative; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.stage canvas, .stage img { display: block; width: 100%; height: auto; }
.stage .hint { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 999px; }
.stage .busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); font-weight: 700; }
.tools { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--soft); }
.chip.on { color: var(--ink); border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink) inset; }
.stamp { color: var(--orange); font-family: ui-monospace, "Courier New", monospace; font-weight: 700; }
input[type=date], input[type=text] { background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 9px 11px; font: inherit; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.grid .cell { position: relative; border-radius: 10px; overflow: hidden; background: #000; padding-bottom: 125%; height: 0; }
.grid .cell img, .grid .cell canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.strip-wrap { max-width: 260px; margin: 0 auto; }
.strip-wrap canvas { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.6); }

.styles { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11,11,15,0), rgba(11,11,15,.96) 30%); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.styles::-webkit-scrollbar { display: none; }
.st { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 10px 12px; min-width: 92px; text-align: center; }
.st b { display: block; font-size: 22px; line-height: 1; margin-bottom: 4px; }
.st span { font-size: 12px; font-weight: 700; color: var(--soft); }
.st.on { border-color: var(--pink); background: #22121b; }
.st.on span { color: var(--ink); }
.st i { display: block; font-style: normal; font-size: 9px; letter-spacing: .1em; color: var(--pink-2); margin-top: 3px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; z-index: 20; }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; width: 100%; background: var(--panel); border-top-left-radius: 26px; border-top-right-radius: 26px;
  padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); max-height: 90vh; overflow: auto; }
.x { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 28px; color: var(--soft); }
.price { font-size: 46px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 0; }
.chrome { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.perks { list-style: none; padding: 0; margin: 14px 0; }
.perks li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.perks li:last-child { border: 0; }
.full { width: 100%; justify-content: center; }
details summary { color: var(--soft); font-size: 13px; margin-top: 12px; cursor: pointer; }

#toast { position: fixed; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fff; color: #111;
  font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; z-index: 30; max-width: 90vw; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.counter { text-align: center; margin: 10px 0 0; }
