/* 계정 서비스에서만 쓰는 모양 */
.entity-foot { font-size: 12.5px; line-height: 1.7; }
.auth-side .entity-foot a { color: #fff; }
.logout-form { margin: 0; }
.nav-btn { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; }
.steps-line { display: flex; gap: 8px; margin: 0 0 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.steps-line span { padding: 5px 12px; border-radius: 999px; background: #eef0f4; }
.steps-line span.on { background: var(--blue); color: #fff; font-weight: 700; }
.steps-line span.done { background: var(--green-50); color: #166534; }
.radio-line { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.radio-line label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.radio-line input[type=text], .radio-line input[type=email] { flex: 1; min-width: 0; }
.check-line { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; margin: 8px 0; }
.check-line input { margin-top: 3px; }
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.app-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.app-card.soon { opacity: .6; }
.app-card h3 { font-size: 16.5px; font-weight: 800; }
.app-card .use { font-size: 13.5px; color: var(--muted); }
.app-card .use b { color: var(--text); font-size: 15px; }
.app-card .btn, .app-card button { margin-top: auto; }
.doc-body h3 { font-size: 15px; font-weight: 750; margin: 16px 0 4px; }
.doc-body p, .doc-body li { font-size: 14px; line-height: 1.7; }
.doc-body ul { padding-left: 20px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.inline-form { display: inline; }
details.act { display: inline-block; position: relative; }
details.act > summary { list-style: none; cursor: pointer; }
details.act > summary::-webkit-details-marker { display: none; }
details.act .act-box { position: absolute; right: 0; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; width: 280px; box-shadow: var(--shadow-lg); }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } details.act .act-box { position: static; width: auto; } }

/* ===== v0.1.3 — 사장님 'YardOS UI/UX 개선 제안서 v0.2' 기준 =====
   모션은 '무슨 일이 일어났는지' 알릴 때만. 시간 토큰: fast 120 / base 200 / slow 320ms.
   transform·opacity만 움직인다. 기기의 '동작 줄이기'를 따르면 모두 끈다. */
:root {
  --t-fast: 120ms; --t-base: 200ms; --t-slow: 320ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--blue);
}

/* 포커스 표시(키보드로 이동할 때 지금 어디인지) — 2px 테두리 */
:focus { outline: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .nav-item:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px;
}

/* 버튼·메뉴: 누를 수 있다는 신호와 눌림 반응 */
button, .btn, .nav-item, .app-card { transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
button:active:not(:disabled), .btn:active { transform: scale(.98); }
button[aria-busy="true"] { opacity: .75; cursor: progress; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 모달 창 — 되돌리기 어렵거나 사유를 받아야 하는 일에만 */
dialog.dlg { border: 0; padding: 0; border-radius: 16px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(16, 24, 40, .28); text-align: left; white-space: normal; }
dialog.dlg::backdrop { background: rgba(15, 23, 42, .45); }
dialog.dlg[open] { animation: dlg-in var(--t-slow) var(--ease-out); }
dialog.dlg[open]::backdrop { animation: fade-in var(--t-base) var(--ease-out); }
dialog.dlg form { padding: 22px 22px 18px; margin: 0; }
dialog.dlg h3 { font-size: 18px; font-weight: 800; margin: 0 0 2px; }
.dlg-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 토스트 — 결과를 잠깐 알리고 사라진다 */
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--green-50); color: #166534; border: 1px solid #bbf7d0; }
.toast .toast-x { margin-left: auto; background: none; border: 0; color: inherit; padding: 0 4px; font-size: 18px; line-height: 1; font-weight: 400; }
.toast .toast-x:hover { background: none; color: inherit; opacity: .7; }
.toast.is-float { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); margin: 0; background: #0f172a; color: #fff; border-color: transparent; box-shadow: 0 12px 30px rgba(16, 24, 40, .3); animation: toast-in var(--t-base) var(--ease-out); }
.toast.is-float .ic { color: #4ade80; }
.toast.is-leaving { animation: toast-out var(--t-base) var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* 입력 즉시 검증 — 칸 아래에 통과/오류를 바로 */
.field-msg { display: block; font-size: 12.5px; font-weight: 500; margin: -6px 0 10px; min-height: 0; }
.field-msg.ok { color: #15803d; }
.field-msg.bad { color: #b91c1c; }
input.is-bad { border-color: #ef4444; }
input.is-ok { border-color: #22c55e; }

/* 표의 작업 단추 줄: 줄바꿈되어도 가지런하게 */
.row-actions { flex-wrap: wrap; row-gap: 6px; }
.empty-box { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-box b { display: block; color: var(--text); font-size: 15.5px; margin-bottom: 4px; }

/* 화면이 바뀔 때 본문이 아주 짧게 나타남(약한 Fade만) */
main.content > *, .auth-card > * { animation: fade-in var(--t-fast) var(--ease-out); }

/* 휴대폰: 엄지로 누르기 쉬운 크기(44px 이상) */
@media (max-width: 640px) {
  button, .btn, .nav-item, select, input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number] { min-height: 44px; }
  .btn-sm, button.btn-sm { min-height: 40px; padding: 8px 12px; }
  .toast.is-float { left: 16px; right: 16px; bottom: 16px; }
  .dlg-actions { flex-direction: column-reverse; }
  .dlg-actions button { width: 100%; }
}

/* 동작 줄이기 설정을 따르면 모든 움직임을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 휴대폰에서는 표를 카드로 접는다(옆으로 밀지 않게) */
@media (max-width: 640px) {
  table.cards-m thead { display: none; }
  table.cards-m, table.cards-m tbody, table.cards-m tr, table.cards-m td { display: block; width: 100%; min-width: 0 !important; }
  table.cards-m tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.cards-m td { padding: 3px 0 !important; border: 0 !important; white-space: normal; }
  table.cards-m td:first-child { font-size: 16px; margin-bottom: 6px; }
  table.cards-m td[data-label] { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
  table.cards-m td[data-label]::before { content: attr(data-label); color: var(--muted); flex: none; }
  table.cards-m td.row-actions { justify-content: flex-start; margin-top: 10px; }
}

/* 버전 표시 — 지금 어떤 판이 올라가 있는지 왼쪽 위에서 바로 보이게 */
.ver-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--blue-50); color: var(--blue); margin-left: 6px; letter-spacing: .02em; white-space: nowrap; }
.auth-side .ver-tag { background: rgba(255,255,255,.2); color: #fff; }
/* 휴대폰: 카드 제목 옆 단추가 글을 밀어 좁히지 않게 아래 줄로 내린다 */
@media (max-width: 640px) {
  .card-head { flex-wrap: wrap; gap: 10px; }
  .card-head > div:first-child { flex: 1 1 100%; }
  .card-head > .btn, .card-head > form, .card-head > form button { width: 100%; }
}

/* 한 번만 보여 주는 주소·키 상자 */
.key-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.key-box code { background: #fff; border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; word-break: break-all; flex: 1; min-width: 200px; user-select: all; }

/* ---------- 2단계 인증 ---------- */
/* 번호는 한 칸에 넣는다(여러 칸으로 쪼개면 자동 채움·붙여넣기가 깨진다). 16px 이상이라 휴대폰에서 화면이 확대되지 않는다 */
input.otp-input, dialog.dlg input.otp-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: .32em; text-align: center; min-height: 52px; max-width: 240px; font-variant-numeric: tabular-nums; }
input.otp-input.otp-wide, dialog.dlg input.otp-input.otp-wide { letter-spacing: .12em; font-size: 18px; max-width: 320px; }
.auth-card .otp-input { max-width: none; }
.otp-form { margin-top: 10px; max-width: 420px; }
ol.steps { margin: 6px 0 14px; padding-left: 22px; display: grid; gap: 18px; }
ol.steps > li { padding-left: 4px; line-height: 1.6; }
ol.steps > li::marker { font-weight: 800; color: var(--primary, #2563eb); }
.qr-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.qr-box { background: #fff; border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; line-height: 0; flex: none; }
.qr-box svg { display: block; width: 208px; height: 208px; max-width: 62vw; max-height: 62vw; }
.qr-side { flex: 1; min-width: 240px; }
.qr-side p { margin: 0 0 8px; }
.key-box code#totp-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; word-break: normal; overflow-wrap: normal; }
ol.code-grid { list-style: decimal inside; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
ol.code-grid li { background: #fff; border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 12px; color: var(--muted, #667085); font-size: 13px; }
ol.code-grid code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: .05em; user-select: all; }
.search-row { display: flex; gap: 8px; margin: 0 0 12px; }
.search-row input[type=search] { flex: 1; min-width: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-violet { background: #ede9fe; color: #5b21b6; }
@media (max-width: 640px) {
  .qr-row { flex-direction: column; align-items: stretch; }
  .qr-box { align-self: center; }
  .search-row { flex-direction: column; }
}


input.otp-input { margin-bottom: 12px; }
td.nowrap { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.search-row input[type=search] { min-height: 44px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 16px; background: #fff; }
details.rescue { margin-top: 14px; font-size: 13.5px; color: var(--muted, #667085); }
details.rescue summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details.rescue p { margin: 4px 0 10px; }
