/* SNDR Framköllun, in Instaprent's Coutumes system: prints laid on her beige
   table, square controls, extended caps for labels and sizes, the serif for
   text, one black button. Colours are literal because the crop editor opens
   outside the theme's .ip wrapper (the faces are global @font-face rules). */
.fk, .fk-ed {
  --table: #ece9e2;
  --table-2: #e2ded5;
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: rgba(0, 0, 0, .6);
  --line: rgba(0, 0, 0, .14);
  --orange: #f67a32;
  --warn: #8a4a00;
  --warn-bg: #fdebd9;
  --shadow: 0 1px 1px rgba(17, 17, 17, .06), 0 6px 18px -6px rgba(17, 17, 17, .22);
  --serif: 'IP Serif', Georgia, 'Times New Roman', serif;
  --ext: 'IP Ext', Arial, sans-serif;
  --cond: 'IP Cond', 'Arial Narrow', Arial, sans-serif;
  --ease: cubic-bezier(.215, .61, .355, 1);
  font-family: var(--serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.fk *, .fk-ed * { box-sizing: border-box; }
/* zero specificity, so every .fk-* control keeps its own face */
:where(.fk, .fk-ed) button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.fk :focus-visible, .fk-ed :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.fk-cap { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; }

/* the tool runs edge to edge under the page head */
.sndr-fk-page .ip-page { padding: 0; max-width: none; }
.sndr-fk-page .ip-woo { font-size: inherit; line-height: inherit; }

.fk {
  position: relative;
  background: var(--table);
  --gut: 16px;
  padding: 24px var(--gut) 140px;
  min-height: 70vh;
}
@media (min-width: 1024px) { .fk { --gut: 24px; padding: 40px var(--gut) 160px; } }
/* a phone on its side: nothing under the camera cut-out or the rounded corners (the theme sets viewport-fit=cover) */
.fk { padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); }

/* ---------- head ---------- */
.fk-head { max-width: 46ch; margin-bottom: 24px; }
.fk-lede { margin: 0; font-size: 14px; line-height: 18px; color: var(--ink-2); }

/* ---------- size buttons (Coutumes square size buttons) ---------- */
.fk-sizes { margin-bottom: 28px; }
.fk-label { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; color: var(--ink); margin: 0 0 12px; }
.fk-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin-inline: calc(var(--gut) * -1);
  padding: 2px var(--gut) 6px;
  scroll-padding-inline: var(--gut);
}
.fk-chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .fk .fk-chips { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; } }
.fk-chip {
  flex: none;
  scroll-snap-align: start;
  display: grid;
  gap: 3px;
  min-width: 78px;
  padding: 10px 12px 9px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  cursor: pointer;
  transition: box-shadow .15s var(--ease);
}
@media (hover: hover) { .fk-chip:hover { box-shadow: inset 0 0 0 1px #888; } }
.fk-chip-size { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; letter-spacing: .02em; white-space: nowrap; }
.fk-chip-price { font-size: 12px; line-height: 14px; color: var(--ink-2); white-space: nowrap; }
.fk-chip[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---------- the kind of print (photos, large prints, canvas), then its size ---------- */
.fk-chooser { display: grid; gap: 10px; min-width: 0; }
.fk-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.fk-kinds[hidden], .fk-gridpick[hidden], .fk-chooser .fk-chips[hidden] { display: none; }
.fk-kind {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--ext);
  font-weight: 700;
  font-size: 11px;
  line-height: 14px;
  text-transform: uppercase;
  letter-spacing: .02em;
  cursor: pointer;
  transition: box-shadow .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
@media (hover: hover) { .fk-kind:hover { box-shadow: inset 0 0 0 1px #888; } }
.fk-kind[aria-checked="true"] { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
/* canvas: her grid is a short side and a long side; each long side shows its price */
.fk-gridpick { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; }
.fk-sel-l { display: grid; gap: 6px; min-width: 0; }
.fk-sel-t { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); }
.fk-sel {
  min-width: 128px;
  min-height: 44px;
  padding: 10px 34px 10px 12px;
  border: 0;
  border-radius: 0;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--serif);
  font-size: 16px; /* 16 px or more: a phone does not zoom the page when the list opens */
  line-height: 20px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
/* the theme sets every select inside .ip-woo to inherit its font: the lists keep the serif, like the tool's other text */
.fk .fk-sel, .fk-ed .fk-sel { font-family: var(--serif); font-weight: 400; }
@media (hover: hover) { .fk-sel:hover { box-shadow: inset 0 0 0 1px #888; } }
.fk-sel-x { padding-bottom: 12px; color: var(--ink-2); }
.fk-sel-l:last-child { flex: 1 1 200px; max-width: 320px; }
.fk-sel { width: 100%; }
/* narrow (a phone, the editor's panel): the two lists one above the other, each the full width */
.fk-chooser { container-type: inline-size; }
@container (max-width: 400px) {
  .fk-sel-x { display: none; }
  .fk-sel-l, .fk-sel-l:last-child { flex: 1 1 100%; max-width: none; }
}
/* canvas: the dashed line is the front's edge, the shaded band goes round the frame's sides */
.fk-wrapline {
  display: none;
  position: absolute;
  inset: var(--wy, 0) var(--wx, 0);
  outline: 1px dashed rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 1px rgba(17, 17, 17, .3), 0 0 0 100vmax rgba(17, 17, 17, .22);
  pointer-events: none;
}
.is-wrap > .fk-wrapline { display: block; }
.fk-ed-frame.is-wrap { overflow: hidden; }

/* ---------- fill or whole photo ---------- */
.fk-group + .fk-group { margin-top: 22px; }
.fk-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-width: 460px; }
.fk-seg-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  cursor: pointer;
  transition: box-shadow .15s var(--ease);
}
@media (hover: hover) { .fk-seg-btn:hover { box-shadow: inset 0 0 0 1px #888; } }
.fk-seg-btn[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }
.fk-seg-txt { display: grid; gap: 2px; min-width: 0; }
.fk-seg-label { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; }
.fk-seg-sub { font-size: 12px; line-height: 14px; color: var(--ink-2); }
/* a print: the photo fills it, or sits whole inside white margins */
.fk-seg-ico { position: relative; flex: none; width: 24px; height: 32px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); overflow: hidden; }
.fk-seg-ico::before { content: ""; position: absolute; background: linear-gradient(160deg, #f6a064, #f67a32 55%, #75c6e8); }
.fk-seg-ico--fill::before { inset: 0; }
.fk-seg-ico--fit::before { left: 1px; right: 1px; top: 9px; bottom: 9px; }
.fk-seg--ed { max-width: none; }
.fk-card.is-fit .fk-win { background: var(--paper); }

/* ---------- buttons (c-button -bg) ---------- */
.fk-btn {
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 0 22px;
  min-height: 44px;
  font-family: var(--ext);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.27;
  text-transform: uppercase;
  letter-spacing: .02em;
  cursor: pointer;
  transition: opacity .2s, background-color .2s;
}
.fk-btn--ink { background: var(--ink); color: var(--paper) !important; }
.fk-btn--lg { min-height: 52px; padding: 0 32px; }
.fk-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.fk-btn:disabled { cursor: default; }

/* ---------- empty state ---------- */
.fk-empty { display: grid; justify-items: center; gap: 18px; padding: 48px 0 32px; text-align: center; }
@media (min-width: 1024px) { .fk-empty { padding: 88px 0 48px; } }
.fk-stack { position: relative; width: 150px; height: 150px; margin-bottom: 14px; }
.fk-stack i { position: absolute; inset: 12px 30px; background: var(--paper); box-shadow: var(--shadow); }
.fk-stack i:nth-child(1) { transform: rotate(-9deg) translate(-14px, 4px); }
.fk-stack i:nth-child(2) { transform: rotate(6deg) translate(16px, 2px); }
.fk-stack i:nth-child(3) { inset: 22px 18px; }
.fk-stack i:nth-child(3)::after { content: ""; position: absolute; inset: 8px; background: linear-gradient(160deg, #f6f2eb, var(--table-2)); }
.fk-empty[hidden] { display: none; }
.fk-drop-hint { margin: 0; font-size: 14px; font-style: italic; color: var(--ink-2); }
@media (hover: none) { .fk-drop-hint { display: none; } }

/* ---------- grid of prints ---------- */
.fk-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 12px;
}
@media (min-width: 900px) { .fk-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px 20px; } }
.fk-grid[hidden] { display: none; }

.fk-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; } /* never wider than its column */
.fk-card.is-new { animation: fk-in .24s var(--ease) both; }
.fk-card.is-leaving { pointer-events: none; }
@keyframes fk-in { from { opacity: 0; transform: translateY(10px); } }

.fk-print {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  container-type: inline-size;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
}
.fk-sheet { position: relative; display: grid; place-items: center; isolation: isolate; }
/* quantity: extra sheets peek out from underneath */
.fk-sheet::before, .fk-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  z-index: -1;
  opacity: 0;
  transition: opacity .2s var(--ease), transform .3s var(--ease);
}
.fk-card[data-qty="2"] .fk-sheet::before,
.fk-card[data-qty="3"] .fk-sheet::before { opacity: 1; transform: rotate(3.5deg) translate(3%, 1%); }
.fk-card[data-qty="3"] .fk-sheet::after { opacity: 1; transform: rotate(-4deg) translate(-3%, 2%); }

.fk-paper {
  position: relative;
  display: block;
  width: calc(86cqi * var(--wmul, 1));
  aspect-ratio: var(--r, .6667);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: width .24s var(--ease), aspect-ratio .24s var(--ease);
}
.fk-win { position: absolute; overflow: hidden; background: var(--table-2); }
.fk-win img { position: absolute; max-width: none; display: block; transition: opacity .3s var(--ease); user-select: none; }
.fk-card[data-status="reading"] .fk-win img:not([src]) { opacity: 0; }
.fk-card:not([data-status="done"]) .fk-win img { opacity: .55; }
@media (hover: hover) { .fk-print:hover .fk-paper { box-shadow: 0 1px 1px rgba(17, 17, 17, .06), 0 12px 28px -8px rgba(17, 17, 17, .3); } }

/* upload ring, bottom-left of the cell */
.fk-ring {
  --p: 0;
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(var(--ink) calc(var(--p) * 360deg), rgba(17, 17, 17, .14) 0);
  -webkit-mask: radial-gradient(circle, transparent 7px, #000 7.5px);
          mask: radial-gradient(circle, transparent 7px, #000 7.5px);
  transition: opacity .3s var(--ease);
}
.fk-card[data-status="done"] .fk-ring, .fk-card[data-status="error"] .fk-ring, .fk-card[data-status="bad"] .fk-ring { opacity: 0; }
.fk-card.is-saving .fk-ring { animation: fk-saving .8s ease-in-out infinite alternate; }
@keyframes fk-saving { to { opacity: .35; } }

.fk-retry {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -80%);
  border: 0;
  background: var(--ink);
  color: var(--paper) !important;
  font-family: var(--ext);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
}
.fk-card[data-status="error"] .fk-retry { display: block; }
.fk-bad { display: none; position: absolute; inset: 20% 12% auto; margin: 0; text-align: center; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.fk-card[data-status="bad"] .fk-bad { display: block; }
.fk-card[data-status="bad"] .fk-paper { opacity: .5; }
.fk-card[data-status="bad"] .fk-meta { visibility: hidden; }
.fk-card[data-status="bad"] .fk-x { opacity: 1; }
.fk-card[data-status="error"] .fk-win img { opacity: .25; }

.fk-x { position: absolute; top: 0; right: 0; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; opacity: .95; }
.fk-x::before {
  content: "";
  width: 26px;
  height: 26px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='1.6'%3E%3Cpath d='M8 8l8 8M16 8l-8 8'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 1px 4px rgba(17, 17, 17, .2);
}
@media (hover: hover) {
  .fk-x { opacity: 0; transition: opacity .15s; }
  .fk-card:hover .fk-x, .fk-x:focus-visible { opacity: 1; }
}

.fk-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 6px; padding-inline: 2px; }
/* the size (and the low-resolution tag) keep their width; on a narrow card the count moves under them instead of squeezing them */
.fk-meta-l { display: flex; align-items: center; gap: 6px; min-width: max-content; }
.fk-meta .fk-qty { flex: none; }
.fk-meta-l { flex: 1 1 auto; }
.fk-size { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; border: 0; background: none; padding: 8px 0; font-family: var(--ext); font-weight: 700; font-size: 11px; letter-spacing: .02em; cursor: pointer; white-space: nowrap; text-align: left; }
.fk-size-l { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
/* "heil mynd" on its own small line, so a narrow card never pushes the count box out */
.fk-size-fit { font-weight: 500; font-size: 10px; color: var(--ink-2); }
.fk-warn { border: 0; cursor: pointer; font-family: var(--ext); font-weight: 700; font-size: 9px; text-transform: uppercase; letter-spacing: .02em; color: var(--warn); background: var(--warn-bg); padding: 4px 6px; white-space: nowrap; }
@media (max-width: 420px) { .fk-warn { font-size: 0; width: 10px; height: 10px; padding: 0; background: var(--orange); } }
.fk-warn[hidden] { display: none; }

.fk-qty { display: flex; align-items: center; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.fk-step { width: 36px; height: 44px; border: 0; background: none; font-size: 14px; line-height: 1; cursor: pointer; }
/* no double-tap-to-zoom wait on the phone: a tap on + counts at once, two quick taps count twice */
.fk button, .fk-ed button, .fk-bar button { touch-action: manipulation; }
.fk-step:disabled { opacity: .3; cursor: default; }
.fk-qty-n { width: 40px; height: 44px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; appearance: none; text-align: center; font-variant-numeric: tabular-nums; font-family: var(--ext); font-size: 16px; color: inherit; } /* 16 px: iPhone zooms into smaller fields */
@media (hover: hover) and (pointer: fine) { .fk-qty-n { font-size: 13px; } }
.fk-qty-n:focus { outline: none; box-shadow: inset 0 -2px 0 var(--ink); }
.fk-qty-n::placeholder { color: var(--ink-2); }

.fk-add { display: grid; min-width: 0; }
.fk-add-btn {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0; /* the caps label wraps inside the cell instead of widening it */
  padding: 12px;
  text-align: center;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  background: transparent;
  font-family: var(--ext);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--ink) !important;
  cursor: pointer;
  transition: box-shadow .2s, background-color .2s;
}
@media (hover: hover) { .fk-add-btn:hover { box-shadow: inset 0 0 0 1px var(--ink); background: rgba(255, 255, 255, .4); } }
.fk-plus { position: relative; width: 36px; height: 36px; background: var(--paper); box-shadow: var(--shadow); }
.fk-plus::before, .fk-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: var(--ink); transform: translate(-50%, -50%); }
.fk-plus::after { transform: translate(-50%, -50%) rotate(90deg); }

/* ---------- bottom bar (Coutumes phone buy bar, on every size) ---------- */
.fk-bar {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--paper);
  box-shadow: 0 -1px 0 var(--line);
  transform: translateY(110%);
  transition: transform .26s var(--ease);
}
.fk.has-photos .fk-bar { transform: none; }
@media (min-width: 1024px) { .fk-bar { padding: 14px max(24px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); } }
.fk-bar-sum { display: grid; min-width: 0; gap: 2px; }
.fk-bar-count { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; }
.fk-bar-count span { white-space: nowrap; }
.fk-bar-total { font-family: var(--ext); font-weight: 700; font-size: 16px; line-height: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fk-bar-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.fk-bar-state { font-size: 12px; line-height: 16px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fk-bar-state.is-dirty { color: var(--warn); }
.fk-bar-note { border: 0; background: none; padding: 2px 0 0; text-align: left; font-size: 12px; color: var(--warn) !important; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.fk-bar-note[hidden] { display: none; }
.fk-bar-net { margin: 0; padding-top: 2px; font-size: 12px; line-height: 16px; color: var(--warn); }
.fk-bar-net[hidden] { display: none; }

/* ---------- removed, with "Hætta við" (above the bar) ---------- */
.fk-toast {
  position: fixed; z-index: 51; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); width: min(calc(100vw - 32px), 460px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 16px;
  background: var(--ink); color: var(--paper); font-size: 15px; line-height: 21px;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s var(--ease);
}
.fk-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fk-toast-undo { flex: none; min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--paper) !important; font-family: var(--ext); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .02em; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (min-width: 1024px) { .fk-toast { bottom: 100px; } }
.fk-ed .fk-toast { top: calc(60px + env(safe-area-inset-top)); bottom: auto; }
.fk-toast-undo[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .fk-toast { transition: none; } }

/* ---------- photos that did not come back after a reload ---------- */
.fk-lost { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 24px; padding: 14px 48px 14px 16px; font-size: 15px; line-height: 22px; color: var(--warn); background: var(--warn-bg); }
.fk-lost[hidden] { display: none; }
.fk-lost > span { flex: 1 1 22ch; min-width: 0; }
.fk-lost .fk-btn { min-height: 44px; }
.fk-lost-x { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; background: none; cursor: pointer; }
.fk-lost-x::before, .fk-lost-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.fk-lost-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.fk-bar-btn { --p: 0; position: relative; flex: none; overflow: hidden; min-width: 188px; min-height: 48px; }
@media (max-width: 420px) { .fk-bar-btn { flex: 0 1 auto; min-width: min(188px, 56%); max-width: 58%; padding: 6px 14px; } } /* a long label wraps instead of running over the total */
@media (min-width: 1024px) { .fk-bar-btn { min-width: 320px; } }
.fk-bar-btn:disabled { opacity: 1; background: #3a3a3a; }
.fk-bar-btn.is-loading { background: linear-gradient(90deg, var(--ink) calc(var(--p) * 100%), #777 0); transition: background .25s; }
.fk-bar-btn:disabled:not(.is-loading) { opacity: .4; }

/* ---------- under the grid ---------- */
.fk-foot { display: flex; justify-content: flex-end; margin-top: 28px; }
.fk-clear { border: 0; background: none; padding: 10px 0; font-size: 13px; color: var(--ink-2) !important; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fk-clear[hidden] { display: none; }

/* ---------- drop veil ---------- */
.fk-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(236, 233, 226, .88);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
}
.fk-veil span { font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(48px, 9vw, 140px); line-height: .85; color: var(--orange); }
.fk.is-dropping .fk-veil { opacity: 1; }

/* ---------- crop editor ---------- */
.fk-ed {
  width: min(960px, 100vw);
  height: min(860px, 100dvh);
  max-width: 100vw;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  margin: auto; /* the theme's reset zeroes the dialog's own centring margin */
  background: var(--paper);
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
/* phone: the photo (at least 30% of the screen), the open tool's choices, the tools along the bottom */
.fk-ed-body { display: grid; min-height: 0; grid-template-rows: minmax(min(30dvh, 240px), 1fr) minmax(0, max-content) auto; grid-template-areas: "stage" "panel" "bar"; }
.fk-ed-stage { grid-area: stage; }
.fk-ed-panel { grid-area: panel; }
.fk-ed-bar { grid-area: bar; }
.fk-ed[open] { display: grid; animation: fk-ed-in .24s var(--ease); }
.fk-ed::backdrop { background: rgba(0, 0, 0, .35); }
@keyframes fk-ed-in { from { opacity: 0; transform: translate3d(0, 24px, 0); } }
@media (max-width: 767px) { .fk-ed { width: 100vw; height: 100dvh; } }

.fk-ed-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left));
  padding-top: max(6px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.fk-link { border: 0; background: none; padding: 12px; cursor: pointer; justify-self: start; font-family: var(--ext); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2) !important; }
.fk-link--strong { justify-self: end; color: var(--ink) !important; }
.fk-ed-nav { display: flex; align-items: center; gap: 4px; }
.fk-ed-count { font-family: var(--ext); font-size: 12px; min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.fk-icon { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
@media (max-width: 360px) { .fk-ed-top .fk-link { padding-inline: 6px; } .fk-ed-count { min-width: 3.4em; } .fk-icon { width: 34px; } }
.fk-icon::before { content: ""; width: 8px; height: 8px; border: solid var(--ink); border-width: 0 0 1.5px 1.5px; transform: translateX(2px) rotate(45deg); }
.fk-icon--next::before { transform: translateX(-2px) rotate(-135deg); }
.fk-icon:disabled { opacity: .25; cursor: default; }
@media (hover: hover) { .fk-icon:hover:not(:disabled) { background: var(--table); } }

.fk-ed-stage { position: relative; overflow: hidden; background: var(--table); touch-action: none; cursor: grab; outline: none; }
.fk-ed-stage.is-dragging { cursor: grabbing; }
.fk-ed-stage.is-fit { cursor: default; }
.fk-ed-paper { position: absolute; display: none; background: var(--paper); }
.fk-ed-stage.is-fit .fk-ed-paper { display: block; }
.fk-ed-stage:focus-visible .fk-ed-frame { outline: 2px solid var(--ink); outline-offset: 4px; }
.fk-ed-stage img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; will-change: transform; }
.fk-ed-frame {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(236, 233, 226, .86);
  outline: 1px solid rgba(255, 255, 255, .9);
  pointer-events: none;
  transition: width .24s var(--ease), height .24s var(--ease), left .24s var(--ease), top .24s var(--ease);
}
.fk-ed-stage.is-dragging .fk-ed-thirds { opacity: 1; }
.fk-ed-thirds {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .2s;
  background:
    linear-gradient(90deg, transparent calc(33.333% - .5px), rgba(255,255,255,.7) 0, rgba(255,255,255,.7) calc(33.333% + .5px), transparent 0, transparent calc(66.666% - .5px), rgba(255,255,255,.7) 0, rgba(255,255,255,.7) calc(66.666% + .5px), transparent 0),
    linear-gradient(0deg, transparent calc(33.333% - .5px), rgba(255,255,255,.7) 0, rgba(255,255,255,.7) calc(33.333% + .5px), transparent 0, transparent calc(66.666% - .5px), rgba(255,255,255,.7) 0, rgba(255,255,255,.7) calc(66.666% + .5px), transparent 0);
}

.fk-ed-panel { display: grid; align-content: start; grid-auto-rows: max-content; gap: 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); border-top: 1px solid var(--line); }
.fk-pane { display: grid; gap: 10px; min-width: 0; }
.fk-pane[hidden] { display: none; }
.fk-pane-t { margin: 0; font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); }
.fk-ed-row--qty { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.fk-ed-row--qty .fk-pane-t { margin: 0; }
.fk-zoom-row[hidden] { display: none; }
.fk-zb { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); cursor: pointer; }

/* the tools: a line icon with its word under it, as in the studio; the open one is marked in orange */
.fk-ed-bar { display: flex; gap: 2px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); background: var(--paper); border-top: 1px solid var(--line); }
.fk-ed-bar::-webkit-scrollbar { display: none; }
.fk-tool {
  position: relative; flex: 1 0 auto; display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 52px; min-height: 58px; padding: 6px 4px;
  border: 0; background: none; color: var(--ink) !important; cursor: pointer; transition: background-color .16s ease, transform .16s var(--ease);
}
.fk-tool span { font-family: var(--serif); font-size: 12px; line-height: 15px; white-space: nowrap; }
.fk-tool[aria-pressed="true"] { background: var(--table); box-shadow: inset 0 -2px 0 var(--orange); }
.fk-ed-del { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px 0 6px; border: 0; background: none; color: #a8321c !important; cursor: pointer; }
.fk-ed-del svg { width: 20px; height: 20px; }
.fk-ed-del span { font-family: var(--serif); font-size: 13px; line-height: 16px; }
@media (hover: hover) and (pointer: fine) { .fk-ed-del:hover { background: rgba(168, 50, 28, .06); } }
.fk-ed-stage:focus-visible { outline: none; } /* the frame shows the focus, not the whole stage */
.fk-tool:disabled { opacity: .35; cursor: default; }
.fk-tool:active:not(:disabled) { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .fk-tool:hover:not(:disabled):not([aria-pressed="true"]) { background: rgba(0, 0, 0, .05); } }
.fk-tool.is-low::after { content: ""; position: absolute; top: 7px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.fk-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--paper); font-family: var(--ext); font-weight: 700; font-size: 10px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.fk-badge[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .fk-tool { transition: none; } }
@media (max-width: 360px) { .fk-tool { min-width: 0; padding-inline: 2px; } .fk-tool span { font-size: 11px; } .fk-ed-bar { gap: 0; padding-inline: max(2px, env(safe-area-inset-left)) max(2px, env(safe-area-inset-right)); } }

/* a computer: the tools in a rail on the left, the photo in the middle, the choices on the right */
@media (min-width: 900px) and (min-height: 541px) {
  .fk-ed-body { grid-template-columns: 92px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); grid-template-areas: "bar stage panel"; }
  .fk-ed-bar { flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 8px 6px; border-top: 0; box-shadow: 1px 0 0 var(--line); }
  .fk-tool { flex: none; width: 100%; min-height: 64px; }
  .fk-tool span { font-size: 13px; line-height: 16px; }
  .fk-ed-panel { border-top: 0; box-shadow: -1px 0 0 var(--line); padding: 22px 20px; gap: 16px; }
  .fk-ed .fk-chips--ed { flex-wrap: wrap !important; overflow: visible !important; margin-inline: 0; padding-inline: 0; }
}
/* a phone turned sideways (or any short, wide window): the photo on the left, the choices and the tools beside it */
@media (orientation: landscape) and (max-height: 540px) {
  .fk-ed-body { grid-template-columns: minmax(0, 1fr) minmax(300px, 46%); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "stage panel" "stage bar"; }
  .fk-ed-stage { margin-left: env(safe-area-inset-left); } /* the crop frame stays clear of the camera cut-out */
  .fk-ed-panel { border-top: 0; border-left: 1px solid var(--line); }
  .fk-ed-bar { border-left: 1px solid var(--line); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
}
.fk-ed-row { display: flex; align-items: center; gap: 14px; }
.fk-ed-row--qty { justify-content: space-between; }
.fk-ed-row--qty .fk-label { margin: 0; }
.fk-ed-warn { margin: 0; font-size: 13px; line-height: 18px; color: var(--warn); background: var(--warn-bg); padding: 10px 12px; }
.fk-ed-warn[hidden] { display: none; }
.fk-ed-hint { margin: 0 0 -6px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.fk-ed-hint[hidden] { display: none; }
.fk-chips--ed { margin-inline: -16px; padding-inline: 16px; flex-wrap: nowrap !important; overflow-x: auto !important; }
.fk-ed .fk-chip { min-width: 70px; padding: 8px 10px 7px; }

.fk-zoom[hidden] { display: none; }
.fk-zoom { flex: 1; min-width: 0; height: 32px; accent-color: var(--ink); background: transparent; -webkit-appearance: none; appearance: none; }
.fk-zoom::-webkit-slider-runnable-track { height: 1.5px; background: var(--ink); }
.fk-zoom::-moz-range-track { height: 1.5px; background: var(--ink); }
.fk-zoom::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border-radius: 50%; background: var(--ink); cursor: pointer; }
.fk-zoom::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .fk *, .fk-ed, .fk-ed * { animation: none !important; transition: none !important; }
}

/* ---------- steps: 1 · 2 · 3 at the top, numbered sections, the review ---------- */
.fk-steps { position: sticky; top: calc(var(--nav-h, 56px) + 0px); z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; list-style: none; margin: -24px calc(var(--gut) * -1) 24px; padding: 10px var(--gut); background: var(--table); box-shadow: 0 1px 0 var(--line); }
@media (min-width: 1024px) { .fk-steps { margin-top: -40px; margin-bottom: 36px; } }
.fk-steps { margin-left: calc(-1 * max(var(--gut), env(safe-area-inset-left))); margin-right: calc(-1 * max(var(--gut), env(safe-area-inset-right))); padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); }
/* a phone on its side has little height: the steps scroll away instead of staying over the photos */
@media (orientation: landscape) and (max-height: 540px) { .fk-steps { position: static; } }
.fk-steps li { min-width: 0; }
.fk-step-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink-2) !important; }
.fk-step-btn b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px currentColor; font-family: var(--ext); font-size: 11px; }
.fk-step-btn span { font-family: var(--ext); font-weight: 700; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; }
.fk-steps .is-on .fk-step-btn { color: var(--ink) !important; }
.fk-steps .is-on .fk-step-btn b { background: var(--ink); color: var(--paper); box-shadow: none; }
.fk-steps .is-done .fk-step-btn { color: var(--ink) !important; }
.fk-steps .is-done .fk-step-btn b { background: #75c6e8; box-shadow: none; }
.fk-step-btn:disabled { cursor: default; opacity: .55; }
@media (max-width: 599px) {
  .fk-step-btn { flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 2px; }
  .fk-step-btn span { font-size: 10px; line-height: 12px; }
}

.fk-sec { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 28px; }
.fk-sec b { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #75c6e8; font-family: var(--ext); font-weight: 700; font-size: 13px; }
.fk-sizes .fk-sec { margin-bottom: 20px; }
.fk-group .fk-label { margin-bottom: 10px; }
.fk-rule { margin: 12px 0 0; font-size: 14px; line-height: 20px; }
.fk-rule--low { margin-top: 6px; color: var(--warn); }
.fk-rule[hidden], .fk-group[hidden] { display: none; }
.fk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); vertical-align: 1px; }
.fk-chip { position: relative; }
.fk-chip.is-low::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.fk-group--qty .fk-qty { display: inline-flex; }
.fk-photos-head { margin-bottom: 20px; }
.fk-photos-head[hidden] { display: none; }
.fk-hint { margin: 0; max-width: 60ch; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.fk-empty .fk-sec { justify-self: center; margin: 0 0 8px; }
.fk-empty-hint { margin: 0; font-size: 15px; line-height: 22px; }
.fk-foot { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.fk-help { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.fk-help a { color: var(--ink) !important; text-decoration: underline; text-underline-offset: 3px; }

/* review: hides the choosing, shows the order as it will be printed */
.fk.is-review .fk-sizes, .fk.is-review .fk-empty, .fk.is-review .fk-grid, .fk.is-review .fk-photos-head, .fk.is-review .fk-clear { display: none; }
.fk-review[hidden] { display: none; }
.fk-review { display: grid; gap: 18px; max-width: 980px; outline: none; }
.fk-review .fk-sec { margin: 0; }
.fk-rv-warn { margin: 0; padding: 12px 14px; font-size: 15px; line-height: 22px; color: var(--warn); background: var(--warn-bg); }
.fk-rv-group { background: var(--paper); padding: 16px; box-shadow: var(--shadow); }
.fk-rv-head { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; }
.fk-rv-head h3 { margin: 0; font-family: var(--ext); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.fk-rv-head span { font-size: 14px; color: var(--ink-2); }
.fk-rv-head strong { font-family: var(--ext); font-size: 15px; font-variant-numeric: tabular-nums; }
.fk-rv-math { margin: 6px 0 14px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.fk-rv-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
.fk-rv-item { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.fk-rv-paper { display: grid; place-items: center; aspect-ratio: 1; background: var(--table); container-type: inline-size; }
.fk-rv-paper .fk-paper { width: calc(78cqi * var(--wmul, 1)); }
@media (hover: hover) { .fk-rv-item:hover .fk-rv-paper { background: var(--table-2); } }
.fk-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.fk-tag { font-family: var(--ext); font-weight: 700; font-size: 9px; line-height: 12px; text-transform: uppercase; letter-spacing: .02em; padding: 3px 5px; background: var(--table); }
.fk-tag--warn { color: var(--warn); background: var(--warn-bg); }
.fk-rv-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 0; border-top: 1px solid var(--line); }
.fk-rv-total span { font-family: var(--ext); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.fk-rv-total strong { font-family: var(--ext); font-size: 22px; font-variant-numeric: tabular-nums; }
.fk-rv-note { margin: 0; font-size: 15px; line-height: 22px; }
.fk-back { justify-self: start; min-height: 44px; border: 0; background: none; padding: 0; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 599px) {
  .fk-bar-btn-kr { display: none; }
  .fk-bar-line { flex-wrap: wrap; gap: 0 8px; }
  .fk-bar-state { white-space: normal; flex-basis: 100%; }
}
