:root {
  color-scheme: light;
  --bg: #f4ecdf;
  --bg-soft: #fbf7f1;
  --surface: rgba(255, 250, 244, 0.88);
  --surface-strong: #fffaf4;
  --text: #221f1a;
  --muted: #6f6557;
  --line: rgba(68, 54, 32, 0.12);
  --accent: #b85f2d;
  --accent-strong: #8f431f;
  --accent-soft: rgba(184, 95, 45, 0.14);
  --shadow: 0 24px 60px rgba(86, 58, 25, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(184, 95, 45, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(232, 205, 164, 0.56), transparent 28%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  font-family:
    "Pretendard",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.48), transparent 90%);
  opacity: 0.18;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a7f70;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: rgba(184, 95, 45, 0.65);
  box-shadow: 0 0 0 4px rgba(184, 95, 45, 0.14);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

code {
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: rgba(184, 95, 45, 0.1);
  color: var(--accent-strong);
  font-size: 0.92em;
}

.page-shell {
  width: min(1660px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.hero,
.summary-bar,
.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero {
  margin-bottom: 1rem;
  border-radius: 34px;
  padding: 1.4rem 1.5rem;
}

.hero-surface {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-end;
}

.hero-copy {
  max-width: 900px;
}

.hero-copy h1 {
  margin: 0.15rem 0 0.45rem;
  font-size: clamp(2.1rem, 4vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-text {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.eyebrow,
.summary-label,
.result-rank,
.snippet-label,
.thumb-button-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
}

.chip.muted {
  color: var(--muted);
}

.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #4ea46a;
  box-shadow: 0 0 0 4px rgba(78, 164, 106, 0.18);
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 26px;
}

.summary-bar > div {
  padding: 0.2rem 0;
}

.summary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.summary-bar strong {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px, 0.95fr) minmax(0, 1.35fr) minmax(300px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.column,
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  padding: 1rem;
}

.card-accent {
  border-color: rgba(184, 95, 45, 0.2);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.card-head h2 {
  margin: 0.1rem 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.search-field {
  display: block;
  margin-bottom: 0.85rem;
}

.search-field input {
  background: rgba(255, 255, 255, 0.82);
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  font-weight: 700;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.primary-button {
  background: linear-gradient(180deg, #cc713d 0%, #ae5727 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(184, 95, 45, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.ghost-button,
.danger-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  color: #9c2f23;
  border-color: rgba(156, 47, 35, 0.24);
}

.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 95, 45, 0.28);
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.helper-tight {
  margin-top: -0.25rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1.5px dashed rgba(184, 95, 45, 0.32);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 239, 227, 0.72));
  color: var(--text);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.dropzone.is-dragover {
  border-color: rgba(184, 95, 45, 0.85);
  box-shadow: 0 0 0 5px rgba(184, 95, 45, 0.12);
  transform: translateY(-1px);
}

.dropzone.compact {
  min-height: 160px;
}

.dropzone-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(184, 95, 45, 0.1);
  color: var(--accent-strong);
  font-size: 1.3rem;
  font-weight: 700;
}

.dropzone-title {
  font-size: 1rem;
  font-weight: 800;
}

.dropzone-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
}

.file-chip,
.pill,
.tag,
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(184, 95, 45, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  padding: 0.34rem 0.7rem;
  font-size: 0.86rem;
}

.file-chip.muted {
  color: var(--muted);
}

.file-chip-list,
.pill-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.pill.soft {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(184, 95, 45, 0.18);
}

.notice {
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.notice strong {
  display: block;
  margin-bottom: 0.35rem;
}

.notice.error {
  border-color: rgba(156, 47, 35, 0.24);
  background: rgba(255, 244, 241, 0.95);
  color: #8d2e23;
}

.list,
.results,
.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.list-item,
.result-item {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(68, 54, 32, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.list-item.is-active,
.result-item.is-active {
  border-color: rgba(184, 95, 45, 0.42);
  box-shadow: 0 0 0 4px rgba(184, 95, 45, 0.09);
}

.list-item button,
.result-item button {
  width: 100%;
  text-align: left;
  padding: 1rem;
  background: transparent;
  color: inherit;
}

.item-title-row,
.result-title-row,
.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
}

.item-identity {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}

.thumb {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  background: #ead9c4;
  flex: none;
}

.result-thumb {
  width: 62px;
  height: 62px;
}

.item-identity h3,
.detail-identity h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.meta {
  color: var(--muted);
  font-size: 0.93rem;
}

.item-badges,
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.result-rank {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 800;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.score-pill {
  font-weight: 800;
  color: var(--accent-strong);
  background: rgba(184, 95, 45, 0.09);
}

.result-snippets {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0;
}

.snippet-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.snippet-label {
  color: var(--muted);
  font-weight: 800;
}

.snippet-value {
  color: var(--text);
}

.detail-card {
  position: sticky;
  top: 1rem;
}

.detail-panel {
  gap: 1rem;
}

.detail-hero {
  align-items: center;
  padding: 1rem;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 239, 227, 0.86));
  border: 1px solid var(--line);
}

.detail-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.detail-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  object-fit: cover;
  background: #ead9c4;
  border: 1px solid rgba(68, 54, 32, 0.1);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: min(320px, 100%);
}

.detail-stat {
  padding: 0.8rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
}

.detail-gallery {
  display: grid;
  gap: 0.85rem;
}

.detail-gallery-main {
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.detail-gallery-main img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #ead9c4;
}

.detail-gallery-copy {
  padding: 0.9rem 1rem 1rem;
}

.detail-gallery-copy strong {
  display: block;
  margin-bottom: 0.2rem;
}

.detail-gallery-copy p,
.detail-block p {
  margin: 0;
  color: var(--muted);
}

.detail-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.7rem;
}

.thumb-button {
  padding: 0.45rem;
  border-radius: 18px;
  border: 1px solid rgba(68, 54, 32, 0.12);
  background: rgba(255, 255, 255, 0.9);
  text-align: left;
}

.thumb-button.is-selected {
  border-color: rgba(184, 95, 45, 0.4);
  box-shadow: 0 0 0 4px rgba(184, 95, 45, 0.08);
}

.thumb-button img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: #ead9c4;
}

.thumb-button-label {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.detail-block {
  padding: 0.95rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.detail-block h4 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.empty-state {
  padding: 1.15rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px dashed rgba(184, 95, 45, 0.24);
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-card {
    position: static;
  }
}

@media (max-width: 920px) {
  .page-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.5rem;
  }

  .hero-surface,
  .detail-hero,
  .item-title-row,
  .result-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-bar,
  .detail-grid,
  .field-row,
  .detail-stats {
    grid-template-columns: 1fr;
  }

  .hero,
  .card {
    border-radius: 22px;
  }
}
