@font-face {
  font-family: Editor-Font;
  src: url("/fonts/JetBrains Mono Regular Nerd Font Complete Mono.ttf")
    format("truetype");
}

body {
  margin: 0px 0px;
  max-width: 100%;
  color: white;
  font-family: "Quicksand", sans-serif;
  background-color: rgb(0, 0, 0);
  cursor: default !important;
  animation: none;
}

html {
  overflow: hidden !important;
}

/* Do not expose the unstyled toolbar/sidebar for a frame while Socket.IO is
   still assembling the first tree. The shared loader remains visible instead. */
html.elsie-booting .elsie-toolbar-with-nav,
html.elsie-booting .content {
  visibility: hidden;
}

a,
u {
  text-decoration: none;
}

.main-loading-overlay {
  cursor: default !important;
  overflow: hidden;
  z-index: 100000000;
  transition: visibility 0s 0.3s, opacity 0.3s linear;
  visibility: visible;
  opacity: 1;
  display: flex;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  align-items: center;
  justify-content: center;
  background: linear-gradient(rgba(9, 24, 43, 0.66), rgba(9, 24, 43, 0.66)), #292929;
  isolation: isolate;
}

.main-loading-overlay,
.main-loading-overlay * {
  filter: none !important;
}

.main-loading-overlay .spinner-content {
  position: relative;
  z-index: 1;
}

.loading-spinner {
  animation: spinner 1.5s infinite linear;
}

.ping {
  --uib-size: 45px;
  --uib-speed: 2s;
  --uib-color: rgb(255, 255, 255);

  position: relative;
  height: var(--uib-size);
  width: var(--uib-size);
}

.ping::before,
.ping::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  background-color: var(--uib-color);
  animation: pulse var(--uib-speed) linear infinite;
  transform: scale(0);
  opacity: 0;
}

.ping::after {
  animation-delay: calc(var(--uib-speed) / -2);
}

@keyframes pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.toolbar {
  min-height: 54px;
  width: 100%;
  background-color: #1e1e1e;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  gap: 8px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.toolbar > #editor-return-link {
  flex: 0 0 auto;
}

.toolbar .homebtn {
  display: flex;
  align-content: center;
  justify-content: center;
  align-items: center;
  position: static;
  background-color: #1360c5;
  border: none;
  color: white;
  border-radius: 10px;
  transition: all 0.1s;
  font-weight: 700;
  height: 28px;
  width: 80px;
}

.toolbar .homebtn:hover {
  background-color: #024cbb;
  transition: all 0.1s;
}

.toolbar .homebtn img {
  width: 14px;
}

.toolbar .homebtn span {
  margin-left: 6px;
}

.elsie-compact-nav {
  position: static;
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  /* The shared context controls use one continuous outer silhouette. */
  gap: 0;
  max-width: 180px;
  padding: 2px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: max-width 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  z-index: 3;
}

.elsie-compact-nav:hover,
.elsie-compact-nav:focus-within {
  max-width: 500px;
  background: rgba(19, 96, 197, 0.16);
  border-color: rgba(100, 181, 246, 0.42);
}

.elsie-compact-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 32px;
  padding: 0 10px;
  border-radius: 7px;
  background-color: transparent;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  gap: 4px;
  transition: background-color 0.16s ease, min-width 0.2s ease, gap 0.2s ease;
}

.elsie-unread-feedback-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid #122235;
  border-radius: 999px;
  background: #55bfff;
  color: transparent;
  font-size: 0;
  box-shadow: 0 0 7px rgba(85, 191, 255, 0.72);
}

.elsie-unread-feedback-badge.is-warning {
  background: #f05b51;
  box-shadow: 0 0 7px rgba(240, 91, 81, 0.7);
}

.elsie-unread-feedback-badge[hidden] { display: none !important; }

.elsie-compact-nav a:hover,
.elsie-compact-nav a:focus-visible {
  background: #1360c5;
  outline: none;
}

.elsie-compact-nav img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
  flex: 0 0 auto;
}

.elsie-compact-nav span {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  margin-left: 0;
  transition: max-width 0.2s ease, opacity 0.16s ease, margin-left 0.2s ease;
}

.elsie-compact-nav a:hover span,
.elsie-compact-nav a:focus-visible span {
  max-width: 72px;
  opacity: 1;
  margin-left: 6px;
}

/* The course chooser uses the same segmented geometry as the ELSIE utility
   nav, but only appears for students enrolled in more than one course. */
.elsie-language-switcher {
  position: static;
  width: max-content;
  max-width: calc(100% - 20px);
  margin: 8px 10px 10px;
  z-index: 2;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.elsie-language-switcher[hidden] {
  display: none;
}

.elsie-language-switcher button {
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.elsie-language-switcher button:hover,
.elsie-language-switcher button:focus-visible,
.elsie-language-switcher button.is-active {
  background: #1360c5;
  color: #fff;
  outline: none;
}

.elsie-toolbar-with-nav .toolbar-current-path {
  left: auto;
  transition: opacity 0.15s ease;
}

.elsie-compact-nav:hover + .toolbar-current-path,
.elsie-compact-nav:focus-within + .toolbar-current-path {
  opacity: 0;
  pointer-events: none;
}

.toolbar .menubar {
  display: flex;
  flex-direction: row;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 0 auto;
  gap: 6px;
}

.elsie-draft-status {
  --draft-tone: #7f95ac;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 205px;
  min-height: 27px;
  margin-right: 10px;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid rgba(127, 149, 172, 0.34);
  border-radius: 8px;
  background: rgba(28, 33, 39, 0.82);
  color: #c8d2dd;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.elsie-draft-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--draft-tone);
  content: "";
}

.elsie-draft-status[data-state="draft"] {
  --draft-tone: #e2b95a;
  border-color: rgba(226, 185, 90, 0.42);
  background: rgba(65, 53, 29, 0.78);
  color: #f1d998;
}

.elsie-draft-status[data-state="editing"] {
  --draft-tone: #6fa9ea;
  color: #c8e1ff;
}

.elsie-draft-status[data-state="warning"] {
  --draft-tone: #de655c;
  border-color: rgba(222, 101, 92, 0.48);
  color: #ffc5c0;
}

.toolbar .menubar .btn {
  margin-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1360c5;
  border: none;
  color: white;
  border-radius: 10px;
  transition: all 0.1s;
  font-weight: 700;
  height: 28px;
  width: 80px;
}

#teacherDashboardBtn {
  width: 80px;
}

#markFolderBtn {
  width: auto;
  min-width: 104px;
  padding: 0 10px;
  white-space: nowrap;
}

#teacherDashboardBtn.is-marking,
#markFolderBtn.is-marking,
.toolbar .menubar .btn.is-marking {
  width: auto;
  min-width: 96px;
  white-space: nowrap;
}

.toolbar .menubar .btn:hover {
  background-color: #024cbb;
  transition: all 0.1s;
}

.toolbar .menubar .btn img {
  width: 14px;
}

.toolbar .menubar .btn span {
  margin-right: 6px;
}

.toolbar .headertxt {
  color: white;
  font-weight: 700;
  font-size: 30px;
  position: static;
  flex: 1 1 9rem;
  min-width: 0;
  text-align: center;
  pointer-events: none;
  white-space: normal;
}

.toolbar-current-path {
  position: static;
  flex: 0 1 auto;
  width: fit-content;
  max-width: min(32vw, 30rem);
  min-width: 0;
  color: #d7d7d7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.toolbar-path-folders {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: right;
}

.toolbar-path-filename {
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(58%, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}

.toolbar-current-path.is-empty {
  opacity: 0;
}

.titlebar .menubar {
  display: flex;
  flex-direction: row;
  margin-top: 4px;
}

.titlebar .menubar .button {
  background-color: #1360c5;
  width: 90px;
  height: 54px;
  color: rgb(204, 108, 108);

  border-radius: 5px;
  transition: all 0.2s;
  margin-left: 2px;
  border: none;
  justify-content: center;
  align-items: center;
  align-content: center;
  justify-items: center;
}
.content {
  --elsie-sidebar-inline-size: clamp(14rem, 30%, 20.125rem);
  position: absolute;
  width: 100%;
  height: calc(100dvh - var(--elsie-toolbar-height, 54px));
  overflow: hidden;
}

.agwrapper {
  background-color: #181818;
  color: white;
  font-family: Editor-Font;
  padding-top: 20px;
  width: 100%;
  height: 100%;
  padding-right: 35px;
  padding-bottom: 20px;
  padding-left: 35px;
  border: 5px solid white;
}
.main {
  margin-left: var(--elsie-sidebar-inline-size);
  position: relative;
  min-width: 0;
  overflow: hidden;
  height: calc(100vh - 54px);
  transition: margin-left 0.15s ease-out;
}

.not{
  z-index: 99;

  background-color: #024cbb;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
.app_editor {
  position: relative;
  box-sizing: border-box;
  border-bottom: 2px solid rgb(41, 41, 41);
}

.app_editor_wrapper {
  width: 100%;
  overflow: visible !important;
}

.app_editor_dragbar {
  background-color: #222222;
  width: 100%;
  height: 2px;
  cursor: row-resize;
  opacity: 1;
}

.elsie-collab-presence {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 96px);
  right: 14px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: min(320px, calc(100vw - 28px));
  padding: 7px 12px;
  border: 1px solid rgba(145, 160, 176, 0.38);
  border-radius: 12px;
  background: #1b1f24;
  color: #e7f3ff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.15s ease-out, visibility 0.22s ease;
  backdrop-filter: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  overflow: hidden;
  box-sizing: border-box;
}

.elsie-collab-presence.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

@keyframes collabPulse {
  0% { box-shadow: 0 0 0 0 rgba(104, 174, 255, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(104, 174, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(104, 174, 255, 0); }
}

.elsie-collab-presence .elsie-collab-badge {
  animation: none;
}

.elsie-collab-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #79b9e8;
  box-shadow: 0 0 0 3px rgba(121, 185, 232, 0.13);
}

.elsie-collab-label {
  white-space: nowrap;
  font-weight: 700;
}

.elsie-collab-avatars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.elsie-collab-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #33404d;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.elsie-collab-extra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #dceeff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.elsie-collab-presence button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(148, 204, 255, 0.48);
  border-radius: 6px;
  background: rgba(42, 124, 221, 0.3);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.elsie-collab-cursor {
  position: fixed;
  z-index: 2147483644;
  width: 2px;
  height: 20px;
  pointer-events: none;
  background: var(--collab-color, #37d7ff);
  box-shadow: 0 0 0 1px rgba(5, 14, 24, 0.8);
}

.elsie-collab-cursor span {
  position: absolute;
  top: -18px;
  left: 0;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px 6px 6px 0;
  background: var(--collab-color, #1282d8);
  color: #151515;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0;
  text-align: center;
}

.dirContent.is-shared-collab {
  position: relative;
  border-color: rgba(89, 172, 255, 0.58);
  background-image: linear-gradient(90deg, rgba(30, 117, 205, 0.18), transparent 58%);
}

.elsie-collab-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding-left: 6px;
  min-width: 0;
  cursor: pointer;
}

.elsie-collab-folder-line {
  width: 14px;
  height: 18px;
  border-left: 2px solid rgba(80, 188, 255, 0.78);
  border-bottom: 2px solid rgba(80, 188, 255, 0.78);
  border-radius: 0 0 0 5px;
  flex: 0 0 auto;
}

.elsie-collab-mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(135deg, #1d79d2, #20b2c9);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}

.elsie-collab-access-popover {
  position: fixed;
  z-index: 2147483647;
  width: min(272px, calc(100vw - 16px));
  max-height: min(280px, calc(100dvh - 16px));
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(104, 174, 255, 0.42);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.96);
  color: #e7f3ff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46);
  font-family: Arial, Helvetica, sans-serif;
}

.elsie-collab-access-title {
  margin-bottom: 8px;
  color: #93d1ff;
  font-size: 12px;
  font-weight: 800;
}

.elsie-collab-access-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.elsie-collab-access-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.elsie-collab-access-state {
  color: #9fb4c9;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.elsie-collab-access-state.is-active {
  color: #64e59a;
}

.elsie-collab-access-empty {
  color: #9fb4c9;
  font-size: 12px;
}

body.liem-reduce-animations {
  animation: none;
}

html.liem-reduce-animations *,
body.liem-reduce-animations * {
  animation-duration: 0.01ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}

html.liem-reduce-animations .elsie-collab-presence,
body.liem-reduce-animations .elsie-collab-presence {
  backdrop-filter: none;
}

html.liem-reduce-animations #file.elsie-tree-updated .dirContent,
body.liem-reduce-animations #file.elsie-tree-updated .dirContent {
  animation: none !important;
}

.xterm_wrapper {
  border-radius: 2px;
  padding-right: 8px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: #000;
}

.terminal {
  width: 100%;
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
}

.checker_wrapper {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  color: white;
  background-color: rgb(0, 0, 0);
  z-index: 5;
  min-height: 120px;
  max-height: 45vh;
  overflow: hidden;
  border-top: 2px solid #292929;
  box-sizing: border-box;
}

/* The legacy checker is opt-in. Its existing control can still deliberately
   reveal it through the classes/inline display state it already manages. */
.checker_wrapper {
  display: none !important;
}

.checker_wrapper.is-open,
.checker_wrapper.is-visible,
.checker_wrapper.show,
.checker_wrapper[aria-hidden="false"],
.checker_wrapper[style*="display:block" i],
.checker_wrapper[style*="display: block" i],
.checker_wrapper[style*="display:flex" i],
.checker_wrapper[style*="display: flex" i] {
  display: block !important;
}

.checker_wrapper.elsie-html-preview {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  background: #1e1e1e;
  border-top: 1px solid #333;
}

.checker_wrapper.elsie-html-preview .desc {
  float: none;
  width: 100%;
  height: auto;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  box-sizing: border-box;
  background: #1e1e1e;
  border-bottom: 1px solid #333;
  color: #fff;
  font-size: 0.75rem;
  overflow: visible;
}

.checker_wrapper.elsie-html-preview .desc button {
  border: 1px solid #4c5662;
  border-radius: 8px;
  background: #30363e;
  color: #f2f6fa;
  min-width: 64px;
  min-height: 30px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.checker_wrapper.elsie-html-preview .elsie-preview-open-page {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  box-sizing: border-box;
  border: 1px solid #1360c5;
  border-radius: 8px;
  background: #1360c5;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.checker_wrapper.elsie-html-preview .elsie-preview-open-page:hover,
.checker_wrapper.elsie-html-preview .elsie-preview-open-page:focus-visible {
  background: #024cbb;
  border-color: #024cbb;
}

.checker_wrapper.elsie-html-preview .frame_wrapper {
  float: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #fff;
  overflow: hidden;
}

.checker_wrapper.elsie-html-preview .frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #fff;
}

.elsie-collab-manager {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 15, 0.74);
  backdrop-filter: blur(5px);
}

.elsie-collab-manager-card {
  width: min(520px, 100%);
  padding: 20px;
  border: 1px solid #315f9c;
  border-radius: 14px;
  background: #101d30;
  color: #edf5ff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  font-family: Arial, Helvetica, sans-serif;
}

.elsie-collab-manager-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.elsie-collab-manager-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.elsie-collab-manager-heading p,
.elsie-collab-manager-help {
  margin: 5px 0 0;
  color: #aac0dc;
  font-size: 0.84rem;
  line-height: 1.45;
}

.elsie-collab-manager-close {
  border: 0;
  background: transparent;
  color: #c5d8f2;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.elsie-collab-manager-label {
  display: block;
  margin-bottom: 7px;
  color: #e7f2ff;
  font-size: 0.85rem;
  font-weight: 700;
}

.elsie-collab-manager-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #406d9e;
  border-radius: 7px;
  background: #07111f;
  color: #fff;
  font: inherit;
  box-sizing: border-box;
}

.elsie-collab-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.elsie-collab-manager-actions .btn {
  width: auto;
  min-width: 118px;
  padding: 0 12px;
}

.elsie-collab-manager-actions .btn.primary {
  background: #2f67c8;
}

.elsie-collab-manager-actions .btn.danger {
  background: #9f3030;
}
.desc {
  color:rgb(255, 255, 255);
  width: 40%;
  height: 98%;
  float: left;
  overflow: auto;
}
.frame_wrapper {
  width: 60%;
  height: 100%;
  color: white;
  float: right;
}

.frame {
  border: none;
  width: 100%;
  height: 100%;
  color: black;
  background-color: white;
}

.sidebarleft {
  height: 100%;
  width: var(--elsie-sidebar-inline-size, clamp(14rem, 30%, 20.125rem));
  position: absolute;
  background-color: #1e1e1e;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 20px 80px 20px;
  box-sizing: border-box;
  z-index: 10;
  transform: translateX(0);
  visibility: visible;
  will-change: transform;
  transition:
    transform 0.15s ease-out,
    visibility 0s linear 0s;
}

.sidebarleft.is-collapsed {
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.15s ease-out,
    visibility 0s linear 0.24s;
}

.view-tiles li {
  margin-bottom: 6px;
  font-size: 18px;
  transition: all 0.2s;
  list-style: none;
  display: table;
  transition: all 0.1s;
}

#file {
  margin-bottom: 50px;
}

.view-tiles li .name {
  width: 100%;
  background-position: 0px 2px;
}

.view-tiles span {
  display: inline-block;
}

.view-tiles li .name {
  color: rgb(255, 255, 255);
  text-indent: 20px;
  background-repeat: no-repeat;
}

.view-tiles li:hover {
  transition: all 0.2s;
}

.view-tiles .date {
  display: none;
}

.etc {
  margin: 0 auto 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

button {
  background-color: #1053ab;
  color: white;
  border: none;
  height: 22px;
  border-radius: 8px;
}

input[type] {
  background-color: #1053ab;
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 11px;
  height: 26px;
  width: 66px;
  font-weight: 700;
  transition: all 0.15s;
}

input[type]:hover {
  background-color: #0e42a1;
  border-radius: 10px;
  transition: all 0.15s;
}

.etc input[type="button"],
.etc .editor-side-action,
.filemanagerfunction input[type="button"],
#undoDeleteButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 66px;
  min-height: 26px;
  height: 26px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  box-sizing: border-box;
}

.toolbar .menubar {
  margin-left: auto;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

@media (max-width: 1500px) {
  .toolbar-current-path {
    right: calc(50% + 150px);
    max-width: 420px;
  }
}

@media (max-width: 1180px) {
  .toolbar-current-path {
    display: none;
  }
}

#teacherDashboardBtn.is-marking,
#teacherDashboardBtn[disabled] {
  width: auto;
  min-width: 96px;
}

.filemanagerfunction {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 11px;
  margin-top: 10px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
}

.filemanagerfunction input {
  margin-right: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

#snackbar {
  visibility: hidden;
  width: auto;
  max-width: calc(100% - 32px);
  min-width: 0;
  margin-left: 0;
  background-color: #292929;
  color: #fff;
  text-align: center;
  border: 1px solid #424242;
  border-radius: 6px;
  padding: 8px 11px;
  position: absolute;
  z-index: 20;
  left: 16px;
  bottom: 16px;
  font-size: 13px;
  line-height: 1.2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

#snackbar.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.backbut {
  color: rgb(218, 218, 218);
  display: flex;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  height: 40px;
  width: 93%;
  padding: 0;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.backbut img {
  width: 20px;
  height: 20px;
  margin-left: 10px;
  margin-right: 10px;
}

.backbut span { font-weight: 800; letter-spacing: .04em; }

#backbut:hover {
  background-color: #292b2e95;
}

.backbutton {
  margin-top: -4px;
}

.dirContent {
  color: rgb(218, 218, 218);
  display: flex;
  align-items: center;
  background: none;
  border: none;
  width: 93%;
  height: 40px;
}

.dirContent:hover {
  background-color: #292b2e95;
}

.dirContent p {
  display: block;
  min-width: 0;
}

.dirContent img {
  width: 20px;
  margin-left: 10px;
  margin-right: 10px;
}

.ai-status-badge,
.elsie-score-badge {
  margin-left: 8px;
  flex: 0 0 auto;
}

.elsie-folder-average {
  vertical-align: middle;
  font-size: 0.62rem !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: help;
}

.ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(79, 141, 247, 0.18);
  color: #9dccff;
  border: 1px solid rgba(157, 204, 255, 0.45);
  font-size: 0.65rem;
  font-weight: 800;
}

.ai-folder-status {
  margin-left: 6px;
}

.ai-status-error {
  background: rgba(244, 67, 54, 0.16);
  color: #ffb3ad;
  border-color: rgba(244, 67, 54, 0.5);
}

.ai-status-pending {
  background: rgba(255, 193, 7, 0.14);
  color: #ffe08a;
  border-color: rgba(255, 193, 7, 0.45);
}

.ai-sidebar-spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(157, 204, 255, 0.28);
  border-top-color: #9dccff;
  border-radius: 50%;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  will-change: transform;
  animation: aiSidebarSpin 0.7s linear infinite;
}

@keyframes aiSidebarSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

input[type="file"] {
  width: 88px;
  color: transparent;
}

.currentdir {
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.currentdir h3 {
  margin: 0;
  line-height: 1.25;
}

.hideBar {
  /* A compact ribbon attached to the sidebar edge, rather than a floating
     button that competes with the editor content. */
  position: absolute;
  top: 50%;
  left: 0;
  bottom: auto;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  width: 26px !important;
  height: 44px !important;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(112, 173, 255, 0.54);
  border-left: 0;
  border-radius: 0 12px 12px 0 !important;
  background: linear-gradient(180deg, #216bc8, #1453ae);
  box-shadow: 3px 4px 10px rgba(0, 0, 0, 0.22);
  color: #ffffff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  pointer-events: auto;
  transform: translateY(-50%);
  will-change: width, transform;
  transition: width 0.18s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.18s ease;
}

.hideBar span {
  display: block;
  transform: translateX(-2px);
}

.elsie-search {
  position: relative;
  margin: 8px 0 12px;
}

.elsie-search > label {
  display: block;
  margin: 0 0 5px 2px;
  color: #aeb9c5;
  font-size: 11px;
  font-weight: 800;
}

.elsie-search-field {
  position: relative;
}

.elsie-search-field input {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  padding: 0 126px 0 11px;
  border: 1px solid #424a54;
  border-radius: 9px;
  outline: none;
  background: #24272b;
  color: #f1f5f8;
  font: inherit;
  font-size: 12px;
}

.elsie-search-field input:focus {
  border-color: #5d8fc8;
  box-shadow: 0 0 0 2px rgba(59, 123, 195, 0.18);
}

#elsieSearchStatus {
  position: absolute;
  top: 50%;
  right: 38px;
  max-width: 112px;
  overflow: hidden;
  color: #86afd9;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.elsie-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #aeb9c5;
  font: 800 18px/1 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.elsie-search-clear:hover,
.elsie-search-clear:focus-visible {
  background: rgba(86, 144, 211, 0.2);
  color: #fff;
  outline: none;
}

.elsie-search-clear[hidden] { display: none !important; }

.elsie-search-results {
  position: static;
  display: grid;
  gap: 13px;
  margin: 10px 0 12px;
  padding: 10px;
  box-sizing: border-box;
  width: auto;
  border: 1px solid #465568;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(34, 39, 46, 0.98), rgba(24, 28, 33, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 8px 20px rgba(0, 0, 0, 0.18);
}

.elsie-search-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  box-sizing: border-box;
}

.elsie-search-group + .elsie-search-group {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.elsie-search-group h3 {
  margin: 0;
  padding: 0 2px 2px;
  color: #9bb9da;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.elsie-search-results[hidden] { display: none !important; }

.elsie-search-result {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 5px 10px;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid #39424c;
  border-radius: 10px;
  background: rgba(38, 43, 50, 0.94);
  color: #e9eef4;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.elsie-search-result:hover,
.elsie-search-result:focus-visible { border-color: #568bc8; background: #2b3540; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); outline: none; transform: translateY(-1px); }
.elsie-search-result-icon { grid-column: 1; grid-row: 1; align-self: center; width: 18px; height: 18px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.8; }
.elsie-search-result strong { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.35; }
.elsie-search-result span { grid-column: 3; align-self: center; padding: 2px 6px; border-radius: 999px; background: rgba(64, 118, 181, 0.18); color: #9bc8f5; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.elsie-search-result code { grid-column: 2 / -1; overflow: hidden; color: #aebbc9; font: 10px/1.45 Editor-Font, monospace; text-overflow: ellipsis; white-space: nowrap; }
.elsie-search-empty,.elsie-search-results > small { padding: 4px 2px; color: #a7b4c2; font-size: 11px; line-height: 1.5; }

#file.is-search-filtered .dirContent[hidden] { display: none !important; }
#file.is-search-filtered .dirContent.elsie-tree-search-match {
  animation: elsieSearchTreeMatchIn 0.15s ease-out both;
  animation-delay: calc(var(--elsie-tree-index, 0) * 18ms);
  backface-visibility: hidden;
}

@keyframes elsieSearchTreeMatchIn {
  from { opacity: 0; filter: blur(2px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #file.is-search-filtered .dirContent.elsie-tree-search-match { animation: none; }
}
html.liem-reduce-animations #file.is-search-filtered .dirContent.elsie-tree-search-match {
  animation: none;
}

.elsie-clipboard-toast {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 2147483646;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 1px 9px;
  align-items: center;
  min-width: 210px;
  max-width: min(330px, calc(100vw - 36px));
  padding: 10px 13px;
  border: 1px solid #4d5966;
  border-radius: 12px;
  background: #1b1f24;
  color: #edf3f9;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(.97);
  transition: opacity .18s ease, transform .28s cubic-bezier(.16,1,.3,1);
}
.elsie-clipboard-toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.elsie-clipboard-toast.is-caret-anchored { transform: translateY(8px) scale(.97); }
.elsie-clipboard-toast.is-caret-anchored.is-visible { transform: translateY(0) scale(1); }
.elsie-clipboard-toast > span { grid-row: 1 / 3; display:grid; place-items:center; width:28px; height:28px; border:1px solid #607284; border-radius:8px; background:#29313a; color:#d7e8f8; font-size:11px; font-weight:900; }
.elsie-clipboard-toast strong { font-size:12px; line-height:1.25; }
.elsie-clipboard-toast small { color:#97a6b5; font-size:10px; }

.ai-confirm-heading {
  margin-bottom: 14px;
  text-align: center;
}

.ai-confirm-heading h3 {
  margin: 0;
  color: #f5f8fc;
  font-size: 22px;
}

.ai-confirm-heading div {
  margin-top: 5px;
  color: #9ca8b5;
  font-size: 12px;
}

.ai-criteria-card {
  max-height: 38vh;
  margin-bottom: 12px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid #3b444f;
  border-radius: 12px;
  background: #1e2125;
  text-align: left;
}

.ai-criteria-copy {
  color: #edf2f7;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.ai-criteria-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.ai-criteria-images img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid #4a535f;
  border-radius: 9px;
  background: #fff;
}

.ai-resubmit-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(111, 161, 219, 0.3);
  border-radius: 10px;
  background: rgba(49, 92, 143, 0.12);
  color: #b9c8d8;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
}

.ai-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

#ai-result-box .ai-dialog-actions button {
  min-width: 116px !important;
  border-radius: 9px !important;
}

#ai-result-box .ai-dialog-primary {
  border: 1px solid #5b9b68 !important;
  background: #397846 !important;
  color: #fff !important;
}

#ai-result-box .ai-dialog-secondary {
  border: 1px solid #4c5662 !important;
  background: #30363e !important;
  color: #f1f5f8 !important;
}

.elsie-score-history {
  position: fixed;
  inset-block-start: calc(var(--elsie-toolbar-height, 54px) + 0.5rem);
  inset-inline-end: 0.75rem;
  z-index: 99998;
  display: none;
  inline-size: min(25rem, calc(100vi - 1.5rem));
  max-block-size: min(72dvh, calc(100dvh - var(--elsie-toolbar-height, 54px) - 1rem));
  padding: 0.85rem;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #424a54;
  border-radius: 12px;
  background: #1c1f23;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.56);
  font-family: "Quicksand", sans-serif;
}

.elsie-score-history-header,
.elsie-score-history-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.elsie-score-history-header {
  align-items: center;
  margin-block-end: 0.65rem;
  padding-block-end: 0.55rem;
  border-block-end: 1px solid #383f48;
}

.elsie-score-history-title { color: #edf3fa; font-size: 0.82rem; font-weight: 800; line-height: 1.2; }
.elsie-score-history-close,
.elsie-score-history-action,
.elsie-score-history-panel-link {
  min-block-size: 1.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid #4b6483;
  border-radius: 0.4rem;
  background: transparent;
  color: #a9c7e8;
  font: 800 0.7rem/1.2 "Quicksand", sans-serif;
  cursor: pointer;
}

.elsie-score-history-close { border-color: #48515c; color: #d2d8df; }
.elsie-score-history-close:hover,
.elsie-score-history-close:focus-visible { background: #30343a; }
.elsie-score-history-action:hover,
.elsie-score-history-action:focus-visible,
.elsie-score-history-panel-link:hover,
.elsie-score-history-panel-link:focus-visible { background: rgba(0, 191, 255, 0.1); border-color: #00bfff; color: #d8eeff; outline: none; }

.elsie-score-history-card {
  margin-block-end: 0.5rem;
  padding: 0.68rem 0.72rem;
  border: 1px solid #343a41;
  border-inline-start: 4px solid #5d6670;
  border-radius: 0.6rem;
  background: #222427;
}

.elsie-score-history-card.is-current {
  border-inline-start-color: #67be70;
  background: #222825;
  box-shadow: none;
}

.elsie-score-history-details { min-inline-size: 0; }
.elsie-score-history-date { margin-block-end: 0.16rem; color: #c7d0da; font-size: 0.74rem; }
.elsie-score-history-attempt { color: #929ca8; font-size: 0.67rem; }
.elsie-score-history-card.is-current .elsie-score-history-attempt { color: #9fcea5; font-weight: 800; }
.elsie-score-history-score { min-inline-size: 3.25rem; padding: 0.22rem 0.42rem; border: 1px solid #4a535d; border-radius: 0.38rem; background: #2a2e33; font-size: 0.84rem; font-weight: 800; text-align: center; white-space: nowrap; }
.elsie-score-history-score.is-good { border-color: #69a66e; background: rgba(82, 150, 89, 0.16); }
.elsie-score-history-score.is-warning { border-color: #b89b54; background: rgba(184, 155, 84, 0.14); }
.elsie-score-history-score.is-low { border-color: #be665b; background: rgba(190, 102, 91, 0.15); }
.elsie-score-history-score.is-pending { color: #b8c0ca; }
.elsie-score-history-actions,
.elsie-score-history-reveal-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.elsie-score-history-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem; margin-block-start: 0.58rem; }
.elsie-score-history-current { border-color: #5f8264; color: #c9e7cc; }
.elsie-score-history-current.is-current { background: rgba(82, 150, 89, 0.16); cursor: default; }
.elsie-score-history-feedback,
.elsie-score-history-code { display: none; margin-block-start: 0.55rem; padding: 0.68rem; border: 1px solid #3b4148; border-radius: 0.5rem; background: #1d2024; color: #d9dee5; font-size: 0.77rem; line-height: 1.55; }
.elsie-score-history-feedback-heading { display: block; margin-block-end: 0.38rem; color: #c7d0da; font-size: 0.74rem; }
.elsie-score-history-code { overflow-x: auto; background: #17191c; color: #c9d3dd; font-family: Editor-Font, monospace; white-space: pre-wrap; }
.elsie-score-history-empty { margin-block-start: 0.4rem; color: #858d96; font-size: 0.7rem; font-style: italic; }
.elsie-score-history-panel-link { display: inline-flex; align-items: center; justify-content: center; margin-block-start: 0.15rem; }

.hideBar .hideBarLabel {
  display: none;
}

.hideBar:hover {
  width: 28px !important;
  background: linear-gradient(180deg, #2b78d7, #175bbe);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.28);
}

.hideBar:focus-visible {
  outline: 3px solid rgba(151, 191, 255, 0.95);
  outline-offset: 3px;
}

.hideBar.is-collapsed {
  left: 0;
}

#undoDeleteButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #1053ab;
}

#undoDeleteButton.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(35%);
}

#ai-result-box button,
#ai-result-box input[type="button"] {
  width: auto !important;
  min-width: 96px;
  max-width: 100%;
  min-height: 38px;
  height: auto !important;
  padding: 9px 16px !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  box-sizing: border-box !important;
}

.ai-feedback-list {
  margin: 8px 0 0 20px;
  padding: 0;
}

.ai-feedback-list .ai-feedback-list {
  margin-top: 4px;
  margin-left: 22px;
}

.ai-feedback-list li {
  margin-bottom: 5px;
  line-height: 1.45;
}

.ai-feedback-list .ai-subbullet {
  list-style-type: circle;
}

@media (max-width: 700px) {
  .sidebarleft {
    width: var(--elsie-sidebar-inline-size);
    padding-left: 14px;
  }

  .filemanagerfunction {
    gap: 6px;
  }

  .filemanagerfunction input {
    min-width: 72px;
    padding: 0 8px;
  }

  #ai-result-box {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 24px) !important;
    padding: 18px !important;
  }
}

@media only screen and (max-width: 900px) {
  html,
  body {
    overflow: auto !important;
    min-width: 0;
  }

  .toolbar {
    height: auto;
    min-height: 48px;
    padding: 6px;
    gap: 6px;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
  }

  .toolbar > #editor-return-link {
    flex: 0 0 auto;
  }

  .toolbar .homebtn {
    position: static;
    flex: 0 0 auto;
    min-width: 42px;
    height: 32px;
    padding: 0 9px;
  }

  .elsie-compact-nav {
    position: static;
    order: 1;
    flex: 0 0 auto;
    min-width: 0;
    width: max-content;
    max-width: 100%;
    justify-content: flex-start;
  }

  .elsie-compact-nav span {
    max-width: 72px;
    opacity: 1;
  }

  .toolbar .headertxt {
    position: static;
    transform: none;
    flex: 1 1 9rem;
    font-size: clamp(18px, 7vw, 26px);
    text-align: center;
    margin: 0;
  }

  .toolbar .menubar {
    flex: 1 1 16rem;
    width: auto;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    margin-left: 0;
  }

  #topScoreWidgetContainer {
    display: flex !important;
    flex: 1 1 12rem;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    margin-right: 0 !important;
  }

  .toolbar .menubar .btn {
    width: auto;
    min-width: 76px;
    height: auto;
    min-height: 34px;
    margin-right: 0;
    padding: 0 10px;
    white-space: normal;
  }

  .etc input[type="button"],
  .etc .editor-side-action,
  .filemanagerfunction input[type="button"],
  #undoDeleteButton {
    min-height: 34px;
    min-width: 76px;
    padding: 0 10px;
  }

  .backbut,
  .dirContent {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    height: auto;
    overflow-wrap: anywhere;
  }

  .view-tiles,
  #file {
    margin-left: 0;
    padding-left: 0;
  }

  .view-tiles li,
  .view-tiles li .name {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@-webkit-keyframes fadein {
  from {
    transform: translate(-24px, -10px);
    opacity: 0;
  }

  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    transform: translate(-24px, -10px);
    opacity: 0;
  }

  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}

@-webkit-keyframes fadeout {
  from {
    transform: translate(0, 0);
    opacity: 1;
  }

  to {
    transform: translate(-14px, -8px);
    opacity: 0;
  }
}

@keyframes fadeout {
  from {
    transform: translate(0, 0);
    opacity: 1;
  }

  to {
    transform: translate(-14px, -8px);
    opacity: 0;
  }
}

@keyframes shift-left {
  0%,
  100% {
    transform: translateX(0%);
  }

  50% {
    transform: scale(0.65) translateX(-75%);
  }
}

@keyframes shift-right {
  0%,
  100% {
    transform: translateX(0%);
  }

  50% {
    transform: scale(0.65) translateX(75%);
  }
}

::-webkit-scrollbar {
  width: 12px;
  background: rgba(121, 121, 121, 0);
  height: 12px;
}

::-webkit-scrollbar:hover {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-thumb {
  background: #63636396;
  border-radius: 10px;

  border-right: 2px solid transparent;
  border-left: 2px solid transparent;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #83838396;
  border-radius: 10px;
}

::-webkit-scrollbar-track-piece {
  display: none;
}

::-webkit-scrollbar-corner {
  display: none;
}

@media only screen and (max-width: 900px) {
  html {
    overflow: auto !important;
  }

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .toolbar {
    height: auto;
    min-height: 54px;
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    box-sizing: border-box;
  }

  .toolbar .homebtn {
    position: static;
    flex: 0 0 auto;
  }

  .elsie-compact-nav {
    position: static;
    order: 1;
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .elsie-compact-nav span {
    max-width: 72px;
    opacity: 1;
  }

  .toolbar .headertxt {
    order: 2;
    flex: 0 0 auto;
    font-size: clamp(22px, 7vw, 30px);
    text-align: center;
  }

  .toolbar .menubar {
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    margin: 0;
    gap: 6px;
  }

  .toolbar .menubar .btn {
    margin-right: 0;
    min-width: 74px;
    width: auto;
    padding: 0 10px;
  }

  .content {
    height: calc(100dvh - var(--elsie-toolbar-height, 104px));
  }

  .sidebarleft {
    width: var(--elsie-sidebar-inline-size);
    height: 100%;
    padding-left: 14px;
    box-sizing: border-box;
  }

  .main {
    margin-left: var(--elsie-sidebar-inline-size);
    height: 100%;
  }

  .filemanagerfunction,
  .etc {
    flex-wrap: wrap;
  }
}

@media only screen and (max-width: 360px), only screen and (max-height: 360px) {
  html,
  body {
    min-width: 0;
    overflow: auto !important;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  .toolbar {
    min-height: 44px;
    padding: 5px;
    gap: 5px;
  }

  .toolbar .homebtn {
    width: auto;
    min-width: 42px;
    height: 30px;
    padding: 0 7px;
    font-size: 11px;
  }

  .toolbar .homebtn span {
    display: none;
  }

  .elsie-compact-nav {
    flex: 1 1 auto;
    gap: 0;
    padding: 2px;
  }

  .elsie-compact-nav a {
    min-width: 30px;
    height: 28px;
    padding: 0 6px;
    font-size: 10px;
  }

  .elsie-compact-nav span {
    display: none;
  }

  .toolbar .headertxt {
    flex: 1 1 auto;
    order: 0;
    font-size: clamp(14px, 7vw, 20px);
    overflow-wrap: anywhere;
  }

  .toolbar .menubar {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .toolbar .menubar .btn {
    min-width: 0;
    height: 30px;
    padding: 0 7px;
    font-size: 11px;
  }

  .content {
    position: relative;
    height: auto;
    min-height: calc(100dvh - 44px);
    overflow: visible;
  }

  .sidebarleft {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 46dvh;
    padding: 8px 8px 16px;
  }

  .main {
    margin-left: 0;
    height: 54dvh;
    min-height: 150px;
  }

  .agwrapper {
    padding: 6px;
    border-width: 2px;
  }

  .etc,
  .filemanagerfunction {
    gap: 5px;
  }

  .etc input[type="button"],
  .etc button,
  .filemanagerfunction input,
  #undoDeleteButton,
  #ai-result-box button,
  #ai-result-box input[type="button"] {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 30px;
    padding: 6px 9px !important;
    font-size: 11px;
    white-space: normal !important;
  }

  .backbut,
  .dirContent {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 32px;
    font-size: 15px;
    padding-left: 4px;
    overflow-wrap: anywhere;
  }

  .dirContent img {
    margin-left: 4px;
    margin-right: 5px;
  }

  .currentdir h3 {
    font-size: 14px;
  }

  #snackbar {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    min-width: 0;
    width: auto;
    margin-left: 0;
    padding: 10px;
    font-size: 12px;
  }

  .checker_wrapper {
    position: relative;
    max-height: none;
    overflow: auto;
  }

  .desc,
  .frame_wrapper {
    float: none;
    width: 100%;
    height: auto;
    max-height: 35dvh;
  }

  #ai-result-box {
    inset: 4px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 8px) !important;
    padding: 10px !important;
    overflow: auto !important;
  }

  .elsie-collab-presence {
    top: calc(env(safe-area-inset-top, 0px) + 46px);
    left: 8px;
    right: 8px;
    max-width: none;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media only screen and (max-width: 620px) {
  .content {
    position: relative !important;
    height: auto !important;
    min-height: calc(100dvh - 100px) !important;
    overflow: visible !important;
  }

  .sidebarleft {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    flex: 1 1 auto;
    padding: 9px 10px 14px !important;
    border-bottom: 1px solid #292929;
    transform: translateY(0);
    transition:
      max-height 0.15s ease-out,
      padding 0.15s ease-out,
      transform 0.15s ease-out,
      visibility 0s linear 0s;
  }

  .sidebarleft.is-collapsed {
    display: block !important;
    max-height: 0 !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom-color: transparent;
    transform: translateY(-10px);
    overflow: hidden !important;
    visibility: hidden;
    pointer-events: none;
    transition:
      max-height 0.15s ease-out,
      padding 0.15s ease-out,
      transform 0.15s ease-out,
      visibility 0s linear 0.24s;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    height: 58dvh !important;
    min-height: 260px !important;
  }

  .content.sidebar-is-collapsed .main {
    height: 100% !important;
  }

  .hideBar {
    display: inline-flex !important;
    position: absolute !important;
    top: auto !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 80px !important;
    height: 24px !important;
    border-radius: 12px 12px 0 0 !important;
    border: 1px solid rgba(112, 173, 255, 0.54) !important;
    border-bottom: 0 !important;
    z-index: 10002 !important;
  }

  .content:not(.sidebar-is-collapsed) .hideBar {
    /* When sidebar is visible, attach toggle to the bottom of the sidebar */
    position: relative !important;
    margin-top: -16px;
    margin-bottom: 0;
    bottom: auto !important;
    border-radius: 0 0 12px 12px !important;
    border-bottom: 1px solid rgba(112, 173, 255, 0.54) !important;
    border-top: 0 !important;
  }

  .hideBar span {
    transform: rotate(90deg) !important;
  }
  .hideBar.is-collapsed span {
    transform: rotate(-90deg) !important;
  }
}


/* Keep phone navigation readable and put the folder toggle at the split. */
@media only screen and (max-width: 620px) {
  html,
  body {
    inline-size: 100%;
    max-inline-size: 100%;
    overflow-x: clip !important;
  }

  .toolbar {
    inline-size: 100%;
    max-inline-size: 100%;
    padding-inline: clamp(0.35rem, 2vi, 0.625rem);
    flex-wrap: wrap;
    overflow: hidden;
  }
  .toolbar > #editor-return-link,
  .toolbar .elsie-compact-nav { order: 1; }
  .toolbar .headertxt {
    order: 2;
    flex: 1 0 100%;
    inline-size: 100%;
  }
  .toolbar .elsie-compact-nav {
    flex: 0 1 auto;
    min-inline-size: 0;
    max-inline-size: calc(100% - 5.5rem);
  }
  .toolbar .elsie-compact-nav span {
    display: none;
  }
  .toolbar .elsie-compact-nav a {
    width: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
  }
  .toolbar .headertxt {
    font-size: clamp(18px, 6vw, 26px);
  }
  .toolbar .menubar {
    flex: 1 0 100%;
    order: 3;
    flex-wrap: wrap;
    justify-content: flex-start;
    inline-size: 100%;
    max-inline-size: 100%;
    overflow: visible;
  }
  .elsie-draft-status {
    flex: 1 1 9rem;
    max-width: 100%;
    min-height: 30px;
    margin-right: 0;
  }
  .toolbar .menubar .btn {
    flex: 1 1 4.5rem;
    min-inline-size: 0;
    max-inline-size: 100%;
  }
  .content {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--elsie-toolbar-height, 54px)) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #1e1e1e;
  }
  .sidebarleft {
    order: 0;
    flex: 1 1 auto;
    inline-size: 100% !important;
    max-inline-size: 100%;
    min-height: 0;
    box-sizing: border-box;
  }
  .content .hideBar,
  .content:not(.sidebar-is-collapsed) .hideBar {
    order: 1;
    flex: 0 0 0;
    align-self: center;
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    width: 72px !important;
    height: 28px !important;
    margin: 0 !important;
    transform: none !important;
    border: 1px solid rgba(112, 173, 255, 0.54) !important;
    border-top: 0 !important;
    border-radius: 0 0 12px 12px !important;
    background: linear-gradient(180deg, #216bc8, #1453ae);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.24);
    color: #fff;
    font-size: 18px;
  }
  .content .hideBar:hover {
    width: 72px !important;
    background: linear-gradient(180deg, #2b78d7, #175bbe);
  }
  .content .hideBar .hideBarIcon {
    display: block;
    transform: rotate(90deg) !important;
  }
  .content .hideBar.is-collapsed .hideBarIcon {
    transform: rotate(-90deg) !important;
  }
  .content .hideBar .hideBarLabel {
    display: none;
  }
  .content .main {
    order: 2;
    flex: 0 0 min(32dvh, 18rem);
    height: auto !important;
    min-height: min(12rem, 32dvh) !important;
    background: #181818;
  }

  .content:not(.sidebar-is-collapsed) .main {
    flex-basis: min(32dvh, 18rem);
    min-height: 0 !important;
  }

  .sidebarleft #file {
    margin-bottom: 18px;
  }

  .elsie-score-history {
    inset-inline: 0.5rem;
    inline-size: auto;
    max-block-size: calc(100dvh - var(--elsie-toolbar-height, 54px) - 1rem);
  }
}

@keyframes elsieTreeRowIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

#file .dirContent.elsie-tree-row-pending {
  visibility: hidden;
}

#file.elsie-tree-updated .dirContent.elsie-tree-row-pending {
  visibility: visible;
  animation: elsieTreeRowIn 0.15s ease-out both;
  animation-delay: min(calc(var(--elsie-tree-index, 0) * 12ms), 96ms);
}

html.liem-reduce-animations .sidebarleft,
html.liem-reduce-animations .main,
body.liem-reduce-animations .sidebarleft,
body.liem-reduce-animations .main {
  transition: none !important;
}

html.liem-reduce-animations #file .dirContent.elsie-tree-row-pending,
body.liem-reduce-animations #file .dirContent.elsie-tree-row-pending {
  visibility: visible;
}

html.elsie-is-resizing .sidebarleft,
html.elsie-is-resizing .main,
html.elsie-is-resizing .content,
html.elsie-is-resizing .elsie-compact-nav,
html.elsie-is-resizing .hideBar {
  transition: none !important;
}

.elsie-location-picker-bar { position: fixed; bottom: 12px; right: 12px; z-index: 2147483645; display: flex; gap: 10px; padding: 10px; background: #242424; border: 1px solid #555; border-radius: 10px; box-shadow: 0 5px 20px #0008; }
.elsie-location-picker-bar .btn { width: auto; min-width: 130px; }
.elsie-picker-mode #home { pointer-events: none; }
.elsie-test-file-picker-bar { left:12px;align-items:center;justify-content:space-between;color:#dbeaff;font-weight:800;background:#20252b;border-color:#456b9f;box-shadow:0 8px 28px #000a; }
.elsie-test-file-picker-bar .btn { background:#2f6bd2;border:1px solid #5b94e9;color:#fff; }
.elsie-test-file-picker-bar span { padding:0 6px; }
@media (max-width: 620px) {
  .elsie-test-file-picker-bar { flex-wrap:wrap;bottom:max(8px, env(safe-area-inset-bottom)); }
  .elsie-test-file-picker-bar span { flex:1 1 100%;padding:0 2px; }
  .elsie-test-file-picker-bar .btn { width:100%; }
}
#elsieSharedFolder { margin: 8px 0 14px; border: 1px solid #454b52; border-radius: 10px; padding: 7px; color: #ddd; background:#1d2024; }
#elsieSharedFolder summary { display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;cursor:pointer;font-weight:750;padding:8px;color:#dce7f2;list-style:none; }
#elsieSharedFolder summary small { grid-column:2;color:#8794a2;font-size:9px;font-weight:700;white-space:normal; }
#elsieSharedFolder summary::after { content:"+";display:grid;place-items:center;width:20px;height:20px;border-radius:6px;background:#292e34;color:#aeb9c5; }
#elsieSharedFolder[open] summary::after { content:"−"; }
#elsieSharedFolder summary::-webkit-details-marker { display:none; }
.elsie-shared-folder-icon { grid-row:1 / span 2;width:18px;height:18px;flex:0 0 auto;background:#a8b8c9;mask:url('/imgs/svgs/solid/folder.svg') center / contain no-repeat;-webkit-mask:url('/imgs/svgs/solid/folder.svg') center / contain no-repeat; }
#elsieSharedFolder button { font-size: 13px; overflow-wrap: anywhere; text-align: left; }
#elsieCollabRecovery { margin: 10px; border: 1px solid #d49b43; border-radius: 8px; padding: 10px; font: 13px/1.5 Arial,sans-serif; color: #eee; }
#elsieCollabRecovery textarea { box-sizing: border-box; width: 100%; min-height: 100px; margin-top: 8px; color: #eee; background: #292929; border: 1px solid #555; }

/* Search must leave the current folder and editor reachable on short screens. */
#elsieSearchResults { max-height: min(34vh, 280px); overflow-y: auto; overscroll-behavior: contain; flex: 0 1 auto; }
#elsieSearchResults .elsie-search-result { padding: 5px 7px; gap: 3px 6px; }
#elsieSearchResults .elsie-search-result-icon { width: 16px; height: 16px; filter: none; }

.elsie-collab-cursor span { pointer-events: auto; cursor: help; }
#editor1 .ace_cursor { color: #fff; border-left-color: #fff; }

/* Preserve the destination names on touch devices, where hover-only labels
   cannot be discovered. The three links still fit beside the compact Home. */
@media (hover: none) and (pointer: coarse) and (max-width: 620px) {
  .toolbar .elsie-compact-nav {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .toolbar .elsie-compact-nav::-webkit-scrollbar { display: none; }
  .toolbar .elsie-compact-nav a,
  .toolbar .elsie-compact-nav a:hover,
  .toolbar .elsie-compact-nav a:focus-visible {
    width: auto;
    min-width: 34px;
    padding-inline: 6px;
  }
  .toolbar .elsie-compact-nav span,
  .toolbar .elsie-compact-nav a:hover span,
  .toolbar .elsie-compact-nav a:focus-visible span {
    display: inline;
    max-width: 72px;
    margin-left: 4px;
    opacity: 1;
  }
}
