:root {
      --bg-start: #3a3a3a;
      --bg-end:   #1f1f1f;
      --card-bg:  rgba(10, 10, 10, 0.6);
      --text:     #f3f3f3;
      --muted:    #bdbdbd;
      --accent:   #e0e0e0;
      --border:   rgba(255,255,255,0.12);
      --ok:       #8fdaa1;
      --warn:     #ffd580;
      --err:      #ff9a9a;
    }

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end));
  background: no-repeat url("images/bunpaper_1440p.png");
  background-size: cover;
  color: var(--text);
  position: relative;
  padding-bottom: 75px; /* avoid overlap with footer */
  scroll: hidden;
}

body.wiki-body {
  background-color: #6f7684;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(12, 20, 34, 0.3) 1px, transparent 1.6px),
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.1) 1px, transparent 1.6px),
    linear-gradient(150deg, #949dac 0%, #768296 45%, #5a6679 100%);
  background-size: 14px 14px, 20px 20px, 100% 100%;
  background-attachment: fixed;
}

body.wiki-body h1,
body.wiki-body h2,
body.wiki-body h3,
body.wiki-body .marble-content,
body.wiki-body .marble-content * {
  text-shadow: none;
}

/* Dim toggle */
.dim-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 3s ease;
}
body.dimmed .dim-overlay { opacity: 0.55; }


.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

@keyframes paneFlyIn {
  0% {
    opacity: 0;
    transform: perspective(1000px) translate3d(0, 26px, -120px) rotateX(8deg) scale(0.98);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0) rotateX(0deg) scale(1);
    filter: blur(0);
  }
}

.title-row,
.player-card,
.files-card,
.crank-card,
.marble-sidebar,
.marble-main,
.admin-sidebar,
.quote-card,
.app-card {
  animation: paneFlyIn 760ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}


header { padding: 24px 16px 8px; }
.title-row {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  border: 1px solid #333;
  padding: 8px 20px;
  border-radius: 100vh;
}
h1 { margin: 0; font-size: clamp(1.25rem, 1rem + 1.5vw, 2rem); color: var(--text); text-shadow: 0 0 20px gray; }

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 14px;
  border-radius: 100vh;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
  font-weight: 600;
}
.btn i { margin-right: 8px; }
.btn:hover { transform: translateY(-1px); }

.reset-mya-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5000;
}


.status {
  font-size: 13px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;
  opacity: .9;
}
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.err { color: var(--err); }

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  transition: padding 200ms ease;
  scroll: hidden;
}
main.expanded { padding: 0 4%;  scroll: hidden;}

.player-card {
  width: min(92vw, 1100px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  overflow: hidden;
  transition: width 2s ease, border-radius 2s ease, border-color 2s ease;
}
.player-card.expanded { width: 85%; border-radius: 6px; border-color: #222; }

.player-aspect { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-aspect video {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: contain; background: #000;
}

.msg { position: fixed; top: 95px; left: 50%; transform: translateX(-50%); opacity: .8; font-size: 12px; text-align: center; }

.fidget-box {
position: absolute;
width: 200px;
height: 200px;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
pointer-events: auto;             /* clickable */
will-change: transform;
touch-action: none;               /* smoother touch dragging */
}

/* VERIFICATION SECTION */

#crankAttachment {
	position: fixed;
	top: calc(50% + 50px);
	left: 50%;
	transform: translateX(-50%);
	width: 20px;
	height: 180px;
	background: #555;
	z-index: 1;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#crankContainer {
	position: fixed;
	top: calc(50% + 180px);
	left: 50%;
	transform: translateX(-50%);
	width: 150px;
	height: 150px;
	z-index: 2;
}

#crank {
	width: 150px;
	height: 150px;
	border: 5px solid #555;
	border-radius: 50%;
	position: relative;
	background: #ddd;
	display: flex;
	justify-content: center;
	align-items: center;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#handle {
	width: 20px;
	height: 100px;
	background: #ab7d11;
	position: absolute;
	top: calc(50% - 100px);
	left: calc(50% - 10px);
	transform-origin: bottom center;
	cursor: grab;
	border-radius: 10px;
}

#handleEnd {
	width: 30px;
	height: 30px;
	background: #000;
	border-radius: 50%;
	position: absolute;
	top: -15px;
	left: calc(50% - 15px);
}

#knob {
	width: 20px;
	height: 20px;
	background: #ab7d11;
	border-radius: 50%;
	position: absolute;
	top: -10px;
	left: calc(50% - 10px);
}

#progressContainer {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	background: #ccc;
	padding: 20px;
	border-radius: 10px;
	text-align: center;
	z-index: 3;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#progressBar {
	width: 100%;
	height: 30px;
	background: #333;
	border-radius: 15px;
	overflow: hidden;
	margin-bottom: 10px;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#progressFill {
	width: 0;
	height: 100%;
	background: #ab7d11;
}

#tooltip {
	font-size: 1.2em;
	color: #111;
}

/* HUB SECTION */
.hub-grid {
  width: min(1100px, 92vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  perspective: 1200px;
  align-items: stretch;
}

.app-card {
  --tilt-x: 0;
  --tilt-y: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 200px;
  padding: 24px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(145deg, rgba(20,20,20,0.9), rgba(36,36,36,0.78));
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(
    circle at calc(50% + (var(--tilt-x) * 22%)) calc(50% - (var(--tilt-y) * 22%)),
    rgba(255,255,255,0.4),
    rgba(255,255,255,0) 45%
  );
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.app-card:hover::before { opacity: 1; }
.app-card:hover {
  border-color: rgba(255,255,255,0.36);
  box-shadow: 0 22px 36px rgba(0,0,0,0.45);
}

.app-card h2,
.app-card p {
  position: relative;
  z-index: 1;
}

.app-card h2 { margin: 0 0 10px; }

.card-symbol {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem);
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

.card-symbol i {
  color: #f0f0f0;
}


.app-card.is-coming-soon {
  opacity: 0.8;
  cursor: not-allowed;
}


@media (max-width: 900px) {
  .hub-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

/* FILES APP */
.files-card {
  width: min(720px, 92vw);
  padding: 28px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.files-card h2 { margin-top: 0; text-align: center; }
.files-form { display: flex; gap: 10px; }
.files-form input,
.link-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
}

.files-form input::placeholder,
.link-row input::placeholder {
  color: rgba(255,255,255,0.92);
}

.drop-zone {
  margin-top: 14px;
  border: 2px dashed rgba(255,255,255,0.35);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  background: rgba(0,0,0,0.2);
}
.drop-zone.dragover {
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.08);
}

.files-actions { margin-top: 14px; }
.files-error { color: var(--err); min-height: 1.2em; }
.files-info { color: var(--muted); }
.link-row { display: flex; gap: 10px; margin-top: 8px; }

.files-retention {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.retention-picker {
  position: relative;
}

.retention-picker::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.75);
  pointer-events: none;
  font-size: 0.82rem;
}

.files-retention select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  color: var(--text);
  padding: 12px 40px 12px 12px;
  font-size: 0.98rem;
}

.files-retention select:focus {
  outline: 2px solid rgba(255,255,255,0.3);
  outline-offset: 1px;
}

.retention-help {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.72);
}

.file-info-card {
  display: grid;
  gap: 16px;
  text-align: center;
  justify-items: center;
}


.file-info-lead {
  margin: 0;
  color: var(--muted);
}

.file-preview-wrap {
  width: min(340px, 100%);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  padding: 10px;
}

.file-preview-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
}

.file-meta-list {
  margin: 4px 0;
  display: grid;
  gap: 12px;
}

.file-meta-list div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
}

.file-meta-list dt {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.file-meta-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.download-btn {
  justify-content: center;
  width: fit-content;
  min-width: 180px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08));
  border-color: rgba(255,255,255,0.28);
}

.download-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-130%);
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.5) 50%, transparent 65%);
  pointer-events: none;
}

.download-btn.is-animating {
  animation: downloadPulse 500ms ease;
}

.download-btn.is-animating::after {
  animation: downloadShimmer 620ms ease;
}

@keyframes downloadPulse {
  0% { transform: scale(1); }
  45% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

@keyframes downloadShimmer {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}


.crank-page {
  min-height: 100%;
}

.crank-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 100vh;
  padding: 28px 20px 20px;
}

.crank-card {
  width: min(680px, 94vw);
  text-align: center;
  z-index: 5;
}

.crank-form {
  margin-top: 14px;
  align-items: center;
}

.crank-form input {
  text-align: center;
}

.crank-progress-wrap {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 14px;
}

#progressContainer {
  position: static;
  transform: none;
  box-shadow: none;
}

#progressBar {
  width: 100%;
  height: 20px;
  background: rgba(0,0,0,0.5);
}

#progressFill {
  background: linear-gradient(90deg, rgba(171,125,17,0.85), rgba(224,205,126,0.95));
}

#tooltip {
  color: var(--text);
  margin-top: 10px;
}

#verifyError {
  min-height: 1.2rem;
  margin-top: 10px;
}

#crankAttachment {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: clamp(18px, 2.4vw, 24px);
  height: clamp(90px, 14vh, 140px);
  background: rgba(185,185,185,0.75);
  border-radius: 100vh;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

#crankContainer {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: clamp(130px, 20vw, 200px);
  height: clamp(130px, 20vw, 200px);
}

#crank {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255,255,255,0.3);
  background: linear-gradient(145deg, rgba(235,235,235,0.85), rgba(150,150,150,0.7));
}

#handle {
  width: clamp(16px, 2.2vw, 24px);
  height: clamp(70px, 10vw, 95px);
  top: calc(50% - clamp(70px, 10vw, 95px));
  left: calc(50% - (clamp(16px, 2.2vw, 24px) / 2));
}

.quotes-main {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 160px);
  overflow: hidden;
}

.quotes-board {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 160px);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 10px 14px;
}

.quote-card {
  position: relative;
  width: min(320px, 88vw);
  max-width: 100%;
  padding: 18px;
  border-radius: 16px;
  background: rgba(18,18,18,0.72);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
  opacity: 1;
  transition: box-shadow 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.quote-card:hover {
  transform: translateY(-2px) rotate(var(--quote-tilt, 0deg));
}

.quote-card blockquote {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.quote-meta {
  margin: 14px 0 0;
  color: var(--muted);
}

.quote-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.quote-like-btn {
  min-width: 82px;
  gap: 8px;
  padding: 8px 12px;
}

.quote-like-btn i {
  color: #ffb9c7;
  margin-right: 0;
}

.quotes-fab-group {
  position: fixed;
  top: 92px;
  right: 22px;
  display: inline-flex;
  gap: 10px;
  z-index: 30;
}

.add-quote-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(20,20,20,0.75);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.quote-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 60;
  overflow: hidden;
}

.quote-modal.is-hidden,
.admin-sidebar.is-hidden,
.admin-sidebar-toggle.is-hidden {
  display: none;
}

.quote-form-card {
  width: min(620px, 94vw);
  display: grid;
  gap: 12px;
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
}

.quote-form-card label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.quote-form-card textarea,
.quote-form-card input {
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.quote-form-card textarea {
  min-height: 120px;
  resize: vertical;
}

.quote-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-sidebar {
  position: fixed;
  top: 154px;
  right: 0;
  width: min(360px, 88vw);
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding: 14px;
  background: rgba(7,7,7,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  backdrop-filter: blur(10px);
  transform: translateX(0);
  transition: transform 220ms ease;
  z-index: 35;
}

.admin-sidebar.is-collapsed {
  transform: translateX(calc(100% + 8px));
}

.admin-sidebar-toggle {
  position: fixed;
  top: 154px;
  right: 14px;
  z-index: 36;
}

.admin-sidebar-toggle.is-collapsed {
  right: 14px;
}

.admin-sidebar-toggle.is-active {
  border-color: rgba(174, 225, 255, 0.65);
  background: rgba(41, 96, 136, 0.46);
}

.admin-quote-list {
  display: grid;
  gap: 10px;
}

.admin-quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
}

.admin-quote-actions {
  display: inline-flex;
  gap: 8px;
}

.admin-quote-row span {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}


/* Marble Codex */
.marble-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 16px;
}

.marble-sidebar,
.marble-main {
  background: rgba(8, 8, 8, 0.62);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(9px);
}

.marble-sidebar {
  padding: 16px;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.marble-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.marble-sidebar-header h1 {
  font-size: 1.4rem;
}

.page-tree {
  display: grid;
  gap: 6px;
}

.page-tree-node {
  position: relative;
}

.page-tree-item {
  --tree-depth: 0;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px 8px calc(14px + (var(--tree-depth) * 18px));
  text-align: left;
  cursor: pointer;
  position: relative;
}

.page-tree-item::before {
  content: "";
  position: absolute;
  left: calc(8px + (var(--tree-depth) * 18px));
  top: 50%;
  width: 8px;
  border-top: 1px solid rgba(255,255,255,0.34);
}

.page-tree-item::after {
  content: "";
  position: absolute;
  left: calc(8px + (var(--tree-depth) * 18px));
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255,255,255,0.2);
}

.page-tree-item.active {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.14);
}

.page-tree-children {
  display: grid;
  gap: 6px;
}

.marble-main {
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-height: calc(100vh - 32px);
  width: 100%;
}

.marble-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.marble-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: min(520px, 100%);
}

.marble-title-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.4);
  color: var(--text);
  font-size: 1.05rem;
  text-align: center;
}

.marble-small-btn {
  padding: 8px 12px;
  border-radius: 10px;
}

.marble-control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.marble-title-input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.editor-toolbar {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-toolbar[hidden] {
  display: none !important;
}

.marble-tool {
  width: 42px;
  height: 38px;
  padding: 0;
}

.marble-shortcuts-help {
  margin-left: 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.marble-shortcuts-help summary {
  cursor: pointer;
  user-select: none;
}

.marble-shortcuts-help ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.marble-shortcuts-help code {
  color: #ffdca8;
}


.marble-select {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.45);
  color: var(--text);
  padding: 0 10px;
}

.marble-image-controls-popup {
  position: fixed;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(7, 10, 17, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  z-index: 80;
}

.marble-image-controls-popup[hidden] {
  display: none !important;
}

.marble-content {
  margin-top: 14px;
  border: 1px solid rgba(0,0,0,0.2);
  background: #fff;
  color: #1c1c1c;
  border-radius: 14px;
  padding: 16px;
  min-height: 60vh;
  width: 100%;
  overflow: auto;
}

.marble-content:focus {
  outline: 1px solid rgba(255,255,255,0.28);
}

.marble-content img {
  max-width: 100%;
  border-radius: 8px;
}

.marble-content a {
  color: #2b6cb0;
}


.book-mode-on .marble-content {
  max-width: min(794px, 100%);
  margin-inline: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.marble-book-pages-container {
  display: grid;
  gap: 26px;
}

.book-mode-on .marble-book-page {
  width: 794px;
  min-height: 1123px;
  box-sizing: border-box;
  padding: 72px 76px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.24);
}

.book-mode-on .marble-main {
  align-items: center;
}

.marble-main .controls .is-active {
  border-color: rgba(174, 225, 255, 0.65);
  background: rgba(41, 96, 136, 0.46);
}

.marble-content img {
  max-width: 100%;
  border-radius: 8px;
}

.marble-content img[data-selected="true"],
.marble-content img.is-selected {
  outline: 2px solid rgba(71, 126, 170, 0.8);
}

.marble-image-scale-full { width: 100%; }
.marble-image-scale-large { width: 75%; }
.marble-image-scale-medium { width: 50%; }
.marble-image-scale-small { width: 33%; }

.marble-image-placement-inline { display: inline-block; margin: 8px 0; }
.marble-image-placement-left { display: block; margin: 10px auto 10px 0; }
.marble-image-placement-center { display: block; margin: 10px auto; }
.marble-image-placement-right { display: block; margin: 10px 0 10px auto; }

.marble-image-flow-none { float: none; clear: both; }
.marble-image-flow-wrap.marble-image-placement-left { float: left; margin: 10px 16px 12px 0; }
.marble-image-flow-wrap.marble-image-placement-right { float: right; margin: 10px 0 12px 16px; }
.marble-image-flow-wrap.marble-image-placement-center,
.marble-image-flow-wrap.marble-image-placement-inline { float: none; }

@media (max-width: 900px) {
  .marble-shell {
    grid-template-columns: 1fr;
  }

  .marble-sidebar {
    position: static;
    max-height: none;
  }


  .marble-book-pages-container {
    gap: 14px;
  }
}


.marble-danger-btn {
  color: #ffd0d0;
  border-color: rgba(255, 140, 140, 0.35);
  background: rgba(80, 18, 18, 0.42);
}

.marble-danger-btn:hover {
  border-color: rgba(255, 180, 180, 0.55);
}
