* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Cantarell", "Segoe UI", "Noto Sans", sans-serif;
  color: #2e3436;
  background: #f2f2f2;

}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: transparent;
  opacity: 0;
}

.screen {
  width: 100%;
  border: 1px solid #c9c9c9;
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 700px;
  overflow: hidden;
  padding-top: 24px;
  padding-bottom: 24px;
}

.menubar {
  display: flex;
  background: #f6f6f6;
  border-bottom: 1px solid #d6d6d6;
  padding: 0;
  height: 24px;
  align-items: stretch;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
}

.menu-button {
  background: #f6f6f6;
  border: none;
  color: #2e3436;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-family: "Cantarell", "Segoe UI", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.1s ease;
  border-right: 1px solid #dddddd;
  white-space: nowrap;
}

.menu-button:hover {
  background: #ececec;
  color: #1f2426;
}

.menu-button:active,
.menu-button.active {
  background: #e2e2e2;
  color: #1f2426;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dropdown-menu {
  position: absolute;
  top: 24px;
  left: 0;
  background: #ffffff;
  border: 1px solid #cfcfcf;
  border-top: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  min-width: 150px;
  z-index: 1000;
  display: none;
}

.dropdown-menu[aria-hidden="false"] {
  display: flex;
  flex-direction: column;
}

.menu-entry {
  padding: 0.4rem 0.8rem;
  color: #2e3436;
  font-size: 0.78rem;
  font-family: "Cantarell", "Segoe UI", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: all 0.1s ease;
  white-space: nowrap;
}

.menu-entry:hover {
  background: #eaeaea;
  color: #1f2426;
}

.menu-separator {
  height: 1px;
  background: #d7d7d7;
  margin: 0.2rem 0;
}

.editor-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #d6d6d6;
}

.editor-content {
  padding: 0;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #b9b9b9 #f3f3f3;
  background: #ffffff;
}

.line {
  font-size: 1rem;
  line-height: 2.2;
  color: #2e3436;
  white-space: normal;
  min-height: 2.2em;
  gap: 0.5rem;
  display: flex;
  align-items: stretch;
  margin: 0;
  
}

.line-num {
  color: #7b7b7b;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  text-align: center;
  min-width: 50px;
  user-select: none;
  border-right: 1px solid #e3e3e3;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  font-weight: 400;
  padding: 0 0.75rem;
}

.line.empty {
  min-height: 1.6em;
}

.comment {
  color: #8b6f47;
  font-style: italic;
}

.link-item {
  color: #1b63b6;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  font-weight: 600;
  border-bottom: 1px dotted rgba(27, 99, 182, 0.45);
}

.link-item:hover {
  color: #134a89;
  border-bottom: 1px dotted #134a89;
  text-shadow: none;
}

.link-item::after {
  content: " ↗";
  font-size: 0.7em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.link-item:hover::after {
  opacity: 0.8;
}

.text {
  color: #4b5254;
  flex: 1;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  padding: 0 0.75rem;
  background: #f6f6f6;
  border-top: 1px solid #d6d6d6;
  font-size: 0.72rem;
  color: #5f6668;
  border-bottom: 1px solid #c9c9c9;
  border-right: 1px solid #c9c9c9;
  font-family: "Cantarell", "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
}

.status-item {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.5rem;
  border-right: 1px solid #dddddd;
}

.status-item:first-child {
  flex: 1;
}

.status-item:last-child {
  border-right: none;
}

@media (max-width: 900px) {
  .line {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .line {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .line {
    font-size: 0.85rem;
    gap: 0.3rem;
    line-height: 2;
  }

  .text {
    font-size: 0.8rem;
  }
}

