:root {
  --dn-bg: #0f1114;
  --dn-bg-soft: #171a1f;
  --dn-line: #2a2f39;
  --dn-text: #d6d7db;
  --dn-text-muted: #9ca1ab;
  --dn-accent: #2a80c8;
  --dn-accent-soft: #1f5d8f;
  --dn-danger: #93343a;
}

body.dn-screen-page {
  background: #0b0d10;
}

.dn-screen-app {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--dn-text);
  background:
    radial-gradient(1200px 500px at 50% -150px, rgba(65, 83, 116, 0.25), transparent),
    linear-gradient(180deg, #0f1114 0%, #0b0d11 100%);
}

.dn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dn-line);
  background: rgba(16, 18, 22, 0.86);
  backdrop-filter: blur(6px);
}

.dn-brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.dn-brand p {
  margin: 2px 0 0;
  color: var(--dn-text-muted);
  font-size: 12px;
}

.dn-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dn-btn {
  border: 1px solid #3a4658;
  color: #dce6f1;
  background: linear-gradient(180deg, #275e8d, #214a70);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.dn-btn:hover {
  filter: brightness(1.08);
}

.dn-btn-danger {
  background: linear-gradient(180deg, #8a3a3f, #6f2c30);
  border-color: #87444a;
}

.dn-main {
  flex: 1;
  min-height: 0;
  padding: 10px;
  overflow: auto;
}

.dn-grid {
  height: 100%;
  display: grid;
  gap: var(--dn-gap, 5px);
}

.dn-cell {
  position: relative;
  border: 1px solid #2f3641;
  background: linear-gradient(180deg, #2a2d32, #26292e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  min-height: 0;
}

.dn-cell.is-locked {
  border-color: #a37a39;
  box-shadow: inset 0 0 0 1px rgba(214, 174, 90, 0.36);
}

.dn-cell-empty-btn {
  position: absolute;
  inset: 0;
  border: 0;
  cursor: pointer;
  color: #d6d9de;
  background: transparent;
  display: grid;
  place-items: center;
}

.dn-plus {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 6px;
  border: 1px solid #4a5058;
  color: transparent;
  font-size: 0;
  line-height: 0;
  display: grid;
  place-items: center;
  background: rgba(30, 34, 39, 0.58);
  transition: box-shadow 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.dn-plus::before,
.dn-plus::after {
  content: '';
  position: absolute;
  background: #e4e7ec;
  border-radius: 2px;
}

.dn-plus::before {
  width: 30px;
  height: 6px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dn-plus::after {
  width: 6px;
  height: 30px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dn-cell-empty-btn:hover .dn-plus,
.dn-cell-empty-btn:focus-visible .dn-plus,
.dn-cell-empty-btn:active .dn-plus {
  border-color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65),
    0 0 16px rgba(255, 255, 255, 0.72),
    0 0 34px rgba(255, 255, 255, 0.5);
  transform: scale(1.03);
}

.dn-cell-media,
.dn-cell-embed {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
}

.dn-cell-media {
  background: #0f1116;
  cursor: zoom-in;
}

.dn-preview-frame {
  position: relative;
}

.dn-preview-frame-image {
  width: 100%;
  height: 100%;
}

.dn-preview-content {
  position: relative;
  cursor: zoom-in;
}

.dn-preview-content a,
.dn-preview-content button,
.dn-preview-content input,
.dn-preview-content select,
.dn-preview-content textarea {
  cursor: pointer;
}

.dn-preview-icon {
  position: absolute;
  right: 8px;
  top: 44px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(15, 19, 25, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0.92;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.dn-preview-icon::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  left: 6px;
  top: 5px;
}

.dn-preview-icon::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transform: rotate(45deg);
  right: 5px;
  bottom: 6px;
}

.dn-preview-content::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 44px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(90, 66, 40, 0.7);
  background: rgba(247, 235, 213, 0.82);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.dn-preview-content::before {
  content: '';
  position: absolute;
  right: 16px;
  top: 52px;
  width: 10px;
  height: 10px;
  border: 2px solid #7a4a1b;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.dn-preview-content:hover::after,
.dn-preview-frame:hover .dn-preview-icon,
.dn-preview-frame:focus-within .dn-preview-icon,
.dn-preview-content:hover::before {
  transform: scale(1.05);
}

.dn-preview-frame:hover .dn-preview-icon,
.dn-preview-content:hover::after {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 14px rgba(255, 255, 255, 0.45);
}

.dn-cell-embed {
  object-fit: cover;
}

.dn-cell-reference {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: #efe4cf;
  padding: 38px 10px 10px;
  font-size: calc(13px * var(--dn-content-scale, 1));
  line-height: 1.52;
}

.dn-ref-image {
  width: 100%;
  max-height: 40%;
  object-fit: contain;
  background: #0f1116;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  margin-bottom: 8px;
  cursor: zoom-in;
}

.dn-ref-html {
  color: #2b2b2b;
}

.dn-ref-html img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: #0f1116;
  cursor: zoom-in;
}

.dn-ref-html h1,
.dn-ref-html h2,
.dn-ref-html h3,
.dn-ref-html h4,
.dn-ref-html h5 {
  margin: 0 0 7px;
  color: #7a4a1b;
  font-size: 1.08em;
}

.dn-ref-html p,
.dn-ref-html ul,
.dn-ref-html ol,
.dn-ref-html dl {
  margin: 0 0 9px;
}

.dn-ref-html table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  margin: 6px 0 14px;
}

.dn-ref-html th,
.dn-ref-html td {
  border: 1px solid #cbbba3;
  padding: 5px 7px;
}

.dn-ref-html .od-rh-statblock {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 1px;
  background: #ccbda7;
  border: 1px solid #ccbda7;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 14px;
}

.dn-ref-html .od-rh-stat {
  background: #f9f3e8;
  padding: 7px 9px;
}

.dn-ref-html .od-rh-stat dt {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #756c60;
}

.dn-ref-html .od-rh-stat dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #242320;
}

.dn-ref-html .od-rh-prose {
  font-size: 0.95em;
  line-height: 1.55;
  color: #2b2b2b;
}

.dn-ref-html .od-rh-prose p {
  margin: 0 0 9px;
}

.dn-ref-html .od-rh-prose a,
.dn-ref-html a {
  display: inline-block;
  text-decoration: none;
  background: #fffaf0;
  border: 1px solid #ca9d5a;
  color: #7c4b17;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
  line-height: 1.25;
  margin: 1px 0;
}

.dn-ref-html .od-rh-prose a:hover,
.dn-ref-html a:hover {
  background: #ca9d5a;
  color: #fff;
}

.dn-ref-html .od-rh-tag-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  color: #7a4a1b;
  background: #f6ead0;
  border: 1px solid #ca9d5a;
  border-radius: 20px;
  padding: 2px 8px;
}

.dn-ref-html .od-rh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.dn-ref-html .od-rh-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin: 4px 0 14px;
  background: #cbbba3;
  border: 1px solid #cbbba3;
  border-radius: 8px;
  overflow: hidden;
}

.dn-ref-html .od-rh-mini > div {
  background: #f9f3e8;
  padding: 8px 10px;
}

.dn-ref-html .od-rh-mini dt {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #756c60;
}

.dn-ref-html .od-rh-mini dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #242320;
}

.dn-ref-html .od-rh-detail h4,
.dn-ref-html h4 {
  margin: 14px 0 6px;
  color: #7a4a1b;
  border-bottom: 2px solid #ca9d5a;
  padding-bottom: 2px;
}

.dn-ref-html .od-rh-table th,
.dn-ref-html table:not(.od-rh-table) thead th {
  background: #f3e7cf;
  color: #554e44;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.dn-ref-html .od-rh-table td,
.dn-ref-html .od-rh-table th,
.dn-ref-html table:not(.od-rh-table) td,
.dn-ref-html table:not(.od-rh-table) th {
  border-color: #cbbba3;
}

.dn-cell-head {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 3;
}

.dn-cell-title {
  font-size: 12px;
  color: #eceef2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  background: rgba(10, 12, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 72%;
}

.dn-cell-actions {
  display: flex;
  gap: 6px;
}

.dn-icon-btn {
  border: 1px solid rgba(220, 228, 236, 0.35);
  color: #e3e8ee;
  background: rgba(14, 17, 21, 0.74);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  min-width: 40px;
  height: 34px;
  padding: 0 10px;
  cursor: pointer;
  transition: box-shadow 120ms ease, border-color 120ms ease, filter 120ms ease;
}

.dn-icon-btn:hover,
.dn-icon-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45), 0 0 10px rgba(255, 255, 255, 0.25);
  filter: brightness(1.06);
}

.dn-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.dn-icon-btn-lock.is-lock-active {
  border-color: #d7af62;
  background: rgba(79, 56, 20, 0.78);
  color: #f2ddb0;
}

.dn-icon-btn-expand {
  min-width: 34px;
  width: 34px;
  padding: 0;
  font-size: 16px;
}

.dn-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.dn-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.dn-panel {
  position: relative;
  z-index: 2;
  max-width: 880px;
  width: min(96vw, 880px);
  max-height: min(90vh, 760px);
  margin: 5vh auto;
  border: 1px solid #42474f;
  border-radius: 7px;
  background: linear-gradient(180deg, #1a1d23, #121419);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dn-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #2d3240;
}

.dn-panel-head h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  color: #b9bec7;
}

.dn-close {
  font-size: 26px;
  border: 0;
  color: #b9c0ca;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.dn-picker-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: visible;
  padding: 8px 10px 8px;
  border-bottom: 1px solid #3c4354;
  background: rgba(13, 16, 22, 0.72);
}

.dn-tab {
  border: 1px solid #495162;
  color: #cfd4db;
  background: #242932;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 600;
}

.dn-tab.is-active {
  background: #2e80c4;
  color: #fff;
  border-color: #4e97d1;
}

.dn-picker-body {
  padding: 10px;
  overflow: auto;
}

.dn-search {
  width: 100%;
  height: 36px;
  border: 1px solid #495162;
  border-radius: 4px;
  color: #d5d9e0;
  background: #181c23;
  padding: 0 10px;
  margin-bottom: 8px;
}

.dn-entry-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #3a404c;
}

.dn-entry-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #2f3540;
  padding: 6px 8px;
  cursor: pointer;
}

.dn-entry-item:first-child {
  border-top: 0;
}

.dn-entry-item:hover {
  background: #263243;
}

.dn-entry-name {
  font-weight: 600;
  color: #d3d9e1;
}

.dn-entry-book {
  color: #a7afba;
  font-size: 12px;
}

.dn-form {
  display: grid;
  gap: 8px;
}

.dn-form input,
.dn-form select {
  height: 36px;
  border: 1px solid #495162;
  border-radius: 4px;
  color: #dce2ea;
  background: #181d25;
  padding: 0 10px;
}

.dn-note-input {
  min-height: 160px;
  border: 1px solid #495162;
  border-radius: 4px;
  color: #dce2ea;
  background: #181d25;
  padding: 10px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.dn-note-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid #3e485a;
  border-radius: 4px;
  background: #101620;
  padding: 6px;
}

.dn-note-tool {
  border: 1px solid #4a5568;
  color: #d7dfeb;
  background: #1c2330;
  border-radius: 4px;
  min-height: 30px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 13px;
}

.dn-note-tool:hover,
.dn-note-tool:focus-visible {
  border-color: #7f95b5;
  background: #253044;
}

.dn-note-color-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b9c4d5;
  font-size: 12px;
  margin-left: 2px;
}

.dn-note-color {
  width: 28px;
  height: 24px;
  border: 1px solid #4b5567;
  border-radius: 4px;
  padding: 0;
  background: transparent;
}

.dn-note-editor {
  min-height: 180px;
  border: 1px solid #495162;
  border-radius: 4px;
  color: #dce2ea;
  background: #181d25;
  padding: 10px;
  font-size: 14px;
  line-height: 1.45;
  overflow: auto;
}

.dn-note-editor:focus {
  outline: 1px solid #6a89b8;
  outline-offset: 0;
}

.dn-note-editor p,
.dn-note-editor ul,
.dn-note-editor ol {
  margin: 0 0 8px;
}

.dn-form-row {
  display: grid;
  gap: 4px;
  margin: 10px 12px 0;
}

.dn-form-row label {
  font-size: 13px;
  color: #c1c7d0;
}

.dn-mobile-quick {
  margin: 10px 12px 0;
}

.dn-mobile-quick .dn-btn {
  width: 100%;
}

.dn-form-foot {
  margin: 12px;
  display: flex;
  justify-content: flex-end;
}

.dn-recall-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  overflow: auto;
}

.dn-panel-sm {
  width: min(94vw, 500px);
  max-width: 500px;
}

#dn-save-modal .dn-panel {
  width: min(94vw, 620px);
  max-width: 620px;
}

#dn-recall-modal .dn-panel {
  width: min(95vw, 900px);
  max-width: 900px;
}

#dn-save-modal .dn-form-row {
  gap: 6px;
  margin: 12px 14px 0;
}

#dn-save-modal .dn-form-row label {
  font-size: 17px;
  font-weight: 600;
  color: #d3d8e0;
}

#dn-save-name {
  height: 44px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  padding: 0 12px;
}

#dn-save-modal .dn-form-foot {
  margin: 14px;
}

#dn-save-modal .dn-form-foot .dn-btn,
#dn-recall-modal .dn-btn {
  font-size: 17px;
  font-weight: 700;
  padding: 9px 16px;
}

#dn-recall-modal .dn-panel-head h2,
#dn-save-modal .dn-panel-head h2 {
  font-size: 40px;
  font-weight: 500;
}

#dn-recall-modal .dn-recall-list {
  padding: 14px;
  gap: 10px;
}

#dn-recall-modal .dn-save-card {
  padding: 14px;
  border-radius: 6px;
}

#dn-recall-modal .dn-save-meta strong {
  font-size: 34px;
  line-height: 1.15;
}

#dn-recall-modal .dn-save-meta span {
  margin-top: 4px;
  font-size: 17px;
}

.dn-settings {
  width: min(94vw, 620px);
  max-width: 620px;
}

.dn-settings .dn-form-row {
  gap: 6px;
  margin: 12px 14px 0;
}

.dn-settings .dn-form-row label {
  font-size: 17px;
  font-weight: 600;
  color: #d3d8e0;
}

.dn-settings .dn-form-row input[type="number"] {
  height: 44px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  padding: 0 12px;
}

.dn-settings .dn-form-row input[type="range"] {
  height: 34px;
  padding: 0;
}

.dn-settings .dn-form-row input[type="range"]::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
}

.dn-settings .dn-form-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #2e80c4;
  border: 0;
  margin-top: -6px;
}

.dn-settings .dn-form-row input[type="range"]::-moz-range-track {
  height: 7px;
  border-radius: 999px;
}

.dn-settings .dn-form-row input[type="range"]::-moz-range-thumb {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #2e80c4;
  border: 0;
}

.dn-settings .dn-form-foot {
  margin: 14px;
}

.dn-settings .dn-form-foot .dn-btn {
  font-size: 17px;
  font-weight: 700;
  padding: 9px 16px;
}

.dn-confirm-text {
  margin: 0;
  color: #c9d0d9;
}

.dn-lightbox-panel {
  position: relative;
  z-index: 2;
  width: min(96vw, 1200px);
  height: min(92vh, 900px);
  margin: 4vh auto;
  border: 1px solid #3f4652;
  border-radius: 7px;
  background: rgba(8, 10, 13, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.dn-lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
}

.dn-lightbox-image {
  display: block;
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

.dn-content-panel {
  position: relative;
  z-index: 2;
  width: min(96vw, 1100px);
  height: min(92vh, 920px);
  margin: 4vh auto;
  border: 1px solid #cbbba3;
  border-radius: 7px;
  background: #efe4cf;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dn-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #ccbda7;
  background: linear-gradient(180deg, #f7ecd8, #ecdbc0);
}

.dn-content-head h2 {
  margin: 0;
  color: #7a4a1b;
  font-size: 22px;
  line-height: 1.2;
}

.dn-content-head .dn-close {
  color: #000000;
}

.dn-content-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  color: #2b2b2b;
  line-height: 1.55;
  font-size: 16px;
  background: #efe4cf;
}

.dn-content-body h1,
.dn-content-body h2,
.dn-content-body h3,
.dn-content-body h4,
.dn-content-body h5 {
  color: #7a4a1b;
  margin: 0 0 10px;
}

.dn-content-body .dn-ref-html h1,
.dn-content-body .dn-ref-html h2,
.dn-content-body .dn-ref-html h3,
.dn-content-body .dn-ref-html h4,
.dn-content-body .dn-ref-html h5,
.dn-content-body .dn-ref-html .od-rh-detail h4 {
  color: #7a4a1b;
}

.dn-content-body p,
.dn-content-body ul,
.dn-content-body ol,
.dn-content-body dl,
.dn-content-body blockquote {
  margin: 0 0 10px;
}

.dn-content-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.dn-content-body table {
  width: 100%;
  border-collapse: collapse;
}

.dn-file-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 44px 10px 10px;
  background: linear-gradient(180deg, #171b21, #101319);
  color: #d8dde5;
}

.dn-file-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #9eb5d0;
  margin: 0 0 6px;
}

.dn-file-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #e8edf5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-file-embed {
  width: 100%;
  height: calc(100% - 44px);
  border: 1px solid #3a4353;
  border-radius: 4px;
  background: #0d1015;
}

.dn-file-lib-head {
  margin: 12px 0 6px;
  color: #9ea7b4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.dn-file-allowed {
  border: 1px solid #445065;
  background: #141b27;
  color: #c7d0dd;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.dn-file-lib {
  border: 1px solid #384151;
  border-radius: 5px;
  background: #11151d;
  max-height: 300px;
  overflow: auto;
}

.dn-file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #2a3140;
}

.dn-file-row:first-child {
  border-top: 0;
}

.dn-file-row:hover {
  background: #1a2230;
}

.dn-file-meta strong {
  display: block;
  color: #e7ecf5;
}

.dn-file-meta span {
  display: block;
  margin-top: 2px;
  color: #a7b0bc;
  font-size: 12px;
}

.dn-file-row-actions {
  display: flex;
  gap: 6px;
}

.dn-file-view {
  display: grid;
  gap: 10px;
}

.dn-file-view-pdf {
  width: 100%;
  min-height: 70vh;
  border: 1px solid #cbbba3;
  border-radius: 6px;
  background: #f8f2e5;
}

.dn-file-pre {
  margin: 0;
  max-height: 65vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid #ccbda7;
  border-radius: 6px;
  background: #f8efdd;
  color: #2b2b2b;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.dn-file-download {
  color: #7c4b17;
  font-weight: 600;
  text-decoration: underline;
}

.dn-note-panel {
  position: absolute;
  inset: 0;
  padding: 44px 10px 10px;
  overflow: auto;
  background: linear-gradient(180deg, #131923, #0f141d);
  color: #dbe4f1;
}

.dn-note-label {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border: 1px solid #456188;
  border-radius: 999px;
  background: rgba(69, 97, 136, 0.18);
  color: #b7cbed;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.dn-note-body {
  color: #dbe4f1;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  word-wrap: break-word;
}

.dn-note-content p,
.dn-note-content ul,
.dn-note-content ol {
  margin: 0 0 10px;
}

.dn-note-content mark {
  background: #f6df7a;
  color: #1a1a1a;
  padding: 0 2px;
  border-radius: 2px;
}

.dn-content-body th,
.dn-content-body td {
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 8px;
}

.dn-save-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #3a404c;
  border-radius: 4px;
  background: #171b21;
}

.dn-save-meta strong {
  display: block;
}

.dn-save-meta span {
  color: #a4acb6;
  font-size: 12px;
}

.dn-empty {
  color: #a6adba;
  padding: 8px;
}

.dn-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  border: 1px solid #3d4451;
  border-radius: 4px;
  background: rgba(16, 19, 25, 0.93);
  color: #d7dee6;
  padding: 8px 10px;
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 10000;
  pointer-events: none;
}

.dn-toast.is-on {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .dn-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dn-brand h1 {
    font-size: 18px;
  }

  .dn-main {
    padding: 8px;
  }

  .dn-panel {
    width: min(98vw, 880px);
    margin: 2vh auto;
    max-height: 96vh;
  }

  .dn-cell-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 680px) {
  .dn-modal:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
  }

  .dn-panel,
  .dn-panel-sm,
  .dn-content-panel,
  .dn-lightbox-panel {
    margin: 0;
    max-height: 94vh;
  }
}
