.remaked-autosave {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #c1d2aa;
  border-radius: 7px;
  background: #f7faF2;
  color: #69765e;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.remaked-autosave[data-state="saved"],
.remaked-autosave[data-state="restored"] {
  border-color: #a9c98b;
  color: #4e752f;
}

.remaked-autosave[data-state="warning"],
.remaked-autosave[data-state="error"] {
  border-color: #d6b77c;
  background: #fff9eb;
  color: #866126;
}

.remaked-build-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 20px;
  background: rgba(34, 43, 28, 0.46);
  backdrop-filter: blur(3px);
}

.remaked-build-overlay[hidden] {
  display: none !important;
}

.remaked-build-manager {
  box-sizing: border-box;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid #aebf95;
  border-radius: 14px;
  background: #fbfdf7;
  color: #2f3b29;
  box-shadow: 0 24px 70px rgba(36, 50, 27, 0.26);
  font-family: var(--rm-font, Inter, ui-sans-serif, system-ui, sans-serif);
}

.remaked-build-manager-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #d4dfc6;
  background: rgba(248, 251, 243, 0.97);
}

.remaked-build-manager-title {
  margin: 0;
  color: #35462a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1;
}

.remaked-build-close,
.remaked-build-button,
.remaked-build-row button {
  box-sizing: border-box;
  min-height: 32px;
  border: 1px solid #afc496;
  border-radius: 7px;
  background: #f5f9ef;
  color: #4b633b;
  font: 700 10px/1 var(--rm-font, Inter, ui-sans-serif, system-ui, sans-serif);
  cursor: pointer;
}

.remaked-build-close {
  min-width: 34px;
  padding: 5px 8px;
  font-size: 17px;
}

.remaked-build-button {
  padding: 7px 11px;
}

.remaked-build-button-primary {
  border-color: #638f3d;
  background: linear-gradient(180deg, #78a94d, #60903b);
  color: #fff;
}

.remaked-build-close:hover,
.remaked-build-button:hover,
.remaked-build-row button:hover,
.remaked-build-close:focus-visible,
.remaked-build-button:focus-visible,
.remaked-build-row button:focus-visible {
  border-color: #729b4d;
  background: #e6f0d9;
  outline: 2px solid rgba(102, 155, 54, 0.25);
  outline-offset: 1px;
}

.remaked-build-button-primary:hover,
.remaked-build-button-primary:focus-visible {
  background: #527e31;
  color: #fff;
}

.remaked-build-manager-body {
  display: grid;
  gap: 15px;
  padding: 15px 16px 18px;
}

.remaked-build-section {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #d3dfc4;
  border-radius: 10px;
  background: #f7faf2;
}

.remaked-build-section h3 {
  margin: 0;
  color: #50663f;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.remaked-build-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.remaked-build-input,
.remaked-build-code {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b9ca9f;
  border-radius: 7px;
  background: #fff;
  color: #354230;
  font: 11px/1.35 var(--rm-font, Inter, ui-sans-serif, system-ui, sans-serif);
}

.remaked-build-input {
  min-height: 34px;
  padding: 7px 9px;
}

.remaked-build-code {
  min-height: 100px;
  resize: vertical;
  padding: 9px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
}

.remaked-build-input:focus-visible,
.remaked-build-code:focus-visible {
  border-color: #6d9848;
  outline: 2px solid rgba(102, 155, 54, 0.22);
  outline-offset: 1px;
}

.remaked-build-list {
  display: grid;
  gap: 6px;
}

.remaked-build-empty {
  padding: 12px;
  border: 1px dashed #c5d3b4;
  border-radius: 8px;
  color: #75816b;
  font-size: 10px;
  text-align: center;
}

.remaked-build-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(4, auto);
  align-items: center;
  gap: 5px;
  padding: 8px;
  border: 1px solid #d0ddc0;
  border-radius: 8px;
  background: #fff;
}

.remaked-build-row-name {
  min-width: 0;
  overflow: hidden;
  color: #3d4e31;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}





.remaked-build-row-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



.remaked-build-row button {
  padding: 6px 8px;
}

.remaked-build-row [data-remaked-build-delete] {
  color: #875242;
}

.remaked-build-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.remaked-build-status {
  min-height: 18px;
  margin: 0;
  color: #68765e;
  font-size: 10px;
  line-height: 1.35;
}

.remaked-build-status[data-state="success"] {
  color: #527b34;
}

.remaked-build-status[data-state="warning"],
.remaked-build-status[data-state="error"] {
  color: #8b6025;
}

@media (max-width: 620px) {
  .remaked-build-overlay {
    align-items: end;
    padding: 8px;
  }

  .remaked-build-manager {
    width: 100%;
    max-height: calc(100vh - 16px);
    border-radius: 12px;
  }

  .remaked-build-manager-header {
    padding: 12px;
  }

  .remaked-build-manager-body {
    gap: 11px;
    padding: 11px;
  }

  .remaked-build-section {
    padding: 10px;
  }

  .remaked-build-create {
    grid-template-columns: 1fr;
  }

  .remaked-build-row {
    grid-template-columns: 1fr 1fr;
  }

  .remaked-build-row-name {
    grid-column: 1 / -1;
    white-space: normal;
  }



  .remaked-build-row-name-text {
    white-space: normal;
  }

  .remaked-build-row button {
    width: 100%;
  }
}
.remaked-legacy-recovery { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rm-border); }
.remaked-legacy-recovery[hidden] { display: none; }
.remaked-legacy-recovery p { margin: 0 0 8px; color: var(--rm-muted); font: 12px/1.5 var(--rm-font); }

/* The retained Code nodes live only in Builds. Reset source fixed dimensions
   here, outside #body, without changing museum markup or copying its handlers. */
.remaked-modern [data-remaked-build-code-workspace] :is(ul, li) {
  box-sizing: border-box; float: none; width: auto; height: auto;
  position: static; margin: 0; padding: 0; list-style: none;
}
.remaked-modern [data-remaked-build-code-workspace] [data-remaked-calculator-code] > li:first-child { display: none; }
.remaked-modern [data-remaked-build-code-workspace] #InCode {
  box-sizing: border-box; float: none; width: 100%; height: auto; min-height: 44px;
  margin-bottom: 8px; padding: 9px; border: 1px solid #afc496; border-radius: 7px;
  background: #fff; color: #2f3b29; font: 12px/1.5 ui-monospace, Consolas, monospace;
}
.remaked-modern [data-remaked-build-code-workspace] .remaked-build-code-actions {
  display: flex; flex-wrap: wrap; gap: 7px;
}
.remaked-modern [data-remaked-build-code-workspace] [data-remaked-calculator-code-source] {
  border: 0; background: transparent;
}
.remaked-modern [data-remaked-build-code-workspace] .remaked-build-button { min-height: 44px; }
.remaked-modern [data-remaked-code-status]:empty { display: none; }
.remaked-modern [data-remaked-code-status] {
  width: 100% !important; margin-top: 8px !important;
  color: #68765e; font: 12px/1.5 var(--rm-font); white-space: normal; overflow-wrap: anywhere;
}
.remaked-modern [data-remaked-code-status][data-state="error"] { color: #8e2921; }
.remaked-modern [data-remaked-code-status][data-state="warning"] { color: #8b6025; }

.remaked-build-catalog {
  gap: 4px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #f8fbf4, #f3f8ed);
}
.remaked-build-catalog-line {
  color: #49633a;
  font: 800 11px/1.35 var(--rm-font);
  letter-spacing: .01em;
}
.remaked-build-catalog [data-remaked-catalog-status] {
  margin: 0;
  font: 10px/1.4 var(--rm-font);
  overflow-wrap: anywhere;
}
.remaked-build-catalog [data-remaked-catalog-status]:empty { display: none; }

.remaked-build-row-name:has(details) { overflow: visible; white-space: normal; }
.remaked-build-row-name details { font-size: 11px; font-weight: 400; }
.remaked-build-row-name details p { margin: 4px 0; overflow-wrap: anywhere; }

.remaked-modern .remaked-build-actions .remaked-tool-button { font-size: 12px; min-height: 36px; }
@media (max-width: 620px) { .remaked-modern .remaked-build-actions .remaked-tool-button { min-height: 44px; } }

/* Shared chrome survives retirement of the install/offline stylesheet. */
.remaked-modern {
  --rm-control-height: 2.75rem;
  --rm-header-control-height: 3.125rem;
}

/* Shared Modern chrome sizing; never override preserved calculator styles. */
.remaked-modern .remaked-tool-button {
  box-sizing: border-box;
  min-height: var(--rm-control-height);
  padding: .5rem .65rem;
  border: 1px solid #a9c28a;
  border-radius: .5rem;
  background: #f3f7ec;
  color: #496438;
  font: 700 .75rem/1.25 var(--rm-font);
  white-space: nowrap;
  flex-shrink: 0;
}
.remaked-modern .remaked-tools { flex-wrap: wrap; overflow-x: visible; }
.remaked-modern .remaked-tool-button:hover {
  border-color: #6f9d47; background: #e4f1d6; color: #35591e;
}
.remaked-modern :is(.remaked-build-button, .remaked-compare-button, .remaked-search-close, .remaked-search-reset) {
  min-height: var(--rm-control-height);
  font: 700 .75rem/1.25 var(--rm-font);
}
.remaked-modern [data-remaked-language-panel] {
  box-sizing: border-box;
  min-height: var(--rm-header-control-height);
  margin: 0;
  border-color: #a9c28a;
}
.remaked-modern [data-remaked-language-panel] button {
  min-width: 2.55rem;
  min-height: var(--rm-control-height);
  padding: .375rem .45rem;
  font: 700 .75rem/1.25 var(--rm-font);
}
.remaked-modern .remaked-autosave {
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .42rem;
  flex: 0 0 13rem;
  min-width: 13rem;
  min-height: 1.9rem;
  padding: .28rem .65rem .28rem .82rem;
  border: 0;
  border-radius: 3px;
  background: rgba(232, 241, 222, .52);
  color: #5b694f;
  font: 600 .75rem/1.2 var(--rm-font);
  white-space: nowrap;
}

.remaked-modern .remaked-autosave::before {
  content: "";
  width: .44rem;
  height: .44rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #8aa96b;
  box-shadow: 0 0 0 2px rgba(138, 169, 107, .10);
}

.remaked-modern .remaked-autosave::after {
  content: "";
  position: absolute;
  inset-block: .28rem;
  inset-inline-start: 0;
  width: 1px;
  background: rgba(139, 158, 111, .38);
}

.remaked-modern .remaked-autosave[data-state="saved"],
.remaked-modern .remaked-autosave[data-state="restored"],
.remaked-modern .remaked-autosave[data-state="ready"] {
  background: rgba(232, 241, 222, .52);
  color: #4e752f;
}

.remaked-modern .remaked-autosave[data-state="saved"]::before,
.remaked-modern .remaked-autosave[data-state="restored"]::before,
.remaked-modern .remaked-autosave[data-state="ready"]::before {
  background: #79a851;
  box-shadow: 0 0 0 2px rgba(121, 168, 81, .12);
}

.remaked-modern .remaked-autosave[data-state="warning"],
.remaked-modern .remaked-autosave[data-state="error"] {
  background: rgba(255, 247, 232, .74);
  color: #866126;
}

.remaked-modern .remaked-autosave[data-state="warning"]::before,
.remaked-modern .remaked-autosave[data-state="error"]::before {
  background: #c79536;
  box-shadow: 0 0 0 2px rgba(199, 149, 54, .10);
}
@media (min-width: 621px) {
  .remaked-modern { --rm-control-height: 2.25rem; --rm-header-control-height: 2.25rem; }
  .remaked-modern [data-remaked-language-panel] {
    flex: 0 0 auto;
  }
  .remaked-modern [data-remaked-language-panel] button {
    width: 2.1rem;
    min-width: 2.1rem;
    min-height: 1.875rem;
  }
}

@media (max-width: 860px) {
  .remaked-modern .remaked-autosave {
    flex-basis: auto;
    min-width: 0;
  }
}
