/* ==========================================================================
   유즈킷 스마트 드롭 (Smart Drop) — 샘플 전용 스타일
   · 메인 최상단 통합 드롭존 + 파일 자동 인식 → 액션 선택 모달
   · 기존 유즈킷 토큰(--yz-*)만 사용해 다른 도구 페이지와 톤을 맞춘다.
   ========================================================================== */

/* ---------- 1. 통합 드롭존 ---------- */
.smart-drop { padding: 2px 0 18px; }
.smart-drop.is-hidden { display: none; }

.sd-card {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 24px 18px;
  background:
    radial-gradient(120% 90% at 88% -20%, rgba(255, 216, 77, .34) 0%, rgba(255, 216, 77, 0) 58%),
    radial-gradient(80% 70% at 4% 110%, rgba(242, 169, 0, .10) 0%, rgba(242, 169, 0, 0) 60%),
    #fff;
  border: 1px solid var(--yz-line);
  border-radius: 26px;
  box-shadow: 0 1px 2px rgba(93, 66, 0, .04), 0 30px 64px -54px rgba(120, 80, 0, .6);
  overflow: hidden;
}

.sd-head { text-align: center; }
.sd-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; letter-spacing: .08em;
  color: var(--yz-yuzu-ink);
  background: var(--yz-lemon-soft);
  border: 1px solid #f2dfa2;
}
.sd-badge .sd-spark { flex: none; color: var(--yz-yuzu); }
.sd-head h2 {
  margin: 10px auto 5px; max-width: 640px;
  font-size: clamp(1.14rem, 2.1vw, 1.42rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1.32;
  color: var(--yz-ink);
}
.sd-head h2 em { font-style: normal; color: var(--yz-yuzu-deep); }
.sd-sub {
  margin: 0 auto; max-width: 580px;
  font-size: .89rem; color: var(--yz-muted);
}

.sd-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 16px 0 0; padding: 22px 18px 18px;
  border: 2px dashed var(--yz-line-strong); border-radius: 20px;
  background: #fffdf9; cursor: pointer; text-align: center;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.sd-zone:hover, .sd-zone:focus-visible {
  border-color: var(--yz-yuzu); background: #fffcf0; outline: none;
  box-shadow: 0 0 0 4px rgba(242, 169, 0, .10);
}
.sd-zone.is-drag {
  border-color: var(--yz-yuzu); border-style: solid;
  background: linear-gradient(180deg, #fffbe8 0%, #fff5d2 100%);
  box-shadow: 0 0 0 5px rgba(242, 169, 0, .18);
  transform: translateY(-1px);
}
.sd-zone-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: 10px;
  border-radius: 15px; color: var(--yz-yuzu-ink);
  background: linear-gradient(180deg, #fff4cb 0%, #ffe9a8 100%);
  border: 1px solid #f4e0a1;
}
.sd-zone.is-drag .sd-zone-ico { background: linear-gradient(180deg, #ffe27a 0%, #ffd24d 100%); }
.sd-zone .btn-primary { padding: 13px 38px; font-size: 1rem; border-radius: 999px; }
.sd-or { margin: 10px 0 0; font-size: .95rem; font-weight: 700; color: var(--yz-ink-2); }
.sd-formats { margin: 3px 0 0; font-size: .76rem; color: var(--yz-muted); }

/* 인식 규칙 미리보기 — 작은 안내 칩 */
.sd-legend {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin: 14px 0 0; padding: 0; list-style: none;
}
.sd-legend li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 11px; border-radius: 12px;
  background: #fffdf7; border: 1px solid var(--yz-line);
  font-size: .72rem; color: var(--yz-muted); line-height: 1.45;
}
.sd-legend b {
  font-size: .76rem; font-weight: 800; color: var(--yz-ink-2);
  display: flex; align-items: center; gap: 5px;
}
.sd-legend b span { font-size: .9rem; }
.sd-privacy {
  margin: 12px 0 0; text-align: center;
  font-size: .72rem; color: var(--yz-muted);
}
.sd-privacy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px;
  vertical-align: -1px; background: currentColor; opacity: .55;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'><rect x='4' y='10' width='16' height='10' rx='2'/><path d='M8 10V7a4 4 0 0 1 8 0v3'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'><rect x='4' y='10' width='16' height='10' rx='2'/><path d='M8 10V7a4 4 0 0 1 8 0v3'/></svg>") center/contain no-repeat; }

/* ---------- 2. 액션 선택 모달 ---------- */
.sd-modal {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: rgba(25, 27, 31, .42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: sdFade .16s ease-out;
}
.sd-modal[hidden] { display: none; }
@keyframes sdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sdRise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.sd-dialog {
  display: flex; flex-direction: column;
  width: min(780px, 100%); max-height: min(86vh, 760px);
  padding: 20px 22px 16px;
  background: #fff; border: 1px solid var(--yz-line);
  border-radius: 24px; box-shadow: 0 40px 90px -40px rgba(40, 26, 0, .55);
  overflow: auto; overscroll-behavior: contain;
  animation: sdRise .18s ease-out;
}
.sd-dialog:focus { outline: none; }

.sd-dialog-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--yz-line);
}
.sd-dialog-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 14px;
  font-size: 1.3rem; line-height: 1;
  background: linear-gradient(180deg, #fff4cb 0%, #ffe9a8 100%);
  border: 1px solid #f4e0a1;
}
.sd-dialog-kicker {
  margin: 0 0 2px; font-size: .7rem; font-weight: 800; letter-spacing: .07em;
  color: var(--yz-yuzu-deep);
}
.sd-dialog-head h2 {
  margin: 0; font-size: 1.16rem; font-weight: 800; letter-spacing: -.035em;
  line-height: 1.35; color: var(--yz-ink);
}
.sd-x {
  flex: none; margin-left: auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid transparent; background: none;
  font-size: 1.25rem; line-height: 1; color: var(--yz-muted);
  cursor: pointer;
}
.sd-x:hover { background: var(--yz-bg-soft); color: var(--yz-ink); }
.sd-x:focus-visible { outline: 3px solid rgba(242, 169, 0, .38); outline-offset: 1px; }

/* 파일 칩 */
.sd-files {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin: 14px 0 0; padding: 0; list-style: none;
}
.sd-file {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%; padding: 6px 11px 6px 9px;
  border-radius: 999px;
  background: #fbf8f0; border: 1px solid var(--yz-line);
  font-size: .8rem; color: var(--yz-ink-2);
}
.sd-file-ico { flex: none; font-size: .92rem; line-height: 1; }
.sd-file-name {
  font-weight: 700; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sd-file-size { flex: none; color: var(--yz-muted); font-variant-numeric: tabular-nums; }
.sd-file-tag {
  flex: none; padding: 1px 7px; border-radius: 999px;
  font-size: .7rem; font-weight: 800;
  color: var(--yz-yuzu-ink); background: var(--yz-lemon-soft);
  border: 1px solid #f2dfa2; font-variant-numeric: tabular-nums;
}
.sd-file-tag.is-loading { color: var(--yz-muted); background: #f4f2ec; border-color: var(--yz-line-strong); }

.sd-note {
  margin: 12px 0 0; padding: 9px 12px;
  border-radius: 12px; background: #fffaf0; border: 1px solid #f4e3b6;
  font-size: .8rem; color: #7a5a12; line-height: 1.5;
}

/* 액션 그룹 */
.sd-groups { margin: 4px 0 0; }
.sd-group { margin-top: 14px; }
.sd-group-head {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 8px; font-size: .78rem; font-weight: 800; color: var(--yz-muted);
}
.sd-group-head b { color: var(--yz-ink-2); }

.sd-actions {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 9px;
}
.sd-act {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) 12px;
  align-items: center; gap: 10px;
  padding: 12px 13px; text-align: left;
  background: #fff; border: 1px solid var(--yz-line); border-radius: 15px;
  font: inherit; color: var(--yz-ink); cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease;
}
.sd-act:hover, .sd-act:focus-visible {
  border-color: var(--yz-yuzu); background: #fffdf2; outline: none;
  box-shadow: 0 10px 22px -16px rgba(120, 80, 0, .6);
  transform: translateY(-1px);
}
.sd-act:active { transform: none; }
.sd-act-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 11px;
  font-size: 1.06rem; line-height: 1;
  background: #fbf7ec; border: 1px solid var(--yz-line);
}
.sd-act:hover .sd-act-ico { background: var(--yz-lemon-soft); border-color: #f2dfa2; }
.sd-act-txt { min-width: 0; }
.sd-act-txt b {
  display: block; font-size: .93rem; font-weight: 800; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-act-txt small {
  display: block; margin-top: 1px;
  font-size: .74rem; color: var(--yz-muted); line-height: 1.4;
}
.sd-act-go { color: var(--yz-line-strong); font-weight: 800; font-size: .95rem; }
.sd-act:hover .sd-act-go { color: var(--yz-yuzu); }
.sd-act-tag {
  position: absolute; top: -7px; right: 10px;
  padding: 1px 7px; border-radius: 999px;
  font-size: .64rem; font-weight: 800; letter-spacing: .02em;
  color: #fff; background: var(--yz-yuzu);
}

.sd-foot {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--yz-line);
  text-align: center; font-size: .74rem; color: var(--yz-muted);
}
.sd-foot::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px;
  vertical-align: -1px; background: currentColor; opacity: .5;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'><rect x='4' y='10' width='16' height='10' rx='2'/><path d='M8 10V7a4 4 0 0 1 8 0v3'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'><rect x='4' y='10' width='16' height='10' rx='2'/><path d='M8 10V7a4 4 0 0 1 8 0v3'/></svg>") center/contain no-repeat; }

body.sd-lock { overflow: hidden; }

/* ---------- 3. 반응형 ---------- */
@media (max-width: 900px) {
  .sd-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .smart-drop { padding: 0 0 14px; }
  .sd-card { padding: 16px 13px 14px; border-radius: 22px; }
  .sd-head h2 { font-size: 1.06rem; }
  .sd-sub { font-size: .82rem; }
  .sd-zone { margin-top: 12px; padding: 18px 12px 16px; border-radius: 17px; }
  .sd-zone-ico { width: 40px; height: 40px; margin-bottom: 8px; border-radius: 13px; }
  .sd-zone .btn-primary { width: 100%; padding: 13px 18px; }
  .sd-or { font-size: .86rem; }
  .sd-formats { font-size: .71rem; line-height: 1.45; }
  .sd-legend { grid-template-columns: 1fr 1fr; gap: 6px; }
  .sd-legend li { padding: 7px 9px; font-size: .68rem; }
  .sd-legend b { font-size: .71rem; }
  .sd-privacy { font-size: .68rem; }

  /* 모바일: 아래에서 올라오는 시트 */
  .sd-modal { align-items: flex-end; padding: 0; }
  .sd-dialog {
    width: 100%; max-height: 86vh;
    padding: 16px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0; border-bottom: 0;
    animation: sdSheet .2s ease-out;
  }
  @keyframes sdSheet { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
  .sd-dialog-ico { width: 38px; height: 38px; border-radius: 12px; font-size: 1.15rem; }
  .sd-dialog-head h2 { font-size: 1.03rem; }
  .sd-dialog-kicker { font-size: .66rem; }
  .sd-file { padding: 5px 10px 5px 8px; font-size: .75rem; }
  .sd-file-name { max-width: 170px; }
  .sd-file-tag { font-size: .66rem; }
  .sd-actions { grid-template-columns: 1fr; gap: 7px; }
  .sd-act { padding: 11px 12px; border-radius: 13px; grid-template-columns: 32px minmax(0, 1fr) 10px; }
  .sd-act-ico { width: 32px; height: 32px; border-radius: 10px; font-size: 1rem; }
  .sd-act-txt b { font-size: .89rem; }
  .sd-act-txt small { font-size: .71rem; }
  .sd-foot { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sd-modal, .sd-dialog, .sd-act, .sd-zone { animation: none !important; transition: none !important; }
}
