/* Entity Architecture module */
.ea-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ea-head h1 { margin: 0 0 4px; font-size: 22px; }
.ea-head .sub { color: var(--muted); font-size: 13px; }
.ea-crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ea-crumb a { color: var(--muted); text-decoration: none; }
.ea-crumb a:hover { color: var(--accent); }
.ea-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.ea-tab { padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; }
.ea-tab:hover { color: var(--text); }
.ea-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ea-grid { display: grid; gap: 14px; }
.ea-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ea-grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.ea-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.ea-stat .v { font-size: 26px; font-weight: 700; line-height: 1.2; }
.ea-stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.ea-stat .h { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ea-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ea-row > * { margin: 0; }
.ea-spacer { flex: 1; }
.ea-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ea-toolbar input, .ea-toolbar select { width: auto; min-width: 140px; padding: 7px 10px; font-size: 13px; }
.ea-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.ea-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ea-table th, .ea-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ea-table tr:last-child td { border-bottom: none; }
.ea-table tr.clickable { cursor: pointer; }
.ea-table tr.clickable:hover td { background: #fafbfc; }
.ea-table td.url { max-width: 260px; word-break: break-all; font-size: 12px; color: var(--muted); }
.ea-table td select, .ea-table td input { padding: 4px 6px; font-size: 12px; width: auto; }
.ea-pred { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: var(--panel-2); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.ea-ls { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ea-ls-good { background: rgba(16,169,110,.14); color: var(--green); }
.ea-ls-warn { background: rgba(245,166,35,.16); color: #b87400; }
.ea-ls-bad { background: rgba(224,36,36,.12); color: var(--red); }
.ea-ls-neutral { background: var(--panel-2); color: var(--muted); }
.ea-prio { font-weight: 700; font-size: 12px; }
.ea-prio-P1 { color: var(--red); } .ea-prio-P2 { color: #b87400; } .ea-prio-P3 { color: var(--muted); }
.ea-issue { border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.ea-issue.error { border-left-color: var(--red); }
.ea-issue.warning { border-left-color: var(--amber); }
.ea-issue.info { border-left-color: #8fa3c0; }
.ea-issue .code { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }
.ea-issue .msg { margin: 4px 0 8px; font-size: 13px; color: var(--text); }
.ea-issue .opts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ea-issue .opts label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); margin: 0; background: var(--panel-2); padding: 4px 10px; border-radius: 14px; cursor: pointer; }
.ea-issue .opts label.sel { background: rgba(232,97,44,.14); color: var(--accent); }
.ea-issue .opts input { width: auto; margin: 0; }
.ea-issue .opts select { width: auto; padding: 4px 8px; font-size: 12px; }
.ea-issue .auto { font-size: 11px; color: var(--green); font-weight: 600; margin-left: 6px; }
.ea-mapping { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr); gap: 6px 12px; font-size: 13px; align-items: center; }
.ea-mapping select { padding: 5px 8px; font-size: 12px; }
.ea-sheet { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.ea-sheet h4 { margin: 0 0 8px; display: flex; gap: 10px; align-items: center; }
.ea-sheet h4 select { width: auto; padding: 4px 8px; font-size: 12px; }
.ea-preview { font-size: 11px; color: var(--muted); margin-top: 8px; overflow-x: auto; }
.ea-preview table td, .ea-preview table th { padding: 3px 6px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ea-graph-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.ea-graph { height: 640px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfd; }
.ea-graph-canvas { position: relative; background: radial-gradient(circle at 30% 20%, #ffffff 0%, #f7f9fc 55%, #f1f4f9 100%); background-size: cover; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(26,34,51,.04); }
.ea-graph-hint { position: absolute; top: 10px; left: 12px; z-index: 5; font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.85); backdrop-filter: blur(3px); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; pointer-events: none; box-shadow: 0 2px 8px rgba(26,34,51,.06); transition: opacity .3s; }
.ea-graph-side { border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 13px; max-height: 640px; overflow: auto; display: flex; flex-direction: column; }
.ea-graph-side-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; margin: auto 0; padding: 30px 10px; }
.ea-graph-side-icon { font-size: 34px; opacity: .55; line-height: 1; }
.ea-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.ea-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ea-legend i { width: 18px; height: 3px; display: inline-block; border-radius: 2px; }
.ea-modal-bg { position: fixed; inset: 0; background: rgba(15,21,32,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 1000; padding: 60px 16px; overflow: auto; }
.ea-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 680px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.ea-modal h3 { margin: 0 0 14px; }
.ea-modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ea-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ea-chip { display: inline-block; background: var(--panel-2); border-radius: 12px; padding: 2px 9px; font-size: 12px; margin: 2px 4px 2px 0; }
.ea-bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.ea-bar > div { height: 100%; background: var(--accent); }
.ea-kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.ea-kv > div:nth-child(odd) { color: var(--muted); }
.ea-note { font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.ea-note.warn { background: rgba(245,166,35,.12); color: #8a5a00; }
.ea-note.ok { background: rgba(16,169,110,.1); color: #0b7a50; }
.ea-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ea-toggle button { background: #fff; border: none; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ea-toggle button.on { background: var(--accent); color: #fff; }
.ea-toggle button:disabled { cursor: not-allowed; opacity: .6; }

/* Teaching mode: header toggle switch */
.ea-teach-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); margin: 0; text-transform: none; letter-spacing: 0; user-select: none; }
.ea-teach-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ea-teach-toggle .slider { position: relative; display: inline-block; width: 36px; height: 20px; background: var(--border); border-radius: 999px; transition: background .15s ease; flex-shrink: 0; }
.ea-teach-toggle .slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ea-teach-toggle input:checked + .slider { background: var(--accent); }
.ea-teach-toggle input:checked + .slider::before { transform: translateX(16px); }
.ea-teach-toggle .txt { white-space: nowrap; }

/* Teaching mode: contextual explanation box */
.ea-teach { border: 1px solid rgba(99,102,241,.35); background: rgba(99,102,241,.06); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.ea-teach-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--text); }
.ea-teach-head strong { font-weight: 700; }
.ea-teach-icon { font-size: 15px; }
.ea-teach-caret { color: var(--muted); font-size: 12px; }
.ea-teach-body { padding: 0 14px 12px 38px; font-size: 13px; line-height: 1.55; color: var(--text); }
.ea-code { font-family: ui-monospace, monospace; font-size: 12px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
@media (max-width: 1000px) { .ea-graph-wrap { grid-template-columns: 1fr; } .ea-2col { grid-template-columns: 1fr; } }
/* Topic map (M2A) */
.ea-topic-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.ea-topic-tree { padding: 6px 0; max-height: 72vh; overflow: auto; }
.ea-topic-side { position: sticky; top: 10px; max-height: 80vh; overflow: auto; }
.ea-topic-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border, #eef1f5); cursor: pointer; font-size: 13px; }
.ea-topic-row:hover { background: var(--panel-2); }
.ea-topic-row.sel { background: rgba(59,130,246,.10); }
.ea-topic-row.dim .lbl { opacity: .7; font-style: italic; }
.ea-topic-row .lbl { font-weight: 600; }
.ea-topic-row .url { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ea-layer { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); }
.ea-layer-root { background: #1f2a44; color: #fff; }
.ea-layer-class { background: rgba(59,130,246,.15); color: #1d4ed8; }
.ea-layer-object { background: rgba(16,169,110,.14); color: #0b7a50; }
.ea-layer-mechanic { background: rgba(168,85,247,.14); color: #7e22ce; }
.ea-fact { border: 1px solid var(--border, #e6e9ef); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.ea-fact.sug { border-style: dashed; background: rgba(245,166,35,.05); }
.ea-imp { color: #f5a623; font-size: 11px; letter-spacing: -1px; }
@media (max-width: 1000px) { .ea-topic-wrap { grid-template-columns: 1fr; } .ea-topic-side { position: static; } }
/* 2B checks */
.ea-checkbar { background: var(--panel-2); border-radius: 8px; padding: 6px 10px; gap: 10px; }
.ea-stat { font-size: 11px; background: var(--panel-2); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.ea-issue { border-left: 3px solid var(--border, #ddd); padding: 4px 8px; margin-bottom: 6px; }
.ea-fc { margin-top: 6px; }
.ea-quote { margin: 4px 0 0; padding: 4px 8px; border-left: 3px solid var(--green); font-size: 12px; font-style: italic; background: rgba(16,169,110,.06); }

/* ── To-do list (VA view) ── */
.ea-progress { height: 8px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.ea-progress-bar { height: 100%; background: #10a96e; border-radius: 6px; transition: width .4s; }
.ea-tasks { display: flex; flex-direction: column; gap: 8px; }
.ea-task { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.ea-task.open { box-shadow: 0 2px 10px rgba(26,34,51,.08); border-color: #c9d1de; }
.ea-task-closed { opacity: .8; }
.ea-task-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.ea-task-select { width: 17px; height: 17px; flex: 0 0 auto; cursor: pointer; margin: 0; }
.ea-task-head:hover { background: var(--panel-2); border-radius: 10px; }
.ea-task-title { flex: 1; font-weight: 600; font-size: 14px; }
.ea-task-title .small { font-weight: 400; margin-top: 2px; word-break: break-all; }
.ea-task-caret { color: var(--muted); transition: transform .2s; }
.ea-task.open .ea-task-caret { transform: rotate(90deg); }
.ea-task-body { padding: 0 16px 14px 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.ea-task-why { margin-top: 12px; background: rgba(43,125,233,.07); border-radius: 8px; padding: 9px 12px; }
.ea-task-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.ea-steps { margin: 0; padding-left: 22px; } .ea-steps li { margin: 5px 0; line-height: 1.45; }
.ea-linkbox { display: flex; flex-direction: column; gap: 8px; }
.ea-linkrow { border: 1px dashed #c9d1de; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; word-break: break-all; }
.ea-copy { padding: 1px 8px !important; font-size: 11px !important; margin-left: 4px; }
.ea-facts { margin: 0; padding-left: 20px; } .ea-facts li { margin: 5px 0; }
.ea-draft { width: 100%; font-family: inherit; font-size: 13px; line-height: 1.5; background: #fffdf5; }
.ea-task-actions { margin-top: 14px; flex-wrap: wrap; }
.ea-task-page { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 2px; word-break: break-all; }
.ea-pri { font-size: 11px; font-weight: 700; border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.ea-pri1 { background: rgba(224,36,36,.1); color: #c01d1d; } .ea-pri2 { background: rgba(245,166,35,.15); color: #8a5a00; } .ea-pri3 { background: var(--panel-2); color: var(--muted); }
.ea-next { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; font-size: 13.5px; cursor: pointer; }
.ea-next a { color: var(--accent); }
.ea-next:hover { background: var(--panel-2); }
.ea-next .small { word-break: break-all; }
.ea-graph-mini { height: 260px; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; background: radial-gradient(circle at 30% 20%, #ffffff 0%, #f5f7fb 100%); }

/* AI page matching */
.ea-match { padding: 10px 12px; }
.ea-match-row { display: flex; gap: 10px; align-items: flex-start; }
.ea-match-cb input { width: 18px; height: 18px; margin-top: 2px; cursor: pointer; }
.ea-match select { max-width: 520px; }
.ea-match-bar { position: sticky; top: 0; z-index: 5; margin-bottom: 10px; padding: 10px 12px; }
.ea-pm-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ea-match-create { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; cursor: pointer; color: var(--muted); }
.ea-match-create input { width: 15px; height: 15px; }
