/*
 * ORDARS 앱 다운로드 — 페이지(/apps/download) + 설정 모달 공용 스타일
 * 2026-07-26 개편 → 2026-08-12 릴리스 축 개편(앱 × 플랫폼 × 버전 · R2 업로드 · OS 감지 강조)
 */
.appdl-page { margin: 0; padding: 40px 16px 56px; background: #f4f5f7; color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", sans-serif; }
.appdl-wrap { max-width: 860px; margin: 0 auto; }

.appdl-head { margin-bottom: 22px; }
.appdl-logo { font-size: 13px; font-weight: 800; letter-spacing: -0.2px; color: #64748b; }
.appdl-logo span { color: #2563eb; }
.appdl-head h1 { margin: 6px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.6px; }

.appdl-list { display: flex; flex-direction: column; gap: 18px; }
.appdl-card { background: #fff; border: 1px solid #e6e8ec; border-radius: 18px; padding: 30px 32px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.appdl-card-top { display: flex; align-items: baseline; gap: 12px; }
.appdl-name { margin: 0; font-size: 38px; font-weight: 900; letter-spacing: -1.4px; line-height: 1.1; }
.appdl-tagline { margin: 10px 0 0; font-size: 15.5px; color: #334155; letter-spacing: -0.2px; }
.appdl-desc { margin: 8px 0 0; font-size: 12.5px; color: #94a3b8; line-height: 1.7; }

/* 플랫폼 타일 — 릴리스가 있는 플랫폼만. 타일 전체가 다운로드 링크.
 * 플랫폼마다 자기 최신 버전·파일 크기를 표기하고, 방문자 OS(is-primary)는 강조. */
.appdl-plats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.appdl-plat { display: flex; align-items: center; gap: 12px; padding: 13px 18px 13px 15px;
  border: 1px solid #e2e8f0; border-radius: 13px; background: #fbfcfe;
  text-decoration: none; color: inherit; min-width: 180px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease; }
.appdl-plat:hover { border-color: #93c5fd; background: #f4f9ff; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08); }
.appdl-plat.is-primary { border-color: #2563eb; background: #eff6ff; box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12); }
.appdl-os { width: 30px; height: 30px; flex-shrink: 0; color: #0f172a; }
.appdl-plat.is-primary .appdl-os { color: #1d4ed8; }
.appdl-plat-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.appdl-plat-name { font-size: 14px; font-weight: 800; letter-spacing: -0.2px; display: flex; align-items: center; gap: 6px; }
.appdl-plat-mine { font-style: normal; font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
  background: #2563eb; color: #fff; }
.appdl-plat-verline { font-size: 11.5px; color: #64748b; white-space: nowrap; }
.appdl-plat-verline strong { color: #0f172a; }
.appdl-plat-link { font-size: 12px; color: #2563eb; font-weight: 700; margin-top: 2px; }
.appdl-plat:hover .appdl-plat-link { text-decoration: underline; }

.appdl-card-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.appdl-help { margin: 24px 4px 0; font-size: 11.5px; color: #94a3b8; line-height: 1.7; text-align: center; }

@media (max-width: 640px) {
  .appdl-page { padding: 26px 12px 40px; }
  .appdl-card { padding: 22px 20px; border-radius: 14px; }
  .appdl-name { font-size: 28px; letter-spacing: -1px; }
  .appdl-tagline { font-size: 14px; }
  .appdl-plats { gap: 10px; margin-top: 20px; }
  .appdl-plat { flex: 1 1 100%; min-width: 0; }
  .appdl-os { width: 26px; height: 26px; }
}

/* 릴리스 노트·이전 버전 (다운로드 페이지) — 플랫폼 단위 */
.appdl-relnote { margin: 0 0 8px; font-size: 11.5px; color: #64748b; line-height: 1.6; }
.appdl-relnote strong { color: #1e40af; margin-right: 4px; }
.appdl-older { margin-top: 12px; }
.appdl-older > summary { list-style: none; cursor: pointer; font-size: 11.5px; color: #64748b; font-weight: 600; }
.appdl-older > summary::-webkit-details-marker { display: none; }
.appdl-older > summary::before { content: "▸ "; }
.appdl-older[open] > summary::before { content: "▾ "; }
.appdl-older > summary:hover { color: #2563eb; }
.appdl-older ul { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid #f1f5f9; }
.appdl-older li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 11.5px; }
.appdl-older-plat { flex-shrink: 0; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: #475569;
  font-size: 10px; font-weight: 700; }
.appdl-older-ver { font-weight: 700; color: #0f172a; }
.appdl-older-desc { flex: 1; min-width: 120px; color: #94a3b8; }
.appdl-older-desc em { font-style: normal; color: #cbd5e1; }
.appdl-older-links a { color: #2563eb; text-decoration: none; font-weight: 600; }
.appdl-older-links a:hover { text-decoration: underline; }
.appdl-empty { padding: 34px 20px; text-align: center; background: #fff; border: 1px dashed #cbd5e1;
  border-radius: 16px; font-size: 13px; color: #475569; line-height: 1.7; }
.appdl-empty span { font-size: 11.5px; color: #94a3b8; }

/* ───────────────────────── 설정 모달 ───────────────────────── */

/* 탭 패널 공통 */
.oapp-panel { padding: 20px; }
.oapp-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.oapp-panel-intro { margin: 0; font-size: 12px; color: #6b7280; line-height: 1.6; }
.oapp-panel-intro a { color: #2563eb; }

/* 인라인 등록 폼 — JS 없이 details/summary 로 토글 (앱 등록 · 릴리스 추가)
 * ⚠2026-07-26: 페이지 CSS 를 다시 쓰면서 이 블록이 유실돼 「앱 등록」이 무스타일로 노출됐다.
 *   같은 파일에 페이지·모달 스타일이 함께 있으니 블록 단위 교체 시 주의. */
.sset-inline-add { position: relative; flex-shrink: 0; }
.sset-inline-add > summary { list-style: none; cursor: pointer; padding: 6px 12px; border: 1px solid #93c5fd;
  border-radius: 8px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px; }
.sset-inline-add > summary::-webkit-details-marker { display: none; }
.sset-inline-add > summary::marker { content: ""; }
.sset-inline-add > summary:hover { background: #dbeafe; }
.sset-inline-add[open] > summary { background: #dbeafe; }
.sset-inline-form { display: flex; gap: 6px; margin-top: 8px; }
.sset-inline-form input[type="text"] { flex: 1; min-width: 180px; padding: 7px 10px; border: 1px solid #d1d5db;
  border-radius: 7px; font-size: 12.5px; background: #fff; color: #111827; }
.sset-inline-form input[type="text"]:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.sset-inline-form button { padding: 7px 14px; border: none; border-radius: 7px; background: #2563eb; color: #fff;
  font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sset-inline-form button:hover { background: #1d4ed8; }
.sset-inline-hint { display: block; margin-top: 5px; font-size: 10.5px; color: #94a3b8; line-height: 1.5; }
.sset-inline-hint code { font-size: 10px; background: #f1f5f9; border-radius: 4px; padding: 0 4px; }

/* 앱 목록 */
.oapp-list { display: flex; flex-direction: column; gap: 8px; }
.oapp-list-card { margin-bottom: 0; }
.oapp-plat-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.oapp-plat-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; color: #3730a3; font-size: 10.5px; font-weight: 700; }
.oapp-plat-badge em { font-style: normal; font-weight: 600; color: #6366f1; }

/* 앱 관리 모달 — 폼 공통 */
.oapp-form { margin: 0; }
.oapp-rows { display: flex; flex-direction: column; gap: 10px; }
.oapp-row { display: flex; gap: 10px; align-items: flex-end; }
.oapp-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.oapp-field > span { font-size: 11.5px; font-weight: 600; color: #374151; }
.oapp-field > span small { font-weight: 400; color: #9ca3af; margin-left: 4px; }
.oapp-field input, .oapp-field textarea, .oapp-field select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 12.5px; background: #fff; color: #111827; font-family: inherit; box-sizing: border-box; width: 100%; }
.oapp-field input:focus, .oapp-field textarea:focus, .oapp-field select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.oapp-grow1 { flex: 1 1 0; } .oapp-grow2 { flex: 2 1 0; }
.oapp-ver-num { flex: 0 0 110px; }
.oapp-plat-sel { flex: 0 0 130px; }

/* 외부 링크 — 라벨 + 입력 한 줄 */
.oapp-url-row { display: flex; align-items: center; gap: 10px; }
.oapp-url-label { flex: 0 0 74px; font-size: 11.5px; font-weight: 600; color: #374151; }
.oapp-url-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 12.5px; background: #fff; color: #111827; box-sizing: border-box; }
.oapp-url-row input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

/* 소스 선택 (파일 업로드 | 외부 링크) */
.oapp-src-seg { display: flex; gap: 16px; padding: 2px 1px; }
.oapp-src-seg label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: #374151; cursor: pointer; }
.oapp-src-seg label small { font-weight: 400; color: #9ca3af; }
.oapp-src-seg input[type="radio"] { accent-color: #2563eb; }

/* 파일 드롭존 — label 전체가 클릭 영역, input 은 시각적으로 숨김 */
.oapp-file-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px;
  border: 1.5px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; cursor: pointer; text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease; }
.oapp-file-drop:hover { border-color: #93c5fd; background: #f0f7ff; }
.oapp-file-drop.is-over { border-color: #2563eb; background: #eff6ff; }
.oapp-file-drop.has-file { border-style: solid; border-color: #93c5fd; background: #f0f7ff; }
.oapp-file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.oapp-file-drop-icon { color: #64748b; }
.oapp-file-drop.has-file .oapp-file-drop-icon { color: #2563eb; }
.oapp-file-drop-text { font-size: 12.5px; font-weight: 600; color: #334155; word-break: break-all; }
.oapp-file-drop-hint { font-size: 10.5px; color: #94a3b8; }

/* 업로드 진행률 */
.oapp-progress { display: flex; align-items: center; gap: 10px; }
.oapp-progress-track { flex: 1; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.oapp-progress-bar { height: 100%; width: 0; border-radius: 999px; background: #2563eb; transition: width 0.15s ease; }
.oapp-progress-label { flex-shrink: 0; font-size: 11px; font-weight: 700; color: #2563eb; min-width: 34px; text-align: right; }

.oapp-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.oapp-spacer { flex: 1; }
.oapp-switch-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #374151; }
.oapp-btn, .oapp-btn-primary, .oapp-btn-danger { padding: 7px 14px; border-radius: 8px; font-size: 12px;
  font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.oapp-btn { background: #fff; border-color: #d1d5db; color: #374151; }
.oapp-btn:hover { background: #f3f4f6; }
.oapp-btn-primary { background: #2563eb; color: #fff; }
.oapp-btn-primary:hover { background: #1d4ed8; }
.oapp-btn-primary:disabled { background: #93c5fd; cursor: default; }
.oapp-btn-danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.oapp-btn-danger:hover { background: #fef2f2; }
.oapp-note { margin: 8px 0 0; font-size: 11px; color: #b45309; }

.oapp-sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.oapp-sec-head h4 { margin: 0 0 3px; font-size: 13px; font-weight: 700; color: #0f172a; }
.oapp-sec-head p { margin: 0; font-size: 11px; color: #6b7280; line-height: 1.6; }
.oapp-rel-form { padding: 12px; margin-top: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  min-width: 380px; }

.oapp-empty { padding: 22px 14px; text-align: center; background: #f9fafb; border: 1px dashed #d1d5db;
  border-radius: 10px; font-size: 12px; color: #9ca3af; }

/* 플랫폼별 릴리스 그룹 */
.oapp-plat-groups { display: flex; flex-direction: column; gap: 14px; }
.oapp-plat-group { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; overflow: hidden; }
.oapp-plat-group-head { display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  background: #f8fafc; border-bottom: 1px solid #eef2f7; }
.oapp-plat-group-icon .appdl-os { width: 17px; height: 17px; display: block; color: #334155; }
.oapp-plat-group-name { font-size: 12.5px; font-weight: 800; color: #0f172a; }
.oapp-plat-group-latest { font-size: 11px; color: #64748b; }
.oapp-plat-group-latest strong { color: #1d4ed8; }
.oapp-plat-group-none { font-size: 11px; color: #b45309; }
.oapp-plat-group-count { font-size: 10.5px; color: #94a3b8; }

/* 릴리스 행 */
.oapp-rel { padding: 12px 13px; border-top: 1px solid #f1f5f9; }
.oapp-rel:first-of-type { border-top: none; }
.oapp-rel.is-latest { background: #f8fbff; }
.oapp-rel.is-unpublished { background: #fcfcfd; }
.oapp-rel.is-unpublished .oapp-rel-ver { color: #94a3b8; }
.oapp-rel-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.oapp-rel-ver { font-size: 13px; font-weight: 800; color: #0f172a; }
.oapp-ver-tag { padding: 1px 8px; border-radius: 999px; background: #dbeafe; color: #1e40af; font-size: 10px; font-weight: 700; }
.oapp-ver-warn { padding: 1px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; }
.oapp-rel-src { padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.oapp-rel-src.is-file { background: #ecfdf5; color: #047857; }
.oapp-rel-src.is-link { background: #f1f5f9; color: #475569; }
.oapp-rel-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; font-size: 10.5px; color: #94a3b8; }
.oapp-rel-file { color: #64748b; font-weight: 600; word-break: break-all; }
.oapp-rel .oapp-actions { margin-top: 10px; }

/* 앱 목록 드래그 핸들 */
.oapp-drag { display: flex; align-items: center; flex-shrink: 0; margin-right: 2px; color: #cbd5e1;
  cursor: grab; touch-action: none; }
.oapp-drag:hover { color: #94a3b8; }
.sset-card:hover .oapp-drag { color: #94a3b8; }

/* 히스토리 탭 */
.oapp-history-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.oapp-history-title span { font-weight: 500; color: #9ca3af; }
.oapp-history-scroll { max-height: 340px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
.oapp-history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.oapp-history-table thead tr { background: #f8fafc; position: sticky; top: 0; }
.oapp-history-table th { padding: 8px 10px; text-align: center; color: #6b7280; font-weight: 600; white-space: nowrap; }
.oapp-history-table td { padding: 7px 10px; text-align: center; color: #374151; }
.oapp-history-table tbody tr { border-top: 1px solid #f1f5f9; }
.oapp-history-table .is-left { text-align: left; }
.oapp-history-user { color: #111827; font-weight: 500; }
.oapp-history-email { color: #9ca3af; font-size: 11px; }
.oapp-history-app { padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; background: #eef2ff; color: #4338ca; }
.oapp-history-dim { color: #6b7280; white-space: nowrap; }
.oapp-history-ip { color: #9ca3af; font-family: monospace; font-size: 11px; }
