#hfc-prep, #hfc-prep * { box-sizing: border-box; }
#hfc-prep {
  --prep-ink: #1c1b1a;
  --prep-paper: #eff1ec;
  --prep-card: #ffffff;
  --prep-accent: #d7263d;
  --prep-accent-soft: rgba(215,38,61,0.08);
  --prep-good: #2f8f5b;
  --prep-good-soft: rgba(47,143,91,0.10);
  --prep-line: #d8dad4;
  --prep-muted: #6b6e68;
  --prep-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --prep-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  max-width: 640px;
  margin: 2rem auto;
  background: var(--prep-card);
  border: 1px solid var(--prep-line);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--prep-sans);
  color: var(--prep-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
#hfc-prep [hidden] { display: none !important; }

#hfc-prep .hfc-prep__header {
  display: flex; align-items: center; gap: 12px;
  background: var(--prep-ink); color: #f4f4f2; padding: 18px 20px;
}
#hfc-prep .hfc-prep__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--prep-accent); flex-shrink: 0;
  animation: hfc-prep-pulse 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { #hfc-prep .hfc-prep__dot { animation: none; } }
@keyframes hfc-prep-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
#hfc-prep .hfc-prep__title { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; color: #f4f4f2 !important; }
#hfc-prep .hfc-prep__tag { margin: 2px 0 0; font-size: 0.85rem; color: #c7c7c3 !important; }

#hfc-prep .hfc-prep__body { padding: 20px; background: var(--prep-paper); }

#hfc-prep .hfc-prep__step {
  background: var(--prep-card);
  border: 1px solid var(--prep-line);
  border-radius: 12px;
  padding: 14px;
  margin: 0 0 14px;
  display: flex; flex-direction: column; gap: 12px;
}
#hfc-prep .hfc-prep__steptitle {
  margin: 0; font-size: 0.92rem; font-weight: 600; color: var(--prep-ink) !important;
  display: flex; align-items: center; gap: 8px;
}
#hfc-prep .hfc-prep__steptitle span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--prep-ink); color: #fff !important; font-size: 0.75rem; font-weight: 600;
}
#hfc-prep .hfc-prep__steptitle em { font-style: normal; font-weight: 400; color: var(--prep-muted) !important; font-size: 0.82rem; }

#hfc-prep .hfc-prep__label {
  display: block; font-size: 0.82rem; color: var(--prep-muted) !important; margin-bottom: 6px;
}
#hfc-prep .hfc-prep__field { min-width: 0; }
#hfc-prep .hfc-prep__row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

#hfc-prep .hfc-prep__select,
#hfc-prep .hfc-prep__input {
  width: 100%; font-family: var(--prep-sans); font-size: 0.88rem;
  padding: 8px 10px; border: 1px solid var(--prep-line); border-radius: 8px;
  background: var(--prep-paper); color: var(--prep-ink) !important; margin: 0;
}
#hfc-prep .hfc-prep__color {
  width: 100%; height: 36px; padding: 2px; border: 1px solid var(--prep-line);
  border-radius: 8px; background: var(--prep-paper); cursor: pointer;
}
#hfc-prep .hfc-prep__range { width: 100%; accent-color: var(--prep-accent); }

#hfc-prep .hfc-prep__segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
#hfc-prep .hfc-prep__segmented--3 { grid-template-columns: repeat(3, 1fr); }
#hfc-prep .hfc-prep__seg {
  padding: 9px 6px; border: 1px solid var(--prep-line); border-radius: 9px;
  background: var(--prep-card); font-family: var(--prep-sans); font-size: 0.8rem; font-weight: 500;
  color: var(--prep-ink) !important; cursor: pointer; text-align: center; line-height: 1.25;
}
#hfc-prep .hfc-prep__seg.is-active {
  border-color: var(--prep-accent); background: var(--prep-accent-soft); color: var(--prep-accent) !important;
}

#hfc-prep .hfc-prep__dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 26px 16px;
  border: 1.5px dashed var(--prep-line); border-radius: 12px;
  background: var(--prep-paper); cursor: pointer;
}
#hfc-prep .hfc-prep__dropzone.is-dragover { border-color: var(--prep-accent); background: var(--prep-accent-soft); }
#hfc-prep .hfc-prep__dropmain { font-size: 0.92rem; font-weight: 600; color: var(--prep-ink) !important; }
#hfc-prep .hfc-prep__dropnote { font-size: 0.76rem; color: var(--prep-muted) !important; }

#hfc-prep .hfc-prep__queuehead {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--prep-muted) !important; margin-bottom: 8px;
}
#hfc-prep .hfc-prep__link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 0.8rem; color: var(--prep-accent) !important; text-decoration: underline;
}
#hfc-prep .hfc-prep__thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
#hfc-prep .hfc-prep__thumb {
  position: relative; width: 56px; height: 56px; padding: 0;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: var(--prep-paper); cursor: pointer;
}
#hfc-prep .hfc-prep__thumbpick { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
#hfc-prep .hfc-prep__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#hfc-prep .hfc-prep__thumb.is-error { border-color: var(--prep-accent); opacity: .6; }
#hfc-prep .hfc-prep__thumb.is-selected { border-color: var(--prep-accent); }
#hfc-prep .hfc-prep__thumb.has-gps::after {
  pointer-events: none;
  content: "GPS"; position: absolute; left: 2px; bottom: 2px;
  font-size: 0.55rem; font-weight: 700; line-height: 1; padding: 2px 3px; border-radius: 3px;
  background: var(--prep-accent); color: #fff;
}
#hfc-prep .hfc-prep__thumbx {
  position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: rgba(28,27,26,0.75); color: #fff !important;
  font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; padding: 0;
}

#hfc-prep .hfc-prep__toggle {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer;
  color: var(--prep-ink) !important;
}
#hfc-prep .hfc-prep__toggle input { width: 18px; height: 18px; accent-color: var(--prep-accent); margin: 0; }
#hfc-prep .hfc-prep__wm { display: flex; flex-direction: column; gap: 12px; }
#hfc-prep .hfc-prep__wm > div { display: flex; flex-direction: column; gap: 12px; }
#hfc-prep .hfc-prep__wm > .hfc-prep__segmented,
#hfc-prep .hfc-prep__wm > .hfc-prep__row2 { display: grid; }

#hfc-prep .hfc-prep__uploadbtn {
  display: inline-block; align-self: flex-start; padding: 9px 14px;
  background: var(--prep-ink); color: #f4f4f2 !important;
  border-radius: 8px; font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
#hfc-prep .hfc-prep__note { margin: 0; font-size: 0.76rem; line-height: 1.45; color: var(--prep-muted) !important; }
#hfc-prep .hfc-prep__note:empty { display: none; }
#hfc-prep .hfc-prep__note code {
  font-family: var(--prep-mono); font-size: 0.74rem; background: var(--prep-paper);
  padding: 1px 4px; border-radius: 4px; color: var(--prep-ink) !important;
}
#hfc-prep .hfc-prep__privacy {
  margin: 0; font-size: 0.78rem; padding: 8px 10px; border-radius: 8px;
  background: var(--prep-good-soft); color: var(--prep-good) !important;
}

#hfc-prep .hfc-prep__stage {
  display: flex; justify-content: center; align-items: center;
  background: repeating-conic-gradient(#e6e8e2 0% 25%, #f4f5f1 0% 50%) 50% / 16px 16px;
  border-radius: 10px; padding: 12px; min-height: 120px;
}
#hfc-prep .hfc-prep__canvas {
  display: block; max-width: 100%; max-height: 420px; width: auto; height: auto;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}

#hfc-prep .hfc-prep__go {
  width: 100%; padding: 13px 16px; border-radius: 10px;
  border: 1px solid var(--prep-accent); background: var(--prep-accent);
  color: #fff !important; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  font-family: var(--prep-sans);
}
#hfc-prep .hfc-prep__go:disabled {
  background: var(--prep-line); border-color: var(--prep-line); color: var(--prep-muted) !important; cursor: not-allowed;
}
#hfc-prep .hfc-prep__progress {
  height: 6px; border-radius: 3px; background: var(--prep-line); overflow: hidden; margin-top: 10px;
}
#hfc-prep .hfc-prep__progress span { display: block; height: 100%; width: 0; background: var(--prep-accent); transition: width .2s; }

#hfc-prep .hfc-prep__results { margin-top: 16px; }
#hfc-prep .hfc-prep__summary {
  font-size: 0.86rem; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px;
  background: var(--prep-good-soft); color: var(--prep-ink) !important; line-height: 1.45;
}
#hfc-prep .hfc-prep__list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
#hfc-prep .hfc-prep__row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--prep-card); border: 1px solid var(--prep-line); border-radius: 10px;
}
#hfc-prep .hfc-prep__rowthumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--prep-paper); }
#hfc-prep .hfc-prep__rowinfo { flex: 1; min-width: 0; }
#hfc-prep .hfc-prep__rowname {
  font-size: 0.85rem; font-weight: 500; color: var(--prep-ink) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#hfc-prep .hfc-prep__rowmeta { font-size: 0.74rem; font-family: var(--prep-mono); color: var(--prep-muted) !important; }
#hfc-prep .hfc-prep__rowmeta .is-good { color: var(--prep-good) !important; }
#hfc-prep .hfc-prep__rowmeta .is-warn { color: var(--prep-accent) !important; }
#hfc-prep .hfc-prep__badge {
  display: inline-block; font-family: var(--prep-sans); font-size: 0.68rem; font-weight: 600;
  padding: 1px 6px; border-radius: 4px; margin-left: 4px;
  background: var(--prep-accent-soft); color: var(--prep-accent) !important;
}
#hfc-prep .hfc-prep__rowdl {
  padding: 7px 12px; border-radius: 7px; background: var(--prep-ink); color: #f4f4f2 !important;
  font-size: 0.78rem; font-weight: 500; text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
#hfc-prep .hfc-prep__rowerror { font-size: 0.78rem; color: var(--prep-accent) !important; flex-shrink: 0; }
#hfc-prep .hfc-prep__actions { display: flex; gap: 10px; }
#hfc-prep .hfc-prep__btn {
  flex: 1; padding: 11px 14px; border-radius: 9px;
  border: 1px solid var(--prep-accent); background: var(--prep-accent);
  color: #fff !important; font-size: 0.88rem; font-weight: 600; cursor: pointer; font-family: var(--prep-sans);
}

#hfc-prep button:focus-visible,
#hfc-prep input:focus-visible,
#hfc-prep select:focus-visible,
#hfc-prep label:focus-within {
  outline: 2px solid var(--prep-accent); outline-offset: 2px;
}

@media (max-width: 520px) {
  #hfc-prep .hfc-prep__body { padding: 14px; }
  #hfc-prep .hfc-prep__row2 { grid-template-columns: 1fr; }
  #hfc-prep .hfc-prep__segmented--3 { grid-template-columns: 1fr; }
  #hfc-prep .hfc-prep__row { flex-wrap: wrap; }
}
