/* Base & Page Structure */
html,
body {
  margin: 0;
  padding: 0;
  background: #f4f4f0;
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

body {
  border-top: 4px solid #333;
}

.page {
  width: min(1000px, calc(100% - 30px));
  margin: 20px auto 50px;
}

/* Typography & Links */
a {
  color: #0645ad;
  text-decoration: underline;
}

h1 {
  margin: 0;
  font-size: 19px;
  font-weight: normal;
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: normal;
}

.small,
.muted,
.note {
  color: #777;
}

.small {
  font-size: 11px;
}

.note {
  font-size: 11px;
  line-height: 1.5;
}

header {
  border-bottom: 1px solid #999;
  padding-bottom: 6px;
  margin-bottom: 18px;
}

.title {
  color: #222;
  text-decoration: none;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.toplinks {
  float: right;
  color: #666;
}

/* Messages & Alerts */
.message {
  border: 1px solid #aaa;
  background: #fff;
  padding: 6px 8px;
  margin-bottom: 12px;
}

.message.error {
  color: #8a2600;
}

.message.ok {
  color: #176b2c;
}

/* Layout Grid & Controls */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: start;
}

.sectionline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #999;
  padding-bottom: 6px;
  margin-bottom: 0;
}

.newnote {
  display: flex;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #999;
  border-top: 0;
  background: #fff;
}

.newnote input,
.tag-editor input {
  flex: 1;
  min-width: 0;
  padding: 3px 5px;
  border: 1px solid #999;
  background: #fff;
  font: inherit;
}

.controls {
  margin: 10px 0;
  color: #666;
}

.controls select,
select {
  padding: 2px 22px 2px 4px;
  border: 1px solid #999;
  background: #fff;
  font: inherit;
}

button {
  font: inherit;
  padding: 2px 9px;
  border: 1px solid #777;
  background: #e7e7e2;
  color: #111;
  cursor: pointer;
}

button:hover {
  background: #d8d8d2;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: #0645ad;
  text-decoration: underline;
}

.link:hover {
  background: none;
}

.danger {
  color: #8a2600;
}

.inline {
  display: inline;
}

/* Note List */
.notelist {
  border: 1px solid #999;
  background: #fff;
}

.note-row {
  padding: 9px 10px;
  border-bottom: 1px solid #ddd;
}

.note-row:last-child {
  border-bottom: 0;
}

.note-row.pinned {
  background: #fffef0;
}

.note-title {
  font-size: 15px;
}

.note-title a {
  color: #222;
}

.mark {
  margin-left: 7px;
  color: #777;
  border: 1px solid #bbb;
  padding: 1px 4px;
  font-size: 10px;
}

.meta {
  color: #777;
  font-size: 11px;
  margin-top: 2px;
}

.tags {
  margin-top: 5px;
  font-size: 11px;
}

.tags a {
  margin-right: 7px;
}

/* Sidebar & Reminders */
.sidehelp {
  margin-top: 26px;
  border: 1px solid #999;
  background: #fff;
  padding: 9px 10px;
  line-height: 1.8;
}

.sidehead {
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  margin-bottom: 6px;
}

.sidehelp code {
  font-family: Menlo, Monaco, Consolas, monospace;
}

.reminders {
  border: 1px solid #999;
  border-top: 0;
  background: #fff;
}

.reminder {
  padding: 8px 9px;
  border-bottom: 1px solid #ddd;
}

.reminder:last-child {
  border-bottom: 0;
}

.reminder span {
  display: block;
  color: #777;
  font-size: 11px;
  margin-top: 2px;
}

.reminder button {
  margin-top: 4px;
}

.reminder a {
  color: #222;
}

.reminder .meta {
  margin-top: 3px;
}

/* Login Box */
.loginbox {
  width: 280px;
  margin: 80px auto;
  border: 1px solid #999;
  background: #fff;
  padding: 15px;
}

.loginbox h1 {
  margin-bottom: 15px;
}

.loginbox label {
  display: block;
  margin-bottom: 10px;
}

.loginbox input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 3px;
  padding: 4px;
  border: 1px solid #999;
  font: inherit;
}

.loginbox input.check {
  width: auto;
  margin-right: 5px;
}

.loginbox.compact {
  margin: 6px 0 20px;
}

/* Note Page & Editor */
.note-page {
  width: min(900px, 100%);
  margin: 0 auto;
}

.note-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid #999;
  padding-bottom: 7px;
}

.note-title-input {
  font: 19px Arial, sans-serif;
  font-weight: normal;
  border: 0;
  background: transparent;
  padding: 0;
  width: min(620px, 100%);
  outline: none;
}

.note-meta {
  font-size: 11px;
  color: #777;
  margin-top: 3px;
}

.note-actions {
  white-space: nowrap;
  color: #666;
}

.editor-wrap {
  position: relative;
  margin-top: 12px;
  border: 1px solid #999;
  background: #fff57e6b;
  min-height: 560px;
}

.editor-wrap textarea,
.highlight {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 560px;
  margin: 0;
  padding: 14px 15px;
  border: 0;
  outline: 0;
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow: auto;
  tab-size: 4;
}

.editor-wrap textarea {
  z-index: 2;
  resize: none;
  background: transparent;
  color: #222;
  caret-color: #222;
}

.highlight {
  z-index: 1;
  color: #222;
  pointer-events: none;
}

.highlight .cmd {
  color: #0645ad;
  font-weight: bold;
}

.highlight .arg {
  color: #555;
}

.highlight .syntax {
  color: #777;
}

/* Rendered note objects */
.rendered-note {
  margin-top: 14px;
  padding: 14px 15px;
  border: 1px solid #999;
  background: #fff;
  box-sizing: border-box;
  min-height: 40px;
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rendered-note:empty {
  display: none;
}

.rendered-note > br:first-child,
.rendered-note > br:last-child {
  line-height: 0;
}

.render-banner {
  margin: -12px -15px;
  padding: 13px 15px;
  /*border-top: 1px solid;
  border-bottom: 1px solid;*/
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

.render-banner-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.render-banner-text {
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
  white-space: normal;
}

.render-banner-defn {
  background: #e8f5e8;
  border-color: #75a875;
  color: #214d21;
}

.render-banner-gtk {
  background: #fff0d8;
  border-color: #c28a35;
  color: #674615;
}

.render-banner-tut {
  background: #eee5fa;
  border-color: #9871c4;
  color: #4d3267;
}

.render-banner-war {
  background: #fde2e2;
  border-color: #c35a5a;
  color: #6c2020;
}

.render-conclusion {
  margin: 16px 0;
  padding: 11px 14px;
  border: 1px solid #aaa;
  background: #eeeeee;
  color: #444;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-family: Arial, sans-serif;
}

.render-conclusion-arrow {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.render-conclusion-text {
  max-width: 90%;
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
}

.render-progress {
  margin: 10px 0;
  padding: 8px 0;
}

.render-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font: 11px Arial, sans-serif;
  color: #666;
  text-transform: uppercase;
}

.render-progress-track {
  height: 9px;
  border: 1px solid #999;
  background: #eee;
  box-sizing: border-box;
}

.render-progress-fill {
  height: 100%;
  background: #555;
}

.render-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0;
  padding: 5px 9px;
  border: 1px solid #999;
  background: #f4f4f4;
  font: 12px Arial, sans-serif;
}

.render-state-mark {
  width: 14px;
  text-align: center;
  font-weight: 700;
}

.render-state-completed {
  background: #e8f5e8;
  border-color: #75a875;
}

.render-state-doing {
  background: #fff0d8;
  border-color: #c28a35;
}

.render-task-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-family: Arial, sans-serif;
}

.render-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border: 1px solid #777;
  background: #fff;
  color: #333;
  cursor: pointer;
  font: 12px Arial, sans-serif;
  line-height: 16px;
}

.render-checkbox.doing {
  background: #fff0d8;
}

.render-checkbox.completed {
  background: #e8f5e8;
  border-color: #679267;
}

/* Command Palette */
.palette {
  position: relative;
  z-index: 5;
  display: none;
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  border: 1px solid #777;
  background: #fff;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
  max-height: 210px;
  overflow: auto;
}

.palette.visible {
  display: block;
}

.palette-item {
  padding: 5px 7px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

.palette-item:last-child {
  border-bottom: 0;
}

.palette-item.selected,
.palette-item:hover {
  background: #e9e9e5;
}

.palette-item strong {
  font-family: Menlo, Monaco, Consolas, monospace;
}

.palette-item span {
  color: #777;
  font-size: 11px;
  margin-left: 8px;
}

.palette-help {
  padding: 6px 7px;
  background: #f0f0ec;
  border-bottom: 1px solid #aaa;
  color: #555;
  font: 11px/1.4 Arial, sans-serif;
}

.editor-bottom {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-top: 8px;
}

.tag-editor {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tag-editor label {
  color: #777;
}

.syntax-note {
  font-size: 11px;
  color: #777;
}

/* Sharing & Details */
.extra {
  margin-top: 12px;
  border-top: 1px solid #bbb;
  padding-top: 7px;
}

.extra summary {
  cursor: pointer;
  color: #0645ad;
}

.sharegrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.sharegrid form {
  border: 1px solid #bbb;
  background: #fff;
  padding: 8px;
}

.sharegrid label {
  display: block;
  color: #666;
  font-size: 11px;
  margin-bottom: 7px;
}

.sharegrid input,
.sharegrid select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 3px;
}

.sharelist {
  margin-top: 10px;
  font-size: 11px;
}

.sharelist > div {
  padding: 5px 0;
  border-bottom: 1px dotted #bbb;
}

.dangerbox {
  color: #8a2600;
}

.readonly-note {
  margin-top: 12px;
  border: 1px solid #999;
  background: #fff;
  padding: 15px;
  min-height: 560px;
  white-space: pre-wrap;
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
  box-sizing: border-box;
}

/* History, Diff, and Blame Views */
.history-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
}

.commit-tree {
  border: 1px solid #999;
  background: #fff;
  padding: 8px 10px;
}

.commit-node {
  padding: 6px 0;
  border-bottom: 1px dotted #bbb;
}

.commit-node:last-child {
  border-bottom: 0;
}

.tree-dot {
  display: inline-block;
  width: 22px;
  color: #0645ad;
}

.commit-node.current {
  background: #fffef0;
}

.history-help {
  border: 1px solid #999;
  background: #fff;
  padding: 9px 10px;
  height: max-content;
}

.commit-meta {
  padding: 7px 0;
  color: #777;
  font-size: 11px;
}

.diffview {
  border: 1px solid #999;
  background: #fff;
  font: 12px/1.5 Menlo, Monaco, Consolas, monospace;
  overflow: auto;
}

.diffline {
  padding: 1px 8px;
  white-space: pre;
}

.diffline.add {
  background: #eef8ee;
  color: #176b2c;
}

.diffline.del {
  background: #fff1ed;
  color: #8a2600;
}

.diffline.hunk {
  background: #eee;
  color: #0645ad;
}

.blameview {
  border: 1px solid #999;
  background: #fff;
  font: 12px/1.5 Menlo, Monaco, Consolas, monospace;
}

.blameline {
  display: grid;
  grid-template-columns: 90px 45px minmax(0, 1fr);
  border-bottom: 1px solid #eee;
}

.blameauthor {
  color: #0645ad;
  padding: 2px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blamenum {
  color: #999;
  padding: 2px 5px;
  text-align: right;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
}

.blameline code {
  padding: 2px 7px;
  white-space: pre-wrap;
}

/* Shared Note & Editors */
.shared-note {
  width: min(800px, 100%);
  margin: auto;
}

.shared-note pre {
  border: 1px solid #999;
  background: #fff;
  padding: 15px;
  white-space: pre-wrap;
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
  min-height: 300px;
}

.shared-editor {
  display: block;
  width: 100%;
  min-height: 520px;
  box-sizing: border-box;
  border: 1px solid #999;
  background: #fff;
  padding: 15px;
  font: 14px/1.55 Menlo, Monaco, Consolas, monospace;
  resize: vertical;
  margin: 10px 0;
}

.shared-note code {
  font-family: Menlo, Monaco, Consolas, monospace;
}

.collaborator-name {
  margin-top: 12px;
}

.collaborator-name label {
  display: block;
  margin-bottom: 8px;
}

.collaborator-name input {
  padding: 4px 5px;
  border: 1px solid #999;
  font: inherit;
  width: 260px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #999;
}

th,
td {
  padding: 6px 7px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

th {
  background: #e9e9e5;
  border-bottom: 1px solid #999;
}

/* Aktuell List & Reference */
.aktuell-list {
  border: 1px solid #999;
  background: #fff;
}

.aktuell-row {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
}

.aktuell-row:last-child {
  border-bottom: 0;
}

.aktuell-kind {
  color: #777;
  font-size: 11px;
  text-transform: lowercase;
}

.aktuell-main a {
  color: #222;
}

.syntax-reference {
  border: 1px solid #ddd;
  background: #fafaf7;
  padding: 7px 9px;
  margin-top: 8px;
}

.syntax-reference div {
  margin: 4px 0;
}

.syntax-reference code {
  font: 12px/1.5 Menlo, Monaco, Consolas, monospace;
}

/* Aktuell Desk Visual Interface */
.aktuell-desk {
  position: relative;
  min-height: 650px;
  margin-top: 12px;
  border: 1px solid #777;
  background: #d8d0bd;
  box-shadow:
    inset 0 0 0 6px #c8c0ad,
    inset 0 0 0 7px #eee8dc;
  overflow: hidden;
}

.desk-item.desk-dragging {
  cursor: grabbing;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.18);
}

.aktuell-desk:before {
  content: "CENTRAAL DESK";
  position: absolute;
  left: 14px;
  top: 10px;
  font: 11px Arial, sans-serif;
  letter-spacing: 0.5px;
  color: #666;
}

.aktuell-desk:after {
  content: "aktuell";
  position: absolute;
  right: 14px;
  top: 10px;
  font: 11px Arial, sans-serif;
  color: #777;
}

.aktuell-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 5px;
  font-size: 11px;
  color: #666;
}
.aktuell-controls label { display: inline-flex; align-items: center; gap: 4px; }
.aktuell-controls select,
.aktuell-controls input,
.aktuell-controls button {
  font: inherit;
  border: 1px solid #888;
  background: #f7f4eb;
  color: #222;
  padding: 3px 5px;
}
.aktuell-controls button { cursor: pointer; }
.aktuell-controls .muted { margin-left: 2px; }

.desk-item {
  position: absolute;
  width: 205px;
  min-height: 92px;
  box-sizing: border-box;
  padding: 10px 11px;
  border: 1px solid #777;
  background: #fffef4;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.14);
  transform: rotate(var(--desk-tilt, 0deg));
  transform-origin: center;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}


.desk-item.todo { background: #fff57e6b; }
.desk-item.remember { background: #fff; }
.desk-item.date { background: #f7f7f2; }
.desk-item.link { background: #fff; }
.desk-item.note-object { background: #eee9dc; }
.desk-item.study { background: #e7edf4; }
.desk-item.desk-done { opacity: 0.35; text-decoration: line-through; }

.desk-kind {
  font-size: 10px;
  color: #777;
  text-transform: uppercase;
  border-bottom: 1px dotted #aaa;
  padding-bottom: 3px;
  margin-bottom: 5px;
}

.desk-title {
  font-size: 14px;
  line-height: 1.25;
  margin-bottom: 5px;
  max-height: 37px;
  overflow: hidden;
}

.desk-title a {
  color: #222;
  text-decoration: underline;
}

.desk-meta {
  font-size: 10px;
  color: #777;
  line-height: 1.35;
}

.desk-actions {
  margin-top: 5px;
}

.desk-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #777;
  text-align: center;
  font-size: 12px;
}

.aktuell-overflow {
  margin-top: 10px;
  border: 1px solid #999;
  background: #eee9dc;
  padding: 8px 10px;
}
.aktuell-overflow-title {
  font-size: 11px;
  text-transform: uppercase;
  color: #666;
  border-bottom: 1px dotted #aaa;
  padding-bottom: 4px;
  margin-bottom: 2px;
}
.aktuell-overflow-row {
  display: grid;
  grid-template-columns: 65px minmax(120px, 1fr) minmax(100px, 0.7fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  border-bottom: 1px dotted #ccc;
  font-size: 11px;
}
.aktuell-overflow-row:last-child { border-bottom: 0; }
.aktuell-overflow-kind { color: #777; text-transform: uppercase; font-size: 9px; }
.aktuell-overflow-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aktuell-overflow-main a { color: #222; }
.aktuell-overflow-meta { color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aktuell-overflow-row button { font: inherit; padding: 2px 5px; border: 1px solid #888; background: #f7f4eb; }

.desk-count {
  float: right;
  color: #777;
  font-size: 11px;
}

.aktuell-intro {
  margin: 7px 0 0;
  color: #777;
  font-size: 11px;
}

/* Home Views */
.note-home {
  width: min(1000px, 100%);
  margin: 0 auto;
}

.new-note-home {
  margin-bottom: 18px;
}

.new-note-home .newnote {
  border-top: 0;
}

.home-aktuell {
  margin-top: 4px;
}

.notes-view {
  width: min(1000px, 100%);
  margin: 0 auto;
}

/* Responsive Media Queries */
@media (max-width: 760px) {
  .workspace,
  .history-layout,
  .sharegrid {
    grid-template-columns: 1fr;
  }

  .toplinks {
    float: none;
    display: block;
    margin-top: 5px;
  }

  .note-head {
    display: block;
  }

  .note-actions {
    margin-top: 7px;
  }

  .editor-wrap,
  .editor-wrap textarea,
  .highlight,
  .readonly-note {
    min-height: 420px;
  }

  .editor-bottom {
    display: block;
  }

  .syntax-note {
    margin-top: 5px;
  }

  .page {
    width: min(1000px, calc(100% - 20px));
    margin-top: 12px;
  }

  .palette {
    width: calc(100% - 30px);
  }

  .aktuell-desk {
    min-height: 900px;
  }

  .desk-item {
    width: 42%;
    min-width: 145px;
  }

  .aktuell-controls {
    align-items: flex-start;
  }

  .aktuell-overflow-row {
    grid-template-columns: 55px minmax(100px, 1fr) auto;
  }
  .aktuell-overflow-meta { display: none; }

                  }
