@font-face {
  font-family: "ngE Noto Sans";
  font-style: normal;
  font-weight: 300;
  src: url("/static/default_ui/fonts/NotoSans-Light.ttf") format("truetype");
  unicode-range: U+0000-00FF, U+0100-017F, U+2010-2040, U+20A0-20CF, U+2190-22FF, U+2713, U+232B;
}

@font-face {
  font-family: "ngE Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  src: url("/static/default_ui/fonts/NotoSans-Regular.ttf") format("truetype");
  unicode-range: U+0000-00FF, U+0100-017F, U+2010-2040, U+20A0-20CF, U+2190-22FF, U+2713, U+232B;
}

@font-face {
  font-family: "ngE Noto Sans Arabic";
  font-style: normal;
  font-weight: 300;
  src: url("/static/default_ui/fonts/NotoSansArabic-Light.ttf") format("truetype");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "ngE Noto Sans Arabic";
  font-style: normal;
  font-weight: 400 700;
  src: url("/static/default_ui/fonts/NotoSansArabic-Regular.ttf") format("truetype");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "ngE Noto Sans CJK JP";
  font-style: normal;
  font-weight: 300 700;
  src: url("/static/default_ui/fonts/NotoSansCJKJP-Regular.ttf") format("truetype");
  unicode-range: U+3000-30FF, U+31F0-31FF, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}

:root {
  --nge-bg: #eef2f4;
  --nge-surface: #f9fafb;
  --nge-section: ivory;
  --nge-line: #d5dde2;
  --nge-line-strong: #9daab3;
  --nge-text: #17212b;
  --nge-muted: #61717f;
  --nge-topbar: #a9e3dd;
  --nge-topbar-text: #15333a;
  --nge-accent: #198477;
  --nge-warning: #ad6b00;
  --nge-error: #b42318;
  --nge-radius: 6px;
  --nge-action-width: 72px;
  --nge-side-menu-width: 270px;
  color-scheme: light;
  font-family: "ngE Noto Sans", "ngE Noto Sans CJK JP", "ngE Noto Sans Arabic", Arial, Helvetica, sans-serif;
  font-weight: 400;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--nge-bg);
  color: var(--nge-text);
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.nge-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr) auto;
  height: 100vh;
  width: 100vw;
}

.nge-shell.is-menu-locked {
  grid-template-columns: var(--nge-side-menu-width) minmax(0, 1fr);
}

.nge-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.nge-login {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--nge-line);
  border-radius: var(--nge-radius);
  background: var(--nge-surface);
}

.nge-login-brand {
  display: flex;
  align-items: center;
  min-height: 46px;
}

.nge-login-brand img {
  width: 132px;
  height: auto;
  display: block;
}

.nge-login label {
  display: grid;
  gap: 5px;
  color: var(--nge-muted);
  font-size: 13px;
}

.nge-login input,
.nge-login select {
  width: 100%;
  height: 34px;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  border-radius: 0;
  padding: 0 2px;
  color: var(--nge-text);
  background: transparent;
}

.nge-login input:focus,
.nge-login select:focus,
.nge-search:focus,
.nge-view-select:focus,
.nge-field input:focus,
.nge-field select:focus,
.nge-field textarea:focus {
  border-bottom-color: var(--nge-accent);
  outline: none;
}

.nge-login button {
  height: 36px;
  border: 1px solid var(--nge-accent);
  border-radius: var(--nge-radius);
  background: var(--nge-accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.nge-login button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.nge-login-message {
  min-height: 18px;
  margin: 0;
  color: var(--nge-error);
  font-size: 13px;
}

.nge-topbar {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  align-items: center;
  background: var(--nge-topbar);
  color: var(--nge-topbar-text);
  min-width: 0;
  grid-column: 1 / -1;
}

.nge-menu-button,
.nge-user-button,
.nge-icon-button,
.nge-action-button {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nge-menu-button {
  width: 184px;
  height: 40px;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border-color: rgba(21, 51, 58, 0.2);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.34);
  line-height: 1;
}

.nge-menu-button:hover {
  border-color: rgba(21, 51, 58, 0.42);
  background: rgba(255, 255, 255, 0.56);
}

.nge-menu-hamburger {
  display: inline-block;
  width: 28px;
  text-align: center;
  color: var(--nge-topbar-text);
  font-size: 24px;
  line-height: 1;
}

.nge-menu-logo {
  width: 118px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.nge-company {
  display: flex;
  align-items: center;
  justify-self: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.nge-company-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  background: var(--nge-surface);
  border-radius: 50%;
  padding: 2px;
}

.nge-company-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.nge-company-status {
  border: 1px solid rgba(21, 51, 58, 0.36);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 700;
}

.nge-user-menu {
  display: flex;
  justify-content: flex-end;
  padding-right: 12px;
  position: relative;
}

.nge-user-button {
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-user-button::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
}

.nge-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  z-index: 40;
  min-width: 190px;
  display: grid;
  padding: 4px;
  border: 1px solid var(--nge-line);
  border-radius: var(--nge-radius);
  background: var(--nge-surface);
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.2);
  color: var(--nge-text);
}

.nge-user-dropdown[hidden] {
  display: none;
}

.nge-user-menu-item {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--nge-text);
  cursor: pointer;
  text-align: left;
  padding: 6px 10px;
}

.nge-user-menu-item:hover {
  background: #eef7f3;
  color: var(--nge-accent);
}

.nge-user-menu-item:last-child {
  margin-top: 4px;
  border-top: 1px solid var(--nge-line);
  border-radius: 0 0 4px 4px;
  color: var(--nge-error);
}

.nge-side-menu-backdrop {
  position: fixed;
  inset: 48px 0 76px 0;
  z-index: 18;
  background: rgba(23, 33, 43, 0.18);
}

.nge-side-menu-backdrop[hidden] {
  display: none;
}

.nge-side-menu {
  position: fixed;
  top: 48px;
  bottom: 76px;
  left: 0;
  z-index: 20;
  width: 270px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  border-right: 1px solid var(--nge-line);
  background: var(--nge-surface);
  box-shadow: 8px 0 18px rgba(23, 33, 43, 0.14);
  transform: translateX(-100%);
  transition: transform 140ms ease;
}

.nge-shell.is-menu-locked .nge-side-menu {
  position: static;
  z-index: 1;
  grid-column: 1;
  grid-row: 2;
  width: auto;
  min-height: 0;
  overflow: auto;
  box-shadow: none;
  transform: none;
  transition: none;
}

.nge-shell.is-menu-locked .nge-side-menu-backdrop {
  display: none;
}

.nge-side-menu.is-open {
  transform: translateX(0);
}

.nge-side-menu-header {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--nge-line);
}

.nge-menu-lock-button {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--nge-line);
  border-radius: 4px;
  background: transparent;
  color: var(--nge-muted);
  cursor: pointer;
  line-height: 1;
}

.nge-menu-lock-button::before,
.nge-menu-lock-button::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nge-menu-lock-button::before {
  bottom: 7px;
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nge-menu-lock-button::after {
  top: 7px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.nge-menu-lock-button[aria-pressed="false"]::after {
  margin-left: 4px;
  transform: translateX(-50%) rotate(28deg);
  transform-origin: bottom left;
}

.nge-menu-lock-button:hover,
.nge-menu-lock-button[aria-pressed="true"] {
  border-color: var(--nge-accent);
  color: var(--nge-accent);
  background: #eef7f3;
}

.nge-side-menu-item {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--nge-text);
  cursor: pointer;
  text-align: left;
  padding: 7px 10px;
}

.nge-side-menu-item:hover {
  background: #eef7f3;
  color: var(--nge-accent);
}

.nge-side-menu-group {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.nge-side-menu-branch {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--nge-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  padding: 8px 10px;
}

.nge-side-menu-branch::before {
  content: ">";
  display: inline-block;
  width: 16px;
  color: var(--nge-muted);
}

.nge-side-menu-branch[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.nge-side-menu-branch:hover {
  background: #eef7f3;
  color: var(--nge-accent);
}

.nge-side-menu-children {
  display: grid;
  gap: 2px;
  padding-left: 14px;
}

.nge-side-menu-children[hidden] {
  display: none;
}

.nge-workspace {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
}

.nge-shell.is-menu-locked .nge-workspace {
  grid-column: 2;
}

.nge-operational-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--nge-action-width);
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.nge-import-view {
  height: 100%;
  min-height: 0;
  display: grid;
}

.nge-import-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.nge-import-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--nge-line);
  background: var(--nge-surface);
}

.nge-import-header h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.nge-import-header p {
  margin: 4px 0 0;
  color: var(--nge-muted);
  font-size: 13px;
}

.nge-import-header p[data-level="ok"] {
  color: var(--nge-accent);
}

.nge-import-header p[data-level="warning"] {
  color: var(--nge-warning);
}

.nge-import-header p[data-level="error"] {
  color: var(--nge-error);
}

.nge-import-actions,
.nge-import-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.nge-primary-button,
.nge-secondary-button {
  min-width: 7rem;
  min-height: 34px;
  border: 1px solid var(--nge-line);
  border-radius: var(--nge-radius);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.nge-primary-button {
  border-color: var(--nge-accent);
  background: var(--nge-accent);
  color: #ffffff;
}

.nge-secondary-button {
  background: #f7f9fa;
  color: var(--nge-text);
}

.nge-primary-button:disabled,
.nge-secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.nge-import-dropzone {
  min-height: 128px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 2px dashed #7f9cab;
  border-radius: var(--nge-radius);
  background: #f8fbfb;
}

.nge-import-dropzone.is-drag-over {
  border-color: var(--nge-accent);
  background: #eaf7f4;
}

.nge-import-drop-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #7f9cab;
  border-radius: var(--nge-radius);
  background: #ffffff;
  color: var(--nge-accent);
  font-size: 13px;
  font-weight: 700;
}

.nge-import-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--nge-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-import-result {
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--nge-line);
  background: #f3f8f6;
  color: var(--nge-text);
}

.nge-import-summary {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--nge-line);
  background: var(--nge-surface);
}

.nge-import-table td:nth-child(3) {
  text-align: right;
}

.nge-import-table .is-not-importable {
  color: var(--nge-muted);
  background: #f7f7f7;
}

.nge-import-table .is-importable td:nth-child(4) {
  color: var(--nge-accent);
  font-weight: 700;
}

.nge-table-pane,
.nge-record {
  min-width: 0;
  min-height: 0;
}

.nge-table-pane {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  gap: 8px;
}

.nge-table-toolbar {
  display: grid;
  grid-template-columns: minmax(14rem, 24rem) minmax(10rem, 1fr) minmax(12rem, 18rem);
  gap: 8px;
  align-items: center;
}

.nge-view-title {
  min-width: 0;
  overflow: hidden;
  color: var(--nge-text);
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-view-profile-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.nge-view-profile-button {
  width: 28px;
  height: 28px;
  border-color: var(--nge-line);
  border-radius: var(--nge-radius);
  color: var(--nge-text);
}

.nge-search,
.nge-view-select,
.nge-column-filter,
.nge-field input,
.nge-field select,
.nge-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  border-radius: 0;
  padding: 0 2px 0;
  background: transparent;
  color: var(--nge-text);
  font-size: 100%;
  font-weight: 400;
}

.nge-search,
.nge-view-select,
.nge-column-filter,
.nge-field input,
.nge-field select {
  height: 24px;
}

.nge-lookup {
  display: grid;
  grid-template-columns: minmax(5rem, 34%) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding-bottom: 0;
}

.nge-lookup output {
  display: block;
  overflow: hidden;
  height: 24px;
  padding: 0;
  border: 0;
  color: var(--nge-muted);
  font-size: 90%;
  font-weight: 300;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-readonly-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--nge-line);
  border-radius: 6px;
  background: ivory;
}

.nge-readonly-card-title {
  color: var(--nge-text);
  font-size: 90%;
  font-weight: 500;
}

.nge-readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 8px 16px;
}

.nge-readonly-grid div {
  min-width: 0;
}

.nge-readonly-grid span {
  display: block;
  color: var(--nge-muted);
  font-size: 80%;
  font-weight: 300;
}

.nge-readonly-grid output {
  display: block;
  overflow: hidden;
  min-height: 20px;
  color: var(--nge-text);
  font-size: 90%;
  font-weight: 300;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-lookup-popup {
  position: fixed;
  z-index: 100;
  max-height: min(60vh, 420px);
  overflow: auto;
  border: 1px solid #35ad49;
  border-radius: 0;
  background: #fffdec;
  box-shadow: 0 12px 28px rgba(23, 33, 43, 0.22);
}

.nge-lookup-popup[hidden] {
  display: none;
}

.nge-lookup-popup table {
  width: 100%;
  border-collapse: collapse;
}

.nge-lookup-popup th,
.nge-lookup-popup td {
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.nge-lookup-popup th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fffdec;
  color: #3f463c;
  font-weight: 700;
}

.nge-lookup-popup td {
  color: #5b6258;
  font-weight: 300;
}

.nge-lookup-popup tr {
  cursor: pointer;
}

.nge-lookup-popup tr:hover,
.nge-lookup-popup tr.is-active {
  background: #a8edb2;
}

.nge-lookup-popup tr:hover td,
.nge-lookup-popup tr.is-active td {
  color: #2f5f37;
}

.nge-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--nge-line);
  background: var(--nge-surface);
}

.nge-table {
  width: 100%;
  border-collapse: collapse;
}

.nge-table th,
.nge-table td {
  border-bottom: 1px solid var(--nge-line);
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.nge-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e9eef2;
  color: #263642;
}

.nge-table td.nge-table-composite-cell {
  min-width: 16rem;
  white-space: normal;
}

.nge-table thead tr[data-nge-column-filter-row] th {
  top: 33px;
  padding-top: 4px;
  padding-bottom: 6px;
  background: #f7f9fa;
}

.nge-column-filter {
  min-width: 4rem;
  height: 22px;
  border-bottom-color: #7f9cab;
  font-size: 90%;
  font-weight: 300;
}

.nge-column-filter::placeholder {
  color: #7b8c97;
}

.nge-table tr {
  cursor: pointer;
}

.nge-table tr:hover {
  background: #eef7f3;
}

.nge-coder-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(28, 41, 52, 0.24);
}

.nge-coder-panel {
  width: min(38rem, calc(100vw - 4rem));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--nge-line);
  border-radius: 6px;
  background: var(--nge-surface);
  box-shadow: 0 16px 40px rgba(28, 41, 52, 0.2);
}

.nge-coder-title {
  color: var(--nge-text);
  font-size: 110%;
  font-weight: 700;
}

.nge-coder-fields {
  display: grid;
  gap: 12px;
}

.nge-coder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.nge-coder-actions button {
  min-width: 6rem;
  min-height: 32px;
  border: 1px solid var(--nge-line);
  border-radius: 4px;
  background: #f7f9fa;
  color: var(--nge-text);
  cursor: pointer;
}

.nge-coder-actions button[type="submit"] {
  border-color: var(--nge-accent);
  background: var(--nge-accent);
  color: white;
}

.nge-table-media-cell {
  width: 5rem;
  min-width: 5rem;
  height: 3.25rem;
  text-align: center;
}

.nge-table-media-thumb {
  display: block;
  width: 4.25rem;
  height: 2.5rem;
  object-fit: contain;
}

.nge-action-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  gap: 8px;
  width: var(--nge-action-width);
  min-height: 0;
  padding: 4px;
  border-left: 1px solid var(--nge-line);
}

.nge-action-button {
  width: 44px;
  height: 44px;
  border-color: var(--nge-line);
  border-radius: var(--nge-radius);
  background: var(--nge-surface);
  color: var(--nge-text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.nge-action-button:hover {
  border-color: var(--nge-accent);
  color: var(--nge-accent);
}

.nge-table-pagination {
  display: grid;
  grid-template-columns: 18px minmax(1.4rem, 1fr) 18px;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--nge-line);
}

.nge-page-button {
  width: 18px;
  height: 24px;
  border: 1px solid var(--nge-line);
  border-radius: 4px;
  background: var(--nge-surface);
  color: var(--nge-text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.nge-page-button:hover:not(:disabled) {
  border-color: var(--nge-accent);
  color: var(--nge-accent);
}

.nge-page-button:disabled {
  cursor: default;
  opacity: 0.36;
}

.nge-page-number {
  min-width: 0;
  overflow: hidden;
  color: var(--nge-text);
  font-size: 80%;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  text-overflow: ellipsis;
}

.nge-record {
  display: grid;
  grid-template-columns: minmax(22rem, 34rem) minmax(0, 1fr) var(--nge-action-width);
  grid-template-rows: clamp(11rem, 22vh, 16rem) minmax(0, 1fr);
  grid-template-areas:
    "header media actions"
    "data data actions";
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.nge-record-header,
.nge-media,
.nge-record-data {
  border: 1px solid var(--nge-line);
  background: var(--nge-surface);
  border-radius: var(--nge-radius);
  min-width: 0;
}

.nge-record-header {
  grid-area: header;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  overflow: hidden;
  background: var(--nge-section);
}

.nge-record-title {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: var(--nge-text);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-field {
  display: grid;
  grid-template-columns: minmax(6rem, 30%) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.nge-field > span:first-child {
  align-self: end;
  padding-bottom: 2px;
  color: var(--nge-muted);
  font-size: 80%;
  font-weight: 300;
}

.nge-field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: end;
  padding-bottom: 0;
}

.nge-field-action .nge-icon-button {
  width: 28px;
  height: 24px;
  border-color: var(--nge-line);
  border-radius: var(--nge-radius);
  color: var(--nge-text);
}

.nge-field-action-rules {
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 4px;
}

.nge-field-rules-button {
  width: 22px;
  height: 24px;
  padding: 0;
  color: var(--nge-muted);
  font-size: 16px;
}

.nge-rules-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
  background: rgba(24, 34, 42, 0.28);
}

.nge-rules-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(900px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 48px));
  min-width: 0;
  border: 1px solid var(--nge-line-strong);
  background: var(--nge-surface);
  box-shadow: 0 18px 36px rgba(23, 33, 43, 0.24);
}

.nge-rules-dialog header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--nge-line);
}

.nge-rules-title {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-rules-body {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}

.nge-rules-dialog footer {
  padding: 8px 12px;
  border-top: 1px solid var(--nge-line);
  color: var(--nge-muted);
  font-size: 85%;
}

.nge-rules-empty {
  color: var(--nge-muted);
  margin: 0;
}

.nge-rules-simple {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  min-height: 18rem;
}

.nge-rule-type-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--nge-line);
  padding-right: 10px;
}

.nge-rule-type-tabs button {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 7px 8px;
  background: transparent;
  color: var(--nge-text);
  cursor: pointer;
  text-align: left;
}

.nge-rule-type-tabs button[aria-selected="true"] {
  border-color: var(--nge-line-strong);
  background: #eef7ef;
}

.nge-rule-type-panel {
  min-width: 0;
  padding-left: 12px;
}

.nge-rule-type-table {
  width: 100%;
  border-collapse: collapse;
}

.nge-rule-type-table th,
.nge-rule-type-table td {
  border-bottom: 1px solid var(--nge-line);
  padding: 6px 7px;
  text-align: left;
  vertical-align: top;
}

.nge-rule-type-table th {
  color: var(--nge-muted);
  font-weight: 600;
}

.nge-rule-type-table input,
.nge-rule-type-table select,
.nge-rule-type-table textarea {
  width: 100%;
  min-width: 7rem;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  padding: 3px 1px;
  background: transparent;
  color: var(--nge-text);
  font: inherit;
}

.nge-rule-type-table textarea {
  min-height: 2.4rem;
  resize: vertical;
}

.nge-rule-type-table tr.is-inactive {
  opacity: 0.72;
}

.nge-rule-row-actions {
  width: 2.5rem;
  text-align: right;
}

.nge-rule-row-actions button {
  border: 1px solid var(--nge-line-strong);
  border-radius: 4px;
  min-width: 1.9rem;
  padding: 4px 7px;
  background: #eef7ef;
  color: var(--nge-text);
  cursor: pointer;
}

.nge-view-profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
  background: rgba(24, 34, 42, 0.28);
}

.nge-view-profile-dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  min-width: 0;
  border: 1px solid var(--nge-line-strong);
  background: var(--nge-surface);
  box-shadow: 0 18px 36px rgba(23, 33, 43, 0.24);
}

.nge-view-profile-dialog header,
.nge-view-profile-dialog footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
}

.nge-view-profile-dialog header {
  border-bottom: 1px solid var(--nge-line);
}

.nge-view-profile-dialog header .nge-rules-title {
  margin-right: auto;
}

.nge-view-profile-dialog footer {
  border-top: 1px solid var(--nge-line);
}

.nge-view-profile-dialog footer .nge-danger-button {
  margin-right: auto;
}

.nge-danger-button {
  min-height: 32px;
  border: 1px solid var(--nge-error);
  border-radius: var(--nge-radius);
  padding: 0 10px;
  background: #fff5f5;
  color: var(--nge-error);
  cursor: pointer;
  font-weight: 700;
}

.nge-view-profile-options {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) minmax(8rem, 12rem) minmax(9rem, 14rem);
  gap: 10px;
  padding: 10px 12px;
}

.nge-view-profile-options label {
  display: grid;
  gap: 4px;
  color: var(--nge-muted);
  font-size: 82%;
}

.nge-view-profile-options input,
.nge-view-profile-options select {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  padding: 3px 1px;
  background: transparent;
  color: var(--nge-text);
  font: inherit;
}

.nge-view-profile-table-wrap {
  min-height: 0;
  overflow: auto;
  padding: 0 12px 12px;
}

.nge-view-profile-table {
  width: 100%;
  border-collapse: collapse;
}

.nge-view-profile-table th,
.nge-view-profile-table td {
  border-bottom: 1px solid var(--nge-line);
  padding: 6px 7px;
  text-align: left;
}

.nge-view-profile-table th {
  color: var(--nge-muted);
  font-weight: 600;
}

.nge-view-profile-table tbody tr {
  cursor: grab;
}

.nge-view-profile-table tbody tr.is-dragging {
  opacity: 0.55;
}

.nge-view-profile-table tbody tr.is-hidden {
  background: var(--nge-section);
  color: var(--nge-muted);
}

.nge-view-profile-table input,
.nge-view-profile-table select {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  background: transparent;
  color: var(--nge-text);
  font: inherit;
}

.nge-view-profile-column-toggle,
.nge-view-profile-sort-toggle {
  border: 1px solid var(--nge-accent);
  border-radius: 4px;
  background: #e8f7ef;
  color: var(--nge-accent);
  font: inherit;
  cursor: pointer;
}

.nge-view-profile-column-toggle {
  width: 100%;
  padding: 5px 7px;
  text-align: left;
}

.nge-view-profile-sort-toggle {
  width: 2.2rem;
  min-height: 2rem;
  padding: 3px 0;
  text-align: center;
}

.nge-view-profile-table tr.is-hidden .nge-view-profile-column-toggle,
.nge-view-profile-sort-toggle:not(.is-active) {
  border-color: var(--nge-line);
  background: var(--nge-section);
  color: var(--nge-muted);
}

.nge-field-action [data-nge-version-select] {
  max-width: 7rem;
}

.nge-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.nge-field textarea.nge-json-editor {
  min-height: clamp(12rem, 38vh, 30rem);
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--nge-line);
  border-radius: 4px;
  background: #fbfcfc;
  font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Consolas, monospace;
  font-size: 92%;
  font-weight: 400;
  line-height: 1.45;
  tab-size: 2;
  resize: vertical;
}

.nge-field textarea.nge-json-editor:focus {
  border-color: var(--nge-accent);
  box-shadow: 0 0 0 2px rgba(25, 132, 119, 0.12);
}

.nge-field textarea.nge-json-editor.is-invalid {
  border-color: var(--nge-error);
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.1);
}

.nge-json-editor-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.4rem;
  margin-top: 0.25rem;
  color: var(--nge-muted);
  font-size: 78%;
  font-weight: 300;
}

.nge-json-format {
  min-width: 2rem;
  height: 1.35rem;
  border: 1px solid var(--nge-line);
  border-radius: 4px;
  background: var(--nge-surface);
  color: var(--nge-text);
  cursor: pointer;
  font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1;
}

.nge-json-format:hover {
  border-color: var(--nge-accent);
}

.nge-json-editor-status.is-invalid {
  color: var(--nge-error);
}

.nge-field-wide {
  grid-column: 1 / -1;
}

.nge-alias-editor {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.nge-alias-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--nge-line);
  background: var(--nge-surface);
}

.nge-alias-table {
  width: 100%;
  border-collapse: collapse;
}

.nge-alias-table th,
.nge-alias-table td {
  border-bottom: 1px solid var(--nge-line);
  padding: 6px 8px;
  text-align: left;
}

.nge-alias-table input,
.nge-alias-add input {
  width: 100%;
  height: 24px;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--nge-text);
}

.nge-alias-table input:focus,
.nge-alias-add input:focus {
  border-bottom-color: var(--nge-accent);
  outline: none;
}

.nge-alias-table th {
  background: #e9eef2;
  color: #263642;
}

.nge-alias-table .nge-icon-button {
  width: 28px;
  height: 28px;
  border-color: var(--nge-line);
  border-radius: var(--nge-radius);
  color: var(--nge-text);
}

.nge-alias-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: end;
}

.nge-alias-add .nge-icon-button {
  width: 32px;
  height: 32px;
  border-color: var(--nge-line);
  border-radius: var(--nge-radius);
  color: var(--nge-text);
}

.nge-lines-editor {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.nge-lines-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--nge-line);
  background: var(--nge-surface);
}

.nge-lines-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.nge-lines-table th,
.nge-lines-table td {
  border-bottom: 1px solid var(--nge-line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.nge-lines-table th {
  background: #e9eef2;
  color: #263642;
  font-weight: 400;
}

.nge-lines-table th:nth-child(1) {
  width: 24%;
}

.nge-lines-table th:nth-child(3) {
  width: 8rem;
}

.nge-lines-table th:nth-child(4) {
  width: 11rem;
}

.nge-lines-table th:nth-child(5) {
  width: 3rem;
}

.nge-lines-table input {
  width: 100%;
  min-width: 0;
  height: 24px;
  border: 0;
  border-bottom: 1px solid var(--nge-line-strong);
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--nge-text);
}

.nge-lines-table input:focus {
  border-bottom-color: var(--nge-accent);
  outline: none;
}

.nge-lines-table .nge-lookup {
  grid-template-columns: minmax(5rem, 40%) minmax(0, 1fr);
}

.nge-lines-table .nge-lookup.nge-lookup-compact {
  grid-template-columns: minmax(0, 1fr);
}

.nge-lines-table .nge-lookup output {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nge-lines-table .nge-lookup.nge-lookup-compact output {
  display: none;
}

.nge-lines-table .nge-icon-button,
.nge-lines-add .nge-icon-button {
  width: 28px;
  height: 28px;
  border-color: var(--nge-line);
  border-radius: var(--nge-radius);
  color: var(--nge-text);
}

.nge-lines-add {
  display: flex;
  justify-content: flex-end;
}

.nge-media {
  grid-area: media;
  position: relative;
  padding: 8px;
  overflow: hidden;
}

.nge-media-stage {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px dashed var(--nge-line-strong);
  border-radius: var(--nge-radius);
  color: var(--nge-muted);
}

.nge-media.has-media .nge-media-stage {
  cursor: zoom-in;
}

.nge-media-image {
  display: block;
  max-width: 88%;
  max-height: 82%;
  object-fit: contain;
}

.nge-media-pdf {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.nge-media-file {
  max-width: 90%;
  overflow-wrap: anywhere;
  color: var(--nge-text);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
}

.nge-media .nge-icon-button {
  position: absolute;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-color: rgba(23, 33, 43, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--nge-text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, border-color 120ms ease, color 120ms ease;
}

.nge-media:hover .nge-icon-button,
.nge-media:focus-within .nge-icon-button {
  opacity: 1;
  pointer-events: auto;
}

.nge-media > .nge-icon-button {
  top: 50%;
  transform: translateY(-50%);
}

.nge-media > .nge-icon-button:first-child {
  left: 14px;
}

.nge-media > .nge-icon-button:nth-of-type(2) {
  right: 14px;
}

.nge-media .nge-icon-button:hover {
  border-color: var(--nge-accent);
  color: var(--nge-accent);
}

.nge-media-tools {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.nge-media:hover .nge-media-tools,
.nge-media:focus-within .nge-media-tools {
  pointer-events: auto;
}

.nge-record .nge-action-bar {
  grid-area: actions;
}

.nge-record-data {
  grid-area: data;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.nge-tabs-vertical {
  border-right: 1px solid var(--nge-line);
  background: #eef2f5;
  padding: 8px;
  overflow: auto;
}

.nge-tab-button {
  display: block;
  width: 100%;
  min-height: 34px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: var(--nge-radius);
  background: transparent;
  color: var(--nge-text);
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
}

.nge-tab-button[aria-selected="true"] {
  border-color: var(--nge-accent);
  background: #ffffff;
  color: var(--nge-accent);
  font-weight: 700;
}

.nge-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 10px;
}

.nge-record-data .nge-panel[hidden] {
  display: none;
}

.nge-record-data .nge-json-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 6px;
  overflow: hidden;
}

.nge-record-data .nge-json-panel > .nge-form-grid {
  height: 100%;
  min-height: 0;
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr);
}

.nge-record-data .nge-json-field-full {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.nge-record-data .nge-json-field-full > * {
  grid-column: 1 / -1;
  min-width: 0;
}

.nge-record-data .nge-json-field-full > span:first-child {
  align-self: start;
}

.nge-record-data .nge-json-field-full textarea.nge-json-editor {
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: none;
  resize: none;
}

.nge-record-data .nge-json-field-full .nge-json-editor-tools {
  width: 100%;
}

.nge-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  align-content: start;
}

.nge-logbar {
  grid-column: 1 / -1;
  border-top: 1px solid var(--nge-line-strong);
  background: #f7f9fa;
  color: var(--nge-text);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 76px;
  min-height: 76px;
  transition: height 120ms ease;
}

.nge-logbar.is-expanded {
  height: 380px;
}

.nge-log-list {
  margin: 0;
  padding: 4px 10px;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.nge-log-entry {
  display: grid;
  grid-template-columns: 76px 26px minmax(0, 1fr);
  gap: 6px;
  min-height: 16px;
  align-items: center;
  font-size: 12px;
}

.nge-log-level-warning {
  color: #8a5600;
}

.nge-log-level-error {
  color: #a3261e;
}
