:root { --orange: #f26a00; --cream: #fffcf7; --ink: #111; --grey: #666; --line: #eadfce; --red: #c62828; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; background: var(--cream); color: var(--ink); font: 15px/1.45 'Inter', system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1 { font-size: 22px; font-weight: 600; }
.muted { color: var(--grey); font-size: 14px; }
.small { font-size: 12px; }

/* centered screens (login / setup) */
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 20px; text-align: center; }
.center .logo { height: 54px; margin-bottom: 18px; }
.center h1 { margin-bottom: 14px; }
.card-form { width: 100%; max-width: 360px; text-align: left; }

/* fields + buttons */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.field em { font-style: normal; font-weight: 400; color: var(--grey); }
.field input, .search {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .search:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,106,0,.15); }
.error { margin: -2px 0 12px; font-size: 13px; color: var(--red); }

.btn { height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.btn--primary { background: var(--orange); color: #fff; width: 100%; }
.btn--primary:disabled { opacity: .6; }
.btn--outline { border: 1.5px solid var(--orange); color: var(--orange); background: transparent; }
.btn--small { height: 38px; width: auto; padding: 0 14px; font-size: 14px; }
.link { color: var(--orange); font-weight: 500; font-size: 14px; padding: 6px 0; }
.link--red { color: var(--red); }

/* top bar + page */
.bar { position: sticky; top: 0; z-index: 5; height: 56px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; background: #fefefe; border-bottom: 1px solid #ddd; }
.bar img { height: 38px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px 14px 40px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search { margin-bottom: 14px; }

/* product rows */
.row { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.row.is-off { opacity: .6; }
.row__img { width: 64px; height: 64px; flex: none; border-radius: 10px; object-fit: cover; background: #f3ede3; display: grid; place-items: center; color: #c9a77f; font-size: 11px; }
.row__main { flex: 1; min-width: 0; }
.row__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__price { font-size: 14px; color: var(--orange); font-weight: 600; }
.row__price s { margin-left: 6px; color: #999; font-weight: 400; font-size: 12px; }
.row__meta { font-size: 12px; color: var(--grey); }
.row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row__btns { display: flex; gap: 14px; }
.empty { padding: 36px 10px; text-align: center; color: var(--grey); }

/* on/off switch */
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: #d6d0c6; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::after { transform: translateX(18px); }
.toggle-line { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 2px; font-weight: 500; }

/* add / edit sheet */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.4); }
.sheet__panel { width: 100%; max-width: 560px; max-height: 94vh; display: flex; flex-direction: column; background: #fefefe; border-radius: 20px 20px 0 0; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.sheet__head h2 { font-size: 18px; font-weight: 600; }
.x { font-size: 30px; line-height: 1; color: #666; padding: 0 6px; }
.sheet__body { padding: 8px 18px 6px; overflow-y: auto; }
.sheet__foot { display: flex; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet__foot .btn { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.picker { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.picker__box { width: 110px; height: 110px; flex: none; border-radius: 14px; overflow: hidden; background: #f3ede3; border: 1px dashed #d9bf9c; display: grid; place-items: center; }
.picker__box img { width: 100%; height: 100%; object-fit: cover; }
.picker__empty { font-size: 12px; color: #b08a5c; }
.picker__btns { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: #2a2829; color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .25s, transform .25s; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
