
:root{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#f7f7f8;background:#08080b;color-scheme:dark;
  --panel:#111116;--line:#25252d;--muted:#8b8b98;--accent:#8b5cf6;--accent2:#6d5dfc;
}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:
radial-gradient(circle at 15% -10%,rgba(139,92,246,.16),transparent 28%),
linear-gradient(180deg,#08080b,#050507 75%)}
button,input,textarea,label{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.intro-screen{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;flex-direction:column;overflow:hidden;background:radial-gradient(circle at 50% 42%,rgba(139,92,246,.22),transparent 34%),#08080b;animation:introFadeIn .35s ease both}
.intro-screen.is-leaving{animation:introFadeOut .42s ease both;pointer-events:none}
.intro-screen img{width:min(62vw,360px);height:min(62vw,360px);object-fit:contain;filter:drop-shadow(0 24px 65px rgba(139,92,246,.28));animation:introLogo 1.25s cubic-bezier(.2,.8,.2,1) both}
.intro-name{margin-top:18px;font-size:clamp(32px,7vw,64px);font-weight:1000;letter-spacing:-.045em}
.intro-tagline{margin-top:7px;color:#9185b9;font-size:11px;font-weight:900;letter-spacing:.28em}
.intro-skip{position:absolute;top:max(18px,env(safe-area-inset-top));right:18px;border:1px solid #30303a;border-radius:999px;background:#14141a;color:#aaaab5;padding:9px 13px;font-size:10px;font-weight:800}
@keyframes introLogo{0%{opacity:0;transform:scale(.72)}70%{opacity:1;transform:scale(1.035)}100%{opacity:1;transform:scale(1)}}
@keyframes introFadeIn{from{opacity:0}to{opacity:1}}@keyframes introFadeOut{from{opacity:1}to{opacity:0;visibility:hidden}}
@media(prefers-reduced-motion:reduce){.intro-screen,.intro-screen img{animation:none}.intro-screen.is-leaving{animation:none;display:none}}
.mode-screen{min-height:100vh;display:grid;place-items:center;padding:28px}
.mode-wrap{width:min(1050px,100%)}
.hero-brand{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.logo-box,.logo-mini{display:grid;place-items:center;background:#f4f4f4;color:#09090a;font-weight:1000}
.logo-box{width:58px;height:58px;border-radius:18px;font-size:22px}
.logo-mini{width:36px;height:36px;border-radius:11px;font-size:14px}
.eyebrow{font-size:9px;letter-spacing:.2em;color:#747480}
h1{font-size:38px;margin:2px 0 0}.hero-copy{color:#94949f;margin:0 0 26px}
.mode-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.mode-card{position:relative;text-align:left;border:1px solid #2a2a32;background:linear-gradient(180deg,#121218,#0e0e13);color:#fff;border-radius:26px;padding:24px;min-height:440px;box-shadow:0 30px 80px #0005;transition:.18s transform,.18s border-color}
.mode-card:hover{transform:translateY(-4px);border-color:#4b4b58}
.mode-card.artist{background:
radial-gradient(circle at 100% 0%,rgba(139,92,246,.18),transparent 38%),
linear-gradient(180deg,#131219,#0d0d12)}
.mode-icon{width:50px;height:50px;border:1px solid #35353f;border-radius:15px;display:grid;place-items:center;font-size:26px;margin-bottom:18px}
.mode-tag{font-size:10px;letter-spacing:.16em;color:#81818d;font-weight:800}
.mode-card h2{font-size:28px;margin:7px 0 7px}.mode-card p{color:#9898a4;line-height:1.5}
.mode-card ul{padding-left:18px;color:#c4c4cb;line-height:1.8;font-size:14px}
.mode-cta{position:absolute;left:24px;bottom:24px;font-weight:900}.artist .mode-cta{color:#b9a3ff}
.coming{text-align:center;color:#666674;font-size:11px;margin-top:18px}
.topbar{height:72px;display:flex;justify-content:space-between;align-items:center;padding:0 16px;border-bottom:1px solid #1e1e24;background:#09090dcc;backdrop-filter:blur(16px);position:sticky;top:0;z-index:20}
.brandline{display:flex;align-items:center;gap:10px}.titleline{font-weight:900;font-size:19px}.titleline span{font-size:9px;letter-spacing:.12em;background:var(--accent);padding:4px 7px;border-radius:999px;margin-left:5px}
.top-actions{display:flex;gap:7px}.icon-btn{width:38px;height:38px;border:1px solid #2b2b33;border-radius:11px;background:#131318;color:#fff;font-size:20px}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;min-height:calc(100vh - 72px)}
.workspace{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;min-width:0}
.stage-shell{width:min(860px,100%);height:min(76vh,850px)}
.stage{position:relative;width:100%;height:100%;overflow:hidden;border:1px solid #2c2c34;border-radius:28px;background:#101015;box-shadow:0 35px 90px #0007;touch-action:none}
.body-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:none;pointer-events:none;user-select:none}
#tattooCanvas{position:absolute;inset:0;width:100%;height:100%;display:none;touch-action:none}
.empty-state{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;color:#777784;cursor:pointer;-webkit-tap-highlight-color:transparent}.empty-icon{font-size:58px;color:#8b5cf6}.empty-state h2{margin:9px 0 5px;color:#e9e9ee}.empty-state p{margin:0}
.stage.has-body-photo .empty-state{display:none!important}
.stage.has-body-photo .body-img{display:block!important}
.stage-photo-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
#brushCursor{position:absolute;border:1px solid white;border-radius:50%;pointer-events:none;display:none;transform:translate(-50%,-50%)}
.quickbar{width:min(860px,100%);display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:10px}
.quick,.upload,.secondary{border:1px solid #303039;background:#17171d;color:#f5f5f5;border-radius:12px;padding:11px 12px;font-weight:800;text-align:center}
.quick.primary,.upload.primary{background:#f4f4f5;color:#09090a;border-color:#f4f4f5}
.sidebar{border-left:1px solid #202027;background:#09090c;padding:13px;overflow:auto}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:17px;padding:13px;margin-bottom:10px}
.section-title{font-size:10px;letter-spacing:.14em;color:#767682;font-weight:900;margin-bottom:10px}
.upload{display:block;width:100%;margin-top:7px}
.tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tool{height:66px;border:1px solid #2b2b34;background:#17171c;color:white;border-radius:12px;font-size:22px;display:flex;flex-direction:column;align-items:center;justify-content:center}.tool span{font-size:10px;color:#8f8f99;margin-top:4px}.tool.active{background:var(--accent);border-color:#9f7aea}.tool.active span{color:white}
.control{margin:10px 0}.row{display:flex;justify-content:space-between;font-size:11px;color:#92929d;margin-bottom:6px}.row span{color:#dedee4}
input[type=range]{width:100%;accent-color:var(--accent)}
.wide{width:100%;margin-top:7px}.text-input,.text-area{width:100%;border:1px solid #2c2c35;background:#17171d;color:#fff;border-radius:11px;padding:10px 11px;margin-top:7px;outline:none}.text-area{min-height:92px;resize:vertical}.measure-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.save-btn{width:100%;border:0;border-radius:14px;padding:15px;background:linear-gradient(90deg,var(--accent),var(--accent2));color:#fff;font-weight:1000;letter-spacing:.04em}
.variant-list,.favorite-list{display:grid;gap:7px}.variant-item,.favorite-item{border:1px solid #292932;background:#16161c;border-radius:11px;padding:9px;font-size:11px;color:#aaa;display:flex;justify-content:space-between;gap:8px}.variant-item button,.favorite-item button{border:0;background:#24242c;color:#fff;border-radius:8px;padding:5px 7px}
@media(max-width:900px){
 .mode-grid{grid-template-columns:1fr}
 .layout{grid-template-columns:1fr}
 .workspace{padding:8px}.stage-shell{height:58vh}
 .sidebar{border-left:0;border-top:1px solid #202027}
 .quickbar{grid-template-columns:1fr 1fr}
}
@media(max-width:500px){
 .mode-screen{padding:16px}.mode-card{min-height:390px;padding:19px}.mode-card h2{font-size:24px}.mode-cta{left:19px;bottom:19px}
 .topbar{height:64px;padding:0 9px}.stage{border-radius:19px}.stage-shell{height:54vh}
}

.logo-box-img,
.logo-mini-img{
  padding:0 !important;
  overflow:hidden;
  background:#0a0a0a !important;
}
.logo-box-img img,
.logo-mini-img img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

#overlayCanvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.layer-list,.project-list,.library-list{display:grid;gap:7px;max-height:190px;overflow:auto}
.layer-item,.project-item,.library-item{display:flex;align-items:center;justify-content:space-between;gap:7px;border:1px solid #292932;background:#16161c;border-radius:11px;padding:9px;font-size:11px}
.layer-item.active{border-color:#8b5cf6;background:#1d1828}
.layer-item .mini-actions{display:flex;gap:4px}
.layer-item button,.project-item button,.library-item button{border:0;background:#25252d;color:#fff;border-radius:8px;padding:5px 7px}
.layer-actions{display:grid;grid-template-columns:44px 44px 1fr 1fr;gap:6px}
.danger-lite{color:#ff9ea8!important}
.info-box{border:1px solid #292932;background:#141419;border-radius:10px;padding:9px;color:#888894;font-size:11px;line-height:1.4;margin-top:7px}
.modal{position:fixed;inset:0;background:#000b;z-index:100;display:grid;place-items:center;padding:20px}
.modal-card{width:min(980px,100%);background:#101015;border:1px solid #30303a;border-radius:22px;padding:14px}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.compare-grid img{width:100%;border-radius:15px;border:1px solid #292932;background:#09090c}
select.text-input{appearance:auto}
@media(max-width:700px){.compare-grid{grid-template-columns:1fr}.layer-actions{grid-template-columns:1fr 1fr}}


/* V6.1 – Photo/editor area anchored directly below the header */
.workspace{
  justify-content:flex-start !important;
  padding-top:10px !important;
}
.stage-shell{
  margin-top:0 !important;
}
@media(max-width:900px){
  .workspace{
    justify-content:flex-start !important;
    padding-top:6px !important;
  }
}

/* V7.1: floating controls only — original V6.2 layout untouched */
.floating-tools{
  position:fixed;
  left:50%;
  bottom:12px;
  transform:translateX(-50%);
  z-index:90;
  display:flex;
  gap:6px;
  padding:6px;
  background:rgba(12,12,16,.94);
  border:1px solid #2b2b34;
  border-radius:16px;
  backdrop-filter:blur(16px);
  box-shadow:0 18px 55px rgba(0,0,0,.55);
}
.float-tool{
  min-width:78px;
  height:48px;
  border:0;
  border-radius:11px;
  background:transparent;
  color:#9898a4;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  font-size:18px;
}
.float-tool span{font-size:8px}
.float-tool.active{background:#f4f4f5;color:#09090a}

.floating-panel{
  position:fixed;
  left:50%;
  bottom:72px;
  transform:translateX(-50%);
  width:min(600px,calc(100% - 20px));
  z-index:89;
  background:rgba(15,15,20,.98);
  border:1px solid #2b2b34;
  border-radius:16px;
  padding:11px;
  box-shadow:0 18px 55px rgba(0,0,0,.55);
}
.float-panel-section{display:none}
.float-panel-section.active{display:block}
.float-row{margin:8px 0}
.float-row label{display:flex;justify-content:space-between;font-size:10px;color:#94949f;margin-bottom:4px}
.float-row input[type=range]{width:100%}
.float-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.float-actions.four{grid-template-columns:repeat(4,1fr)}
@media(max-width:700px){
  .floating-tools{bottom:7px;width:calc(100% - 14px);justify-content:space-between}
  .float-tool{min-width:0;flex:1;height:46px}
  .floating-panel{bottom:64px;max-height:36vh;overflow:auto}
  .float-actions.four{grid-template-columns:1fr 1fr}
}


/* V7.2 — Werkzeugleiste unter dem Bild, ohne Überlagerung */
.tools-below-image{
  width:min(860px,100%);
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.tools-below-image .floating-tools,
.tools-below-image .floating-panel{
  position:static !important;
  left:auto !important;
  bottom:auto !important;
  transform:none !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
}

.tools-below-image .floating-tools{
  display:flex;
  justify-content:center;
}

.tools-below-image .floating-panel{
  max-height:none !important;
  overflow:visible !important;
}

@media(max-width:700px){
  .tools-below-image{
    width:100%;
    margin-top:8px;
  }

  .tools-below-image .floating-tools{
    width:100% !important;
  }

  .tools-below-image .floating-panel{
    width:100% !important;
    max-height:none !important;
    overflow:visible !important;
  }
}


/* V10 — 300 built-in tattoo templates */
.template-library-head{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-bottom:9px}
.template-library-head .section-title{margin:0 0 2px}
.template-library-head strong{font-size:15px}
.template-library-head>span{font-size:9px;color:#777783}
.template-filter-row{display:grid;grid-template-columns:1fr auto;gap:6px;margin:7px 0}
.template-filter-row .text-input{margin:0;min-width:0}
.template-filter-row .secondary{white-space:nowrap;padding:9px}
.template-filter-row .secondary.active{background:#f4f4f5;color:#09090a}
.template-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  max-height:430px;
  overflow:auto;
  padding:1px;
}
.template-card{
  min-width:0;
  border:1px solid #292932;
  background:#15151b;
  border-radius:12px;
  overflow:hidden;
}
.template-image{
  display:grid;
  place-items:center;
  width:100%;
  height:112px;
  border:0;
  background:#f3f1ec;
  cursor:pointer;
  padding:8px;
}
.template-image img{width:100%;height:100%;object-fit:contain}
.template-meta{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:7px}
.template-meta>div{min-width:0}
.template-meta strong,.template-meta span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.template-meta strong{font-size:9px}
.template-meta span{font-size:8px;color:#777783;margin-top:2px}
.template-star{border:0;background:transparent;color:#777783;font-size:17px;cursor:pointer;padding:3px}
.template-star.active{color:#f1d36d}
.library-divider{display:flex;align-items:center;gap:8px;margin:12px 0 8px;color:#686874;font-size:8px;font-weight:900;letter-spacing:.13em}
.library-divider:before,.library-divider:after{content:"";height:1px;background:#292932;flex:1}
@media(max-width:880px){
  .template-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-height:none}
}
@media(max-width:520px){
  .template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .template-filter-row{grid-template-columns:1fr}
}

/* V11 flash library */
.template-library-panel .template-library-head strong{letter-spacing:.01em}
.template-image{background:#f6f4ef}
.template-image img{filter:contrast(1.08)}


/* V12.1 — Artist Pro Dock */
.pro-dock-title{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:8px 10px 2px;
}
.pro-dock-title span{color:#a78bfa;font-size:8px;font-weight:1000;letter-spacing:.18em}
.pro-dock-title strong{color:#898994;font-size:9px}
.realism-presets{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:8px}
.realism-preset{
  border:1px solid #303039;background:#17171d;color:#bbbcc5;border-radius:10px;
  padding:8px 6px;font-size:9px;font-weight:900
}
.realism-preset.active{border-color:#8b5cf6;background:#261e3b;color:#fff}
.pro-tip{
  margin-top:8px;padding:8px 9px;border-radius:10px;background:#15151a;
  border:1px solid #292932;color:#777783;font-size:9px;line-height:1.35
}
.measure-inline .text-input{margin-top:2px}
.measure-inline .info-box{margin-top:6px;padding:7px 8px;font-size:9px}
.compact-select-row .text-input{margin-top:3px;padding:8px 9px}

/* Source controls stay in the DOM, but the Artist edits only from the Pro Dock. */
.artist-active .artist-edit-source{display:none!important}

@media(min-width:901px){
  .artist-active .layout{height:calc(100dvh - 72px);min-height:0;overflow:hidden}
  .artist-active .workspace{
    height:calc(100dvh - 72px);min-height:0;
    display:grid;grid-template-columns:minmax(0,1fr) 304px;grid-template-rows:minmax(0,1fr);
    align-items:stretch;gap:10px;padding:10px!important;overflow:hidden
  }
  .artist-active .stage-shell{
    width:100%;height:100%;max-width:860px;min-width:0;min-height:0;justify-self:center
  }
  .artist-active .stage{border-radius:22px}
  .artist-active .tools-below-image{
    width:304px;height:100%;min-height:0;margin:0;gap:6px;padding:5px;
    align-self:stretch;border:1px solid #24242d;border-radius:18px;background:#0e0e13;overflow:hidden
  }
  .artist-active .floating-tools{
    display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));
    gap:3px;padding:4px;flex:0 0 auto
  }
  .artist-active .float-tool{
    min-width:0;width:100%;height:47px;padding:3px;font-size:16px
  }
  .artist-active .float-tool span{font-size:7px}
  .artist-active .floating-panel{
    min-height:0;padding:9px!important;overflow:hidden!important;flex:1 1 auto
  }
  .artist-active .float-row{margin:7px 0}
  .artist-active .float-actions{gap:5px}
  .artist-active .float-actions .secondary{padding:8px 6px;font-size:9px}
  .artist-active .layer-list{max-height:calc(100dvh - 270px)}
  .artist-active .sidebar{height:calc(100dvh - 72px);overflow:auto}
}

@media(max-width:900px){
  .artist-active .layout{display:block;min-height:0}
  .artist-active .workspace{
    height:calc(100dvh - 64px);min-height:520px;
    display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;
    gap:6px;padding:6px!important;align-items:stretch;overflow:hidden;background:#08080b
  }
  .artist-active .stage-shell{
    width:100%;height:100%!important;min-height:0;max-height:none
  }
  .artist-active .stage{border-radius:18px}
  .artist-active .tools-below-image{
    width:100%;margin:0;gap:4px;padding:4px;
    border:1px solid #24242d;border-radius:15px;background:#0e0e13
  }
  .artist-active .pro-dock-title{display:none!important}
  .artist-active .floating-tools{
    display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:3px
  }
  .artist-active .float-tool{
    min-width:0;height:40px;padding:2px;font-size:14px
  }
  .artist-active .float-tool span{font-size:6.5px}
  .artist-active .floating-panel{
    padding:7px!important;max-height:none!important;overflow:hidden!important
  }
  .artist-active .float-row{margin:4px 0}
  .artist-active .float-row label{font-size:8px;margin-bottom:2px}
  .artist-active .float-actions .secondary{padding:7px 5px;font-size:8px}
  .artist-active .realism-presets{
    grid-template-columns:repeat(4,1fr);gap:3px;margin-bottom:4px
  }
  .artist-active .realism-preset{padding:6px 2px;font-size:7px}
  .artist-active .pro-tip{display:none}
  .artist-active .compact-select-row{
    display:grid;grid-template-columns:72px 1fr;align-items:center;gap:5px
  }
  .artist-active .compact-select-row label{margin:0}
  .artist-active .compact-select-row .text-input{margin:0;padding:6px;font-size:8px}
  .artist-active .layer-list{max-height:92px}
  .artist-active .sidebar{border-top:1px solid #202027}
}

@media(max-width:520px){
  .artist-active .workspace{min-height:500px}
  .artist-active .floating-panel{padding:6px!important}
  .artist-active .float-row input[type=range]{height:14px}
  .artist-active .measure-inline{
    display:grid;grid-template-columns:100px 1fr;gap:5px;align-items:center
  }
  .artist-active .measure-inline .text-input,
  .artist-active .measure-inline .info-box{margin:0}
}

/* V12.2 quick delete */
.quick-delete-actions{margin-top:7px}
.image-delete-row{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:7px}
.image-delete-row .secondary{padding:8px 6px;font-size:9px}
@media(max-width:900px){.artist-active .quick-delete-actions .secondary{padding:6px 4px;font-size:7.5px}}


/* V12.4 — Tattoo Pen Studio */
.artist-pen-studio{
  border:1px solid #292932;
  background:#111116;
  border-radius:14px;
  padding:5px;
  margin:1px 0 2px;
}
.artist-pen-toolbar{
  display:flex;
  align-items:center;
  gap:4px;
  min-width:0;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scrollbar-width:none;
}
.artist-pen-toolbar::-webkit-scrollbar{display:none}
.pen-tool{
  flex:0 0 49px;
  height:48px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:1px;
  padding:3px;
  border:1px solid #303039;
  border-radius:10px;
  background:#19191f;
  color:#b1b1bb;
  cursor:pointer;
  touch-action:manipulation;
}
.pen-tool.compact{flex-basis:38px}
.pen-tool .pen-icon{
  display:block;
  font-size:19px;
  line-height:1;
  font-weight:700;
}
.pen-tool small{
  display:block;
  font-size:6.5px;
  font-weight:900;
  letter-spacing:.02em;
}
.pen-tool.active{
  background:#f2f2f4;
  border-color:#f2f2f4;
  color:#09090b;
}
.pen-divider{
  flex:0 0 1px;
  height:33px;
  background:#34343d;
  margin:0 2px;
}
.artist-pen-settings{
  display:grid;
  grid-template-columns:minmax(82px,1fr) minmax(82px,1fr) auto auto;
  gap:6px;
  align-items:center;
  margin-top:5px;
}
.pen-setting{
  min-width:0;
  padding:5px 6px;
  border:1px solid #25252e;
  border-radius:9px;
  background:#15151b;
}
.pen-setting span{
  display:flex;
  justify-content:space-between;
  gap:5px;
  margin-bottom:2px;
  color:#8c8c96;
  font-size:7px;
  font-weight:800;
}
.pen-setting b{color:#d4d4da}
.pen-setting input{width:100%;margin:0}
.ink-swatches{
  display:flex;
  gap:4px;
  align-items:center;
}
.ink-swatch{
  width:24px;height:24px;
  flex:0 0 24px;
  padding:0;
  border:2px solid #393943;
  border-radius:50%;
  background:var(--ink);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.08);
}
.ink-swatch.active{
  border-color:#fff;
  box-shadow:0 0 0 2px #8b5cf6;
}
.pen-device-hint{
  white-space:nowrap;
  color:#686873;
  font-size:7px;
  font-weight:800;
}
#brushCursor.pen-cursor{
  border:1.5px solid rgba(255,255,255,.9)!important;
  box-shadow:0 0 0 1px rgba(0,0,0,.8),0 0 9px rgba(139,92,246,.45);
}

@media(min-width:901px){
  .artist-active .tools-below-image{
    width:326px!important;
  }
  .artist-active .workspace{
    grid-template-columns:minmax(0,1fr) 326px!important;
  }
  .artist-active .artist-pen-studio{flex:0 0 auto}
}

@media(max-width:900px){
  .artist-active .artist-pen-studio{
    padding:3px;
    border-radius:11px;
  }
  .artist-active .artist-pen-toolbar{gap:2px}
  .artist-active .pen-tool{
    flex-basis:42px;
    height:38px;
    border-radius:8px;
  }
  .artist-active .pen-tool.compact{flex-basis:32px}
  .artist-active .pen-tool .pen-icon{font-size:15px}
  .artist-active .pen-tool small{font-size:5.5px}
  .artist-active .pen-divider{height:27px}
  .artist-active .artist-pen-settings{
    grid-template-columns:1fr 1fr auto;
    gap:3px;
    margin-top:3px;
  }
  .artist-active .pen-setting{
    padding:3px 4px;
    border-radius:7px;
  }
  .artist-active .pen-setting span{font-size:6px}
  .artist-active .ink-swatch{
    width:19px;height:19px;flex-basis:19px;
  }
  .artist-active .pen-device-hint{display:none}
}

@media(max-width:520px){
  .artist-active .artist-pen-toolbar{
    padding-bottom:1px;
  }
  .artist-active .pen-tool{
    flex-basis:39px;
  }
  .artist-active .artist-pen-settings{
    grid-template-columns:minmax(70px,1fr) minmax(70px,1fr) auto;
  }
}

/* V8: body-photo source chooser and generated tattoo-placement templates */
.body-photo-modal-card{width:min(1000px,100%);max-height:min(92vh,920px);overflow:auto}
.body-source-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0 18px}
.body-source-action{display:grid;grid-template-columns:46px 1fr;grid-template-rows:auto auto;column-gap:11px;align-items:center;border:1px solid #303039;background:#17171d;color:#f5f5f5;border-radius:15px;padding:13px;cursor:pointer}
.body-source-action>span{grid-row:1/3;width:46px;height:46px;display:grid;place-items:center;border-radius:13px;background:#25252e;font-size:21px}
.body-source-action strong{font-size:13px}.body-source-action small{color:#8b8b98;font-size:10px}
.body-source-action.camera-action{background:linear-gradient(135deg,#8b5cf6,#6d5dfc);border-color:#a88cff}.body-source-action.camera-action>span{background:#ffffff20}
.body-source-action.camera-action small{color:#ded6ff}
.body-template-heading{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:10px}
.body-template-heading>div{display:flex;flex-direction:column;gap:3px}.body-template-heading span{color:#858590;font-size:10px}
.body-template-heading em{font-style:normal;font-size:9px;letter-spacing:.14em;color:#a78bfa;font-weight:900}
.body-template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.body-template-card{padding:0;overflow:hidden;border:1px solid #2d2d36;background:#16161c;color:#fff;border-radius:15px;text-align:left;transition:.16s transform,.16s border-color}
.body-template-card:hover{transform:translateY(-2px);border-color:#8b5cf6}
.body-template-card img{display:block;width:100%;aspect-ratio:4/5;object-fit:cover;background:#222228}
.body-template-card>span{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px}
.body-template-card strong{font-size:11px}.body-template-card small{font-size:9px;color:#8d8d98}
button.empty-state{width:100%;border:0;background:transparent}
@media(max-width:620px){
 .body-photo-modal-card{padding:11px;max-height:94vh}
 .body-source-actions{grid-template-columns:1fr;gap:7px;margin-bottom:14px}
 .body-template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .body-template-card>span{display:block;padding:8px}
 .body-template-card strong,.body-template-card small{display:block}
 .body-template-card small{margin-top:2px}
}

/* V8.2 Auto Placement */
.auto-placement-box{margin-top:10px;padding:11px;border:1px solid #34303f;border-radius:14px;background:linear-gradient(145deg,#17141f,#111116)}
.auto-placement-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:7px}
.auto-placement-head>div{display:flex;flex-direction:column;gap:2px}.auto-placement-head span{font-size:8px;letter-spacing:.16em;color:#a78bfa;font-weight:900}.auto-placement-head strong{font-size:12px}
.auto-placement-head em{font-style:normal;font-size:8px;letter-spacing:.1em;color:#7f7f8c;border:1px solid #34343e;border-radius:999px;padding:5px 7px}
.auto-placement-head em.ready{color:#d8ccff;border-color:#7656ca;background:#281e3d}
.auto-clip-toggle{display:flex;align-items:center;gap:9px;margin:9px 0;padding:9px;border:1px solid #2c2c35;border-radius:11px;background:#15151b;cursor:pointer}
.auto-clip-toggle input{width:18px;height:18px;accent-color:#8b5cf6;flex:0 0 auto}
.auto-clip-toggle span{display:flex;flex-direction:column;gap:2px}.auto-clip-toggle strong{font-size:10px}.auto-clip-toggle small{font-size:8px;color:#858590;line-height:1.35}
.auto-place-btn{padding:12px}.auto-place-btn:disabled{filter:grayscale(1);opacity:.42;cursor:not-allowed}
.auto-placement-hint{margin-top:7px;color:#8e8e9a;font-size:9px;line-height:1.4}
@media(max-width:500px){.auto-placement-box{padding:9px}.auto-placement-head strong{font-size:11px}.auto-clip-toggle{padding:8px}}

/* V8.2.1 — Mobile scroll fix for the expanded Auto Placement panel */
@media(max-width:700px){
  .tools-below-image .floating-panel{
    max-height:min(55dvh,560px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:stable;
    padding-bottom:calc(14px + env(safe-area-inset-bottom)) !important;
  }
  .tools-below-image .float-panel-section.active{
    min-height:min-content;
  }
  .auto-placement-box{
    touch-action:pan-y;
  }
}

/* V8.2.2 — Desktop/Laptop scroll for expanded tool content */
.tools-below-image .floating-panel{
  max-height:min(62vh,680px) !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior-y:contain;
  scrollbar-gutter:stable;
}
@media(max-width:700px){
  .tools-below-image .floating-panel{
    max-height:min(55dvh,560px) !important;
    -webkit-overflow-scrolling:touch;
  }
}

/* V8.3 — Native mobile tattoo gestures */
.touch-gesture-tip{display:none}
@media(pointer:coarse){
 .touch-gesture-tip{
  width:min(860px,100%);
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:5px 12px;
  margin:7px 0 0;
  padding:7px 10px;
  border:1px solid #292933;
  border-radius:11px;
  background:#121218;
  color:#9a9aa6;
  font-size:9px;
  font-weight:800;
  letter-spacing:.01em;
 }
 .touch-gesture-tip span:before{content:'•';color:#8b5cf6;margin-right:5px}
 #tattooCanvas{touch-action:none}
}


/* V8.4 — Desktop work zoom and phone editor recovery */
html,body,#app{max-width:100%;overflow-x:hidden}
.editor-screen,.layout,.workspace{max-width:100%}
.stage-shell{position:relative}
.body-img,#tattooCanvas,#overlayCanvas{
 transform-origin:50% 50%;
 will-change:transform;
}
.view-zoom-controls{
 position:absolute;
 right:12px;
 bottom:12px;
 z-index:12;
 display:grid;
 grid-template-columns:34px minmax(90px,130px) 48px 34px 34px 34px;
 align-items:center;
 gap:5px;
 padding:6px;
 border:1px solid #34343e;
 border-radius:14px;
 background:rgba(12,12,16,.92);
 box-shadow:0 14px 34px rgba(0,0,0,.42);
 backdrop-filter:blur(14px);
}
.view-zoom-controls input{width:100%;margin:0;accent-color:#8b5cf6}
.view-zoom-controls output{
 color:#d8d8df;
 font-size:9px;
 font-weight:900;
 text-align:center;
 font-variant-numeric:tabular-nums;
}
.view-zoom-button{
 width:34px;
 height:32px;
 display:grid;
 place-items:center;
 padding:0;
 border:1px solid #34343e;
 border-radius:9px;
 background:#1a1a21;
 color:#f5f5f7;
 font-size:16px;
 font-weight:900;
}
.view-zoom-button:hover:not(:disabled),.view-zoom-button.active{
 border-color:#9f7aea;
 background:#332451;
}
.view-zoom-button:disabled{opacity:.34;cursor:not-allowed}
.stage.view-pan-mode{cursor:grab}
.stage.view-panning{cursor:grabbing}
.stage.view-pan-mode #tattooCanvas{cursor:grab}

@media(max-width:900px){
 .view-zoom-controls{display:none}
 .topbar{
  width:100%;
  height:calc(58px + env(safe-area-inset-top));
  min-height:calc(58px + env(safe-area-inset-top));
  padding:
   env(safe-area-inset-top)
   max(9px,env(safe-area-inset-right))
   0
   max(9px,env(safe-area-inset-left));
  gap:6px;
  overflow:hidden;
 }
 .brandline{flex:1 1 auto;min-width:0;gap:6px}
 .brandline>div:last-child{min-width:0}
 .logo-mini{width:32px;height:32px;flex:0 0 32px}
 .eyebrow,.titleline{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .eyebrow{font-size:7px}
 .titleline{font-size:clamp(14px,4.2vw,18px)}
 .titleline span{display:none}
 .top-actions{flex:0 0 auto;gap:3px}
 .icon-btn{width:34px;height:34px;flex:0 0 34px;font-size:18px}
 .layout{min-height:calc(100dvh - 58px - env(safe-area-inset-top))}
 .artist-active .layout{display:block!important;min-height:0!important;overflow:visible!important}
 .artist-active .workspace{
  width:100%;
  height:auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column;
  align-items:center;
  gap:5px;
  overflow:visible!important;
 }
 .artist-active .stage-shell{
  width:100%;
  height:clamp(320px,58dvh,560px)!important;
  min-height:320px!important;
  max-height:560px!important;
  flex:0 0 auto;
 }
 .artist-active .tools-below-image{
  flex:0 0 auto;
  overflow:visible!important;
 }
 .artist-active .tools-below-image .floating-panel{
  max-height:none!important;
  overflow:visible!important;
  scrollbar-gutter:auto!important;
 }
 .touch-gesture-tip{
  flex:0 0 auto;
  margin-top:4px!important;
  padding:5px 8px!important;
 }
}

@media(max-width:520px){
 .topbar{
  height:calc(54px + env(safe-area-inset-top));
  min-height:calc(54px + env(safe-area-inset-top));
 }
 .logo-mini,.topbar .eyebrow{display:none}
 .brandline{gap:5px}
 .titleline{font-size:17px}
 .top-actions{gap:2px}
 .icon-btn{width:32px;height:32px;flex-basis:32px;font-size:17px}
 .layout{min-height:calc(100dvh - 54px - env(safe-area-inset-top))}
 .artist-active .stage-shell{
  height:clamp(300px,54dvh,500px)!important;
  min-height:300px!important;
 }
 .artist-active .stage{border-radius:16px}
}


/* V8.5 — Clear eraser naming and progressive mask fading */
.mask-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.float-actions .secondary.active{
 border-color:#9f7aea;
 background:#332451;
 color:#fff;
}
.fade-strength-row{display:none}
.fade-strength-row.active{display:block}
@media(max-width:520px){
 .mask-actions{gap:3px}
 .mask-actions .secondary{padding:7px 3px;font-size:7.5px}
}


/* V9.0 — Personal Tattoo Creator library */
.creator-library-link{
 display:block;margin:0 0 7px;padding:10px 11px;border:1px solid #7656ca;border-radius:11px;
 background:#241a38;color:#e1d8ff;text-decoration:none;text-align:center;font-size:9px;font-weight:900
}
.personal-template-card{border-color:#4a376d}
.personal-template-card .template-meta span{color:#aa91f5}
.library-empty-state{
 grid-column:1/-1;padding:18px 12px;border:1px dashed #34343e;border-radius:12px;
 color:#7f7f8b;text-align:center;font-size:9px;line-height:1.45
}
