.migration-header { gap: 14px; }
.ep-source-notice { flex: 0 0 auto; align-self: center; margin-top: 7px; color: #6e809b; font-size: 12px; text-decoration: none; }
.ep-source-notice:hover { color: #365e95; text-decoration: underline; }
#sidebar-toggle { display: grid; place-items: center; flex: 0 0 36px; min-width: 36px; min-height: 36px; padding: 6px; border-radius: 8px; color: #58708f; }
#sidebar-toggle svg { width: 20px; height: 20px; }
#sidebar-toggle:hover { background: #e9eff8; }
#sidebar-toggle:disabled { opacity: .35; cursor: default; }
.ep-global-lookup { position: absolute; left: 50%; transform: translateX(-50%); width: clamp(260px, 33vw, 470px); }
.ep-global-lookup form { display: flex; align-items: center; gap: 8px; padding: 4px 7px 4px 12px; border: 1px solid #c3d0e0; border-radius: 12px; background: #f9fbfe; }
.ep-global-lookup form:focus-within { border-color: #6889b7; box-shadow: 0 0 0 3px #6689b312; }
.ep-global-lookup form > svg { flex: 0 0 16px; width: 16px; height: 16px; color: #8092ad; }
.ep-global-lookup input { min-width: 0; width: 100%; height: 26px; padding: 0; border: 0; outline: none; background: transparent; color: #334d70; font: inherit; font-size: 12px; }
.ep-global-lookup input::placeholder { color: #7f8ea3; opacity: 1; }
.ep-global-lookup input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ep-global-lookup form button { flex: 0 0 auto; white-space: nowrap; padding: 4px 7px; border: 0; border-radius: 6px; background: #eaf0f8; color: #526c8f; font: inherit; font-size: 12px; cursor: pointer; }
.ep-global-lookup.is-exam-disabled { opacity: .65; }
#global-lookup-clear { width: 25px; height: 25px; padding: 0; border-radius: 50%; background: transparent; color: #7a8ca5; font-size: 18px; }
#global-lookup-clear:hover { background: #e6edf6; color: #344d70; }
#global-lookup-clear[hidden] { display: none; }
.ep-global-lookup button:focus-visible { outline: 2px solid #6584af; outline-offset: 2px; }
.ep-lookup-panel { position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: min(610px, calc(100dvh - 82px)); overflow-y: auto; padding: 11px 14px; border: 1px solid #c4d0e0; border-radius: 16px; background: #fbf9f5; box-shadow: 0 15px 45px #253e6129; }
.ep-lookup-panel[hidden] { display: none; }
.ep-lookup-panel > header { display: flex; align-items: center; justify-content: space-between; color: #344d70; font-size: 13px; }
.ep-lookup-panel > header button { border: 0; background: transparent; color: #7b8ca3; font-size: 19px; cursor: pointer; }
.ep-lookup-empty p { color: #718098; font-size: 12px; line-height: 1.6; }
.ep-lookup-empty { padding: 17px 6px; color: #415776; }
.ep-lookup-list { margin-top: 7px; }
.ep-lookup-candidates { display: grid; grid-template-columns: minmax(95px, 1fr) 44px minmax(0, 2fr) 44px; margin-top: 7px; }
.ep-lookup-candidates > .ep-lookup-list { display: contents; }
.ep-lookup-candidates .ep-lookup-entry { grid-column: 1 / 4; display: grid; grid-template-columns: subgrid; min-width: 0; }
.ep-lookup-candidates .ep-lookup-entry__choice { grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; gap: 0; min-height: 44px; height: 100%; }
.ep-lookup-candidates .ep-lookup-entry__choice strong { grid-column: 1; }
.ep-lookup-candidates .ep-lookup-entry__choice span { grid-column: 3; padding-left: 8px; }
.ep-lookup-row-pronounce, .ep-lookup-row-save { display: flex; align-items: center; justify-content: center; border-top: 1px solid #edf1f6; }
/* Separate controls share the row grid, without nesting buttons in a listbox option. */
.ep-lookup-row-pronounce { grid-column: 2; position: relative; }
.ep-lookup-row-save { grid-column: 4; }
.ep-lookup-row-save .ep-word-save--icon { flex-wrap: nowrap; gap: 0; }
.ep-lookup-pronounce { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: #58749a; cursor: pointer; }
.ep-lookup-pronounce:hover { background: #edf3fb; color: #304e79; }
.ep-lookup-pronounce svg { width: 18px; height: 18px; }
.ep-lookup-suggestion-title { margin: 14px 8px 4px; color: #526c8f; font-size: 12px; font-weight: 600; }
.ep-lookup-list--suggestions { margin-top: 0; }
.ep-lookup-list--suggestions .ep-lookup-entry__choice { grid-template-columns: minmax(0, 1fr) auto; }
.ep-lookup-list--suggestions .ep-lookup-entry__choice span { color: #8797ad; font-size: 12px; }
.ep-lookup-entry { border-top: 1px solid #edf1f6; color: #3e526d; }
.ep-lookup-entry__choice { display: grid; grid-template-columns: minmax(95px, 34%) minmax(0, 1fr); align-items: baseline; gap: 12px; width: 100%; min-height: 43px; padding: 10px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.ep-lookup-entry__choice:focus-visible, .ep-lookup-entry.is-active .ep-lookup-entry__choice { outline: none; background: #edf3fb; }
.ep-lookup-entry__choice strong { color: #233b5d; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.ep-lookup-entry__choice span { color: #718098; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-lookup-entry__detail { margin: 12px 0 2px; padding: 13px 15px; border: 1px solid #e0e8f3; border-radius: 12px; background: #f5f8fc; }
.ep-lookup-entry__detail > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ep-lookup-entry__detail strong { color: #233b5d; font-size: 17px; overflow-wrap: anywhere; }
.ep-lookup-entry__detail small { color: #7387a3; font-size: 12px; }
.ep-lookup-entry__detail p { margin: 5px 0 9px; color: #405874; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.ep-lookup-entry__detail button { border: 1px solid #d2dce9; border-radius: 6px; padding: 4px 8px; background: #fbf9f5; color: #557196; font: inherit; font-size: 12px; cursor: pointer; }
.ep-lookup-retry { margin: 12px 0 4px; padding: 7px 12px; border: 1px solid #d2dce9; border-radius: 6px; background: #f5f8fc; color: #415d84; font: inherit; font-size: 12px; cursor: pointer; }
#global-lookup-status { margin: 9px 0 0; color: #6c7f99; font-size: 12px; }
#global-lookup-status:empty { display: none; }
@media (min-width: 1001px) {
  body.ep-sidebar-collapsed #sidebar { display: none; }
  body.ep-sidebar-collapsed .migration-main { margin-left: 0; }
}
@media (max-width: 1000px) {
  .migration-header { padding: 0 12px; gap: 8px; }
  .ep-global-lookup { position: relative; left: auto; transform: none; width: auto; flex: 1 1 300px; max-width: 470px; margin-right: auto; }
  .migration-header .ep-global-site-entry { flex: 0 0 auto; font-size: 12px; }
}
@media (max-width: 600px) {
  .migration-header .ep-global-site-entry strong span { display: none; }
  .migration-header .ep-global-site-entry { border-radius: 8px; }
  .ep-global-lookup { min-width: 0; }
  .ep-lookup-panel { position: fixed; left: 12px; right: 12px; width: auto; top: 62px; transform: none; }
  .ep-global-lookup input { font-size: 12px; }
  .ep-global-lookup form { gap: 5px; padding-left: 8px; }
}
@media print { #global-lookup, #sidebar-toggle { display: none !important; } }
