/* Sruthi Arts Studio — Instagram-style admin. Mobile first. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #fff4f6;
  --petal: #fde6ec;
  --ink: #26151e;
  --muted: #7a6670;
  --line: #efe3e8;
  --berry: #a8325e;
  --rose: #e0789c;
  --gold: #e8b16a;
  --leaf: #2f8a5b;
  --danger: #c0392b;
  --ring: linear-gradient(45deg, #f2c46b 0%, #e0789c 45%, #a8325e 75%, #7b3fa0 100%);
  --display: "IM Fell English", Georgia, serif;
  --body: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --nav-h: 58px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: var(--berry); }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { min-height: 100dvh; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(600px 400px at 80% 0%, var(--petal), transparent 70%), var(--bg); }
.login-card { width: min(100%, 360px); display: grid; gap: 16px; text-align: center; animation: rise .6s var(--spring) both; }
.logo { display: inline-block; margin: 0; line-height: 0; color: var(--ink); }
.logo svg { height: 96px; width: auto; overflow: visible; }
.topbar .logo svg { height: 42px; }
.lg-flourish { stroke-dasharray: 240; stroke-dashoffset: 240; animation: lgDraw 1.6s .2s var(--ease) forwards; }
.lg-moon, .lg-spark { transform-box: fill-box; transform-origin: center; }
.lg-moon { animation: pop .7s .9s var(--spring) both; }
.lg-spark { animation: twinkle 2.8s 1.2s ease-in-out infinite; }
.lg-spark.s2 { animation-delay: 2.1s; }
@keyframes lgDraw { to { stroke-dashoffset: 0; } }
@keyframes twinkle { 50% { transform: scale(.5) rotate(45deg); opacity: .5; } }
.login p { color: var(--muted); margin: 0; }
.login .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.login .or::before, .login .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login details { text-align: left; }
.login summary { cursor: pointer; color: var(--berry); font-weight: 500; list-style: none; text-align: center; }
.login summary::-webkit-details-marker { display: none; }
.login form { display: grid; gap: 10px; margin-top: 12px; }
.login .help { font-size: .82rem; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 0; }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 0; background: var(--berry); color: #fff; font-weight: 700; text-decoration: none; transition: transform .12s var(--ease), background .2s, opacity .2s; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.light { background: #f3edf0; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--berry); }
.btn.danger { background: #fbe9e7; color: var(--danger); }
.btn.block { width: 100%; }
.btn.gh { background: #24292f; }
.btn svg { width: 18px; height: 18px; flex: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field small { color: var(--muted); font-size: .8rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="email"], textarea, select {
  width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(224, 120, 156, .18); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 12px; padding-top: env(safe-area-inset-top, 0px); background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 12px; color: var(--ink); position: relative; transition: transform .15s var(--ease), background .2s; text-decoration: none; }
.icon-btn:active { transform: scale(.88); }
.icon-btn:hover { background: #f7f1f4; }
.icon-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dot { position: absolute; top: 8px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ff3b5c; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; animation: pop .4s var(--spring); }
.publish { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--petal); color: var(--berry); animation: rise .3s var(--ease); }
.publish.live { background: #e6f4ec; color: var(--leaf); }
.publish.fail { background: #fbe9e7; color: var(--danger); }
.publish i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1s infinite; }
.publish.live i, .publish.fail i { animation: none; }
@keyframes blink { 50% { opacity: .25; } }

.shell { max-width: 935px; margin: 0 auto; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Profile header ---------- */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 16px 22px; align-items: center; padding: 18px 16px 8px; }
.avatar { width: 86px; height: 86px; border-radius: 50%; padding: 3px; background: var(--ring); animation: spinIn .8s var(--spring) both; }
.avatar > * { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; object-fit: cover; background: var(--petal); display: grid; place-items: center; font: 400 2rem var(--display); color: var(--berry); }
@keyframes spinIn { from { transform: rotate(-40deg) scale(.6); opacity: 0; } }
.who h1 { font: 700 1.15rem/1.2 var(--body); margin: 0 0 2px; }
.who p { margin: 0; color: var(--muted); }
.stats { display: flex; gap: 22px; margin-top: 10px; }
.stats div { display: grid; }
.stats b { font-size: 1.1rem; }
.stats span { font-size: .8rem; color: var(--muted); }
.profile-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.profile-actions .btn { flex: 1; min-height: 38px; padding: 8px 12px; border-radius: 8px; font-size: .9rem; }

/* ---------- Tabs ---------- */
.tabs { position: sticky; top: 56px; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); margin-top: 12px; }
.tabs button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 0 8px; border: 0; background: none; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs .bar { position: absolute; top: -1px; height: 2px; width: 25%; background: var(--ink); transition: transform .35s var(--spring); }

.view { animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Posts grid ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: .88rem; transition: all .2s var(--ease); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { position: relative; aspect-ratio: 4 / 5; border: 0; padding: 0; background: var(--petal); overflow: hidden; animation: tileIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .4s; opacity: 0; }
.tile img.ok { opacity: 1; }
.tile img.broken { opacity: 0; }
.tile:hover img { transform: scale(1.05); }
.tile:active { filter: brightness(.9); }
.tile .badge { position: absolute; top: 6px; right: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .72rem; font-weight: 700; backdrop-filter: blur(4px); }
.tile .badge.sold { background: var(--berry); }
.tile .price-tag { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: .75rem; font-weight: 700; }
.tile.is-sold img { filter: grayscale(.5) brightness(.9); }
.tile.new { animation: newPost .7s var(--spring) both; }
@keyframes tileIn { from { opacity: 0; transform: scale(.94); } }
@keyframes newPost { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } }
.skeleton { background: linear-gradient(110deg, var(--petal) 30%, #fff 50%, var(--petal) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty .ring { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; }
.empty .ring svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.empty h2 { font: 700 1.4rem var(--body); color: var(--ink); margin: 0; }

/* ---------- Sheets (post view, composer) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; justify-items: center; background: rgba(20, 8, 14, .5); animation: fade .25s ease both; }
.sheet-wrap.closing { animation: fade .22s ease reverse both; }
.sheet { width: 100%; max-width: 560px; max-height: 94dvh; overflow: auto; overscroll-behavior: contain; background: #fff; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetUp .45s var(--spring) both; }
.sheet-wrap.closing .sheet { animation: sheetDown .22s var(--ease) both; }
.sheet.full { max-width: 935px; height: 100dvh; max-height: 100dvh; border-radius: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; height: 52px; padding: 0 6px; background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; text-align: center; font: 700 1rem var(--body); }
.sheet-head .txt { border: 0; background: none; font-weight: 700; color: #0095f6; padding: 10px; justify-self: end; }
.sheet-head .txt:disabled { opacity: .35; }
.sheet-head .txt.plain { color: var(--ink); justify-self: start; font-weight: 500; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: #ddd; margin: 8px auto 0; }
.sheet-body { padding: 16px; display: grid; gap: 16px; }

.post-media { position: relative; background: #000; }
.post-media img { width: 100%; max-height: 62dvh; object-fit: contain; margin: 0 auto; }
.post-meta { padding: 14px 16px 4px; display: grid; gap: 6px; }
.post-meta h3 { margin: 0; font: 700 1.1rem var(--body); }
.post-meta .cap { margin: 0; white-space: pre-wrap; }
.post-meta .meta { color: var(--muted); font-size: .88rem; }
.stock-card { margin: 12px 16px; padding: 14px; border-radius: 14px; background: var(--soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stock-card b { display: block; font-size: .95rem; }
.stock-card small { color: var(--muted); }
.stepper { display: inline-flex; align-items: center; background: #fff; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.35rem; color: var(--berry); border-radius: 50%; }
.stepper button:active { background: var(--petal); }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.stepper output.bump { animation: bump .3s var(--spring); }
@keyframes bump { 50% { transform: scale(1.4); } }
.post-actions { display: grid; gap: 8px; padding: 8px 16px 20px; }
.post-actions .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm { padding: 14px; border-radius: 12px; background: #fbe9e7; display: grid; gap: 10px; animation: rise .3s var(--spring); }
.confirm p { margin: 0; color: var(--danger); font-weight: 500; }

/* Composer */
.picker { display: grid; place-items: center; gap: 14px; min-height: 52dvh; padding: 24px; text-align: center; border: 2px dashed var(--line); border-radius: 16px; margin: 16px; color: var(--muted); transition: border-color .2s, background .2s; }
.picker.drag { border-color: var(--rose); background: var(--soft); }
.picker svg { width: 84px; height: 84px; fill: none; stroke: var(--ink); stroke-width: 1.2; }
.picker h3 { margin: 0; font: 400 1.3rem var(--body); color: var(--ink); }
.preview { position: relative; aspect-ratio: 4 / 5; background: #111; overflow: hidden; }
.preview img { width: 100%; height: 100%; object-fit: cover; animation: zoomIn .5s var(--ease); }
.preview .swap { position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .6); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .85rem; }
@keyframes zoomIn { from { transform: scale(1.08); opacity: 0; } }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ring); transition: width .4s var(--ease); }
.done-burst { display: grid; place-items: center; gap: 12px; padding: 48px 16px; text-align: center; }
.heart { width: 96px; height: 96px; animation: heart .9s var(--spring) both; }
.heart path { fill: url(#hg); }
@keyframes heart { 0% { transform: scale(0) rotate(-20deg); } 50% { transform: scale(1.2) rotate(6deg); } 100% { transform: scale(1); } }
.done-burst h3 { margin: 0; font: 700 1.3rem var(--body); }
.done-burst p { margin: 0; color: var(--muted); }

/* ---------- Orders ---------- */
.orders { display: grid; gap: 12px; padding: 16px; }
.order { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; animation: tileIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.order img { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--petal); }
.order h3 { margin: 0; font: 700 1rem var(--body); }
.order p { margin: 2px 0; font-size: .9rem; }
.order .muted { color: var(--muted); }
.order .foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #fff3cd; color: #8a5a00; }
.pill.shipped { background: #e6f4ec; color: var(--leaf); }
.warn { padding: 10px 12px; border-radius: 10px; background: #fff3cd; color: #6b4a00; font-size: .88rem; }

/* ---------- Forms (page text, settings) ---------- */
.forms { display: grid; gap: 14px; padding: 16px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 14px; animation: tileIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.card h2 { margin: 0; font: 700 1rem var(--body); display: flex; align-items: center; gap: 8px; }
.card h2 small { font-weight: 400; color: var(--muted); }
.steps-edit { display: grid; gap: 10px; }
.step-edit { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--soft); position: relative; }
.step-edit .rm { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #fff; color: var(--muted); }
.photo-field { display: flex; align-items: center; gap: 12px; }
.photo-field img, .photo-field .ph { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--petal); }
.savebar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; justify-content: center; padding: 10px 16px; pointer-events: none; }
.savebar .btn { pointer-events: auto; box-shadow: 0 10px 30px rgba(168, 50, 94, .35); animation: rise .35s var(--spring); min-width: 220px; }

/* ---------- Bottom nav (phones) & FAB ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.bottomnav button { border: 0; background: none; display: grid; place-items: center; color: var(--ink); position: relative; }
.bottomnav button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--spring); }
.bottomnav button[aria-current="page"] svg { stroke-width: 2.4; transform: scale(1.08); }
.bottomnav button:active svg { transform: scale(.85); }
.bottomnav .plus svg { width: 30px; height: 30px; }
.bottomnav .dot { top: 6px; right: calc(50% - 22px); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #262626; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toastIn .4s var(--spring) both; }
.toast.err { background: var(--danger); }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { transform: scale(0); } }

/* ---------- Larger screens ---------- */
@media (min-width: 760px) {
  .topbar { padding: 0 24px; }
  .profile { grid-template-columns: 150px 1fr; padding: 32px 24px 12px; }
  .avatar { width: 150px; height: 150px; }
  .who h1 { font-size: 1.4rem; }
  .profile-actions { grid-column: 2; justify-content: flex-start; }
  .profile-actions .btn { flex: 0 0 auto; }
  .grid { gap: 6px; padding: 0 12px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 18px; max-width: 640px; animation: popIn .4s var(--spring) both; }
  .sheet.full { height: auto; max-height: 92dvh; border-radius: 18px; }
  .sheet-wrap.closing .sheet { animation: popOut .2s var(--ease) both; }
  .grabber { display: none; }
  .bottomnav { left: 50%; right: auto; bottom: 18px; transform: translateX(-50%); width: 420px; height: 60px; padding: 0; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 40px rgba(38, 21, 30, .12); }
  .savebar { bottom: 92px; }
  .toasts { bottom: 96px; }
  @keyframes popIn { from { opacity: 0; transform: scale(.94); } }
  @keyframes popOut { to { opacity: 0; transform: scale(.96); } }
}

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