/* ux.css — sinabro40 (2026-10-29) "버튼이 너무 많고 뭘 눌러야 할지 모르겠다"
   처음 화면: 머리글 = 작업 공간 3개(같은 모양) · 보드 연결 · 더보기 · 로그인
             편집기 줄 = 이름 · 저장 · 파일 ▾ · 코드|블록 · ▶ 실행 (멈춤은 실행 중·보드 연결 때만)
   styles.css 뒤에 읽는다. 옛 규칙(계절 테마의 !important 등)을 이기도록 body.ux40과 id로 범위를 좁힌다. */

/* ── 머리글 ── */
body.ux40 header .ws-nav{display:flex;align-items:center;gap:2px;margin-left:6px;padding-left:12px;border-left:1px solid rgba(255,255,255,.2)}
body.ux40 header #open-ai-studio-btn.ws-btn,
body.ux40 header #open-data-studio-header-btn.ws-btn,
body.ux40 header #open-sensor-guide-btn.ws-btn{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 12px;border:1px solid transparent;border-radius:10px;background:transparent!important;color:#f6efe6;font:700 14px/1 var(--ui-font);cursor:pointer;white-space:nowrap;box-shadow:none}
body.ux40 header .ws-btn:hover{background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.18)}
body.ux40 header .ws-btn:focus-visible,body.ux40 #header-connect-btn:focus-visible,body.ux40 header .dd-trigger:focus-visible{outline:3px solid #ffb36b;outline-offset:2px}
body.ux40 header .ws-btn .material-symbols-rounded{font-size:20px;color:#ffc58f}
body.ux40 header .ws-label{font-size:14px}

body.ux40 header #header-connect-btn{display:inline-flex;align-items:center;gap:6px;height:38px;min-height:38px;padding:0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.4);background:rgba(255,255,255,.1)!important;color:#fff;font:800 13.5px/1 var(--ui-font);cursor:pointer;white-space:nowrap}
body.ux40 header #header-connect-btn:hover{background:rgba(255,255,255,.2)!important;filter:none}
body.ux40 header #header-connect-btn[data-state="connected"]{background:#1f7a52!important;border-color:#6fd3a6}
body.ux40 header #header-connect-btn .material-symbols-rounded{font-size:19px}
body.ux40 header #pico-connection-label{font-size:13.5px!important}
body.ux40 header .header-right{gap:8px;align-items:center}
body.ux40 header #dd-more .dd-trigger{height:38px;background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.4);color:#fff}
body.ux40 header #dd-more .dd-trigger:hover{background:rgba(255,255,255,.2)}
body.ux40 header #dd-more .dd-caret{color:#eadfce}
body.ux40 header #dd-more{z-index:10060}

/* [더보기] 넓은 판: 두 칸 */
body.ux40 #dd-more .dd-panel.dd-wide{left:auto;right:0;width:min(580px,calc(100vw - 16px));min-width:0;max-width:none;max-height:calc(100dvh - 84px);overflow:auto;grid-template-columns:1fr 1fr;gap:2px 12px;align-items:start}
body.ux40 #dd-more.open .dd-panel.dd-wide{display:grid}
body.ux40 .dd-group{display:flex;flex-direction:column;gap:2px;min-width:0}
body.ux40 .dd-group > .dd-sec{border-top:0;margin-top:0;padding-top:10px}
body.ux40 .dd-mobile-only{display:none}
body.ux40 #dd-more .dd-links{grid-column:1 / -1;display:grid;grid-template-columns:1fr 1fr;column-gap:12px;border-top:1px solid #f1e9dd;margin-top:4px}
body.ux40 #dd-more .dd-links > .dd-sec{grid-column:1 / -1}
body.ux40 .dd-panel a.dd-item{text-decoration:none;color:var(--ui-ink)}
body.ux40 .dd-link-t{display:flex;flex-direction:column;gap:2px;font:600 13.5px/1.2 var(--ui-font)}
body.ux40 .dd-link-t small{font-size:12px;font-weight:500;color:var(--ui-sub)}
body.ux40 .dd-panel .dd-item:focus-visible{outline:2px solid var(--ui-accent);outline-offset:-2px}
body.ux40 .dd-row-ctl{display:inline-flex;gap:6px;align-items:center}
body.ux40 #learning-reflect.dd-item{color:var(--ui-ink);font:inherit}

/* ── 편집기 줄 ── */
body.ux40 #save-cloud-btn.save-main{display:inline-flex;flex-direction:row;align-items:center;gap:5px;width:auto;height:var(--ui-h);min-height:0;padding:0 12px 0 10px;border:1px solid var(--ui-line);border-radius:var(--ui-radius);background:#fff}
body.ux40 #save-cloud-btn.save-main .material-symbols-rounded{font-size:19px}
body.ux40 #save-cloud-btn.save-main::after{display:inline;font:700 13px/1 var(--ui-font);color:var(--ui-ink)}
body.ux40 #save-cloud-btn.save-main:hover{border-color:#d4c3aa;background:#fffaf3}
body.ux40 .editor-header-row #sim-run-btn{height:40px;padding:0 22px;font-size:15px;letter-spacing:.01em;background:#12a66a;border:0;box-shadow:0 2px 0 #0b7a4d;color:#fff}
body.ux40 .editor-header-row #sim-run-btn:hover{background:#0f9560}
body.ux40 .editor-header-row #sim-run-btn:focus-visible,body.ux40 .editor-header-row #sim-stop-btn:focus-visible{outline:3px solid #ffb36b;outline-offset:2px}
body.ux40 .editor-header-row #sim-run-btn.is-running{background:#0d8a57;box-shadow:0 0 0 3px rgba(18,166,106,.25)}
body.ux40 .editor-header-row #sim-run-btn.is-running::after{content:"실행 중";margin-left:6px;padding:2px 6px;border-radius:6px;background:rgba(255,255,255,.22);font-size:11.5px;font-weight:700}
body.ux40:not(.sim-running):not(.board-connected) #sim-stop-btn{display:none!important}
body.ux40 .editor-header-row #sim-stop-btn{height:40px}
body.ux40:not(.board-connected) .console-status #board-files-btn{display:none!important}
body.ux40 #fullscreen-btn.labeled::after{display:none}
body.ux40 #fullscreen-btn{width:var(--ui-h);padding:0}

/* ── 처음 안내 ── */
body.ux40 .editor-container{position:relative}
.first-hint{position:absolute;left:12px;right:12px;bottom:12px;z-index:40;display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid #f1cfa6;background:#fff7ec;border-radius:12px;box-shadow:0 10px 28px rgba(20,14,6,.35);font:14px/1.45 var(--ui-font);color:#3b2c1a;max-height:calc(100% - 24px);overflow:auto}
.first-hint[hidden]{display:none!important}
.fh-icon{font-size:24px;color:#D95F00;flex:none}
.fh-steps{display:flex;flex-wrap:wrap;gap:4px 18px;margin:0;padding:0;list-style:none;counter-reset:fh;flex:1;min-width:0}
.fh-steps li{counter-increment:fh;display:flex;align-items:baseline;gap:4px;flex-wrap:wrap}
.fh-steps li::before{content:counter(fh);display:inline-grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:#D95F00;color:#fff;font:800 12px/20px var(--ui-font);text-align:center;align-self:center}
.fh-ok{border:0;border-radius:999px;background:#D95F00;color:#fff;font:800 13.5px/1 var(--ui-font);padding:10px 16px;cursor:pointer;flex:none}
.fh-ok:hover{background:#b94f00}.fh-ok:focus-visible{outline:3px solid #ffb36b;outline-offset:2px}
.fh-short{display:none}
.fh-steps b{margin-right:2px}
.fh-link{border:0;background:none;padding:0;color:#a14a00;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}
body.fullscreen-mode .first-hint{display:none!important}

/* 단축키 창 */
.keys-dialog{border:0;border-radius:16px;padding:18px 22px;max-width:min(460px,92vw);box-shadow:0 20px 50px rgba(20,14,6,.3);font:14px/1.5 var(--ui-font);color:var(--ui-ink)}
.keys-dialog::backdrop{background:rgba(20,14,6,.35)}
.keys-dialog h2{margin:0 0 10px;font-size:18px}
.keys-dialog table{border-collapse:collapse;width:100%}.keys-dialog td{padding:6px 4px;border-bottom:1px solid #f1e9dd;vertical-align:middle}
.keys-dialog td:first-child{white-space:nowrap;padding-right:14px}
.keys-dialog kbd{display:inline-block;min-width:22px;padding:2px 6px;border:1px solid #d9cbb6;border-bottom-width:2px;border-radius:6px;background:#fff;font:700 12.5px/1.3 ui-monospace,monospace;text-align:center}
.keys-dialog form{text-align:right;margin-top:12px}

/* ── 아래 상태 줄: AI 의존도 게이지를 AI 질문 칸 옆으로 ── */
body.ux40 .workspace-status .cog-summary.cog-inline{flex-direction:row;align-items:center;gap:6px;margin-left:auto}
body.ux40 .workspace-status .cog-inline .cog-gauge{background:#f3eee7;border-color:#e6dccd;color:#4a3b28;padding:3px 9px}
body.ux40 .workspace-status .cog-inline .cog-track{display:block;width:44px;background:#e2d8ca}
body.ux40 .workspace-status .cog-inline small{color:#7a6a55;white-space:nowrap}

/* ── AI 스튜디오 ── */
#ai-studio-modal .ai-studio-sub{font-size:14px;font-weight:600;color:#6b7c85;margin-left:4px}
#ai-studio-modal .ai-tab small{display:block;margin-top:2px;font-size:11.5px;font-weight:600;opacity:.75}
#ai-studio-modal button.step-indicator{border:0;background:none;font:inherit;font-size:14px!important;font-weight:600;color:#40545e;cursor:pointer;padding:7px 12px;border-radius:999px}
#ai-studio-modal button.step-indicator.active{background:#1f6f5b;color:#fff;font-weight:800;opacity:1}
#ai-studio-modal button.step-indicator:not(:disabled):not(.active):hover{background:#eaf4f1}
#ai-studio-modal button.step-indicator:disabled{cursor:not-allowed;opacity:.5}
#ai-studio-modal button.step-indicator.done:not(.active){color:#1f6f5b}
#ai-studio-modal button.step-indicator.done::before{content:"✓ "}
#ai-studio-modal button.step-indicator:focus-visible{outline:3px solid #7fc8b2;outline-offset:2px}
.studio-intro{border:1px solid #d6e6e1;background:#f4fbf8;border-radius:14px;padding:10px 14px;margin-bottom:12px;font-size:14.5px;line-height:1.55;color:#273c48}
.studio-intro summary{font-weight:800;cursor:pointer;color:#1f5b4c}
.studio-intro p{margin:8px 0}
.studio-path{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;list-style:none;padding:0;margin:8px 0 10px;counter-reset:sp}
.studio-path li{counter-increment:sp;background:#fff;border:1px solid #dbe8e4;border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:2px}
.studio-path li b::before{content:counter(sp) ". ";color:#2f8f73}
.studio-path span{font-size:13px;color:#5c727e}
.studio-example{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:space-between}
.studio-loading{display:flex;align-items:center;gap:10px;background:#fff8e6;border:1px solid #f1d58f;border-radius:12px;padding:10px 14px;margin:8px 0;font-size:14px;color:#5d4510}
.studio-loading[data-error="true"]{background:#fff0eb;border-color:#f3b9a6;color:#a13c24}
.studio-spin{flex:none;width:18px;height:18px;border-radius:50%;border:3px solid #f0d9a8;border-top-color:#D95F00;animation:studioSpin .9s linear infinite}
.studio-loading[data-error="true"] .studio-spin{display:none}
@keyframes studioSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.studio-spin{animation:none}}
.studio-what{background:#f4f7fb;border-radius:12px;padding:10px 14px;font-size:14px;margin:10px 0 14px}
.studio-what code,.studio-flow code{font-size:12.5px;background:#eef1f5;border-radius:4px;padding:0 4px}
.studio-use-grid .studio-use-main{grid-row:span 2;border-color:#9fd4c2;background:#f6fcf9}
.studio-code-preview{background:#1e2230;color:#e6e9f2;border-radius:10px;padding:10px 12px;margin:8px 0;font:12.5px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;max-height:230px;overflow:auto;white-space:pre}
.studio-steps-mini{margin:4px 0 8px;padding-left:20px;font-size:13.5px;color:#3b5360}
#studio-runtime-input{flex:1 1 240px;min-width:160px;height:32px;border:1px solid #9fcfbd;border-radius:8px;padding:0 10px;font:14px var(--ui-font);background:#fff}
#studio-runtime-input:focus{outline:2px solid #2c8f70;outline-offset:1px}

/* ── 좁은 화면 ── */
@media (max-width:1180px){
  body.ux40 header .ws-btn{padding:0 9px}
  body.ux40 header .ws-label{font-size:13px}
}
@media (max-width:1020px){
  body.ux40 header #open-ai-studio-btn.ws-btn,body.ux40 header #open-data-studio-header-btn.ws-btn,body.ux40 header #open-sensor-guide-btn.ws-btn{padding:0 8px;gap:0}
  body.ux40 header .ws-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
@media (max-width:720px){
  body.ux40 header .ws-nav{display:none}
  body.ux40 .dd-mobile-only{display:flex}
  body.ux40 #dd-more .dd-panel.dd-wide{position:fixed;top:56px;left:8px!important;right:8px!important;width:auto;grid-template-columns:1fr;max-height:calc(100dvh - 70px)}
  body.ux40 #dd-more .dd-links{grid-template-columns:1fr}
  body.ux40 header #header-connect-btn{padding:0 10px}
  body.ux40 header .header-right{width:auto;justify-content:flex-end;margin-left:auto}
  body.ux40 header{flex-wrap:nowrap;align-items:center}
  body.ux40 header .header-left{flex-wrap:nowrap}
  body.ux40 .editor-header-row #sim-run-btn{padding:0 16px}
  .first-hint{align-items:flex-start;font-size:13.5px;padding:8px 10px;gap:8px}
  .first-hint .fh-icon{display:none}
  .fh-steps{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px}
  .fh-more{display:none}.fh-short{display:inline;color:#5b4a35}
  .fh-ok{padding:8px 12px;align-self:center}
  body.ux40 header #dd-more .dd-label{display:inline}
  body.ux40 .editor-header-row .editor-tabs{flex:0 0 auto}
  body.ux40 .editor-header-row .editor-controls{flex:1 1 auto;justify-content:flex-end;width:auto}
  body.ux40 .workspace-status .cog-inline .cog-gauge > span:not(.cog-pct):not(.material-symbols-rounded),body.ux40 .workspace-status .cog-inline .cog-track{display:none}
  body.ux40 .workspace-status .cog-inline .cog-gauge{white-space:nowrap}
  .studio-path{grid-template-columns:1fr 1fr}
  #ai-studio-modal button.step-indicator{font-size:12.5px!important;padding:6px 7px}
  body.ux40 .workspace-status .cog-inline small{display:none}
}
@media (max-width:420px){
  body.ux40 header #pico-connection-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  body.ux40 header #header-connect-btn{width:40px;padding:0;justify-content:center}
}
@media print{.first-hint{display:none!important}}
