/* sndhand – mobile first */
:root {
  --brand: #00a85a; --brand-d: #008a4a; --brand-l: #e5f8ee;
  --red: #e5373f; --ink: #1c1d1f; --ink2: #5c6066; --line: #e6e7ea; --bg: #f5f6f7; --card: #fff;
  --r: 12px; --top: 60px; --tab: 62px;
  color-scheme: light;
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif; color: var(--ink); background: var(--bg); padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)) }
a { color: inherit; text-decoration: none }
a:hover { color: var(--brand-d) }
img { max-width: 100%; display: block }
h1 { font-size: 22px; line-height: 1.3; margin: 16px 0 12px }
h2 { font-size: 17px; margin: 0 0 10px }
button, input, select, textarea { font: inherit; color: inherit }
[hidden] { display: none !important }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none }
.muted { color: var(--ink2) }
.small { font-size: 13px }
.center { text-align: center }
.pre { white-space: pre-wrap; overflow-wrap: anywhere }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px }
.empty { padding: 40px 16px; text-align: center; color: var(--ink2) }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--brand-l); color: var(--brand-d); vertical-align: middle }
.pill.grey { background: #eceef0; color: var(--ink2) }
.flag { background: #fff7e0; border: 1px solid #f3dd9a; padding: 8px 12px; border-radius: 8px; font-size: 14px }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 99px; border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, opacity .15s }
.btn .ic { width: 20px; height: 20px }
.btn-main { background: var(--brand); color: #fff }
.btn-main:hover { background: var(--brand-d); color: #fff }
.btn-sell { background: var(--red); color: #fff }
.btn-sell:hover { background: #c92a32; color: #fff }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink) }
.btn-ghost:hover { border-color: #c9ccd1; color: var(--ink) }
.btn.big { height: 50px; font-size: 16px; padding: 0 28px }
.btn:disabled, .busy { opacity: .55; pointer-events: none }
.danger { color: var(--red) !important }
.linkish { background: none; border: 0; padding: 0; color: var(--brand-d); cursor: pointer; font-size: inherit }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line) }
.top-in { display: flex; align-items: center; gap: 12px; height: var(--top); max-width: 1180px; margin: 0 auto; padding: 0 16px }
.logo { display: flex; align-items: center; flex: none }
.logo img { height: 34px; width: auto }
@media (min-width: 900px) { .logo img { height: 40px } }
.search { flex: 1; display: flex; align-items: center; background: var(--bg); border-radius: 99px; height: 40px; padding: 0 4px 0 14px; min-width: 0 }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; height: 100% }
.search input::-webkit-search-cancel-button { display: none }
.search button { border: 0; background: none; color: var(--ink2); width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer }
.top-nav { display: none; align-items: center; gap: 6px }
.top-nav .ico { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50% }
.top-nav .ico:hover { background: var(--bg) }
.badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center }
.notice { background: var(--brand-l); color: var(--brand-d); text-align: center; font-size: 14px; padding: 6px 16px }
.av { width: var(--s, 40px); height: var(--s, 40px); border-radius: 50%; object-fit: cover; flex: none; background: #eee }
.av-txt { display: inline-grid; place-items: center; background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 45% 30%); font-weight: 700; font-size: calc(var(--s) * .42) }

/* bottom tab bar (mobile) */
.tabbar { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); display: flex }
.tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink2) }
.tabbar a.on { color: var(--ink); font-weight: 600 }
.tabbar .sell i { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%; background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(229, 55, 63, .35) }
.tabbar .badge { top: 5px; right: calc(50% - 22px) }

/* home */
.cats-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none }
.cats-row::-webkit-scrollbar { display: none }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 14px; white-space: nowrap }
.hero { margin: 12px 0 8px; padding: 20px; border-radius: var(--r); background: linear-gradient(135deg, #0a9f5a, #13b86c 60%, #5fd39a); color: #fff; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between }
.hero h1 { margin: 0 0 6px; font-size: 26px }
.hero p { margin: 0 0 14px; max-width: 520px; opacity: .95 }
.hero .btn-sell { box-shadow: 0 4px 14px rgba(0, 0, 0, .18) }
.hero-stats { font-size: 14px; opacity: .95; line-height: 1.7 }
.hero-stats b { font-size: 20px }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px }
.sec-h h2 { margin: 0 }
.sec-h a { color: var(--brand-d); font-size: 14px; font-weight: 600 }

/* grid & card */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px }
.card { display: block; background: var(--card); border-radius: 10px; overflow: hidden }
.card .ph { position: relative; aspect-ratio: 1; background: #eceef0; overflow: hidden }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s }
.card:hover .ph img { transform: scale(1.03) }
.card .price { position: absolute; left: 0; bottom: 10px; background: rgba(0, 0, 0, .62); color: #fff; font-weight: 700; font-size: 14px; padding: 3px 10px 3px 8px; border-radius: 0 99px 99px 0 }
.card .ttl { padding: 7px 9px 9px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.card.is-sold .ph img { opacity: .8 }
/* Ruy băng tam giác đỏ góc trái, chữ SOLD xoay chéo */
.sold { position: absolute; top: 0; left: 0; width: 64px; height: 64px; font-size: 0; z-index: 1; isolation: isolate; pointer-events: none }
.sold::before { content: ""; position: absolute; inset: 0; background: var(--red); clip-path: polygon(0 0, 100% 0, 0 100%); z-index: -1 }
.sold::after { content: "SOLD"; position: absolute; top: 15px; left: -2px; transform: rotate(-45deg); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 1px }
.tag-hold { position: absolute; top: 8px; right: 8px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; box-shadow: 0 1px 4px rgba(0, 0, 0, .15) }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; color: #b8bcc2 }
.noimg .ic { width: 40px; height: 40px }

/* search */
.search-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap }
.search-head h1 { margin-bottom: 8px }
.filters { background: #fff; border-radius: var(--r); margin-bottom: 14px }
.filters summary { display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-weight: 600; cursor: pointer; list-style: none }
.filters summary::-webkit-details-marker { display: none }
.filters summary .ic { width: 18px; height: 18px }
.filter-form { padding: 0 14px 14px; display: grid; gap: 12px }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 600 }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-weight: 400; font-size: 16px; outline: none }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l) }
textarea { resize: vertical; min-height: 44px }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px }
legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0 }
.chk { display: flex; align-items: center; gap: 7px; font-weight: 400 }
.chk input { width: 18px; height: 18px; accent-color: var(--brand) }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.row-btn { display: flex; gap: 8px; justify-content: flex-end }
.more { text-align: center; margin: 20px 0 }

/* item page */
.item { display: grid; gap: 16px; margin-top: 12px }
.gallery { position: relative; margin: 0 -16px }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #fff }
.slides::-webkit-scrollbar { display: none }
.slides figure { flex: none; width: 100%; margin: 0; aspect-ratio: 1; scroll-snap-align: start; display: grid; place-items: center; background: #fff; cursor: zoom-in }
.slides figure img { width: 100%; height: 100%; object-fit: contain }
.gallery .sold.big { width: 104px; height: 104px }
.gallery .sold.big::after { top: 26px; left: 2px; font-size: 18px; letter-spacing: 2px }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; scrollbar-width: none }
.thumbs button { flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #eee; opacity: .7 }
.thumbs button.on { border-color: var(--ink); opacity: 1 }
.thumbs img { width: 100%; height: 100%; object-fit: cover }
.info h1 { margin-top: 0; font-size: 20px }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px }
.price-big { font-size: 28px; font-weight: 800 }
.acts { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px }
.like { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600 }
.like.on { color: var(--red); border-color: #f6c3c6; background: #fff3f4 }
.like .ic { width: 18px; height: 18px }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 }
.cta .btn-main { flex: 1 1 100%; height: 50px; font-size: 16px }
.status-form { display: flex; gap: 6px; flex: 1 }
.status-form select { padding: 8px 10px; height: 42px; min-width: 150px; flex: 1 }
.desc { background: #fff; border-radius: var(--r); padding: 14px; margin-bottom: 12px }
.spec { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; font-size: 14px; margin-bottom: 12px }
.spec th, .spec td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top }
.spec th { width: 34%; color: var(--ink2); font-weight: 500; background: #fafbfb }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0 }
.spec a { color: var(--brand-d) }
.seller { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--r); padding: 12px 14px }
.seller > span { display: grid }
.rate { display: inline-flex; gap: 10px; font-size: 13px; color: var(--ink2) }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: grid; place-items: center; cursor: zoom-out }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain }

/* forms */
.form-page { max-width: 640px; margin: 0 auto }
.box { background: #fff; border-radius: var(--r); padding: 16px; margin-bottom: 12px; display: grid; gap: 14px }
.box h2 { margin: 0 }
.box h2 small { font-weight: 400; font-size: 13px; color: var(--ink2) }
.err { margin: 0; color: var(--red); font-size: 14px; background: #fff1f2; padding: 8px 12px; border-radius: 8px }
.auth .box { margin-top: 8px }
.radios { display: grid; gap: 6px }
.radio { display: flex; align-items: center; gap: 10px; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer }
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-l) }
.radio input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0 }
.price-in span { display: flex; align-items: center; gap: 8px }
.price-in input { font-size: 22px !important; font-weight: 700 !important; text-align: right }
.price-in b { font-size: 22px }
.sticky-act { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%) }
.sticky-act .btn { width: 100% }
.sell { padding-bottom: 10px }
body:has(.sell), body:has(.chat) { padding-bottom: 0 }

/* uploader */
.up-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px }
.up-item, .up-add { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden }
.up-item { background: #eee; cursor: grab }
.up-item img { width: 100%; height: 100%; object-fit: cover }
.up-item.loading img { opacity: .4 }
.up-item.loading::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 24px; height: 24px; margin: -12px; border: 3px solid #fff; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite }
.up-item.drag { opacity: .4 }
.up-item .cover { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; text-align: center; padding: 2px }
.up-item .x, .up-item .mv button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer }
.up-item .x { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .65); color: #fff }
.up-item .mv { position: absolute; top: 4px; left: 4px; display: flex; gap: 4px }
.up-item .mv button { background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .2) }
.up-item .x svg, .up-item .mv svg { width: 16px; height: 16px; display: block }
.up-add { border: 2px dashed #c9ccd1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--ink2); font-weight: 600; font-size: 12px; background: #fafbfb }
.up-add:hover { border-color: var(--brand); color: var(--brand-d) }
@keyframes spin { to { transform: rotate(360deg) } }

/* profile */
.profile { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: var(--r); padding: 16px; margin: 12px 0 }
.profile h1 { margin: 0 0 4px; font-size: 20px }
.profile p { margin: 6px 0 }
.links { font-size: 14px }
.links a, .links .linkish { color: var(--brand-d) }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 12px; scrollbar-width: none }
.tabs a, .tabs button { flex: none; padding: 10px 14px; border: 0; background: none; border-bottom: 3px solid transparent; font-weight: 600; color: var(--ink2); cursor: pointer; font-size: 14px }
.tabs .on { color: var(--ink); border-bottom-color: var(--brand) }
.reviews { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px }
.reviews li { display: flex; gap: 12px; background: #fff; border-radius: var(--r); padding: 12px 14px }
.reviews .score { font-size: 22px }
.reviews p { margin: 4px 0 }
.av-edit { display: flex; align-items: center; gap: 14px }
.av-edit .btn { display: inline-flex }

/* inbox */
.threads { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--r); overflow: hidden }
.threads a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line) }
.threads li:last-child a { border-bottom: 0 }
.threads a.unread { background: #f3fbf7 }
.threads a.unread b { color: var(--brand-d) }
.t-ph { flex: none; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: #eee; display: grid; place-items: center; color: #b8bcc2 }
.t-ph img { width: 100%; height: 100%; object-fit: cover }
.t-main { flex: 1; min-width: 0; display: block }
.t-main .muted { white-space: nowrap }
.t-last { display: block; color: var(--ink2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.t-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px }
.t-side .badge { position: static }
.inbox h1 small { font-size: 14px; font-weight: 400; color: var(--ink2) }

/* chat */
.chat-page .foot { display: none }
.chat-page main.wrap { padding: 0; max-width: 820px }
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--top) - 1px); background: #fff }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line) }
.chat-head .back { display: grid; place-items: center; width: 34px; height: 34px; flex: none }
.chat-item { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center }
.chat-item .t-ph { width: 44px; height: 44px }
.chat-item > span:last-child { min-width: 0; display: grid }
.chat-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px }
.chat-who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; flex: none }
.chat-who span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.chat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: #f6fbf8; border-bottom: 1px solid var(--line); font-size: 14px }
.chat-bar .btn { height: 36px; padding: 0 14px; font-size: 14px }
.chat-bar.review input[name=body] { flex: 1 1 200px; padding: 7px 10px; font-size: 14px }
.seg { display: inline-flex; gap: 4px }
.seg label { display: block; font-weight: 400 }
.seg input { position: absolute; opacity: 0 }
.seg span { display: block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; font-size: 13px }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-l); font-weight: 600 }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; background: #f3f4f6 }
.msg { align-self: flex-start; max-width: 78%; background: #fff; border-radius: 16px 16px 16px 4px; padding: 7px 12px 5px; box-shadow: 0 1px 1px rgba(0, 0, 0, .04) }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 16px 16px 4px 16px }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere }
.msg img { border-radius: 10px; max-height: 240px; width: auto; margin: 3px 0 }
.msg time { display: block; font-size: 10px; opacity: .65; text-align: right }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff }
.composer textarea { flex: 1; border-radius: 20px; padding: 9px 14px; max-height: 140px; resize: none; line-height: 1.4 }
.composer .ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; color: var(--ink2); cursor: pointer; border: 0; background: none }
.composer .send { color: #fff; background: var(--brand) }
.composer label.ico { font-weight: 400 }

/* admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px }
.stats div { background: #fff; border-radius: var(--r); padding: 12px; font-size: 13px; color: var(--ink2) }
.stats b { display: block; font-size: 22px; color: var(--ink) }
.table-wrap { overflow-x: auto }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap }
.tbl td a { color: var(--brand-d) }
.tbl tr.banned td { opacity: .5; text-decoration: line-through }
.nowrap { white-space: nowrap }
.inline { display: flex; gap: 8px }
.inline input { flex: 1 }

/* prose / errors / footer */
.prose { max-width: 720px; background: #fff; border-radius: var(--r); padding: 4px 20px 16px; margin: 12px auto }
.prose li { margin-bottom: 6px }
.err-page { text-align: center; padding: 60px 16px }
.foot { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink2) }
.foot p { margin: 4px 0 }
.foot a { color: var(--brand-d) }

/* larger screens */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px }
  .up-grid { grid-template-columns: repeat(5, 1fr) }
}
@media (min-width: 900px) {
  body { padding-bottom: 0 }
  .tabbar { display: none }
  .top-nav { display: flex }
  .top-in { gap: 20px }
  .search { max-width: 560px }
  .grid { grid-template-columns: repeat(5, 1fr) }
  .item { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start }
  .gallery { margin: 0; position: sticky; top: calc(var(--top) + 12px) }
  .slides { border-radius: var(--r) }
  .thumbs { padding: 8px 0 }
  .info h1 { font-size: 23px }
  .cta .btn-main { flex: 1 1 auto }
  .hero { padding: 28px 32px }
  .hero h1 { font-size: 32px }
  .chat { height: calc(100dvh - var(--top) - 24px); margin-top: 12px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line) }
}
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(6, 1fr) } }

/* trình sửa ảnh (chép từ thanchi): luôn nền tối như app camera */
.ed{--ed-bg:#111413;--ed-panel:#1d2220;--ed-line:#323936;--ed-fg:#eef3f0;--ed-muted:#9aa6a0;--ed-accent:#2fc27d;--ed-accent-ink:#04210f}
.ed{position:fixed;inset:0;z-index:40;background:var(--ed-bg);color:var(--ed-fg);display:flex;flex-direction:column;color-scheme:dark;
  padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
.ed-top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 16px}
.eb{min-height:38px;padding:0 14px;border-radius:10px;border:1px solid var(--ed-line);background:var(--ed-panel);color:var(--ed-fg);font-weight:600;font-size:14px;white-space:nowrap}
.eb.on,.eb.pri{background:var(--ed-accent);color:var(--ed-accent-ink);border-color:var(--ed-accent)}
.eb:disabled{opacity:.35}
.ed :focus-visible{outline-color:var(--ed-accent)}
.ed-stage{flex:1;min-height:0;display:grid;place-items:center;overflow:hidden;margin:0 12px;position:relative}
.ed-wrap{position:relative;touch-action:none}
.ed-wrap canvas{display:block;touch-action:none}
.ed[data-tool="brush"] canvas{cursor:crosshair}
.ed-layer{position:absolute;inset:0;overflow:hidden}
.ed[data-tool="brush"] .ed-layer,.ed[data-tool="crop"] .ed-layer{pointer-events:none}
.ed-item{position:absolute;transform:translate(-50%,-50%);white-space:pre;text-align:center;font-weight:700;line-height:1.2;cursor:move;touch-action:none;user-select:none;-webkit-user-select:none}
.ed-item.sel{outline:2px dashed var(--ed-accent);outline-offset:6px}
.ed-item.pill{padding:.18em .45em;border-radius:.5em;color:#FFFFFF}
.ed-item.boxed{padding:.18em .45em;border-radius:.35em}
.ed-item.txt{-webkit-text-stroke-width:.2em;paint-order:stroke fill}
.crop{position:absolute;box-shadow:0 0 0 9999px rgba(0,0,0,.58);border:2px solid #FFFFFF;touch-action:none;cursor:move;
  background-image:linear-gradient(rgba(255,255,255,.35),rgba(255,255,255,.35)),linear-gradient(rgba(255,255,255,.35),rgba(255,255,255,.35)),linear-gradient(90deg,rgba(255,255,255,.35),rgba(255,255,255,.35)),linear-gradient(90deg,rgba(255,255,255,.35),rgba(255,255,255,.35));
  background-size:100% 1px,100% 1px,1px 100%,1px 100%;background-position:0 33.33%,0 66.66%,33.33% 0,66.66% 0;background-repeat:no-repeat}
.crop i{position:absolute;width:28px;height:28px;border:4px solid #FFFFFF}
.crop i::before{content:"";position:absolute;inset:-14px}
.crop .tl{left:-5px;top:-5px;border-right:0;border-bottom:0;cursor:nwse-resize}
.crop .tr{right:-5px;top:-5px;border-left:0;border-bottom:0;cursor:nesw-resize}
.crop .bl{left:-5px;bottom:-5px;border-right:0;border-top:0;cursor:nesw-resize}
.crop .br{right:-5px;bottom:-5px;border-left:0;border-top:0;cursor:nwse-resize}
.ed-opts{padding:10px 16px 6px;min-height:104px;display:grid;gap:8px;align-content:center;justify-items:center}
.ed-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;max-width:560px;width:100%}
.ed-row input[type="text"],.ed-row textarea{flex:1;min-width:0;min-height:40px;border-radius:10px;border:1px solid var(--ed-line);background:var(--ed-panel);color:var(--ed-fg);padding:0 12px;font-size:16px}
.ed-row textarea{padding:8px 12px;resize:none;line-height:1.35;font-family:inherit}
.ed-hint{margin:0;color:var(--ed-muted);font-size:14px;text-align:center;max-width:36ch}
.ed-range{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--ed-muted);font-weight:600}
.ed-range input{accent-color:var(--ed-accent);width:160px}
.sw{width:32px;height:32px;border-radius:50%;border:2px solid var(--ed-line);padding:0}
.sw[aria-pressed="true"]{border-color:var(--ed-fg);box-shadow:0 0 0 2px var(--ed-accent)}
.sw.none{background:linear-gradient(135deg,transparent 45%,#E0245E 45%,#E0245E 55%,transparent 55%),var(--ed-panel)}
.ed-lab{width:34px;font-size:13px;font-weight:600;color:var(--ed-muted);text-align:right}
.eb.sq{width:38px;padding:0;font-size:20px;line-height:1}
.ed-range b{min-width:24px;color:var(--ed-fg);text-align:left}
.stk{gap:6px}
.stkb{border:none;border-radius:8px;color:#FFFFFF;font-weight:700;font-size:13px;min-height:34px;padding:0 10px}
.stkb.g{background:var(--ed-panel);border:1px solid var(--ed-line);font-size:20px;min-width:40px;padding:0}
.ed-tools{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--ed-line)}
.ed-tools button{background:none;border:none;color:var(--ed-muted);padding:10px 0 12px;display:grid;justify-items:center;gap:4px;font-size:12px;font-weight:600}
.ed-tools button[aria-pressed="true"]{color:var(--ed-accent)}
.ed .eb{cursor:pointer}.ed-tools button{cursor:pointer}
.toast{position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom));transform:translateX(-50%);background:#1c1d1f;color:#fff;padding:10px 16px;border-radius:12px;font-weight:600;z-index:120;max-width:calc(100% - 32px);text-align:center;font-size:14px}
.ed .toast,.ed~.toast{z-index:120}
.up-item .ed-btn { position: absolute; right: 4px; bottom: 22px; height: 22px; padding: 0 8px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .92); font-size: 11px; font-weight: 700; cursor: pointer }
.up-item:first-child .ed-btn { bottom: 22px }
.up-item:not(:first-child) .ed-btn { bottom: 4px }
.up-item img { cursor: pointer }
.btn-google { width: 100%; background: #fff; border-color: #dadce0; color: #1f1f1f; gap: 10px }
.btn-google:hover { background: #f8f9fa; color: #1f1f1f; border-color: #c6c9cd }
.g-logo { width: 20px; height: 20px }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 13px; margin: 14px 0 6px }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line) }
.auth > .err { margin-bottom: 10px }
