/* M-Pick 내신왕 디자인 시스템 컴포넌트 스타일 (Artifact project/components/bundle.css 원본 그대로) */
/* M-Pick 내신왕 — component styles, from the live site's ui.css with literal colours bound to tokens */
.mp { font-family: var(--font-sans); font-size: 14px; color: var(--ui-ink); line-height: 1.5; }
.mp :is(button, input, select, textarea) { font-family: inherit; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--ui-control); padding: 8px 16px; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.4; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-none); background: var(--ui-surface); color: var(--ui-ink); box-sizing: border-box; cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--ui-surface-hover); border-color: var(--ui-line-hover); }
.btn.primary { background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-surface); }
.btn.primary:hover:not(:disabled) { background: var(--ui-accent-hover); border-color: var(--ui-accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { border-color: transparent; background: var(--ui-surface-ghost-hover); }
.btn.danger { color: var(--ui-danger); background: var(--ui-surface); border-color: var(--ui-danger-line); }
.btn.danger:hover:not(:disabled) { background: var(--ui-danger-wash); border-color: var(--ui-danger-line-hover); }
.btn.tiny { min-height: var(--ui-control-compact); font-size: 13px; padding: 6px 12px; }
.btn.icon { width: var(--ui-control-compact); min-height: var(--ui-control-compact); padding: 8px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.mp :is(button, a, summary):focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
button[aria-busy="true"] { position: relative; pointer-events: none; color: transparent !important; opacity: 1 !important; }
button[aria-busy="true"]::before { content: ""; position: absolute; left: calc(50% - 8px); top: calc(50% - 8px); width: 16px; height: 16px; border: 2px solid var(--ui-accent-soft); border-top-color: var(--ui-accent); border-radius: var(--ui-radius-full); box-sizing: border-box; animation: mp-spin .65s linear infinite; }
button.primary[aria-busy="true"]::before { border-color: rgba(255,255,255,.4); border-top-color: var(--ui-surface); }
@keyframes mp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::before { animation: none; } }

/* Input / select */
.field { display: grid; gap: 8px; font-size: 13px; font-weight: 550; }
.input, .mp select { min-height: var(--ui-control); padding: 8px 12px; font-size: 14px; font-weight: 400; line-height: 1.5; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-none); background: var(--ui-surface); color: var(--ui-ink); box-sizing: border-box; }
:is(.input, .mp select):focus { border-color: var(--ui-accent); outline: 2px solid var(--ui-accent-ring); outline-offset: 1px; }
.input[readonly], :is(.input, .mp select):disabled { background: var(--ui-surface-muted); color: var(--ui-sub); }
.mp [aria-invalid="true"] { border-color: var(--ui-danger) !important; }

/* Scope chip (단원 선택) */
.scope-unit-options { display: flex; flex-wrap: wrap; gap: 8px; }
.scope-unit { display: block; position: relative; cursor: pointer; }
.scope-unit input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scope-unit span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 64px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--ui-line); font-size: 14px; font-weight: 500; color: var(--ui-sub); background: var(--ui-surface); box-sizing: border-box; }
.scope-unit span::before { content: ""; width: 10px; height: 10px; border: 1px solid var(--ui-line-strong); box-sizing: border-box; }
.scope-unit[data-selection="all"] span { background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-surface); font-weight: 600; }
.scope-unit[data-selection="all"] span::before { width: 9px; height: 5px; border: 0; border-left: 2px solid var(--ui-surface); border-bottom: 2px solid var(--ui-surface); transform: rotate(-45deg); margin-top: -3px; }
.scope-unit[data-selection="partial"] span { color: var(--ui-accent); border-color: var(--ui-accent); font-weight: 600; }
.scope-unit[data-selection="partial"] span::before { width: 10px; height: 2px; border: 0; background: var(--ui-accent); }
.scope-unit input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

/* Tabs */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--ui-line); }
.tab { font-family: var(--font-sans); font-size: 14px; font-weight: 500; white-space: nowrap; min-height: 48px; padding: 12px 0; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ui-sub); cursor: pointer; }
.tab.active { color: var(--ui-accent); font-weight: 650; border-bottom-color: var(--ui-accent); }

/* Data table */
.record-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.record-table th { background: var(--ui-surface-head); color: var(--ui-sub); font-size: 13px; font-weight: 500; }
.record-table th, .record-table td { padding: 12px 16px; border-bottom: 1px solid var(--ui-line); }
.record-table strong { font-weight: 600; }
.record-table small { display: block; font-size: 13px; color: var(--ui-sub); margin-top: 4px; }
.record-row { cursor: pointer; }
.record-row:hover, .record-row:focus-within { background: var(--ui-accent-wash); }
.record-row.is-current { background: var(--ui-accent-current); box-shadow: inset 3px 0 var(--ui-accent); }
.record-code { font: 500 13px var(--font-mono); color: var(--ui-sub); }
.record-row:hover .record-code { color: var(--ui-accent); }

/* Dialog */
.mp-dialog { font-size: 14px; background: var(--ui-surface); box-shadow: var(--ui-shadow-dialog); border: 1px solid var(--ui-line-dialog); border-radius: var(--ui-radius-none); }
.mp-dialog > .panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 12px 24px; gap: 16px; border-bottom: 1px solid var(--ui-line); }
.mp-dialog > .panel-head h2 { font-size: 18px; font-weight: 650; line-height: 1.4; margin: 0; }
.dialog-body { padding: 24px; }
