/* Alignment Explorer: MEGA 12.1's window (AlignmentEditor/maligneditmainform.lfm) with its
   menu bar, three toolbars, the DNA and translated protein tabs, the alignment grid and
   the status bar. The grid is drawn on a canvas from MEGA's own TAlignGrid.DrawCell. */
.ae { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--white); font-size: 13px; }
.ae-title { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 12px; background: var(--gray-10); border-bottom: 1px solid var(--gray-20); font-weight: 500; }
.ae-title span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-close { width: 30px; height: 26px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.ae-close:hover { background: var(--gray-20); }
.ae-close svg { width: 14px; height: 14px; }

.ae-menubar { display: flex; flex: none; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--gray-20); }
.ae-menubar > button { height: 30px; padding: 0 10px; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.ae-menubar > button:hover, .ae-menubar > button[aria-expanded="true"] { background: var(--gray-20); }

/* Menus share the page's .menu-list look; these add checks, shortcuts and submenus. */
.ae-menu { z-index: 40; min-width: 240px; padding: 2px 0; }
.ae-menu [role^="menuitem"] { display: grid; grid-template-columns: 18px 1fr auto 12px; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; text-align: left; white-space: nowrap; }
.ae-menu [role^="menuitem"] .k { color: var(--gray-60); font-size: 12px; }
.ae-menu [role^="menuitem"] .c { font-size: 12px; text-align: center; }
.ae-menu [role^="menuitem"] .a::after { content: "\203A"; }
.ae-menu [role^="menuitem"][aria-expanded="true"] { background: var(--gray-10); }

.ae-tools { display: flex; flex-wrap: wrap; flex: none; gap: 2px 10px; padding: 3px 6px; border-bottom: 1px solid var(--gray-20); background: linear-gradient(var(--white), var(--gray-10)); }
.ae-toolbar { display: flex; align-items: center; gap: 1px; }
.ae-toolbar[hidden] { display: none; }
.ae-toolbar > button, .ae-tool { display: grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 1px solid transparent; background: none; cursor: pointer; color: var(--gray-90); }
.ae-toolbar > button:hover:not(:disabled), .ae-toolbar > button[aria-expanded="true"] { border-color: var(--gray-30); background: var(--white); }
.ae-toolbar > button:disabled { opacity: 0.35; }
.ae-toolbar svg { width: 20px; height: 20px; }
.ae-toolbar .divider { width: 1px; height: 20px; margin: 0 4px; background: var(--gray-30); }
/* ClustalW "W" and MUSCLE "M" align buttons: lettered tiles as in MEGA's toolbar. */
.ae-toolbar .align-tool { width: 34px; }
.ae-letter { display: grid; place-items: center; width: 22px; height: 22px; font: 700 15px/1 var(--sans); color: var(--white); }
.ae-letter.w { background: #2f6db5; }
.ae-letter.m { background: var(--mega-green); }
.ae-letter + .drop { width: 0; height: 0; margin-top: 12px; border: 3px solid transparent; border-top-color: currentColor; }
.align-tool { grid-auto-flow: column; gap: 1px; }

.ae-tabs { display: flex; flex: none; gap: 2px; padding: 4px 6px 0; border-bottom: 1px solid var(--gray-30); }
.ae-tabs button { height: 28px; padding: 0 14px; border: 1px solid var(--gray-30); border-bottom: 0; background: var(--gray-10); cursor: pointer; white-space: nowrap; }
.ae-tabs button[aria-selected="true"] { background: var(--white); font-weight: 500; position: relative; top: 1px; }
.ae-tabs button[hidden] { display: none; }

.ae-body { position: relative; flex: 1; min-height: 0; }
.ae-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.ae-scroll { position: absolute; inset: 0; overflow: auto; outline: none; touch-action: pan-x pan-y; }
.ae-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ae-spacer { width: 1px; height: 1px; }
.ae-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gray-60); pointer-events: none; padding: 16px; text-align: center; }
.ae-name-edit { position: absolute; z-index: 2; height: 22px; padding: 0 4px; border: 1px solid var(--focus); background: var(--white); font: 12px var(--sans); }

.ae-status { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 30px; padding: 2px 10px; border-top: 1px solid var(--gray-20); background: var(--gray-10); font-size: 12px; }
.ae-status label { display: inline-flex; align-items: center; gap: 4px; }
.ae-status input[type="number"] { width: 84px; height: 24px; }
.ae-status .grow { flex: 1; min-width: 0; color: var(--gray-70); }
.ae-busy { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgb(255 255 255 / 0.7); }
.ae-busy > div { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--gray-30); background: var(--white); box-shadow: 0 2px 6px rgb(0 0 0 / 0.2); }

/* MEGA's dialogs: the welcome form, message boxes, input boxes and option forms. */
.ae-dialog { width: min(460px, calc(100vw - 32px)); }
.ae-dialog.wide { width: min(640px, calc(100vw - 32px)); }
.ae-dialog .body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ae-dialog .body p { margin: 0; white-space: pre-wrap; }
.ae-dialog .body label { display: flex; align-items: center; gap: 8px; }
.ae-dialog .body input[type="text"] { width: 100%; }
.ae-dialog .choices { display: flex; flex-direction: column; gap: 10px; padding-left: 4px; }
.ae-dialog .heading { font-weight: 600; }
.ae-dialog .actions { flex-wrap: wrap; }
.ae-dialog .list { max-height: 50vh; overflow: auto; border: 1px solid var(--gray-30); }
.ae-dialog .list label { padding: 6px 10px; cursor: pointer; }
.ae-dialog .list label:hover { background: var(--gray-10); }
.ae-dialog table.prefs { width: 100%; }
.ae-dialog .tab-row { display: flex; gap: 2px; border-bottom: 1px solid var(--gray-30); }
.ae-dialog .tab-row button { height: 28px; padding: 0 14px; border: 1px solid var(--gray-30); border-bottom: 0; background: var(--gray-10); cursor: pointer; }
.ae-dialog .tab-row button[aria-selected="true"] { background: var(--white); font-weight: 500; }

@media (max-width: 640px) {
  .ae-tools { gap: 2px 4px; }
  .ae-status { font-size: 11px; }
}

/* The main window's sequence view opens its data here. */
.alignment-head > button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--gray-30); background: var(--white); cursor: pointer; }
