:root {
  --adventure-bg-primary: #1a1a1f;
  --adventure-bg-secondary: #141418;
  --adventure-gold: #d4af37;
  --adventure-text-primary: #e0e0e0;
  --adventure-text-secondary: #aaaaaa;
  --adventure-text-muted: #888888;
  --adventure-link: #7eb8da;
  --adventure-border-dark: #333333;
  --adventure-box-filled: linear-gradient(180deg, rgba(45, 38, 32, 0.85) 0%, rgba(35, 30, 25, 0.9) 100%);
  --adventure-box-empty: transparent;
  --adventure-font-body: "Crimson Pro", Georgia, serif;
  --adventure-font-heading: "Colus", Georgia, serif;
  --adventure-font-decorative: "Colus", Georgia, serif;
}

/* ============ BASE ============ */
.adventure-view.style-dragonbrew {
  background: var(--adventure-bg-primary);
  color: var(--adventure-text-primary);
  font-family: var(--adventure-font-body);
  font-size: 10.5pt;
  line-height: 1.5;
}

.adventure-view.style-dragonbrew .adventure-content {
  background: var(--adventure-bg-primary);
  border: 0px;
}

.adventure-view.style-dragonbrew .place-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 32px;
}

/* Ensure body text uses Crimson Pro font */
.adventure-content,
.adventure-content p,
.adventure-content li,
.place-content,
.place-content p,
.place-content li {
  font-family: 'Crimson Pro', 'Crimson Text', Georgia, serif;
}

/* ============ PAGE HEADER ============ */
.adventure-view.style-dragonbrew .place-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--adventure-gold);
}

.adventure-view.style-dragonbrew .place-header h3 {
  font-family: var(--adventure-font-heading);
  font-size: 32pt;
  font-weight: 700;
  color: var(--adventure-gold);
  padding-top: 15px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.adventure-view.style-dragonbrew .place-number,
.adventure-view.style-dragonbrew .place-header .ornament {
  /*display: none;*/
  font-family: colus;
  padding-top: 15px;
  color: #c9c9c9;
  font-size: 1rem;
}

.adventure-view.style-dragonbrew .place-tagline {
  font-family: var(--adventure-font-heading);
  font-size: 10pt;
  color: var(--adventure-text-secondary);
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============ TYPOGRAPHY ============ */
.adventure-view.style-dragonbrew p {
  margin-bottom: 1em;
  text-align: justify;
  font-size: 1rem;
  text-align: center;
}

.adventure-view.style-dragonbrew .drop-cap::first-letter {
  float: left;
  font-family: var(--adventure-font-decorative);
  font-size: 3.5em;
  line-height: 0.8;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: var(--adventure-gold);
}

.adventure-view.style-dragonbrew a,
.adventure-view.style-dragonbrew .wiki-link {
  color: var(--adventure-link);
  text-decoration: none;
  border-bottom: 1px dotted var(--adventure-link);
  font-family: Colus;
  font-size: 0.7rem;
}

/* ============ HEADINGS ============ */
.adventure-view.style-dragonbrew .place-content h3 {
  font-family: var(--adventure-font-heading);
  font-size: 14pt;
  font-weight: 700;
  color: var(--adventure-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 24px 0 12px;
  /*ADDED FOR CENTERING*/
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 100%;
  text-align: center;
  margin-left: 0;
  margin-right: 0;
}

.adventure-view.style-dragonbrew .place-content h4 {
  font-family: var(--adventure-font-heading);
  font-size: 11pt;
  font-weight: 700;
  color: #c4c4c4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
}

/* ============ STYLED BOXES ============ */

/* Decorated Box (Filled/Empty) - Gold decorative lines with diamond endpoints and inline title */
.styled-box[data-box-type="filled"],
.styled-box[data-box-type="empty"],
.styled-box[data-box-type="dialog"] {
  position: relative;
  margin-bottom: 20px;
  margin-left: -6px;
  margin-right: -6px;
}

/* Decorative line structure */
.styled-box .decorative-line {
  display: flex;
  align-items: center;
  height: 10px;
}

.styled-box .diamond-left,
.styled-box .diamond-right {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
}

.styled-box .line-segment {
  flex: 1;
  height: 2px;
  background: var(--adventure-gold);
}

.styled-box .title-banner {
  flex-shrink: 0;
  background: var(--adventure-gold);
  padding: 3px 20px;
  /* Creates a hexagonal/diamond shape with angled corners at left and right */
  clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0% 50%);
}

.styled-box .title-banner span {
  font-family: var(--adventure-font-heading);
  font-size: 9pt;
  font-weight: 700;
  color: var(--adventure-bg-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.styled-box .box-content {
  padding: 16px 12px;
  margin-left: 6px;
  margin-right: 6px;
}

.styled-box[data-box-type="filled"] .box-content {
  background: var(--adventure-box-filled);
}

.styled-box[data-box-type="empty"] .box-content {
  background: var(--adventure-box-empty);
}

.styled-box[data-box-type="dialog"] .box-content {
  background: var(--adventure-box-filled);
}

/* Dialog Box - With speaker name */
.styled-box[data-box-type="dialog"] .speaker-name {
  font-family: var(--adventure-font-heading);
  font-size: 11pt;
  font-weight: 700;
  color: var(--adventure-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.styled-box[data-box-type="dialog"] p {
  font-style: italic;
  margin-bottom: 12px;
  font-size: 10.5pt;
  line-height: 1.5;
}

/* DemonBox (Highlight) - Full gold background with SVG scroll edges */
.styled-box[data-box-type="highlight"] {
  position: relative;
  margin-bottom: 20px;
  margin-left: 6px;  /* Compensate for left spikes */
  margin-right: 6px; /* Compensate for right spikes */
  min-height: 100px;
}

.styled-box[data-box-type="highlight"] .demon-box-svg {
  position: absolute;
  top: 0;
  left: -6px;  /* Allow spikes to extend outside */
  width: calc(100% + 12px);
  height: 100%;
  z-index: 0;
  overflow: visible;
}

.styled-box[data-box-type="highlight"] .box-content {
  position: relative;
  z-index: 1;
  padding: 16px 20px;
  color: var(--adventure-bg-primary);
}

.styled-box[data-box-type="highlight"] .box-title {
  font-family: var(--adventure-font-heading);
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  padding-bottom: 8px;
  color: var(--adventure-bg-primary);
}

.styled-box[data-box-type="highlight"] p {
  font-size: 9.5pt;
  line-height: 1.4;
  margin-bottom: 0.6em;
  color: var(--adventure-bg-primary);
}

.styled-box[data-box-type="highlight"] a {
  color: var(--adventure-bg-primary);
  border-bottom-color: var(--adventure-bg-primary);
  font-weight: 600;
}

/* ============ LAYOUT ============ */
.styled-layout {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.styled-layout[data-layout="two-column"] > .styled-layout-column {
  flex: 1;
  min-width: 0;
}

.styled-layout[data-layout="two-column-uneven"] > .styled-layout-column[data-column="wide"] {
  flex: 2;
  min-width: 0;
}

.styled-layout[data-layout="two-column-uneven"] > .styled-layout-column[data-column="narrow"] {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
}

.styled-layout .styled-box {
  margin-bottom: 0;
}

/* ============ TABLES ============ */
.adventure-view.style-dragonbrew table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5pt;
  margin: 12px 0;
  background: transparent;
  border: none;
}

/* Remove any default borders */
.adventure-view.style-dragonbrew table,
.adventure-view.style-dragonbrew table tr,
.adventure-view.style-dragonbrew table td {
  border: none;
}

/* Keep TH styling for any tables that do have proper headers */
.adventure-view.style-dragonbrew th {
  font-family: var(--adventure-font-heading);
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px;
  text-align: left;
  border: none;
  border-bottom: 2px solid var(--adventure-gold);
  color: var(--adventure-gold);
  background: transparent;
}

/* Base styling for all table cells */
.adventure-view.style-dragonbrew td {
  padding: 10px;
  color: #e0e0e0;
  font-size: 0.95em;
  font-weight: 400;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  vertical-align: top;
  background: transparent;
}

/* First row cells are headers by default (for tables without title row) */
.adventure-view.style-dragonbrew table tr:first-child td {
  color: #c4c4c4;
  font-family: var(--adventure-font-heading);
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

/* EXCEPTION: If first row has only one cell, it's a title (not headers) */
.adventure-view.style-dragonbrew table tr:first-child:has(td:only-child) td {
  color: #e0e0e0;
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 1.1em;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.5em 0;
  border-bottom: 2px solid rgba(212, 175, 55, 0.5);
}

/* Second row is headers only in tables that have a title row */
.adventure-view.style-dragonbrew table tr:first-child:has(td:only-child) + tr td {
  color: var(--adventure-gold);
  font-family: var(--adventure-font-heading);
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

/* Last row should not have bottom border */
.adventure-view.style-dragonbrew table tr:last-child td {
  border-bottom: none;
}

/* Special column types */
.adventure-view.style-dragonbrew td.dice-col,
.adventure-view.style-dragonbrew th.dice-col {
  text-align: center;
  font-family: var(--adventure-font-heading);
  font-weight: 700;
  color: var(--adventure-gold);
  width: 40px;
}

/* ============ ENTITY TABLE ============ */
.styled-entity-table td:nth-child(1) {
  width: 110px;
}

/* ============ ENTITY CARDS ============ */
.styled-entity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-top: 3px solid var(--adventure-gold);
  color: var(--adventure-text-primary);
}

.styled-entity-card[data-entity-card-type="enemy"] {
  background: rgba(180, 60, 60, 0.1);
  border: 1px solid rgba(180, 60, 60, 0.3);
  border-top: 3px solid #b43c3c;
}

.styled-entity-card[data-entity-card-type="npc"] {
  background: rgba(126, 184, 218, 0.1);
  border: 1px solid rgba(126, 184, 218, 0.3);
  border-top: 3px solid var(--adventure-link);
}

.styled-entity-card[data-entity-card-type="item"] {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-top: 3px solid var(--adventure-gold);
}

/* ============ PAGE FOOTER ============ */
.adventure-view.style-dragonbrew .page-footer {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.adventure-view.style-dragonbrew .footer-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--adventure-gold);
  color: var(--adventure-bg-primary);
  padding: 6px 32px 8px;
  clip-path: polygon(12px 0%, calc(100% - 12px) 0%, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0% 50%);
}

.adventure-view.style-dragonbrew .footer-chapter {
  font-family: var(--adventure-font-heading);
  font-size: 8pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.adventure-view.style-dragonbrew .footer-page {
  font-family: var(--adventure-font-heading);
  font-size: 14pt;
  font-weight: 700;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .adventure-view.style-dragonbrew .place-content {
    padding: 20px 20px;
  }

  .styled-layout,
  .styled-layout[data-layout="two-column-uneven"] {
    flex-direction: column;
  }

  .styled-layout[data-layout="two-column-uneven"] > .styled-layout-column[data-column="narrow"] {
    max-width: none;
  }
  
  /* Stack column layouts on smaller screens */
  .content-columns {
    flex-direction: column;
  }
  
  .content-column-right {
    max-width: none;
  }
  
  /* Reset float on smaller screens for better mobile layout */
  .styled-box.float-right,
  .styled-box.float-left,
  .styled-image.float-right,
  .styled-image.float-left {
    float: none;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  .adventure-view.style-dragonbrew .place-content {
    padding: 4px 4px; /* 16px originally */
  }

  .adventure-view.style-dragonbrew .place-header h3 {
    font-size: 24pt;
  }
}

/* ============ FLOAT-BASED LAYOUT FOR SIDEBAR BOXES ============ */
/* Float-based layout allows text to wrap naturally around boxes */
.styled-box.float-right {
    float: right;
    width: 280px;
    max-width: 40%;
    margin-left: 20px;
    margin-bottom: 16px;
    clear: right;
}

.styled-box.float-left {
    float: left;
    width: 280px;
    max-width: 40%;
    margin-right: 20px;
    margin-bottom: 16px;
    clear: left;
}

.styled-image.float-right {
    float: right;
    max-width: 40%;
    margin-left: 20px;
    margin-bottom: 16px;
    clear: right;
}

.styled-image.float-left {
    float: left;
    max-width: 40%;
    margin-right: 20px;
    margin-bottom: 16px;
    clear: left;
}

/* Full-width boxes clear floats */
.styled-box[data-placement="full"],
.styled-box:not([data-placement]) {
    clear: both;
}

.styled-image[data-placement="full"],
.styled-image:not([data-placement]) {
    clear: both;
}

/* Clearfix for adventure content */
.adventure-content::after {
    content: "";
    display: table;
    clear: both;
}

.styled-image {
    max-width: 100%;
    margin: 16px 0;
}

.styled-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* ============ FLOAT CLEARING FOR STRUCTURAL ELEMENTS ============ */
/* Section dividers should always clear floats */
.adventure-section,
.gm-section,
.adventure-view > hr,
.place-content > hr,
.scene-content > hr,
.section-divider {
    clear: both;
}

/* Table of contents should clear floats */
.adventure-toc,
.contents-section {
    clear: both;
}

/* Major section headers should clear floats */
.adventure-view h2,
.place-header,
.scene-header {
    clear: both;
}

/* Ensure bottom decorative line stays inside the box flow */
.styled-box .decorative-line:last-child {
    clear: none;
}

/* ============ TABLE STYLING FOR EDITOR-CREATED TABLES ============ */
/* Tables from the editor use TD elements only, no TH elements */

.adventure-view table,
.adventure-content table,
.formatted-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: transparent;
    border: none;
}

/* Remove any default borders */
.adventure-view table,
.adventure-view table tr,
.adventure-view table td,
.adventure-content table,
.adventure-content table tr,
.adventure-content table td,
.formatted-content table,
.formatted-content table tr,
.formatted-content table td {
    border: none;
}

/* Base styling for all table cells */
.adventure-view table td,
.adventure-content table td,
.formatted-content table td {
    color: #e0e0e0;
    font-size: 0.95em;
    font-weight: 400;
    text-align: left;
    padding: 0.75em 1em;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    background: transparent;
    vertical-align: top;
}

/* First row cells are headers by default (for tables without title row) */
.adventure-view table tr:first-child td,
.adventure-content table tr:first-child td,
.formatted-content table tr:first-child td {
    color: #d4af37;
    font-family: 'Colus', 'Cinzel', Georgia, serif;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

/* EXCEPTION: If first row has only one cell, it's a title (not headers) */
.adventure-view table tr:first-child:has(td:only-child) td,
.adventure-content table tr:first-child:has(td:only-child) td,
.formatted-content table tr:first-child:has(td:only-child) td {
    color: #e0e0e0;
    font-family: "Crimson Pro", Georgia, serif;
    font-size: 1.1em;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    padding: 0.5em 0;
    border-bottom: 2px solid rgba(212, 175, 55, 0.5);
}

/* Second row is headers only in tables that have a title row */
.adventure-view table tr:first-child:has(td:only-child) + tr td,
.adventure-content table tr:first-child:has(td:only-child) + tr td,
.formatted-content table tr:first-child:has(td:only-child) + tr td {
    color: #d4af37;
    font-family: 'Colus', 'Cinzel', Georgia, serif;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75em 1em;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

/* Last row should not have bottom border */
.adventure-view table tr:last-child td,
.adventure-content table tr:last-child td,
.formatted-content table tr:last-child td {
    border-bottom: none;
}

/* Links in tables */
.adventure-view table a,
.adventure-content table a,
.formatted-content table a {
    color: #d4af37;
    text-decoration: none;
}

.adventure-view table a:hover,
.adventure-content table a:hover,
.formatted-content table a:hover {
    text-decoration: underline;
}

/* Also keep TH styling for any tables that do have proper headers */
.adventure-view table th,
.adventure-content table th,
.formatted-content table th {
    color: #d4af37;
    font-family: 'Colus', 'Cinzel', Georgia, serif;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
    padding: 0.75em 1em;
    border: none;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
    background: transparent;
}

/* ============ TABLE BODY STANDARD CLASS ============ */
/* Override first-row styling for tables that should use body text throughout */
.table-body-standard tr:first-child td,
.table-body-standard.styled-entity-table tr:first-child td,
.adventure-view .table-body-standard tr:first-child td,
.adventure-content .table-body-standard tr:first-child td,
.formatted-content .table-body-standard tr:first-child td {
    color: #e0e0e0 !important;
    font-family: "Crimson Pro", Georgia, serif !important;
    font-size: 0.95em !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15) !important;
}

/* Ensure all rows in table-body-standard use body font */
.table-body-standard td,
.adventure-view .table-body-standard td,
.adventure-content .table-body-standard td,
.formatted-content .table-body-standard td {
    font-family: "Crimson Pro", Georgia, serif !important;
    font-size: 0.95em !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* ============ LEGACY COLUMN LAYOUT (kept for backwards compatibility) ============ */
/* Note: New content uses float-based layout above */
.content-columns {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.content-column-left {
    flex: 2;
    min-width: 0;
}

.content-column-right {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.content-column-right .styled-box {
    margin-bottom: 16px;
}

.content-column-right .styled-box:last-child {
    margin-bottom: 0;
}

/* Note: Responsive stacking for .content-columns is handled in @media (max-width: 900px) above */

/* ============ EDITOR-SCOPED STYLES ============ */
/* These styles make layouts and boxes render properly in the Quill editor */

/* ============ LAYOUT MODAL STYLES ============ */
.layout-column-editor {
    background: var(--adventure-bg-primary, #1a1a1f);
}

.layout-column-editor .ql-toolbar {
    border-color: var(--border-default, #333);
    background: var(--adventure-bg-secondary, #141418);
}

.layout-column-editor .ql-container {
    border-color: var(--border-default, #333);
}

.layout-column-editor .ql-editor {
    min-height: 200px;
    color: var(--adventure-text-primary, #e0e0e0);
}

.layout-column-editor .ql-editor.ql-blank::before {
    color: var(--adventure-text-muted, #888);
    font-style: italic;
}

/* Editor Layout Preview - show as clickable block */
.ql-editor .styled-layout {
  display: flex !important;
  flex-direction: row !important;
  gap: 16px !important;
  margin: 16px 0 !important;
  padding: 12px !important;
  min-height: 80px !important;
  border: 2px dashed rgba(212, 175, 55, 0.4) !important;
  background: rgba(212, 175, 55, 0.05) !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

.ql-editor .styled-layout:hover {
  border-color: rgba(212, 175, 55, 0.7) !important;
  background: rgba(212, 175, 55, 0.1) !important;
}

.ql-editor .styled-layout-column {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 8px !important;
  border: 1px solid rgba(212, 175, 55, 0.2) !important;
  border-radius: 2px !important;
  background: rgba(26, 26, 31, 0.3) !important;
}

.ql-editor .styled-layout[data-layout="two-column-uneven"] > .styled-layout-column[data-column="wide"] {
  flex: 2 !important;
}

.ql-editor .styled-layout[data-layout="two-column-uneven"] > .styled-layout-column[data-column="narrow"] {
  flex: 1 !important;
}

/* Visual indicator showing column type */
.ql-editor .styled-layout-column::before {
  content: attr(data-column);
  display: block !important;
  font-size: 9px !important;
  color: #d4af37 !important;
  opacity: 0.7 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-bottom: 4px !important;
  padding-bottom: 4px !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
}

.ql-editor .styled-layout-column p {
  margin: 0 !important;
  color: #888 !important;
}

/* Editor Box Styles - mirror render view with decorative lines and backgrounds */
.ql-editor .styled-box {
  position: relative;
  margin-bottom: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 12px;
  min-height: 60px;
}

/* Settings button for styled boxes in editor */
.ql-editor .styled-box {
  position: relative;
  margin-bottom: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 12px;
  min-height: 60px;
}

.ql-editor .styled-box-settings {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: rgba(30, 30, 30, 0.9);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  z-index: 100;
  /* Ensure it's not editable and clickable */
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.ql-editor .styled-image-settings {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(126, 184, 218, 0.6);
  background: rgba(20, 30, 40, 0.9);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  z-index: 100;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.ql-editor .styled-image-settings:hover {
  opacity: 1;
  background: rgba(126, 184, 218, 0.3);
  border-color: rgba(126, 184, 218, 0.8);
}

.ql-editor .styled-image:hover .styled-image-settings {
  opacity: 1;
}

/* Editor preview for styled images */
.ql-editor .styled-image {
    position: relative;
    margin: 16px 0;
    border: 2px dashed rgba(126, 184, 218, 0.4);
    padding: 4px;
    border-radius: 4px;
}

.ql-editor .styled-image:hover {
    border-color: rgba(126, 184, 218, 0.7);
}

.ql-editor .styled-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.ql-editor .styled-image[data-placement="left"]::after {
    content: "◀ VÄNSTER";
    position: absolute;
    bottom: 4px;
    left: 8px;
    font-size: 9px;
    color: rgba(126, 184, 218, 0.8);
    letter-spacing: 0.05em;
}

.ql-editor .styled-image[data-placement="right"]::after {
    content: "HÖGER ▶";
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 9px;
    color: rgba(126, 184, 218, 0.8);
    letter-spacing: 0.05em;
}

.ql-editor .styled-box-settings:hover {
  opacity: 1;
  background: rgba(212, 175, 55, 0.3);
  border-color: rgba(212, 175, 55, 0.8);
}

.ql-editor .styled-box:hover .styled-box-settings {
  opacity: 1;
}

/* Show box type indicator */
.ql-editor .styled-box::before {
  content: attr(data-box-type) " (" attr(data-title) attr(data-speaker) ")";
  display: block;
  font-family: var(--adventure-font-heading), "Colus", Georgia, serif;
  font-size: 8pt;
  font-weight: 700;
  color: var(--adventure-gold, #d4af37);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

/* Background for filled boxes */
.ql-editor .styled-box[data-box-type="filled"] {
  background: linear-gradient(180deg, rgba(45, 38, 32, 0.3) 0%, rgba(35, 30, 25, 0.4) 100%);
}

/* Background for empty boxes */
.ql-editor .styled-box[data-box-type="empty"] {
  background: transparent;
}

/* Background for highlight boxes */
.ql-editor .styled-box[data-box-type="highlight"] {
  background: rgba(212, 175, 55, 0.2);
}

/* Background for dialog boxes */
.ql-editor .styled-box[data-box-type="dialog"] {
  background: linear-gradient(180deg, rgba(45, 38, 32, 0.3) 0%, rgba(35, 30, 25, 0.4) 100%);
}

/* Show speaker name for dialog boxes */
.ql-editor .styled-box[data-box-type="dialog"][data-speaker]::before {
  content: "DIALOG: " attr(data-speaker);
}

/* Show title for non-dialog boxes */
.ql-editor .styled-box[data-box-type="filled"][data-title]::before,
.ql-editor .styled-box[data-box-type="empty"][data-title]::before,
.ql-editor .styled-box[data-box-type="highlight"][data-title]::before {
  content: attr(data-box-type) ": " attr(data-title);
}

/* Editor placement indicators */
.ql-editor .styled-box[data-placement="left"] {
    border-left: 3px solid var(--adventure-gold, #d4af37) !important;
}

.ql-editor .styled-box[data-placement="left"]::after {
    content: "◀ VÄNSTER";
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 9px;
    color: var(--adventure-gold, #d4af37);
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.ql-editor .styled-box[data-placement="right"] {
    border-right: 3px solid var(--adventure-gold, #d4af37) !important;
}

.ql-editor .styled-box[data-placement="right"]::after {
    content: "HÖGER ▶";
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 9px;
    color: var(--adventure-gold, #d4af37);
    opacity: 0.8;
    letter-spacing: 0.05em;
}
/*TEMP EDIT*/
