.ofp-app {
  --ofp-bg: #f5f7f4;
  --ofp-surface: #ffffff;
  --ofp-muted-surface: #eef2ec;
  --ofp-text: #17221b;
  --ofp-muted: #5d695f;
  --ofp-line: #d9e0d8;
  --ofp-primary: #176b59;
  --ofp-primary-dark: #0f5245;
  --ofp-accent: #e6b655;
  --ofp-danger: #b3433f;
  --ofp-warning: #ad7a16;
  --ofp-success: #235f3f;
  --ofp-shadow: 0 16px 44px rgba(29, 43, 35, 0.12);
  --ofp-radius: 8px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
  color: var(--ofp-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ofp-app *,
.ofp-app *::before,
.ofp-app *::after {
  box-sizing: border-box;
}

.ofp-app button,
.ofp-app input {
  font: inherit;
}

.ofp-app button {
  cursor: pointer;
}

.ofp-app button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ofp-hero,
.ofp-panel,
.ofp-status,
.ofp-quality,
.ofp-gallery,
.ofp-review,
.ofp-zip-plan,
.ofp-progress,
.ofp-bottom-actions,
.ofp-smash {
  border: 1px solid var(--ofp-line);
  border-radius: var(--ofp-radius);
  background: var(--ofp-surface);
  box-shadow: var(--ofp-shadow);
}

.ofp-hero {
  margin-bottom: 14px;
  padding: clamp(18px, 4vw, 30px);
  background: linear-gradient(135deg, #0f5245 0%, #176b59 54%, #235f3f 100%);
  color: #ffffff;
}

.ofp-brand {
  margin: 0 0 8px;
  color: #f4d484 !important;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ofp-hero h2,
.ofp-quality h3,
.ofp-gallery h3,
.ofp-review h3,
.ofp-smash h3,
.ofp-modal-card h3 {
  margin: 0 0 8px;
  letter-spacing: 0;
}

.ofp-hero h2 {
  max-width: 760px;
  color: #ffffff !important;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.03;
}

.ofp-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.ofp-panel,
.ofp-quality,
.ofp-gallery,
.ofp-review,
.ofp-zip-plan,
.ofp-progress,
.ofp-smash {
  margin-top: 14px;
  padding: clamp(16px, 4vw, 26px);
}

.ofp-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.ofp-field {
  display: grid;
  gap: 8px;
  color: var(--ofp-text);
  font-weight: 850;
}

.ofp-field span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.ofp-field strong {
  color: var(--ofp-danger);
}

.ofp-field small {
  color: var(--ofp-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.ofp-field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cdd6cc;
  border-radius: var(--ofp-radius);
  padding: 0 15px;
  background: #fbfcfb;
  color: var(--ofp-text);
  font-size: 1.02rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ofp-field input:focus {
  border-color: var(--ofp-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(23, 107, 89, 0.15);
}

.ofp-notices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.ofp-notices p {
  min-height: 58px;
  margin: 0;
  border: 1px solid var(--ofp-line);
  border-radius: var(--ofp-radius);
  padding: 12px;
  background: var(--ofp-muted-surface);
  color: var(--ofp-muted);
  font-size: 0.94rem;
  font-weight: 780;
  line-height: 1.35;
}

.ofp-actions,
.ofp-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ofp-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--ofp-radius);
  padding: 13px 18px;
  color: var(--ofp-text);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ofp-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.ofp-button-primary {
  flex: 1 1 280px;
  background: var(--ofp-accent);
  color: #241a04 !important;
  box-shadow: 0 10px 24px rgba(180, 130, 34, 0.23);
}

.ofp-button-primary:not(:disabled):hover {
  background: #f0c768;
}

.ofp-button-secondary {
  flex: 1 1 220px;
  background: #e8efed;
  color: var(--ofp-primary-dark) !important;
}

.ofp-button-secondary:not(:disabled):hover {
  background: #dce8e5;
}

.ofp-button-success {
  background: var(--ofp-success);
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(35, 95, 63, 0.22);
}

.ofp-button-success:not(:disabled):hover {
  background: #1b4f34;
}

.ofp-button-ghost {
  border: 1px solid var(--ofp-line);
  background: #ffffff;
  color: var(--ofp-danger) !important;
}

.ofp-button-ghost:not(:disabled):hover {
  background: #fff1f0;
}

.ofp-button-large {
  min-height: 62px;
  padding-right: 24px;
  padding-left: 24px;
  font-size: 1.08rem;
}

.ofp-status {
  margin-top: 14px;
  padding: 14px 18px;
}

.ofp-status p {
  margin: 0;
  color: var(--ofp-muted);
  font-weight: 850;
  line-height: 1.4;
}

.ofp-status p.is-error {
  color: var(--ofp-danger);
}

.ofp-status p.is-success {
  color: var(--ofp-success);
}

.ofp-quality {
  display: grid;
  gap: 14px;
}

.ofp-quality.is-hidden,
.ofp-review.is-hidden,
.ofp-zip-plan.is-hidden,
.ofp-progress.is-hidden,
.ofp-bottom-actions.is-hidden,
.ofp-smash.is-hidden,
.ofp-modal-backdrop.is-hidden {
  display: none;
}

.ofp-quality h3,
.ofp-gallery h3,
.ofp-review h3,
.ofp-smash h3 {
  color: var(--ofp-primary-dark);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

.ofp-quality p,
.ofp-gallery p,
.ofp-review p,
.ofp-zip-plan p,
.ofp-progress p,
.ofp-smash p {
  margin: 0;
  color: var(--ofp-muted);
  font-weight: 780;
  line-height: 1.5;
}

.ofp-review .ofp-quality-note {
  margin-top: 10px;
  border: 1px solid #edc484;
  border-radius: var(--ofp-radius);
  padding: 12px;
  background: #fff8e8;
  color: #6f4b0c;
  font-size: 0.94rem;
}

.ofp-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ofp-quality-grid span {
  border: 1px solid var(--ofp-line);
  border-radius: var(--ofp-radius);
  padding: 10px;
  background: #fbfcfb;
  color: var(--ofp-primary-dark);
  font-size: 0.92rem;
  font-weight: 900;
}

.ofp-section-header {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ofp-empty {
  display: grid;
  gap: 8px;
  min-height: 160px;
  place-items: center;
  border: 2px dashed #c8d3c7;
  border-radius: var(--ofp-radius);
  padding: 26px;
  background: #fbfcfb;
  color: var(--ofp-muted);
  text-align: center;
}

.ofp-empty strong {
  color: var(--ofp-text);
  font-size: 1.12rem;
}

.ofp-empty.is-hidden {
  display: none;
}

.ofp-photo-board {
  display: grid;
  gap: 16px;
}

.ofp-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 104px));
  gap: 12px;
  justify-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ofp-photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--ofp-radius);
  background: #fbfcfb;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ofp-photo-card:hover {
  border-color: #cddbd4;
  background: #f3f7f4;
}

.ofp-photo-card.sortable-ghost {
  opacity: 0.45;
}

.ofp-photo-card.sortable-chosen {
  box-shadow: 0 12px 24px rgba(23, 107, 89, 0.22);
  transform: scale(1.02);
}

.ofp-photo-card.sortable-drag {
  opacity: 0.98;
  box-shadow: 0 18px 34px rgba(23, 107, 89, 0.25);
}

.ofp-photo-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--ofp-line);
  border-radius: var(--ofp-radius);
  background: #dfe6df;
  overflow: hidden;
  cursor: default;
  touch-action: pan-y;
}

.ofp-photo-preview img,
.ofp-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

.ofp-photo-preview img {
  object-fit: cover;
  pointer-events: none;
}

.ofp-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--ofp-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.ofp-drag-handle {
  position: absolute;
  top: 5px;
  left: 5px;
  display: inline-flex;
  min-width: 54px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 5px;
  padding: 4px 6px;
  background: rgba(15, 82, 69, 0.94);
  color: #ffffff;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.ofp-drag-handle:active {
  cursor: grabbing;
}

.ofp-drag-number {
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.ofp-drag-handle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0.8;
  pointer-events: none;
}

.ofp-remove-photo {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(179, 67, 63, 0.18);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.82);
  color: rgba(179, 67, 63, 0.72);
  box-shadow: 0 4px 10px rgba(23, 34, 27, 0.08);
  opacity: 0.78;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.ofp-remove-photo:hover,
.ofp-remove-photo:focus-visible {
  background: #fff1f0;
  color: var(--ofp-danger);
  opacity: 1;
  transform: scale(1.04);
}

.ofp-remove-photo svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  pointer-events: none;
}

.ofp-quality-badge {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 0;
  transform: translateX(-50%);
  box-shadow: 0 3px 8px rgba(23, 34, 27, 0.18);
}

.ofp-is-dragging .ofp-photo-board {
  cursor: grabbing;
}

.ofp-quality-badge.is-good {
  background: #2f8f55;
}

.ofp-quality-badge.is-warning {
  background: #d7a329;
}

.ofp-quality-badge.is-poor {
  background: #c84640;
}

.ofp-quality-badge.is-pending {
  background: #88938b;
}

.ofp-filter-low .ofp-photo-card:not(.is-warning):not(.is-poor) {
  display: none;
}

.ofp-check {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ofp-line);
  border-radius: var(--ofp-radius);
  padding: 12px;
  background: #f8fbf9;
  color: var(--ofp-primary-dark);
  font-weight: 900;
  line-height: 1.3;
}

.ofp-check input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--ofp-success);
}

.ofp-quality-confirm {
  border-color: #edc484;
  background: #fff8e8;
  color: #7b530d;
}

.ofp-quality-confirm.is-hidden {
  display: none;
}

.ofp-zip-plan {
  display: grid;
  gap: 8px;
}

.ofp-heavy-warning {
  color: var(--ofp-warning) !important;
}

.ofp-progress {
  display: grid;
  gap: 10px;
}

.ofp-progress-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #e6ece7;
}

.ofp-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--ofp-success);
  transition: width 160ms ease;
}

.ofp-bottom-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  justify-content: flex-end;
  margin-top: 14px;
  border-radius: var(--ofp-radius) var(--ofp-radius) 0 0;
  padding: 14px;
}

.ofp-bottom-actions .ofp-button-success {
  flex: 1 1 320px;
}

.ofp-smash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 16px;
  align-items: center;
}

.ofp-smash h3 {
  color: var(--ofp-success);
}

.ofp-smash-instruction {
  margin-top: 8px !important;
  color: var(--ofp-primary-dark) !important;
  font-weight: 900 !important;
}

.ofp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 34, 27, 0.56);
}

.ofp-modal-card {
  width: min(440px, 100%);
  border-radius: var(--ofp-radius);
  padding: clamp(18px, 5vw, 26px);
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.ofp-modal-card h3 {
  color: var(--ofp-primary-dark);
  font-size: 1.42rem;
}

.ofp-modal-card p {
  margin: 0 0 18px;
  color: var(--ofp-muted);
  font-weight: 800;
  line-height: 1.5;
}

.ofp-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 800px) {
  .ofp-app {
    padding: 12px;
  }

  .ofp-field-grid,
  .ofp-notices,
  .ofp-quality-grid {
    grid-template-columns: 1fr;
  }

  .ofp-actions,
  .ofp-bottom-actions,
  .ofp-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ofp-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 10px;
  }

  .ofp-smash {
    grid-template-columns: 1fr;
  }
}
