.entry-panel-window {
  position: fixed;
  display: none;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 10px;
  width: 580px;
  max-width: calc(100vw - 24px);
  height: 469px;
  max-height: calc(100vh - 24px);
  min-width: 320px;
  min-height: 220px;
  border: none;
  outline: 1px solid rgba(170, 178, 194, 0.06);
  box-shadow:
    0 0 0 1px rgba(24, 28, 36, 0.72),
    0 14px 60px rgba(0, 0, 0, 0.9),
    inset 0 0 120px rgba(148, 160, 186, 0.04);
  z-index: 111;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(10, 12, 18, 0.22) 2px, rgba(10, 12, 18, 0.22) 3px),
    linear-gradient(to left, rgba(188, 198, 220, 0.06) 0%, rgba(188, 198, 220, 0.02) 60%, transparent 100%),
    linear-gradient(to bottom, rgba(188, 198, 220, 0.06) 0%, rgba(188, 198, 220, 0.02) 60%, transparent 100%),
    linear-gradient(to right, rgba(188, 198, 220, 0.06) 0%, rgba(188, 198, 220, 0.02) 60%, transparent 100%),
    linear-gradient(to top, rgba(188, 198, 220, 0.06) 0%, rgba(188, 198, 220, 0.02) 60%, transparent 100%);
  background-color: rgba(9, 12, 18, 0.985);
  background-size:
    100% var(--scanline-gap),
    var(--corner-size) 1px,
    1px var(--corner-size),
    var(--corner-size) 1px,
    1px var(--corner-size);
  background-position:
    0 0,
    top right,
    top right,
    bottom left,
    bottom left;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

.entry-panel-window.open {
  display: flex;
}

.entry-panel-window.options-open {
  min-height: 620px;
  height: min(620px, calc(100vh - 24px));
}

.entry-panel-window::before,
.entry-panel-window::after {
  content: "";
  position: absolute;
  width: var(--corner-size);
  height: var(--corner-size);
  pointer-events: none;
  z-index: 10;
}

.entry-panel-window::before {
  top: 0;
  left: 0;
  background:
    linear-gradient(to right, rgba(242, 226, 152, 0.42) 0%, rgba(242, 226, 152, 0.14) 60%, transparent 100%) top / 100% 1px no-repeat,
    linear-gradient(to bottom, rgba(242, 226, 152, 0.42) 0%, rgba(242, 226, 152, 0.14) 60%, transparent 100%) left / 1px 100% no-repeat;
}

.entry-panel-window::after {
  right: 0;
  bottom: 0;
  background:
    linear-gradient(to left, rgba(242, 226, 152, 0.42) 0%, rgba(242, 226, 152, 0.14) 60%, transparent 100%) bottom / 100% 1px no-repeat,
    linear-gradient(to top, rgba(242, 226, 152, 0.42) 0%, rgba(242, 226, 152, 0.14) 60%, transparent 100%) right / 1px 100% no-repeat;
}

.entry-panel-window ::selection {
  background: rgba(196, 202, 214, 0.28);
  color: rgba(244, 246, 250, 0.96);
}

.entry-panel-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  border-bottom: 1px solid rgba(168, 178, 198, 0.08);
  color: rgba(220, 218, 228, 0.28);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.22em;
  line-height: 1;
  flex-shrink: 0;
  text-shadow:
    0 0 4px rgba(198, 208, 226, 0.22),
    0 0 10px rgba(124, 138, 170, 0.08);
}

.entry-panel-titlebar span {
  color: rgba(206, 216, 232, 0.76);
  text-shadow:
    0 0 5px rgba(210, 220, 236, 0.4),
    0 0 14px rgba(126, 142, 176, 0.14);
}

.entry-panel-menubar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 5px;
  border-bottom: 1px solid rgba(168, 178, 198, 0.06);
  flex-shrink: 0;
}

.entry-panel-menubar button {
  border: none;
  background: none;
  padding: 0;
  color: rgba(194, 204, 222, 0.7);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: var(--cursor-pointer);
}

.entry-panel-menubar button:hover,
.entry-panel-menubar button:focus-visible {
  outline: none;
  color: rgba(228, 236, 248, 0.92);
  text-shadow:
    0 0 5px rgba(224, 232, 246, 0.48),
    0 0 12px rgba(144, 158, 188, 0.18);
}

.entry-panel-close {
  cursor: var(--cursor-pointer);
  color: rgba(236, 214, 138, 0.38);
  font-size: 9px;
  background: none;
  border: none;
  font-family: var(--font-mono);
  padding: 0;
  transition: color 0.2s, text-shadow 0.2s;
}

.entry-panel-close:hover,
.entry-panel-close:focus-visible {
  outline: none;
  color: rgba(248, 236, 184, 0.96);
  text-shadow:
    0 0 5px rgba(244, 230, 170, 0.92),
    0 0 14px rgba(224, 206, 126, 0.42);
}

.entry-panel-header {
  padding: 20px 28px 0;
  flex-shrink: 0;
  position: relative;
}

.entry-panel-corner-glyph {
  position: absolute;
  top: 16px;
  right: 28px;
  font-size: 18px;
  color: rgba(210, 208, 222, 0.14);
  font-family: var(--font-serif);
  line-height: 1;
  pointer-events: none;
  text-shadow:
    0 0 8px rgba(210, 208, 222, 0.22),
    0 0 20px rgba(190, 188, 208, 0.1);
}

.entry-panel-title-rule-top,
.entry-panel-title-rule-bottom {
  height: 1px;
}

.entry-panel-title-rule-top {
  background: linear-gradient(to right, rgba(160, 210, 240, 0.28), rgba(120, 185, 230, 0.06) 72%, transparent);
  margin-bottom: 10px;
}

.entry-panel-title-rule-bottom {
  background: linear-gradient(to right, rgba(160, 210, 240, 0.16), rgba(120, 185, 230, 0.04) 72%, transparent);
  margin-top: 10px;
  margin-bottom: 10px;
}

.entry-panel-title-input {
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  color: rgba(230, 222, 180, 0.82);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
  outline: none;
  caret-color: rgba(226, 232, 244, 0.86);
  text-shadow: var(--glow-blue-high);
}

.entry-panel-title-input::placeholder {
  color: rgba(194, 186, 150, 0.42);
  text-shadow: none;
}

.entry-panel-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-panel-meta-label,
.entry-panel-meta-hint {
  font-size: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-shadow: var(--glow-blue-low);
}

.entry-panel-meta-label {
  color: rgba(188, 196, 214, 0.56);
}

.entry-panel-meta-hint {
  color: rgba(192, 202, 220, 0.56);
}

.entry-panel-meta-hint[data-tone="success"] {
  color: rgba(224, 232, 244, 0.82);
  text-shadow: var(--glow-blue-high);
}

.entry-panel-meta-hint[data-tone="error"] {
  color: rgba(232, 172, 148, 0.84);
  text-shadow:
    0 0 5px rgba(210,140,130,1.0),
    0 0 18px rgba(190,120,110,0.68),
    0 0 36px rgba(170,100,90,0.32);
}

.entry-panel-divider {
  height: 1px;
  margin: 0 28px;
  flex-shrink: 0;
  background: linear-gradient(to right, rgba(168, 178, 198, 0.18), rgba(120, 136, 164, 0.04) 80%, transparent);
  position: relative;
  overflow: hidden;
}

.entry-panel-divider::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(224, 232, 246, 0.42), transparent);
  animation: divider-sweep 1.2s ease-out forwards;
}

.entry-panel-body {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 22px 52px 22px 28px;
}

.entry-panel-body::before {
  content: attr(data-coord);
  position: absolute;
  top: 26px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 7px;
  color: rgba(200, 198, 215, 0.1);
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  pointer-events: none;
  user-select: none;
  text-shadow: var(--glow-blue-low);
}

.entry-panel-body-input {
  width: 100%;
  height: 100%;
  min-height: 160px;
  border: none;
  background: transparent;
  padding: 0;
  color: rgba(206, 216, 232, 0.8);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  outline: none;
  caret-color: rgba(226, 232, 244, 0.86);
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 155, 185, 0.1) transparent;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: var(--glow-blue-medium);
}

.entry-panel-body-input[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: rgba(186, 194, 210, 0.34);
  text-shadow: var(--glow-blue-low);
  pointer-events: none;
}

.entry-panel-body-input p {
  margin: 0 0 1.45em;
}

.entry-panel-body-input p:last-child {
  margin-bottom: 0;
}

.entry-panel-body-input strong,
.entry-panel-body-input b {
  color: rgba(232, 238, 246, 0.94);
  font-weight: 700;
  text-shadow: var(--glow-blue-high);
}

.entry-panel-body-input em,
.entry-panel-body-input i {
  color: rgba(218, 224, 236, 0.9);
  font-style: italic;
  text-shadow: var(--glow-blue-medium);
}

.entry-panel-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 28px 16px;
  border-top: 1px solid rgba(168, 178, 198, 0.08);
  flex-shrink: 0;
  overflow-y: auto;
}

.entry-panel-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-panel-options-toggle {
  align-self: flex-start;
  border: none;
  background: none;
  padding: 10px 0 0;
  color: rgba(194, 204, 222, 0.74);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  cursor: var(--cursor-pointer);
}

.entry-panel-options-toggle::after {
  content: " +";
  opacity: 0.68;
}

.entry-panel-options-toggle[data-open="true"]::after {
  content: " -";
}

.entry-panel-options-toggle:hover,
.entry-panel-options-toggle:focus-visible {
  outline: none;
  color: rgba(228, 236, 248, 0.92);
  text-shadow:
    0 0 4px rgba(224, 232, 246, 0.42),
    0 0 12px rgba(144, 158, 188, 0.16);
}

.entry-panel-options-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-panel-options-content[hidden] {
  display: none !important;
}

.entry-panel-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 10px;
}

.entry-panel-label {
  color: rgba(192, 202, 220, 0.56);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: var(--glow-blue-low);
}

.entry-panel-tag-row {
  display: grid;
  grid-template-columns: minmax(0, 240px) auto;
  gap: 10px;
  align-items: center;
}

.entry-panel-tag-picker {
  position: relative;
  max-width: 240px;
}

.entry-panel-tag-trigger,
.entry-panel-tag-add {
  height: 16px;
  min-height: 16px;
  border-top: 1px solid rgba(212, 220, 240, 0.12);
  border-left: 1px solid rgba(212, 220, 240, 0.12);
  border-right: 1px solid rgba(48, 56, 76, 0.92);
  border-bottom: 1px solid rgba(48, 56, 76, 0.92);
  background: rgba(12, 16, 24, 0.78);
  box-shadow: inset 0 0 10px rgba(8, 10, 16, 0.16);
  color: rgba(210, 218, 232, 0.78);
  font-family: var(--font-mono);
  font-size: 8px;
}

.entry-panel-tag-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 8px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(224, 232, 246, 0.62) 50%),
    linear-gradient(135deg, rgba(224, 232, 246, 0.62) 50%, transparent 50%);
  background-position:
    calc(100% - 11px) 6px,
    calc(100% - 7px) 6px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  background-color: rgba(12, 16, 24, 0.78);
  cursor: var(--cursor-pointer) !important;
  outline: none;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-panel-tag-trigger[data-empty="true"] {
  color: rgba(186, 194, 210, 0.54);
}

.entry-panel-tag-trigger[data-open="true"] {
  border-top-color: rgba(228, 236, 248, 0.16);
  border-left-color: rgba(228, 236, 248, 0.16);
  border-right-color: rgba(76, 88, 114, 0.92);
  border-bottom-color: rgba(76, 88, 114, 0.92);
}

.entry-panel-tag-trigger:focus-visible,
.entry-panel-tag-add:focus-visible {
  outline: none;
  border-top-color: rgba(228, 236, 248, 0.16);
  border-left-color: rgba(228, 236, 248, 0.16);
  border-right-color: rgba(76, 88, 114, 0.92);
  border-bottom-color: rgba(76, 88, 114, 0.92);
}

.entry-panel-tag-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  max-height: 152px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid rgba(76, 88, 114, 0.92);
  background: rgba(12, 16, 24, 0.985);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.38),
    inset 0 0 18px rgba(8, 10, 16, 0.2);
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 155, 185, 0.18) transparent;
}

.entry-panel-tag-menu.open {
  display: flex;
}

.entry-panel-tag-option,
.entry-panel-tag-option-empty {
  min-height: 18px;
  border: none;
  background: transparent;
  color: rgba(210, 218, 232, 0.78);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.entry-panel-tag-option {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 3px 6px;
  cursor: var(--cursor-pointer) !important;
  text-align: left;
}

.entry-panel-tag-option:hover,
.entry-panel-tag-option:focus-visible,
.entry-panel-tag-option.is-selected {
  outline: none;
  background: rgba(74, 82, 96, 0.72);
  color: rgba(226, 232, 240, 0.92);
}

.entry-panel-tag-option-glyph {
  font-size: 10px;
  opacity: 0.6;
}

.entry-panel-tag-option-empty {
  padding: 3px 6px;
  color: rgba(186, 194, 210, 0.5);
}

.entry-panel-tag-add {
  width: 92px;
  padding: 0 10px;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 14px;
  white-space: nowrap;
  cursor: var(--cursor-pointer);
}

.entry-panel-tag-add:hover,
.entry-panel-tag-add:focus-visible {
  color: rgba(228, 236, 248, 0.92);
  text-shadow:
    0 0 4px rgba(224, 232, 246, 0.42),
    0 0 12px rgba(144, 158, 188, 0.16);
}

.entry-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
  align-self: flex-start;
  max-width: 160px;
}

.entry-panel-comments-field {
  padding-top: 0;
}

.entry-panel-comments-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.entry-panel-comment-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0 6px;
  background:
    linear-gradient(to right, rgba(160, 210, 240, 0.16), rgba(120, 185, 230, 0.03) 72%, transparent) top / 100% 1px no-repeat,
    linear-gradient(to right, rgba(160, 210, 240, 0.12), rgba(120, 185, 230, 0.02) 72%, transparent) bottom / 100% 1px no-repeat;
}

.entry-panel-comment-label {
  color: rgba(192, 202, 220, 0.56);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: var(--glow-blue-low);
}

.entry-panel-comment-input {
  min-height: 28px;
  resize: none;
  border: none;
  background: transparent;
  color: rgba(210, 218, 232, 0.82);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  padding: 0;
  outline: none;
  box-shadow: none;
}

.entry-panel-comment-input::placeholder {
  color: rgba(186, 194, 210, 0.4);
  text-shadow: var(--glow-blue-low);
}

.entry-panel-tag-chip,
.entry-panel-tag-empty {
  border: 1px solid rgba(194, 204, 224, 0.14);
  background: rgba(18, 22, 30, 0.68);
  padding: 3px 8px;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 218, 232, 0.74);
}

.entry-panel-tag-chip {
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: var(--cursor-pointer);
}

.entry-panel-tag-glyph {
  font-size: 10px;
  opacity: 0.6;
}

.entry-panel-tag-chip::after {
  content: " x";
  opacity: 0.66;
}

.entry-panel-tag-chip:hover,
.entry-panel-tag-chip:focus-visible {
  outline: none;
  color: rgba(228, 236, 248, 0.92);
}

.entry-panel-tag-empty {
  opacity: 0.72;
}

@media (max-width: 604px) {
  .entry-panel-window {
    width: calc(100vw - 24px);
  }
}

@media (max-width: 768px) {
  .entry-panel-window {
    max-width: calc(100vw - 24px);
    height: auto;
    max-height: calc(100vh - 24px);
    min-width: 320px;
    min-height: 220px;
  }

  .entry-panel-header {
    padding: 16px 18px 0;
  }

  .entry-panel-corner-glyph {
    top: 12px;
    right: 18px;
  }

  .entry-panel-divider {
    margin: 0 18px;
  }

  .entry-panel-body {
    padding: 18px 32px 18px 18px;
  }

  .entry-panel-body::before {
    right: 8px;
    top: 20px;
  }

  .entry-panel-footer {
    padding: 0 18px 14px;
  }

  .entry-panel-tag-row {
    grid-template-columns: 1fr;
  }

  .entry-panel-window.options-open {
    height: auto;
    min-height: 620px;
  }

  .entry-panel-comments-grid {
    grid-template-columns: 1fr;
  }

  .entry-panel-tag-add {
    width: 100%;
  }
}
