* {
  box-sizing: border-box;
  transition: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #ffffff;
  color: #000000;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.2px;
  overflow: hidden;
}

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

#app {
  height: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  height: 40px;
  border-bottom: 1px solid #000;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  z-index: 10;
}

.desk-menu {
  position: absolute;
  top: 30px;
  right: 12px;
  width: 220px;
  background: #fff;
  border: 1px solid #000;
  z-index: 30;
}

.desk-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #000;
  cursor: pointer;
}

.desk-menu-item:last-child {
  border-bottom: none;
}

.desk-menu-item:hover,
.desk-menu-item.active {
  background: #000;
  color: #fff;
}

.desk-menu-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-menu-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.desk-delete-glyph {
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.desk-menu-item:hover .desk-delete-glyph {
  color: #fff;
}

.desk-delete-glyph:hover {
  color: #ff0000 !important;
}

.desk-menu-item-create {
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.desk-rename-btn {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
}

#desk-switcher-btn {
  cursor: pointer;
}

#walkthrough-btn {
  margin-left: 8px;
  border: 1px solid #000;
  background: #fff;
  font-size: 11px;
  padding: 0 4px;
  cursor: pointer;
}

#walkthrough-btn:hover {
  background: #000;
  color: #fff;
}

.hidden {
  display: none;
}

#drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.04);
  border: 2px dashed #000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 999;
  font-size: 12px;
}

.support-card {
  position: fixed;
  right: 10px;
  bottom: 51px;
  width: 200px;
  border: 1px solid #000;
  background: #fff;
  padding: 8px;
  font-size: 11px;
  line-height: 1.4;
  z-index: 100;
}

.support-title {
  margin-bottom: 4px;
}

.support-copy {
  opacity: 0.85;
}

.support-btn {
  margin-top: 6px;
  border: 1px solid #000;
  background: #fff;
  padding: 2px 6px;
  cursor: pointer;
}

.support-btn:hover {
  background: #000;
  color: #fff;
}

.support-dismiss {
  margin-top: 4px;
  font-size: 9px;
  opacity: 0.5;
  cursor: pointer;
}

.support-dismiss:hover {
  opacity: 0.9;
}

#card-test-panel {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 170px;
  border: 1px solid #000;
  background: #fff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 200;
  font-size: 10px;
}

.card-test-title {
  font-size: 10px;
}

#card-test-panel button {
  border: 1px solid #000;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
  text-align: left;
}

#card-test-panel button:hover {
  background: #000;
  color: #fff;
}

.view {
  display: block;
  height: 100%;
  margin-top: 0;
  padding: 0;
}

.view.hidden {
  display: none !important;
}

#shelf-view,
#furnace-view {
  width: 100%;
  height: 100%;
}

#shelf-view {
  padding: 12px;
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shelf-header {
  border: 1px solid #000000;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.shelf-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.frag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
}

.frag-card {
  border: 1px solid #000000;
  padding: 8px;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: #fff;
  position: relative;
}

button:hover,
.frag-card:hover,
.file-item:hover,
.sidebar-item:hover,
.file-action:hover {
  background: #000000;
  color: #ffffff;
}

.new-btn {
  width: auto;
  height: 100px;
  min-height: 100px;
  padding: 8px;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.card-name {
  font-size: 11px;
  word-break: break-word;
}

.card-tag {
  font-size: 10px;
}

.meatmark {
  position: absolute;
  top: 5px;
  right: 4px;
  font-size: 12px;
  line-height: 1;
}

.doc-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  border-top: 1px solid #000;
  background: #fff;
  padding: 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  z-index: 20;
}

.doc-footer .left-tag {
  border: 1px solid #000;
  padding: 2px 8px;
}

.doc-footer .footer-auth {
  display: flex;
  align-items: center;
  position: relative;
}

.doc-footer #auth-entry {
  cursor: pointer;
}

.doc-footer .sync-indicator {
  margin-left: 6px;
  font-size: 10px;
  color: #0057ff;
}

.auth-card {
  position: absolute;
  bottom: 25px;
  left: 0;
  width: 180px;
  border: 1px solid #000;
  background: #fff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
  padding-bottom: 18px;
}

.auth-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.auth-email {
  font-size: 10px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.auth-user-mark {
  font-size: 10px;
  opacity: 0.7;
  flex-shrink: 0;
}

.auth-title {
  font-size: 11px;
}

.auth-stats {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.auth-verify {
  font-size: 8px;
  color: #c00;
  cursor: pointer;
  opacity: 0.85;
  white-space: nowrap;
}

.auth-bar {
  height: 2px;
  background: #ddd;
}

#auth-bar-fill {
  height: 100%;
  width: 0;
  background: #000;
}

.auth-toggle {
  font-size: 10px;
  cursor: pointer;
}

.auth-mini-actions {
  position: absolute;
  right: 6px;
  bottom: 4px;
  display: flex;
  gap: 6px;
}

.auth-mini-btn {
  font-size: 11px;
  cursor: pointer;
  opacity: 0.6;
  user-select: none;
}

.auth-mini-btn:hover {
  opacity: 1;
}

.doc-footer .left-tag:hover {
  color: #ff0000;
  text-decoration: underline;
}

.doc-footer .locks {
  display: flex;
  gap: 4px;
}

@media (max-width: 768px) {
  .doc-footer {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease !important;
  }

  body.mobile-footer-visible .doc-footer {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

.furnace-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  height: calc(100vh - 24px);
  padding: 12px;
  min-width: 0;
  min-height: 0;
}

.left-main {
  min-width: 0;
  min-height: 0;
  position: relative;
}

.projector-wrapper {
  border: 1px solid #000;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

.projector-header-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #000;
  background: #000;
  color: #fff;
}

.back-inline {
  border: none;
  background: transparent;
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
}

.back-inline:hover {
  background: #fff;
  color: #000;
}

.projector-title {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  min-width: 0;
}

.projector-title-prefix {
  flex-shrink: 0;
  white-space: nowrap;
}

.projector-title-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projector-rename-input {
  flex: 1;
  min-width: 0;
}

@media (min-width: 1025px) {
  .projector-title {
    cursor: pointer;
  }
}

.projector-rename-btn {
  margin-right: 6px;
}

#projector-walkthrough-btn {
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  font-size: 11px;
  padding: 0 6px;
  margin-right: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

#projector-walkthrough-btn:hover {
  background: #fff;
  color: #000;
}

@media (min-width: 1025px) {
  .projector-rename-btn {
    display: none;
  }
}

#furnace-view {
  position: relative;
  margin-top: 0;
  height: 100vh;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workspace {
  width: min(100%, 1100px);
  max-width: 1100px;
  max-height: 900px;
  height: min(100%, 900px);
  margin: 0;
  display: flex;
  flex-direction: column;
}

.projector-body {
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  min-width: 0;
  height: 100%;
  overflow: auto;
  overflow-wrap: normal;
  word-break: normal;
}

.projector-view {
  border: none;
  min-width: 0;
  white-space: pre-wrap;
  outline: none;
  flex: 1;
}

.bottom-panel {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 200px;
  height: 100px;
  border: none;
  background: rgba(32, 32, 32, 0.1);
  padding: 6px;
  font-size: 10px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 4px;
  min-height: 0;
  backdrop-filter: blur(8px) saturate(50%);
  -webkit-backdrop-filter: blur(8px) saturate(50%);
}

.aux-modules {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.aux-module-line {
  width: fit-content;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
}

.aux-module-line:hover {
  text-decoration: underline;
}

.aux-module-line.is-enabled {
  color: #ea00ff;
}

.aux-terminal-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 14px;
}

.aux-prompt {
  font-size: 10px;
  line-height: 1;
}

.aux-input {
  border: none;
  background: transparent;
  color: #000;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  outline: none;
  width: 120px;
}

.aux-tail-cursor {
  font-size: 10px;
  line-height: 1;
}

.bottom-panel.has-text .aux-tail-cursor {
  display: none;
}

.aux-mobile-toggle {
  display: block;
  position: absolute;
  left: 4px;
  bottom: 4px;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 10px;
  cursor: pointer;
}

.bottom-panel {
  padding-bottom: 18px;
}

.bottom-panel.aux-collapsed {
  width: 56px;
  height: 24px;
  padding: 4px;
  display: block;
}

.bottom-panel.aux-collapsed .aux-modules,
.bottom-panel.aux-collapsed .aux-terminal-line {
  display: none;
}

.right-panel {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.raw-section,
.drawer-section {
  border: 1px solid #000000;
  padding: 10px;
  display: flex;
  min-width: 0;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.raw-section {
  position: relative;
}

.raw-box {
  border: 1px solid #000;
  padding: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.raw-section label,
.drawer-title {
  font-size: 11px;
  margin-bottom: 0;
  line-height: 1.1;
}

.raw-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.fake-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1.0em;
  background: #000;
  animation: fake-cursor-blink 1s infinite;
  pointer-events: none;
}

@keyframes fake-cursor-blink {
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}

#raw-input {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  resize: none;
  border: none;
  padding: 0;
  font-size: 11px;
  line-height: 1.2;
  outline: none;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.corner-action {
  position: absolute;
  right: 4px;
  bottom: 4px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  padding: 1px 6px;
  font-size: 11px;
  cursor: pointer;
}

.raw-clear-btn {
  right: 49px;
}

.corner-action.copy-success {
  background: #000;
  color: #fff;
  border-color: #000;
}

.file-list {
  border: none;
  margin-top: 0;
}

.drawer-list {
  overflow: auto;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.drawer-section {
  padding: 4px;
}

.drawer-upload-bar {
  margin-top: 4px;
  border-top: 1px solid #000;
  display: flex;
  align-items: center;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  flex-shrink: 0;
  padding: 2px 0;
  cursor: pointer;
}

.upload-filename {
  flex: 1;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  opacity: 0.6;
}

.upload-confirm {
  border-left: 1px solid #000;
  border-top: none;
  border-right: none;
  border-bottom: none;
  background: transparent;
  color: inherit;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0.35;
}

.upload-confirm:disabled {
  cursor: not-allowed;
}

.upload-confirm.enabled {
  opacity: 1;
  transform: scale(1.05);
}

.upload-confirm:hover {
  background: transparent;
  color: inherit;
}

.upload-confirm.flash {
  transform: scale(1.12);
}

.drawer-upload-bar:hover {
  background: #f5f5f5;
}

.hidden-file-input {
  display: none;
}

.file-item {
  padding: 6px 8px;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.file-item:last-child {
  border-bottom: none;
}

.file-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.file-delete-glyph {
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.file-item:hover .file-actions {
  display: flex;
}

.file-action {
  border: 1px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  min-width: 18px;
  text-align: center;
}

.file-action:hover {
  background: #000;
  color: #fff;
}

.file-action-delete:hover {
  background: #000;
  color: #fff;
}

.drawer-rename-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: #fff36b;
  color: #ff0000;
  font-size: 12px;
  line-height: 1.1;
  padding: 0 2px;
  outline: none;
}

@media (min-width: 1025px) {
  .file-item:hover .file-delete-glyph {
    color: #fff;
  }

  .file-delete-glyph:hover {
    color: #ff0000 !important;
  }
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  border-top: 1px solid #000;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
}

@media (max-width: 768px) {
  .workspace {
    max-width: 100%;
    margin: 0;
  }

  .furnace-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 0.9fr 290px;
    height: 100vh;
    gap: 12px;
  }

  .right-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: 100%;
  }

  .raw-section,
  .drawer-section {
    height: 100%;
    overflow: auto;
  }

}
