.image-care-shell {
  --care-accent: #2f6db7;
  --care-accent-strong: #25568f;
  --care-text: #172033;
  --care-muted: #607086;
  --care-border: #dde7f0;
  --care-surface: #ffffff;
  --care-soft: #f5f8fc;
  --care-focus: rgba(47, 109, 183, .3);
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  color: var(--care-text);
  padding-bottom: 32px;
}

.image-care-shell *,
.image-care-shell *::before,
.image-care-shell *::after { box-sizing: border-box; }

.image-care-shell [hidden] { display: none !important; }

.image-care-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.image-care-header > div { min-width: 0; }
.image-care-header h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.16; letter-spacing: -.025em; }
.image-care-header p { margin: 5px 0 0; color: var(--care-muted); font-size: 13px; line-height: 1.5; }

.image-care-shell button,
.image-care-shell select { font: inherit; }

.image-care-back,
.image-care-text-button,
.image-care-secondary {
  appearance: none;
  border: 1px solid var(--care-border);
  background: var(--care-surface);
  color: var(--care-text);
  cursor: pointer;
}

.image-care-back {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 12px;
  font-weight: 750;
}

.image-care-back:hover,
.image-care-secondary:hover { border-color: rgba(47, 109, 183, .45); background: #f8fbff; }

.image-care-compliance {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #dce8f5;
  border-radius: 13px;
  background: #f5f9fe;
  color: #43566f;
  font-size: 12.5px;
  line-height: 1.6;
}

.image-care-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.image-care-mode {
  appearance: none;
  display: grid !important;
  align-content: center !important;
  justify-content: stretch !important;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--care-border);
  border-radius: 14px;
  background: var(--care-surface);
  color: var(--care-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.image-care-mode strong { min-width: 0; font-size: 14px; line-height: 1.25; white-space: normal; }
.image-care-mode span { display: block; color: var(--care-muted); font-size: 11.5px; line-height: 1.4; white-space: normal; }
.image-care-mode:hover { border-color: rgba(47, 109, 183, .42); transform: translateY(-1px); }
.image-care-mode.is-selected {
  border-color: rgba(47, 109, 183, .65);
  background: linear-gradient(135deg, #eff6ff, #f8f7ff);
  box-shadow: 0 0 0 1px rgba(47, 109, 183, .08), 0 10px 24px rgba(47, 109, 183, .08);
}
.image-care-mode.is-selected strong { color: var(--care-accent-strong); }
.image-care-mode.is-disabled { opacity: .52; cursor: not-allowed; transform: none; box-shadow: none; }

.image-care-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  gap: 16px;
  align-items: start;
}

.image-care-input-column,
.image-care-side-column { display: grid; gap: 14px; min-width: 0; }

.image-care-card,
.image-care-terms {
  border: 1px solid var(--care-border);
  border-radius: 16px;
  background: var(--care-surface);
  box-shadow: 0 8px 28px rgba(25, 44, 72, .055);
}
.image-care-terms { margin-top: 14px; }

.image-care-card { padding: 16px; }
.image-care-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.image-care-card-head h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.image-care-card-head p { margin: 4px 0 0; color: var(--care-muted); font-size: 12px; line-height: 1.45; }

.image-care-text-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border-color: transparent;
  border-radius: 9px;
  color: var(--care-accent-strong);
  font-size: 12px;
}
.image-care-text-button:hover { background: #eef5fc; }

.image-care-drop-zone {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-height: 184px;
  padding: 24px 18px;
  border: 1.5px dashed #b9c9d9;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f7faff);
  color: var(--care-text);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.image-care-drop-zone:hover,
.image-care-drop-zone.is-dragging { border-color: var(--care-accent); background: #f0f6fd; }
.image-care-drop-zone.is-dragging { transform: scale(.995); }
.image-care-drop-zone.is-disabled { opacity: .65; cursor: wait; }
.image-care-drop-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e9f2fc;
  color: var(--care-accent);
  font-size: 25px;
  line-height: 1;
}
.image-care-drop-zone strong { font-size: 14px; }
.image-care-drop-zone > span:not(.image-care-drop-icon) { color: var(--care-muted); font-size: 11.5px; line-height: 1.4; }
.image-care-drop-zone > small { color: var(--care-muted); font-size: 10.5px; line-height: 1.4; }
.image-care-picker-button {
  appearance: none;
  min-height: 44px;
  margin-top: 4px;
  padding: 9px 18px;
  border: 1px solid rgba(47, 109, 183, .26);
  border-radius: 11px;
  background: var(--care-accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(47, 109, 183, .18);
  transition: transform .14s ease-out, filter .14s ease-out, box-shadow .14s ease-out;
}
.image-care-picker-button:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 9px 18px rgba(47, 109, 183, .22); }
.image-care-picker-button:active:not(:disabled) { transform: translateY(0); }
.image-care-picker-button:disabled { opacity: .58; cursor: wait; box-shadow: none; }

.image-care-file-list {
  display: grid;
  gap: 8px;
  max-height: 310px;
  margin: 12px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: thin;
}
.image-care-file-list:empty { display: none; }
.image-care-file {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px;
  border-radius: 11px;
  background: var(--care-soft);
}
.image-care-file img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #eaf0f6; }
.image-care-file-copy { display: grid; gap: 2px; min-width: 0; }
.image-care-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.image-care-file-copy small { color: var(--care-muted); font-size: 11px; }
.image-care-file-remove {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9b3a3a;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.image-care-file-remove:hover { background: #fff0f0; }

.image-care-terms { overflow: clip; box-shadow: none; }
.image-care-terms > summary,
.image-care-details > summary {
  padding: 13px 15px;
  color: var(--care-accent-strong);
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
}
.image-care-terms[open] > summary,
.image-care-details[open] > summary { border-bottom: 1px solid var(--care-border); }
.image-care-terms dl { display: grid; gap: 0; margin: 0; padding: 5px 15px 12px; }
.image-care-term { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #edf2f7; }
.image-care-term:last-child { border-bottom: 0; }
.image-care-term dt { color: var(--care-text); font-size: 12px; font-weight: 750; }
.image-care-term dd { margin: 0; color: var(--care-muted); font-size: 11.5px; line-height: 1.55; }

.image-care-choice-list { display: grid; gap: 8px; }
.image-care-choice-list label {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--care-border);
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
}
.image-care-choice-list label:has(input:checked) { border-color: rgba(47, 109, 183, .56); background: #f1f7fe; }
.image-care-choice-list label.is-disabled { opacity: .48; cursor: not-allowed; }
.image-care-choice-list input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--care-accent); }
.image-care-choice-list span { display: grid; gap: 3px; min-width: 0; }
.image-care-choice-list strong { font-size: 13px; }
.image-care-choice-list small { color: var(--care-muted); font-size: 11.5px; line-height: 1.45; }

.image-care-explain { padding: 13px; border-radius: 12px; background: var(--care-soft); }
.image-care-explain strong { font-size: 13px; }
.image-care-explain p { margin: 5px 0 0; color: var(--care-muted); font-size: 12px; line-height: 1.55; }
.image-care-detect-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.image-care-detect-flow > div { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 11px; border: 1px solid var(--care-border); border-radius: 12px; background: var(--care-soft); }
.image-care-detect-flow > div > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #e6f0fb; color: var(--care-accent-strong); font-size: 11px; font-weight: 850; }
.image-care-detect-flow strong { margin-top: 2px; font-size: 12.5px; }
.image-care-detect-flow small { color: var(--care-muted); font-size: 10.5px; line-height: 1.45; }
.image-care-detect-note { margin: 10px 1px 0; color: var(--care-muted); font-size: 11.5px; line-height: 1.55; }
.image-care-select-label { display: grid; gap: 7px; margin-top: 12px; color: var(--care-text); font-size: 12.5px; font-weight: 700; }
.image-care-select-label select {
  width: 100%;
  min-height: 42px;
  padding: 7px 34px 7px 11px;
  border: 1px solid var(--care-border);
  border-radius: 10px;
  background: var(--care-surface);
  color: var(--care-text);
}

.image-care-action-bar { display: flex; gap: 9px; padding: 2px 0; }
.image-care-primary,
.image-care-secondary {
  appearance: none;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}
.image-care-primary {
  flex: 1 1 auto;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #2f6db7, #5d59cf);
  color: #fff;
  box-shadow: 0 9px 20px rgba(47, 109, 183, .22);
}
.image-care-primary:hover:not(:disabled) { filter: brightness(1.04); }
.image-care-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.image-care-secondary { flex: 0 0 auto; }

.image-care-status {
  min-height: 20px;
  padding-inline: 2px;
  color: var(--care-muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.image-care-status[data-tone="success"] { color: #227154; }
.image-care-status[data-tone="error"] { color: #b23d3d; }
.image-care-status[data-tone="warning"] { color: #976515; }

.image-care-result { overflow: hidden; }
.image-care-progress { height: 6px; margin: -2px 0 14px; overflow: hidden; border-radius: 999px; background: #e9eff6; }
.image-care-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6db7, #6a5bd7); transition: width .25s ease; }
.image-care-progress.is-indeterminate span { width: 38%; animation: image-care-progress-slide 1.25s ease-in-out infinite; }
@keyframes image-care-progress-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}
.image-care-summary-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.image-care-summary-metrics > div { display: grid; gap: 2px; padding: 10px; border-radius: 11px; background: var(--care-soft); }
.image-care-summary-metrics strong { color: var(--care-accent-strong); font-size: 18px; line-height: 1; }
.image-care-summary-metrics span { color: var(--care-muted); font-size: 10.5px; }
.image-care-detection-list { display: grid; gap: 10px; margin-top: 12px; }
.image-care-detection-card { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--care-border); border-radius: 13px; background: var(--care-surface); box-shadow: 0 5px 16px rgba(25, 44, 72, .04); }
.image-care-detection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.image-care-detection-head h4 { min-width: 0; margin: 1px 0 0; overflow: hidden; color: var(--care-text); font-size: 12.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.image-care-detection-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: var(--care-soft); color: var(--care-muted); font-size: 10.5px; font-weight: 800; }
.image-care-detection-badge.is-ai { background: #fff0e7; color: #9a4b1c; }
.image-care-detection-badge.is-verified { background: #e9f1ff; color: #275d9a; }
.image-care-detection-badge.is-non-ai { background: #eaf8f1; color: #216b50; }
.image-care-detection-badge.is-review { background: #fff6df; color: #8b6317; }
.image-care-detection-explanation { margin: -2px 0 0; color: var(--care-muted); font-size: 11px; line-height: 1.45; }
.image-care-detection-models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.image-care-detection-model { display: grid; gap: 3px; min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--care-soft); }
.image-care-detection-model > span { color: var(--care-muted); font-size: 10px; }
.image-care-detection-model > strong { color: var(--care-text); font-size: 12.5px; }
.image-care-detection-model > small { overflow-wrap: anywhere; color: var(--care-muted); font-size: 10.5px; line-height: 1.4; }
.image-care-detection-source { margin: 0; padding-top: 8px; border-top: 1px solid var(--care-border); color: var(--care-muted); font-size: 10.5px; line-height: 1.5; overflow-wrap: anywhere; }
.image-care-detection-more { margin: 0; padding: 9px 11px; border-radius: 10px; background: var(--care-soft); color: var(--care-muted); font-size: 11px; line-height: 1.5; }
.image-care-observer-summary { margin: 10px 0 0; padding: 10px 11px; border-radius: 10px; background: var(--care-soft); color: var(--care-muted); font-size: 11.5px; line-height: 1.6; }
.image-care-conclusion { margin: 12px 0 0; color: #465970; font-size: 12px; line-height: 1.6; }
.image-care-conclusion.is-error { color: #b23d3d; }
.image-care-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.image-care-result-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--care-border);
  border-radius: 10px;
  background: var(--care-surface);
  color: var(--care-accent-strong);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.image-care-result-link:hover { border-color: rgba(47, 109, 183, .45); background: #f7fbff; }
.image-care-details { margin: 12px -16px -16px; border-top: 1px solid var(--care-border); }
.image-care-details > summary { padding-inline: 16px; }
#imageCareDetailBody { display: grid; gap: 10px; max-height: 440px; padding: 12px 16px 16px; overflow: auto; }
.image-care-item-detail,
.image-care-limitations { padding: 11px; border-radius: 11px; background: var(--care-soft); }
.image-care-item-detail h4,
.image-care-limitations h4 { margin: 0 0 8px; font-size: 12.5px; overflow-wrap: anywhere; }
.image-care-detail-row { display: grid; grid-template-columns: minmax(100px, .42fr) minmax(0, 1fr); gap: 9px; padding: 5px 0; border-top: 1px solid rgba(135, 153, 175, .15); font-size: 11px; line-height: 1.45; }
.image-care-detail-row > strong { color: #4a5b70; font-weight: 700; }
.image-care-detail-row > span { min-width: 0; color: var(--care-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.image-care-detail-nested { display: grid; }
.image-care-detail-nested > .image-care-detail-row:first-child { border-top: 0; padding-top: 0; }
.image-care-detail-empty { margin: 0; color: var(--care-muted); font-size: 12px; }
.image-care-limitations ul { margin: 0; padding-left: 18px; color: var(--care-muted); font-size: 11.5px; line-height: 1.55; }

.image-care-shell :is(button, select, summary, label[tabindex], a):focus-visible,
.image-care-drop-zone:focus-visible {
  outline: 3px solid var(--care-focus);
  outline-offset: 2px;
}

body.theme-dark .image-care-shell {
  --care-text: #edf3fb;
  --care-muted: #a5b4c7;
  --care-border: rgba(143, 163, 187, .24);
  --care-surface: rgba(18, 24, 34, .9);
  --care-soft: rgba(90, 126, 166, .1);
  --care-focus: rgba(124, 196, 255, .38);
}
body.theme-dark .image-care-compliance { border-color: rgba(108, 164, 222, .25); background: rgba(47, 109, 183, .11); color: #b7c9dd; }
body.theme-dark .image-care-mode.is-selected { border-color: rgba(124, 196, 255, .5); background: linear-gradient(135deg, rgba(47,109,183,.22), rgba(104,88,215,.15)); }
body.theme-dark .image-care-mode.is-selected strong,
body.theme-dark .image-care-terms > summary,
body.theme-dark .image-care-details > summary,
body.theme-dark .image-care-result-link { color: #9ccaff; }
body.theme-dark .image-care-drop-zone { border-color: rgba(150, 174, 199, .34); background: rgba(13, 20, 30, .54); }
body.theme-dark .image-care-drop-zone:hover,
body.theme-dark .image-care-drop-zone.is-dragging { border-color: #78b9f0; background: rgba(47, 109, 183, .13); }
body.theme-dark .image-care-drop-icon { background: rgba(90, 166, 232, .14); color: #8bc9ff; }
body.theme-dark .image-care-picker-button { border-color: rgba(124,196,255,.3); background: #3778bd; }
body.theme-dark .image-care-file img { background: rgba(13, 20, 30, .8); }
body.theme-dark .image-care-file-remove { color: #f2a1a1; }
body.theme-dark .image-care-file-remove:hover { background: rgba(190, 65, 65, .15); }
body.theme-dark .image-care-choice-list label { background: rgba(13, 20, 30, .44); }
body.theme-dark .image-care-choice-list label:has(input:checked) { border-color: rgba(124,196,255,.48); background: rgba(47,109,183,.15); }
body.theme-dark .image-care-detect-flow > div,
body.theme-dark .image-care-detection-model { background: rgba(13, 20, 30, .44); }
body.theme-dark .image-care-detect-flow > div > span { background: rgba(90,166,232,.14); color: #9ccaff; }
body.theme-dark .image-care-detection-card { background: rgba(18, 24, 34, .72); }
body.theme-dark .image-care-detection-badge.is-ai { background: rgba(210, 107, 54, .16); color: #ffb587; }
body.theme-dark .image-care-detection-badge.is-verified { background: rgba(75, 143, 222, .17); color: #a8d0ff; }
body.theme-dark .image-care-detection-badge.is-non-ai { background: rgba(70, 174, 128, .15); color: #8de0bb; }
body.theme-dark .image-care-detection-badge.is-review { background: rgba(209, 155, 50, .16); color: #f2cc7a; }
body.theme-dark .image-care-back:hover,
body.theme-dark .image-care-secondary:hover,
body.theme-dark .image-care-result-link:hover { background: rgba(90,166,232,.1); }
body.theme-dark .image-care-progress { background: rgba(151, 170, 191, .15); }
body.theme-dark .image-care-conclusion { color: #b9c7d8; }
body.theme-dark .image-care-detail-row > strong { color: #c4d2e2; }
body.theme-dark .image-care-status[data-tone="success"] { color: #82d9b4; }
body.theme-dark .image-care-status[data-tone="error"],
body.theme-dark .image-care-conclusion.is-error { color: #ffaaa1; }
body.theme-dark .image-care-status[data-tone="warning"] { color: #f2cc7a; }

@media (max-width: 820px) {
  .image-care-shell { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .image-care-header { align-items: flex-start; gap: 11px; margin-bottom: 12px; }
  .image-care-back { min-height: 44px; padding: 8px 11px; font-size: 12px; }
  .image-care-header h2 { font-size: 21px; }
  .image-care-header p { font-size: 11.5px; }
  .image-care-compliance { margin-bottom: 12px; padding: 10px 11px; font-size: 11.5px; }
  .image-care-mode-tabs { grid-template-columns: 1fr; gap: 7px; margin-bottom: 12px; }
  .image-care-mode { min-height: 0; padding: 10px 12px; }
  .image-care-mode { min-height: 58px; padding: 10px 12px; }
  .image-care-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .image-care-card { padding: 13px; border-radius: 14px; }
  .image-care-drop-zone { min-height: 176px; padding: 20px 14px; }
  .image-care-file-list { max-height: 252px; }
  .image-care-action-bar {
    position: sticky;
    z-index: 4;
    bottom: 0;
    margin: 0 -8px;
    padding: 9px 8px max(9px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--care-border);
    background: var(--care-surface);
    background: color-mix(in srgb, var(--care-surface) 92%, transparent);
    backdrop-filter: blur(16px);
  }
  .image-care-primary,
  .image-care-secondary { min-height: 44px; }
  .image-care-terms { border-radius: 14px; }
  .image-care-term { grid-template-columns: 1fr; gap: 3px; }
  .image-care-result-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .image-care-result-link { justify-content: center; }
  .image-care-details { margin: 12px -13px -13px; }
  .image-care-detail-row { grid-template-columns: 96px minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .image-care-detect-flow { grid-template-columns: 1fr; }
  .image-care-detect-flow > div { grid-template-columns: 28px minmax(0, 1fr); align-items: center; }
  .image-care-detect-flow > div > span { grid-row: 1 / span 2; }
  .image-care-detect-flow strong { margin-top: 0; }
  .image-care-detection-head { display: grid; }
  .image-care-detection-head h4 { white-space: normal; overflow-wrap: anywhere; }
  .image-care-detection-badge { justify-self: start; }
  .image-care-detection-models { grid-template-columns: 1fr; }
}

body.mobile-ui .image-care-layout { grid-template-columns: minmax(0, 1fr); }

@media (prefers-reduced-motion: reduce) {
  .image-care-shell *,
  .image-care-shell *::before,
  .image-care-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .image-care-mode:hover,
  .image-care-drop-zone.is-dragging { transform: none; }
  .image-care-progress.is-indeterminate span { animation: none; transform: translateX(80%); }
}
