/* Candy Works brand, taken from candyworksuk.co.uk */
:root {
  --ink: #161212;
  --muted: #5d5552;
  --cream: #fff9ed;
  --card: #fffdf7;
  --bg: #ffffff;
  --lime: #e5ff85;
  --lime-strong: #5aff24;
  --pink: #ff8fbb;
  --hot: #ff4794;
  --berry: #b90b53;
  --yellow: #ffcc37;
  --line: #161212;
  --soft-line: #e9e1d3;
  --ok: #0f6b3a;
  --ok-soft: #e1f8d6;
  --warn: #7a4a00;
  --warn-soft: #fff1c7;
  --danger: #b3101e;
  --danger-soft: #ffe1e4;
  --radius: 13px;
  --btn-radius: 5px;
  --border: 2px solid var(--ink);
  --shadow: 3px 4px 0 0 var(--ink);
  --display: Impact, Anton, "Arial Black", "Helvetica Neue", sans-serif;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; }
h1, h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 1; margin: 0 0 .55em; }
h1 { font-size: 2.3rem; letter-spacing: -1.2px; }
h2 { font-size: 1.35rem; letter-spacing: -.5px; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5em; }
h1 small { font-family: Inter, sans-serif; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 500; color: var(--muted); display: inline-block; }
a { color: var(--berry); font-weight: 600; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
strong, b { font-weight: 700; }

/* Hot-pink highlighter stripe, as on the shop's headings */
.hl { background-image: linear-gradient(transparent 65%, var(--hot) 65%, var(--hot) 94%, transparent 94%); padding: 0 2px; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--berry); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.eyebrow::before { content: "✦"; font-size: 1rem; }

/* ---------- wordmark */
.wordmark { font-family: var(--display); font-weight: 900; font-size: 30px; line-height: .83; letter-spacing: -1.5px; color: var(--ink); text-transform: uppercase; position: relative; display: inline-block; padding-right: 20px; }
.wordmark .star { position: absolute; top: -2px; right: 0; color: var(--berry); font-size: 23px; letter-spacing: 0; }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--cream); border-right: var(--border); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 2px 6px 6px; text-decoration: none; }
.side .tagline { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 6px 14px; }
.side a.nav { color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: var(--btn-radius); border: 2px solid transparent; display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: .93rem; }
.side a.nav:hover { border-color: var(--ink); background: var(--card); }
.side a.nav.active { background: var(--lime); border: var(--border); box-shadow: 3px 3px 0 0 var(--ink); }
.side .grow { flex: 1; }
.side .who { font-size: .85rem; color: var(--muted); padding: 10px 8px 0; border-top: 2px solid var(--soft-line); }
.side .who b { color: var(--ink); }
.strip { background: var(--lime); border-bottom: var(--border); padding: 8px 32px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 12px; }
.strip span:last-child { letter-spacing: 0; text-transform: none; font-weight: 700; font-size: .8rem; }
main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.content { min-width: 0; }

/* ---------- cards / forms */
.card { background: var(--card); border: var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > h2:first-child { display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pink); border: var(--border); color: var(--ink); font-size: .85rem; font-family: Inter, sans-serif; font-weight: 800; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 12px; }
label.field { display: block; }
label.field > span { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: var(--border); border-radius: var(--btn-radius); padding: 9px 11px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 3px 3px 0 0 var(--hot); }
input[type=file] { font: inherit; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-weight: 600; }
.check input { margin-top: 4px; accent-color: var(--ink); width: 16px; height: 16px; }
.check small { display: block; font-weight: 500; }

button, .btn { font: inherit; font-weight: 800; font-size: .88rem; border: var(--border); background: var(--cream); color: var(--ink); padding: 9px 15px; border-radius: var(--btn-radius); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; transition: transform .08s, box-shadow .08s; }
button:hover, .btn:hover { background: #fff; }
button.primary, .btn.primary { background: var(--lime); box-shadow: 3px 3px 0 0 var(--ink); }
button.primary:hover, .btn.primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 var(--ink); background: var(--lime); }
button.primary:active, .btn.primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--ink); }
button.ghost { background: transparent; border-color: transparent; }
button.link { background: none; border: none; padding: 0; color: var(--berry); font-weight: 700; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
button.danger { color: var(--danger); }
button.link.danger { color: var(--danger); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
button.big { padding: 13px 22px; font-size: 1rem; }
.btn::after, button.primary.big::after { content: "↗"; font-weight: 700; }
.btn.no-arrow::after { content: none; }

/* ---------- flat icons */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.side a.nav .ic { width: 20px; height: 20px; }
.pill .ic { width: 12px; height: 12px; }
.note { display: flex; gap: 8px; align-items: flex-start; }
.note .ic { margin-top: 2px; }
.check small .ic { width: 12px; height: 12px; color: var(--berry); }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chosen-list .ch button { padding: 6px; justify-content: center; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); white-space: nowrap; }
.pill.store { background: var(--yellow); }
.pill.draft { background: var(--pink); }
.pill.ok { background: var(--lime); }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.pill.diet { background: var(--cream); }
.note { padding: 10px 14px; border-radius: var(--btn-radius); border: 2px solid var(--ink); background: var(--warn-soft); font-size: .9rem; margin: 8px 0; font-weight: 600; }
.note.info { background: var(--cream); }
.note.ok { background: var(--ok-soft); }

/* ---------- tables */
table.nut { width: 100%; border-collapse: collapse; font-size: .9rem; border: var(--border); background: #fff; }
table.nut th { background: var(--ink); color: #fff; font-weight: 700; }
table.nut th, table.nut td { border-bottom: 1px solid var(--soft-line); padding: 5px 9px; text-align: left; }
table.nut td:last-child, table.nut th:last-child { text-align: right; }
table.nut tr.sub td:first-child { padding-left: 24px; color: var(--muted); }
table.nut input { width: 92px; text-align: right; padding: 5px 8px; }
.scroll-x { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 8px; border-bottom: var(--border); }
table.list td { padding: 9px 8px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; }
table.list tr:hover td { background: var(--cream); }

/* ---------- shopify preview */
.preview { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 18px; background: #fff; font-size: .95rem; }
.preview table { border-collapse: collapse; margin-top: 6px; }
.preview th, .preview td { border: 1px solid #ccc; padding: 2px 12px; }
.preview td p, .preview th p { margin: 4px 0; }
.ingredients strong { color: #000; font-weight: 800; }

/* ---------- home */
.hero { background: var(--cream); border: var(--border); border-radius: var(--radius); padding: 26px 26px 22px; margin-bottom: 20px; }
.hero h1 { font-size: 2.6rem; margin-bottom: .3em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 20px; }
.tile { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card); border: var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: transform .1s, box-shadow .1s; font-weight: 500; }
.tile:hover { transform: translate(-2px, -2px); box-shadow: 5px 6px 0 0 var(--ink); }
.tile .em { width: 46px; height: 46px; display: grid; place-items: center; border: var(--border); border-radius: 10px; background: var(--pink); }
.tile .em .ic { width: 24px; height: 24px; }
.tile:nth-child(2) .em { background: var(--lime); }
.tile:nth-child(3) .em { background: var(--yellow); }
.tile h2 { margin: 14px 0 6px; }
.tile .go { margin-top: auto; padding-top: 10px; font-weight: 800; font-size: .88rem; }
.tile .go::after { content: " ↗"; }

/* ---------- pick & mix picker */
.picker { max-height: 470px; overflow: auto; border: var(--border); border-radius: 10px; background: #fff; }
.picker .item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--soft-line); cursor: pointer; }
.picker .item:hover { background: var(--cream); }
.picker .item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--ink); background: var(--cream); flex: none; }
.picker .item .nm { flex: 1; min-width: 0; }
.picker .item .nm div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.picker .item.chosen { background: var(--lime); }
.chosen-list .ch { display: grid; grid-template-columns: 1fr 96px 30px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--soft-line); font-weight: 600; }
.chosen-list .ch input { text-align: right; padding: 6px 8px; }
.sizes { display: flex; gap: 10px; }
.sizes label { flex: 1; text-align: center; border: var(--border); border-radius: var(--btn-radius); padding: 10px 6px; cursor: pointer; font-weight: 800; background: var(--cream); }
.sizes input { display: none; }
.sizes label:has(input:checked) { background: var(--lime); box-shadow: 3px 3px 0 0 var(--ink); }
.total { font-weight: 800; }
.total.bad { color: var(--danger); }

.pdfwrap { border: var(--border); border-radius: var(--radius); overflow: hidden; background: var(--cream); box-shadow: var(--shadow); }
.pdfwrap iframe { width: 100%; height: 470px; border: 0; display: block; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--pink); }
.login .card { width: 100%; max-width: 380px; padding: 30px; background: var(--cream); }
.login .brand { text-align: center; margin-bottom: 6px; }
.login .wordmark { font-size: 40px; }
.login .wordmark .star { font-size: 30px; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.3em; font-weight: 600; }

.bookmarklet { display: inline-block; padding: 11px 16px; border-radius: var(--btn-radius); background: var(--pink); color: var(--ink); border: var(--border); box-shadow: 3px 3px 0 0 var(--ink); font-weight: 800; text-decoration: none; cursor: grab; }
details summary { cursor: pointer; font-weight: 700; }
code { background: var(--cream); border: 1px solid var(--soft-line); padding: 1px 6px; border-radius: 4px; font-size: .88em; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 0 var(--hot); padding: 10px 18px; border-radius: var(--btn-radius); font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
.hidden { display: none !important; }

main, .card, .split > *, .grid2 > * { min-width: 0; }
@media (max-width: 960px) {
  .split, .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; gap: 4px; border-right: none; border-bottom: var(--border); }
  .side .logo { width: 100%; padding: 0 0 8px; }
  .side .wordmark { font-size: 24px; }
  .side .wordmark .star { font-size: 18px; }
  .side a.nav { padding: 6px 9px; font-size: .85rem; }
  .side .grow, .side .who, .side .tagline { display: none; }
  .strip { padding: 7px 16px; }
  .strip span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .strip span:last-child { white-space: nowrap; }
  main { padding: 18px 16px 50px; }
  h1, .hero h1 { font-size: 1.8rem; }
  .card, .hero { padding: 16px; }
  .grid3 { grid-template-columns: 1fr; }
  .sizes label { padding: 9px 4px; }
  table.list th:nth-child(3), table.list td:nth-child(3) { display: none; }
}
