/* Gootium A+ Builder — editor styles.
 *
 * Deliberately close to Seller Central's Premium A+ editor, because the shop owner asked for a
 * 1:1 copy and because that UI is genuinely good at one thing: you can tell what a module is
 * without reading its name. Screenshots this was built from live in
 * docs/baselines/amazon premium a plus/.
 *
 * This file is served at /app.css. It is a plain stylesheet, not a string inside a template
 * literal — the previous arrangement silently ate backslashes and let a stray backtick truncate
 * the whole script, twice.
 */

:root {
  --ink: #0f1111;
  --muted: #565959;
  --line: #d5d9d9;
  --line-soft: #e7e9ea;
  --bg: #f7f8f8;
  --head: #e9ebed;         /* module + card header grey */
  --teal: #007185;         /* Amazon's link/primary teal */
  --teal-dark: #005f6b;
  --bad: #b12704;
  --warn: #8a6116;
  --ok: #067d62;
  --overlay: #6f7373;      /* the grey text-overlay block in the hero mock */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--ink);
  font: 13px/1.5 "Amazon Ember", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---- chrome ------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border-bottom: 1px solid var(--line);
}
.crumbs { color: var(--muted); flex: 1; }
.crumbs b { color: var(--ink); font-weight: 600; }

.page { padding: 1rem 1.25rem 4rem; }
h1.title { font-size: 1.7rem; font-weight: 400; margin: .4rem 0 1rem; }
h1.title small { font-size: .8rem; color: var(--teal); margin-left: .6rem; }

/* the step rail, kept because it tells you where publishing sits in the flow */
.steps { display: flex; justify-content: center; gap: 3rem; padding: .9rem 0 1.2rem; border-top: 3px solid var(--line-soft); }
.step { display: flex; align-items: center; gap: .45rem; color: var(--muted); }
.step .dot { width: 13px; height: 13px; border: 1px solid var(--muted); border-radius: 50%; }
.step.done .dot { background: var(--teal); border-color: var(--teal); }
.step.done { color: var(--ink); }

.meta { display: flex; flex-wrap: wrap; gap: 2.5rem; padding: 0 0 1rem; border-bottom: 1px solid var(--line); }
.meta div { min-width: 90px; }
.meta .k { font-weight: 700; margin-bottom: .2rem; }
.meta .v { color: var(--muted); }

.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg); margin-bottom: 1rem; }
.tab { padding: .55rem 1.1rem; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); }
.tab.on { background: #fff; color: var(--ink); border-bottom-color: var(--teal); }

/* ---- buttons ------------------------------------------------------------ */

button, .btn {
  font: inherit; padding: .38rem .85rem; border-radius: 6px;
  border: 1px solid var(--teal); background: #fff; color: var(--teal); cursor: pointer;
}
button:hover, .btn:hover { background: #f0f7f8; }
button.primary, .btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
button.primary:hover { background: var(--teal-dark); }
button.plain { border-color: var(--line); color: var(--ink); }
button:disabled { opacity: .4; cursor: default; }
/* full header height, no radius, sharing borders, flush to the card's right edge */
button.iconbtn {
  border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0;
  width: 62px; align-self: stretch; font-size: 1.35rem; font-weight: 300; color: var(--ink);
  background: #fff; display: flex; align-items: center; justify-content: center;
}
button.iconbtn:hover { background: var(--bg); }
button.iconbtn:disabled { opacity: .25; background: #fff; }
.linklike { background: none; border: 0; color: var(--teal); cursor: pointer; padding: 0; }

/* ---- module card -------------------------------------------------------- */

/* Card chrome, measured from the baseline. The three full-height cells on the right are most of
   why two Amazon modules never blur together: each card ends in hard vertical rules. */
.mod { border: 1px solid var(--line); background: #fff; }
.mod-head { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 62px; }
.mod-title {
  flex: 1; display: flex; align-items: center; gap: .6rem; padding: 0 1.1rem;
  font-weight: 700; font-size: 1.05rem;
}
.pill { background: #146eb4; color: #fff; border-radius: 999px; padding: .1rem .5rem; font-size: .72rem; font-weight: 400; }
.mod-actions { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; }
.mod-body { padding: 1.1rem; }
.mod-foot {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: .9rem 1.1rem; min-height: 78px;
}
/* the required-image block, pushed to the right edge as in the baseline */
.foot-img { margin-left: auto; text-align: right; }
.foot-img-label { font-weight: 700; font-size: .82rem; margin-bottom: .35rem; }
.foot-img-row { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.foot-img-row img { width: 64px; height: 40px; object-fit: cover; border: 1px solid var(--line); }
.mod-foot .right { margin-left: auto; text-align: right; }
.req { color: var(--bad); }

/* ---- the layout mock ----------------------------------------------------
 * The point of the whole exercise: the fields sit where their output will sit.
 */
.mock { background: #fff; }
/* Empty and white, exactly as the baseline has it. The background image is NOT drawn here — a
   square photo behind a wide canvas is cover-cropped to a slice, which reads as a broken preview
   because it is not a preview. The only honest preview is the storefront one. */
.mock-canvas { position: relative; min-height: 430px; background: #fff; display: flex; align-items: center; }
.mock-canvas.pos-left  { justify-content: flex-start; }
.mock-canvas.pos-right { justify-content: flex-end; }
.overlay-box { background: var(--overlay); color: #fff; padding: 1.3rem; width: 48%; min-width: 320px; margin: 0 1.1rem; }
.overlay-box input[type=text], .overlay-box textarea, .overlay-box .rte { border-radius: 0; border-color: transparent; }
.overlay-box label { color: #fff; }
/* the counter has to stay readable against the overlay grey — this is the tightest layout in the
   builder, so it is exactly where someone needs to see how much room is left */
.overlay-box .count { color: rgba(255, 255, 255, .8); }
.overlay-box .count.over { color: #ffd0c8; }

.mock-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.mock-split.rev .mock-media { order: 2; }

.mock-cols { display: grid; gap: 1rem; }
.mock-cols.c3 { grid-template-columns: repeat(3, 1fr); }
.mock-cols.c4 { grid-template-columns: repeat(4, 1fr); }

.mock-rows { display: flex; flex-direction: column; gap: .5rem; }
.mock-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: .6rem; align-items: start; }
.mock-qa { border: 1px solid var(--line-soft); padding: .6rem; }

/* the image uploader for the hero sits under its canvas, where the canvas stands in for it */
.mock-under { border-top: 1px solid var(--line-soft); padding-top: .8rem; margin-top: .8rem; }

/* fields a bespoke layout did not place. Appended rather than dropped — a control that exists in
 * the contract but not on screen is a setting nobody can find. */
.extras { border-top: 1px solid var(--line-soft); margin-top: 1rem; padding-top: .7rem; }
.extras-head { font-weight: 700; color: var(--muted); font-size: .8rem; margin-bottom: .3rem; }

/* ---- fields ------------------------------------------------------------- */

label { display: block; font-weight: 700; margin: .7rem 0 .25rem; font-size: .82rem; }
label:first-child { margin-top: 0; }
input[type=text], textarea, select {
  width: 100%; padding: .4rem .55rem; border: 1px solid var(--line);
  border-radius: 4px; font: inherit; background: #fff; color: var(--ink);
}
input[type=text]:focus, textarea:focus, select:focus { outline: 2px solid #007185; outline-offset: -1px; }
textarea { min-height: 4.5rem; resize: vertical; }
.count { float: right; font-weight: 400; color: var(--muted); font-size: .75rem; }
.count.over { color: var(--bad); font-weight: 700; }
.hint { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

/* rich-text toolbar, cosmetic parity with Amazon's B I U " bullets */
.rt-bar { display: flex; gap: .1rem; background: #f3f3f3; border: 1px solid var(--line); border-bottom: 0; padding: .25rem; }
.rt-bar button { border: 0; background: none; padding: .15rem .45rem; color: var(--ink); border-radius: 3px; }
.rt-bar button:hover { background: #e3e3e3; }
.rt-bar + textarea { border-radius: 0 0 4px 4px; }

/* variant chooser: little diagrams, never a text dropdown */
.variants { display: flex; gap: .5rem; align-items: center; }
.variant { width: 84px; height: 36px; border: 2px solid var(--line); display: flex; cursor: pointer; padding: 3px; gap: 3px; background: #fff; }
.variant.on { border-color: var(--teal); }
.variant .v-lines { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 3px; }
.variant .v-lines span { height: 2px; background: #232f3e; display: block; }
.variant .v-block { flex: 1; background: #232f3e; }
.swatch { width: 60px; height: 34px; border: 2px solid var(--line); cursor: pointer; }
.swatch.on { border-color: var(--teal); }

/* image slot */
.dropzone { border: 1px dashed var(--teal); background: #fbfdfd; padding: 1.4rem 1rem; text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.over { background: #eef7f8; }
.dz-ratio { font-size: 1.15rem; font-weight: 700; color: var(--teal); }
.dz-hint { color: var(--muted); margin-top: .25rem; }
.dz-input { display: none; }
.crops { display: flex; gap: .75rem; flex-wrap: wrap; }
.cropwrap { max-width: 150px; }
.crop { position: relative; overflow: hidden; border: 1px solid var(--line); background: #f1f1f1; cursor: crosshair; }
.crop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cropcap { font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.focal { position: absolute; width: 13px; height: 13px; margin: -6px 0 0 -6px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--teal); pointer-events: none; }

/* the WYSIWYG body field */
.rte {
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 4px 4px;
  padding: .5rem .6rem; min-height: 4.5rem; background: #fff;
  /* colour explicitly: inside the hero's grey overlay box everything inherits white, and a
     white-on-white body field looks like an empty one that has silently lost its text */
  color: var(--ink);
  font: inherit; line-height: 1.55; overflow-wrap: anywhere;
}
.rte:focus { outline: 2px solid var(--teal); outline-offset: -1px; }
.rte ul, .rte ol { margin: .3rem 0; padding-left: 1.4rem; }
.rte blockquote { margin: .3rem 0; padding-left: .7rem; border-left: 3px solid var(--line); color: var(--muted); }
.rte a { color: var(--teal); }
.rt-note {
  margin-left: auto; color: var(--muted); font-size: .72rem; align-self: center;
  padding-right: .3rem;
  /* narrower than this sentence in a split layout or a compact row; truncate rather than clip
     mid-character, and keep the whole thing in the tooltip */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%;
}
.rt-bar { align-items: center; }

/* a compact repeating group: one item per line, the way a table row reads */
.item-body.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; align-items: start; }
.item-body.row label { margin-top: 0; }
.item-body.row textarea, .item-body.row .rte { min-height: 2.4rem; }

/* inside a repeating item or a grid cell the crop previews are reference, not the subject */
.item .cropwrap, .mock-cols .cropwrap { max-width: 108px; }

/* repeating groups */
.group { border: 1px solid var(--line-soft); padding: .7rem; margin-top: .7rem; }
.group-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; font-weight: 700; }
.group-count { margin-left: auto; font-weight: 400; color: var(--muted); font-size: .78rem; }
.group-count.under { color: var(--warn); font-weight: 700; }
.item { border: 1px solid var(--line-soft); margin-bottom: .5rem; }
.item-head { display: flex; align-items: center; gap: .3rem; padding: .3rem .5rem; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.item-head .grow { flex: 1; color: var(--muted); font-size: .78rem; }
.item-head button { border-color: var(--line); color: var(--ink); padding: .1rem .4rem; }
.item-body { padding: .6rem; }
.addrow { width: 100%; border-style: dashed; }

/* The dashed Add Module zone. One after every module, so the gap between two cards always has a
   dashed rectangle in it and the boundary is never ambiguous. */
.addzone { border: 1px dashed var(--line); padding: 3.2rem 1rem; text-align: center; margin: 1rem 0; cursor: pointer; }
.addzone-slim { padding: 1.5rem 1rem; }
.addzone:hover { background: #fbfcfc; border-color: var(--teal); }
/* neutral, like the baseline — this is not the page's primary action */
.addzone button { border-color: var(--line); color: var(--muted); padding: .55rem 1.4rem; font-size: .95rem; }
.addzone:hover button { color: var(--teal); border-color: var(--teal); }

/* the whole uploaded image, uncropped — the first thing anyone wants to see is the picture */
.shot {
  border: 1px solid var(--line); background: var(--bg); padding: .4rem;
  max-width: 380px; display: flex; justify-content: center;
}
.shot img { max-width: 100%; max-height: 240px; object-fit: contain; display: block; }

/* cropping, folded away until asked for */
.crop-det { border: 1px solid var(--line-soft); margin: .9rem 0 1rem; }
.crop-det > summary {
  padding: .5rem .7rem; cursor: pointer; font-weight: 700; font-size: .82rem;
  background: var(--bg); list-style-position: inside;
}
.crop-det[open] > summary { border-bottom: 1px solid var(--line-soft); }
.crop-body { padding: .7rem; }
.crop-body .crops { margin-top: .6rem; }

.modal-narrow { width: min(760px, 96vw); }

/* ---- picker modal ------------------------------------------------------- */

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; justify-content: center; padding: 2vh 2vw; z-index: 60; }
.modal { background: #fff; width: min(1500px, 98vw); max-height: 96vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal-head b { flex: 1; font-size: 1.15rem; }
.modal-body { padding: 1rem 1.1rem; overflow: auto; flex: 1; }
.modal-foot { padding: .7rem 1.1rem; border-top: 1px solid var(--line); text-align: right; }
.picker-search { margin-bottom: 1.2rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 1.6rem; }
.pcard { border: 1px solid var(--line); cursor: pointer; background: #fff; }
.pcard:hover { border-color: var(--teal); box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.pcard.off { opacity: .45; cursor: not-allowed; }
.pcard-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; background: var(--head); font-weight: 700; }
/* the example reaches the card's edges, as in the baseline — a generous margin here only shrinks
   the one thing the card exists to show */
.pcard-body { padding: .45rem; border-top: 1px solid var(--line-soft); }

/* The miniature render inside a picker card.
 *
 * Sized to be READ, not merely recognised. The first version drew this at 6px, which produced a
 * diagram of a module rather than an example of one — you could see that a thing had four columns
 * without being able to tell what went in them. Amazon's cards are legible at a glance and that is
 * most of why their picker works.
 */
.mini { border: 1px solid var(--line-soft); background: #fff; padding: 10px; font-size: 9px; line-height: 1.45; color: #333; }
.mini img { display: block; width: 100%; object-fit: cover; }
.mini .h { font-weight: 700; font-size: 12px; letter-spacing: .3px; text-transform: uppercase; margin: 3px 0; }
.mini .s { font-size: 7.5px; letter-spacing: .8px; text-transform: uppercase; color: #767676; }
.mini .p { color: #555; }
.mini-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.mini-cols { display: grid; gap: 8px; }
.mini-hero { position: relative; padding: 0; border: 0; }
.mini-hero .cap {
  position: absolute; left: 5%; top: 50%; transform: translateY(-50%); width: 44%;
  background: rgba(35, 47, 62, .88); color: #fff; padding: 8px;
  /* belt and braces: the copy above is short enough to fit, and if someone lengthens it later this
     keeps the result tidy instead of letting a half-word hang out of the box */
  overflow: hidden;
}
.mini-hero .cap .h, .mini-hero .cap .s, .mini-hero .cap .p { color: #fff; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table td, .mini-table th { border-bottom: 1px solid #eee; padding: 3px 4px; text-align: left; font-weight: 400; }
.mini-table th { font-weight: 700; }
.mini-qa { border-bottom: 1px solid #eee; padding: 4px 0; display: flex; justify-content: space-between; color: #444; }
.mini-pill { display: inline-block; border: 1px solid #ccc; border-radius: 999px; padding: 2px 9px; margin: 0 3px; }
/* a carousel is a strip that runs off the edge — clipping the last slide is the point, so it is
   given a whole slide's worth of width rather than being cut mid-caption */
.mini-strip { display: flex; gap: 7px; overflow: hidden; }
.mini-slide { min-width: 44%; flex: none; }
.mini-play { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: rgba(0,0,0,.55); }
.mini-play::after { content: ""; position: absolute; left: 12px; top: 8px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }

/* ---- notices ------------------------------------------------------------ */

.msg { padding: .55rem .8rem; margin-bottom: .6rem; border-radius: 4px; }
.msg.err { background: #fff0f0; border: 1px solid #f5c6c6; color: var(--bad); }
.msg.warn { background: #fff8e6; border: 1px solid #f0dca0; color: var(--warn); }
.msg.ok { background: #eefaf6; border: 1px solid #b7e3d6; color: var(--ok); }
.muted { color: var(--muted); }
.banner { display: flex; gap: .6rem; background: #eef7fa; border-left: 4px solid var(--teal); padding: .7rem .9rem; margin-bottom: 1rem; }

/* ---- product list ------------------------------------------------------- */

.plist { border: 1px solid var(--line); }
.prow { display: flex; align-items: center; gap: .8rem; padding: .55rem .8rem; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--bg); }
.prow img { width: 38px; height: 38px; object-fit: cover; background: #eee; }
.prow .name { flex: 1; }
.tag { font-size: .72rem; padding: .1rem .45rem; border-radius: 3px; background: #eee; color: var(--muted); }
.tag.on { background: #d7f2e6; color: var(--ok); }

/* ---- SERP preview ------------------------------------------------------- */

.serp { border: 1px solid var(--line); padding: .7rem; max-width: 600px; margin-top: .3rem; }
.serp-url { font-size: .76rem; color: #4d5156; }
.serp-title { color: #1a0dab; font-size: 1.05rem; line-height: 1.3; margin: .1rem 0; }
.serp-desc { font-size: .82rem; color: #4d5156; }
