@font-face {
  font-family: "HfpLemon";
  src: url("./assets/fonts/Lemon-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "HfpSpace";
  src: url("./assets/fonts/SpaceMono-Regular.ttf") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --canvas-border: #36527D;
  --hfp-green: #2BD309;
  --left-a: #B56A28;
  --left-b: #F68C1E;
  --right-a: #95C8EC;
  --right-b: #1B6891;
  --canvas-top: #014C79;
  --canvas-bottom: #42B1D1;
  --left-width: 70px;
  --right-width: 110px;
  --safe-top: max(env(safe-area-inset-top), 0px);
  --safe-bottom: max(env(safe-area-inset-bottom), 0px);
}

html, body {
  width: 100%; height: 100%; margin: 0; overflow: hidden;
  background: #014C79;
  touch-action: none;
  overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Arial, sans-serif;
}
button, input, textarea { font: inherit; }
button { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }
img { user-select: none; -webkit-user-drag: none; }

.painting-screen { width:100vw; height:100dvh; min-height:100vh; position:relative; overflow:hidden; }

.canvas-stage { position:absolute; inset:0; display:grid; place-items:center; overflow:hidden; z-index:0; }
.blue-bg {
  position:absolute; inset:0;
  background: linear-gradient(180deg, var(--canvas-top) 0%, var(--canvas-bottom) 100%);
}
.paper-wrap {
  position:relative;
  width:min(74vw,460px);
  aspect-ratio:1/1;
  max-height:calc(100dvh - 198px);
  border-radius:20px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 10px 20px rgba(0,0,0,.30);
  touch-action:none;
}
#paintCanvas,.layer-host,.pattern-draft { position:absolute; inset:0; width:100%; height:100%; }
#paintCanvas { z-index:1; background:#fff; touch-action:none; }
.layer-host { z-index:3; pointer-events:none; }
.pattern-draft { z-index:4; pointer-events:none; }

.art-layer { position:absolute; z-index:1; transform-origin:center; pointer-events:none; touch-action:none; }
.layer-host.interactive .art-layer { pointer-events:auto; }
.art-layer.selected::after {
  content:""; position:absolute; inset:-5px;
  border:2px dashed var(--hfp-green); border-radius:10px;
  box-shadow:0 0 0 2px rgba(255,255,255,.80);
  pointer-events:none;
}
.art-layer img,.art-layer canvas { width:100%; height:100%; object-fit:contain; display:block; }
.art-layer.shape-square .layer-content { width:100%; height:100%; border-radius:7px; }
.art-layer.shape-star .layer-content { width:100%; height:100%; display:grid; place-items:center; line-height:1; }
.art-layer.text-layer .layer-content {
  width:100%; height:100%; display:grid; place-items:center; white-space:nowrap;
  text-shadow:0 1px 0 rgba(255,255,255,.7);
}

/* Header */
.header-float { position:absolute; z-index:50; top:0; left:0; right:0; padding-top:var(--safe-top); pointer-events:none; }
.header-row { display:flex; align-items:center; justify-content:space-between; padding:0 10px 8px; margin:0 8px; pointer-events:auto; }
.header-side { width:52px; display:grid; place-items:center; }
.header-center { flex:1; min-width:0; display:grid; place-items:center; }
.header-logo { width:100%; max-width:200px; height:40px; object-fit:contain; pointer-events:none; }
.header-hit { min-width:44px; min-height:44px; display:grid; place-items:center; border-radius:12px; }
.header-hit img { width:40px; height:40px; object-fit:contain; pointer-events:none; }
.header-hit.active { background:rgba(43,211,9,.18); border:2px solid var(--hfp-green); }

/* Universal slider */
.size-slider-float { position:absolute; left:0; right:0; top:calc(var(--safe-top) + 54px); z-index:45; display:flex; justify-content:center; pointer-events:none; }
.size-slider-row { width:100%; display:flex; align-items:center; justify-content:center; gap:6px; }
.size-indicator-box { width:26px; height:26px; display:grid; place-items:center; position:relative; }
.size-indicator-img { width:22px; height:22px; object-fit:contain; position:absolute; inset:2px; }
.size-indicator-img.asset-missing { display:none; }
.size-indicator-fallback { display:none; position:absolute; }
.size-indicator-fallback.show { display:block; }
.size-indicator-fallback.stroke.small { width:13px; height:2px; border-radius:2px; background:#D4E157; transform:rotate(-55deg); }
.size-indicator-fallback.stroke.large { width:20px; height:5px; border-radius:4px; background:#D4E157; transform:rotate(-55deg); }
.size-indicator-fallback.shape.small { width:8px; height:8px; border:2px solid #D4E157; border-radius:2px; }
.size-indicator-fallback.shape.large { width:18px; height:18px; border:3px solid #D4E157; border-radius:3px; }
.size-indicator-fallback.outline.small { width:9px; height:12px; border:2px solid #D4E157; border-radius:5px; }
.size-indicator-fallback.outline.large { width:18px; height:23px; border:3px solid #D4E157; border-radius:8px; }
.size-indicator-fallback.text.small::before,.size-indicator-fallback.text.large::before { content:"A"; color:#D4E157; font-weight:800; line-height:1; }
.size-indicator-fallback.text.small::before { font-size:11px; }
.size-indicator-fallback.text.large::before { font-size:22px; }

.size-slider-wrap { position:relative; width:50%; max-width:300px; min-width:250px; height:48px; pointer-events:auto; }
#sizeSlider { position:absolute; inset:0; width:100%; height:48px; margin:0; appearance:none; -webkit-appearance:none; background:transparent; cursor:pointer; --pct:50%; }
#sizeSlider::-webkit-slider-runnable-track {
  height:10px; border-radius:5px;
  background:linear-gradient(to right,#D4E157 0%,#D4E157 var(--pct),rgba(30,58,95,.28) var(--pct),rgba(30,58,95,.28) 100%);
}
#sizeSlider::-webkit-slider-thumb {
  width:44px; height:44px; appearance:none; -webkit-appearance:none;
  background:transparent url("./assets/images/Sun.png") center/contain no-repeat;
  border:0; margin-top:-17px;
}
#sizeSlider::-moz-range-track { height:10px; border-radius:5px; background:rgba(30,58,95,.28); }
#sizeSlider::-moz-range-progress { height:10px; border-radius:5px; background:#D4E157; }
#sizeSlider::-moz-range-thumb { width:44px; height:44px; border:0; background:transparent url("./assets/images/Sun.png") center/contain no-repeat; }

/* Bottom manipulation */
.sun-dock {
  position:absolute; left:0; right:0; bottom:calc(22px + var(--safe-bottom)); z-index:95;
  display:flex; justify-content:center; align-items:center; gap:16px; pointer-events:none;
}
.sun-btn { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; border:2px solid transparent; pointer-events:auto; }
.sun-btn img { width:40px; height:40px; object-fit:contain; pointer-events:none; }
.sun-btn.active { border-color:var(--hfp-green); background:rgba(43,211,9,.15); }
.sun-btn.dimmed { opacity:.42; }

/* Left drawer */
.left-drawer {
  position:absolute; left:0; top:50%; z-index:40; display:flex; align-items:center;
  transform:translate(calc(-1 * var(--left-width)),-50%);
  transition:transform 300ms cubic-bezier(.22,.61,.36,1);
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.22));
}
.left-drawer.open { transform:translate(0,-50%); }
.left-panel { position:relative; width:var(--left-width); max-height:calc(100dvh - 140px); border:2px solid #1E3A8A; border-left:0; border-radius:0 16px 16px 0; overflow:hidden; }
.left-gradient { position:absolute; inset:0; background:linear-gradient(90deg,var(--left-a),var(--left-b)); }
.left-tools { position:relative; z-index:1; max-height:calc(100dvh - 144px); overflow-y:auto; scrollbar-width:none; padding:10px 8px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.left-tools::-webkit-scrollbar { display:none; }
.tool-slot { width:100%; min-height:36px; border-radius:10px; display:grid; place-items:center; position:relative; flex:0 0 auto; }
.tool-slot.active { background:rgba(255,255,255,.35); }
.tool-slot>img { width:32px; height:32px; object-fit:contain; pointer-events:none; }
.tool-separator { width:60%; height:1px; margin:8px 0; background:rgba(30,58,138,.30); flex:0 0 auto; }
.fake-scrollbar { position:absolute; left:4px; top:18px; width:8px; height:58px; border-radius:4px; background:#FFCC00; z-index:2; opacity:.9; }
.color-slot { min-height:48px; }
.color-outer { width:44px; height:44px; border-radius:12px; padding:3px; margin-top:4px; background:rgba(255,255,255,.25); border:3px solid #fff; display:grid; place-items:center; box-shadow:0 3px 5px rgba(0,0,0,.25); }
.color-inner { width:100%; height:100%; border-radius:8px; border:2px solid rgba(255,255,255,.9); background:#36527D; }
.drawer-handle { flex:0 0 auto; display:flex; align-items:center; justify-content:center; }
.left-handle { width:25px; height:80px; margin-left:-2px; padding:0 5px; gap:3px; background:var(--left-b); border:2px solid #1E3A8A; border-left:0; border-radius:0 12px 12px 0; }
.left-handle span,.right-handle span { display:block; width:2px; height:36px; border-radius:1px; }
.left-handle span { background:#fff; }

/* Right drawer */
.right-drawer {
  position:absolute; right:0; top:50%; z-index:38;
  transform:translate(var(--right-width),-50%);
  transition:transform 300ms cubic-bezier(.22,.61,.36,1);
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.18));
}
.right-drawer.open { transform:translate(0,-50%); }
.right-inner { position:relative; }
.right-panel { width:var(--right-width); position:relative; z-index:0; border:2px solid #1E3A8A; border-right:0; border-radius:16px 0 0 16px; overflow:hidden; padding:10px 8px; }
.right-gradient { position:absolute; inset:0; background:linear-gradient(90deg,var(--right-a),var(--right-b)); }
.right-content { position:relative; z-index:1; display:flex; flex-direction:column; gap:10px; }
.right-handle { position:absolute; left:-23px; top:50%; margin-top:-40px; z-index:2; width:25px; height:80px; gap:2px; padding:0 3px; background:var(--right-a); border:2px solid #1E3A8A; border-right:0; border-radius:12px 0 0 12px; }
.right-handle span { background:var(--right-b); }

.shape-section,.outline-section { position:relative; min-height:112px; display:grid; place-items:center; }
.outline-section { min-height:124px; }
.shape-grid { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:center; justify-items:center; }
.shape-hit { width:46%; min-width:42px; aspect-ratio:1; max-height:44px; border:2px solid transparent; border-radius:12px; display:grid; place-items:center; }
.shape-hit.active { border-color:var(--hfp-green); background:rgba(43,211,9,.12); }
.shape.square { display:block; width:40px; height:40px; border-radius:6px; background:#FFCC00; border:2px solid #E6B800; }
.shape.circle { display:block; width:44px; height:44px; border-radius:50%; background:#34C759; border:2px solid #248A3D; }
.shape.star { display:block; font-size:34px; line-height:1; color:#FF3B30; }
.shape.triangle { width:0; height:0; border-left:22px solid transparent; border-right:22px solid transparent; border-bottom:38px solid #1E3A5F; }
.shape.large.square { width:56px; height:56px; }
.shape.large.star { font-size:50px; }

.mini-fab { position:absolute; right:0; z-index:4; width:32px; height:32px; border-radius:16px; background:rgba(255,255,255,.95); display:grid; place-items:center; font-size:30px; line-height:1; }
.mini-fab.add { top:0; color:#007AFF; }
.mini-fab.clear { bottom:0; color:#FF3B30; font-size:29px; }

.outline-list { width:100%; display:flex; flex-direction:column; align-items:center; gap:6px; padding:2px 0; }
.outline-choice { position:relative; width:78px; height:50px; border-radius:8px; }
.outline-choice.selected { outline:3px solid var(--hfp-green); outline-offset:1px; }
.outline-card { width:78px; height:50px; border-radius:8px; border:2px solid #C4C4CC; background:#fff; object-fit:cover; pointer-events:none; }

/* Modal common */
.modal-root { position:absolute; inset:0; z-index:500; pointer-events:none; }
.modal-root[hidden] { display:none !important; }
.modal-root.open { pointer-events:auto; }
.modal-backdrop {
  position:absolute; inset:0; width:100%; height:100%;
  background:rgba(0,0,0,.45);
  opacity:0; transition:opacity 170ms ease;
}
.modal-root.open>.modal-backdrop { opacity:1; }

/* ThemedToolModal replica: fade + centered orange face */
.themed-center { position:absolute; inset:0; display:grid; place-items:center; padding:20px; pointer-events:none; }
.themed-face {
  position:relative;
  width:min(calc(100vw - 40px),340px);
  max-height:min(78vh,520px);
  border:3px solid var(--canvas-border);
  border-radius:22px;
  overflow:visible;
  box-shadow:0 16px 34px rgba(0,0,0,.28);
  transform:scale(.97);
  opacity:0;
  transition:opacity 170ms ease,transform 170ms ease;
  pointer-events:auto;
}
.modal-root.open .themed-face { opacity:1; transform:scale(1); }
.themed-gradient {
  position:absolute; inset:0; border-radius:18px;
  background:linear-gradient(180deg,#F59E43 0%,#E47B28 56%,#C9661D 100%);
  overflow:hidden;
}
.themed-badge {
  position:absolute; z-index:3; left:50%; top:-24px; transform:translateX(-50%);
  width:54px; height:54px; border-radius:27px;
  display:grid; place-items:center;
  background:#FFF6E9;
  border:3px solid var(--canvas-border);
  box-shadow:0 5px 12px rgba(0,0,0,.22);
  font-size:28px;
}
.themed-badge img { width:34px; height:34px; object-fit:contain; }
.themed-body { position:relative; z-index:2; padding:38px 18px 18px; max-height:min(74vh,500px); overflow:auto; }
.themed-title {
  font-family:"HfpLemon",sans-serif;
  font-size:20px; font-weight:800; color:#fff; text-align:center; margin-bottom:12px;
  text-shadow:0 1px 4px rgba(0,0,0,.25);
}

/* Pen modal */
.line-style-row { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.line-style-card {
  min-height:54px; border-radius:12px; border:2px solid rgba(255,255,255,.65);
  background:rgba(255,255,255,.18); display:grid; place-items:center;
}
.line-style-card.selected { border-color:#fff; background:rgba(255,255,255,.34); box-shadow:0 0 0 2px rgba(54,82,125,.25); }
.line-solid,.line-dashed { display:block; width:72%; border-top:4px solid var(--canvas-border); border-radius:4px; }
.line-dashed { border-top-style:dashed; }
.line-dotted { color:var(--canvas-border); font-size:18px; letter-spacing:3px; white-space:nowrap; }
.thickness-graphic { margin:18px auto 14px; display:flex; flex-direction:column; gap:6px; width:80%; align-items:flex-start; opacity:.9; }
.thick { display:block; height:4px; border-radius:4px; background:rgba(54,82,125,.8); }
.thick.long{width:100%;}.thick.mid{width:70%;}.thick.short{width:42%;}
.brush-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.brush-choice {
  min-height:92px; padding:8px 4px; border-radius:14px; border:2px solid transparent;
  background:rgba(255,255,255,.22); color:#fff; font:700 12px/1.2 "HfpLemon",sans-serif;
}
.brush-choice.selected { border-color:#fff; background:rgba(255,255,255,.38); }
.brush-choice img { width:50px; height:50px; object-fit:contain; display:block; margin:0 auto 4px; }

/* Pattern/Text rows follow source geometry */
.pattern-list,.font-list { display:flex; flex-direction:column; gap:8px; }
.pattern-row {
  width:100%; min-height:58px;
  display:flex; align-items:center; gap:12px;
  padding:10px 8px; border-radius:12px;
  background:#fff; border:2px solid #E4E4E7;
  color:var(--canvas-border);
}
.pattern-row.selected { border-color:var(--canvas-border); background:rgba(54,82,125,.08); }
.pattern-thumb-wrap { width:36px; height:36px; display:grid; place-items:center; flex:0 0 auto; }
.pattern-thumb-wrap img { width:36px; height:36px; object-fit:contain; }
.pattern-label { font-family:"HfpLemon",sans-serif; font-size:15px; font-weight:700; text-align:left; flex:1; }
.themed-close-btn {
  display:block; margin:14px auto 0; padding:10px 28px; min-height:44px;
  border-radius:16px; background:rgba(255,255,255,.22); border:2px solid rgba(255,255,255,.90);
  color:#fff; font-family:"HfpLemon",sans-serif; font-size:16px; font-weight:700;
}
.themed-close-btn.secondary { margin:0; width:100%; }

/* Eraser */
.eraser-face { width:min(calc(100vw - 40px),380px); }
.eraser-choices { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.eraser-choice {
  border-radius:16px; padding:12px 6px; min-height:140px; background:rgba(255,255,255,.22);
  border:2px solid rgba(255,255,255,.62); color:#fff; font:700 13px/1.25 "HfpLemon",sans-serif;
}
.eraser-choice.selected { background:rgba(255,255,255,.38); border-color:#fff; }
.eraser-plate {
  width:92px; height:92px; margin:0 auto 8px; border-radius:22px; display:grid; place-items:center;
  background:#FFF7ED; color:#6D28D9; font-size:46px; border:2px solid rgba(54,82,125,.22);
}

/* Text */
.text-face { width:min(calc(100vw - 40px),400px); }
.text-modal-input {
  width:100%; min-height:88px; border:1px solid #ccc; border-radius:10px; padding:10px; resize:none;
  font-size:16px; background:#fff; color:var(--canvas-border); text-align:left; outline:none;
}
.font-list { margin-top:12px; }
.font-aa { width:36px; height:36px; display:grid; place-items:center; font-size:18px; color:var(--canvas-border); }
.lemon { font-family:"HfpLemon",sans-serif; }
.space { font-family:"HfpSpace",monospace; }

/* Color */
.color-face { width:min(calc(100vw - 40px),360px); }
.color-preview-wrap { display:flex; justify-content:center; margin-bottom:12px; }
.color-preview {
  width:100%; height:64px; border-radius:14px; border:3px solid var(--canvas-border);
  background:#36527D; box-shadow:inset 0 0 0 2px rgba(255,255,255,.45);
}
.preset-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:9px; margin-bottom:14px; }
.preset-grid button {
  width:38px; height:38px; border-radius:50%; background:var(--sw);
  border:2px solid rgba(54,82,125,.55); box-shadow:inset 0 0 0 2px rgba(255,255,255,.75);
}
.color-slider-block { display:flex; flex-direction:column; gap:14px; }
.color-slider { width:100%; height:30px; appearance:none; -webkit-appearance:none; background:transparent; }
.color-slider::-webkit-slider-thumb {
  appearance:none; -webkit-appearance:none; width:28px; height:28px; border-radius:50%;
  background:#fff; border:3px solid var(--canvas-border); margin-top:-9px; box-shadow:0 2px 5px rgba(0,0,0,.25);
}
.color-slider::-webkit-slider-runnable-track { height:10px; border-radius:6px; }
.hue-slider::-webkit-slider-runnable-track { background:linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); }
.light-slider::-webkit-slider-runnable-track { background:linear-gradient(90deg,#111,#fff); }
.alpha-slider::-webkit-slider-runnable-track { background:linear-gradient(90deg,rgba(255,255,255,.15),#fff); }
.color-actions { display:flex; justify-content:center; gap:22px; margin-top:16px; }
.round-action { width:54px; height:54px; border-radius:50%; border:3px solid #fff; color:#fff; font-size:36px; line-height:1; }
.round-action.cancel { background:#E5484D; }
.round-action.save { background:#2DBE60; }

/* Shape / outline bottom sheets: source uses slide + white 60% sheet + 22px top corners + 3px border */
.sheet-modal>.modal-backdrop { opacity:0; transition:opacity 220ms ease; }
.sheet-modal.open>.modal-backdrop { opacity:1; }
.sheet-wrap { position:absolute; inset:0; display:flex; align-items:flex-end; pointer-events:none; }
.bottom-sheet {
  width:100%; height:60%; max-height:68%;
  background:#fff;
  border-top-left-radius:22px; border-top-right-radius:22px;
  border:3px solid var(--canvas-border); border-bottom:0;
  padding:12px 16px 20px;
  transform:translateY(102%);
  transition:transform 260ms cubic-bezier(.22,.61,.36,1);
  pointer-events:auto;
}
.sheet-modal.open .bottom-sheet { transform:translateY(0); }
.sheet-handle { width:48px; height:5px; border-radius:5px; background:#D1D5DB; margin:0 auto 16px; }
.sheet-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; align-items:start; }
.sheet-tile {
  min-height:118px; border-radius:14px; border:2px solid #E4E4E7; background:#fff;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px;
  color:var(--canvas-border); font:700 13px/1.2 "HfpLemon",sans-serif;
}
.outline-sheet-tile img { width:92px; height:70px; object-fit:cover; border-radius:10px; border:2px solid #C4C4CC; }

/* Download themed modal */
.download-face { width:min(calc(100vw - 40px),360px); }
.download-body { text-align:center; }
.download-logo { width:180px; height:56px; object-fit:contain; margin:0 auto 6px; display:block; }
.download-body p { color:rgba(255,255,255,.96); font-size:14px; line-height:1.4; margin:4px 0 16px; text-shadow:0 1px 3px rgba(0,0,0,.22); }
.download-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.download-primary { min-height:44px; border-radius:16px; background:#2BD309; color:#103c05; font-weight:800; border:2px solid #fff; }

/* Main menu */
.menu-backdrop {
  position:absolute; inset:0; width:100%; height:100%; opacity:0;
  background:rgba(17,27,42,.58); backdrop-filter:blur(8px);
  transition:opacity 180ms ease;
}
.menu-modal.open .menu-backdrop { opacity:1; }
.menu-center { position:absolute; inset:0; display:grid; place-items:center; padding:20px; pointer-events:none; }
.menu-card {
  width:min(calc(100vw - 40px),340px); padding:24px 18px 18px; position:relative;
  border-radius:20px; border:3px solid var(--canvas-border); overflow:hidden;
  opacity:0; transform:scale(.97); transition:180ms ease; pointer-events:auto;
}
.menu-modal.open .menu-card { opacity:1; transform:scale(1); }
.menu-gradient { position:absolute; inset:0; background:linear-gradient(180deg,#014C79,#42B1D1); }
.menu-logo { position:relative; z-index:1; width:190px; height:56px; object-fit:contain; display:block; margin:0 auto 18px; }
.menu-action {
  position:relative; z-index:1; width:100%; min-height:48px; margin-top:10px; border-radius:15px;
  background:rgba(255,255,255,.92); color:var(--canvas-border); font:800 15px/1 "HfpLemon",sans-serif;
}
.menu-action.muted { background:rgba(255,255,255,.22); color:#fff; border:2px solid rgba(255,255,255,.85); }

/* CTA only appears after meaningful use, never on a timer */
.end-card {
  position:absolute; z-index:300; left:50%; bottom:calc(94px + var(--safe-bottom));
  transform:translate(-50%,14px); width:min(92vw,430px); min-height:70px;
  padding:9px 10px; border-radius:22px; border:2px solid rgba(255,255,255,.90);
  background:rgba(8,44,73,.92); box-shadow:0 12px 30px rgba(0,0,0,.28);
  backdrop-filter:blur(12px); display:flex; align-items:center; gap:10px;
  opacity:0; pointer-events:none; transition:opacity .25s ease,transform .25s ease;
}
.end-card.show { opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.end-card>img { width:86px; height:42px; object-fit:contain; }
.end-copy { min-width:0; flex:1; display:flex; flex-direction:column; color:#fff; }
.end-copy strong { font-size:15px; }.end-copy span{font-size:12px;opacity:.85;}
.install-btn { padding:11px 18px; border-radius:999px; background:#2BD309; color:#103c05; font-weight:800; }

.local-notice {
  position:absolute; z-index:700; left:50%; top:calc(var(--safe-top) + 112px); transform:translateX(-50%);
  max-width:82vw; padding:9px 12px; border-radius:14px; background:rgba(0,0,0,.76); color:#fff; font-size:12px; text-align:center;
}
.local-notice[hidden] { display:none; }

@media (orientation:landscape) {
  :root { --left-width:90px; }
  .header-row { width:100%; max-width:720px; margin:0 auto; padding:16px 16px 8px; }
  .left-panel { max-height:230px; }
  .left-tools { max-height:226px; }
  .tool-slot>img { width:44px; height:44px; }
  .paper-wrap { width:min(52vw,520px); max-height:calc(100dvh - 84px); }
  .end-card { bottom:calc(92px + var(--safe-bottom)); }
  .themed-face { max-height:86vh; }
}
@media (max-width:390px) {
  .size-slider-wrap { min-width:220px; }
  .sun-dock { gap:10px; }
  .sun-btn { width:50px; height:50px; }
  .sun-btn img { width:36px; height:36px; }
  .paper-wrap { width:min(72vw,360px); }
}
