/* 편집기·대화 상자 모양(L5). 우리 디자인이다: 구글 색·로고·아이콘 없음, 단추는 글자뿐.
   변수는 웹앱 app.css 와 같은 이름(--ink --sub --line --soft --acc ...). 바깥 파일·주소 없음. */
.pr-editor, .pr-dialog {
  --ed-bg: #fff; --ed-chrome: #f3f3f1; --ed-line: #cfcfca; --ed-mute: #5a5a5a;
  --ed-ok: #1b6b2f; --ed-bad: #a1261b;
  color: var(--ink, #161616);
  font-family: "PretendardSub", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
.pr-editor *, .pr-dialog * { box-sizing: border-box; }
.pr-editor [hidden], .pr-dialog [hidden] { display: none !important; }

/* ---- 단추 공통(편집기·대화 상자 안) ---- */
.pr-editor .pr-btn, .pr-dialog .pr-btn {
  min-height: 40px; padding: 6px 14px; font: inherit; font-size: 15px; line-height: 1.2; cursor: pointer;
  color: var(--ink, #161616); background: #fff; border: 1px solid #8a8a85; border-radius: 6px;
}
.pr-editor .pr-btn:hover, .pr-dialog .pr-btn:hover { background: #ecece8; }
.pr-editor .pr-btn-primary, .pr-dialog .pr-btn-primary { background: var(--acc, #0b4f8a); border-color: var(--acc, #0b4f8a); color: #fff; font-weight: 700; }
.pr-editor .pr-btn-primary:hover, .pr-dialog .pr-btn-primary:hover { background: #083d6c; }
.pr-editor .pr-btn-small, .pr-dialog .pr-btn-small { min-height: 40px; padding: 4px 10px; font-size: 14px; }
.pr-editor .pr-btn[aria-disabled="true"], .pr-editor .pr-btn:disabled, .pr-dialog .pr-btn:disabled { opacity: .55; cursor: not-allowed; }
.pr-editor button:focus-visible, .pr-editor select:focus-visible, .pr-editor textarea:focus-visible, .pr-editor input:focus-visible,
.pr-editor [tabindex]:focus-visible, .pr-dialog button:focus-visible, .pr-dialog input:focus-visible, .pr-dialog select:focus-visible {
  outline: 2px solid var(--acc, #0b4f8a); outline-offset: 1px;
}
.pr-dialog .pr-link { background: none; border: 0; padding: 6px 0; color: var(--acc, #0b4f8a); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---- 편집기 틀 ---- */
.pr-editor { display: flex; flex-direction: column; height: 100%; min-height: 440px; background: var(--ed-bg); border: 1px solid var(--ed-line); min-width: 0; }
.pr-ed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; background: var(--ed-chrome); border-bottom: 1px solid var(--ed-line); }
.pr-ed-pname { min-height: 40px; max-width: 220px; padding: 4px 8px; font: inherit; font-weight: 700; font-size: 16px; color: inherit; background: transparent; border: 1px dashed transparent; border-radius: 6px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-ed-pname:hover { border-color: #8a8a85; background: #fff; }
.pr-ed-fn { min-height: 40px; min-width: 130px; max-width: 220px; padding: 4px 8px; font: inherit; font-size: 16px; border: 1px solid #8a8a85; border-radius: 6px; background: #fff; color: inherit; }
.pr-ed-deploywrap { position: relative; display: inline-block; }
.pr-ed-dmenu { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 150px; margin-top: 2px; padding: 4px; background: #fff; border: 1px solid #8a8a85; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.pr-ed-mi { display: block; width: 100%; min-height: 40px; padding: 6px 12px; text-align: left; font: inherit; font-size: 15px; color: inherit; background: none; border: 0; border-radius: 4px; cursor: pointer; }
.pr-ed-mi:hover, .pr-ed-mi:focus { background: #e3edf6; }
.pr-ed-status { margin-left: auto; font-size: 14px; color: var(--ed-mute); }
.pr-ed-status.pr-ed-dirty { color: var(--ed-bad); font-weight: 700; }
.pr-ed-msg { padding: 8px 12px; font-size: 15px; background: #eef3f8; border-bottom: 1px solid var(--ed-line); }
.pr-ed-msg-err { background: #fbe9e7; color: #7a1c13; }
.pr-ed-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 12px; font-size: 15px; background: #fff6c9; border-bottom: 1px solid #d6c36a; }

/* ---- 본문: 왼쪽 목록 + 가운데 ---- */
.pr-ed-body { display: flex; flex: 1 1 auto; min-height: 0; }
.pr-ed-side { flex: 0 0 188px; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; overflow: auto; background: #fafaf8; border-right: 1px solid var(--ed-line); font-size: 15px; }
.pr-ed-sidehead { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 4px; }
.pr-ed-files { list-style: none; margin: 0 0 8px; padding: 0; }
.pr-ed-file { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.pr-ed-file.pr-ed-on, .pr-ed-navbtn.pr-ed-on { background: #dce8f3; }
.pr-ed-filebtn, .pr-ed-navbtn { flex: 1 1 auto; min-height: 40px; padding: 4px 8px; text-align: left; font: inherit; font-size: 15px; color: inherit; background: none; border: 0; border-radius: 6px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-ed-filebtn:hover, .pr-ed-navbtn:hover { background: #ecece8; }
.pr-ed-side > .pr-ed-navbtn { flex: 0 0 auto; }
.pr-ed-mini { min-height: 40px; min-width: 40px; padding: 2px 6px; font: inherit; font-size: 13px; color: var(--ed-mute); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.pr-ed-mini:hover { background: #ecece8; color: inherit; }
.pr-ed-file .pr-ed-mini { display: none; }
.pr-ed-file.pr-ed-on .pr-ed-mini, .pr-ed-file:hover .pr-ed-mini, .pr-ed-file:focus-within .pr-ed-mini { display: inline-block; }
.pr-ed-main { flex: 1 1 auto; min-width: 0; display: flex; }

/* ---- 코드 칸 ---- */
.pr-ed-code { flex: 1 1 auto; display: flex; min-width: 0; min-height: 0; overflow: hidden; }
.pr-ed-gutter, .pr-ed-ta { margin: 0; padding: 8px 8px; font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; }
.pr-ed-gutter { flex: 0 0 auto; min-width: 3.4em; overflow: hidden; text-align: right; color: #666; background: var(--ed-chrome); border-right: 1px solid var(--ed-line); user-select: none; }
.pr-ed-ta { flex: 1 1 auto; min-width: 0; resize: none; border: 0; border-radius: 0; color: var(--ink, #161616); background: #fff; white-space: pre; overflow: auto; tab-size: 2; }
.pr-ed-ta:focus-visible { outline-offset: -2px; }

/* ---- 트리거·보낸 메일 ---- */
.pr-ed-list { flex: 1 1 auto; min-width: 0; padding: 12px; overflow: auto; font-size: 15px; }
.pr-ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #e2e2dd; }
.pr-ed-rowmain { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.pr-ed-sub, .pr-ed-empty { color: var(--ed-mute); font-size: 14px; }
.pr-ed-mail { padding: 8px 0; border-bottom: 1px solid #e2e2dd; }
.pr-ed-mailbody { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--ed-chrome); padding: 8px; border-radius: 6px; }

/* ---- 실행 로그 ---- */
.pr-ed-logbox { flex: 0 0 auto; border-top: 1px solid var(--ed-line); background: #fafaf8; }
.pr-ed-loghead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 10px; font-size: 15px; }
.pr-ed-logbtns { display: inline-flex; gap: 6px; }
.pr-ed-log { height: 150px; overflow: auto; padding: 4px 10px 8px; font: 13.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: #fff; border-top: 1px solid #e2e2dd; }
.pr-ed-logline { display: flex; gap: 10px; overflow-wrap: anywhere; }
.pr-ed-time { flex: 0 0 auto; color: #666; }
.pr-ed-lv { flex: 0 0 2.4em; color: #666; }
.pr-ed-lt { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; }
.pr-lv-warn .pr-ed-lv, .pr-lv-warn .pr-ed-lt { color: #7a5200; }
.pr-lv-error .pr-ed-lv, .pr-lv-error .pr-ed-lt { color: var(--ed-bad); font-weight: 700; }

/* ---- 대화 상자(권한 검토·배포·알림 공통) ---- */
.pr-dialog-back { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(20, 20, 20, .45); }
.pr-dialog { width: min(480px, 100%); max-height: calc(100vh - 24px); overflow: auto; padding: 18px 20px; background: #fff; border: 1px solid #8a8a85; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.3); font-size: 16px; line-height: 1.55; }
.pr-dialog-title { margin: 0 0 8px; padding: 0; border: 0; font-size: 18px; line-height: 1.35; }
.pr-dialog-text { margin: 0 0 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.pr-dialog input[type="text"], .pr-dialog select { width: 100%; min-height: 40px; padding: 6px 10px; font: inherit; font-size: 16px; color: inherit; background: #fff; border: 1px solid #8a8a85; border-radius: 6px; }
.pr-dialog label { display: block; margin: 8px 0; }
.pr-dialog label > span { display: block; margin-bottom: 3px; font-size: 14px; color: var(--ed-mute); }
.pr-dialog-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pr-dialog-buttons [data-pr="auth-account"] { flex: 1 1 100%; text-align: left; }
.pr-toasts { z-index: 1100; }

.pr-auth-adv { margin: 4px 0; }
.pr-auth-scopes { margin: 8px 0 0; padding-left: 1.3em; }
.pr-auth-scopes li { margin: 2px 0; }

/* ---- 배포 창 ---- */
.pr-deploy { display: block; }
.pr-deploy-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pr-deploy-type { margin: 6px 0; }
.pr-type-list { margin-top: 6px; padding: 6px; border: 1px solid var(--ed-line); border-radius: 6px; background: var(--ed-chrome); }
.pr-type-opt { display: block; width: 100%; text-align: left; }
.pr-note { margin: 6px 0 0; font-size: 14px; color: var(--ed-mute); }
.pr-note-warn { color: #7a5200; font-weight: 700; }
.pr-deploy-me, .pr-deploy-meta { margin: 6px 0; font-size: 15px; }
.pr-deploy-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 15px; }
.pr-deploy-dl dt { color: var(--ed-mute); }
.pr-deploy-dl dd { margin: 0; }
.pr-deploy-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pr-url-row { margin: 8px 0; }
.pr-url { display: block; padding: 8px 10px; font: 13.5px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--ed-chrome); border: 1px solid var(--ed-line); border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.pr-url-btns { display: flex; gap: 8px; margin-top: 8px; }

/* ---- 좁은 화면 ---- */
@media (max-width: 640px) {
  .pr-editor { min-height: 520px; }
  .pr-ed-top { gap: 6px; padding: 6px; }
  .pr-ed-status { margin-left: 0; flex-basis: 100%; }
  .pr-ed-body { flex-direction: column; }
  .pr-ed-side { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; max-height: 120px; border-right: 0; border-bottom: 1px solid var(--ed-line); }
  .pr-ed-sidehead { flex: 0 0 100%; }
  .pr-ed-files { display: flex; flex-wrap: wrap; margin: 0; }
  .pr-ed-file .pr-ed-mini { display: inline-block; }
  .pr-ed-main { min-height: 220px; }
  .pr-ed-log { height: 110px; }
  .pr-dialog { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .pr-editor *, .pr-dialog * { transition: none !important; animation: none !important; } }
@media print { .pr-editor, .pr-dialog-back { display: none !important; } }
