* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f3f4f6;
  color: #111827;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  padding: 14px;
}

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

button {
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  padding: 6px 10px;
  cursor: pointer;
}

button:hover {
  border-color: #64748b;
  background: #f8fafc;
}

button[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #111827;
}

input,
select {
  min-height: 30px;
  padding: 4px 7px;
}

textarea {
  padding: 8px 10px;
  line-height: 1.35;
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  position: relative;
  padding-top: 42px;
}

.auth-bar {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 32px;
  color: #334155;
  font-size: 13px;
}

.login-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.login-form input {
  width: 126px;
  min-height: 30px;
}

.auth-user {
  font-weight: 700;
}

.about-link {
  color: #334155;
  font-weight: 700;
  text-decoration: none;
}

.about-link:hover {
  color: #111827;
  text-decoration: underline;
}

.about-page {
  min-height: calc(100vh - 28px);
  display: grid;
  place-items: start center;
  padding: 36px 14px;
}

.about-panel {
  width: min(720px, 100%);
  padding: 18px;
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.about-panel p {
  color: #334155;
  line-height: 1.55;
}

.maincolumn {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.mainrow {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.library-panel,
.control-panel,
.surface-panel,
.network-math {
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.library-panel {
  align-self: start;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 12px;
}

.panel-heading {
  margin-bottom: 10px;
}

.panel-heading h1,
.panel-heading h2 {
  margin: 0;
  line-height: 1.15;
}

.panel-heading h1 {
  font-size: 20px;
}

.panel-heading h2 {
  font-size: 16px;
}

.panel-heading p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.library-actions,
.action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.library-actions {
  margin-bottom: 12px;
}

.control-panel {
  padding: 12px;
}

.architecture-editor {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.architecture-editor label {
  padding-top: 8px;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
}

#formulatext {
  width: 100%;
  min-height: 74px;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.action-toolbar {
  align-items: center;
  margin-top: 10px;
}

.data-source-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  color: #334155;
  font-size: 13px;
}

.data-source-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.data-source-header > span:first-child {
  font-weight: 700;
}

#datasetStatus {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.data-source-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.target-select-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #334155;
  font-weight: 700;
}

.target-select-label select {
  max-width: 180px;
}

.data-source-controls input[type="file"] {
  max-width: 260px;
  padding: 4px;
  background: #f8fafc;
}

.dataset-preview {
  margin-top: 8px;
  padding: 8px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.dataset-preview strong {
  color: #111827;
}

.dataset-preview table {
  margin-top: 6px;
  border-collapse: collapse;
  font-family: "Courier New", monospace;
  font-size: 11px;
}

.dataset-preview td {
  padding: 2px 7px 2px 0;
  color: #334155;
}

.toolbar-divider {
  width: 1px;
  height: 26px;
  background: #e5e7eb;
}

.primary-action {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.primary-action:hover {
  background: #1f2937;
  border-color: #1f2937;
}

.danger-action {
  border-color: #dc2626;
  color: #991b1b;
}

.danger-action:hover {
  background: #fef2f2;
}
#importData{
  display:none;
}
#dataTable {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#dataTable td, #dataTable th {
  border: 1px solid #ddd;
  padding: 8px;
}

#dataTable tr:nth-child(even){background-color: #f2f2f2;}

#dataTable tr:hover {background-color: #ddd;}

#dataTable th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #000000;
  color: white;
}

#dataTable thead tr{
  display: table;
  width: 90%;
  table-layout: fixed;
}

#dataTable thead tbody {
  display: block;
}

.scrollable {
  display: block;
  max-height: 200px;
  overflow-y: auto;
}
.scrollable tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.project_table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.project_table td, .project_table th {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 7px;
}

.project_table tr:nth-child(even){background-color: #f8fafc;}

.project_table tr:hover {background-color: #eef2ff;}

.project_table tr.selected-net-row {
  background-color: #dbeafe;
}

.library-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.library-net-name {
  display: inline-block;
  max-width: calc(100% - 58px);
  vertical-align: middle;
}

.library-delete {
  float: right;
  padding: 3px 6px;
  border-color: #fecaca;
  color: #991b1b;
  font-size: 11px;
}

.library-delete:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.project_table th {
  text-align: left;
  background-color: #111827;
  color: #fff;
  font-weight: 700;
}

.icon {
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
}
.icon:hover {
  border-color: #2563eb;
}
#layer_controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

#netdia {
  width: 100%;
  height: min(640px, calc(100vh - 260px));
  min-height: 360px;
  overflow: auto;
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.node-chart-controls {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.node-chart-controls select {
  max-width: 160px;
}

.canvas-control-stack,
.canvas-train-controls,
.layer-node-controls,
.input-layer-panel {
  color: #334155;
  font: 12px Arial, Helvetica, sans-serif;
}

.canvas-control-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.diagram-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.canvas-train-controls {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.canvas-train-controls button {
  min-width: 68px;
  min-height: 32px;
}

.diagram-controls label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.diagram-controls input[type="number"] {
  width: 72px;
  min-height: 26px;
  padding: 2px 5px;
}

.diagram-controls #learningRate {
  width: 78px;
}

.diagram-controls #reportStride {
  width: 58px;
}

.diagram-controls input[type="checkbox"] {
  min-height: auto;
}

.check-control {
  color: #111827;
}

.layer-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 12px;
  border: 0;
  border-left: 1px solid #dbe1ea;
  background: transparent;
}

.layer-node-controls,
.input-layer-panel {
  display: block;
  padding: 8px;
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.layer-node-controls {
  width: 152px;
  line-height: 1.8;
}

.layer-controls #numlayers,
.numnodes {
  font-weight: 700;
  color: #111827;
  cursor: pointer;
}

.nodetype,
.gatetype {
  min-height: 27px;
  max-width: 124px;
  padding: 2px 6px;
  font-size: 12px;
}

.node-activation-control {
  align-items: center;
  gap: 4px;
  width: 112px;
  min-height: 30px;
  padding: 4px 5px;
  border: 1px solid #dbe1ea;
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #475569;
  font: 11px Arial, Helvetica, sans-serif;
}

.node-activation-control label {
  flex: 0 0 auto;
  font-weight: 700;
}

.node-activation-select {
  flex: 1 1 auto;
  width: 74px;
  min-width: 0;
  min-height: 22px;
  max-width: 78px;
  padding: 1px 4px;
  font-size: 11px;
}

.edge-chart {
  width: 36px;
  height: 24px;
  border: 1px solid #99f6e4;
  border-radius: 3px;
  background: rgba(240, 253, 250, 0.94);
  pointer-events: none;
}

.output-loss-control {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid #dbe1ea;
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #475569;
  font: 11px Arial, Helvetica, sans-serif;
}

.output-loss-control label {
  flex: 0 0 auto;
  font-weight: 700;
}

.output-loss-control select {
  width: 104px;
  min-width: 0;
  min-height: 22px;
  padding: 1px 4px;
  font-size: 11px;
}

#inputToggles {
  margin-top: 8px;
  font-size: 12px;
}

.input-layer-title {
  display: block;
  margin-bottom: 2px;
  color: #334155;
  font-weight: 700;
  font-size: 12px;
}

.input-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 190px;
  margin-bottom: 5px;
}

.input-field-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  cursor: pointer;
}

.input-field-toggle span,
.target-field-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-scale-select {
  width: 76px;
  min-height: 24px;
  padding: 1px 3px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #111827;
  font-size: 11px;
}

.target-field-row {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e5e7eb;
}

.target-field-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
}

.target-field-badge {
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 4px;
  background: #e5e7eb;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
}

#inputData.thumbnail {
  margin-top: 8px;
}

.normalization-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
}

.input-normalization-controls {
  display: block;
  max-width: 185px;
  padding: 7px;
}

.normalization-heading {
  font-weight: 700;
  color: #111827;
  margin-right: 2px;
}

.normalization-control {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  margin-top: 5px;
  white-space: nowrap;
}

.normalization-control small {
  color: #64748b;
}

.normalization-control select {
  min-height: 26px;
  max-width: 92px;
  padding: 2px 5px;
}
/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
  background-color: #fefefe;
  margin: 5vh auto;
  padding: 20px;
  border: 1px solid #888;
  width: min(1180px, calc(100vw - 48px));
  max-height: 86vh;
  overflow: auto;
}

.notice-modal {
  z-index: 3;
}

.notice-content {
  width: min(520px, calc(100vw - 36px));
  margin-top: 12vh;
}

.notice-content h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.notice-content p {
  margin: 0 0 10px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.notice-content button {
  margin-top: 6px;
}

/* The Close Button */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  /*cursor: pointer;*/
}

.node-type-editor {
  font-family: Arial, Helvetica, sans-serif;
}

.node-type-heading {
  margin: 0 0 14px;
}

.node-type-heading h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.node-type-heading p {
  margin: 0;
  color: #555;
  font-size: 13px;
}

.node-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: #334155;
  font-size: 13px;
}

.node-type-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.node-type-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111;
  color: #fff;
  text-align: left;
  padding: 9px 8px;
}

.node-type-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px;
  vertical-align: top;
  background: #fff;
}

.node-type-table tr:nth-child(even) td {
  background: #fafafa;
}

.node-type-table code,
.node-type-js code {
  display: inline-block;
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 3px 5px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #f8fafc;
  color: #111827;
}

.math-with-js-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.math-with-js-tooltip::after {
  content: attr(data-js-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: max-content;
  max-width: min(520px, 70vw);
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #111827;
  color: #f8fafc;
  font: 12px "Courier New", monospace;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

.math-with-js-tooltip:hover::after,
.math-with-js-tooltip:focus::after {
  display: block;
}

.node-type-input {
  width: 150px;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 5px 6px;
  font: 13px Arial, Helvetica, sans-serif;
}

.node-type-input.compact {
  width: 96px;
}

.node-type-input.code-input {
  width: 260px;
  max-width: 100%;
  min-height: 76px;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.loss-help {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #dbe1ea;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.loss-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.loss-library-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 150px;
  border: 1px solid #d6dee8;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.loss-library-card:hover,
.loss-library-card:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  outline: none;
}

.loss-library-card strong {
  font-size: 14px;
}

.loss-library-card span {
  font-size: 12px;
  line-height: 1.35;
  color: #475569;
}

.loss-library-card code {
  display: block;
  max-height: 46px;
  overflow: hidden;
  border-radius: 4px;
  background: #f1f5f9;
  padding: 6px;
  color: #0f172a;
  font-size: 11px;
  line-height: 1.25;
}

.loss-library-category {
  width: fit-content;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985 !important;
  padding: 2px 7px;
  font-size: 11px !important;
  font-weight: 700;
}

.loss-selected-note {
  margin: 0 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  padding: 8px 10px;
  color: #1e3a8a;
  font-size: 13px;
}

.loss-definition-table tr.loss-row-selected td {
  background: #eff6ff;
}

.loss-solution-table td {
  vertical-align: top;
}

.loss-solution-row {
  cursor: pointer;
}

.loss-solution-row:hover td,
.loss-solution-row:focus td {
  background: #eff6ff;
}

.loss-solution-row:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.loss-solution-table code {
  display: block;
  max-width: 420px;
  max-height: 54px;
  overflow: hidden;
  white-space: pre-wrap;
}

.loss-solution-source {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.loss-definition-table .code-input {
  width: 190px;
  min-height: 58px;
}

.loss-definition-table input[type="number"] {
  width: 78px;
}

.loss-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.node-type-action,
.node-type-add {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  padding: 5px 9px;
  cursor: pointer;
}

.node-type-action.primary,
.node-type-add {
  background: #111;
  border-color: #111;
  color: #fff;
}

.node-type-add {
  margin-top: 12px;
}

.feedforward-panel {
  font-family: Arial, Helvetica, sans-serif;
  max-width: 680px;
}

.feedforward-heading h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.feedforward-heading p {
  margin: 0 0 14px;
  color: #475569;
  font-size: 13px;
}

.feedforward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.feedforward-grid label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 13px;
}

.feedforward-grid input {
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 5px 7px;
}

.feedforward-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #64748b;
  font-size: 12px;
}

.feedforward-result-card {
  margin-top: 16px;
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  background: #f8fafc;
  padding: 12px;
}

.feedforward-output-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
}

.feedforward-output-row strong {
  font-size: 20px;
  color: #111827;
}

.feedforward-output-row small,
.feedforward-input-summary {
  color: #64748b;
  font-size: 12px;
}

.feedforward-input-summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  line-height: 1.5;
}

.collapsed-layer-card {
  box-sizing: border-box;
  width: 136px;
  min-height: 128px;
  padding: 12px;
  border: 1.5px solid #111827;
  border-radius: 4px;
  background: #fff;
  color: #111827;
  font: 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.collapsed-layer-card:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.collapsed-layer-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  text-align: center;
}

.collapsed-layer-count {
  color: #475569;
  font-size: 12px;
  text-align: center;
}

.collapsed-layer-activation {
  max-width: 112px;
  border: 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
  color: #111827;
  padding: 4px 0;
  font: 11px Arial, Helvetica, sans-serif;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.collapsed-layer-activation:hover {
  color: #2563eb;
}

.collapsed-layer-charts {
  width: 100%;
}

.collapsed-layer-chart {
  width: 110px;
  height: 44px;
  background: transparent;
}

.layer-modal {
  font-family: Arial, Helvetica, sans-serif;
}

.layer-modal h3 {
  margin: 0 0 4px;
}

.layer-modal p {
  margin: 0 0 12px;
  color: #475569;
}

.layer-modal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.layer-modal-activations {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 9px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

.layer-modal-activations span {
  flex: 1;
  overflow-wrap: anywhere;
}

.layer-modal-activations button {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  padding: 5px 9px;
  cursor: pointer;
}

.layer-modal-summary > div {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  padding: 9px;
  border-radius: 6px;
  line-height: 1.35;
}

.layer-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.layer-modal-chart {
  min-height: 280px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  vertical-align: middle;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.progress-wrap { margin: 10px 0 0; }
.progress {
  position: relative;
  height: 9px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 120ms ease;
}
.progress-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #475569;
  font: 12px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin-top: 6px;
}
.icon-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.icon-button img {
  width: 20px;
  height: 20px;
  display: block;
}

.network-math {
  width: 100%;
  margin: 0 0 24px;
  padding: 12px 14px;
  overflow: visible;
}

.network-numeric-row {
  border-top: 1px solid #e5e7eb;
  margin-top: 10px;
  padding-top: 8px;
}

.network-numeric-equations {
  margin-top: 6px;
  overflow: visible;
  padding: 4px 0 3px;
  white-space: normal;
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.numeric-equation {
  min-width: 0;
  margin-bottom: 8px;
}

.kan-fit-summary {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #ccfbf1;
  border-radius: 6px;
  background: #f0fdfa;
  color: #134e4a;
  white-space: normal;
}

.kan-fit-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.kan-summary-output {
  margin-bottom: 6px;
  font-size: 12px;
}

.kan-local-polynomial {
  margin: 6px 0;
  padding: 6px 7px;
  border: 1px solid #99f6e4;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.84);
  color: #134e4a;
  line-height: 1.45;
}

.kan-local-polynomial strong {
  display: block;
  margin-bottom: 3px;
}

.kan-local-polynomial span {
  overflow-wrap: anywhere;
}

.kan-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}

.kan-summary-card {
  padding: 6px 7px;
  border: 1px solid #99f6e4;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.72);
}

.kan-summary-current {
  margin-left: 8px;
  color: #0f766e;
  font-size: 12px;
}

.kan-summary-centers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
  color: #475569;
}

.kan-summary-centers > span,
.kan-summary-centers sub {
  color: inherit;
}

.numeric-output,
.numeric-equals,
.numeric-activation,
.numeric-gate,
.numeric-paren {
  color: #374151;
}

.numeric-output {
  font-weight: 700;
  margin-right: 4px;
}

.numeric-equals {
  margin-right: 4px;
}

.numeric-weight-term,
.numeric-bias-term {
  display: inline;
  margin-right: 5px;
}

.numeric-sign {
  margin-right: 2px;
}

.numeric-coefficient {
  color: inherit;
}

.numeric-factor {
  margin-left: 2px;
}

.numeric-group {
  display: inline;
}

.numeric-kan-phi {
  display: inline-block;
  vertical-align: top;
  margin: 0 4px 6px 0;
}

.numeric-kan-details {
  display: block;
  margin: 2px 0 0 18px;
  color: #475569;
  white-space: normal;
}

.numeric-kan-expansion {
  display: block;
  max-width: none;
}

.numeric-kan-basis-term {
  display: block;
  margin: 3px 0 6px;
  padding-left: 14px;
}

.numeric-basis-call {
  display: inline;
}

.numeric-basis-definition {
  display: block;
  margin: 2px 0 0 20px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.numeric-basis-name {
  display: inline-block;
  min-width: 70px;
  color: #475569;
}

.numeric-basis-value {
  display: inline-block;
  margin-left: 8px;
  color: #0f766e;
}

.numeric-piecewise {
  display: inline-grid;
  grid-template-columns: minmax(180px, auto) auto;
  gap: 1px 12px;
  vertical-align: top;
}

.numeric-piecewise > span {
  display: contents;
}

.numeric-piecewise > span.numeric-piece-active .numeric-piece-value,
.numeric-piecewise > span.numeric-piece-active .numeric-piece-cond {
  background: #ccfbf1;
  color: #115e59;
  font-weight: 700;
}

.numeric-piece-value {
  color: #475569;
}

.numeric-piece-cond {
  color: #64748b;
}

.kan-summary-note {
  margin-top: 4px;
  color: #475569;
  font-size: 12px;
}

.numeric-equation-empty {
  color: #6b7280;
  font-size: 12px;
}

@media (max-width: 980px) {
  body {
    padding: 10px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .auth-bar {
    position: static;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .login-form {
    flex-wrap: wrap;
  }

  .library-panel {
    max-height: none;
  }

  .architecture-editor {
    grid-template-columns: 1fr;
  }

  .architecture-editor label {
    padding-top: 0;
  }

  .toolbar-divider {
    display: none;
  }

  #netdia {
    height: 560px;
  }
}
