/* 2026-10-26 12-48: 흰·옅은 바탕 위 회색 글자(#888·#999·#9ca3af·#718096 등, 대비 4.5 미만) → var(--ink-3)(#646b75 · 흰 바탕 5.38) — 선·꺼진 단추·자리 글·아이콘·장식·어두운 바탕은 그대로 */
/* 2026-10-25 12-47 D1: 주황·파랑·상태색을 디자인 체계 변수로(user/common.css :root — 단추 바탕·주황 글자 --brand-700 · 누름 --brand-800 · 아이콘·선·글 없는 면 --brand · 상태 --ok·--warn·--danger·--info) — A1·A5·A7 */
/* 펜 페어링 페이지 — 사용자용 */

.pen-settings-main {
    min-height: 100vh;
    background: #f5f6fa;
    padding: 16px 0 80px;
}

.pen-settings-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pen-settings-header {
    padding: 16px 0;
}

.pen-settings-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.pen-settings-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* 상태 카드 */
.pen-status-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #c9d3e8;
}

.pen-status-card[data-state="connected"] {
    border-left-color: var(--ok);
}

.pen-status-card[data-state="connecting"],
.pen-status-card[data-state="scanning"] {
    border-left-color: var(--warn);
}

.pen-status-card[data-state="error"] {
    border-left-color: var(--danger);
}

.pen-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}
/* ★ 2026-11-24 13-59 — 숨김이 이기게.
   저자 css 가 display 를 적으면 **특이성과 상관없이** 브라우저 기본 [hidden] { display: none } 을 덮는다
   — 기원(origin)이 더 세기 때문이다(브라우저 기본 < 사용자 < 저자). 그래서 아래 한 줄을 더해
   같은 저자 css 안에서 [hidden] 쪽이 이기게 한다. 13-56 부터 숨긴다고 해 놓고 안 숨던 것이다.
   여기서는 펜을 잇기 전에도 «기기 -»·«배터리 -» 줄(#penDeviceRow·#penBatteryRow)이
   각각 532×35px 로 보였다(로컬 실측). 같은 파일 .pen-devices-hint 는 display 를 안 적어
   제대로 숨는다 — 대조군. */
.pen-status-row[hidden] { display: none; }

.pen-status-row + .pen-status-row {
    border-top: 1px solid #f0f2f5;
}

.pen-status-label {
    font-size: 13px;
    color: var(--ink-3, #646b75);
}

.pen-status-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* 기기 목록 */
.pen-devices-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.pen-devices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pen-devices-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.pen-devices-hint {
    margin: 0 0 10px;
    padding: 8px 12px;
    background: var(--info-50);
    color: #2c5fcf;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.pen-devices-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pen-devices-empty {
    text-align: center;
    color: var(--ink-3, #646b75);
    font-size: 13px;
    padding: 24px 0;
}

.pen-device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #f5f6fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.pen-device-item:hover,
.pen-device-item:active {
    background: #e9edf5;
}

.pen-device-item[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
}

.pen-device-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 0 0 2px;
}

.pen-device-address {
    font-size: 12px/* 12-46 A13: 11px */;
    color: var(--ink-3, #646b75);
    font-family: monospace;
    margin: 0;
}

.pen-device-rssi {
    font-size: 12px/* 12-46 A13: 11px */;
    color: var(--ink-3, #646b75);
    text-align: right;
    white-space: nowrap;
}

/* 버튼 */
.pen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

.pen-btn:active {
    transform: scale(0.98);
}

.pen-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pen-btn--scan {
    background: var(--brand-700);
    color: #fff;
}

.pen-btn--scan:hover:not(:disabled) {
    background: var(--brand-800);
}

.pen-btn--scan[data-scanning="true"] {
    background: var(--warn);
}

.pen-btn--danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    width: 100%;
}

.pen-btn--danger:hover:not(:disabled) {
    background: #fff5f5;
}

.pen-btn--ghost {
    background: transparent;
    color: var(--brand-700);
    border: 1px solid var(--brand-700);
    margin-top: 12px;
}

/* 도움말 */
.pen-help-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.pen-help-section summary {
    min-height: 32px;   /* 2026-10-25 12-46 C4 */
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--info);
    list-style: none;
}

.pen-help-section summary::after {
    content: "›";
    float: right;
    transition: transform 0.15s;
}

.pen-help-section details[open] summary::after {
    transform: rotate(90deg);
}

.pen-help-section ol {
    margin: 12px 0 0;
    padding-left: 20px;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}

/* ★★ 2026-11-26 대표 「새창열기인데 콘텐츠 안에 **닫기 버튼만**, **상하좌우 검은 테두리 없이**
   **전체 창**으로 했으면 좋겠습니다」
   → 레터박스(검은 여백)를 없애고 **창을 꽉 채운다**. 막대도 없애고 **닫기 단추만** 위에 띄운다.
   ★ 내용은 16:9 로 만들어져 있으므로, 창 비율이 다르면 **채우되 넘치는 쪽을 자르지 않는다**
     — iframe 자체를 창 크기로 두고 안쪽 콘텐츠가 제 비율로 맞춘다(콘텐츠 쪽이 16:9 를 지킨다).
   ★ 연결이 끊기지 않는 까닭은 그대로다 — 이 화면을 **떠나지 않기** 때문이다. */
.pen-view {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #000;
}

.pen-view[hidden] { display: none; }

/* 콘텐츠가 **창을 꽉 채운다** — 검은 테두리가 생기지 않는다 */
.pen-view-frame {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

/* 닫기 단추만 콘텐츠 **위에** 떠 있다
   ★★ 2026-11-26 대표 「메인으로 가는 버튼과 제품으로 가는 버튼 등 버튼이 안 되는 게 있습니다」
      단추 줄이 **머리 줄 오른쪽**(top: 10px)에 있어 그 안 화면의 메뉴·로그인 단추를 덮었다
      (로컬 실측: 화면 오른쪽 위를 찍으면 penViewClose 가 받았다).
      → **아래 오른쪽**으로 내린다 — 교재도 플랫폼 화면도 그 자리는 비어 있다. */
.pen-view-bar {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 0;
    padding: 0;
}

/* 제목·새 창에서·안내는 **감춘다**(대표 「닫기 버튼만」) */
.pen-view-title,
.pen-view-open,
.pen-view-hint { display: none; }

.pen-view-bar .pen-view-close {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.pen-view-bar .pen-view-close:hover {
    background: rgba(192, 57, 43, .9);
    border-color: rgba(192, 57, 43, .9);
}

/* 겹침이 떠 있는 동안 뒤쪽은 스크롤하지 않는다 */
body.pen-view-on { overflow: hidden; }

/* 「Smart Pen」 단추 — 펜 화면에서 전체 창을 연다 */
.pen-btn--smart {
    width: 100%;
    margin: 0 0 16px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
}

/* ★★★ 2026-11-26 대표 «펜을 움직여 포지션으로 이동 — 마우스같이 비례로 움직여야 한다»
   펜이 가리킨 자리를 전체 창 위에 **커서**로 그린다. 눌러지는 것이 아니라 보이기만 한다.
   ★ 움직임이 멈추면 2.5초 뒤 스스로 옅어진다(화면을 가리지 않게). */
/* ★★ 2026-11-28 대표 「지금 **동그라미 표시는 터치에서** 이루어지는 표시고 … **펜에서는 화살표가 나와야** 됩니다」
         ·「**마우스하고 똑같은 기능**」
   → 동그라미(터치 자국)를 **마우스 화살표**로 바꾼다. 모양은 앱과 **같은 경로**다 —
     `PenCursorOverlay.kt:onDraw` 의 Path(0,0 → 0,24 → 6,18 → 10,28 → 15,26 → 11,17 → 20,17 → 닫기)
     흰 채움 + 검은 테두리 2. 그것을 SVG 로 그대로 옮겼다(한쪽만 고치면 앱과 달라진다).
   ★ 가리키는 자리가 **왼쪽 위 끝**이다(마우스와 같다) — 동그라미 때의 `margin:-11px` 가운데 맞춤을 없앤다. */
.pen-cursor {
    position: absolute;
    z-index: 3;
    width: 22px;
    height: 30px;
    margin: 0;                 /* 화살표는 **왼쪽 위 끝**이 가리킨 자리다(마우스와 같다) */
    /* ★ 꺾쇠(< >)까지 **인코딩**한다 — 날것으로 두면 iOS Safari(아이패드 웹뷰)가 data URI 를
       통째로 버려 커서가 **안 보인다**. `#` 도 %23 이어야 한다(CSS 가 조각 구분자로 읽는다). */
    background: url("data:image/svg+xml;utf8,\
%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 23 31' width='22' height='30'%3E\
%3Cpath d='M0 0 L0 24 L6 18 L10 28 L15 26 L11 17 L20 17 Z' fill='%23fff' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E\
%3C/svg%3E") no-repeat 0 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
    pointer-events: none;      /* 커서가 콘텐츠를 가로채지 않는다 */
    opacity: 0;
    transition: opacity .25s, left .06s linear, top .06s linear;
}

.pen-cursor.is-on { opacity: 1; }
